Quantcast

Add spellbook tab to toggle Clique UI

James Whitehead II [10-09-10 - 14:11]
Add spellbook tab to toggle Clique UI
Filename
BindConfig.lua
Clique.lua
Clique.xml
mousesquare128.tga
mousesquare64.tga
diff --git a/BindConfig.lua b/BindConfig.lua
index cb82a20..96662db 100755
--- a/BindConfig.lua
+++ b/BindConfig.lua
@@ -10,10 +10,14 @@ function CliqueConfig:OnShow()
         self.initialized = true
     end

+    CliqueSpellTab:SetChecked(true)
     self:UpdateList()
     self:EnableSpellbookButtons()
 end

+function CliqueConfig:OnHide()
+    CliqueSpellTab:SetChecked(false)
+end

 function CliqueConfig:SetupGUI()
     self.rows = {}
@@ -31,7 +35,6 @@ function CliqueConfig:SetupGUI()
         self.rows[i]:SetPoint("RIGHT", CliqueConfigPage1Column2, "RIGHT", 0, 0)
     end

-    -- Set text elements using localized values
     _G[self:GetName() .. "TitleText"]:SetText(L["Clique Binding Configuration"])

     self.dialog = _G["CliqueDialog"]
diff --git a/Clique.lua b/Clique.lua
index 9b01f2e..7cdec72 100755
--- a/Clique.lua
+++ b/Clique.lua
@@ -137,6 +137,9 @@ function addon:Enable()
         pushable = 1,
         whileDead = 1,
     }
+
+    -- Set the tooltip for the spellbook tab
+    CliqueSpellTab.tooltip = L["Clique binding configuration"]
 end

 function addon:InitializeDatabase()
diff --git a/Clique.xml b/Clique.xml
index 5dc5d74..fbd0a44 100755
--- a/Clique.xml
+++ b/Clique.xml
@@ -122,6 +122,29 @@
         <HighlightTexture file="Interface\BUTTONS\ButtonHilight-Square" alphaMode="ADD"/>
     </Button>

+    <CheckButton name="CliqueSpellTab" inherits="SpellBookSkillLineTabTemplate" parent="SpellBookFrame" hidden="false">
+        <Scripts>
+            <OnClick>
+                if CliqueConfig:IsVisible() then
+                    HideUIPanel(CliqueConfig)
+                else
+                    ShowUIPanel(CliqueConfig)
+                end
+            </OnClick>
+            <OnShow>
+                if CliqueConfig:IsVisible() then
+                    self:SetChecked(true)
+                end
+
+                local num = GetNumSpellTabs()
+                self:ClearAllPoints()
+                local lastTab = _G["SpellBookSkillLineTab" .. num]
+                self:SetPoint("TOPLEFT", lastTab, "BOTTOMLEFT", 0, -17)
+            </OnShow>
+        </Scripts>
+        <NormalTexture file="Interface\AddOns\Clique\mousesquare64"/>
+    </CheckButton>
+
     <Frame name="CliqueDialog" toplevel="true" enableMouse="true" movable="true" inherits="BasicFrameTemplate" parent="UIParent" frameStrata="DIALOG" hidden="true">
         <Size x="350" y="160"/>
         <Anchors>
@@ -484,6 +507,9 @@
             <OnShow>
                 CliqueConfig:OnShow()
             </OnShow>
+            <OnHide>
+                CliqueConfig:OnHide()
+            </OnHide>
         </Scripts>
     </Frame> <!-- CliqueConfig -->
 </Ui>
diff --git a/mousesquare128.tga b/mousesquare128.tga
deleted file mode 100644
index 7e210d3..0000000
Binary files a/mousesquare128.tga and /dev/null differ
diff --git a/mousesquare64.tga b/mousesquare64.tga
new file mode 100644
index 0000000..68c9603
Binary files /dev/null and b/mousesquare64.tga differ