Quantcast

hide frame button by default

Kevin Gilbert [08-29-16 - 19:04]
hide frame button by default
Filename
ArtifactMenu.lua
diff --git a/ArtifactMenu.lua b/ArtifactMenu.lua
index f30bfed..2bc8fa3 100644
--- a/ArtifactMenu.lua
+++ b/ArtifactMenu.lua
@@ -19,7 +19,7 @@ end
 function ArtifactMenuFrame:SetupFrame()
     self:UnregisterEvent("ADDON_LOADED")
     --Frame
-    self:SetWidth(32)
+    self:SetWidth(320)
     self:SetHeight(32)
     self:SetPoint("CENTER",32,0)
     self:EnableMouse(true)
@@ -45,7 +45,7 @@ function ArtifactMenuFrame:SetupFrame()
     self.rightGradiant:SetGradientAlpha("Horizontal", 0, 0, 0, 1, 0, 0, 0, 0.2)
     self.text = self:CreateFontString(nil, "ARTWORK", "GameFontWhite")
     self.text:SetJustifyH("CENTER")
-    self.text:SetText("0")
+    self.text:SetText("Open Artifact Menu")
     self.text:SetWidth(40)
     self.text:SetHeight(14)
     self.text:SetPoint("CENTER", 0, -5)
@@ -53,14 +53,13 @@ function ArtifactMenuFrame:SetupFrame()
     self.menu = CreateFrame("Frame","ArtifactMenuFrameMenu", self, "UIDropDownMenuTemplate", 1)
     self.menuOnLoad = menuOnLoad
     UIDropDownMenu_Initialize(self.menu, self.menuOnLoad, "MENU")
+    self:HideFrame();
     self:SetScript("OnClick",
         function(s,button,down)
             s:OnClick(button,down)
         end)
     self.dataBroker = ldb:NewDataObject("ArtifactMenu", {
         type = "data source",
-        text = "",
-        value = "",
         label = "ArtifactMenu",
         OnClick = function (clickedframe, button, down)
             ArtifactMenuFrame:OnClick(button, down, clickedframe)
@@ -77,6 +76,16 @@ function ArtifactMenuFrame:OnClick(button, down, anchorFrame)
     end
 end

+function ArtifactMenuFrame:ShowFrame()
+    self:SetAlpha(100)
+    self:EnableMouse(true)
+end
+
+function ArtifactMenuFrame:HideFrame()
+    self:SetAlpha(0)
+    self:EnableMouse(false)
+end
+
 function openArtifactMenu()
     -- http://wowprogramming.com/docs/api_types#itemQuality
     local QUALITY = {}