From 987cce625d0d05d1237ace82cb858c83f6f3aaae Mon Sep 17 00:00:00 2001 From: Steven Jackson Date: Sun, 4 Jan 2015 18:38:42 -0600 Subject: [PATCH] 5.4.153 --- .../AddOns/SVUI/framework/api/api_general.lua | 27 ++++ .../SVUI/framework/widgets/widget_superbutton.lua | 18 +-- Interface/AddOns/SVUI_StyleOMatic/Loader.lua | 2 +- .../AddOns/SVUI_StyleOMatic/components/_load.xml | 1 + .../components/addons/MasterPlan.lua | 23 ++++ .../SVUI_StyleOMatic/components/addons/_load.xml | 2 +- .../SVUI_StyleOMatic/components/atlas/_load.xml | 3 + .../SVUI_StyleOMatic/components/atlas/garrison.lua | 130 ++++++++++++++++++++ .../SVUI_StyleOMatic/components/blizzard/alert.lua | 13 ++ .../components/blizzard/garrison.lua | 99 +++++++++++---- 10 files changed, 284 insertions(+), 34 deletions(-) create mode 100644 Interface/AddOns/SVUI_StyleOMatic/components/atlas/_load.xml create mode 100644 Interface/AddOns/SVUI_StyleOMatic/components/atlas/garrison.lua diff --git a/Interface/AddOns/SVUI/framework/api/api_general.lua b/Interface/AddOns/SVUI/framework/api/api_general.lua index f5de5f3..d561d57 100644 --- a/Interface/AddOns/SVUI/framework/api/api_general.lua +++ b/Interface/AddOns/SVUI/framework/api/api_general.lua @@ -363,6 +363,30 @@ local SecureFadeCallback = function(self, callback) end --[[ ########################################################## +HOOKED ATLAS HIJACKER +########################################################## +]]-- +-- For the atlas listeners we will unfortunately need a few global objects +_G.ATLAS_THIEF = {} -- Wasn't this the name of a movie? +_G.ATLAS_HACKS = {} -- Couldn't think of anything clever honestly. +_G.ATLAS_HACKS["default"] = function(self) + self:SetTexture("") +end + +local StealAtlas = function(self, atlas) + if(not self or not atlas) then return end + local hack = ATLAS_THIEF[atlas]; + if(hack) then + local fn = ATLAS_HACKS[hack] or ATLAS_HACKS["default"] + local pass, catch = pcall(fn, self, atlas) + if(catch) then + SV:Debugger(catch) + return + end + end +end +--[[ +########################################################## ENUMERATION ########################################################## ]]-- @@ -380,6 +404,9 @@ local function AppendMethods(OBJECT) if not OBJECT.FadeIn then META.FadeIn = SecureFadeIn end if not OBJECT.FadeOut then META.FadeOut = SecureFadeOut end if not OBJECT.FadeCallback then META.FadeCallback = SecureFadeCallback end + if(OBJECT.SetAtlas) then + hooksecurefunc(META, "SetAtlas", StealAtlas) + end end local HANDLER, OBJECT = {["Frame"] = true}, CreateFrame("Frame") diff --git a/Interface/AddOns/SVUI/framework/widgets/widget_superbutton.lua b/Interface/AddOns/SVUI/framework/widgets/widget_superbutton.lua index ce68ada..afa452a 100644 --- a/Interface/AddOns/SVUI/framework/widgets/widget_superbutton.lua +++ b/Interface/AddOns/SVUI/framework/widgets/widget_superbutton.lua @@ -221,7 +221,7 @@ local SetSuperButtonAction = function(self, action) end local HotKey = self.HotKey - local key = GetBindingKey(self.___binding) + local key = GetBindingKey(self.___binding ~= nil) if(key) then HotKey:SetText(GetBindingText(key, 1)) HotKey:Show() @@ -309,7 +309,7 @@ local SetSuperButtonSpell = function(self, spellID, spellName, texture) end local HotKey = self.HotKey - local key = GetBindingKey(self.___binding) + local key = GetBindingKey(self.___binding ~= nil) if(key) then HotKey:SetText(GetBindingText(key, 1)) HotKey:Show() @@ -397,7 +397,7 @@ local SetSuperButtonItem = function(self, itemLink, texture) end local HotKey = self.HotKey - local key = GetBindingKey(self.___binding) + local key = GetBindingKey(self.___binding ~= nil) if(key) then HotKey:SetText(GetBindingText(key, 1)) HotKey:Show() @@ -577,9 +577,9 @@ function SuperButton:AddAction(buttonName, updateFunc, eventFunc, bindingKey) self:ClearBindings() end end - if(self:IsShown() and (self.___binding) and (name == 'action' or name == 'binding')) then + if(self:IsShown() and (self.___binding ~= nil) and (name == 'action' or name == 'binding')) then self:ClearBindings() - local key = GetBindingKey(self.___binding) + local key = GetBindingKey(self.___binding ~= nil) if(key) then self:SetBindingClick(1, key, self, 'LeftButton') end @@ -686,9 +686,9 @@ function SuperButton:AddSpell(buttonName, updateFunc, eventFunc, bindingKey) self:ClearBindings() end end - if(self:IsShown() and (self.___binding) and (name == 'spell' or name == 'binding')) then + if(self:IsShown() and (self.___binding ~= nil) and (name == 'spell' or name == 'binding')) then self:ClearBindings() - local key = GetBindingKey(self.___binding) + local key = GetBindingKey(self.___binding ~= nil) if(key) then self:SetBindingClick(1, key, self, 'LeftButton') end @@ -794,9 +794,9 @@ function SuperButton:AddItem(buttonName, updateFunc, eventFunc, bindingKey) self:ClearBindings() end end - if(self:IsShown() and (self.___binding) and (name == 'item' or name == 'binding')) then + if(self:IsShown() and (self.___binding ~= nil) and (name == 'item' or name == 'binding')) then self:ClearBindings() - local key = GetBindingKey(self.___binding) + local key = GetBindingKey(self.___binding ~= nil) if(key) then self:SetBindingClick(1, key, self, 'LeftButton') end diff --git a/Interface/AddOns/SVUI_StyleOMatic/Loader.lua b/Interface/AddOns/SVUI_StyleOMatic/Loader.lua index 5e7e08e..81b3891 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/Loader.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/Loader.lua @@ -100,7 +100,7 @@ AddonObject.defaults = { ['Bugsack'] = true, ['Clique'] = true, ['Cooline'] = true, - ['Details'] = true, + --['Details'] = true, ['DBM'] = true, ['DXE'] = true, ['LightHeaded'] = true, diff --git a/Interface/AddOns/SVUI_StyleOMatic/components/_load.xml b/Interface/AddOns/SVUI_StyleOMatic/components/_load.xml index 47dc976..a2f7198 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/components/_load.xml +++ b/Interface/AddOns/SVUI_StyleOMatic/components/_load.xml @@ -1,5 +1,6 @@