Quantcast

Added a Game Menu button for easy access.

Safturento [10-28-11 - 07:33]
Added a Game Menu button for easy access.
Filename
stAddonManager/stAddonManager.lua
stAddonManager/stAddonManager.toc
diff --git a/stAddonManager/stAddonManager.lua b/stAddonManager/stAddonManager.lua
index 9f5b69f..739abf7 100644
--- a/stAddonManager/stAddonManager.lua
+++ b/stAddonManager/stAddonManager.lua
@@ -19,6 +19,7 @@ local backdrop = {
 -- INITIAL FRAME CREATION ----------------------------
 ------------------------------------------------------
 stAddonManager = CreateFrame("Frame", "stAddonManager", UIParent)
+stAddonManager:SetFrameStrata("HIGH")
 stAddonManager.header = CreateFrame("Frame", "stAddonmanager_Header", stAddonManager)

 stAddonManager.header:SetPoint("CENTER", UIParent, "CENTER", 0, 50)
@@ -322,4 +323,28 @@ local function LoadWindow()
 end

 SLASH_STADDONMANAGER1, SLASH_STADDONMANAGER2, SLASH_STADDONMANAGER3 = "/staddonmanager", "/stam", "/staddon"
-SlashCmdList["STADDONMANAGER"] = LoadWindow
\ No newline at end of file
+SlashCmdList["STADDONMANAGER"] = LoadWindow
+
+local gmbAddOns = CreateFrame("Button", "GameMenuButtonAddOns", GameMenuFrame, "GameMenuButtonTemplate")
+gmbAddOns:SetSize(GameMenuButtonMacros:GetWidth(), GameMenuButtonMacros:GetHeight())
+GameMenuFrame:SetHeight(GameMenuFrame:GetHeight()+GameMenuButtonMacros:GetHeight());
+GameMenuButtonLogout:SetPoint("TOP", gmbAddOns, "BOTTOM", 0, -1)
+gmbAddOns:SetPoint("TOP", GameMenuButtonMacros, "BOTTOM", 0, -1)
+gmbAddOns:SetText("|cff00aaffst|rAddonManager")
+gmbAddOns:SetScript("OnClick", function()
+	HideUIPanel(GameMenuFrame);
+	LoadWindow()
+end)
+
+gmbAddOns:RegisterEvent("ADDON_LOADED")
+gmbAddOns:RegisterEvent("PLAYER_ENTERING_WORLD")
+gmbAddOns:SetScript("OnEvent", function(self, event, addon)
+	if (event == "PLAYER_ENTERING_WORLD" and IsAddOnLoaded("Tukui")) or (event == "ADDON_LOADED" and addon == "Tukui") then
+		local T, C, L = unpack(Tukui)
+		T.SkinButton(gmbAddOns)
+		local font = {GameMenuButtonMacros:GetFontString():GetFont()}
+		local shadow = {GameMenuButtonMacros:GetFontString():GetShadowOffset()}
+		gmbAddOns:GetFontString():SetFont(unpack(font))
+		gmbAddOns:GetFontString():SetShadowOffset(unpack(shadow))
+	end
+end)
\ No newline at end of file
diff --git a/stAddonManager/stAddonManager.toc b/stAddonManager/stAddonManager.toc
index 9091d8d..1aeb330 100644
--- a/stAddonManager/stAddonManager.toc
+++ b/stAddonManager/stAddonManager.toc
@@ -1,6 +1,6 @@
 ## Interface: 40200
 ## Author: Safturento
-## Version: 1.0.3
+## Version: @project-version@
 ## Title: |cff00aaffst|rAddonManager
 ## Notes: A simple and minimalistic addon to disable/enabled addons without logging out.