From cbd1a8671710771c8ab059de80b123a9544ddfb8 Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Thu, 15 Nov 2007 21:53:52 +0000 Subject: [PATCH] * Fixed an issue relating to Polymorph (Rank 1: Pig) and the way the rank text was changed. The system should now work for any ranks, numeric or not. * Renamed the "Options" button to "Frames" --- Clique.lua | 21 +++++++++++++++------ CliqueOptions.lua | 11 ++++++++--- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/Clique.lua b/Clique.lua index 90511cd..b44fd58 100644 --- a/Clique.lua +++ b/Clique.lua @@ -148,13 +148,10 @@ function Clique:SpellBookButtonPressed(frame, button) local id = SpellBook_GetSpellID(this:GetParent():GetID()); local texture = GetSpellTexture(id, SpellBookFrame.bookType) local name, rank = GetSpellName(id, SpellBookFrame.bookType) - + if rank == L.RACIAL_PASSIVE or rank == L.PASSIVE then StaticPopup_Show("CLIQUE_PASSIVE_SKILL") return - else - local num = rank:match("(%d+)") or "" - rank = tonumber(num) end local type = "spell" @@ -411,8 +408,20 @@ function Clique:SetAttribute(entry, frame) frame:SetAttribute(entry.modifier.."unit"..button, entry.arg2) end elseif entry.type == "spell" then - local rank = tonumber(entry.arg2) - local cast = string.format(rank and L.CAST_FORMAT or "%s", entry.arg1, rank) + local rank = entry.arg2 + local cast + if rank then + if tonumber(rank) then + -- The rank is a number (pre-2.3) so fill in the format + cast = L.CAST_FORMAT:format(entry.arg1, rank) + else + -- The whole rank string is saved (post-2.3) so use it + cast = string.format("%s(%s)", entry.arg1, rank) + end + else + cast = entry.arg1 + end + frame:SetAttribute(entry.modifier.."type"..button, entry.type) frame:SetAttribute(entry.modifier.."spell"..button, cast) diff --git a/CliqueOptions.lua b/CliqueOptions.lua index 2b85770..c698235 100644 --- a/CliqueOptions.lua +++ b/CliqueOptions.lua @@ -458,7 +458,7 @@ function Clique:CreateOptionsFrame() local button = CreateFrame("Button", "CliqueButtonOptions", CliqueFrame, "UIPanelButtonGrayTemplate") button:SetHeight(24) button:SetWidth(60) - button:SetText("Options") + button:SetText("Frames") button:SetPoint("LEFT", CliqueButtonCustom, "RIGHT", 3, 0) button:SetScript("OnClick", buttonFunc) @@ -992,7 +992,12 @@ end function Clique:FillListEntry(frame, idx) local entry = self.sortList[idx] - local rank = string.format(" (Rank %d)", entry.rank or 0) + if tonumber(entry.arg2) then + rank = string.format("Rank %d", entry.arg2) + elseif entry.arg2 then + rank = entry.arg2 + end + local type = string.format("%s%s", string.upper(string.sub(entry.type, 1, 1)), string.sub(entry.type, 2)) local button = tonumber(string.sub(entry.button, -1, -1)) @@ -1008,7 +1013,7 @@ function Clique:FillListEntry(frame, idx) frame.name:SetText(string.format("Pet Action %d%s", entry.arg1, entry.arg2 and " on "..entry.arg2 or "")) elseif entry.type == "spell" then if entry.arg2 then - frame.name:SetText(string.format("%s (%s %d)%s", entry.arg1, L.RANK, entry.arg2, + frame.name:SetText(string.format("%s (%s)%s", entry.arg1, rank, entry.arg5 and " on "..entry.arg5 or "")) else frame.name:SetText(string.format("%s%s", entry.arg1, entry.arg5 and " on "..entry.arg5 or "")) -- 1.7.9.5