Quantcast

Add an 'ooh-shiny' box when spellbook/clique are both open

James Whitehead II [10-13-10 - 13:47]
Add an 'ooh-shiny' box when spellbook/clique are both open
Filename
BindConfig.lua
Clique.xml
diff --git a/BindConfig.lua b/BindConfig.lua
index 701c41b..3728832 100755
--- a/BindConfig.lua
+++ b/BindConfig.lua
@@ -20,6 +20,7 @@ function CliqueConfig:OnShow()
     CliqueSpellTab:SetChecked(true)
     self:UpdateList()
     self:EnableSpellbookButtons()
+    self:UpdateAlert()
 end

 function CliqueConfig:OnHide()
@@ -27,6 +28,7 @@ function CliqueConfig:OnHide()
     self:SetParent(UIParent)
     self:Hide()
     CliqueSpellTab:SetChecked(false)
+    self:UpdateAlert()
 end

 function CliqueConfig:SetupGUI()
@@ -60,6 +62,13 @@ function CliqueConfig:SetupGUI()
     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.alert = _G["CliqueTabAlert"]
+
+    self.close = _G[self:GetName() .. "CloseButton"]
+    self.close:SetScript("OnClick", function()
+        HideUIPanel(CliqueConfig)
+    end)
+
     self.page1.column1:SetText(L["Action"])
     self.page1.column2:SetText(L["Binding"])

@@ -517,3 +526,14 @@ function CliqueConfig:SpellTab_OnClick(frame)
         ShowUIPanel(CliqueConfig)
     end
 end
+
+function CliqueConfig:UpdateAlert(type)
+    local alert = CliqueTabAlert
+    if not addon.settings.alerthidden and SpellBookFrame:IsVisible() and CliqueConfig:IsVisible() then
+        alert.type = type
+        alert.text:SetText(L["When both the Clique binding configuration window and the spellbook are open, you can set new bindings simply by performing them on the spell icon in your spellbook. Simply move your mouse over a spell and then click or press a key on your keyboard along with any combination of the alt, control, and shift keys. The new binding will be added to your binding configuration."])
+        alert:Show()
+    else
+        alert:Hide()
+    end
+end
diff --git a/Clique.xml b/Clique.xml
index 59c0f33..895a039 100755
--- a/Clique.xml
+++ b/Clique.xml
@@ -141,6 +141,59 @@
         <NormalTexture file="Interface\AddOns\Clique\images\icon_square_64"/>
     </CheckButton>

+    <Frame name="CliqueTabAlert" parentKey="alert" inherits="GlowBoxTemplate" parent="SpellBookFrame" enableMouse="true" hidden="true" frameStrata="DIALOG" framelevel="2">
+        <Size x="220" y="100"/>
+        <Anchors>
+            <Anchor point="LEFT" relativeTo="CliqueSpellTab" relativePoint="RIGHT" x="20" y="0"/>
+        </Anchors>
+        <Layers>
+            <Layer level="OVERLAY">
+                <FontString name="$parentText" parentKey="text" inherits="GameFontHighlightLeft" justifyV="TOP" text="TALENT_MICRO_BUTTON_TUTORIAL" >
+                    <Size x="188" y="0"/>
+                    <Anchors>
+                        <Anchor point="TOPLEFT" x="16" y="-24"/>
+                    </Anchors>
+                </FontString>
+            </Layer>
+        </Layers>
+        <Frames>
+            <Button name="$parentClose" parentKey="close" inherits="UIPanelCloseButton">
+                <Anchors>
+                    <Anchor point="TOPRIGHT" x="6" y="6"/>
+                </Anchors>
+                <Scripts>
+                    <OnClick>
+                        Clique.settings.alerthidden = true
+                        CliqueTabAlert:Hide();
+                    </OnClick>
+                </Scripts>
+            </Button>
+            <Frame name="$parentArrow" parentKey="arrow" inherits="GlowBoxArrowTemplate">
+                <Anchors>
+                    <Anchor point="RIGHT" relativePoint="LEFT" x="0" y="0"/>
+                </Anchors>
+            </Frame>
+        </Frames>
+        <Scripts>
+            <OnLoad>
+                self.arrow:SetSize(21, 53)
+                self.arrow.arrow = _G[self.arrow:GetName() .. "Arrow"]
+                self.arrow.glow = _G[self.arrow:GetName() .. "Glow"]
+                self.arrow.arrow:SetAllPoints(true)
+                self.arrow.glow:SetAllPoints(true)
+                -- Rotate 90 degrees
+                -- left, bottom, right, bottom, left, top, right, top
+                self.arrow.arrow:SetTexCoord(0.78515625, 0.58789063, 0.99218750, 0.58789063, 0.78515625, 0.54687500, 0.99218750, 0.54687500)
+                self.arrow.glow:SetTexCoord(0.40625000, 0.82812500, 0.66015625, 0.82812500, 0.40625000, 0.77343750, 0.66015625, 0.77343750)
+                self.text:SetSpacing(4)
+
+            </OnLoad>
+            <OnShow>
+                self:SetHeight(self.text:GetHeight() + 42)
+            </OnShow>
+        </Scripts>
+    </Frame>
+
     <Frame name="CliqueDialog" toplevel="true" enableMouse="true" movable="true" inherits="BasicFrameTemplate" parent="UIParent" frameStrata="DIALOG" hidden="true">
         <Size x="350" y="160"/>
         <Anchors>