From a736e5d744d783cb018c30d64622e8cb6dce04cd Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Sun, 3 Oct 2010 20:21:18 +0100 Subject: [PATCH] Continued revmap of Clique user interface --- Clique.xml | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++--- CliqueOptions.lua | 59 +++++++++++++++++++++++++++++++++++++---- CliqueUtils.lua | 2 +- 3 files changed, 127 insertions(+), 10 deletions(-) diff --git a/Clique.xml b/Clique.xml index 384ad93..0a6c4f7 100755 --- a/Clique.xml +++ b/Clique.xml @@ -115,6 +115,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -124,6 +161,9 @@ + + + @@ -225,10 +265,36 @@ - - + + + + + + + + - + CliqueConfigPortrait:SetTexture("Interface\\FriendsFrame\\FriendsFrameScrollIcon"); CliqueConfig.page1:SetParent(CliqueConfig.Inset) CliqueConfig.page2:SetParent(CliqueConfig.Inset) + CliqueConfig.page3:SetParent(CliqueConfig.Inset) CliqueConfig.page1:SetAllPoints(CliqueConfig.Inset) CliqueConfig.page2:SetAllPoints(CliqueConfig.Inset) + CliqueConfig.page3:SetAllPoints(CliqueConfig.Inset) CliqueConfig:OnShow() diff --git a/CliqueOptions.lua b/CliqueOptions.lua index f8c5e90..3709e9d 100755 --- a/CliqueOptions.lua +++ b/CliqueOptions.lua @@ -33,6 +33,18 @@ function CliqueConfig:SetupGUI() -- Set text elements using localized values _G[self:GetName() .. "TitleText"]:SetText(L["Clique Configuration"]) + + self.dialog = _G["CliqueDialog"] + self.dialog.title = _G["CliqueDialogTitleText"] + + self.dialog.title:SetText(L["Clique: Set binding"]) + self.dialog.button_accept:SetText(L["Accept"]) + self.dialog.bindText:SetText(L["Alt-Control-Shift-F"]) + + self.dialog.button_binding:SetText(L["Set binding"]) + local desc = L["In order to specify a binding, move your mouse over the button labelled 'Set binding' and either click with your mouse or press a key on your keyboard. You can modify the binding by holding down a combination of the alt, control and shift keys on your keyboard."] + self.dialog.desc:SetText(desc) + self.page1.column1:SetText(L["Action"]) self.page1.column2:SetText(L["Binding"]) @@ -44,10 +56,14 @@ function CliqueConfig:SetupGUI() self.page1.button_spell:SetText(L["Bind spell"]) self.page1.button_other:SetText(L["Bind other"]) self.page1.button_edit:SetText(L["Edit"]) - + self.page2.button_save:SetText(L["Save"]) self.page2.button_cancel:SetText(L["Cancel"]) + self.page3.button_save:SetText(L["Save"]) + self.page3.button_cancel:SetText(L["Cancel"]) + + self.page1:Show() end @@ -175,11 +191,44 @@ function CliqueConfig:Button_OnClick(button) -- Click handler for "Bind other" button elseif button == self.page1.button_other then - self.page1:Hide() - self.page2:Show() + local config = CliqueConfig + local menu = { + { + text = L["Select a binding type"], + isTitle = true + }, + { + text = L["Target clicked unit"], + func = function() + config.page1:Hide() + config.page2.bindType = "target" + config.page2:Show() + end, + }, + { + text = L["Open unit menu"], + func = function() + config.page1:Hide() + config.page2.bindType = "menu" + config.page2:Show() + end, + }, + { + text = L["Run custom macro"], + func = function() + config.page1:Hide() + config.page3:Show() + end, + }, + } + UIDropDownMenu_SetAnchor(self.dropdown, 0, 0, "BOTTOMLEFT", self.page1.button_other, "TOP") + EasyMenu(menu, self.dropdown, nil, 0, 0, nil, nil) -- Click handler for "Edit" button elseif button == self.page1.button_edit then + elseif button == self.page3.button_cancel then + self.page3:Hide() + self.page1:Show() elseif button == self.page2.button_cancel then self.page2:Hide() self.page1:Show() @@ -290,7 +339,7 @@ end function CliqueConfig:ShowEditPage() self:ClearEditPage() self.page1:Hide() - self.page2:Show() + self.page3:Show() end function CliqueConfig:Save_OnClick(button, button, down) @@ -298,7 +347,7 @@ end function CliqueConfig:Cancel_OnClick(button, button, down) self:ClearEditPage() - self.page2:Hide() + self.page3:Hide() self.page1:Show() end diff --git a/CliqueUtils.lua b/CliqueUtils.lua index 775dc3c..e7b29ac 100644 --- a/CliqueUtils.lua +++ b/CliqueUtils.lua @@ -95,7 +95,7 @@ function addon:GetBindingActionText(binding) if btype == "menu" then return L["Show unit menu"] elseif btype == "target" then - return L["Target '%s' unit"]:format(binding.unit) + return L["Target clicked unit"] elseif btype == "spell" then if binding.rank then return L["Cast %s (Rank %d)"]:format(binding.spell, binding.rank) -- 1.7.9.5