diff --git a/Interface/AddOns/SVUI/Bindings.xml b/Interface/AddOns/SVUI/Bindings.xml index 0293f5f..844e72f 100644 --- a/Interface/AddOns/SVUI/Bindings.xml +++ b/Interface/AddOns/SVUI/Bindings.xml @@ -1,11 +1,11 @@ <Bindings> - <Binding name="Raid Marker" header="SVUI" runOnUp="true"> + <Binding name="RaidMarker" description="Raid Marker" header="SVUI" runOnUp="true"> RaidMark_HotkeyPressed(keystate) </Binding> - <Binding name="Toggle Docks" runOnUp="false"> + <Binding name="ToggleDocks" description="Toggle Docks" header="SVUI" runOnUp="false"> HideSuperDocks() </Binding> - <Binding name="Lets Ride" runOnUp="false"> + <Binding name="LetsRide" description="Lets Ride" header="SVUI" runOnUp="false"> SVUILetsRide() </Binding> </Bindings> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/SVUI.lua b/Interface/AddOns/SVUI/SVUI.lua index 7870806..8de74bd 100644 --- a/Interface/AddOns/SVUI/SVUI.lua +++ b/Interface/AddOns/SVUI/SVUI.lua @@ -37,9 +37,16 @@ local floor = math.floor --[[ TABLE METHODS ]]-- local tsort, tconcat = table.sort, table.concat; --[[ -########################################################## -ADDON DATA -########################################################## +############################################################ + /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$ /$$$$$$ +| $$ /$$__ $$ /$$__ $$ /$$__ $$| $$ /$$__ $$ +| $$ | $$ \ $$| $$ \__/| $$ \ $$| $$ | $$ \__/ +| $$ | $$ | $$| $$ | $$$$$$$$| $$ | $$$$$$ +| $$ | $$ | $$| $$ | $$__ $$| $$ \____ $$ +| $$ | $$ | $$| $$ $$| $$ | $$| $$ /$$ \ $$ +| $$$$$$$$| $$$$$$/| $$$$$$/| $$ | $$| $$$$$$$$| $$$$$$/ +|________/ \______/ \______/ |__/ |__/|________/ \______/ +############################################################ ]]-- local SVUI = {}; local SVUINameSpace, SVUICore = ...; @@ -50,20 +57,16 @@ local playerRealm = GetRealmName(); local SetAddonCore; local callbacks = {}; local numCallbacks = 0; ---[[ -########################################################## -CONSTANTS -########################################################## -]]-- + +--[[ CONSTANTS ]]-- + BINDING_HEADER_SVUI = "SuperVillain UI"; SLASH_RELOADUI1 = "/rl" SLASH_RELOADUI2 = "/reloadui" SlashCmdList.RELOADUI = ReloadUI ---[[ -########################################################## -MUNGLUNCH's FASTER ASSERT FUNCTION -########################################################## -]]-- + +--[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- + function enforce(condition, ...) if not condition then if next({...}) then @@ -78,10 +81,20 @@ function enforce(condition, ...) end local assert = enforce; --[[ -########################################################## -LOCAL FUNCTIONS -########################################################## +###################################################################### + /$$$$$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$ /$$ /$$$$$$ + /$$__ $$| $$ /$$__ $$| $$__ $$ /$$__ $$| $$ /$$__ $$ +| $$ \__/| $$ | $$ \ $$| $$ \ $$| $$ \ $$| $$ | $$ \__/ +| $$ /$$$$| $$ | $$ | $$| $$$$$$$ | $$$$$$$$| $$ | $$$$$$ +| $$|_ $$| $$ | $$ | $$| $$__ $$| $$__ $$| $$ \____ $$ +| $$ \ $$| $$ | $$ | $$| $$ \ $$| $$ | $$| $$ /$$ \ $$ +| $$$$$$/| $$$$$$$$| $$$$$$/| $$$$$$$/| $$ | $$| $$$$$$$$| $$$$$$/ + \______/ |________/ \______/ |_______/ |__/ |__/|________/ \______/ +###################################################################### ]]-- + +--[[ CLASS COLOR LOCALS ]]-- + local function formatValueString(text) if "string" == type(text) then text = gsub(text,"\n","\\n") @@ -129,12 +142,10 @@ local function DispatchCallbacks() print("ERROR:", err) end end -end ---[[ -########################################################## -BUILD CLASS COLOR GLOBAL -########################################################## -]]-- +end + +--[[ BUILD CLASS COLOR GLOBAL ]]-- + SVUI_CLASS_COLORS = {}; do local classes = {}; @@ -176,12 +187,10 @@ do end end classes = nil -end ---[[ -########################################################## -APPENDED GLOBAL FUNCTIONS -########################################################## -]]-- +end + +--[[ APPENDED LUA METHODS ]]-- + function math.parsefloat(value,decimal) if decimal and decimal > 0 then local calc1 = 10 ^ decimal; @@ -249,12 +258,19 @@ function string.explode(str, delim) return res end --[[ -########################################################## -DEFINE REGISTRY HELPERS -########################################################## +############################################################################### + /$$$$$$$ /$$$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$$/$$$$$$$ /$$ /$$ +| $$__ $$| $$_____/ /$$__ $$|_ $$_/ /$$__ $$|__ $$__/ $$__ $$| $$ /$$/ +| $$ \ $$| $$ | $$ \__/ | $$ | $$ \__/ | $$ | $$ \ $$ \ $$ /$$/ +| $$$$$$$/| $$$$$ | $$ /$$$$ | $$ | $$$$$$ | $$ | $$$$$$$/ \ $$$$/ +| $$__ $$| $$__/ | $$|_ $$ | $$ \____ $$ | $$ | $$__ $$ \ $$/ +| $$ \ $$| $$ | $$ \ $$ | $$ /$$ \ $$ | $$ | $$ \ $$ | $$ +| $$ | $$| $$$$$$$$| $$$$$$/ /$$$$$$| $$$$$$/ | $$ | $$ | $$ | $$ +|__/ |__/|________/ \______/ |______/ \______/ |__/ |__/ |__/ |__/ +############################################################################### ]]-- do - local PackageQueue, ScriptQueue = {},{}; + local PackageQueue, PluginQueue, ScriptQueue = {},{},{}; local INFO_BY = "%s |cff0099FFby %s|r"; local INFO_VERSION = "%s%s |cff33FF00Version: %s|r"; @@ -268,27 +284,34 @@ do INFO_HEADER = "SuperVillain UI (устарела %.3f): Плагины"; end - local rootstring = function(self) return self.___name end + local PLUGIN_LISTING = ""; + + local rootstring = function(self) return self.___addonName end local changeDBVar = function(self, value, key, sub1, sub2, sub3) - local config = self.__owner.db[self.___name] + local core = self.___core + local schema = self.___schema + local config = core.db[schema] + if((sub1 and sub2 and sub3) and (config[sub1] and config[sub1][sub2] and config[sub1][sub2][sub3])) then - self.__owner.db[self.___name][sub1][sub2][sub3][key] = value + core.db[schema][sub1][sub2][sub3][key] = value elseif((sub1 and sub2) and (config[sub1] and config[sub1][sub2])) then - self.__owner.db[self.___name][sub1][sub2][key] = value + core.db[schema][sub1][sub2][key] = value elseif(sub1 and config[sub1]) then - self.__owner.db[self.___name][sub1][key] = value + core.db[schema][sub1][key] = value else - self.__owner.db[self.___name][key] = value + core.db[schema][key] = value end - self.db = self.__owner.db[self.___name] + + self.db = core.db[schema] + if(self.UpdateLocals) then self:UpdateLocals() end end local innerOnEvent = function(self, event, ...) - local obj = self.__owner + local obj = self.module if self[event] and type(self[event]) == "function" then self[event](obj, event, ...) end @@ -297,16 +320,20 @@ do local registerEvent = function(self, eventname, eventfunc) if not self.___eventframe then self.___eventframe = CreateFrame("Frame", nil) - self.___eventframe.__owner = self + self.___eventframe.module = self self.___eventframe:SetScript("OnEvent", innerOnEvent) end - local fn = eventfunc - if type(eventfunc) == "string" then - fn = self[eventfunc] - elseif(not fn and self[eventname]) then - fn = self[eventname] + + if(not self.___eventframe[eventname]) then + local fn = eventfunc + if type(eventfunc) == "string" then + fn = self[eventfunc] + elseif(not fn and self[eventname]) then + fn = self[eventname] + end + self.___eventframe[eventname] = fn end - self.___eventframe[eventname] = fn + self.___eventframe:RegisterEvent(eventname) end @@ -316,18 +343,70 @@ do end end - local addonEvent = function(self, event, addon) - if addon == "SVUI_ConfigOMatic" then - local list = self.__owner.Plugins - for i, plugin in pairs(list) do - if(plugin.callback) then - plugin.callback() + local innerOnUpdate = function(self, elapsed) + if self.elapsed and self.elapsed > (self.throttle) then + local obj = self.module + local core = obj.___core + local callbacks = self.callbacks + + for name, fn in pairs(callbacks) do + local _, error = pcall(fn, obj) + if(error and core.Debugging) then + print(error) end end + + self.elapsed = 0 + else + self.elapsed = (self.elapsed or 0) + elapsed + end + end + + local registerUpdate = function(self, updatefunc, throttle) + if not self.___updateframe then + self.___updateframe = CreateFrame("Frame", nil); + self.___updateframe.module = self; + self.___updateframe.callbacks = {}; + self.___updateframe.elapsed = 0; + self.___updateframe.throttle = throttle or 0.2; + end + + if(updatefunc and type(updatefunc) == "string" and self[updatefunc]) then + self.___updateframe.callbacks[updatefunc] = self[updatefunc] + end + + self.___updateframe:SetScript("OnUpdate", innerOnUpdate) + end + + local unregisterUpdate = function(self, updatefunc) + if(updatefunc and type(updatefunc) == "string" and self.___updateframe.callbacks[updatefunc]) then + self.___updateframe.callbacks[updatefunc] = nil + if(#self.___updateframe.callbacks == 0) then + self.___updateframe:SetScript("OnUpdate", nil) + end + else + self.___updateframe:SetScript("OnUpdate", nil) end end - local function SetNewComponent(obj, name, parent, plugin) + local function SetPluginString(addonName) + local pluginString = PLUGIN_LISTING or "" + local author = GetAddOnMetadata(addonName, "Author") or "Unknown" + local Pname = GetAddOnMetadata(addonName, "Title") or addonName + local version = GetAddOnMetadata(addonName, "Version") or "???" + pluginString = INFO_BY:format(pluginString, author) + pluginString = ("%s%s"):format(pluginString, Pname) + pluginString = INFO_VERSION:format(pluginString, "|cff00FF00", version) + pluginString = ("%s|r\n"):format(pluginString) + + PLUGIN_LISTING = pluginString + end + + local function SetFoundAddon() + -- DO STUFF + end + + local function SetInternalModule(obj, schema, core) local addonmeta = {} local oldmeta = getmetatable(obj) if oldmeta then @@ -335,19 +414,49 @@ do end addonmeta.__tostring = rootstring setmetatable( obj, addonmeta ) - obj.___name = name - obj.__owner = parent + + local addonName = ("SVUI [%s]"):format(schema) + + obj.___addonName = addonName + obj.___schema = schema + obj.___core = core obj.initialized = false obj.CombatLocked = false obj.ChangeDBVar = changeDBVar obj.RegisterEvent = registerEvent obj.UnregisterEvent = unregisterEvent - if(not plugin) then - return obj + obj.RegisterUpdate = registerUpdate + obj.UnregisterUpdate = unregisterUpdate + + return obj + end + + local function SetExternalModule(obj, schema, core, addon) + local addonmeta = {} + local oldmeta = getmetatable(obj) + if oldmeta then + for k, v in pairs(oldmeta) do addonmeta[k] = v end end + addonmeta.__tostring = rootstring + setmetatable( obj, addonmeta ) + + local addonName = ("%s [%s]"):format(addon, schema) + + obj.___addonName = addonName + obj.___schema = schema + obj.___core = core + obj.initialized = false + obj.CombatLocked = false + obj.ChangeDBVar = changeDBVar + obj.RegisterEvent = registerEvent + obj.UnregisterEvent = unregisterEvent + obj.RegisterUpdate = registerUpdate + obj.UnregisterUpdate = unregisterUpdate + + return obj end - local Registry_SetCallback = function(self, fn) + local Registry_NewCallback = function(self, fn) if(fn and type(fn) == "function") then self.Callbacks[#self.Callbacks+1] = fn end @@ -359,59 +468,52 @@ do end end - local Registry_NewPackage = function(self, obj, name) - if self.__owner[name] then return end - PackageQueue[#PackageQueue+1] = name - self.Packages[#self.Packages+1] = name + local Registry_NewPackage = function(self, obj, schema) + local core = self.___core + if(core[schema]) then return end + + PackageQueue[#PackageQueue+1] = schema + self.Modules[#self.Modules+1] = schema - self.__owner[name] = SetNewComponent(obj, name, self.__owner) + core[schema] = SetInternalModule(obj, schema, core) - if(self.__owner.AddonLaunched) then - if(self.__owner[name].Load) then - self.__owner[name]:Load() + if(core.AddonLaunched) then + if(core[schema].Load) then + core[schema]:Load() end end end - local Registry_FetchPlugins = function(self) - local list = ""; - for addon, plugin in pairs(self.Plugins) do - if addon ~= self.__owner.___name then - local author = GetAddOnMetadata(addon, "Author") - local Pname = GetAddOnMetadata(addon, "Title") or addon - list = ("%s%s"):format(list, Pname) - if author then - list = self.INFO_BY:format(list, author) - end - list = self.INFO_VERSION:format(list, "|cff00FF00", plugin.version) - list = ("%s|r\n"):format(list) - end - end - return list - end + local Registry_NewPlugin = function(self, obj) + local core = self.___core + local coreName = core.___addonName + local addonName = obj.___addonName - local Registry_NewPlugin = function(self, obj, name, callbackFunc) - if(callbackFunc and type(callbackFunc) == "function") then - local addon = obj.___name - local ver = obj.___ver or GetAddOnMetadata(addon, "Version") - local oldFlag = (ver < self.__owner.___ver) - self.Plugins[addon] = { - version = ver, - callback = callbackFunc - } - if addon ~= self.__owner.___name then - local fetch = self:FetchPlugins() or "" - self.__owner.Options.args.plugins.args.pluginOptions.args.pluginlist.args.active.name = fetch + if(addonName and addonName ~= coreName) then + local schema = GetAddOnMetadata(addonName, "X-SVUI"); + if(not schema or (schema and core[schema])) then return end + + PluginQueue[#PluginQueue+1] = schema + self.Modules[#self.Modules+1] = schema + + SetPluginString(addonName) + + core[schema] = SetExternalModule(obj, schema, core, addonName) + + if(core.AddonLaunched and core[schema].Load) then + core[schema]:Load() end - callbackFunc() end + end - SetNewComponent(obj, name, self.__owner, true) + local Registry_FetchPlugins = function(self) + -- DO STUFF end local Registry_RunCallbacks = function(self) - for i=1, #self.Callbacks do - local fn = self.Callbacks[i] + local callbacks = self.Callbacks + for i=1, #callbacks do + local fn = callbacks[i] if(fn and type(fn) == "function") then fn() end @@ -419,10 +521,11 @@ do end local Registry_Update = function(self, name, dataOnly) - local obj = self.__owner[name] + local core = self.___core + local obj = core[name] if obj then - if self.__owner.db[name] then - obj.db = self.__owner.db[name] + if core.db[name] then + obj.db = core.db[name] end if obj.ReLoad and not dataOnly then obj:ReLoad() @@ -431,12 +534,15 @@ do end local Registry_UpdateAll = function(self) - local list = self.Packages - for _,name in pairs(list) do - local obj = self.__owner[name] - if self.__owner.db[name] then - obj.db = self.__owner.db[name] + local modules = self.Modules + local core = self.___core + for _,name in pairs(modules) do + local obj = core[name] + + if core.db[name] then + obj.db = core.db[name] end + if obj and obj.ReLoad then obj:ReLoad() end @@ -445,12 +551,14 @@ do local Registry_Load = function(self) if not PackageQueue then return end + local core = self.___core + for i=1,#PackageQueue do local name = PackageQueue[i] - local obj = self.__owner[name] + local obj = core[name] if obj and not obj.initialized then - if self.__owner.db[name] then - obj.db = self.__owner.db[name] + if core.db[name] then + obj.db = core.db[name] end if obj.Load then local halt = false @@ -485,8 +593,8 @@ do function SetAddonCore(obj,n,v) obj = { - ___name = n, - ___ver = v, + ___addonName = n, + ___version = v, db = {}, Global = { Accountant = {}, @@ -527,7 +635,7 @@ do active = { order = 1, type = "description", - name = "" + name = function() return PLUGIN_LISTING end } } }, @@ -538,18 +646,16 @@ do } }, Registry = { - Packages = {}, + Modules = {}, Plugins = {}, Callbacks = {}, - INFO_BY = INFO_BY, INFO_VERSION = INFO_VERSION, INFO_NEW = INFO_NEW, INFO_NAME = INFO_NAME, INFO_HEADER = INFO_HEADER, - SetCallback = Registry_SetCallback, + NewCallback = Registry_NewCallback, NewScript = Registry_NewScript, NewPackage = Registry_NewPackage, - FetchPlugins = Registry_FetchPlugins, NewPlugin = Registry_NewPlugin, RunCallbacks = Registry_RunCallbacks, Update = Registry_Update, @@ -565,15 +671,14 @@ do mt.__tostring = rootstring setmetatable(obj, mt) - obj.Registry.__owner = obj + obj.Registry.___core = obj return obj end end -SVUI = SetAddonCore(SVUI, SVUINameSpace, version) - --[[ LOCALIZATION HELPERS ]]-- + local failsafe = function() assert(false) end local metaread = { @@ -600,18 +705,33 @@ local metawrite = setmetatable({}, { end, __index = failsafe }) +--[[ +########################################################## + /$$$$$$ /$$$$$$ /$$$$$$$ /$$$$$$$$ + /$$__ $$ /$$__ $$| $$__ $$| $$_____/ +| $$ \__/| $$ \ $$| $$ \ $$| $$ +| $$ | $$ | $$| $$$$$$$/| $$$$$ +| $$ | $$ | $$| $$__ $$| $$__/ +| $$ $$| $$ | $$| $$ \ $$| $$ +| $$$$$$/| $$$$$$/| $$ | $$| $$$$$$$$ + \______/ \______/ |__/ |__/|________/ +########################################################## +]]-- +SVUI = SetAddonCore(SVUI, SVUINameSpace, version) SVUI.Localization = setmetatable({}, metaread) --[[ MISC ]]-- + SVUI.fubar = function() return end SVUI.class = select(2,UnitClass("player")); SVUI.ClassRole = ""; +SVUI.UnitRole = "NONE"; SVUI.ConfigurationMode = false; SVUI.DebuggingMode = false ---[[ MISC ]]-- --[[ UTILITY FRAMES ]]-- + SVUI.UIParent = CreateFrame("Frame", "SVUIParent", UIParent); SVUI.UIParent:SetFrameLevel(UIParent:GetFrameLevel()); SVUI.UIParent:SetPoint("CENTER", UIParent, "CENTER"); @@ -620,7 +740,8 @@ SVUI.Snap[1] = SVUI.UIParent; SVUI.Cloaked = CreateFrame("Frame", nil, UIParent); SVUI.Cloaked:Hide(); ---[[ UTILITY FRAMES ]]-- + +--[[ COMMON FUNCTIONS ]]-- function SVUI:SetLocaleStrings(locale, isDefault) local gameLocale = GetLocale() @@ -635,11 +756,16 @@ function SVUI:SetLocaleStrings(locale, isDefault) end end -function SVUI:Prototype(n, v) +function SVUI:Prototype(name) + local version = GetAddOnMetadata(name, "Version") + local schema = GetAddOnMetadata(name, "X-SVUI") + local obj = { - ___name = n, - ___ver = v + ___addonName = name, + ___version = version, + ___schema = schema } + local mt = {} local old = getmetatable(obj) if old then @@ -684,4 +810,6 @@ end SVUICore[1] = SVUI SVUICore[2] = SVUI.Localization +--[[ SET MASTER GLOBAL ]]-- + _G[SVUINameSpace] = SVUICore; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/SVUI.toc b/Interface/AddOns/SVUI/SVUI.toc index 51d6220..8f02ede 100644 --- a/Interface/AddOns/SVUI/SVUI.toc +++ b/Interface/AddOns/SVUI/SVUI.toc @@ -1,6 +1,6 @@ -## Interface: 50400 +## Interface: 60000 ## Author: Munglunch -## Version: 4.084 +## Version: 5.02 ## Title: |cffFF9900SVUI|r ## Notes: Supervillain UI [|cff9911FFCore Framework|r]. ## SavedVariables: SVUI_Global @@ -9,5 +9,6 @@ ## X-oUF: oUF_SuperVillain ## X-Notes: Special thanks to Elv and Tukz for their incredible work. ## X-Email: munglunch@gmail.com +## X-SVUI: SuperVillain SVUI.xml diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ActionPanel/oUF_ActionPanel.lua b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ActionPanel/oUF_ActionPanel.lua index ac98666..8de49c9 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ActionPanel/oUF_ActionPanel.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ActionPanel/oUF_ActionPanel.lua @@ -53,7 +53,7 @@ local Update = function(self, event, unit) texture:SetTexture(media[3]) texture:SetGradient("VERTICAL",1,1,0,1,0,0) else - texture:SetTexture(0,0,0,0) + texture:SetTexture("") end end end diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ActionPanel/oUF_ActionPanel.toc b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ActionPanel/oUF_ActionPanel.toc index d9bd2a0..129e085 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ActionPanel/oUF_ActionPanel.toc +++ b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ActionPanel/oUF_ActionPanel.toc @@ -2,7 +2,7 @@ ## Title: oUF ActionPanel ## Notes: Adds a backing to all unit frames that provides many utilities. ## Author: Munglunch -## Version: 4.084 +## Version: 5.02 ## X-Category: oUF ## Dependencies: oUF diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Afflicted/oUF_Afflicted.toc b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Afflicted/oUF_Afflicted.toc index 19e041b..ee5034f 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Afflicted/oUF_Afflicted.toc +++ b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Afflicted/oUF_Afflicted.toc @@ -2,7 +2,7 @@ ## Title: oUF Afflicted ## Notes: Adds Custom Debuff Highlighting to oUF. ## Author: Munglunch -## Version: 4.084 +## Version: 5.02 ## X-Category: oUF ## Dependencies: oUF diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc index 3550d8a..021f782 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc +++ b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc @@ -2,7 +2,7 @@ ## Title: oUF Arcane Charge ## Notes: Adds support for arcane charge indicators to oUF. ## Author: Munglunch -## Version: 4.084 +## Version: 5.02 ## Dependencies: oUF oUF_ArcaneCharge.lua \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Combatant/oUF_Combatant.toc b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Combatant/oUF_Combatant.toc index 37634eb..2e2d68f 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Combatant/oUF_Combatant.toc +++ b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Combatant/oUF_Combatant.toc @@ -2,7 +2,7 @@ ## Title: oUF Combatant ## Notes: Adds PvP trinket status and spec icons to oUF frames. ## Author: Munglunch -## Version: 4.0840 +## Version: 5.020 ## X-Category: oUF ## Dependencies: oUF diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Friendship/oUF_Friendship.lua b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Friendship/oUF_Friendship.lua index f37e03f..f381dd2 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Friendship/oUF_Friendship.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Friendship/oUF_Friendship.lua @@ -24,7 +24,7 @@ local friendships = { [GetFactionInfoByID(1281)] = 1281, [GetFactionInfoByID(1282)] = 1282, [GetFactionInfoByID(1283)] = 1283, - [GetFactionInfoByID(1357)] = 1357, + -- [GetFactionInfoByID(1357)] = 1357, [GetFactionInfoByID(1358)] = 1358, } diff --git a/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua b/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua index e4ddda8..54282bf 100644 --- a/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua +++ b/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua @@ -109,16 +109,18 @@ local function RefreshMicrobar() for i=1,13 do local data = ICON_DATA[i] local button = _G[data[1]] - button:ClearAllPoints() - button:Size(buttonSize, buttonSize + 28) - button._fade = MOD.db.Micro.mouseover - if lastParent == SVUI_MicroBar then - button:SetPoint("BOTTOMLEFT",lastParent,"BOTTOMLEFT",1,1) - else - button:SetPoint('LEFT',lastParent,'RIGHT',spacing,0) - end - lastParent = button; - button:Show() + if(button) then + button:ClearAllPoints() + button:Size(buttonSize, buttonSize + 28) + button._fade = MOD.db.Micro.mouseover + if lastParent == SVUI_MicroBar then + button:SetPoint("BOTTOMLEFT",lastParent,"BOTTOMLEFT",1,1) + else + button:SetPoint('LEFT',lastParent,'RIGHT',spacing,0) + end + lastParent = button; + button:Show() + end end end @@ -153,8 +155,11 @@ local SVUIMicroButtonsParent = function(self) self = SVUI_MicroBar end for i=1,13 do - local data = ICON_DATA[i] - _G[data[1]]:SetParent(SVUI_MicroBar) + local data = ICON_DATA[i] + if(data) then + local mButton = _G[data[1]] + if(mButton) then mButton:SetParent(SVUI_MicroBar) end + end end end @@ -343,15 +348,15 @@ local function ModifyActionButton(parent) checked:SetTexture(1,1,1,.2) end if flash then - flash:SetTexture(0,0,0,0) + flash:SetTexture("") end if normal then - normal:SetTexture(0,0,0,0) + normal:SetTexture("") normal:Hide() normal:SetAlpha(0) end if parentTex then - parentTex:SetTexture(0,0,0,0) + parentTex:SetTexture("") parentTex:Hide() parentTex:SetAlpha(0) end @@ -1312,40 +1317,44 @@ CreateMicroBar = function(self) SuperVillain:AddToDisplayAudit(microBar) for i=1,13 do - local data = ICON_DATA[i] - local button = _G[data[1]] - button:SetParent(SVUI_MicroBar) - button:Size(buttonSize, buttonSize + 28) - button.Flash:SetTexture(0,0,0,0) - if button.SetPushedTexture then - button:SetPushedTexture("") - end - if button.SetNormalTexture then - button:SetNormalTexture("") - end - if button.SetDisabledTexture then - button:SetDisabledTexture("") - end - if button.SetHighlightTexture then - button:SetHighlightTexture("") - end - button:Formula409() - - local buttonMask = NewFrame("Frame",nil,button) - buttonMask:SetPoint("TOPLEFT",button,"TOPLEFT",0,-28) - buttonMask:SetPoint("BOTTOMRIGHT",button,"BOTTOMRIGHT",0,0) - buttonMask:SetFramedButtonTemplate() - buttonMask:SetPanelColor() - buttonMask.icon = buttonMask:CreateTexture(nil,"OVERLAY",nil,2) - buttonMask.icon:FillInner(buttonMask,2,2) - buttonMask.icon:SetTexture(ICON_FILE) - buttonMask.icon:SetTexCoord(data[2],data[3],data[4],data[5]) - buttonMask.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - button.overlay = buttonMask; - button._fade = self.db.Micro.mouseover - button:HookScript('OnEnter', MicroButton_OnEnter) - button:HookScript('OnLeave', MicroButton_OnLeave) - button:Show() + local data = ICON_DATA[i] + if(data) then + local button = _G[data[1]] + if(button) then + button:SetParent(SVUI_MicroBar) + button:Size(buttonSize, buttonSize + 28) + button.Flash:SetTexture("") + if button.SetPushedTexture then + button:SetPushedTexture("") + end + if button.SetNormalTexture then + button:SetNormalTexture("") + end + if button.SetDisabledTexture then + button:SetDisabledTexture("") + end + if button.SetHighlightTexture then + button:SetHighlightTexture("") + end + button:Formula409() + + local buttonMask = NewFrame("Frame",nil,button) + buttonMask:SetPoint("TOPLEFT",button,"TOPLEFT",0,-28) + buttonMask:SetPoint("BOTTOMRIGHT",button,"BOTTOMRIGHT",0,0) + buttonMask:SetFramedButtonTemplate() + buttonMask:SetPanelColor() + buttonMask.icon = buttonMask:CreateTexture(nil,"OVERLAY",nil,2) + buttonMask.icon:FillInner(buttonMask,2,2) + buttonMask.icon:SetTexture(ICON_FILE) + buttonMask.icon:SetTexCoord(data[2],data[3],data[4],data[5]) + buttonMask.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + button.overlay = buttonMask; + button._fade = self.db.Micro.mouseover + button:HookScript('OnEnter', MicroButton_OnEnter) + button:HookScript('OnLeave', MicroButton_OnLeave) + button:Show() + end + end end MicroButtonPortrait:ClearAllPoints() diff --git a/Interface/AddOns/SVUI/packages/bag/SVBag.lua b/Interface/AddOns/SVUI/packages/bag/SVBag.lua index 402e653..d3c9d59 100644 --- a/Interface/AddOns/SVUI/packages/bag/SVBag.lua +++ b/Interface/AddOns/SVUI/packages/bag/SVBag.lua @@ -173,16 +173,18 @@ local function BuildEquipmentMap() gearSet = GetEquipmentSetLocations(set); if(gearSet) then for key, location in pairs(gearSet)do - player, bank, bags, _, index, bag = EquipmentManager_UnpackLocation(location); - if((bank or bags) and (index and bag)) then - loc = format("%d_%d", bag, index); - gearList[loc] = (gearList[loc] or {}); - tinsert(gearList[loc], set); + if(type(location) ~= "string") then + player, bank, bags, _, index, bag = EquipmentManager_UnpackLocation(location); + if((bank or bags) and (index and bag)) then + loc = format("%d_%d", bag, index); + gearList[loc] = (gearList[loc] or {}); + tinsert(gearList[loc], set); + end end end end end -end +end --[[ ########################################################## CORE FUNCTIONS @@ -238,7 +240,6 @@ function MOD:RefreshSlot(bag, slotID) local itemLink = GetContainerItemLink(bag, slotID); local key; slot:Show() - slot.questIcon:Hide() slot.name, slot.rarity = nil, nil; local start, duration, enable = GetContainerItemCooldown(bag, slotID) CooldownFrame_SetTimer(slot.cooldown, start, duration, enable) @@ -258,7 +259,6 @@ function MOD:RefreshSlot(bag, slotID) local z, A, C = GetContainerItemQuestInfo(bag, slotID) if A and not isActive then slot:SetBackdropBorderColor(1.0, 0.3, 0.3) - slot.questIcon:Show() elseif A or z then slot:SetBackdropBorderColor(1.0, 0.3, 0.3) elseif slot.rarity and slot.rarity>1 then @@ -436,16 +436,11 @@ function MOD:Layout(isBank) f.Bags[bagID][slotID]:SetNormalTexture(nil); f.Bags[bagID][slotID]:SetCheckedTexture(nil); f.Bags[bagID][slotID]:SetSlotTemplate(true, 2, 0, 0, true); + if(_G[f.Bags[bagID][slotID]:GetName().."NewItemTexture"]) then _G[f.Bags[bagID][slotID]:GetName().."NewItemTexture"]:Hide() end - f.Bags[bagID][slotID].count:ClearAllPoints(); - f.Bags[bagID][slotID].count:Point("BOTTOMRIGHT", 0, 2); - f.Bags[bagID][slotID].questIcon = _G[f.Bags[bagID][slotID]:GetName().."IconQuestTexture"]; - f.Bags[bagID][slotID].questIcon:SetTexture(TEXTURE_ITEM_QUEST_BANG); - f.Bags[bagID][slotID].questIcon:FillInner(f.Bags[bagID][slotID]); - f.Bags[bagID][slotID].questIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9 ); - f.Bags[bagID][slotID].questIcon:Hide(); + f.Bags[bagID][slotID].iconTexture = _G[f.Bags[bagID][slotID]:GetName().."IconTexture"]; f.Bags[bagID][slotID].iconTexture:FillInner(f.Bags[bagID][slotID]); f.Bags[bagID][slotID].iconTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9 ); diff --git a/Interface/AddOns/SVUI/packages/chat/SVChat.lua b/Interface/AddOns/SVUI/packages/chat/SVChat.lua index 32de19d..ce1648c 100644 --- a/Interface/AddOns/SVUI/packages/chat/SVChat.lua +++ b/Interface/AddOns/SVUI/packages/chat/SVChat.lua @@ -578,15 +578,15 @@ do chat:Formula409(true) _G[chatName.."ButtonFrame"]:MUNG() ------------------------------------------- - _G[tabName .."Left"]:SetTexture(0,0,0,0) - _G[tabName .."Middle"]:SetTexture(0,0,0,0) - _G[tabName .."Right"]:SetTexture(0,0,0,0) - _G[tabName .."SelectedLeft"]:SetTexture(0,0,0,0) - _G[tabName .."SelectedMiddle"]:SetTexture(0,0,0,0) - _G[tabName .."SelectedRight"]:SetTexture(0,0,0,0) - _G[tabName .."HighlightLeft"]:SetTexture(0,0,0,0) - _G[tabName .."HighlightMiddle"]:SetTexture(0,0,0,0) - _G[tabName .."HighlightRight"]:SetTexture(0,0,0,0) + _G[tabName .."Left"]:SetTexture("") + _G[tabName .."Middle"]:SetTexture("") + _G[tabName .."Right"]:SetTexture("") + _G[tabName .."SelectedLeft"]:SetTexture("") + _G[tabName .."SelectedMiddle"]:SetTexture("") + _G[tabName .."SelectedRight"]:SetTexture("") + _G[tabName .."HighlightLeft"]:SetTexture("") + _G[tabName .."HighlightMiddle"]:SetTexture("") + _G[tabName .."HighlightRight"]:SetTexture("") tab.text = _G[chatName.."TabText"] tab.text:SetTextColor(1, 1, 1) diff --git a/Interface/AddOns/SVUI/packages/dock/SVDock.lua b/Interface/AddOns/SVUI/packages/dock/SVDock.lua index d0c945e..a54747f 100644 --- a/Interface/AddOns/SVUI/packages/dock/SVDock.lua +++ b/Interface/AddOns/SVUI/packages/dock/SVDock.lua @@ -292,7 +292,7 @@ local function SetSuperDockStyle(dock) backdrop.bottom:Point("BOTTOMRIGHT", -1, 1) backdrop.bottom:Height(4) backdrop.top = backdrop:CreateTexture(nil, "OVERLAY") - backdrop.top:SetTexture(0, 0, 0, 0) + backdrop.top:SetTexture("") backdrop.top:Point("TOPLEFT", 1, -1) backdrop.top:Point("TOPRIGHT", -1, 1) backdrop.top:SetAlpha(0) @@ -426,7 +426,7 @@ local function BorderColorUpdates() SVUIBottomPanel:SetBackdropBorderColor(0,0,0,1) end -SuperVillain.Registry:SetCallback(BorderColorUpdates) +SuperVillain.Registry:NewCallback(BorderColorUpdates) function MOD:CreateDockPanels() self.SuperDockFaded = SVUI_Cache["Dock"].SuperDockFaded diff --git a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua index dc2b981..a6598b5 100644 --- a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua +++ b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua @@ -691,51 +691,62 @@ end INVITE AUTOMATONS ########################################################## ]]-- -local function AutoGroupInvite(self, event, arg) +function MOD:PARTY_INVITE_REQUEST(event, arg) if not SuperVillain.db.SVHenchmen.autoAcceptInvite then return end - if IsInGroup() then return end - if event == "PARTY_INVITE_REQUEST" then - if QueueStatusMinimapButton:IsShown() then return end - hideStatic = true; - if GetNumFriends() > 0 then ShowFriends() end - if IsInGuild() then GuildRoster() end - local invited = false; - for i = 1, GetNumFriends()do - local friend = GetFriendInfo(i) + + if IsInGroup() or QueueStatusMinimapButton:IsShown() then return end + + if GetNumFriends() > 0 then ShowFriends() end + if IsInGuild() then GuildRoster() end + + hideStatic = true; + local invited = false; + for i = 1, GetNumFriends()do + local friend = GetFriendInfo(i) + if friend == arg then + AcceptGroup() + invited = true; + SuperVillain:AddonMessage("Accepted an Invite From Your Friends!") + break + end + end + if not invited then + for i = 1, BNGetNumFriends()do + local _, _, _, friend = BNGetFriendInfo(i) + arg = arg:match("(.+)%-.+") or arg; if friend == arg then AcceptGroup() invited = true; - SuperVillain:AddonMessage("Accepted an Invite From Your Friends!") + SuperVillain:AddonMessage("Accepted an Invite!") break end end - if not invited then - for i = 1, GetNumGuildMembers(true)do - local guildMate = GetGuildRosterInfo(i) - if guildMate == arg then - AcceptGroup() - invited = true; - SuperVillain:AddonMessage("Accepted an Invite From Your Guild!") - break - end - end - end - if not invited then - for i = 1, BNGetNumFriends()do - local _, _, _, friend = BNGetFriendInfo(i) - arg = arg:match("(.+)%-.+") or arg; - if friend == arg then - AcceptGroup() - SuperVillain:AddonMessage("Accepted an Invite!") - break - end + end + if not invited then + for i = 1, GetNumGuildMembers(true)do + local guildMate = GetGuildRosterInfo(i) + if guildMate == arg then + AcceptGroup() + invited = true; + SuperVillain:AddonMessage("Accepted an Invite From Your Guild!") + break end end - elseif event == "GROUP_ROSTER_UPDATE" and hideStatic == true then - StaticPopup_Hide("PARTY_INVITE") - hideStatic = false + end + if invited then + local popup = StaticPopup_FindVisible("PARTY_INVITE") + if(popup) then + popup.inviteAccepted = 1 + StaticPopup_Hide("PARTY_INVITE") + else + popup = StaticPopup_FindVisible("PARTY_INVITE_XREALM") + if(popup) then + popup.inviteAccepted = 1 + StaticPopup_Hide("PARTY_INVITE_XREALM") + end + end end -end +end --[[ ########################################################## REPAIR AUTOMATONS @@ -914,8 +925,8 @@ function MOD:Load() self:ToggleMailMinions() end - self:RegisterEvent('PARTY_INVITE_REQUEST', AutoGroupInvite) - self:RegisterEvent('GROUP_ROSTER_UPDATE', AutoGroupInvite) + self:RegisterEvent('PARTY_INVITE_REQUEST') + for _,event in pairs(AutomatedEvents) do self:RegisterEvent(event) end diff --git a/Interface/AddOns/SVUI/packages/map/SVMap.lua b/Interface/AddOns/SVUI/packages/map/SVMap.lua index 7f204cc..ff61fb6 100644 --- a/Interface/AddOns/SVUI/packages/map/SVMap.lua +++ b/Interface/AddOns/SVUI/packages/map/SVMap.lua @@ -220,7 +220,7 @@ do if frame:GetObjectType() == "Texture" then local iconFile = frame:GetTexture() if(iconFile ~= nil and (iconFile:find("Border") or iconFile:find("Background") or iconFile:find("AlphaMask"))) then - frame:SetTexture(0,0,0,0) + frame:SetTexture("") else frame:ClearAllPoints() frame:Point("TOPLEFT", btn, "TOPLEFT", 2, -2) @@ -328,7 +328,7 @@ local function AdjustMapSize() elseif WORLDMAP_SETTINGS.size == WORLDMAP_QUESTLIST_SIZE then SetQuestWorldMap() end - BlackoutWorld:SetTexture(0,0,0,0) + BlackoutWorld:SetTexture("") else if WORLDMAP_SETTINGS.size == WORLDMAP_FULLMAP_SIZE then WorldMapFrame_SetFullMapView() diff --git a/Interface/AddOns/SVUI/packages/override/SVOverride.lua b/Interface/AddOns/SVUI/packages/override/SVOverride.lua index 0edbff1..78c2fcb 100644 --- a/Interface/AddOns/SVUI/packages/override/SVOverride.lua +++ b/Interface/AddOns/SVUI/packages/override/SVOverride.lua @@ -404,7 +404,7 @@ local function SetTimerStyle(bar) for i=1, bar:GetNumRegions()do local child = select(i, bar:GetRegions()) if child:GetObjectType() == "Texture"then - child:SetTexture(0,0,0,0) + child:SetTexture("") elseif child:GetObjectType() == "FontString" then child:SetFontTemplate(SuperVillain.Media.font.roboto, 12, 'OUTLINE') end @@ -994,9 +994,9 @@ local GroupLootDropDown_GiveLoot = function(self) end local BailOut_OnEvent = function(self, event, ...) - if (event == "UNIT_ENTERED_VEHICLE" or CanExitVehicle()) then + if (event == "UNIT_ENTERED_VEHICLE" and CanExitVehicle()) then self:Show() - elseif(event == "UNIT_EXITED_VEHICLE") then + else self:Hide() end end @@ -1094,6 +1094,7 @@ function MOD:Load() exit:RegisterEvent("UNIT_ENTERED_VEHICLE") exit:RegisterEvent("UNIT_EXITED_VEHICLE") exit:RegisterEvent("VEHICLE_UPDATE") + exit:RegisterEvent("PLAYER_ENTERING_WORLD") exit:SetScript("OnEvent", BailOut_OnEvent) exit:Hide() diff --git a/Interface/AddOns/SVUI/packages/plates/SVPlate.lua b/Interface/AddOns/SVUI/packages/plates/SVPlate.lua index d581191..bec98bd 100644 --- a/Interface/AddOns/SVUI/packages/plates/SVPlate.lua +++ b/Interface/AddOns/SVUI/packages/plates/SVPlate.lua @@ -1167,22 +1167,22 @@ do health:Hide() fontRegions:Hide() - ref.threat:SetTexture(0,0,0,0) + ref.threat:SetTexture("") ref.border:Hide() - ref.highlight:SetTexture(0,0,0,0) + ref.highlight:SetTexture("") ref.level:SetWidth( 000.1 ) ref.level:Hide() - ref.skullicon:SetTexture(0,0,0,0) + ref.skullicon:SetTexture("") ref.raidicon:SetAlpha( 0 ) - ref.eliteicon:SetTexture(0,0,0,0) + ref.eliteicon:SetTexture("") plate.name:Hide() - cast.border:SetTexture(0,0,0,0) - cast.shield:SetTexture(0,0,0,0) + cast.border:SetTexture("") + cast.shield:SetTexture("") cast.icon:SetTexCoord( 0, 0, 0, 0 ) cast.icon:SetWidth(.001) - cast.shadow:SetTexture(0,0,0,0) + cast.shadow:SetTexture("") cast.shadow:Hide() cast.text:Hide() diff --git a/Interface/AddOns/SVUI/packages/stats/stats/bags.lua b/Interface/AddOns/SVUI/packages/stats/stats/bags.lua index 9156da3..d171898 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/bags.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/bags.lua @@ -98,5 +98,5 @@ local BagsColorUpdate = function() end end; -SuperVillain.Registry:SetCallback(BagsColorUpdate) +SuperVillain.Registry:NewCallback(BagsColorUpdate) MOD:Extend("Bags", StatEvents, bags_events, nil, bags_click, bags_focus); \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/cta.lua b/Interface/AddOns/SVUI/packages/stats/stats/cta.lua index e4f46c2..348baae 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/cta.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/cta.lua @@ -154,6 +154,6 @@ local CTAColorUpdate = function() CTA_OnEvent(currentObject) end end; -SuperVillain.Registry:SetCallback(CTAColorUpdate) +SuperVillain.Registry:NewCallback(CTAColorUpdate) MOD:Extend('Call to Arms', StatEvents, CTA_OnEvent, nil, CTA_OnClick, CTA_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/dps.lua b/Interface/AddOns/SVUI/packages/stats/stats/dps.lua index 780e31c..4f5b080 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/dps.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/dps.lua @@ -123,5 +123,5 @@ local DPSColorUpdate = function() end end -SuperVillain.Registry:SetCallback(DPSColorUpdate) +SuperVillain.Registry:NewCallback(DPSColorUpdate) MOD:Extend('DPS', StatEvents, DPS_OnEvent, nil, DPS_OnClick, DPS_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/durability.lua b/Interface/AddOns/SVUI/packages/stats/stats/durability.lua index f410471..962a8c5 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/durability.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/durability.lua @@ -142,7 +142,7 @@ local DurColorUpdate = function() Durability_OnEvent(currentObject) end end; -SuperVillain.Registry:SetCallback(DurColorUpdate) +SuperVillain.Registry:NewCallback(DurColorUpdate) MOD:Extend("Durability", StatEvents, Durability_OnEvent, nil, Durability_OnClick, Durability_OnEnter) MOD:Extend("Durability Bar", StatEvents, DurabilityBar_OnEvent, nil, Durability_OnClick, Durability_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/friends.lua b/Interface/AddOns/SVUI/packages/stats/stats/friends.lua index 8b364e4..96542ce 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/friends.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/friends.lua @@ -379,6 +379,6 @@ local FriendsColorUpdate = function() end end; -SuperVillain.Registry:SetCallback(FriendsColorUpdate) +SuperVillain.Registry:NewCallback(FriendsColorUpdate) MOD:Extend('Friends', StatEvents, OnEvent, nil, Click, OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/guild.lua b/Interface/AddOns/SVUI/packages/stats/stats/guild.lua index e7d2370..56b3c40 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/guild.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/guild.lua @@ -59,7 +59,7 @@ local guildFormattedFaction = join("|cff", patternColor, "%s:|r |cFFFFFFFF%s/%s local guildFormattedOnline = join("", "+ %d ", FRIENDS_LIST_ONLINE, "..."); local guildFormattedNote = join("", "|cff999999 ", LABEL_NOTE, ":|r %s"); local guildFormattedRank = join("", "|cff999999 ", GUILD_RANK1_DESC, ":|r %s"); -local GuildStatMembers,GuildStatXP,GuildStatMOTD = {},{},""; +local GuildStatMembers,GuildStatMOTD = {},""; local currentObject; local UnitFlagFormat = { @@ -104,7 +104,7 @@ local function SortGuildStatMembers(shift) end end end) -end; +end local function GetGuildStatMembers() twipe(GuildStatMembers) @@ -118,25 +118,12 @@ local function GetGuildStatMembers() GuildStatMembers[#GuildStatMembers + 1] = { name, rank, level, zone, note, officernote, online, statusFormat, classFileName, rankIndex, isMobile} end end -end; - -local function GetGuildStatXP() - local currentXP, nextLevelXP = UnitGetGuildXP("player") - local totalXP = currentXP + nextLevelXP; - local percent; - if currentXP > 0 and totalXP > 0 then - percent = ceil(currentXP / totalXP * 100) - else - percent = 0 - end; - GuildStatXP[0] = { currentXP, totalXP, percent } -end; +end local GuildStatEventHandler = { ["PLAYER_ENTERING_WORLD"] = function(arg1, arg2) if not GuildFrame and IsInGuild() then LoadAddOn("Blizzard_GuildUI") - GetGuildStatXP() GuildRoster() end end, @@ -151,9 +138,6 @@ local GuildStatEventHandler = { end end end, - ["GUILD_XP_UPDATE"] = function(arg1, arg2) - GetGuildStatXP() - end, ["PLAYER_GUILD_UPDATE"] = function(arg1, arg2) GuildRoster() end, @@ -167,29 +151,29 @@ local GuildStatEventHandler = { local function MenuInvite(self, unit) GuildDatatTextRightClickMenu:Hide() InviteUnit(unit) -end; +end local function MenuRightClick(self, unit) GuildDatatTextRightClickMenu:Hide() SetItemRef(("player:%s"):format(unit), ("|Hplayer:%1$s|h[%1$s]|h"):format(unit), "LeftButton") -end; +end local function MenuLeftClick() if IsInGuild() then if not GuildFrame then LoadAddOn("Blizzard_GuildUI") - end; + end GuildFrame_Toggle() GuildFrame_TabClicked(GuildFrameTab2) else if not LookingForGuildFrame then LoadAddOn("Blizzard_LookingForGuildUI") - end; + end if LookingForGuildFrame then LookingForGuildFrame_Toggle() end end -end; +end local function Guild_OnEvent(self, event, ...) currentObject = self; @@ -199,7 +183,7 @@ local function Guild_OnEvent(self, event, ...) else self.text:SetText(L['No Guild']) end -end; +end local function Guild_OnClick(self, button) if button == "RightButton" and IsInGuild() then @@ -228,11 +212,11 @@ local function Guild_OnClick(self, button) notCheckable = true, func = MenuInvite } - end; + end menuCountWhispers = menuCountWhispers + 1; if not grouped then grouped = "" - end; + end MenuMap[3].menuList[menuCountWhispers] = { text = ("|cff%02x%02x%02x%d|r |cff%02x%02x%02x%s|r %s"):format(levelc.r*255, levelc.g*255, levelc.b*255, info[3], classc.r*255, classc.g*255, classc.b*255, info[1], grouped), arg1 = info[1], @@ -240,46 +224,38 @@ local function Guild_OnClick(self, button) func = MenuRightClick } end - end; + end EasyMenu(MenuMap, GuildDatatTextRightClickMenu, "cursor", 0, 0, "MENU", 2) else MenuLeftClick() end -end; +end local function Guild_OnEnter(self, _, ap) if not IsInGuild() then return - end; + end MOD:Tip(self) local aq, ar = GetNumGuildMembers() - if #GuildStatMembers == 0 then GetGuildStatMembers() end; + if #GuildStatMembers == 0 then GetGuildStatMembers() end SortGuildStatMembers(IsShiftKeyDown()) - local as, at = GetGuildInfo('player') - local au = GetGuildLevel() - if as and at and au then - MOD.tooltip:AddDoubleLine(("%s [%d]"):format(as, au), guildFormattedName:format(GUILD, ar, aq), 0.4, 0.78, 1, 0.4, 0.78, 1) - MOD.tooltip:AddLine(at, 0.4, 0.78, 1) - end; + local guildName, guildRankName, guildRankIndex = GetGuildInfo('player') + if guildName and guildRankName then + MOD.tooltip:AddDoubleLine(("%s "):format(guildName), guildFormattedName:format(GUILD, ar, aq), 0.4, 0.78, 1, 0.4, 0.78, 1) + MOD.tooltip:AddLine(guildRankName, 0.4, 0.78, 1) + end if GuildStatMOTD ~= "" then MOD.tooltip:AddLine(' ') MOD.tooltip:AddLine(("%s |cffaaaaaa- |cffffffff%s"):format(GUILD_MOTD, GuildStatMOTD), 0.75, 0.9, 1, 1) - end; + end local av = SuperVillain:HexColor(0.75,0.9,1) - if GetGuildLevel() ~= 25 then - if GuildStatXP[0] then - local Z, a0, a1 = unpack(GuildStatXP[0]) - MOD.tooltip:AddLine(' ') - MOD.tooltip:AddLine(guildFormattedXP:format(TruncateString(Z), TruncateString(a0), a1)) - end - end; local _, _, standingID, barMin, barMax, barValue = GetGuildFactionInfo() if standingID ~= 8 then barMax = barMax - barMin; barValue = barValue - barMin; barMin = 0; MOD.tooltip:AddLine(guildFormattedFaction:format(COMBAT_FACTION_CHANGE, TruncateString(barValue), TruncateString(barMax), ceil(barValue / barMax * 100))) - end; + end local zoneColor, classColor, questColor, member, groupFormat; local counter = 0; MOD.tooltip:AddLine(' ') @@ -287,39 +263,39 @@ local function Guild_OnEnter(self, _, ap) if((30 - counter) <= 1) then if((ar - 30) > 1) then MOD.tooltip:AddLine(guildFormattedOnline:format(ar - 30), 0.75, 0.9, 1) - end; + end break - end; + end member = GuildStatMembers[X] if GetRealZoneText() == member[4]then zoneColor = {r=0.3,g=1.0,b=0.3} else zoneColor = {r=0.65,g=0.65,b=0.65} - end; + end classColor, questColor = RAID_CLASS_COLORS[member[9]], GetQuestDifficultyColor(member[3]) if UnitInParty(member[1]) or UnitInRaid(member[1]) then groupFormat = "|cffaaaaaa*|r" else groupFormat = "" - end; + end if IsShiftKeyDown() then MOD.tooltip:AddDoubleLine(("%s |cff999999-|cffffffff %s"):format(member[1], member[2]), member[4], classColor.r, classColor.g, classColor.b, zoneColor.r, zoneColor.g, zoneColor.b) if member[5] ~= ""then MOD.tooltip:AddLine(guildFormattedNote:format(member[5]), 0.75, 0.9, 1, 1) - end; + end if member[6] ~= ""then MOD.tooltip:AddLine(guildFormattedRank:format(member[6]), 0.3, 1, 0.3, 1) end else MOD.tooltip:AddDoubleLine(("|cff%02x%02x%02x%d|r %s%s %s"):format(questColor.r*255, questColor.g*255, questColor.b*255, member[3], member[1], groupFormat, member[8]), member[4], classColor.r, classColor.g, classColor.b, zoneColor.r, zoneColor.g, zoneColor.b) - end; + end counter = counter + 1 - end; + end MOD:ShowTip() if not ap then GuildRoster() end -end; +end local GuildColorUpdate = function() local hexColor = SuperVillain:HexColor("highlight"); @@ -327,7 +303,7 @@ local GuildColorUpdate = function() if currentObject ~= nil then Guild_OnEvent(currentObject, 'SVUI_COLOR_UPDATE') end -end; -SuperVillain.Registry:SetCallback(GuildColorUpdate) +end +SuperVillain.Registry:NewCallback(GuildColorUpdate) MOD:Extend('Guild', StatEvents, Guild_OnEvent, nil, Guild_OnClick, Guild_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/hps.lua b/Interface/AddOns/SVUI/packages/stats/stats/hps.lua index 46ba6d0..1a47746 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/hps.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/hps.lua @@ -130,5 +130,5 @@ local HPSColorUpdate = function() end end -SuperVillain.Registry:SetCallback(HPSColorUpdate) +SuperVillain.Registry:NewCallback(HPSColorUpdate) MOD:Extend('HPS', StatEvents, HPS_OnEvent, nil, HPS_OnClick, HPS_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/time.lua b/Interface/AddOns/SVUI/packages/stats/stats/time.lua index 3bec845..ffde932 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/time.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/time.lua @@ -231,6 +231,6 @@ local ColorUpdate = function() end end; -SuperVillain.Registry:SetCallback(ColorUpdate) +SuperVillain.Registry:NewCallback(ColorUpdate) MOD:Extend('Time', {"UPDATE_INSTANCE_INFO"}, OnEvent, Update, Click, OnEnter, OnLeave) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tip/SVTip.lua b/Interface/AddOns/SVUI/packages/tip/SVTip.lua index cf45924..86c1ebe 100644 --- a/Interface/AddOns/SVUI/packages/tip/SVTip.lua +++ b/Interface/AddOns/SVUI/packages/tip/SVTip.lua @@ -875,44 +875,44 @@ local function ApplyTooltipSkins() tooltip.SuperBorder = mask if tooltip.Background then - tooltip.Background:SetTexture(0,0,0,0) + tooltip.Background:SetTexture("") end if tooltip.Delimiter1 then - tooltip.Delimiter1:SetTexture(0,0,0,0) - tooltip.Delimiter2:SetTexture(0,0,0,0) + tooltip.Delimiter1:SetTexture("") + tooltip.Delimiter2:SetTexture("") end if tooltip.BorderTop then - tooltip.BorderTop:SetTexture(0,0,0,0) + tooltip.BorderTop:SetTexture("") end if tooltip.BorderTopLeft then - tooltip.BorderTopLeft:SetTexture(0,0,0,0) + tooltip.BorderTopLeft:SetTexture("") end if tooltip.BorderTopRight then - tooltip.BorderTopRight:SetTexture(0,0,0,0) + tooltip.BorderTopRight:SetTexture("") end if tooltip.BorderLeft then - tooltip.BorderLeft:SetTexture(0,0,0,0) + tooltip.BorderLeft:SetTexture("") end if tooltip.BorderRight then - tooltip.BorderRight:SetTexture(0,0,0,0) + tooltip.BorderRight:SetTexture("") end if tooltip.BorderBottom then - tooltip.BorderBottom:SetTexture(0,0,0,0) + tooltip.BorderBottom:SetTexture("") end if tooltip.BorderBottomRight then - tooltip.BorderBottomRight:SetTexture(0,0,0,0) + tooltip.BorderBottomRight:SetTexture("") end if tooltip.BorderBottomLeft then - tooltip.BorderBottomLeft:SetTexture(0,0,0,0) + tooltip.BorderBottomLeft:SetTexture("") end tooltip:SetBackdrop({ diff --git a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua index 626e670..bcf0679 100644 --- a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua +++ b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua @@ -556,7 +556,9 @@ function MOD:RefreshUnitLayout(frame, template) if(GRID_MODE) then if(self.db.grid.shownames and self.db.grid.size >= 30) then if(not nametext:IsShown()) then nametext:Show() end - nametext:Point("CENTER", frame, "CENTER", 1, 0) + nametext:Point("CENTER", frame, "CENTER", 0, 0) + nametext:SetJustifyH("CENTER") + nametext:SetJustifyV("MIDDLE") frame:Tag(nametext, "[name:grid]") else nametext:Hide() @@ -567,6 +569,23 @@ function MOD:RefreshUnitLayout(frame, template) cY = db.name.yOffset nametext:ClearAllPoints() SuperVillain:ReversePoint(nametext, point, infoPanel, cX, cY) + + if(nametext.initialAnchor:find("RIGHT")) then + nametext:SetJustifyH("RIGHT") + elseif(nametext.initialAnchor:find("LEFT")) then + nametext:SetJustifyH("LEFT") + else + nametext:SetJustifyH("CENTER") + end + + if(nametext.initialAnchor:find("TOP")) then + nametext:SetJustifyV("TOP") + elseif(nametext.initialAnchor:find("BOTTOM")) then + nametext:SetJustifyV("BOTTOM") + else + nametext:SetJustifyV("MIDDLE") + end + frame:Tag(nametext, db.name.tags) end end diff --git a/Interface/AddOns/SVUI/packages/unit/elements/auras.lua b/Interface/AddOns/SVUI/packages/unit/elements/auras.lua index 32a36fe..9e1baec 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/auras.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/auras.lua @@ -108,8 +108,8 @@ local PostCreateAuraIcon = function(self, aura) aura.cd.noOCC = true; aura.cd.noCooldownCount = true; aura.cd:SetReverse() - aura.overlay:SetTexture(0,0,0,0) - aura.stealable:SetTexture(0,0,0,0) + aura.overlay:SetTexture("") + aura.stealable:SetTexture("") if aura.styled then return end if aura.SetNormalTexture then aura:SetNormalTexture("") end diff --git a/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua b/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua index 426dbbc..d1fac21 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua @@ -311,8 +311,12 @@ local function CreateNameText(frame, unitName) name:SetShadowColor(0, 0, 0, 1) if unitNmae == "target" then name:SetPoint("RIGHT", frame) + name:SetJustifyH("RIGHT") + name:SetJustifyV("MIDDLE") else name:SetPoint("CENTER", frame) + name:SetJustifyH("CENTER") + name:SetJustifyV("MIDDLE") end return name; end diff --git a/Interface/AddOns/SVUI/packages/unit/elements/tags.lua b/Interface/AddOns/SVUI/packages/unit/elements/tags.lua index c957aad..ff13651 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/tags.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/tags.lua @@ -88,7 +88,7 @@ local function SetTagStyle(style, min, max) result = format("%s%%", format("%.1f", min / max * 100)) result = result:gsub(".0%%", "%%") return result - elseif style == "CURRENT" or (style == "CURRENT_MAX" or style == "CURRENT_MAX_PERCENT" or style == "CURRENT_PERCENT") and min == max then + elseif style == "CURRENT" or ((style == "CURRENT_MAX" or style == "CURRENT_MAX_PERCENT" or style == "CURRENT_PERCENT") and min == max) then return format("%s", TruncateString(min)) elseif style == "CURRENT_MAX" then return format("%s - %s", TruncateString(min), TruncateString(max)) @@ -97,7 +97,7 @@ local function SetTagStyle(style, min, max) result = result:gsub(".0%%", "%%") return result elseif style == "CURRENT_MAX_PERCENT" then - result = format("%s - %s | %s%%", TruncateString(min), TruncateString(max), format("%.1f", min / max * 100)) + result = format("%s - %s - %s%%", TruncateString(min), TruncateString(max), format("%.1f", min / max * 100)) result = result:gsub(".0%%", "%%") return result end @@ -215,6 +215,7 @@ oUF_SuperVillain.Tags.Events["health:deficit"] = "UNIT_HEALTH_FREQUENT UNIT_MAXH oUF_SuperVillain.Tags.Events["health:current"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"; oUF_SuperVillain.Tags.Events["health:curmax"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"; oUF_SuperVillain.Tags.Events["health:curpercent"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"; +oUF_SuperVillain.Tags.Events["health:curmax-percent"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"; oUF_SuperVillain.Tags.Events["health:percent"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"; oUF_SuperVillain.Tags.Events["power:color"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER"; @@ -335,6 +336,8 @@ oUF_SuperVillain.Tags.Methods["health:curmax"] = function(f)local i = UnitIsDead oUF_SuperVillain.Tags.Methods["health:curpercent"] = function(f)local i = UnitIsDead(f)and DEAD or UnitIsGhost(f)and L["Ghost"]or not UnitIsConnected(f)and L["Offline"]if i then return i else return SetTagStyle("CURRENT_PERCENT", UnitHealth(f), UnitHealthMax(f))end end +oUF_SuperVillain.Tags.Methods["health:curmax-percent"] = function(f)local i = UnitIsDead(f)and DEAD or UnitIsGhost(f)and L["Ghost"]or not UnitIsConnected(f)and L["Offline"]if i then return i else return SetTagStyle("CURRENT_MAX_PERCENT", UnitHealth(f), UnitHealthMax(f))end end + oUF_SuperVillain.Tags.Methods["health:percent"] = function(f)local i = UnitIsDead(f)and DEAD or UnitIsGhost(f)and L["Ghost"]or not UnitIsConnected(f)and L["Offline"]if i then return i else return SetTagStyle("PERCENT", UnitHealth(f), UnitHealthMax(f))end end oUF_SuperVillain.Tags.Methods["health:deficit"] = function(f)local i = UnitIsDead(f)and DEAD or UnitIsGhost(f)and L["Ghost"]or not UnitIsConnected(f)and L["Offline"]if i then return i else return SetTagStyle("DEFICIT", UnitHealth(f), UnitHealthMax(f))end end diff --git a/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua b/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua index 15540ad..ba9d9d2 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua @@ -118,23 +118,23 @@ CUSTOM HANDLERS local UpdateTextures = function(bar, spec, max) if max == 0 then max = 4 end if spec == SPEC_WARLOCK_DEMONOLOGY then - bar[1].overlay:SetTexture(0,0,0,0) - bar[1].underlay:SetTexture(0,0,0,0) + bar[1].overlay:SetTexture("") + bar[1].underlay:SetTexture("") SuperVillain.Animate:StopFlash(bar[1].overlay) bar[1].underlay.anim:Finish() - bar[2].overlay:SetTexture(0,0,0,0) - bar[2].underlay:SetTexture(0,0,0,0) + bar[2].overlay:SetTexture("") + bar[2].underlay:SetTexture("") SuperVillain.Animate:StopFlash(bar[2].overlay) bar[2].underlay.anim:Finish() - bar[3].overlay:SetTexture(0,0,0,0) - bar[3].underlay:SetTexture(0,0,0,0) + bar[3].overlay:SetTexture("") + bar[3].underlay:SetTexture("") SuperVillain.Animate:StopFlash(bar[3].overlay) bar[3].underlay.anim:Finish() - bar[4].overlay:SetTexture(0,0,0,0) - bar[4].underlay:SetTexture(0,0,0,0) + bar[4].overlay:SetTexture("") + bar[4].underlay:SetTexture("") SuperVillain.Animate:StopFlash(bar[4].overlay) bar[4].underlay.anim:Finish() bar.CurrentSpec = spec diff --git a/Interface/AddOns/SVUI/scripts/misc.lua b/Interface/AddOns/SVUI/scripts/misc.lua index 1b60ba9..9628ecd 100644 --- a/Interface/AddOns/SVUI/scripts/misc.lua +++ b/Interface/AddOns/SVUI/scripts/misc.lua @@ -82,7 +82,7 @@ local function LoadStyledChatBubbles() region:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Chat\CHATBUBBLE-TAIL]]) needsUpdate = false else - region:SetTexture(0,0,0,0) + region:SetTexture("") end elseif(region:GetObjectType() == "FontString" and not frame.text) then frame.text = region diff --git a/Interface/AddOns/SVUI/scripts/raid.lua b/Interface/AddOns/SVUI/scripts/raid.lua index afd86e4..27e387c 100644 --- a/Interface/AddOns/SVUI/scripts/raid.lua +++ b/Interface/AddOns/SVUI/scripts/raid.lua @@ -236,6 +236,7 @@ local function LoadRaidUtility() CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateRolePoll:SetPoint("BOTTOMRIGHT", CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateReadyCheck, "TOPRIGHT", 0, 1) do + --[[NEEDS TESTING]]-- local buttons = { "CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton", "DisbandRaidButton", @@ -246,15 +247,14 @@ local function LoadRaidUtility() "RaidUtility_CloseButton" } - for i, button in pairs(buttons) do - local f = _G[button] - _G[button.."Left"]:SetAlpha(0) - _G[button.."Middle"]:SetAlpha(0) - _G[button.."Right"]:SetAlpha(0) - f:Formula409() - f:SetFramedButtonTemplate() - f:HookScript("OnEnter", ButtonEnter) - f:HookScript("OnLeave", ButtonLeave) + for i, gName in pairs(buttons) do + local button = _G[gName] + if(button) then + button:Formula409() + button:SetFramedButtonTemplate() + button:HookScript("OnEnter", ButtonEnter) + button:HookScript("OnLeave", ButtonLeave) + end end end end diff --git a/Interface/AddOns/SVUI/scripts/spellbind.lua b/Interface/AddOns/SVUI/scripts/spellbind.lua index 01f269b..5343c4e 100644 --- a/Interface/AddOns/SVUI/scripts/spellbind.lua +++ b/Interface/AddOns/SVUI/scripts/spellbind.lua @@ -204,7 +204,7 @@ local function binder_BuildSpells(self, delete) i = 1 while _G[i.."_cbs"] do _G[i.."_fs"]:SetText("") - _G[i.."_texture"]:SetTexture(0,0,0,0) + _G[i.."_texture"]:SetTexture("") _G[i.."_cbs"].checked = false _G[i.."_cbs"]:ClearAllPoints() _G[i.."_cbs"]:Hide() diff --git a/Interface/AddOns/SVUI/system/cartography.lua b/Interface/AddOns/SVUI/system/cartography.lua index 49f0573..631f8d4 100644 --- a/Interface/AddOns/SVUI/system/cartography.lua +++ b/Interface/AddOns/SVUI/system/cartography.lua @@ -153,13 +153,15 @@ do for C in pairs(continents) do local zones = { GetMapZones(C) }; continents[C] = zones; - SetMapZoom(C, 0); - zones[0] = GetCurrentMapAreaID(); - _getmapdata(_cache); - for Z in ipairs(zones) do - SetMapZoom(C, Z); - zones[Z] = GetCurrentMapAreaID(); + local pass, error = pcall(SetMapZoom, C, 0) + if(pass) then + zones[0] = GetCurrentMapAreaID(); _getmapdata(_cache); + for Z in ipairs(zones) do + SetMapZoom(C, Z); + zones[Z] = GetCurrentMapAreaID(); + _getmapdata(_cache); + end end end diff --git a/Interface/AddOns/SVUI/system/common.lua b/Interface/AddOns/SVUI/system/common.lua index 8ae228c..61f7e2d 100644 --- a/Interface/AddOns/SVUI/system/common.lua +++ b/Interface/AddOns/SVUI/system/common.lua @@ -261,11 +261,11 @@ local function Formula409(self, option) end target:Hide() elseif(target:GetDrawLayer() == option) then - target:SetTexture(0,0,0,0) + target:SetTexture("") elseif(option and (type(option) == "string") and (target:GetTexture() ~= option)) then - target:SetTexture(0,0,0,0) + target:SetTexture("") else - target:SetTexture(0,0,0,0) + target:SetTexture("") end end end @@ -322,7 +322,7 @@ function SuperVillain:UpdateFontTemplates() FontTemplateUpdates() end -SuperVillain.Registry:SetCallback(FontTemplateUpdates) +SuperVillain.Registry:NewCallback(FontTemplateUpdates) --[[ ########################################################## APPENDED TEMPLATING METHODS @@ -752,9 +752,10 @@ local function CreatePanelTemplate(frame, templateName, underlay, noupdate, padd frame._color = colorName; frame._gradient = gradientName; frame._texture = false; - frame._noupdate = bypass; + frame._noupdate = bypass; - local panel = NewFrame('Frame', nil, frame) + local panel; + if(not frame.Panel) then panel = NewFrame('Frame', nil, frame) else panel = frame.Panel end panel:Point('TOPLEFT', frame, 'TOPLEFT', (xOffset * -1), yOffset) panel:Point('BOTTOMRIGHT', frame, 'BOTTOMRIGHT', xOffset, (yOffset * -1)) @@ -906,11 +907,14 @@ local function CreatePanelTemplate(frame, templateName, underlay, noupdate, padd bottomLeft:SetPoint("TOPLEFT", frame.Panel, "LEFT", 0, 0) bottomLeft:SetVertexColor(0.1, 0.1, 0.1, 0.5) bottomLeft:SetNonBlocking(true) - end + end local level = frame:GetFrameLevel() - frame:SetFrameLevel(level + 1) + if(level > 0) then level = level - 1 end frame.Panel:SetFrameLevel(level) + if(level == 0 and not InCombatLockdown()) then + frame:SetFrameLevel(1) + end end local function HasCooldown(n) @@ -989,8 +993,68 @@ end TEMPLATE API ########################################################## ]]-- +local function SetBasicPanel(self, topX, topY, bottomX, bottomY, hasShadow) + if(not self or (self and self.Panel)) then return end + + local frame = self + + local currentLevel = self:GetFrameLevel() + if(currentLevel == 0) then + currentLevel = 1 + end + + if(not self.Panel) then self.Panel = CreateFrame("Frame", nil, frame) end + + if(hasShadow) then + self.Panel:SetPoint("TOPLEFT", frame, "TOPLEFT", -2, 2) + self.Panel:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 2, -2) + self.Panel:SetFrameLevel(currentLevel - 1) + + self.Panel:SetBackdrop({ + bgFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], + edgeSize = 3, + insets = + { + left = 0, + right = 0, + top = 0, + bottom = 0, + }, + }) + self.Panel:SetBackdropColor(0,0,0,0) + self.Panel:SetBackdropBorderColor(0,0,0) + else + self.Panel:SetPoint("TOPLEFT", frame, "TOPLEFT", topX, topY) + self.Panel:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", bottomX, bottomY) + self.Panel:SetFrameLevel(currentLevel - 1) + + self.Panel:SetBackdrop({ + bgFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + edgeSize = 1, + insets = + { + left = 1, + right = 1, + top = 1, + bottom = 1, + }, + }) + self.Panel:SetBackdropColor(0,0,0,0.65) + self.Panel:SetBackdropBorderColor(0,0,0) + end + + NewHook(frame, "SetBackdrop", HookBackdrop) + NewHook(frame, "SetBackdropColor", HookBackdropColor) + NewHook(frame, "SetBackdropBorderColor", HookBackdropBorderColor) +end + local function SetPanelTemplate(self, templateName, noupdate, overridePadding, xOffset, yOffset) - if(self.Panel) then return; end if(not templateName or not _templates[templateName]) then templateName = 'Default' end local padding = false @@ -1006,8 +1070,7 @@ local function SetPanelTemplate(self, templateName, noupdate, overridePadding, x end local function SetFixedPanelTemplate(self, templateName, noupdate, overridePadding, xOffset, yOffset) - if(self.Panel) then return; end - if(not templateName or not _templates[templateName]) then templateName = 'Default' end + if(not templateName or not _templates[templateName]) then templateName = 'Default' end local padding = false if(overridePadding and type(overridePadding) == "number") then @@ -1130,7 +1193,7 @@ local function SetSlotTemplate(self, underlay, padding, x, y, noChecked) if self.styled then return end padding = padding or 1 CreatePanelTemplate(self, "Slot", underlay, true, padding, x, y) - CreateButtonPanel(self, noChecked) + --CreateButtonPanel(self, noChecked) self.styled = true end @@ -1167,7 +1230,7 @@ local function SetEditboxTemplate(self, x, y) if self.RightTex then MUNG(self.RightTex) end if self.MiddleTex then MUNG(self.MiddleTex) end - CreatePanelTemplate(self, "Inset", true, true, 1, x, y) + CreatePanelTemplate(self, "Inset", false, true, 1, x, y) local globalName = self:GetName(); if globalName then @@ -1298,7 +1361,7 @@ local function FrameTemplateUpdates() end end end -SuperVillain.Registry:SetCallback(FrameTemplateUpdates) +SuperVillain.Registry:NewCallback(FrameTemplateUpdates) --[[ ########################################################## ENUMERATION @@ -1314,6 +1377,7 @@ local function AppendMethods(OBJECT) if not OBJECT.FillInner then META.FillInner = FillInner end if not OBJECT.MUNG then META.MUNG = MUNG end if not OBJECT.Formula409 then META.Formula409 = Formula409 end + if not OBJECT.SetBasicPanel then META.SetBasicPanel = SetBasicPanel end if not OBJECT.SetPanelTemplate then META.SetPanelTemplate = SetPanelTemplate end if not OBJECT.SetFixedPanelTemplate then META.SetFixedPanelTemplate = SetFixedPanelTemplate end if not OBJECT.SetPanelColor then META.SetPanelColor = SetPanelColor end diff --git a/Interface/AddOns/SVUI/system/installer.lua b/Interface/AddOns/SVUI/system/installer.lua index 8dc4494..6ca8edd 100644 --- a/Interface/AddOns/SVUI/system/installer.lua +++ b/Interface/AddOns/SVUI/system/installer.lua @@ -62,7 +62,6 @@ end local function forceCVars() SetCVar("alternateResourceText",1) SetCVar("statusTextDisplay","BOTH") - SetCVar("mapQuestDifficulty",1) SetCVar("ShowClassColorInNameplate",1) SetCVar("screenshotQuality",10) SetCVar("chatMouseScroll",1) diff --git a/Interface/AddOns/SVUI/system/mentalo.lua b/Interface/AddOns/SVUI/system/mentalo.lua index 9a5e00e..e5c4575 100644 --- a/Interface/AddOns/SVUI/system/mentalo.lua +++ b/Interface/AddOns/SVUI/system/mentalo.lua @@ -236,6 +236,18 @@ theHand:SetFrameLevel(99) theHand:SetClampedToScreen(true) theHand:SetSize(128,128) theHand:SetPoint("CENTER") +theHand.bg = theHand:CreateTexture(nil, "OVERLAY") +theHand.bg:SetAllPoints(theHand) +theHand.bg:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-HAND-OFF]]) +theHand.energy = theHand:CreateTexture(nil, "OVERLAY") +theHand.energy:SetAllPoints(theHand) +theHand.energy:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-ENERGY]]) +SuperVillain.Animate:Orbit(theHand.energy, 10) +theHand.flash = theHand.energy.anim; +theHand.energy:Hide() +theHand.elapsedTime = 0; +theHand.flash:Stop() +theHand:Hide() --[[ ########################################################## LOCAL FUNCTIONS @@ -689,19 +701,6 @@ function SuperVillain:SetSVMovablesPositions() end function SuperVillain:LoadMovables() - theHand.bg = theHand:CreateTexture(nil, "OVERLAY") - theHand.bg:SetAllPoints(theHand) - theHand.bg:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-HAND-OFF]]) - theHand.energy = theHand:CreateTexture(nil, "OVERLAY") - theHand.energy:SetAllPoints(theHand) - theHand.energy:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-ENERGY]]) - self.Animate:Orbit(theHand.energy, 10) - theHand.flash = theHand.energy.anim; - theHand.energy:Hide() - theHand.elapsedTime = 0; - theHand.flash:Stop() - theHand:Hide() - for name, _ in pairs(self.MentaloFrames)do local parent, text, overlay, snapoffset, postdrag; for key, value in pairs(self.MentaloFrames[name])do diff --git a/Interface/AddOns/SVUI/system/system.lua b/Interface/AddOns/SVUI/system/system.lua index 2105d91..c6599f1 100644 --- a/Interface/AddOns/SVUI/system/system.lua +++ b/Interface/AddOns/SVUI/system/system.lua @@ -69,41 +69,52 @@ DISPEL MECHANICS ########################################################## ]]-- local droodSpell1, droodSpell2 = GetSpellInfo(110309), GetSpellInfo(4987); -local RefClassRoles; +local RefClassRoles, RefUnitRoles; local RefMagicSpec; -- canBeTank, canBeHealer, canBeDPS = UnitGetAvailableRoles("unit") do if(toonClass == "PRIEST") then RefClassRoles = {"C", "C", "C"} + RefUnitRoles = {"HEALER", "HEALER", "DAMAGER"} SuperVillain.Dispellable = {["Magic"] = true, ["Disease"] = true} elseif(toonClass == "WARLOCK") then RefClassRoles = {"C", "C", "C"} + RefUnitRoles = {"DAMAGER", "DAMAGER", "DAMAGER"} elseif(toonClass == "WARRIOR") then RefClassRoles = {"M", "M", "T"} + RefUnitRoles = {"DAMAGER", "DAMAGER", "TANK"} elseif(toonClass == "HUNTER") then RefClassRoles = {"M", "M", "M"} + RefUnitRoles = {"DAMAGER", "DAMAGER", "DAMAGER"} elseif(toonClass == "ROGUE") then RefClassRoles = {"M", "M", "M"} + RefUnitRoles = {"DAMAGER", "DAMAGER", "DAMAGER"} elseif(toonClass == "MAGE") then RefClassRoles = {"C", "C", "C"} + RefUnitRoles = {"DAMAGER", "DAMAGER", "DAMAGER"} SuperVillain.Dispellable = {["Curse"] = true} elseif(toonClass == "DEATHKNIGHT") then RefClassRoles = {"T", "M", "M"} + RefUnitRoles = {"TANK", "DAMAGER", "DAMAGER"} elseif(toonClass == "DRUID") then RefMagicSpec = 4 RefClassRoles = {"C", "M", "T", "C"} + RefUnitRoles = {"DAMAGER", "DAMAGER", "TANK", "HEALER"} SuperVillain.Dispellable = {["Curse"] = true, ["Poison"] = true} elseif(toonClass == "SHAMAN") then RefMagicSpec = 3 RefClassRoles = {"C", "M", "C"} + RefUnitRoles = {"DAMAGER", "DAMAGER", "HEALER"} SuperVillain.Dispellable = {["Curse"] = true} elseif(toonClass == "MONK") then RefMagicSpec = 2 RefClassRoles = {"T", "C", "M"} + RefUnitRoles = {"TANK", "HEALER", "DAMAGER"} SuperVillain.Dispellable = {["Disease"] = true, ["Poison"] = true} elseif(toonClass == "PALADIN") then RefMagicSpec = 1 RefClassRoles = {"C", "T", "M"} + RefUnitRoles = {"HEALER", "TANK", "DAMAGER"} SuperVillain.Dispellable = {["Poison"] = true, ["Disease"] = true} end end @@ -118,10 +129,11 @@ end function SuperVillain:DefinePlayerRole() local spec = GetSpecialization() - local role; + local role, unitRole; if spec then if(self.CurrentSpec == spec) then return end role = RefClassRoles[spec] + unitRole = RefUnitRoles[spec] if role == "T" and UnitLevel("player") == MAX_PLAYER_LEVEL then local bonus, pvp = GetCombatRatingBonus(COMBAT_RATING_RESILIENCE_PLAYER_DAMAGE_TAKEN), false; if bonus > GetDodgeChance() and bonus > GetParryChance() then @@ -129,6 +141,7 @@ function SuperVillain:DefinePlayerRole() end end self.CurrentSpec = spec + self.RoleIsSet = true else local intellect = select(2, UnitStat("player", 4)) local agility = select(2, UnitStat("player", 2)) @@ -139,11 +152,16 @@ function SuperVillain:DefinePlayerRole() else role = "C" end - end - if self.ClassRole ~= role and self.RoleChangedCallback then + end + if self.UnitRole ~= unitRole then + self.UnitRole = unitRole + end + if self.ClassRole ~= role then self.ClassRole = role; - self.RoleChangedCallback() - end + if self.RoleChangedCallback then + self.RoleChangedCallback() + end + end if RefMagicSpec then if(GetTalentInfo(RefMagicSpec)) then self.Dispellable["Magic"] = true @@ -151,7 +169,6 @@ function SuperVillain:DefinePlayerRole() self.Dispellable["Magic"] = nil end end - self.RoleIsSet = true end --[[ ########################################################## @@ -198,7 +215,7 @@ function SuperVillain:ToggleConfig() local _,_,_,_,_,state = GetAddOnInfo("SVUI_ConfigOMatic") if state ~= "MISSING" and state ~= "DISABLED" then LoadAddOn("SVUI_ConfigOMatic") - local config_version = GetAddOnMetadata("SVUI_ConfigOMatic","Version") + local config_version = GetAddOnMetadata("SVUI_ConfigOMatic", "Version") if(tonumber(config_version) < 4) then self:StaticPopup_Show("CLIENT_UPDATE_REQUEST") end diff --git a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua index 911f9fa..a2ae678 100644 --- a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua +++ b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua @@ -51,10 +51,9 @@ local SVUIAddOnName, PLUGIN = ...; local SuperVillain, L = unpack(SVUI); local CONFIGS = SuperVillain.Configs local NewHook = hooksecurefunc; -local SVUIAddonEventHandler = CreateFrame("Frame", nil) -local version = GetAddOnMetadata(..., "Version"); -PLUGIN = SuperVillain:Prototype(SVUIAddOnName, version) +PLUGIN = SuperVillain:Prototype(SVUIAddOnName) +local SCHEMA = PLUGIN.___schema; _G["WhisperVillain"] = PLUGIN; --[[ @@ -65,17 +64,12 @@ LOCAL VARS local playerName = UnitName("player"); local playerRealm = GetRealmName(); -local LeftToolBarButton = CreateFrame("Button", nil, UIParent) local ConjugationKeys = {[1]={[1]="are",[2]="am",[3]="were",[4]="was",[5]="I",[6]="me",[7]="you",[8]="my",[9]="your",[10]="mine",[11]="your's",[12]="I'm",[13]="you're",[14]="I've",[15]="you've",[16]="I'll",[17]="you'll",[18]="myself",[19]="yourself"},[2]={[1]="am",[2]="are",[3]="was",[4]="were",[5]="you",[6]="you",[7]="me",[8]="your",[9]="my",[10]="your's",[11]="mine",[12]="you're",[13]="I'm",[14]="you've",[15]="I've",[16]="you'll",[17]="I'll",[18]="yourself",[19]="myself"},[3]={[1]="me am",[2]="am me",[3]="mecan",[4]="can me",[5]="me have",[6]="me will",[7]="will me"},[4]={[1]="I am",[2]="am I",[3]="I can",[4]="can I",[5]="I have",[6]="I will",[7]="will I"}}; local punctuations = {[1]={pattern="%.",value="."},[2]={pattern=",",value=","},[3]={pattern="!",value="!"},[4]={pattern="%?",value="?"},[5]={pattern=":",value=":"},[6]={pattern=";",value=";"},[7]={pattern="&",value="&"},[8]={pattern="\"",value="\""},[9]={pattern="@",value="@"},[10]={pattern="#",value="#"},[11]={pattern="%(",value="("},[12]={pattern="%)",value=")"}}; -local AnsweringService = CreateFrame("Frame"); -local PhoneTimeHandler = CreateFrame("Frame") - local PhoneLines = {}; local ResponseQueue = {}; -local Events = {}; -local ElapsedUpdate = 0; + local ICON_FILE = [[Interface\AddOns\SVUI_AnsweringService\artwork\DOCK-CALL]] --[[ ########################################################## @@ -437,47 +431,10 @@ LOCAL FUNCTIONS ########################################################## ]]-- local function ServiceMessage(msg) - local msgFrom = SuperVillain.db.SVAnswer.prefix == true and "Minion Answering Service" or ""; + local msgFrom = SuperVillain.db[SCHEMA].prefix == true and "Minion Answering Service" or ""; print("|cffffcc1a" .. msgFrom .. ":|r", msg) end -local function AddCaller(caller) - local state_text = "now on hold."; - local call_answered = false - PhoneLines[caller] = { - Line = 1, - InUse = false, - FirstResponse = true, - Caller = caller, - InBound = "", - OutBound = "", - LastKey = 1, - TimeStamp = 0 - }; - for x = 1, 5, 1 do - local btn = _G["HenchmenPhoneLine"..x]; - if(btn.Text:GetText() ~= caller) then - btn.Text:SetText(caller); - PhoneLines[caller].Line = x - call_answered = true - if SuperVillain.db.SVAnswer.autoAnswer == true then - PhoneLines[caller].InUse = true; - btn:SetPanelColor("green"); - LeftToolBarButton:SetPanelColor("green"); - LeftToolBarButton.stateColor = SuperVillain.Media.gradient.green - state_text = "on the line."; - PlaySoundFile("Sound\\interface\\iQuestUpdate.wav") - end - break; - end - end - if(not call_answered) then - ServiceMessage("All lines are busy. New caller ("..caller..") was disconnected.") - else - ServiceMessage("New caller ("..caller..") is "..state_text) - end -end - local function ClearResponses(caller) for x = 1, #ResponseQueue, 1 do if ResponseQueue[x] then @@ -500,55 +457,6 @@ local function RemoveCaller(caller) ServiceMessage("Caller ("..caller..") was disconnected."); end end - -local function GetServiceState() - local inUse = false - local onHold = false - for x = 1, 5, 1 do - local btn = _G["HenchmenPhoneLine"..x]; - local caller = btn.Text:GetText() - if(PhoneLines[caller]) then - inUse = true - if(not PhoneLines[caller].InUse) then - onHold = true - end - end - end - - if inUse then - if onHold then - LeftToolBarButton:SetPanelColor("yellow") - LeftToolBarButton.icon:SetGradient(unpack(SuperVillain.Media.gradient.yellow)) - LeftToolBarButton.stateColor = SuperVillain.Media.gradient.yellow - else - LeftToolBarButton:SetPanelColor("green") - LeftToolBarButton.icon:SetGradient(unpack(SuperVillain.Media.gradient.green)) - LeftToolBarButton.stateColor = SuperVillain.Media.gradient.green - end - else - LeftToolBarButton:SetPanelColor("default") - LeftToolBarButton.stateColor = SuperVillain.Media.gradient.default - end - return inUse,onHold -end - -local function HangUp(caller,ignored) - RemoveCaller(caller) - local inUse,onHold = GetServiceState() - - if inUse == false then - _G["HenchmenOperator"]:Hide() - elseif onHold == true then - _G["HenchmenOperator"]:Show() - else - _G["HenchmenOperator"]:Show() - end - - if(ignored) then - ServiceMessage(caller.." is now ignoring you! MwaaHaHa!") - PlaySoundFile("Sound\\interface\\RaidWarning.wav") - end -end --[[ ########################################################## MESSAGE PROCESSING @@ -790,39 +698,146 @@ do end end end + +function PLUGIN:AddCaller(caller) + local state_text = "now on hold."; + local call_answered = false + PhoneLines[caller] = { + Line = 1, + InUse = false, + FirstResponse = true, + Caller = caller, + InBound = "", + OutBound = "", + LastKey = 1, + TimeStamp = 0 + }; + for x = 1, 5, 1 do + local btn = _G["HenchmenPhoneLine"..x]; + if(btn.Text:GetText() ~= caller) then + btn.Text:SetText(caller); + PhoneLines[caller].Line = x + call_answered = true + if self.db.autoAnswer == true then + PhoneLines[caller].InUse = true; + btn:SetPanelColor("green"); + self.Docklet:SetPanelColor("green"); + self.Docklet.stateColor = SuperVillain.Media.gradient.green + state_text = "on the line."; + PlaySoundFile("Sound\\interface\\iQuestUpdate.wav") + end + break; + end + end + if(not call_answered) then + ServiceMessage("All lines are busy. New caller ("..caller..") was disconnected.") + else + ServiceMessage("New caller ("..caller..") is "..state_text) + end +end + +function PLUGIN:GetServiceState() + local inUse = false + local onHold = false + for x = 1, 5, 1 do + local btn = _G["HenchmenPhoneLine"..x]; + local caller = btn.Text:GetText() + if(PhoneLines[caller]) then + inUse = true + if(not PhoneLines[caller].InUse) then + onHold = true + end + end + end + + if inUse then + if onHold then + self.Docklet:SetPanelColor("yellow") + self.Docklet.icon:SetGradient(unpack(SuperVillain.Media.gradient.yellow)) + self.Docklet.stateColor = SuperVillain.Media.gradient.yellow + else + self.Docklet:SetPanelColor("green") + self.Docklet.icon:SetGradient(unpack(SuperVillain.Media.gradient.green)) + self.Docklet.stateColor = SuperVillain.Media.gradient.green + end + else + self.Docklet:SetPanelColor("default") + self.Docklet.stateColor = SuperVillain.Media.gradient.default + end + return inUse,onHold +end + +function PLUGIN:HangUp(caller,ignored) + RemoveCaller(caller) + local inUse,onHold = self:GetServiceState() + + if inUse == false then + self.Window:Hide() + elseif onHold == true then + self.Window:Show() + else + self.Window:Show() + end + + if(ignored) then + ServiceMessage(caller.." is now ignoring you! MwaaHaHa!") + PlaySoundFile("Sound\\interface\\RaidWarning.wav") + end +end --[[ ########################################################## EVENTS ########################################################## ]]-- -local function AnsweringServiceEventHandler(self, event, ...) - local handler = Events[event] - if handler then handler(...) end +function PLUGIN:PhoneTimeUpdate() + local timer = 300; + local ttime = GetTime() + if #ResponseQueue > 0 then + for x = 1, #ResponseQueue, 1 do + if ResponseQueue[x] then + if ResponseQueue[x].ETA < ttime then + SendChatMessage(ResponseQueue[x].MSG, "WHISPER", nil, ResponseQueue[x].CID) + tremove(ResponseQueue, x) + end + end + end + end + if ttime > timer then + for x = 1, 5, 1 do + local btn = _G["HenchmenPhoneLine"..x]; + local caller = btn.Text:GetText() + if(PhoneLines[caller]) then + if PhoneLines[caller].TimeStamp < (ttime - timer) then + self:HangUp(caller) + end + end + end + end end -function Events.CHAT_MSG_IGNORED(inbound_message, caller, ...) +function PLUGIN:CHAT_MSG_IGNORED(inbound_message, caller, ...) if(PhoneLines[caller] and PhoneLines[caller].InUse) then - HangUp(caller,true) + self:HangUp(caller,true) end end -function Events.CHAT_MSG_WHISPER(inbound_message, caller) +function PLUGIN:CHAT_MSG_WHISPER(inbound_message, caller) if not UnitIsAFK("player") and not UnitIsDND("player") then if (not PhoneLines[caller]) then - AddCaller(caller) + self:AddCaller(caller) end - PLUGIN:TakeAMessage(caller, inbound_message) + self:TakeAMessage(caller, inbound_message) end end -function Events.CHAT_MSG_BN_WHISPER(inbound_message, sender, _, _, _, _, _, _, _, _, _, _, presenceID) +function PLUGIN:CHAT_MSG_BN_WHISPER(inbound_message, sender, _, _, _, _, _, _, _, _, _, _, presenceID) if not UnitIsAFK("player") and not UnitIsDND("player") then local _, bnToon = BNGetToonInfo(presenceID); local caller = bnToon or sender; if (not PhoneLines[caller]) then - AddCaller(caller) + self:AddCaller(caller) end - PLUGIN:TakeAMessage(caller, inbound_message) + self:TakeAMessage(caller, inbound_message) end end --[[ @@ -830,6 +845,15 @@ end OTHER HANDLERS ########################################################## ]]-- +local AnsweringOnClick = function() + if(not PLUGIN.Window) then return end + if(PLUGIN.Window:IsShown()) then + PLUGIN.Window:Hide() + else + PLUGIN.Window:Show() + end +end + local PhoneLineClick = function(self, button) local caller = self.Text:GetText() if((caller == "Empty Phone Line") or not PhoneLines[caller]) then return; end @@ -845,39 +869,9 @@ local PhoneLineClick = function(self, button) ServiceMessage(caller.." is now on hold") end elseif button == "RightButton" then - HangUp(caller) - end - GetServiceState() -end - -local PhoneTimeUpdate = function(self, elapsed) - ElapsedUpdate = ElapsedUpdate + elapsed - if ElapsedUpdate > 4 then - local timer = 300; - local ttime = GetTime() - ElapsedUpdate = 0 - if #ResponseQueue > 0 then - for x = 1, #ResponseQueue, 1 do - if ResponseQueue[x] then - if ResponseQueue[x].ETA < ttime then - SendChatMessage(ResponseQueue[x].MSG, "WHISPER", nil, ResponseQueue[x].CID) - tremove(ResponseQueue, x) - end - end - end - end - if ttime > timer then - for x = 1, 5, 1 do - local btn = _G["HenchmenPhoneLine"..x]; - local caller = btn.Text:GetText() - if(PhoneLines[caller]) then - if PhoneLines[caller].TimeStamp < (ttime - timer) then - HangUp(caller) - end - end - end - end + PLUGIN:HangUp(caller) end + PLUGIN:GetServiceState() end --[[ ########################################################## @@ -885,7 +879,7 @@ LOAD AND CONSTRUCT ########################################################## ]]-- local function LoadOptions() - SuperVillain.Options.args.plugins.args.pluginOptions.args.SVAnswer = { + SuperVillain.Options.args.plugins.args.pluginOptions.args[SCHEMA] = { type = "group", name = L["Answering Service"], childGroups = "tree", @@ -894,88 +888,85 @@ local function LoadOptions() order = 1, type = "toggle", name = "Enable", - get = function(a)return SuperVillain.db.SVAnswer.enable end, - set = function(a,b)SuperVillain.db.SVAnswer.enable = b;SuperVillain:StaticPopup_Show("RL_CLIENT")end + get = function(a)return SuperVillain.db[SCHEMA].enable end, + set = function(a,b)SuperVillain.db[SCHEMA].enable = b;SuperVillain:StaticPopup_Show("RL_CLIENT")end }, autoAnswer = { order = 2, type = "toggle", name = "Auto Answer", - get = function(a)return SuperVillain.db.SVAnswer.autoAnswer end, - set = function(a,b)SuperVillain.db.SVAnswer.autoAnswer = b end + get = function(a)return SuperVillain.db[SCHEMA].autoAnswer end, + set = function(a,b) SuperVillain.db[SCHEMA].autoAnswer = b end }, prefix = { order = 3, type = "toggle", name = "Prefix Messages", - get = function(a)return SuperVillain.db.SVAnswer.prefix end, - set = function(a,b)SuperVillain.db.SVAnswer.prefix = b end + get = function(a)return SuperVillain.db[SCHEMA].prefix end, + set = function(a,b) SuperVillain.db[SCHEMA].prefix = b end }, } } end -local AnsweringOnClick = function() - if HenchmenOperator:IsShown() then - HenchmenOperator:Hide() - else - HenchmenOperator:Show() - end -end +function PLUGIN:Load() + if(not SuperVillain.db[SCHEMA].enable) then return end -local function LoadAnsweringService() - if(not SuperVillain.db.SVAnswer.enable) then return end - - PLUGIN.db = SuperVillain.db.SVAnswer + self.db = SuperVillain.db[SCHEMA] - AnsweringService:SetScript("OnEvent", AnsweringServiceEventHandler) - AnsweringService:RegisterEvent("CHAT_MSG_WHISPER") - AnsweringService:RegisterEvent("CHAT_MSG_BN_WHISPER") - AnsweringService:RegisterEvent("CHAT_MSG_IGNORED") - PhoneTimeHandler:SetScript("OnUpdate", PhoneTimeUpdate) + self:RegisterEvent("CHAT_MSG_WHISPER") + self:RegisterEvent("CHAT_MSG_BN_WHISPER") + self:RegisterEvent("CHAT_MSG_IGNORED") + self:RegisterUpdate("PhoneTimeUpdate", 4) local buttonsize = SuperDockToolBarLeft.currentSize - LeftToolBarButton:SetParent(SuperDockToolBarLeft) - LeftToolBarButton:Point("LEFT", SuperDockToolBarLeft, "LEFT", 3, 0) - LeftToolBarButton:Size(buttonsize, buttonsize) - LeftToolBarButton:SetFramedButtonTemplate() - LeftToolBarButton.icon = LeftToolBarButton:CreateTexture(nil, "OVERLAY") - LeftToolBarButton.icon:FillInner(LeftToolBarButton,2,2) - LeftToolBarButton.icon:SetTexture(ICON_FILE) - LeftToolBarButton.stateColor = SuperVillain.Media.gradient.special - LeftToolBarButton.TText = L["Show / Hide Phone Lines"] - LeftToolBarButton:RegisterForClicks("AnyUp") - SuperVillain.SVDock:ActivateDockletButton(LeftToolBarButton, AnsweringOnClick) + + local docklet = CreateFrame("Button", nil, SuperVillain.UIParent) + docklet:SetParent(SuperDockToolBarLeft) + docklet:Point("LEFT", SuperDockToolBarLeft, "LEFT", 3, 0) + docklet:Size(buttonsize, buttonsize) + docklet:SetFramedButtonTemplate() + docklet.icon = docklet:CreateTexture(nil, "OVERLAY") + docklet.icon:FillInner(docklet,2,2) + docklet.icon:SetTexture(ICON_FILE) + docklet.stateColor = SuperVillain.Media.gradient.special + docklet.TText = L["Show / Hide Phone Lines"] + docklet:RegisterForClicks("AnyUp") + + SuperVillain.SVDock:ActivateDockletButton(docklet, AnsweringOnClick) SuperDockToolBarLeft:SetWidth(buttonsize + 4) - local f = CreateFrame("Frame", "HenchmenOperator", UIParent) - f:SetFrameStrata("MEDIUM") - f:SetWidth(128) - f:SetHeight(145) - f:SetScript("OnDragStart", function(self) self:StartMoving() end) - f:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() end) - f:SetPoint("BOTTOMRIGHT",LeftSuperDock,"TOPRIGHT",0,6) - f:SetFixedPanelTemplate("Transparent") - f:SetMovable(true) - f:EnableMouse(true) - f:SetClampedToScreen(true) - f:RegisterForDrag("LeftButton") - - local title = f:CreateFontString("HenchmenOperatorText") + self.Docklet = docklet + + local window = CreateFrame("Frame", nil, SuperVillain.UIParent) + window:SetFrameStrata("MEDIUM") + window:SetWidth(128) + window:SetHeight(145) + window:SetScript("OnDragStart", function(this) this:StartMoving() end) + window:SetScript("OnDragStop", function(this) this:StopMovingOrSizing() end) + window:SetPoint("BOTTOMRIGHT", LeftSuperDock, "TOPRIGHT", 0, 6) + window:SetFixedPanelTemplate("Transparent") + window:SetMovable(true) + window:EnableMouse(true) + window:SetClampedToScreen(true) + window:RegisterForDrag("LeftButton") + + local title = window:CreateFontString("HenchmenOperatorText") title:SetWidth(128) title:SetHeight(50) title:SetFontObject(GameFontNormal) title:SetTextColor(0.5, 0.5, 1, 1) title:SetJustifyH("CENTER") title:SetJustifyV("TOP") - title:SetPoint("TOP", "HenchmenOperator", "TOP", 0, -2) + title:SetPoint("TOP", window, "TOP", 0, -2) title:SetText("Henchman Answering Service") + for x = 1, 5, 1 do - local phLn = CreateFrame("Button", "HenchmenPhoneLine"..x, f) + local phLn = CreateFrame("Button", "HenchmenPhoneLine"..x, window) phLn:SetWidth(124) phLn:SetHeight(20) - phLn:SetPoint("TOPLEFT", "HenchmenOperator", "TOPLEFT", 2, ((-16) - (x * 21))) + phLn:SetPoint("TOPLEFT", window, "TOPLEFT", 2, ((-16) - (x * 21))) phLn:RegisterForClicks("AnyUp") phLn:SetScript("OnClick", PhoneLineClick) phLn:SetFixedPanelTemplate("Button") @@ -990,21 +981,25 @@ local function LoadAnsweringService() phLn.Text:SetText("Empty Phone Line") end - HenchmenOperator:Hide() + self.Window = window + self.Window:Hide() + + local strMsg - if SuperVillain.db.SVAnswer.autoAnswer == true then + if SuperVillain.db[SCHEMA].autoAnswer == true then strMsg = "The Henchmen Operators Are Screening Your Calls.." else strMsg = "The Henchmen Operators Are Standing By.." end SuperVillain:AddonMessage(strMsg) + + LoadOptions() end -CONFIGS["SVAnswer"] = { +CONFIGS[SCHEMA] = { ["enable"] = false, ["autoAnswer"] = false, ["prefix"] = true } -SuperVillain.Registry:NewScript(LoadAnsweringService) -SuperVillain.Registry:NewPlugin(PLUGIN, "SVAnswer", LoadOptions) \ No newline at end of file +SuperVillain.Registry:NewPlugin(PLUGIN) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.toc b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.toc index 790babd..874927d 100644 --- a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.toc +++ b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.toc @@ -1,8 +1,10 @@ -## Interface: 50400 +## Interface: 60000 ## Author: Munglunch -## Version: 4.084 +## Version: 5.02 ## Title: |cffFF9900SVUI |r|cffFFEF00Answering Service|r -## Notes: Supervillain UI [|cff9911FFAutomatic Whispers|r]. +## Notes: Supervillain UI [|cff9911FFAutomatic Whispers|r] +## LoadOnDemand: 1 ## RequiredDeps: SVUI +## X-SVUI: SVAnswer SVUI_AnsweringService.lua diff --git a/Interface/AddOns/SVUI_ArtOfWar/Bindings.xml b/Interface/AddOns/SVUI_ArtOfWar/Bindings.xml index f0778e8..05e6324 100644 --- a/Interface/AddOns/SVUI_ArtOfWar/Bindings.xml +++ b/Interface/AddOns/SVUI_ArtOfWar/Bindings.xml @@ -1,5 +1,5 @@ <Bindings> - <Binding name="Call Out Incoming" header="SVUIAOW" runOnUp="false"> + <Binding name="SayIncoming" description="Call Out Incoming" header="SVUIAOW" runOnUp="false"> SVUISayIncoming() </Binding> </Bindings> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua index d4ce857..7a77a7a 100644 --- a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua +++ b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua @@ -50,10 +50,9 @@ local SVUIAddOnName, PLUGIN = ...; local SuperVillain, L = unpack(SVUI); local CONFIGS = SuperVillain.Configs local NewHook = hooksecurefunc; -local SVUIAddonEventHandler = CreateFrame("Frame", nil) -local version = GetAddOnMetadata(..., "Version") -PLUGIN = SuperVillain:Prototype(SVUIAddOnName, version) +PLUGIN = SuperVillain:Prototype(SVUIAddOnName) +local SCHEMA = PLUGIN.___schema; _G["WarVillain"] = PLUGIN; --[[ @@ -189,37 +188,37 @@ local function AddEnemyScan(guid, timestamp) end local function SaveEnemyScan(guid, timestamp) - local e = EnemyCache[guid] - if(not e) then e = AddEnemyScan(guid, timestamp) end + local enemy = EnemyCache[guid] + if(not enemy) then enemy = AddEnemyScan(guid, timestamp) end SVAOW_Cache[guid] = { - ["name"] = e.name, - ["realm"] = e.realm, - ["class"] = e.class, - ["race"] = e.race, - ["sex"] = e.sex, - ["colors"] = e.colors, - ["time"] = e.timestamp + ["name"] = enemy.name, + ["realm"] = enemy.realm, + ["class"] = enemy.class, + ["race"] = enemy.race, + ["sex"] = enemy.sex, + ["colors"] = enemy.colors, + ["time"] = enemy.timestamp } - local msg = ("Killed By: %s"):format(e.name); - HeadsUpAlarm(msg, CombatText_StandardScroll, e.colors.r, e.colors.g, e.colors.b, "sticky"); + local msg = ("Killed By: %s"):format(enemy.name); + HeadsUpAlarm(msg, CombatText_StandardScroll, enemy.colors.r, enemy.colors.g, enemy.colors.b, "sticky"); PLUGIN:UpdateSummary() end local function KilledEnemyHandler(guid) - local e = SVAOW_Cache[guid] - if(e) then - HeadsUpAlarm(("Killed Mortal Enemy: %s"):format(e.name), CombatText_StandardScroll, 0.2, 1, 0.1, "sticky"); + local enemy = SVAOW_Cache[guid] + if(enemy) then + HeadsUpAlarm(("Killed Mortal Enemy: %s"):format(enemy.name), CombatText_StandardScroll, 0.2, 1, 0.1, "sticky"); end - e = EnemyCache[guid] - if(e) then - HeadsUpAlarm(("Killed Enemy: %s"):format(e.name), CombatText_StandardScroll, 0.1, 0.8, 0); + enemy = EnemyCache[guid] + if(enemy) then + HeadsUpAlarm(("Killed Enemy: %s"):format(enemy.name), CombatText_StandardScroll, 0.1, 0.8, 0); end end local function ClearCacheScans() wipe(EnemyCache) wipe(AlertedCache) - PLUGIN.LOG.Output:Clear(); + if(PLUGIN.LOG and PLUGIN.LOG.Output) then PLUGIN.LOG.Output:Clear() end end local function ClearSavedScans() @@ -371,7 +370,7 @@ function PLUGIN:UpdateCommunicator() end end self.InPVP = true - SVUIAddonEventHandler:UnregisterEvent("UPDATE_BATTLEFIELD_SCORE") + self:UnregisterEvent("UPDATE_BATTLEFIELD_SCORE") self.Scanning = false self:PauseScanner() end @@ -389,7 +388,7 @@ function PLUGIN:UpdateCommunicator() node:Hide() end self.InPVP = nil - SVUIAddonEventHandler:RegisterEvent("UPDATE_BATTLEFIELD_SCORE") + self:RegisterEvent("UPDATE_BATTLEFIELD_SCORE") self.Scanning = true self:PopulateScans() @@ -460,6 +459,7 @@ local function ParseIncomingLog(timestamp, event, eGuid, eName, pGuid) end local function GetSourceType(guid) + if not guid then return end local subStr, binStr, bitVal, srcType subStr = guid:sub(3, 5) binStr = ("0x%s"):format(subStr) @@ -468,7 +468,8 @@ local function GetSourceType(guid) return srcType end -function PLUGIN:CombatLogScanner(timestamp, event, _, srcGUID, srcName, srcFlags, sourceRaidFlags, dstGUID, dstName, dstFlags, destRaidFlags, _, spellName) +function PLUGIN:COMBAT_LOG_EVENT_UNFILTERED(timestamp, event, _, srcGUID, srcName, srcFlags, sourceRaidFlags, dstGUID, dstName, dstFlags, destRaidFlags, _, spellName) + if not srcFlags then return end local flagParse = band(srcFlags, COMBATLOG_OBJECT_REACTION_HOSTILE) local flagged = flagParse == COMBATLOG_OBJECT_REACTION_HOSTILE @@ -476,7 +477,7 @@ function PLUGIN:CombatLogScanner(timestamp, event, _, srcGUID, srcName, srcFlags if(srcGUID and srcName) then local isHostile = CombatLog_Object_IsA(srcFlags, COMBATLOG_FILTER_HOSTILE_PLAYERS) local srcType = GetSourceType(srcGUID) - if((srcType == 0 or srcType == 8) and isHostile) then + if(srcType and (srcType == 0 or srcType == 8) and isHostile) then if(event == "SPELL_AURA_APPLIED" and (spellName == L["Stealth"] or spellName == L["Prowl"])) then StealthAlarm(spellName) end @@ -491,7 +492,7 @@ function PLUGIN:CombatLogScanner(timestamp, event, _, srcGUID, srcName, srcFlags if(PLUGIN.Scanning and dstGUID and dstName) then local isHostile = CombatLog_Object_IsA(dstFlags, COMBATLOG_FILTER_HOSTILE_PLAYERS) local srcType = GetSourceType(dstGUID) - if((srcType == 0 or srcType == 8) and isHostile) then + if(srcType and (srcType == 0 or srcType == 8) and isHostile) then ParseIncomingLog(timestamp, event, dstGUID, dstName, srcGUID) end end @@ -504,56 +505,38 @@ function PLUGIN:CombatLogScanner(timestamp, event, _, srcGUID, srcName, srcFlags end end -function PLUGIN:TargetChanged() - if(UnitIsPlayer("target") and UnitIsEnemy("target", "player")) then - local guid = UnitGUID("target") - if(not EnemyCache[guid]) then - local timestamp = time() - AddEnemyScan(guid, timestamp) - end - if(SVAOW_Cache[guid]) then - HeadsUpAlarm("Kill On Sight!", CombatText_StandardScroll, 1, 0, 0, "crit") - end - end -end - -function PLUGIN:TheyGotMe() - local guid = PLUGIN.HitBy - if(guid and guid ~= "") then - local stamp = time() - SaveEnemyScan(guid, stamp) - end -end +function PLUGIN:EventDistributor(event, ...) + local inInstance, instanceType = IsInInstance() -local Registry_OnEvent = function(self, event, ...) if(event == "PLAYER_REGEN_ENABLED") then - PLUGIN.HitBy = false; - elseif(event == "COMBAT_LOG_EVENT_UNFILTERED") then - PLUGIN:CombatLogScanner(...) + self.HitBy = false; + if(instanceType == "pvp") then self.Scanning = false end else - local inInstance, instanceType = IsInInstance() - if(instanceType == "pvp") then - PLUGIN.Scanning = false - end - - if(event == "PLAYER_ENTERING_WORLD" or event == "UPDATE_BATTLEFIELD_SCORE") then - PLUGIN:UpdateCommunicator() - elseif(event == "PLAYER_TARGET_CHANGED") then - if(instanceType ~= "pvp") then - PLUGIN:TargetChanged() - end - elseif(event == "PLAYER_DEAD") then - if(instanceType ~= "pvp") then - PLUGIN:TheyGotMe() + if(instanceType ~= "pvp") then + if(event == "PLAYER_TARGET_CHANGED") then + if(UnitIsPlayer("target") and UnitIsEnemy("target", "player")) then + local guid = UnitGUID("target") + if(not EnemyCache[guid]) then + local timestamp = time() + AddEnemyScan(guid, timestamp) + end + if(SVAOW_Cache[guid]) then + HeadsUpAlarm("Kill On Sight!", CombatText_StandardScroll, 1, 0, 0, "crit") + end + end + elseif(event == "PLAYER_DEAD") then + local guid = self.HitBy + if(guid and guid ~= "") then + local stamp = time() + SaveEnemyScan(guid, stamp) + end end else - PLUGIN:UpdateZoneStatus() + self.Scanning = false end end end -SVUIAddonEventHandler:SetScript("OnEvent", Registry_OnEvent) - local onMouseWheel = function(self, delta) if (delta > 0) then self:ScrollUp() @@ -598,16 +581,6 @@ local function MakeLogWindow() PLUGIN.LOG = frame _G["SVUI_ArtOfWarTool1"].Window = PLUGIN.LOG - - SVUIAddonEventHandler:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") - SVUIAddonEventHandler:RegisterEvent("ZONE_CHANGED") - SVUIAddonEventHandler:RegisterEvent("ZONE_CHANGED_NEW_AREA") - SVUIAddonEventHandler:RegisterEvent("PLAYER_ENTERING_WORLD") - SVUIAddonEventHandler:RegisterEvent("PLAYER_TARGET_CHANGED") - SVUIAddonEventHandler:RegisterEvent("PLAYER_REGEN_ENABLED") - SVUIAddonEventHandler:RegisterEvent("PLAYER_DEAD") - SVUIAddonEventHandler:RegisterEvent("UNIT_FACTION") - SVUIAddonEventHandler:RegisterEvent("UPDATE_BATTLEFIELD_SCORE") end local function MakeCommWindow() @@ -869,7 +842,7 @@ BUILD FUNCTION ########################################################## ]]-- local function LoadOptions() - SuperVillain.Options.args.plugins.args.pluginOptions.args.SVAOW = { + SuperVillain.Options.args.plugins.args.pluginOptions.args[SCHEMA] = { type = "group", name = L["Art of War"], childGroups = "tree", @@ -878,29 +851,29 @@ local function LoadOptions() order = 1, type = "toggle", name = "Enable", - get = function(a) return SuperVillain.db.SVAOW.enable end, - set = function(a,b)SuperVillain.db.SVAOW.enable = b; SuperVillain:StaticPopup_Show("RL_CLIENT") end + get = function(a) return SuperVillain.db[SCHEMA].enable end, + set = function(a,b)SuperVillain.db[SCHEMA].enable = b; SuperVillain:StaticPopup_Show("RL_CLIENT") end } } } end -local function LoadWarVillain() - if(not SuperVillain.db.SVAOW.enable) then return end +function PLUGIN:Load() + if(not SuperVillain.db[SCHEMA].enable) then return end local ALERT_HEIGHT = 60; local DOCK_WIDTH = SuperDockWindowRight:GetWidth(); local DOCK_HEIGHT = SuperDockWindowRight:GetHeight(); local BUTTON_SIZE = (DOCK_HEIGHT * 0.25) - 4; - PLUGIN.db = SuperVillain.db.SVAOW + self.db = SuperVillain.db[SCHEMA] if(not SVAOW_Data) then SVAOW_Data = {} end if(not SVAOW_Cache) then SVAOW_Cache = {} end - PLUGIN.HitBy = false; - PLUGIN.Scanning = false; - PLUGIN.InPVP = false + self.HitBy = false; + self.Scanning = false; + self.InPVP = false local holder = CreateFrame("Frame", "SVUI_ArtOfWarDock", SuperDockWindowRight) holder:SetFrameStrata("BACKGROUND") @@ -989,7 +962,7 @@ local function LoadWarVillain() divider1:SetPoint("BOTTOMRIGHT") divider1:SetHeight(1) - PLUGIN.Title = title + self.Title = title local listbutton = CreateFrame("Button", nil, holder) listbutton:SetPoint("TOPLEFT", title, "BOTTOMLEFT",0,0) @@ -1000,7 +973,7 @@ local function LoadWarVillain() listbutton:SetScript("OnLeave", Switch_OnLeave) listbutton:SetScript("OnClick", Switch_OnClick) - PLUGIN.Switch = listbutton + self.Switch = listbutton local summary = CreateFrame("ScrollingMessageFrame", nil, holder) summary:SetSpacing(4) @@ -1014,7 +987,7 @@ local function LoadWarVillain() summary:SetFading(false) summary:SetInsertMode('TOP') - PLUGIN.Summary = summary + self.Summary = summary local divider2 = summary:CreateTexture(nil,"OVERLAY") divider2:SetTexture(0,0,0,0.5) @@ -1031,23 +1004,38 @@ local function LoadWarVillain() holder:Hide() - PLUGIN:ResetLogs() + self:ResetLogs() local targetButton = CreateFrame("Button", "SVUI_TargetScanButton", UIParent, "SecureActionButtonTemplate") - targetButton:SetAllPoints(PLUGIN.LOG) + targetButton:SetAllPoints(self.LOG) targetButton:SetFrameLevel(99) targetButton:RegisterForClicks("AnyUp") targetButton:SetAttribute("type1", "macro") targetButton:SetAttribute("macrotext", "/tar") targetButton:EnableMouse(false) - targetButton:HookScript("OnClick", function(self) self:EnableMouse(false) end) + targetButton:HookScript("OnClick", function(this) this:EnableMouse(false) end) + + self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") + + self:RegisterEvent("PLAYER_TARGET_CHANGED", "EventDistributor") + self:RegisterEvent("PLAYER_REGEN_ENABLED", "EventDistributor") + self:RegisterEvent("PLAYER_DEAD", "EventDistributor") + + self:RegisterEvent("ZONE_CHANGED", "UpdateZoneStatus") + self:RegisterEvent("ZONE_CHANGED_NEW_AREA", "UpdateZoneStatus") + self:RegisterEvent("UNIT_FACTION", "UpdateZoneStatus") + + self:RegisterEvent("PLAYER_ENTERING_WORLD", "UpdateCommunicator") + self:RegisterEvent("UPDATE_BATTLEFIELD_SCORE", "UpdateCommunicator") + + LoadOptions() end ---/tar Munglunch +-- /tar Sinnisterr +-- /tar Munglunch -CONFIGS["SVAOW"] = { +CONFIGS[SCHEMA] = { ["enable"] = true } -SuperVillain.Registry:NewScript(LoadWarVillain) -SuperVillain.Registry:NewPlugin(PLUGIN, "SVAOW", LoadOptions) \ No newline at end of file +SuperVillain.Registry:NewPlugin(PLUGIN) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.toc b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.toc index 9d5aad5..1ac9e65 100644 --- a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.toc +++ b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.toc @@ -1,10 +1,11 @@ -## Interface: 50400 +## Interface: 60000 ## Author: Munglunch -## Version: 4.084 +## Version: 5.02 ## Title: |cffFF9900SVUI |r|cffFFEF00Art of War|r ## Notes: Supervillain UI [|cff9911FFPvP Tools|r]. ## SavedVariables: SVAOW_Data ## SavedVariablesPerCharacter: SVAOW_Cache ## RequiredDeps: SVUI +## X-SVUI: SVAOW SVUI_ArtOfWar.lua diff --git a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc index 81e44c3..b75cd33 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc +++ b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc @@ -1,9 +1,11 @@ -## Interface: 50400 -## Author: Munglunch, Elv -## Version: 4.084 +## Interface: 60000 +## Author: Munglunch +## Version: 5.02 ## Title: |cffFF9900SVUI |r|cffFFEF00Config O Matic|r ## Notes: Supervillain UI [|cff9911FFConfig Options|r] ## RequiredDeps: SVUI ## LoadOnDemand: 1 +## X-Notes: Special thanks to Elv and Tukz for their incredible work. +## X-Email: munglunch@gmail.com _load.xml diff --git a/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua b/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua index 01c1808..7e5052a 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua @@ -101,7 +101,7 @@ local function UpdateButton(button, treeline, selected, canExpand, isExpanded) button.icon:SetTexture(icon) button.icon:SetPoint("LEFT", 8 * level, (level == 1) and 0 or 1) else - button.icon:SetTexture(0,0,0,0) + button.icon:SetTexture("") end if iconCoords then diff --git a/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua b/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua index f8411b4..a63260c 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua @@ -83,7 +83,7 @@ local function Constructor() frame:SetScript("OnMouseDown", Label_OnClick) local highlight = frame:CreateTexture(nil, "HIGHLIGHT") - highlight:SetTexture(0,0,0,0) + highlight:SetTexture("") highlight:SetAllPoints() highlight:SetBlendMode("ADD") diff --git a/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/prototypes.lua b/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/prototypes.lua index 6d304c7..7347931 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/prototypes.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/prototypes.lua @@ -268,7 +268,7 @@ do frame:ClearAllPoints() frame:Hide() frame:SetBackdrop(frameBackdrop) - frame.bgTex:SetTexture(0,0,0,0) + frame.bgTex:SetTexture("") table.insert(DropDownCache, frame) return nil end diff --git a/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua b/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua index 0e6236d..f54cce4 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua @@ -101,7 +101,7 @@ local function UpdateButton(button, treeline, selected, canExpand, isExpanded) button.icon:SetTexture(icon) button.icon:SetPoint("LEFT", 8 * level, (level == 1) and 0 or 1) else - button.icon:SetTexture(0,0,0,0) + button.icon:SetTexture("") end if iconCoords then diff --git a/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua b/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua index f8411b4..a63260c 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua @@ -83,7 +83,7 @@ local function Constructor() frame:SetScript("OnMouseDown", Label_OnClick) local highlight = frame:CreateTexture(nil, "HIGHLIGHT") - highlight:SetTexture(0,0,0,0) + highlight:SetTexture("") highlight:SetAllPoints() highlight:SetBlendMode("ADD") diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua index 008d80d..1d4bef2 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua @@ -49,6 +49,7 @@ local textStringFormats = { ["percent"] = "Percent", ["curpercent"] = "Current - Percent", ["curmax"] = "Current - Maximum", + ["curmax-percent"] = "Current - Maximum | %", } --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_DebugOMatic/Bindings.xml b/Interface/AddOns/SVUI_DebugOMatic/Bindings.xml new file mode 100644 index 0000000..0aece78 --- /dev/null +++ b/Interface/AddOns/SVUI_DebugOMatic/Bindings.xml @@ -0,0 +1,5 @@ +<Bindings> + <Binding name="Frame Debugger" description="Frame Stack Analyzer" header="SVUIDEBUG" runOnUp="false"> + DebugThisFrame() + </Binding> +</Bindings> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_DebugOMatic/SVUI_DebugOMatic.toc b/Interface/AddOns/SVUI_DebugOMatic/SVUI_DebugOMatic.toc new file mode 100644 index 0000000..47da00f --- /dev/null +++ b/Interface/AddOns/SVUI_DebugOMatic/SVUI_DebugOMatic.toc @@ -0,0 +1,9 @@ +## Interface: 50400 +## Author: Munglunch, Azilroka, Sortokk +## Version: 1.6 +## Title: |cffFF9900SVUI |r|cffFFEF00Debug O Matic|r +## Notes: Supervillain UI Debugging. +## RequiredDeps: SVUI +## OptionalDeps: Blizzard_DebugTools + +SVUI_DebugOMatic.xml diff --git a/Interface/AddOns/SVUI_DebugOMatic/SVUI_DebugOMatic.xml b/Interface/AddOns/SVUI_DebugOMatic/SVUI_DebugOMatic.xml new file mode 100644 index 0000000..a3f97ba --- /dev/null +++ b/Interface/AddOns/SVUI_DebugOMatic/SVUI_DebugOMatic.xml @@ -0,0 +1,116 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Script file='debug.lua'/> + + <Frame name="SVUI_ScriptError" movable="true" hidden="true" frameStrata="DIALOG"> + <Size x="384" y="260"/> + <Anchors> + <Anchor point="TOPLEFT"/> + </Anchors> + <Layers> + <Layer level="BACKGROUND"> + <Texture name="$parentBG" setAllPoints="true"/> + </Layer> + <Layer level="OVERLAY"> + <Texture name="$parentTitleBG"> + <Anchors> + <Anchor point="TOPLEFT"> + <Offset x="8" y="-8"/> + </Anchor> + <Anchor point="BOTTOMRIGHT" relativePoint="TOPRIGHT"> + <Offset x="-32" y="-24"/> + </Anchor> + </Anchors> + </Texture> + <Texture name="$parentDialogBG"> + <Anchors> + <Anchor point="TOPLEFT"> + <Offset x="8" y="-32"/> + </Anchor> + <Anchor point="BOTTOMRIGHT"> + <Offset x="-32" y="32"/> + </Anchor> + </Anchors> + </Texture> + </Layer> + <Layer level="ARTWORK"> + <FontString parentKey="Title" inherits="GameFontNormal"> + <Anchors> + <Anchor point="TOPLEFT"> + <Offset x="8" y="-8"/> + </Anchor> + <Anchor point="TOPRIGHT"> + <Offset x="-32" y="-24"/> + </Anchor> + </Anchors> + </FontString> + <FontString parentKey="sourceLabel" font="GameFontNormalCenter"> + <Size x="140" y="16"/> + <Anchors> + <Anchor point="BOTTOMLEFT"> + <Offset x="104" y="8"/> + </Anchor> + </Anchors> + </FontString> + </Layer> + </Layers> + <Frames> + <ScrollFrame name="$parentDialog" inherits="MinimalScrollFrameTemplate"> + <Size x="343" y="194"/> + <Anchors> + <Anchor point="TOPLEFT"> + <Offset x="12" y="-30"/> + </Anchor> + </Anchors> + <ScrollChild> + <EditBox parentKey="Input" multiLine="true" letters="4000" autoFocus="false"> + <Size x="343" y="194"/> + <Scripts> + <OnCursorChanged function="ScrollingEdit_OnCursorChanged"/> + <OnUpdate> + ScrollingEdit_OnUpdate(self, elapsed, self:GetParent()); + </OnUpdate> + <OnEditFocusGained> + self:HighlightText(0); + </OnEditFocusGained> + <OnEscapePressed function="EditBox_ClearFocus"/> + </Scripts> + <FontString inherits="GameFontHighlightSmall"/> + </EditBox> + </ScrollChild> + </ScrollFrame> + <Button parentKey="Clear" inherits="UIPanelButtonTemplate" text="RESET"> + <Size x="96" y="24"/> + <Anchors> + <Anchor point="BOTTOMLEFT"> + <Offset x="8" y="4"/> + </Anchor> + </Anchors> + <Scripts> + <OnClick> + local frame = _G["SVUI_ScriptErrorDialog"]; + frame.Input:SetText(""); + </OnClick> + </Scripts> + </Button> + <Button parentKey="Close" inherits="UIPanelCloseButton"> + <Anchors> + <Anchor point="TOPRIGHT"> + <Offset x="-2" y="-2"/> + </Anchor> + </Anchors> + </Button> + </Frames> + <Scripts> + <OnLoad function="SVUI_ScriptError_OnLoad"/> + <OnShow function="SVUI_ScriptError_OnShow"/> + <OnDragStart> + _G["SVUI_ScriptError"].moving = true; + _G["SVUI_ScriptError"]:StartMoving(); + </OnDragStart> + <OnDragStop> + _G["SVUI_ScriptError"].moving = nil; + _G["SVUI_ScriptError"]:StopMovingOrSizing(); + </OnDragStop> + </Scripts> + </Frame> +</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_DebugOMatic/debug.lua b/Interface/AddOns/SVUI_DebugOMatic/debug.lua new file mode 100644 index 0000000..03fadba --- /dev/null +++ b/Interface/AddOns/SVUI_DebugOMatic/debug.lua @@ -0,0 +1,296 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local type = _G.type; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local tinsert = _G.tinsert; +local string = _G.string; +local math = _G.math; +local table = _G.table; +--[[ STRING METHODS ]]-- +local format, find, lower, match = string.format, string.find, string.lower, string.match; +--[[ MATH METHODS ]]-- +local floor, abs, min, max = math.floor, math.abs, math.min, math.max; +--[[ TABLE METHODS ]]-- +local tremove, tcopy, twipe, tsort, tconcat, tdump = table.remove, table.copy, table.wipe, table.sort, table.concat, table.dump; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SuperVillain, L = unpack(SVUI); +local ErrorStorage = {} +BINDING_HEADER_SVUIDEBUG = "SuperVillain UI: Debugger"; +--[[ +########################################################## +CUSTOM MESSAGE WINDOW +########################################################## +]]-- +function SVUI_ScriptError_OnLoad() + SVUI_ScriptError.Source = ""; + SVUI_ScriptError:SetFixedPanelTemplate("Transparent") + SVUI_ScriptErrorDialog:SetFixedPanelTemplate("Transparent") + SVUI_ScriptErrorDialog.Input:SetScript("OnTextChanged", function(self, userInput) + if userInput then return end; + local _, max = SVUI_ScriptErrorDialogScrollBar:GetMinMaxValues() + for i = 1, max do + ScrollFrameTemplate_OnMouseWheel(SVUI_ScriptErrorDialog, -1) + end + end) + _G["SVUI_ScriptError"]:RegisterForDrag("LeftButton"); +end; + +function SVUI_ScriptError_OnShow() + if SVUI_ScriptError.Source then + local txt = SVUI_ScriptError.Source; + SVUI_ScriptError.Title:SetText(txt); + end +end; +--[[ +########################################################## +OTHER SLASH COMMANDS +########################################################## +]]-- +local function GetOriginalContext() + UIParentLoadAddOn("Blizzard_DebugTools") + local orig_DevTools_RunDump = DevTools_RunDump + local originalContext + DevTools_RunDump = function(value, context) + originalContext = context + end + DevTools_Dump("") + DevTools_RunDump = orig_DevTools_RunDump + return originalContext +end + +local function SuperVillain_Dump(value) + local context = GetOriginalContext() + local buffer = "" + context.Write = function(self, msg) + buffer = buffer.."\n"..msg + end + + DevTools_RunDump(value, context) + return buffer.."\n"..table.dump(value) +end + +local function DebugDump(any) + if type(any)=="string" then + return any + elseif type(any) == "table" then + return SuperVillain_Dump(any) + elseif any==nil or type(any)=="number" then + return tostring(any) + end + return any +end + +local function DebugOutput(msg) + if not SVUI_ScriptError:IsShown() then + SVUI_ScriptError:Show() + end + local outputString = SVUI_ScriptErrorDialog.Input:GetText() + outputString = outputString .. "\n" .. msg + tinsert(ErrorStorage,msg); + SVUI_ScriptErrorDialog.Input:SetText(outputString) +end; + +local function ShowDebug(header, ...) + local value = (header and format("Debug %s: ", header)) or "Debug: " + value = format("|cff11ff11 %s|r", value) + for i = 1, select('#', ...), 2 do + local name = select(i, ...) + local var = DebugDump(select(i+1, ...)) + value = format("%s %s = ", value, name)..var + end + SVUI_ScriptError.Source = header; + DebugOutput(value) +end + +function DebugThisFrame(arg) + local outputString = " "; + if arg then + arg = _G[arg] or GetMouseFocus() + else + arg = GetMouseFocus() + end + if arg and (arg.GetName and arg:GetName()) then + local point, relativeTo, relativePoint, xOfs, yOfs = arg:GetPoint() + outputString = outputString.."|cffCC0000----------------------------".."\n" + outputString = outputString.."|cffCC00FF--Mouseover Frame".."|r".."\n" + outputString = outputString.."|cffCC0000----------------------------|r".."\n" + outputString = outputString.."|cff00D1FF".."Name: |cffFFD100"..arg:GetName().."\n" + if arg:GetParent() and arg:GetParent():GetName() then + outputString = outputString.."|cff00D1FF".."Parent: |cffFFD100"..arg:GetParent():GetName().."\n" + end + outputString = outputString.."|cff00D1FF".."Width: |cffFFD100"..format("%.2f",arg:GetWidth()).."\n" + outputString = outputString.."|cff00D1FF".."Height: |cffFFD100"..format("%.2f",arg:GetHeight()).."\n" + outputString = outputString.."|cff00D1FF".."Strata: |cffFFD100"..arg:GetFrameStrata().."\n" + outputString = outputString.."|cff00D1FF".."Level: |cffFFD100"..arg:GetFrameLevel().."\n" + outputString = outputString.."|cff00D1FF".."IsShown: |cffFFD100"..tostring(arg:IsShown()).."\n" + if xOfs then + outputString = outputString.."|cff00D1FF".."X: |cffFFD100"..format("%.2f",xOfs).."\n" + end + if yOfs then + outputString = outputString.."|cff00D1FF".."Y: |cffFFD100"..format("%.2f",yOfs).."\n" + end + if relativeTo and relativeTo:GetName() then + outputString = outputString.."|cff00D1FF".."Point: |cffFFD100"..point.."|r anchored to "..relativeTo:GetName().."'s |cffFFD100"..relativePoint.."\n" + end + local bg = arg:GetBackdrop() + if type(bg) == "table" then + outputString = outputString.."|cffFF9900>> BACKDROP --------------------------|r".."\n" + outputString = outputString..tdump(bg).."\n" + end + if arg._template then + outputString = outputString.."Template Name: |cff00FF55"..arg._template.."\n" + end + if arg.Panel then + local cpt, crt, crp, cxo, cyo = arg.Panel:GetPoint() + outputString = outputString.."|cffFF8800>> backdropFrame --------------------------|r".."\n" + outputString = outputString.."|cff00D1FF".."Width: |cffFFD100"..format("%.2f",arg.Panel:GetWidth()).."\n" + outputString = outputString.."|cff00D1FF".."Height: |cffFFD100"..format("%.2f",arg.Panel:GetHeight()).."\n" + outputString = outputString.."|cff00D1FF".."Strata: |cffFFD100"..arg.Panel:GetFrameStrata().."\n" + outputString = outputString.."|cff00D1FF".."Level: |cffFFD100"..arg.Panel:GetFrameLevel().."\n" + if cxo then + outputString = outputString.."|cff00D1FF".."X: |cffFFD100"..format("%.2f",cxo).."\n" + end + if cyo then + outputString = outputString.."|cff00D1FF".."Y: |cffFFD100"..format("%.2f",cyo).."\n" + end + if crt and crt:GetName() then + outputString = outputString.."|cff00D1FF".."Point: |cffFFD100"..cpt.."|r anchored to "..crt:GetName().."'s |cffFFD100"..crp.."\n" + end + bg = arg.Panel:GetBackdrop() + if type(bg) == "table" then + outputString = outputString.."|cffFF9900>> BACKDROP --------------------------|r".."\n" + outputString = outputString..tdump(bg).."\n" + end + if arg._skin then + local cpt, crt, crp, cxo, cyo = arg._skin:GetPoint() + outputString = outputString.."|cffFF7700>> backdropTexture --------------------------|r".."\n" + outputString = outputString.."|cff00D1FF".."Width: |cffFFD100"..format("%.2f",arg._skin:GetWidth()).."\n" + outputString = outputString.."|cff00D1FF".."Height: |cffFFD100"..format("%.2f",arg._skin:GetHeight()).."\n" + if cxo then + outputString = outputString.."|cff00D1FF".."X: |cffFFD100"..format("%.2f",cxo).."\n" + end + if cyo then + outputString = outputString.."|cff00D1FF".."Y: |cffFFD100"..format("%.2f",cyo).."\n" + end + if crt and crt:GetName() then + outputString = outputString.."|cff00D1FF".."Point: |cffFFD100"..cpt.."|r anchored to "..crt:GetName().."'s |cffFFD100"..crp.."\n" + end + bg = arg._skin:GetTexture() + if bg then + outputString = outputString.."|cff00D1FF".."Texture: |cffFFD100"..bg.."\n" + end + end + end + local childFrames = { arg:GetChildren() } + if #childFrames > 0 then + outputString = outputString.."|cffCC00FF>>>> Child Frames----------------------------".."|r".."\n".."\n" + for _, child in ipairs(childFrames) do + local cpt, crt, crp, cxo, cyo = child:GetPoint() + if child:GetName() then + outputString = outputString.."|cff00FF55++"..child:GetName().."|r".."\n" + else + outputString = outputString.."|cff99FF55+!!+".."Anonymous Frame".."|r".."\n" + end + outputString = outputString.."|cffCC00FF----------------------------|r".."\n" + outputString = outputString.."|cff00D1FF".."Width: |cffFFD100"..format("%.2f",child:GetWidth()).."\n" + outputString = outputString.."|cff00D1FF".."Height: |cffFFD100"..format("%.2f",child:GetHeight()).."\n" + outputString = outputString.."|cff00D1FF".."Strata: |cffFFD100"..child:GetFrameStrata().."\n" + outputString = outputString.."|cff00D1FF".."Level: |cffFFD100"..child:GetFrameLevel().."\n" + if cxo then + outputString = outputString.."|cff00D1FF".."X: |cffFFD100"..format("%.2f",cxo).."\n" + end + if cyo then + outputString = outputString.."|cff00D1FF".."Y: |cffFFD100"..format("%.2f",cyo).."\n" + end + if crt and crt:GetName() then + outputString = outputString.."|cff00D1FF".."Point: |cffFFD100"..cpt.."|r anchored to "..crt:GetName().."'s |cffFFD100"..crp.."\n" + end + bg = child:GetBackdrop() + if type(bg) == "table" then + outputString = outputString.."|cffFF9900>> BACKDROP --------------------------|r".."\n" + outputString = outputString..tdump(bg).."\n" + end + if child._template then + outputString = outputString.."Template Name: |cff00FF55"..child._template.."\n" + end + if child.Panel then + local cpt, crt, crp, cxo, cyo = child.Panel:GetPoint() + outputString = outputString.."|cffFF8800>> backdropFrame --------------------------|r".."\n" + outputString = outputString.."|cff00D1FF".."Width: |cffFFD100"..format("%.2f",child.Panel:GetWidth()).."\n" + outputString = outputString.."|cff00D1FF".."Height: |cffFFD100"..format("%.2f",child.Panel:GetHeight()).."\n" + outputString = outputString.."|cff00D1FF".."Strata: |cffFFD100"..child.Panel:GetFrameStrata().."\n" + outputString = outputString.."|cff00D1FF".."Level: |cffFFD100"..child.Panel:GetFrameLevel().."\n" + if cxo then + outputString = outputString.."|cff00D1FF".."X: |cffFFD100"..format("%.2f",cxo).."\n" + end + if cyo then + outputString = outputString.."|cff00D1FF".."Y: |cffFFD100"..format("%.2f",cyo).."\n" + end + if crt and crt:GetName() then + outputString = outputString.."|cff00D1FF".."Point: |cffFFD100"..cpt.."|r anchored to "..crt:GetName().."'s |cffFFD100"..crp.."\n" + end + bg = child.Panel:GetBackdrop() + if type(bg) == "table" then + outputString = outputString.."|cffFF9900>> BACKDROP --------------------------|r".."\n" + outputString = outputString..tdump(bg).."\n" + end + if child._skin then + local cpt, crt, crp, cxo, cyo = child._skin:GetPoint() + outputString = outputString.."|cffFF7700>> backdropTexture --------------------------|r".."\n" + outputString = outputString.."|cff00D1FF".."Width: |cffFFD100"..format("%.2f",child._skin:GetWidth()).."\n" + outputString = outputString.."|cff00D1FF".."Height: |cffFFD100"..format("%.2f",child._skin:GetHeight()).."\n" + if cxo then + outputString = outputString.."|cff00D1FF".."X: |cffFFD100"..format("%.2f",cxo).."\n" + end + if cyo then + outputString = outputString.."|cff00D1FF".."Y: |cffFFD100"..format("%.2f",cyo).."\n" + end + if crt and crt:GetName() then + outputString = outputString.."|cff00D1FF".."Point: |cffFFD100"..cpt.."|r anchored to "..crt:GetName().."'s |cffFFD100"..crp.."\n" + end + bg = child._skin:GetTexture() + if bg then + outputString = outputString.."|cffFF9900----------------------------|r".."\n" + outputString = outputString..bg.."\n" + end + outputString = outputString.."|cffCC0000----------------------------|r".."\n" + end + end + end + outputString = outputString.."\n\n" + end + elseif arg == nil or arg == "" then + outputString = outputString.."Invalid frame name".."\n" + else + outputString = outputString.."Could not find frame info".."\n" + end + DebugOutput(outputString) +end; +SLASH_SVUI_FRAME_DEBUG1 = "/svdf" +SlashCmdList["SVUI_FRAME_DEBUG"] = DebugThisFrame; \ No newline at end of file diff --git a/Interface/AddOns/SVUI_Laborer/Bindings.xml b/Interface/AddOns/SVUI_Laborer/Bindings.xml index b126d31..3b81fd2 100644 --- a/Interface/AddOns/SVUI_Laborer/Bindings.xml +++ b/Interface/AddOns/SVUI_Laborer/Bindings.xml @@ -1,14 +1,14 @@ <Bindings> - <Binding name="Fishing Mode" header="SVUILABORER" runOnUp="false"> + <Binding name="FishingMode" description="Fishing Mode" header="SVUILABORER" runOnUp="false"> SVUIFishingMode() </Binding> - <Binding name="Farming Mode" runOnUp="false"> + <Binding name="FarmingMode" description="Farming Mode" header="SVUILABORER" runOnUp="false"> SVUIFarmingMode() </Binding> - <Binding name="Archaeology Mode" runOnUp="false"> + <Binding name="ArchaeologyMode" description="Archaeology Mode" header="SVUILABORER" runOnUp="false"> SVUIArchaeologyMode() </Binding> - <Binding name="Cooking Mode" runOnUp="false"> + <Binding name="CookingMode" description="Cooking Mode" header="SVUILABORER" runOnUp="false"> SVUICookingMode() </Binding> </Bindings> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.lua b/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.lua index eed7439..e25cb26 100644 --- a/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.lua +++ b/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.lua @@ -36,12 +36,12 @@ local SVUIAddOnName, PLUGIN = ...; local SuperVillain, L = unpack(SVUI); local CONFIGS = SuperVillain.Configs local NewHook = hooksecurefunc; -local SVUIAddonEventHandler = CreateFrame("Frame", nil) -local version = GetAddOnMetadata(..., "Version") local playerGUID = UnitGUID('player') local classColor = RAID_CLASS_COLORS -PLUGIN = SuperVillain:Prototype(SVUIAddOnName, version) + +PLUGIN = SuperVillain:Prototype(SVUIAddOnName) +local SCHEMA = PLUGIN.___schema; _G["LaborVillain"] = PLUGIN; --[[ @@ -414,10 +414,10 @@ BUILD FUNCTION ########################################################## ]]-- local function LoadOptions() - SuperVillain.Options.args.plugins.args.pluginOptions.args.SVLaborer = { + SuperVillain.Options.args.plugins.args.pluginOptions.args[SCHEMA] = { type = 'group', name = L['Laborer'], - get = function(key)return SuperVillain.db.SVLaborer[key[#key]]end, + get = function(key)return SuperVillain.db[SCHEMA][key[#key]]end, set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key]) end, args = { intro = { @@ -430,8 +430,8 @@ local function LoadOptions() order = 2, name = L['Enable'], desc = L['Enable/Disable the Laborer dock.'], - get = function(key)return SuperVillain.db.SVLaborer[key[#key]]end, - set = function(key, value)SuperVillain.db.SVLaborer.enable = value;SuperVillain:StaticPopup_Show("RL_CLIENT")end + get = function(key)return SuperVillain.db[SCHEMA][key[#key]]end, + set = function(key, value)SuperVillain.db[SCHEMA].enable = value;SuperVillain:StaticPopup_Show("RL_CLIENT")end }, fontSize = { order = 3, @@ -454,7 +454,7 @@ local function LoadOptions() order = 1, name = L['AutoEquip'], desc = L['Enable/Disable automatically equipping fishing gear.'], - get = function(key)return SuperVillain.db.SVLaborer.fishing[key[#key]]end, + get = function(key)return SuperVillain.db[SCHEMA].fishing[key[#key]]end, set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key], "fishing")end } } @@ -470,7 +470,7 @@ local function LoadOptions() order = 1, name = L['AutoEquip'], desc = L['Enable/Disable automatically equipping cooking gear.'], - get = function(key)return SuperVillain.db.SVLaborer.cooking[key[#key]]end, + get = function(key)return SuperVillain.db[SCHEMA].cooking[key[#key]]end, set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key], "cooking")end } } @@ -480,8 +480,8 @@ local function LoadOptions() type = "group", name = L["Farming Mode Settings"], guiInline = true, - get = function(key)return SuperVillain.db.SVLaborer.farming[key[#key]]end, - set = function(key, value)SuperVillain.db.SVLaborer.farming[key[#key]] = value end, + get = function(key)return SuperVillain.db[SCHEMA].farming[key[#key]]end, + set = function(key, value)SuperVillain.db[SCHEMA].farming[key[#key]] = value end, args = { buttonsize = { type = 'range', @@ -541,12 +541,13 @@ local function LoadOptions() } end -function LoadLaborVillain() - if(not SuperVillain.db.SVLaborer.enable) then return end - PLUGIN.db = SuperVillain.db.SVLaborer +function PLUGIN:Load() + if(not SuperVillain.db[SCHEMA].enable) then return end + + self.db = SuperVillain.db[SCHEMA] lastClickTime = nil; - PLUGIN.WornItems = {}; - PLUGIN.InModeGear = false; + self.WornItems = {}; + self.InModeGear = false; local ALERT_HEIGHT = 60; local DOCK_WIDTH = SuperDockWindowRight:GetWidth(); @@ -644,18 +645,22 @@ function LoadLaborVillain() ModeAlert:SetScript('OnMouseDown', ModeAlert_OnMouseDown) ModeAlert:Hide() - PLUGIN.ModeAlert = ModeAlert + self.ModeAlert = ModeAlert + + self:MakeLogWindow() - PLUGIN:MakeLogWindow() modesDocklet:Hide() - PLUGIN:LoadCookingMode() - PLUGIN:LoadFishingMode() - PLUGIN:LoadArchaeologyMode() - PLUGIN:PrepareFarmingTools() - PLUGIN:RegisterEvent("SKILL_LINES_CHANGED") + + self:LoadCookingMode() + self:LoadFishingMode() + self:LoadArchaeologyMode() + self:PrepareFarmingTools() + self:RegisterEvent("SKILL_LINES_CHANGED") + + LoadOptions() end -CONFIGS["SVLaborer"] = { +CONFIGS[SCHEMA] = { ["enable"] = true, ["fontSize"] = 12, ["farming"] = { @@ -673,5 +678,4 @@ CONFIGS["SVLaborer"] = { }, } -SuperVillain.Registry:NewScript(LoadLaborVillain) -SuperVillain.Registry:NewPlugin(PLUGIN, "SVLaborer", LoadOptions) \ No newline at end of file +SuperVillain.Registry:NewPlugin(PLUGIN) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.toc b/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.toc index 6646384..f333f07 100644 --- a/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.toc +++ b/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.toc @@ -1,10 +1,11 @@ -## Interface: 50400 +## Interface: 60000 ## Author: Munglunch -## Version: 4.084 +## Version: 5.02 ## Title: |cffFF9900SVUI |r|cffFFEF00Laborer|r ## Notes: Supervillain UI [|cff9911FFProfession Tools|r]. ## SavedVariables: LABOR_Data ## SavedVariablesPerCharacter: LABOR_Cache ## RequiredDeps: SVUI +## X-SVUI: SVLaborer SVUI_Laborer.xml diff --git a/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua index 92a5aa8..dc0751b 100644 --- a/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua +++ b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua @@ -40,10 +40,9 @@ GET ADDON DATA local SVUIAddOnName, PLUGIN = ...; local SuperVillain, L = unpack(SVUI) local NewHook = hooksecurefunc; -local SVUILogEventHandler = CreateFrame("Frame", nil) -local version = GetAddOnMetadata(..., "Version"); -PLUGIN = SuperVillain:Prototype(SVUIAddOnName, version) +PLUGIN = SuperVillain:Prototype(SVUIAddOnName) +local SCHEMA = PLUGIN.___schema; _G["LogVillain"] = PLUGIN; local CHAT = SuperVillain.SVChat; @@ -98,7 +97,6 @@ local RefreshLoggedSlot = function(self, bag, slotID, save) local itemLink = GetContainerItemLink(bag, slotID); local key; slot:Show() - slot.questIcon:Hide() slot.name, slot.rarity = nil, nil; local start, duration, enable = GetContainerItemCooldown(bag, slotID) CooldownFrame_SetTimer(slot.cooldown, start, duration, enable) @@ -118,7 +116,6 @@ local RefreshLoggedSlot = function(self, bag, slotID, save) local z, A, C = GetContainerItemQuestInfo(bag, slotID) if A and not isActive then slot:SetBackdropBorderColor(1.0, 0.3, 0.3) - slot.questIcon:Show() elseif A or z then slot:SetBackdropBorderColor(1.0, 0.3, 0.3) elseif slot.rarity and slot.rarity>1 then @@ -260,7 +257,7 @@ function PLUGIN:AppendBankFunctions() end function PLUGIN:AppendChatFunctions() - if SuperVillain.db.SVChat.enable and SuperVillain.db.SVLogs.saveChats then + if SuperVillain.db.SVChat.enable and SuperVillain.db[SCHEMA].saveChats then for _,event in pairs(LoggingEvents) do SuperVillain.SVChat:RegisterEvent(event, "LogCurrentChat") end @@ -285,7 +282,7 @@ BUILD FUNCTION ########################################################## ]]-- local function LoadOptions() - SuperVillain.Options.args.plugins.args.pluginOptions.args.SVLogs = { + SuperVillain.Options.args.plugins.args.pluginOptions.args[SCHEMA] = { type = "group", name = L["Log O Matic"], childGroups = "tree", @@ -294,25 +291,25 @@ local function LoadOptions() order = 1, type = "toggle", name = "Enable", - get = function(a)return SuperVillain.db.SVLogs.enable end, - set = function(a,b)SuperVillain.db.SVLogs.enable = b; SuperVillain:StaticPopup_Show("RL_CLIENT") end + get = function(a)return SuperVillain.db[SCHEMA].enable end, + set = function(a,b)SuperVillain.db[SCHEMA].enable = b; SuperVillain:StaticPopup_Show("RL_CLIENT") end }, saveChats = { order = 2, type = "toggle", name = L["Save Chats"], desc = L["Retain chat messages even after logging out."], - get = function(a)return SuperVillain.db.SVLogs.saveChats end, - set = function(a,b) SuperVillain.db.SVLogs.saveChats = b; SuperVillain:StaticPopup_Show("RL_CLIENT") end + get = function(a)return SuperVillain.db[SCHEMA].saveChats end, + set = function(a,b) SuperVillain.db[SCHEMA].saveChats = b; SuperVillain:StaticPopup_Show("RL_CLIENT") end }, } } end -local function LoadLogOMatic() - if not SuperVillain.db.SVLogs.enable then return end +function PLUGIN:Load() + if not SuperVillain.db[SCHEMA].enable then return end - PLUGIN.db = SuperVillain.db.SVLogs + self.db = SuperVillain.db[SCHEMA] local toonClass = select(2,UnitClass("player")); local r,g,b = RAID_CLASS_COLORS[toonClass].r, RAID_CLASS_COLORS[toonClass].g, RAID_CLASS_COLORS[toonClass].b @@ -325,13 +322,13 @@ local function LoadLogOMatic() SVLOG_Data[realmKey]["info"][nameKey] = hexString; SVLOG_Data[realmKey]["bags"][nameKey] = SVLOG_Data[realmKey]["bags"][nameKey] or {}; - PLUGIN.stash = SVLOG_Data[realmKey]["bags"]; - PLUGIN.myStash = SVLOG_Data[realmKey]["bags"][nameKey]; + self.stash = SVLOG_Data[realmKey]["bags"]; + self.myStash = SVLOG_Data[realmKey]["bags"][nameKey]; SVLOG_Data[realmKey]["quests"] = SVLOG_Data[realmKey]["quests"] or {}; SVLOG_Data[realmKey]["quests"][nameKey] = SVLOG_Data[realmKey]["quests"][nameKey] or {}; - PLUGIN.chronicle = SVLOG_Data[realmKey]["quests"][nameKey]; + self.chronicle = SVLOG_Data[realmKey]["quests"][nameKey]; NewHook(SuperVillain, "ResetAllUI", ResetAllLogs); @@ -340,8 +337,8 @@ local function LoadLogOMatic() for alt,_ in pairs(SVLOG_Data[realmKey]["bags"]) do for bag,items in pairs(SVLOG_Data[realmKey]["bags"][alt]) do for id,amt in pairs(items) do - PLUGIN.BagItemCache[id] = PLUGIN.BagItemCache[id] or {} - PLUGIN.BagItemCache[id][alt] = amt + self.BagItemCache[id] = self.BagItemCache[id] or {} + self.BagItemCache[id][alt] = amt end end end @@ -351,7 +348,7 @@ local function LoadLogOMatic() local BAGS = SuperVillain.SVBag; if BAGS.BagFrame then BAGS.BagFrame.RefreshBagsSlots = RefreshLoggedBagsSlots; - NewHook(BAGS, "MakeBank", PLUGIN.AppendBankFunctions); + NewHook(BAGS, "MakeBank", self.AppendBankFunctions); RefreshLoggedBagsSlots(BAGS.BagFrame) end end @@ -360,14 +357,15 @@ local function LoadLogOMatic() end --[[ APPLY HOOKS ]]-- - PLUGIN:AppendChatFunctions() - NewHook(CHAT, "ReLoad", PLUGIN.AppendChatFunctions); + self:AppendChatFunctions() + NewHook(CHAT, "ReLoad", self.AppendChatFunctions) + + LoadOptions() end -SuperVillain.Configs["SVLogs"] = { +SuperVillain.Configs[SCHEMA] = { ["enable"] = true, ["saveChats"] = false } -SuperVillain.Registry:NewScript(LoadLogOMatic) -SuperVillain.Registry:NewPlugin(PLUGIN, "SVLogs", LoadOptions) \ No newline at end of file +SuperVillain.Registry:NewPlugin(PLUGIN) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.toc b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.toc index 1d42267..3e350e0 100644 --- a/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.toc +++ b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.toc @@ -1,10 +1,11 @@ -## Interface: 50400 +## Interface: 60000 ## Author: Munglunch -## Version: 4.084 +## Version: 5.02 ## Title: |cffFF9900SVUI |r|cffFFEF00Log O Matic|r ## Notes: Supervillain UI [|cff9911FFData Logging|r]. ## SavedVariables: SVLOG_Data ## SavedVariablesPerCharacter: SVLOG_Cache ## RequiredDeps: SVUI +## X-SVUI: SVLogs SVUI_LogOMatic.lua diff --git a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua index 4eb31a7..2cce5cb 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua @@ -41,10 +41,10 @@ local SVUIAddOnName, PLUGIN = ...; local SuperVillain, L = unpack(SVUI); local CONFIGS = SuperVillain.Configs local NewHook = hooksecurefunc; -local SVUIAddonEventHandler = CreateFrame("Frame", nil) -local version = GetAddOnMetadata(..., "Version"); -PLUGIN = SuperVillain:Prototype(SVUIAddOnName, version) +PLUGIN = SuperVillain:Prototype(SVUIAddOnName) +local SCHEMA = PLUGIN.___schema; +local VERSION = PLUGIN.___version; _G["StyleVillain"] = PLUGIN; --[[ @@ -63,9 +63,9 @@ PLUGIN.OptionsCache = { order = 4, type = "group", name = "Addon Styling", - get = function(a)return SuperVillain.db.SVStyle.addons[a[#a]] end, - set = function(a,b)SuperVillain.db.SVStyle.addons[a[#a]] = b;SuperVillain:StaticPopup_Show("RL_CLIENT")end, - disabled = function()return not SuperVillain.db.SVStyle.addons.enable end, + get = function(a)return SuperVillain.db[SCHEMA].addons[a[#a]] end, + set = function(a,b)SuperVillain.db[SCHEMA].addons[a[#a]] = b;SuperVillain:StaticPopup_Show("RL_CLIENT")end, + disabled = function()return not SuperVillain.db[SCHEMA].addons.enable end, guiInline = true, args = { ace3 = { @@ -119,7 +119,7 @@ function PLUGIN:Style(style, fn, ...) local verb = charming[math.random(1,#charming)] self:AddonMessage(styleMessage:format(style, verb)) elseif(self.Debugging and error) then - SuperVillain:Debugger(errorMessage:format(version, style, error)) + SuperVillain:Debugger(errorMessage:format(VERSION, style, error)) end end @@ -130,7 +130,7 @@ function PLUGIN:IsAddonReady(addon, ...) if not IsAddOnLoaded(a) then return false end end - local config = SuperVillain.db.SVStyle or SuperVillain.Configs.SVStyle + local config = SuperVillain.db[SCHEMA] or SuperVillain.Configs[SCHEMA] return config.addons[addon] end @@ -146,8 +146,8 @@ function PLUGIN:SaveAddonStyle(addon, fn, force, passive, ...) self:DefineEventFunction(event, addon) end end - if(SuperVillain.Configs.SVStyle.addons[addon] == nil) then - SuperVillain.Configs.SVStyle.addons[addon] = true + if(SuperVillain.Configs[SCHEMA].addons[addon] == nil) then + SuperVillain.Configs[SCHEMA].addons[addon] = true end if force then @@ -180,13 +180,13 @@ function PLUGIN:DefineEventFunction(addonEvent, addon) self.EventListeners[addonEvent][addon] = true if(not self[addonEvent]) then self[addonEvent] = function(self, event, ...) - for name,fn in pairs(self.AddOnQueue)do + for name,fn in pairs(self.AddOnQueue) do if self:IsAddonReady(name) and self.EventListeners[event] and self.EventListeners[event][name] then self:Style(name, fn, event, ...) end end end - SVUIAddonEventHandler:RegisterEvent(addonEvent); + self:RegisterEvent(addonEvent); end end @@ -202,7 +202,7 @@ function PLUGIN:SafeEventRemoval(addon, event) end end if not defined then - SVUIAddonEventHandler:UnregisterEvent(event) + self:UnregisterEvent(event) end end @@ -214,40 +214,70 @@ function PLUGIN:RefreshAddonStyles() end end -function PLUGIN:ToggleStyle(addon, value) - SuperVillain.db.SVStyle.addons[addon] = value -end - -function PLUGIN:StyleInit(event, ...) - for addon,fn in pairs(self.AddOnQueue)do - self:AppendAddonOption(addon) - if(SuperVillain.db.SVStyle.addons[addon] == nil) then - SuperVillain.db.SVStyle.addons[addon] = true - end - end +function PLUGIN:AppendAddonOption(addon) + if(not self.OptionsCache.args[addon]) then + self.OptionsCache.args[addon] = { + type = "toggle", + name = addon, + desc = L["Addon Styling"], + get = function(key) return self:IsAddonReady(key[#key]) end, + set = function(key,value) self:ChangeDBVar(value, key[#key]); SuperVillain:StaticPopup_Show("RL_CLIENT") end, + disabled = function() + if addon then + return not IsAddOnLoaded(addon) + else + return false + end + end + } + end +end - for addon,fn in pairs(self.OnLoadAddons) do - if(SuperVillain.db.SVStyle.blizzard[addon] == nil) then - SuperVillain.db.SVStyle.blizzard[addon] = true +function PLUGIN:PLAYER_ENTERING_WORLD(event, ...) + for name,fn in pairs(self.OnLoadAddons) do + if(SuperVillain.db[SCHEMA].blizzard[name] == nil) then + SuperVillain.db[SCHEMA].blizzard[name] = true end - if(IsAddOnLoaded(addon) and (SuperVillain.db.SVStyle.blizzard[addon] or SuperVillain.db.SVStyle.addons[addon])) then - self:Style(addon, fn, event, ...) - self.OnLoadAddons[addon] = nil + if(IsAddOnLoaded(name) and (SuperVillain.db[SCHEMA].blizzard[name] or SuperVillain.db[SCHEMA].addons[name])) then + self:Style(name, fn, event, ...) + self.OnLoadAddons[name] = nil end end for _,fn in pairs(self.CustomQueue)do - fn(event) + fn(event, ...) end twipe(self.CustomQueue) + + local listener = self.EventListeners[event] + for name,fn in pairs(self.AddOnQueue)do + self:AppendAddonOption(name) + if(SuperVillain.db[SCHEMA].addons[name] == nil) then + SuperVillain.db[SCHEMA].addons[name] = true + end + if(listener[name] and self:IsAddonReady(name)) then + self:Style(name, fn, event, ...) + end + end + collectgarbage("collect") end -function PLUGIN:StyleOnDemand(event, addon) +function PLUGIN:ADDON_LOADED(event, addon) for name, fn in pairs(self.OnLoadAddons) do if(addon:find(name)) then self:Style(name, fn, event, addon) + self.OnLoadAddons[name] = nil + end + end + + local listener = self.EventListeners[event] + if(listener) then + for name, fn in pairs(self.AddOnQueue) do + if(listener[name] and self:IsAddonReady(name)) then + self:Style(name, fn, event, addon) + end end end end @@ -256,23 +286,6 @@ end OPTIONS CREATION ########################################################## ]]-- -function PLUGIN:AppendAddonOption(addon) - PLUGIN.OptionsCache.args[addon] = { - type = "toggle", - name = addon, - desc = L["Addon Styling"], - get=function(a)return PLUGIN:IsAddonReady(a[#a])end, - set=function(a,b)SuperVillain.db.SVStyle.addons[a[#a]] = b;SuperVillain:StaticPopup_Show("RL_CLIENT")end, - disabled = function() - if addon then - return not IsAddOnLoaded(addon) - else - return false - end - end - } -end - local RegisterAddonDocklets = function() local MAIN = _G["SuperDockletMain"]; local EXTRA = _G["SuperDockletExtra"]; @@ -366,19 +379,8 @@ end BUILD FUNCTION ########################################################## ]]-- -local Registry_OnEvent = function(self, event, ...) - if(event == "PLAYER_ENTERING_WORLD") then - PLUGIN:StyleInit(event, ...) - elseif(event == "ADDON_LOADED") then - PLUGIN:StyleOnDemand(event, ...) - end - if(PLUGIN[event]) then - PLUGIN[event](PLUGIN, event, ...) - end -end - local function LoadOptions() - SuperVillain.Options.args.plugins.args.pluginOptions.args.SVStyle={ + SuperVillain.Options.args.plugins.args.pluginOptions.args[SCHEMA]={ type = "group", name = L["Style O Matic"], childGroups = "tree", @@ -392,23 +394,23 @@ local function LoadOptions() order = 2, type = "toggle", name = "Standard UI Styling", - get = function(a)return SuperVillain.db.SVStyle.blizzard.enable end, - set = function(a,b)SuperVillain.db.SVStyle.blizzard.enable = b;SuperVillain:StaticPopup_Show("RL_CLIENT")end + get = function(a)return SuperVillain.db[SCHEMA].blizzard.enable end, + set = function(a,b)SuperVillain.db[SCHEMA].blizzard.enable = b;SuperVillain:StaticPopup_Show("RL_CLIENT")end }, addonEnable = { order = 3, type = "toggle", name = "Addon Styling", - get = function(a)return SuperVillain.db.SVStyle.addons.enable end, - set = function(a,b)SuperVillain.db.SVStyle.addons.enable = b;SuperVillain:StaticPopup_Show("RL_CLIENT")end + get = function(a)return SuperVillain.db[SCHEMA].addons.enable end, + set = function(a,b)SuperVillain.db[SCHEMA].addons.enable = b;SuperVillain:StaticPopup_Show("RL_CLIENT")end }, blizzard = { order = 300, type = "group", name = "Individual Mods", - get = function(a)return SuperVillain.db.SVStyle.blizzard[a[#a]]end, - set = function(a,b)SuperVillain.db.SVStyle.blizzard[a[#a]] = b;SuperVillain:StaticPopup_Show("RL_CLIENT")end, - disabled = function()return not SuperVillain.db.SVStyle.blizzard.enable end, + get = function(a)return SuperVillain.db[SCHEMA].blizzard[a[#a]]end, + set = function(a,b)SuperVillain.db[SCHEMA].blizzard[a[#a]] = b;SuperVillain:StaticPopup_Show("RL_CLIENT")end, + disabled = function()return not SuperVillain.db[SCHEMA].blizzard.enable end, guiInline = true, args = { bmah = { @@ -416,6 +418,11 @@ local function LoadOptions() name = L["Black Market AH"], desc = L["TOGGLEART_DESC"] }, + chat = { + type = "toggle", + name = L["Chat Menus"], + desc = L["TOGGLEART_DESC"] + }, transmogrify = { type = "toggle", name = L["Transmogrify Frame"], @@ -688,8 +695,8 @@ local function LoadOptions() } end -local function LoadStyleOMatic() - PLUGIN.db = SuperVillain.db.SVStyle +function PLUGIN:Load() + self.db = SuperVillain.db[SCHEMA] local alert = CreateFrame('Frame', nil, UIParent); alert:SetFixedPanelTemplate('Transparent'); @@ -709,7 +716,7 @@ local function LoadStyleOMatic() alert.Close = CreateFrame('Button', nil, alert); alert.Close:SetSize(70, 25); alert.Close:SetPoint('LEFT', alert, 'BOTTOM', 10, 20); - alert.Close:SetScript('OnClick', function(self) self:GetParent():Hide() end); + alert.Close:SetScript('OnClick', function(this) this:GetParent():Hide() end); alert.Close.Text = alert.Close:CreateFontString(nil, "OVERLAY"); alert.Close.Text:SetFont(SuperVillain.Media.font.default, 10); alert.Close.Text:SetPoint('CENTER'); @@ -717,21 +724,23 @@ local function LoadStyleOMatic() alert.Accept:SetButtonTemplate(); alert.Close:SetButtonTemplate(); alert:Hide(); - PLUGIN.Alert = alert; + self.Alert = alert; NewHook(SuperVillain, "ReloadDocklets", RegisterAddonDocklets); SuperVillain:ReloadDocklets(); + SuperVillain.DynamicOptions[SCHEMA] = {key = "addons", data = self.OptionsCache}; + LoadOptions() - SuperVillain.DynamicOptions["SVStyle"] = {key = "addons", data = PLUGIN.OptionsCache}; - SVUIAddonEventHandler:RegisterEvent("ADDON_LOADED", "StyleOnDemand"); - SVUIAddonEventHandler:RegisterEvent("PLAYER_ENTERING_WORLD", "StyleInit"); + self:StyleInit(); + self:RegisterEvent("ADDON_LOADED"); end -CONFIGS["SVStyle"] = { +CONFIGS[SCHEMA] = { ["blizzard"] = { ["enable"] = true, ["bags"] = true, - ["bmah"] = true, + ["bmah"] = true, + ["chat"] = true, ["reforge"] = true, ["calendar"] = true, ["achievement"] = true, @@ -812,7 +821,4 @@ CONFIGS["SVStyle"] = { } } -SuperVillain.Registry:NewScript(LoadStyleOMatic) -SuperVillain.Registry:NewPlugin(PLUGIN, "SVStyle", LoadOptions) - -SVUIAddonEventHandler:SetScript("OnEvent", Registry_OnEvent) \ No newline at end of file +SuperVillain.Registry:NewPlugin(PLUGIN) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc index f978be7..813eb1a 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc +++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc @@ -1,9 +1,10 @@ -## Interface: 50400 +## Interface: 60000 ## Author: Munglunch, Azilroka, Sortokk -## Version: 4.084 +## Version: 5.02 ## Title: |cffFF9900SVUI |r|cffFFEF00Style O Matic|r ## Notes: Supervillain UI [|cff9911FFAddon Skins|r]. ## RequiredDeps: SVUI ## OptionalDeps: Blizzard_DebugTools, Blizzard_PetJournal, SharedMedia +## X-SVUI: SVStyle SVUI_StyleOMatic.xml diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/_load.xml b/Interface/AddOns/SVUI_StyleOMatic/addons/_load.xml index 3cbb84d..969f53a 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/_load.xml +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/_load.xml @@ -9,6 +9,7 @@ <Script file='blackmarket.lua'/> <Script file='calendar.lua'/> <Script file='challenges.lua'/> + <Script file='chat.lua'/> <Script file='character.lua'/> <Script file='dressup.lua'/> <Script file='encounterjournal.lua'/> diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/achievement.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/achievement.lua index db954e1..8a5fb1d 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/achievement.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/achievement.lua @@ -70,11 +70,11 @@ local function AchievementStyle() STYLE:ApplyCloseButtonStyle(AchievementFrameCloseButton, AchievementFrame.Panel) STYLE:ApplyDropdownStyle(AchievementFrameFilterDropDown) AchievementFrameFilterDropDown:Point("TOPRIGHT", AchievementFrame, "TOPRIGHT", -44, 5) - STYLE:ApplyScrollStyle(AchievementFrameCategoriesContainerScrollBar, 5) - STYLE:ApplyScrollStyle(AchievementFrameAchievementsContainerScrollBar, 5) - STYLE:ApplyScrollStyle(AchievementFrameStatsContainerScrollBar, 5) - STYLE:ApplyScrollStyle(AchievementFrameComparisonContainerScrollBar, 5) - STYLE:ApplyScrollStyle(AchievementFrameComparisonStatsContainerScrollBar, 5) + STYLE:ApplyScrollFrameStyle(AchievementFrameCategoriesContainerScrollBar, 5) + STYLE:ApplyScrollFrameStyle(AchievementFrameAchievementsContainerScrollBar, 5) + STYLE:ApplyScrollFrameStyle(AchievementFrameStatsContainerScrollBar, 5) + STYLE:ApplyScrollFrameStyle(AchievementFrameComparisonContainerScrollBar, 5) + STYLE:ApplyScrollFrameStyle(AchievementFrameComparisonStatsContainerScrollBar, 5) for f = 1, 3 do STYLE:ApplyTabStyle(_G["AchievementFrameTab"..f]) _G["AchievementFrameTab"..f]:SetFrameLevel(_G["AchievementFrameTab"..f]:GetFrameLevel()+2) @@ -101,7 +101,7 @@ local function AchievementStyle() end; for f = 1, 20 do local d = _G["AchievementFrameCategoriesContainerButton"..f] - STYLE:ApplyLinkButtonStyle(d) + STYLE:ApplyItemButtonStyle(d) end; k.containerStyleed = true end) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/alert.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/alert.lua index 0f4f93e..02156ac 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/alert.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/alert.lua @@ -24,21 +24,21 @@ local function AlphaHelper(this, value, flag) if value ~= 1 and flag ~= true then d:SetAlpha(1, true) end -end; +end --[[ ########################################################## ALERTFRAME STYLER ########################################################## ]]-- local function AlertStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.alertframes ~= true then return end; + if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.alertframes ~= true then return end for i = 1, 4 do local alert = _G["SVUI_SystemAlert"..i]; if(alert) then for b = 1, 3 do alert.buttons[b]:SetButtonTemplate() - end; + end alert:Formula409() STYLE:ApplyAlertStyle(alert) alert.input:SetEditboxTemplate() @@ -56,12 +56,12 @@ local function AlertStyle() if frame then frame:SetAlpha(1) hooksecurefunc(frame, "SetAlpha", AlphaHelper) - if not frame.BasicBG then - STYLE:SetBasicBG(frame) - frame.BasicBG:Point("TOPLEFT", _G[frame:GetName().."Background"], "TOPLEFT", -2, -6) - frame.BasicBG:Point("BOTTOMRIGHT", _G[frame:GetName().."Background"], "BOTTOMRIGHT", -2, 6) - end; - _G["AchievementAlertFrame"..i.."Background"]:SetTexture(0,0,0,0) + if not frame.Panel then + frame:SetBasicPanel() + frame.Panel:Point("TOPLEFT", _G[frame:GetName().."Background"], "TOPLEFT", -2, -6) + frame.Panel:Point("BOTTOMRIGHT", _G[frame:GetName().."Background"], "BOTTOMRIGHT", -2, 6) + end + _G["AchievementAlertFrame"..i.."Background"]:SetTexture("") _G["AchievementAlertFrame"..i.."OldAchievement"]:MUNG() _G["AchievementAlertFrame"..i.."Glow"]:MUNG() _G["AchievementAlertFrame"..i.."Shine"]:MUNG() @@ -90,11 +90,11 @@ local function AlertStyle() if frame then frame:SetAlpha(1) hooksecurefunc(frame, "SetAlpha", AlphaHelper) - if not frame.BasicBG then - STYLE:SetBasicBG(frame) - frame.BasicBG:Point("TOPLEFT", frame, "TOPLEFT", -2, -6) - frame.BasicBG:Point("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -2, 6) - end; + if not frame.Panel then + frame:SetBasicPanel() + frame.Panel:Point("TOPLEFT", frame, "TOPLEFT", -2, -6) + frame.Panel:Point("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -2, 6) + end frame.shine:MUNG() frame.glowFrame:MUNG() frame.glowFrame.glow:MUNG() @@ -123,15 +123,15 @@ local function AlertStyle() if frame then frame:SetAlpha(1) hooksecurefunc(frame, "SetAlpha", AlphaHelper) - if not frame.BasicBG then - STYLE:SetBasicBG(frame) - frame.BasicBG:Point("TOPLEFT", frame, "TOPLEFT", -2, -6) - frame.BasicBG:Point("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -2, 6) - end; + if not frame.Panel then + frame:SetBasicPanel() + frame.Panel:Point("TOPLEFT", frame, "TOPLEFT", -2, -6) + frame.Panel:Point("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -2, 6) + end local j = select(2, frame:GetRegions()) if j:GetObjectType() == "Texture"then if j:GetTexture() == "Interface\\GuildFrame\\GuildChallenges"then j:MUNG()end - end; + end GuildChallengeAlertFrameGlow:MUNG() GuildChallengeAlertFrameShine:MUNG() GuildChallengeAlertFrameEmblemBorder:MUNG() @@ -141,7 +141,7 @@ local function AlertStyle() GuildChallengeAlertFrameEmblemIcon.b:Point("TOPLEFT", GuildChallengeAlertFrameEmblemIcon, "TOPLEFT", -3, 3) GuildChallengeAlertFrameEmblemIcon.b:Point("BOTTOMRIGHT", GuildChallengeAlertFrameEmblemIcon, "BOTTOMRIGHT", 3, -2) GuildChallengeAlertFrameEmblemIcon:SetParent(GuildChallengeAlertFrameEmblemIcon.b) - end; + end SetLargeGuildTabardTextures("player", GuildChallengeAlertFrameEmblemIcon, nil, nil) end end) @@ -151,24 +151,24 @@ local function AlertStyle() if frame then frame:SetAlpha(1) hooksecurefunc(frame, "SetAlpha", AlphaHelper) - if not frame.BasicBG then - STYLE:SetBasicBG(frame) - frame.BasicBG:Point("TOPLEFT", frame, "TOPLEFT", 19, -6) - frame.BasicBG:Point("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -22, 6) - end; + if not frame.Panel then + frame:SetBasicPanel() + frame.Panel:Point("TOPLEFT", frame, "TOPLEFT", 19, -6) + frame.Panel:Point("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -22, 6) + end for i = 1, frame:GetNumRegions()do local j = select(i, frame:GetRegions()) if j:GetObjectType() == "Texture"then if j:GetTexture() == "Interface\\Challenges\\challenges-main" then j:MUNG() end end - end; + end ChallengeModeAlertFrame1Shine:MUNG() ChallengeModeAlertFrame1GlowFrame:MUNG() ChallengeModeAlertFrame1GlowFrame.glow:MUNG() ChallengeModeAlertFrame1Border:MUNG() ChallengeModeAlertFrame1DungeonTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9) ChallengeModeAlertFrame1DungeonTexture:ClearAllPoints() - ChallengeModeAlertFrame1DungeonTexture:Point("LEFT", frame.BasicBG, 9, 0) + ChallengeModeAlertFrame1DungeonTexture:Point("LEFT", frame.Panel, 9, 0) if not ChallengeModeAlertFrame1DungeonTexture.b then ChallengeModeAlertFrame1DungeonTexture.b = CreateFrame("Frame", nil, frame) ChallengeModeAlertFrame1DungeonTexture.b:SetFixedPanelTemplate("Default") @@ -183,23 +183,23 @@ local function AlertStyle() if frame then frame:SetAlpha(1) hooksecurefunc(frame, "SetAlpha", AlphaHelper) - if not frame.BasicBG then - STYLE:SetBasicBG(frame) - frame.BasicBG:Point("TOPLEFT", frame, "TOPLEFT", 4, 4) - frame.BasicBG:Point("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -7, 6) - end; + if not frame.Panel then + frame:SetBasicPanel() + frame.Panel:Point("TOPLEFT", frame, "TOPLEFT", 4, 4) + frame.Panel:Point("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -7, 6) + end for i = 1, frame:GetNumRegions()do local j = select(i, frame:GetRegions()) if j:GetObjectType() == "Texture"then if j:GetTexture() == "Interface\\Scenarios\\ScenariosParts" then j:MUNG() end end - end; + end ScenarioAlertFrame1Shine:MUNG() ScenarioAlertFrame1GlowFrame:MUNG() ScenarioAlertFrame1GlowFrame.glow:MUNG() ScenarioAlertFrame1DungeonTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9) ScenarioAlertFrame1DungeonTexture:ClearAllPoints() - ScenarioAlertFrame1DungeonTexture:Point("LEFT", frame.BasicBG, 9, 0) + ScenarioAlertFrame1DungeonTexture:Point("LEFT", frame.Panel, 9, 0) if not ScenarioAlertFrame1DungeonTexture.b then ScenarioAlertFrame1DungeonTexture.b = CreateFrame("Frame", nil, frame) ScenarioAlertFrame1DungeonTexture.b:SetFixedPanelTemplate("Default") @@ -215,11 +215,11 @@ local function AlertStyle() if frame then frame:SetAlpha(1) hooksecurefunc(frame, "SetAlpha", AlphaHelper) - if not frame.BasicBG then - STYLE:SetBasicBG(frame) - frame.BasicBG:Point("TOPLEFT", frame, "TOPLEFT", -2, -6) - frame.BasicBG:Point("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -2, 6) - end; + if not frame.Panel then + frame:SetBasicPanel() + frame.Panel:Point("TOPLEFT", frame, "TOPLEFT", -2, -6) + frame.Panel:Point("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -2, 6) + end _G["CriteriaAlertFrame"..i.."Unlocked"]:SetTextColor(1, 1, 1) _G["CriteriaAlertFrame"..i.."Name"]:SetTextColor(1, 1, 0) _G["CriteriaAlertFrame"..i.."Background"]:MUNG() @@ -233,7 +233,7 @@ local function AlertStyle() _G["CriteriaAlertFrame"..i.."IconTexture"].b:Point("TOPLEFT", _G["CriteriaAlertFrame"..i.."IconTexture"], "TOPLEFT", -3, 3) _G["CriteriaAlertFrame"..i.."IconTexture"].b:Point("BOTTOMRIGHT", _G["CriteriaAlertFrame"..i.."IconTexture"], "BOTTOMRIGHT", 3, -2) _G["CriteriaAlertFrame"..i.."IconTexture"]:SetParent(_G["CriteriaAlertFrame"..i.."IconTexture"].b) - end; + end _G["CriteriaAlertFrame"..i.."IconTexture"]:SetTexCoord(0.1, 0.9, 0.1, 0.9) end end @@ -255,11 +255,11 @@ local function AlertStyle() frame.Icon.b:SetFixedPanelTemplate("Default") frame.Icon.b:WrapOuter(frame.Icon) frame.Icon:SetParent(frame.Icon.b) - end; - if not frame.BasicBG then - STYLE:SetBasicBG(frame) - frame.BasicBG:SetPoint("TOPLEFT", frame.Icon.b, "TOPLEFT", -4, 4) - frame.BasicBG:SetPoint("BOTTOMRIGHT", frame.Icon.b, "BOTTOMRIGHT", 180, -4) + end + if not frame.Panel then + frame:SetBasicPanel() + frame.Panel:SetPoint("TOPLEFT", frame.Icon.b, "TOPLEFT", -4, 4) + frame.Panel:SetPoint("BOTTOMRIGHT", frame.Icon.b, "BOTTOMRIGHT", 180, -4) end end end @@ -279,11 +279,11 @@ local function AlertStyle() frame.Icon.b:SetFixedPanelTemplate("Default") frame.Icon.b:WrapOuter(frame.Icon) frame.Icon:SetParent(frame.Icon.b) - end; - if not frame.BasicBG then - STYLE:SetBasicBG(frame) - frame.BasicBG:SetPoint("TOPLEFT", frame.Icon.b, "TOPLEFT", -4, 4) - frame.BasicBG:SetPoint("BOTTOMRIGHT", frame.Icon.b, "BOTTOMRIGHT", 180, -4) + end + if not frame.Panel then + frame:SetBasicPanel() + frame.Panel:SetPoint("TOPLEFT", frame.Icon.b, "TOPLEFT", -4, 4) + frame.Panel:SetPoint("BOTTOMRIGHT", frame.Icon.b, "BOTTOMRIGHT", 180, -4) end end end @@ -299,9 +299,9 @@ local function AlertStyle() frame.Icon.b:SetFixedPanelTemplate("Default") frame.Icon.b:WrapOuter(frame.Icon) frame.Icon:SetParent(frame.Icon.b) - STYLE:SetBasicBG(frame) - frame.BasicBG:SetPoint("TOPLEFT", frame.Icon.b, "TOPLEFT", -4, 4) - frame.BasicBG:SetPoint("BOTTOMRIGHT", frame.Icon.b, "BOTTOMRIGHT", 180, -4) + frame:SetBasicPanel() + frame.Panel:SetPoint("TOPLEFT", frame.Icon.b, "TOPLEFT", -4, 4) + frame.Panel:SetPoint("BOTTOMRIGHT", frame.Icon.b, "BOTTOMRIGHT", 180, -4) local frame = BonusRollLootWonFrame; frame:SetAlpha(1) @@ -315,10 +315,10 @@ local function AlertStyle() frame.Icon.b:SetFixedPanelTemplate("Default") frame.Icon.b:WrapOuter(frame.Icon) frame.Icon:SetParent(frame.Icon.b) - STYLE:SetBasicBG(frame) - frame.BasicBG:SetPoint("TOPLEFT", frame.Icon.b, "TOPLEFT", -4, 4) - frame.BasicBG:SetPoint("BOTTOMRIGHT", frame.Icon.b, "BOTTOMRIGHT", 180, -4) -end; + frame:SetBasicPanel() + frame.Panel:SetPoint("TOPLEFT", frame.Icon.b, "TOPLEFT", -4, 4) + frame.Panel:SetPoint("BOTTOMRIGHT", frame.Icon.b, "BOTTOMRIGHT", 180, -4) +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/auctionhouse.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/auctionhouse.lua index 329d689..87c46e5 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/auctionhouse.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/auctionhouse.lua @@ -81,7 +81,7 @@ AUCTIONFRAME STYLER local function AuctionStyle() if(SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.auctionhouse ~= true) then return end; STYLE:ApplyCloseButtonStyle(AuctionFrameCloseButton) - STYLE:ApplyScrollStyle(AuctionsScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(AuctionsScrollFrameScrollBar) AuctionFrame:Formula409(true) AuctionFrame:SetPanelTemplate("Halftone", false, 2) BrowseFilterScrollFrame:Formula409() @@ -91,10 +91,11 @@ local function AuctionStyle() STYLE:ApplyDropdownStyle(BrowseDropDown) STYLE:ApplyDropdownStyle(PriceDropDown) STYLE:ApplyDropdownStyle(DurationDropDown) - STYLE:ApplyScrollStyle(BrowseFilterScrollFrameScrollBar) - STYLE:ApplyScrollStyle(BrowseScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(BrowseFilterScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(BrowseScrollFrameScrollBar) IsUsableCheckButton:SetCheckboxTemplate(true) ShowOnPlayerCheckButton:SetCheckboxTemplate(true) + ExactMatchCheckButton:SetCheckboxTemplate(true) SideDressUpFrame:Formula409(true) SideDressUpFrame:SetPanelTemplate("Halftone") SideDressUpFrame:Point("TOPLEFT", AuctionFrame, "TOPRIGHT", 7, 0) @@ -142,8 +143,6 @@ local function AuctionStyle() BrowseBuyoutButton:Point("RIGHT", BrowseCloseButton, "LEFT", -4, 0) BrowseBidButton:Point("RIGHT", BrowseBuyoutButton, "LEFT", -4, 0) - BrowseResetButton:Point("TOPLEFT", AuctionFrameBrowse, "TOPLEFT", 81, -74) - BrowseSearchButton:Point("TOPRIGHT", AuctionFrameBrowse, "TOPRIGHT", 25, -34) AuctionsItemButton:Formula409() AuctionsItemButton:SetButtonTemplate() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/barbershop.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/barbershop.lua index 87d1b68..f1cba95 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/barbershop.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/barbershop.lua @@ -55,7 +55,7 @@ local function BarberShopStyle() BarberShopAltFormFrameBorder:Formula409() BarberShopAltFormFrame:Point("BOTTOM", BarberShopFrame, "TOP", 0, 5) BarberShopAltFormFrame:Formula409() - STYLE:SetBasicBG(BarberShopAltFormFrame) + BarberShopAltFormFrame:SetBasicPanel() end; --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/blackmarket.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/blackmarket.lua index 47780cb..ccdf5c6 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/blackmarket.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/blackmarket.lua @@ -38,7 +38,7 @@ local function BlackMarketStyle() BlackMarketFrame.Inset:Formula409() BlackMarketFrame.Inset:SetFixedPanelTemplate("Inset") STYLE:ApplyCloseButtonStyle(BlackMarketFrame.CloseButton) - STYLE:ApplyScrollStyle(BlackMarketScrollFrameScrollBar, 4) + STYLE:ApplyScrollFrameStyle(BlackMarketScrollFrameScrollBar, 4) ChangeTab(BlackMarketFrame.ColumnName) ChangeTab(BlackMarketFrame.ColumnLevel) @@ -63,7 +63,7 @@ local function BlackMarketStyle() if not u.styled then u:Formula409() u:SetButtonTemplate() - STYLE:ApplyLinkButtonStyle(u.Item) + STYLE:ApplyItemButtonStyle(u.Item) u.styled = true end; if v <= t then @@ -75,7 +75,7 @@ local function BlackMarketStyle() end end) BlackMarketFrame.HotDeal:Formula409() - STYLE:ApplyLinkButtonStyle(BlackMarketFrame.HotDeal.Item) + STYLE:ApplyItemButtonStyle(BlackMarketFrame.HotDeal.Item) for b = 1, BlackMarketFrame:GetNumRegions()do local y = select(b, BlackMarketFrame:GetRegions()) if y and y:GetObjectType() == "FontString" and y:GetText() == BLACK_MARKET_TITLE then diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/calendar.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/calendar.lua index b3a2f40..7e14675 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/calendar.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/calendar.lua @@ -131,7 +131,7 @@ local function CalendarStyle() CalendarTexturePickerFrame:Formula409() CalendarTexturePickerTitleFrame:Formula409() CalendarTexturePickerFrame:SetFixedPanelTemplate("Transparent", true) - STYLE:ApplyScrollStyle(CalendarTexturePickerScrollBar) + STYLE:ApplyScrollFrameStyle(CalendarTexturePickerScrollBar) CalendarTexturePickerAcceptButton:SetButtonTemplate() CalendarTexturePickerCancelButton:SetButtonTemplate() CalendarCreateEventInviteButton:SetButtonTemplate() @@ -164,18 +164,18 @@ local function CalendarStyle() CalendarViewEventInviteList:SetFixedPanelTemplate("Transparent", true) CalendarViewEventInviteListSection:Formula409() STYLE:ApplyCloseButtonStyle(CalendarViewEventCloseButton) - STYLE:ApplyScrollStyle(CalendarViewEventInviteListScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(CalendarViewEventInviteListScrollFrameScrollBar) for _,btn in pairs(CalendarButtons)do _G[btn]:SetButtonTemplate() end CalendarEventPickerFrame:Formula409() CalendarEventPickerTitleFrame:Formula409() CalendarEventPickerFrame:SetFixedPanelTemplate("Transparent", true) - STYLE:ApplyScrollStyle(CalendarEventPickerScrollBar) + STYLE:ApplyScrollFrameStyle(CalendarEventPickerScrollBar) CalendarEventPickerCloseButton:SetButtonTemplate() - STYLE:ApplyScrollStyle(CalendarCreateEventDescriptionScrollFrameScrollBar) - STYLE:ApplyScrollStyle(CalendarCreateEventInviteListScrollFrameScrollBar) - STYLE:ApplyScrollStyle(CalendarViewEventDescriptionScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(CalendarCreateEventDescriptionScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(CalendarCreateEventInviteListScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(CalendarViewEventDescriptionScrollFrameScrollBar) end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/character.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/character.lua index c194e6c..c2a8b34 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/character.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/character.lua @@ -113,7 +113,7 @@ local function EquipmentFlyout_OnShow() local texture = _G["EquipmentFlyoutFrameButton"..counter.."IconTexture"] button:SetButtonTemplate() texture:SetTexCoord(0.1, 0.9, 0.1, 0.9) - button:GetNormalTexture():SetTexture(0,0,0,0) + button:GetNormalTexture():SetTexture("") texture:FillInner() button:SetFrameLevel(button:GetFrameLevel() + 2) if not button.Panel then @@ -162,13 +162,13 @@ local function Reputation_OnShow() if not bar.Panel then bar:SetPanelTemplate("Inset") end; - _G["ReputationBar"..i.."Background"]:SetTexture(0,0,0,0) - _G["ReputationBar"..i.."ReputationBarHighlight1"]:SetTexture(0,0,0,0) - _G["ReputationBar"..i.."ReputationBarHighlight2"]:SetTexture(0,0,0,0) - _G["ReputationBar"..i.."ReputationBarAtWarHighlight1"]:SetTexture(0,0,0,0) - _G["ReputationBar"..i.."ReputationBarAtWarHighlight2"]:SetTexture(0,0,0,0) - _G["ReputationBar"..i.."ReputationBarLeftTexture"]:SetTexture(0,0,0,0) - _G["ReputationBar"..i.."ReputationBarRightTexture"]:SetTexture(0,0,0,0) + _G["ReputationBar"..i.."Background"]:SetTexture("") + _G["ReputationBar"..i.."ReputationBarHighlight1"]:SetTexture("") + _G["ReputationBar"..i.."ReputationBarHighlight2"]:SetTexture("") + _G["ReputationBar"..i.."ReputationBarAtWarHighlight1"]:SetTexture("") + _G["ReputationBar"..i.."ReputationBarAtWarHighlight2"]:SetTexture("") + _G["ReputationBar"..i.."ReputationBarLeftTexture"]:SetTexture("") + _G["ReputationBar"..i.."ReputationBarRightTexture"]:SetTexture("") end end end; @@ -182,10 +182,10 @@ local function CharacterFrameStyle() return end; STYLE:ApplyCloseButtonStyle(CharacterFrameCloseButton) - STYLE:ApplyScrollStyle(CharacterStatsPaneScrollBar) - STYLE:ApplyScrollStyle(ReputationListScrollFrameScrollBar) - STYLE:ApplyScrollStyle(TokenFrameContainerScrollBar) - STYLE:ApplyScrollStyle(GearManagerDialogPopupScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(CharacterStatsPaneScrollBar) + STYLE:ApplyScrollFrameStyle(ReputationListScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(TokenFrameContainerScrollBar) + STYLE:ApplyScrollFrameStyle(GearManagerDialogPopupScrollFrameScrollBar) for _,slotName in pairs(CharacterSlotNames) do local charSlot = _G["Character"..slotName] @@ -245,47 +245,47 @@ local function CharacterFrameStyle() EquipmentFlyoutFrame:HookScript("OnShow", EquipmentFlyout_OnShow) hooksecurefunc("EquipmentFlyout_Show", EquipmentFlyout_OnShow) CharacterFramePortrait:MUNG() - STYLE:ApplyScrollStyle(_G["PaperDollTitlesPaneScrollBar"], 5) - STYLE:ApplyScrollStyle(_G["PaperDollEquipmentManagerPaneScrollBar"], 5) + STYLE:ApplyScrollFrameStyle(_G["PaperDollTitlesPaneScrollBar"], 5) + STYLE:ApplyScrollFrameStyle(_G["PaperDollEquipmentManagerPaneScrollBar"], 5) for _,btn in pairs(CharFrameList)do _G[btn]:Formula409(true) end; - CharacterModelFrameBackgroundTopLeft:SetTexture(0,0,0,0) - CharacterModelFrameBackgroundTopRight:SetTexture(0,0,0,0) - CharacterModelFrameBackgroundBotLeft:SetTexture(0,0,0,0) - CharacterModelFrameBackgroundBotRight:SetTexture(0,0,0,0) + CharacterModelFrameBackgroundTopLeft:SetTexture("") + CharacterModelFrameBackgroundTopRight:SetTexture("") + CharacterModelFrameBackgroundBotLeft:SetTexture("") + CharacterModelFrameBackgroundBotRight:SetTexture("") CharacterFrame:SetPanelTemplate("Action") CharacterModelFrame:SetPanelTemplate("Comic", false, 0) CharacterFrameExpandButton:SetFrameLevel(CharacterModelFrame:GetFrameLevel() + 5) - --STYLE:SetBasicBG(CharacterStatsPane) - STYLE:SetBasicBG(PaperDollTitlesPane) + + PaperDollTitlesPane:SetBasicPanel() PaperDollTitlesPane:HookScript("OnShow", function(f) for _,btn in pairs(PaperDollTitlesPane.buttons)do - btn.BgTop:SetTexture(0,0,0,0) - btn.BgBottom:SetTexture(0,0,0,0) - btn.BgMiddle:SetTexture(0,0,0,0) - btn.Check:SetTexture(0,0,0,0) + btn.BgTop:SetTexture("") + btn.BgBottom:SetTexture("") + btn.BgMiddle:SetTexture("") + btn.Check:SetTexture("") btn.text:FillInner(btn) btn.text:SetFont(SuperVillain.Media.font.roboto,10,"NONE","LEFT") end end) - STYLE:SetBasicBG(PaperDollEquipmentManagerPane) + PaperDollEquipmentManagerPane:SetBasicPanel() PaperDollEquipmentManagerPaneEquipSet:SetButtonTemplate() PaperDollEquipmentManagerPaneSaveSet:SetButtonTemplate() PaperDollEquipmentManagerPaneEquipSet:Width(PaperDollEquipmentManagerPaneEquipSet:GetWidth()-8) PaperDollEquipmentManagerPaneSaveSet:Width(PaperDollEquipmentManagerPaneSaveSet:GetWidth()-8) PaperDollEquipmentManagerPaneEquipSet:Point("TOPLEFT", PaperDollEquipmentManagerPane, "TOPLEFT", 8, 0) PaperDollEquipmentManagerPaneSaveSet:Point("LEFT", PaperDollEquipmentManagerPaneEquipSet, "RIGHT", 4, 0) - PaperDollEquipmentManagerPaneEquipSet.ButtonBackground:SetTexture(0,0,0,0) + PaperDollEquipmentManagerPaneEquipSet.ButtonBackground:SetTexture("") PaperDollEquipmentManagerPane:HookScript("OnShow", function(f) for _,btn in pairs(PaperDollEquipmentManagerPane.buttons)do - btn.BgTop:SetTexture(0,0,0,0) - btn.BgBottom:SetTexture(0,0,0,0) - btn.BgMiddle:SetTexture(0,0,0,0) + btn.BgTop:SetTexture("") + btn.BgBottom:SetTexture("") + btn.BgMiddle:SetTexture("") btn.icon:Size(36, 36) - btn.Check:SetTexture(0,0,0,0) + btn.Check:SetTexture("") btn.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) btn.icon:SetPoint("LEFT", btn, "LEFT", 4, 0) hooksecurefunc(btn.icon, "SetPoint", function(f, g, h, i, j, k, X) @@ -308,7 +308,7 @@ local function CharacterFrameStyle() GearManagerDialogPopupScrollFrame:Formula409() GearManagerDialogPopupEditBox:Formula409() - STYLE:SetBasicBG(GearManagerDialogPopupEditBox) + GearManagerDialogPopupEditBox:SetBasicPanel() GearManagerDialogPopupOkay:SetButtonTemplate() GearManagerDialogPopupCancel:SetButtonTemplate() @@ -320,7 +320,7 @@ local function CharacterFrameStyle() e:Formula409() e:SetButtonTemplate() texture:SetTexCoord(0.1, 0.9, 0.1, 0.9) - _G["GearManagerDialogPopupButton"..i.."Icon"]:SetTexture(0,0,0,0) + _G["GearManagerDialogPopupButton"..i.."Icon"]:SetTexture("") texture:FillInner() e:SetFrameLevel(e:GetFrameLevel() + 2) if not e.Panel then @@ -348,12 +348,12 @@ local function CharacterFrameStyle() ReputationFrame:Formula409(true) ReputationListScrollFrame:Formula409() ReputationDetailFrame:Formula409() - STYLE:SetBasicBG(ReputationDetailFrame) + ReputationDetailFrame:SetBasicPanel() ReputationDetailFrame:Point("TOPLEFT", ReputationFrame, "TOPRIGHT", 4, -28) ReputationFrame:HookScript("OnShow", Reputation_OnShow) hooksecurefunc("ExpandFactionHeader", Reputation_OnShow) hooksecurefunc("CollapseFactionHeader", Reputation_OnShow) - STYLE:SetBasicBG(TokenFrameContainer) + TokenFrameContainer:SetBasicPanel() TokenFrame:HookScript("OnShow", function() for i = 1, GetCurrencyListSize() do @@ -369,7 +369,7 @@ local function CharacterFrameStyle() end end; TokenFramePopup:Formula409() - STYLE:SetBasicBG(TokenFramePopup) + TokenFramePopup:SetBasicPanel() TokenFramePopup:Point("TOPLEFT", TokenFrame, "TOPRIGHT", 4, -28) end) PetModelFrame:SetPanelTemplate("Comic",false,1,-7,-7) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/chat.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/chat.lua new file mode 100644 index 0000000..f843cbc --- /dev/null +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/chat.lua @@ -0,0 +1,477 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +--]] +local SuperVillain, L = unpack(SVUI); +local STYLE = _G.StyleVillain; +--[[ +########################################################## +FRAME LISTS +########################################################## +]]-- +local ChatMenuList = { + "ChatMenu", + "EmoteMenu", + "LanguageMenu", + "VoiceMacroMenu", +}; +local ChatFrameList1 = { + "ChatConfigFrame", + "ChatConfigBackgroundFrame", + "ChatConfigCategoryFrame", + "ChatConfigChatSettingsClassColorLegend", + "ChatConfigChatSettingsLeft", + "ChatConfigChannelSettingsLeft", + "ChatConfigChannelSettingsClassColorLegend", + "ChatConfigOtherSettingsCombat", + "ChatConfigOtherSettingsPVP", + "ChatConfigOtherSettingsSystem", + "ChatConfigOtherSettingsCreature", + "ChatConfigCombatSettingsFilters", + "CombatConfigMessageSourcesDoneBy", + "CombatConfigMessageSourcesDoneTo", + "CombatConfigColorsUnitColors", + "CombatConfigColorsHighlighting", + "CombatConfigColorsColorizeUnitName", + "CombatConfigColorsColorizeSpellNames", + "CombatConfigColorsColorizeDamageNumber", + "CombatConfigColorsColorizeDamageSchool", + "CombatConfigColorsColorizeEntireLine", +}; +local ChatFrameList2 = { + "ChatConfigFrameDefaultButton", + "ChatConfigFrameOkayButton", + "CombatLogDefaultButton", + "ChatConfigCombatSettingsFiltersCopyFilterButton", + "ChatConfigCombatSettingsFiltersAddFilterButton", + "ChatConfigCombatSettingsFiltersDeleteButton", + "CombatConfigSettingsSaveButton", + "ChatConfigFrameCancelButton", +}; +local ChatFrameList3 = { + "ChatConfigCategoryFrame", + "ChatConfigBackgroundFrame", + "ChatConfigChatSettingsClassColorLegend", + "ChatConfigChannelSettingsClassColorLegend", + "ChatConfigCombatSettingsFilters", + "ChatConfigCombatSettingsFiltersScrollFrame", + "CombatConfigColorsHighlighting", + "CombatConfigColorsColorizeUnitName", + "CombatConfigColorsColorizeSpellNames", + "CombatConfigColorsColorizeDamageNumber", + "CombatConfigColorsColorizeDamageSchool", + "CombatConfigColorsColorizeEntireLine", + "ChatConfigChatSettingsLeft", + "ChatConfigOtherSettingsCombat", + "ChatConfigOtherSettingsPVP", + "ChatConfigOtherSettingsSystem", + "ChatConfigOtherSettingsCreature", + "ChatConfigChannelSettingsLeft", + "CombatConfigMessageSourcesDoneBy", + "CombatConfigMessageSourcesDoneTo", + "CombatConfigColorsUnitColors", +}; +local ChatFrameList4 = { + "CombatConfigColorsColorizeSpellNames", + "CombatConfigColorsColorizeDamageNumber", + "CombatConfigColorsColorizeDamageSchool", + "CombatConfigColorsColorizeEntireLine", +}; +local ChatFrameList5 = { + "ChatConfigFrameOkayButton", + "ChatConfigFrameDefaultButton", + "CombatLogDefaultButton", + "ChatConfigCombatSettingsFiltersDeleteButton", + "ChatConfigCombatSettingsFiltersAddFilterButton", + "ChatConfigCombatSettingsFiltersCopyFilterButton", + "CombatConfigSettingsSaveButton", +}; +local ChatFrameList6 = { + "CombatConfigColorsHighlightingLine", + "CombatConfigColorsHighlightingAbility", + "CombatConfigColorsHighlightingDamage", + "CombatConfigColorsHighlightingSchool", + "CombatConfigColorsColorizeUnitNameCheck", + "CombatConfigColorsColorizeSpellNamesCheck", + "CombatConfigColorsColorizeSpellNamesSchoolColoring", + "CombatConfigColorsColorizeDamageNumberCheck", + "CombatConfigColorsColorizeDamageNumberSchoolColoring", + "CombatConfigColorsColorizeDamageSchoolCheck", + "CombatConfigColorsColorizeEntireLineCheck", + "CombatConfigFormattingShowTimeStamp", + "CombatConfigFormattingShowBraces", + "CombatConfigFormattingUnitNames", + "CombatConfigFormattingSpellNames", + "CombatConfigFormattingItemNames", + "CombatConfigFormattingFullText", + "CombatConfigSettingsShowQuickButton", + "CombatConfigSettingsSolo", + "CombatConfigSettingsParty", + "CombatConfigSettingsRaid", +}; +--[[ +########################################################## +HELPERS +########################################################## +]]-- +local ChatGeneric_OnShow = function(self) + if(not self.Panel) then + self:SetPanelTemplate("Halftone") + end +end + +local ChatMenu_OnShow = function(self) + if(not self.Panel) then + self:SetPanelTemplate("Halftone") + end + self:ClearAllPoints() + self:Point("BOTTOMLEFT", ChatFrame1, "TOPLEFT", 0, 30) +end + +local ChatConfigChannelSettingsLeft_OnEvent = function(self, event) + ChatConfigChannelSettingsLeft:UnregisterEvent("PLAYER_ENTERING_WORLD") + local checkBoxTable = self.checkBoxTable; + local checkBoxNameString = "ChatConfigChannelSettingsLeftCheckBox"; + local boxHeight = ChatConfigOtherSettingsCombatCheckBox1:GetHeight() or 20 + local colorsHeight = ChatConfigChatSettingsLeftCheckBox1Check:GetHeight() or 20 + for i = 1,#checkBoxTable do + local gName = ("ChatConfigChannelSettingsLeftCheckBox%d"):format(i) + local checkbox = _G[gName] + if(checkbox) then + if(not checkbox.Panel) then + checkbox:Formula409() + checkbox:SetBasicPanel() + end + checkbox:SetHeight(boxHeight) + checkbox.Panel:Point("TOPLEFT",3,-1) + checkbox.Panel:Point("BOTTOMRIGHT",-3,1) + local check = _G[("%sCheck"):format(gName)] + if(check and not check.Panel) then + check:SetCheckboxTemplate(true) + end + local colors = _G[("%sColorClasses"):format(gName)] + if(colors) then + if(not colors.Panel) then + colors:SetCheckboxTemplate(true) + end + colors:SetHeight(colorsHeight) + end + end + end +end + +local ChatConfigBackgroundFrame_OnShow = function(self) + local gName, checkbox, check, colors + local boxHeight = ChatConfigOtherSettingsCombatCheckBox1:GetHeight() or 20 + local colorsHeight = ChatConfigChatSettingsLeftCheckBox1Check:GetHeight() or 20 + + for i = 1, #CHAT_CONFIG_CHAT_LEFT do + gName = ("ChatConfigChatSettingsLeftCheckBox%d"):format(i) + checkbox = _G[gName] + if(checkbox) then + if(not checkbox.Panel) then + checkbox:Formula409() + checkbox:SetPanelTemplate("Default") + end + checkbox.Panel:Point("TOPLEFT", 3, -1) + checkbox.Panel:Point("BOTTOMRIGHT", -3, 1) + checkbox:SetHeight(boxHeight) + + check = _G[("%sCheck"):format(gName)] + if(check and not check.Panel) then + check:SetCheckboxTemplate(true) + end + colors = _G[("%sColorClasses"):format(gName)] + if(colors) then + if(not colors.Panel) then + colors:SetCheckboxTemplate(true) + end + colors:SetHeight(colorsHeight) + end + end + end + for i = 1, #CHAT_CONFIG_OTHER_COMBAT do + gName = ("ChatConfigOtherSettingsCombatCheckBox%d"):format(i) + checkbox = _G[gName] + if(checkbox) then + if(not checkbox.Panel) then + checkbox:Formula409() + checkbox:SetPanelTemplate("Default") + end + checkbox.Panel:Point("TOPLEFT", 3, -1) + checkbox.Panel:Point("BOTTOMRIGHT", -3, 1) + + check = _G[("%sCheck"):format(gName)] + if(check and not check.Panel) then + check:SetCheckboxTemplate(true) + end + end + end + for i = 1, #CHAT_CONFIG_OTHER_PVP do + gName = ("ChatConfigOtherSettingsPVPCheckBox%d"):format(i) + checkbox = _G[gName] + if(checkbox) then + if(not checkbox.Panel) then + checkbox:Formula409() + checkbox:SetPanelTemplate("Default") + end + checkbox.Panel:Point("TOPLEFT", 3, -1) + checkbox.Panel:Point("BOTTOMRIGHT", -3, 1) + + check = _G[("%sCheck"):format(gName)] + if(check and not check.Panel) then + check:SetCheckboxTemplate(true) + end + end + end + for i = 1, #CHAT_CONFIG_OTHER_SYSTEM do + gName = ("ChatConfigOtherSettingsSystemCheckBox%d"):format(i) + checkbox = _G[gName] + if(checkbox) then + if(not checkbox.Panel) then + checkbox:Formula409() + checkbox:SetPanelTemplate("Default") + end + checkbox.Panel:Point("TOPLEFT", 3, -1) + checkbox.Panel:Point("BOTTOMRIGHT", -3, 1) + + check = _G[("%sCheck"):format(gName)] + if(check and not check.Panel) then + check:SetCheckboxTemplate(true) + end + end + end + for i = 1, #CHAT_CONFIG_CHAT_CREATURE_LEFT do + gName = ("ChatConfigOtherSettingsCreatureCheckBox%d"):format(i) + checkbox = _G[gName] + if(checkbox) then + if(not checkbox.Panel) then + checkbox:Formula409() + checkbox:SetPanelTemplate("Default") + end + checkbox.Panel:Point("TOPLEFT", 3, -1) + checkbox.Panel:Point("BOTTOMRIGHT", -3, 1) + + check = _G[("%sCheck"):format(gName)] + if(check and not check.Panel) then + check:SetCheckboxTemplate(true) + end + end + end + for i = 1, #COMBAT_CONFIG_MESSAGESOURCES_BY do + gName = ("CombatConfigMessageSourcesDoneByCheckBox%d"):format(i) + checkbox = _G[gName] + if(checkbox) then + if(not checkbox.Panel) then + checkbox:Formula409() + checkbox:SetPanelTemplate("Default") + end + checkbox.Panel:Point("TOPLEFT", 3, -1) + checkbox.Panel:Point("BOTTOMRIGHT", -3, 1) + + check = _G[("%sCheck"):format(gName)] + if(check and not check.Panel) then + check:SetCheckboxTemplate(true) + end + end + end + for i = 1, #COMBAT_CONFIG_MESSAGESOURCES_TO do + gName = ("CombatConfigMessageSourcesDoneToCheckBox%d"):format(i) + checkbox = _G[gName] + if(checkbox) then + if(not checkbox.Panel) then + checkbox:Formula409() + checkbox:SetPanelTemplate("Default") + end + checkbox.Panel:Point("TOPLEFT", 3, -1) + checkbox.Panel:Point("BOTTOMRIGHT", -3, 1) + + check = _G[("%sCheck"):format(gName)] + if(check and not check.Panel) then + check:SetCheckboxTemplate(true) + end + end + end + for i = 1, #COMBAT_CONFIG_UNIT_COLORS do + gName = ("CombatConfigColorsUnitColorsSwatch%d"):format(i) + checkbox = _G[gName] + if(checkbox) then + if(not checkbox.Panel) then + checkbox:Formula409() + checkbox:SetPanelTemplate("Default") + end + checkbox.Panel:Point("TOPLEFT", 3, -1) + checkbox.Panel:Point("BOTTOMRIGHT", -3, 1) + end + end + for i = 1, 4 do + gName = ("CombatConfigMessageTypesLeftCheckBox%d"):format(i) + for j = 1, 4 do + local gName2 = ("%s_%d"):format(gName, j) + if(_G[gName] and _G[gName2]) then + _G[gName]:SetCheckboxTemplate(true) + _G[gName2]:SetCheckboxTemplate(true) + end + end + + gName = ("CombatConfigMessageTypesRightCheckBox%d"):format(i) + for j = 1, 10 do + local gName2 = ("%s_%d"):format(gName, j) + if(_G[gName] and _G[gName2]) then + _G[gName]:SetCheckboxTemplate(true) + _G[gName2]:SetCheckboxTemplate(true) + end + end + + gName = ("CombatConfigMessageTypesMiscCheckBox%d"):format(i) + if(_G[gName]) then + _G[gName]:SetCheckboxTemplate(true) + end + end +end +--[[ +########################################################## +CHAT STYLER +########################################################## +]]-- +local function ChatStyle() + if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.chat ~= true then + return + end + + for i = 1, #ChatMenuList do + local name = ChatMenuList[i] + local this = _G[name] + if(this) then + if(name == "ChatMenu") then + this:HookScript("OnShow", ChatMenu_OnShow) + else + this:HookScript("OnShow", ChatGeneric_OnShow) + end + end + end + + for i = 1, #ChatFrameList1 do + local name = ChatFrameList1[i] + local this = _G[name] + if(this) then + this:Formula409() + end + end + + for i = 1, #ChatFrameList2 do + local name = ChatFrameList2[i] + local this = _G[name] + if(this) then + this:SetButtonTemplate() + end + end + + ChatConfigFrameOkayButton:Point("RIGHT", ChatConfigFrameCancelButton, "RIGHT", -11, -1) + ChatConfigCombatSettingsFiltersDeleteButton:Point("TOPRIGHT", ChatConfigCombatSettingsFilters, "BOTTOMRIGHT", 0, -1) + ChatConfigCombatSettingsFiltersAddFilterButton:Point("RIGHT", ChatConfigCombatSettingsFiltersDeleteButton, "LEFT", -1, 0) + ChatConfigCombatSettingsFiltersCopyFilterButton:Point("RIGHT", ChatConfigCombatSettingsFiltersAddFilterButton, "LEFT", -1, 0) + + if(_G["CombatConfigTab1"]) then _G["CombatConfigTab1"]:Formula409() end + if(_G["CombatConfigTab2"]) then _G["CombatConfigTab2"]:Formula409() end + if(_G["CombatConfigTab3"]) then _G["CombatConfigTab3"]:Formula409() end + if(_G["CombatConfigTab4"]) then _G["CombatConfigTab4"]:Formula409() end + if(_G["CombatConfigTab5"]) then _G["CombatConfigTab5"]:Formula409() end + + CombatConfigSettingsNameEditBox:SetEditboxTemplate() + ChatConfigFrame:SetPanelTemplate("Halftone", true) + + for i = 1, #ChatFrameList3 do + local frame = _G[ChatFrameList3[i]] + if(frame) then + frame:Formula409() + frame:SetBasicPanel() + end + end + + for i = 1, #ChatFrameList4 do + local this = _G[ChatFrameList4[i]] + if(this) then + this:ClearAllPoints() + if this == CombatConfigColorsColorizeSpellNames then + this:Point("TOP",CombatConfigColorsColorizeUnitName,"BOTTOM",0,-2) + else + this:Point("TOP",_G[ChatFrameList4[i-1]],"BOTTOM",0,-2) + end + end + end + + ChatConfigChannelSettingsLeft:RegisterEvent("PLAYER_ENTERING_WORLD") + ChatConfigChannelSettingsLeft:SetScript("OnEvent", ChatConfigChannelSettingsLeft_OnEvent) + + CreateChatChannelList(ChatConfigChannelSettings, GetChannelList()) + ChatConfig_CreateCheckboxes(ChatConfigChannelSettingsLeft, CHAT_CONFIG_CHANNEL_LIST, "ChatConfigCheckBoxWithSwatchAndClassColorTemplate", CHANNELS) + ChatConfig_UpdateCheckboxes(ChatConfigChannelSettingsLeft) + + ChatConfigBackgroundFrame:SetScript("OnShow", ChatConfigBackgroundFrame_OnShow) + + for i = 1, #COMBAT_CONFIG_TABS do + local this = _G["CombatConfigTab"..i] + if(this) then + STYLE:ApplyTabStyle(this) + this:SetHeight(this:GetHeight()-2) + this:SetWidth(ceil(this:GetWidth()+1.6)) + _G["CombatConfigTab"..i.."Text"]:SetPoint("BOTTOM", 0, 10) + end + end + + CombatConfigTab1:ClearAllPoints() + CombatConfigTab1:SetPoint("BOTTOMLEFT", ChatConfigBackgroundFrame, "TOPLEFT", 6, -2) + + for i = 1, #ChatFrameList5 do + local this = _G[ChatFrameList5[i]] + if(this) then + this:SetButtonTemplate() + end + end + + ChatConfigFrameOkayButton:SetPoint("TOPRIGHT", ChatConfigBackgroundFrame, "BOTTOMRIGHT", -3, -5) + ChatConfigFrameDefaultButton:SetPoint("TOPLEFT", ChatConfigCategoryFrame, "BOTTOMLEFT", 1, -5) + CombatLogDefaultButton:SetPoint("TOPLEFT", ChatConfigCategoryFrame, "BOTTOMLEFT", 1, -5) + ChatConfigCombatSettingsFiltersDeleteButton:SetPoint("TOPRIGHT", ChatConfigCombatSettingsFilters, "BOTTOMRIGHT", -3, -1) + ChatConfigCombatSettingsFiltersCopyFilterButton:SetPoint("RIGHT", ChatConfigCombatSettingsFiltersDeleteButton, "LEFT", -2, 0) + ChatConfigCombatSettingsFiltersAddFilterButton:SetPoint("RIGHT", ChatConfigCombatSettingsFiltersCopyFilterButton, "LEFT", -2, 0) + + for i = 1, #ChatFrameList6 do + local this = _G[ChatFrameList6[i]] + if(this) then + this:SetCheckboxTemplate(true) + end + end + + STYLE:ApplyPaginationStyle(ChatConfigMoveFilterUpButton,true) + STYLE:ApplyPaginationStyle(ChatConfigMoveFilterDownButton,true) + + ChatConfigMoveFilterUpButton:ClearAllPoints() + ChatConfigMoveFilterDownButton:ClearAllPoints() + ChatConfigMoveFilterUpButton:SetPoint("TOPLEFT",ChatConfigCombatSettingsFilters,"BOTTOMLEFT",3,0) + ChatConfigMoveFilterDownButton:SetPoint("LEFT",ChatConfigMoveFilterUpButton,24,0) + + CombatConfigSettingsNameEditBox:SetEditboxTemplate() + + ChatConfigFrame:Size(680,596) + ChatConfigFrameHeader:ClearAllPoints() + ChatConfigFrameHeader:SetPoint("TOP", ChatConfigFrame, "TOP", 0, -5) +end; +--[[ +########################################################## +STYLE LOADING +########################################################## +]]-- +STYLE:SaveCustomStyle(ChatStyle) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/encounterjournal.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/encounterjournal.lua index 1dc5fa3..3213aaf 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/encounterjournal.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/encounterjournal.lua @@ -32,24 +32,26 @@ local function Tab_OnLeave(this) this.backdrop:SetBackdropBorderColor(0,0,0,1) end -local function ChangeTabHelper(this, x, y) - --this:Formula409() +local function ChangeTabHelper(this, xOffset, yOffset) this:GetNormalTexture():SetTexCoord(0.1, 0.9, 0.1, 0.9) this:GetNormalTexture():FillInner() this.backdrop = CreateFrame("Frame", nil, this) this.backdrop:FillInner(this) + local level = this:GetFrameLevel() if(level > 0) then this.backdrop:SetFrameLevel(level - 1) else this.backdrop:SetFrameLevel(0) end + this.backdrop:SetPanelTemplate("Component", true) this.backdrop:SetPanelColor("dark") this:HookScript("OnEnter",Tab_OnEnter) this:HookScript("OnLeave",Tab_OnLeave) - local a,b,c,d,e = this:GetPoint() - this:Point(a,b,c,x or 7,y or e) + + local initialAnchor, anchorParent, relativeAnchor, xPosition, yPosition = this:GetPoint() + this:Point(initialAnchor, anchorParent, relativeAnchor, xOffset or 7, yOffset or yPosition) end local function Outline(frame, noHighlight) @@ -99,6 +101,7 @@ local function EncounterJournalStyle() if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.encounterjournal ~= true then return end; + EncounterJournal:Formula409(true) EncounterJournalInstanceSelect:Formula409(true) EncounterJournalNavBar:Formula409(true) @@ -115,19 +118,16 @@ local function EncounterJournalStyle() EncounterJournalInstanceSelectRaidTab:Formula409(true) ChangeTabHelper(EncounterJournalEncounterFrameInfoBossTab) ChangeTabHelper(EncounterJournalEncounterFrameInfoLootTab, 0, -10) - --EncounterJournalEncounterFrameInstanceFrame:Formula409(true) EncounterJournalSearchResults:Formula409(true) - --EncounterJournal:SetPanelTemplate("Halftone") EncounterJournal:SetPanelTemplate("Action") EncounterJournal:SetPanelColor("dark") EncounterJournalInset:SetFixedPanelTemplate("Inset") EncounterJournalInstanceSelectScrollFrameScrollChild:SetFixedPanelTemplate("Default") EncounterJournalInstanceSelectScrollFrameScrollChild:SetPanelColor("dark") - -- EncounterJournalInstanceSelectScrollFrameinstance6 - -- EncounterJournalBossButton1 + EncounterJournalEncounterFrameInstanceFrame:SetFixedPanelTemplate("Inset") local comicHolder = CreateFrame('Frame', nil, EncounterJournal.encounter) @@ -147,22 +147,11 @@ local function EncounterJournalStyle() EncounterJournalInstanceSelectDungeonTab:SetButtonTemplate() EncounterJournalInstanceSelectRaidTab:SetButtonTemplate() - STYLE:ApplyScrollbarStyle(EncounterJournalEncounterFrameInfoLootScrollBar) + STYLE:ApplyScrollBarStyle(EncounterJournalEncounterFrameInfoLootScrollBar) local bgParent = EncounterJournal.encounter.instance local loreParent = EncounterJournal.encounter.instance.loreScroll - -- local lorepanel = CreateFrame('Frame', nil, EncounterJournalEncounterFrame) - -- lorepanel:SetAllPoints(bgParent) - -- local blackout = lorepanel:CreateTexture(nil, "BACKGROUND") - -- blackout:SetAllPoints(lorepanel) - -- blackout:SetTexture(0,0,0) - -- local bigBorder = CreateFrame('Frame', nil, bgParent) - -- bigBorder:SetPoint("TOPLEFT", bgParent, "TOPLEFT", 0, 0) - -- bigBorder:SetPoint("BOTTOMRIGHT", bgParent, "BOTTOMRIGHT", 0, 66) - -- Outline(bigBorder, true) - - --bgParent.loreBG:SetTexCoord(0.07, 0.93, 0.07, 0.7) bgParent.loreBG:SetPoint("TOPLEFT", bgParent, "TOPLEFT", 0, 0) bgParent.loreBG:SetPoint("BOTTOMRIGHT", bgParent, "BOTTOMRIGHT", 0, 90) @@ -172,11 +161,6 @@ local function EncounterJournalStyle() EncounterJournal.encounter.infoFrame.description:SetTextColor(1, 1, 1) loreParent:SetFrameLevel(loreParent:GetFrameLevel() + 10) - --EncounterJournalSearchResults:SetFixedPanelTemplate("Comic") - - --EncounterJournalNavBarButton2:Formula409(true) - --EncounterJournalNavBarButton2:SetButtonTemplate() - --EncounterJournal_ListInstances local frame = EncounterJournal.instanceSelect.scroll.child local index = 1 @@ -240,4 +224,4 @@ end; STYLE LOADING ########################################################## ]]-- -STYLE:SaveBlizzardStyle('Blizzard_EncounterJournal',EncounterJournalStyle) \ No newline at end of file +STYLE:SaveBlizzardStyle('Blizzard_EncounterJournal', EncounterJournalStyle) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/friends.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/friends.lua index 4511e92..5d72e1b 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/friends.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/friends.lua @@ -48,17 +48,17 @@ local FriendsFrameList1 = { "AddFriendFrame", "AddFriendNoteFrame" }; -local FriendsFrameList2 = { - "FriendsFrameBroadcastInputLeft", - "FriendsFrameBroadcastInputRight", - "FriendsFrameBroadcastInputMiddle", - "ChannelFrameDaughterFrameChannelNameLeft", - "ChannelFrameDaughterFrameChannelNameRight", - "ChannelFrameDaughterFrameChannelNameMiddle", - "ChannelFrameDaughterFrameChannelPasswordLeft", - "ChannelFrameDaughterFrameChannelPasswordRight", - "ChannelFrameDaughterFrameChannelPasswordMiddle" -}; +-- local FriendsFrameList2 = { +-- "FriendsFrameBroadcastInputLeft", +-- "FriendsFrameBroadcastInputRight", +-- "FriendsFrameBroadcastInputMiddle", +-- "ChannelFrameDaughterFrameChannelNameLeft", +-- "ChannelFrameDaughterFrameChannelNameRight", +-- "ChannelFrameDaughterFrameChannelNameMiddle", +-- "ChannelFrameDaughterFrameChannelPasswordLeft", +-- "ChannelFrameDaughterFrameChannelPasswordRight", +-- "ChannelFrameDaughterFrameChannelPasswordMiddle" +-- }; local FriendsFrameButtons = { "FriendsFrameAddFriendButton", "FriendsFrameSendMessageButton", @@ -86,18 +86,18 @@ local FriendsFrameButtons = { }; local function TabCustomHelper(this) - if not this then return end; + if not this then return end for _,prop in pairs(FrameSuffix) do local frame = _G[this:GetName()..prop] - frame:SetTexture(0,0,0,0) - end; - this:GetHighlightTexture():SetTexture(0,0,0,0) + frame:SetTexture("") + end + this:GetHighlightTexture():SetTexture("") this.backdrop = CreateFrame("Frame", nil, this) this.backdrop:SetFixedPanelTemplate("Default") this.backdrop:SetFrameLevel(this:GetFrameLevel()-1) this.backdrop:Point("TOPLEFT", 3, -8) this.backdrop:Point("BOTTOMRIGHT", -6, 0) -end; +end local function ChannelList_OnUpdate() for i = 1, MAX_DISPLAY_CHANNEL_BUTTONS do @@ -108,7 +108,7 @@ local function ChannelList_OnUpdate() _G["ChannelButton"..i.."Text"]:SetFontTemplate(nil, 12) end end -end; +end --[[ ########################################################## FRIENDSFRAME STYLER @@ -131,10 +131,10 @@ local function FriendsFrameStyle() end FriendsFrame.Panel:SetPanelTemplate("Halftone") - STYLE:ApplyScrollStyle(FriendsFrameFriendsScrollFrameScrollBar, 5) - STYLE:ApplyScrollStyle(WhoListScrollFrameScrollBar, 5) - STYLE:ApplyScrollStyle(ChannelRosterScrollFrameScrollBar, 5) - STYLE:ApplyScrollStyle(FriendsFriendsScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(FriendsFrameFriendsScrollFrameScrollBar, 5) + STYLE:ApplyScrollFrameStyle(WhoListScrollFrameScrollBar, 5) + STYLE:ApplyScrollFrameStyle(ChannelRosterScrollFrameScrollBar, 5) + STYLE:ApplyScrollFrameStyle(FriendsFriendsScrollFrameScrollBar) FriendsFrameInset:Formula409() WhoFrameListInset:Formula409() WhoFrameEditBoxInset:Formula409() @@ -147,25 +147,30 @@ local function FriendsFrameStyle() LFRQueueFrameRoleInset:Formula409() LFRQueueFrameCommentInset:Formula409() LFRQueueFrameListInset:SetFixedPanelTemplate("Inset", true) - STYLE:SetBasicBG(FriendsFrameFriendsScrollFrame) - FriendsFrameFriendsScrollFrame.BasicBG:Point("TOPRIGHT", -4, 0) - STYLE:SetBasicBG(WhoFrameListInset) + FriendsFrameFriendsScrollFrame:SetBasicPanel() + FriendsFrameFriendsScrollFrame.Panel:Point("TOPRIGHT", -4, 0) + WhoFrameListInset:SetBasicPanel() + for c, e in pairs(FriendsFrameButtons)do _G[e]:SetButtonTemplate() - end; - for c, texture in pairs(FriendsFrameList2)do - _G[texture]:MUNG() - end; + end + + -- for c, texture in pairs(FriendsFrameList2)do + -- _G[texture]:MUNG() + -- end + for c, V in pairs(FriendsFrameList1)do _G[V]:Formula409() - end; + end + for u = 1, FriendsFrame:GetNumRegions()do local a1 = select(u, FriendsFrame:GetRegions()) if a1:GetObjectType() == "Texture"then - a1:SetTexture(0,0,0,0) + a1:SetTexture("") a1:SetAlpha(0) end - end; + end + FriendsFrameStatusDropDown:SetPoint('TOPLEFT', FriendsTabHeader, 'TOPLEFT', 0, -27) STYLE:ApplyDropdownStyle(FriendsFrameStatusDropDown, 70) FriendsFrameBattlenetFrame:Formula409() @@ -192,40 +197,51 @@ local function FriendsFrameStyle() AddFriendFrame:SetFixedPanelTemplate("Transparent", true) ScrollOfResurrectionSelectionFrame:SetFixedPanelTemplate('Transparent') ScrollOfResurrectionSelectionFrameList:SetFixedPanelTemplate('Default') - STYLE:ApplyScrollStyle(ScrollOfResurrectionSelectionFrameListScrollFrameScrollBar, 4) + STYLE:ApplyScrollFrameStyle(ScrollOfResurrectionSelectionFrameListScrollFrameScrollBar, 4) ScrollOfResurrectionSelectionFrameTargetEditBox:SetEditboxTemplate() FriendsFrameBroadcastInput:SetPanelTemplate("Default") ChannelFrameDaughterFrameChannelName:SetPanelTemplate("Default") ChannelFrameDaughterFrameChannelPassword:SetPanelTemplate("Default") + ChannelFrame:HookScript("OnShow", function() ChannelRosterScrollFrame:Formula409() end) + hooksecurefunc("FriendsFrame_OnEvent", function() ChannelRosterScrollFrame:Formula409() end) + WhoFrame:HookScript("OnShow", function() ChannelRosterScrollFrame:Formula409() end) + hooksecurefunc("FriendsFrame_OnEvent", function() WhoListScrollFrame:Formula409() end) - STYLE:SetBasicBG(ChannelFrameDaughterFrame) + + ChannelFrameDaughterFrame:SetBasicPanel() STYLE:ApplyCloseButtonStyle(ChannelFrameDaughterFrameDetailCloseButton, ChannelFrameDaughterFrame) STYLE:ApplyCloseButtonStyle(FriendsFrameCloseButton, FriendsFrame.Panel) STYLE:ApplyDropdownStyle(WhoFrameDropDown, 150) + for i = 1, 4 do STYLE:ApplyTabStyle(_G["FriendsFrameTab"..i]) - end; + end + for i = 1, 3 do TabCustomHelper(_G["FriendsTabHeaderTab"..i]) - end; + end + hooksecurefunc("ChannelList_Update", ChannelList_OnUpdate) - STYLE:SetBasicBG(FriendsFriendsFrame) + FriendsFriendsFrame:SetBasicPanel() + _G["FriendsFriendsFrame"]:Formula409() _G["FriendsFriendsList"]:Formula409() _G["FriendsFriendsNoteFrame"]:Formula409() + _G["FriendsFriendsSendRequestButton"]:SetButtonTemplate() _G["FriendsFriendsCloseButton"]:SetButtonTemplate() + FriendsFriendsList:SetEditboxTemplate() FriendsFriendsNoteFrame:SetEditboxTemplate() STYLE:ApplyDropdownStyle(FriendsFriendsFrameDropDown, 150) @@ -237,7 +253,7 @@ local function FriendsFrameStyle() BNConversationInviteDialogCancelButton:SetButtonTemplate() for i = 1, BN_CONVERSATION_INVITE_NUM_DISPLAYED do _G["BNConversationInviteDialogListFriend"..i].checkButton:SetCheckboxTemplate(true) - end; + end FriendsTabHeaderSoRButton:SetFixedPanelTemplate('Default') FriendsTabHeaderSoRButton:SetButtonTemplate() FriendsTabHeaderSoRButtonIcon:SetDrawLayer('OVERLAY') @@ -249,24 +265,24 @@ local function FriendsFrameStyle() FriendsTabHeaderRecruitAFriendButtonIcon:SetDrawLayer('OVERLAY') FriendsTabHeaderRecruitAFriendButtonIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9) FriendsTabHeaderRecruitAFriendButtonIcon:FillInner() - FriendsTabHeaderRecruitAFriendButton:Point('TOPRIGHT', FriendsTabHeaderSoRButton, 'TOPLEFT', -4, 0) + FriendsFrameIgnoreScrollFrame:SetFixedPanelTemplate("Inset") - STYLE:ApplyScrollStyle(FriendsFrameIgnoreScrollFrameScrollBar, 4) + STYLE:ApplyScrollFrameStyle(FriendsFrameIgnoreScrollFrameScrollBar, 4) FriendsFramePendingScrollFrame:SetFixedPanelTemplate("Inset") - STYLE:ApplyScrollStyle(FriendsFramePendingScrollFrameScrollBar, 4) + STYLE:ApplyScrollFrameStyle(FriendsFramePendingScrollFrameScrollBar, 4) IgnoreListFrame:Formula409() PendingListFrame:Formula409() ScrollOfResurrectionFrame:Formula409() ScrollOfResurrectionFrameAcceptButton:SetButtonTemplate() ScrollOfResurrectionFrameCancelButton:SetButtonTemplate() - ScrollOfResurrectionFrameTargetEditBoxLeft:SetTexture(0,0,0,0) - ScrollOfResurrectionFrameTargetEditBoxMiddle:SetTexture(0,0,0,0) - ScrollOfResurrectionFrameTargetEditBoxRight:SetTexture(0,0,0,0) + ScrollOfResurrectionFrameTargetEditBoxLeft:SetTexture("") + ScrollOfResurrectionFrameTargetEditBoxMiddle:SetTexture("") + ScrollOfResurrectionFrameTargetEditBoxRight:SetTexture("") ScrollOfResurrectionFrameNoteFrame:Formula409() ScrollOfResurrectionFrameNoteFrame:SetFixedPanelTemplate() ScrollOfResurrectionFrameTargetEditBox:SetFixedPanelTemplate() ScrollOfResurrectionFrame:SetFixedPanelTemplate('Transparent') -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/gossip.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/gossip.lua index dda3630..01cc7d6 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/gossip.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/gossip.lua @@ -35,10 +35,10 @@ local function GossipStyle() end) ItemTextFrame:SetPanelTemplate("Pattern") ItemTextFrameInset:MUNG() - STYLE:ApplyScrollStyle(ItemTextScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(ItemTextScrollFrameScrollBar) STYLE:ApplyCloseButtonStyle(ItemTextFrameCloseButton) local r = {"GossipFrameGreetingPanel", "GossipFrame", "GossipFrameInset", "GossipGreetingScrollFrame"} - STYLE:ApplyScrollStyle(GossipGreetingScrollFrameScrollBar, 5) + STYLE:ApplyScrollFrameStyle(GossipGreetingScrollFrameScrollBar, 5) for s, t in pairs(r)do _G[t]:Formula409() end; diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua index 7a79463..91a85b0 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua @@ -167,7 +167,7 @@ local function GuildBankStyle() GuildBankFrame:SetPanelTemplate("Halftone") GuildBankEmblemFrame:Formula409(true) GuildBankMoneyFrameBackground:MUNG() - STYLE:ApplyScrollStyle(GuildBankPopupScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(GuildBankPopupScrollFrameScrollBar) for b = 1, GuildBankFrame:GetNumChildren() do local c = select(b, GuildBankFrame:GetChildren()) @@ -194,7 +194,7 @@ local function GuildBankStyle() local icon = _G["GuildBankColumn"..b.."Button"..d.."IconTexture"] local texture = _G["GuildBankColumn"..b.."Button"..d.."NormalTexture"] if texture then - texture:SetTexture(0,0,0,0) + texture:SetTexture("") end e:SetSlotTemplate() icon:FillInner() @@ -275,8 +275,8 @@ local function GuildBankStyle() end end - STYLE:ApplyScrollStyle(GuildBankTransactionsScrollFrameScrollBar) - STYLE:ApplyScrollStyle(GuildBankInfoScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(GuildBankTransactionsScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(GuildBankInfoScrollFrameScrollBar) end local function GuildFrameStyle() @@ -298,14 +298,15 @@ local function GuildFrameStyle() end end - STYLE:SetBasicBG(GuildNewsBossModel) + GuildNewsBossModel:SetBasicPanel() GuildNewsBossModelTextFrame:SetPanelTemplate("Default") - GuildNewsBossModelTextFrame.Panel:Point("TOPLEFT", GuildNewsBossModel.BasicBG, "BOTTOMLEFT", 0, -1) + GuildNewsBossModelTextFrame.Panel:Point("TOPLEFT", GuildNewsBossModel.Panel, "BOTTOMLEFT", 0, -1) GuildNewsBossModel:SetPoint("TOPLEFT", GuildFrame, "TOPRIGHT", 4, -43) for _, gName in pairs(GuildButtonList)do local btn = _G[gName] if(btn) then + btn:Formula409() btn:SetButtonTemplate() end end @@ -328,8 +329,8 @@ local function GuildFrameStyle() GuildXPFrame:ClearAllPoints() GuildXPFrame:Point("TOP", GuildFrame, "TOP", 0, -40) - STYLE:ApplyScrollStyle(GuildPerksContainerScrollBar, 4) - GuildNewPerksFrame:SetFixedPanelTemplate("Pattern") + STYLE:ApplyScrollFrameStyle(GuildPerksContainerScrollBar, 4) + GuildNewPerksFrame:SetFixedPanelTemplate("FramedTop") GuildFactionBar:Formula409() GuildFactionBar.progress:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) GuildFactionBar:SetPanelTemplate("Inset") @@ -353,8 +354,8 @@ local function GuildFrameStyle() GuildNextPerkButton:SetPanelTemplate("Inset") GuildNextPerkButton.Panel:WrapOuter(GuildNextPerkButtonIconTexture) - GuildRosterContainer:SetFixedPanelTemplate("Pattern") - STYLE:ApplyScrollStyle(GuildRosterContainerScrollBar, 5) + GuildRosterContainer:SetFixedPanelTemplate("FramedTop") + STYLE:ApplyScrollFrameStyle(GuildRosterContainerScrollBar, 5) GuildRosterShowOfflineButton:SetCheckboxTemplate(true) for i = 1, 4 do @@ -373,13 +374,14 @@ local function GuildFrameStyle() end GuildMemberDetailFrame:SetPanelTemplate("Default", true) - STYLE:SetBasicBG(GuildMemberNoteBackground) - STYLE:SetBasicBG(GuildMemberOfficerNoteBackground) + GuildMemberNoteBackground:SetBasicPanel() + GuildMemberOfficerNoteBackground:SetBasicPanel() GuildMemberRankDropdown:SetFrameLevel(GuildMemberRankDropdown:GetFrameLevel()+5) - STYLE:ApplyDropdownStyle(GuildMemberRankDropdown, 175) + STYLE:ApplyDropdownStyle(GuildMemberRankDropdown, 182) + GuildMemberRankDropdown.Panel:SetBackdropColor(0,0,0,1) GuildNewsFrame:Formula409() - GuildNewsContainer:SetFixedPanelTemplate("Pattern") + GuildNewsContainer:SetFixedPanelTemplate("FramedTop") for i = 1, 17 do local btn = _G["GuildNewsContainerButton"..i] @@ -400,8 +402,8 @@ local function GuildFrameStyle() end GuildNewsFiltersFrame:Point("TOPLEFT", GuildFrame, "TOPRIGHT", 4, -20) - STYLE:ApplyScrollStyle(GuildNewsContainerScrollBar, 4) - STYLE:ApplyScrollStyle(GuildInfoDetailsFrameScrollBar, 4) + STYLE:ApplyScrollFrameStyle(GuildNewsContainerScrollBar, 4) + STYLE:ApplyScrollFrameStyle(GuildInfoDetailsFrameScrollBar, 4) for i = 1, 3 do local tab = _G["GuildInfoFrameTab"..i] @@ -413,21 +415,21 @@ local function GuildFrameStyle() local panel1 = CreateFrame("Frame", nil, GuildInfoFrameInfo) panel1:SetPoint("TOPLEFT", GuildInfoFrameInfo, "TOPLEFT", 2, -22) panel1:SetPoint("BOTTOMRIGHT", GuildInfoFrameInfo, "BOTTOMRIGHT", 0, 200) - STYLE:SetBasicBG(panel1) + panel1:SetBasicPanel() local panel2 = CreateFrame("Frame", nil, GuildInfoFrameInfo) panel2:SetPoint("TOPLEFT", GuildInfoFrameInfo, "TOPLEFT", 2, -158) panel2:SetPoint("BOTTOMRIGHT", GuildInfoFrameInfo, "BOTTOMRIGHT", 0, 118) - STYLE:SetBasicBG(panel2) + panel2:SetBasicPanel() local panel3 = CreateFrame("Frame", nil, GuildInfoFrameInfo) panel3:SetPoint("TOPLEFT", GuildInfoFrameInfo, "TOPLEFT", 2, -233) panel3:SetPoint("BOTTOMRIGHT", GuildInfoFrameInfo, "BOTTOMRIGHT", 0, 3) - STYLE:SetBasicBG(panel3) + panel3:SetBasicPanel() GuildRecruitmentCommentInputFrame:SetFixedPanelTemplate("Default") GuildTextEditFrame:SetFixedPanelTemplate("Transparent", true) - STYLE:ApplyScrollStyle(GuildTextEditScrollFrameScrollBar, 5) + STYLE:ApplyScrollFrameStyle(GuildTextEditScrollFrameScrollBar, 5) GuildTextEditContainer:SetFixedPanelTemplate("Default") local editChildren = GuildTextEditFrame:GetNumChildren() @@ -442,8 +444,8 @@ local function GuildFrameStyle() end end - STYLE:ApplyScrollStyle(GuildLogScrollFrameScrollBar, 4) - GuildLogFrame:SetFixedPanelTemplate("Transparent", true) + STYLE:ApplyScrollFrameStyle(GuildLogScrollFrameScrollBar, 4) + GuildLogFrame:SetBasicPanel() local logChildren = GuildLogFrame:GetNumChildren() for b = 1, logChildren do @@ -457,8 +459,8 @@ local function GuildFrameStyle() end end - GuildRewardsFrame:SetFixedPanelTemplate("Pattern") - STYLE:ApplyScrollStyle(GuildRewardsContainerScrollBar, 5) + GuildRewardsFrame:SetBasicPanel(0,23,3,-3) + STYLE:ApplyScrollFrameStyle(GuildRewardsContainerScrollBar, 5) for b = 1, 8 do local button = _G["GuildPerksContainerButton"..b] @@ -511,7 +513,7 @@ local function GuildControlStyle() GuildControlUI:SetFixedPanelTemplate("Halftone") GuildControlUIRankBankFrameInset:Formula409() GuildControlUIRankBankFrameInsetScrollFrame:Formula409() - STYLE:ApplyScrollStyle(GuildControlUIRankBankFrameInsetScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(GuildControlUIRankBankFrameInsetScrollFrameScrollBar) hooksecurefunc("GuildControlUI_RankOrder_Update",RankOrder_OnUpdate) GuildControlUIRankOrderFrameNewButton:HookScript("OnClick",function() SuperVillain:ExecuteTimer(1,RankOrder_OnUpdate) @@ -603,7 +605,7 @@ local function LFGuildFrameStyle() LookingForGuildFrame:SetPanelTemplate("Action") LookingForGuildBrowseButton_LeftSeparator:MUNG() LookingForGuildRequestButton_RightSeparator:MUNG() - STYLE:ApplyScrollStyle(LookingForGuildBrowseFrameContainerScrollBar) + STYLE:ApplyScrollFrameStyle(LookingForGuildBrowseFrameContainerScrollBar) LookingForGuildBrowseButton:SetButtonTemplate() LookingForGuildRequestButton:SetButtonTemplate() STYLE:ApplyCloseButtonStyle(LookingForGuildFrameCloseButton) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/help.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/help.lua index 0fe3c18..dab4f0d 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/help.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/help.lua @@ -26,7 +26,8 @@ local HelpFrameList = { "HelpFrameKnowledgebase", "HelpFrameHeader", "HelpFrameKnowledgebaseErrorFrame" -}; +} + local HelpFrameButtonList = { "HelpFrameOpenTicketHelpItemRestoration", "HelpFrameAccountSecurityOpenTicket", @@ -38,16 +39,23 @@ local HelpFrameButtonList = { "GMChatOpenLog", "HelpFrameTicketSubmit", "HelpFrameTicketCancel" -}; +} + local function NavBarHelper(button) - for d = 1, #button.navList do - local i = button.navList[d] - local j = button.navList[d-1] - if i and j then - i:SetFrameLevel(j:GetFrameLevel()-2) + for i = 1, #button.navList do + local this = button.navList[i] + local last = button.navList[i - 1] + if this and last then + local level = last:GetFrameLevel() + if(level >= 2) then + level = level - 2 + else + level = 0 + end + this:SetFrameLevel(level) end end -end; +end --[[ ########################################################## HELPFRAME STYLER @@ -56,14 +64,14 @@ HELPFRAME STYLER local function HelpFrameStyle() if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.help ~= true then return - end; + end tinsert(HelpFrameButtonList, "HelpFrameButton16") tinsert(HelpFrameButtonList, "HelpFrameSubmitSuggestionSubmit") tinsert(HelpFrameButtonList, "HelpFrameReportBugSubmit") for d = 1, #HelpFrameList do _G[HelpFrameList[d]]:Formula409(true) _G[HelpFrameList[d]]:SetPanelTemplate("Default") - end; + end HelpFrameHeader:SetFrameLevel(HelpFrameHeader:GetFrameLevel()+2) HelpFrameKnowledgebaseErrorFrame:SetFrameLevel(HelpFrameKnowledgebaseErrorFrame:GetFrameLevel()+2) HelpFrameReportBugScrollFrame:Formula409() @@ -75,8 +83,8 @@ local function HelpFrameStyle() if not e:GetName() then e:Formula409() end - end; - STYLE:ApplyScrollStyle(HelpFrameReportBugScrollFrameScrollBar) + end + STYLE:ApplyScrollFrameStyle(HelpFrameReportBugScrollFrameScrollBar) HelpFrameSubmitSuggestionScrollFrame:Formula409() HelpFrameSubmitSuggestionScrollFrame:SetPanelTemplate("Default") HelpFrameSubmitSuggestionScrollFrame.Panel:Point("TOPLEFT", -4, 4) @@ -86,8 +94,8 @@ local function HelpFrameStyle() if not e:GetName() then e:Formula409() end - end; - STYLE:ApplyScrollStyle(HelpFrameSubmitSuggestionScrollFrameScrollBar) + end + STYLE:ApplyScrollFrameStyle(HelpFrameSubmitSuggestionScrollFrameScrollBar) HelpFrameTicketScrollFrame:Formula409() HelpFrameTicketScrollFrame:SetPanelTemplate("Default") HelpFrameTicketScrollFrame.Panel:Point("TOPLEFT", -4, 4) @@ -97,8 +105,8 @@ local function HelpFrameStyle() if not e:GetName() then e:Formula409() end - end; - STYLE:ApplyScrollStyle(HelpFrameKnowledgebaseScrollFrame2ScrollBar) + end + STYLE:ApplyScrollFrameStyle(HelpFrameKnowledgebaseScrollFrame2ScrollBar) for d = 1, #HelpFrameButtonList do _G[HelpFrameButtonList[d]]:Formula409(true) _G[HelpFrameButtonList[d]]:SetButtonTemplate() @@ -107,19 +115,19 @@ local function HelpFrameStyle() _G[HelpFrameButtonList[d]].text:SetPoint("CENTER") _G[HelpFrameButtonList[d]].text:SetJustifyH("CENTER") end - end; + end for d = 1, 6 do local f = _G["HelpFrameButton"..d] f:SetButtonTemplate() f.text:ClearAllPoints() f.text:SetPoint("CENTER") f.text:SetJustifyH("CENTER") - end; + end for d = 1, HelpFrameKnowledgebaseScrollFrameScrollChild:GetNumChildren()do local f = _G["HelpFrameKnowledgebaseScrollFrameButton"..d] f:Formula409(true) f:SetButtonTemplate() - end; + end HelpFrameKnowledgebaseSearchBox:ClearAllPoints() HelpFrameKnowledgebaseSearchBox:Point("TOPLEFT", HelpFrameMainInset, "TOPLEFT", 13, -10) HelpFrameKnowledgebaseNavBarOverlay:MUNG() @@ -127,8 +135,8 @@ local function HelpFrameStyle() HelpFrame:Formula409(true) HelpFrame:SetPanelTemplate("Halftone") HelpFrameKnowledgebaseSearchBox:SetEditboxTemplate() - STYLE:ApplyScrollStyle(HelpFrameKnowledgebaseScrollFrameScrollBar, 5) - STYLE:ApplyScrollStyle(HelpFrameTicketScrollFrameScrollBar, 4) + STYLE:ApplyScrollFrameStyle(HelpFrameKnowledgebaseScrollFrameScrollBar, 5) + STYLE:ApplyScrollFrameStyle(HelpFrameTicketScrollFrameScrollBar, 4) STYLE:ApplyCloseButtonStyle(HelpFrameCloseButton, HelpFrame.Panel) STYLE:ApplyCloseButtonStyle(HelpFrameKnowledgebaseErrorFrameCloseButton, HelpFrameKnowledgebaseErrorFrame.Panel) HelpFrameCharacterStuckHearthstone:SetButtonTemplate() @@ -143,7 +151,7 @@ local function HelpFrameStyle() i:HookScript("OnClick", function() NavBarHelper(h) end) - end; + end NavBarHelper(h) end) HelpFrameGM_ResponseNeedMoreHelp:SetButtonTemplate() @@ -156,7 +164,7 @@ local function HelpFrameStyle() e:SetFixedPanelTemplate("Default") end end -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/itemsocketing.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/itemsocketing.lua index 2436a1f..ff3268f 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/itemsocketing.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/itemsocketing.lua @@ -27,7 +27,7 @@ local function ItemSocketStyle() ItemSocketingFrameInset:MUNG() ItemSocketingScrollFrame:Formula409() ItemSocketingScrollFrame:SetPanelTemplate("Inset", true) - STYLE:ApplyScrollStyle(ItemSocketingScrollFrameScrollBar, 2) + STYLE:ApplyScrollFrameStyle(ItemSocketingScrollFrameScrollBar, 2) for j = 1, MAX_NUM_SOCKETS do local i = _G[("ItemSocketingSocket%d"):format(j)]; local C = _G[("ItemSocketingSocket%dBracketFrame"):format(j)]; diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/keybinding.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/keybinding.lua index 85fafa8..71eca1c 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/keybinding.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/keybinding.lua @@ -20,33 +20,45 @@ local STYLE = _G.StyleVillain; KEYBINDING STYLER ########################################################## ]]-- +local BindButtons = { + "KeyBindingFrameDefaultButton", + "KeyBindingFrameUnbindButton", + "KeyBindingFrameOkayButton", + "KeyBindingFrameCancelButton" +} + local function BindingStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.binding ~= true then return end; - local buttons = {"KeyBindingFrameDefaultButton", "KeyBindingFrameUnbindButton", "KeyBindingFrameOkayButton", "KeyBindingFrameCancelButton"} - for l, m in pairs(buttons)do - _G[m]:Formula409()_G[m]:SetFixedPanelTemplate("Default") - end; - STYLE:ApplyScrollStyle(KeyBindingFrameScrollFrameScrollBar) - KeyBindingFrameCharacterButton:SetCheckboxTemplate(true) - KeyBindingFrameHeaderText:ClearAllPoints() - KeyBindingFrameHeaderText:Point("TOP", KeyBindingFrame, "TOP", 0, -4) + if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.binding ~= true then return end + + for _, gName in pairs(BindButtons)do + local btn = _G[gName] + if(btn) then + btn:Formula409() + btn:SetButtonTemplate() + end + end + + for i = 1, KEY_BINDINGS_DISPLAYED do + local button1 = _G["KeyBindingFrameBinding"..i.."Key1Button"] + if(button1) then + button1:Formula409(true) + button1:SetEditboxTemplate() + end + + local button2 = _G["KeyBindingFrameBinding"..i.."Key2Button"] + if(button2) then + button2:Formula409(true) + button2:SetEditboxTemplate() + end + end + + STYLE:ApplyScrollFrameStyle(KeyBindingFrameScrollFrameScrollBar) KeyBindingFrame:Formula409() KeyBindingFrame:SetPanelTemplate("Halftone") - for b = 1, KEY_BINDINGS_DISPLAYED do - local n = _G["KeyBindingFrameBinding"..b.."Key1Button"] - local o = _G["KeyBindingFrameBinding"..b.."Key2Button"] - n:Formula409(true) - n:SetButtonTemplate() - n:SetFixedPanelTemplate("Default") - o:Formula409(true) - o:SetButtonTemplate() - o:SetFixedPanelTemplate("Default") - end; - KeyBindingFrameUnbindButton:Point("RIGHT", KeyBindingFrameOkayButton, "LEFT", -3, 0)KeyBindingFrameOkayButton:Point("RIGHT", KeyBindingFrameCancelButton, "LEFT", -3, 0) -end; +end --[[ ########################################################## STYLE LOADING ########################################################## ]]-- -STYLE:SaveBlizzardStyle("Blizzard_BindingUI",BindingStyle) \ No newline at end of file +STYLE:SaveBlizzardStyle("Blizzard_BindingUI", BindingStyle) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/lfd.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/lfd.lua index 37f4541..011f6db 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/lfd.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/lfd.lua @@ -36,11 +36,11 @@ local LFDFrameList = { local Incentive_OnShow = function(button) ActionButton_ShowOverlayGlow(button:GetParent().checkButton) -end; +end local Incentive_OnHide = function(button) ActionButton_HideOverlayGlow(button:GetParent().checkButton) -end; +end local LFDQueueRandom_OnUpdate = function() LFDQueueFrame:Formula409() @@ -73,7 +73,7 @@ local LFDQueueRandom_OnUpdate = function() end end end -end; +end local ScenarioQueueRandom_OnUpdate = function() LFDQueueFrame:Formula409() @@ -99,14 +99,15 @@ local ScenarioQueueRandom_OnUpdate = function() end end end -end; +end --[[ ########################################################## LFD STYLER ########################################################## ]]-- local function LFDFrameStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.lfg ~= true then return end; + if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.lfg ~= true then return end + PVEFrame:Formula409() PVEFrame:SetPanelTemplate("Action") PVEFrameLeftInset:Formula409() @@ -119,25 +120,31 @@ local function LFDFrameStyle() PVEFrameTopBorder:Hide() PVEFrameLeftInsetBg:Hide() PVEFrame.shadows:Hide() + LFDQueueFramePartyBackfillBackfillButton:SetButtonTemplate() LFDQueueFramePartyBackfillNoBackfillButton:SetButtonTemplate() LFDQueueFrameRandomScrollFrameChildFrameBonusRepFrame.ChooseButton:SetButtonTemplate() ScenarioQueueFrameRandomScrollFrameChildFrameBonusRepFrame.ChooseButton:SetButtonTemplate() - STYLE:ApplyScrollStyle(ScenarioQueueFrameRandomScrollFrameScrollBar) + + STYLE:ApplyScrollFrameStyle(ScenarioQueueFrameRandomScrollFrameScrollBar) + GroupFinderFrameGroupButton1.icon:SetTexture("Interface\\Icons\\INV_Helmet_08") GroupFinderFrameGroupButton2.icon:SetTexture("Interface\\Icons\\inv_helmet_06") GroupFinderFrameGroupButton3.icon:SetTexture("Interface\\Icons\\Icon_Scenarios") GroupFinderFrameGroupButton4.icon:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\SVUI-EMBLEM") + LFGDungeonReadyDialogBackground:MUNG() LFGDungeonReadyDialogEnterDungeonButton:SetButtonTemplate() LFGDungeonReadyDialogLeaveQueueButton:SetButtonTemplate() STYLE:ApplyCloseButtonStyle(LFGDungeonReadyDialogCloseButton) + LFGDungeonReadyDialog:Formula409() LFGDungeonReadyDialog:SetPanelTemplate("Pattern", true, 2, 4, 4) LFGDungeonReadyStatus:Formula409() LFGDungeonReadyStatus:SetPanelTemplate("Pattern", true, 2, 4, 4) LFGDungeonReadyDialogRoleIconTexture:SetTexture("Interface\\LFGFrame\\UI-LFG-ICONS-ROLEBACKGROUNDS") LFGDungeonReadyDialogRoleIconTexture:SetAlpha(0.5) + hooksecurefunc("LFGDungeonReadyPopup_Update", function() local b, c, d, e, f, g, h, i, j, k, l, m = GetLFGProposal() if LFGDungeonReadyDialogRoleIcon:IsShown() then @@ -150,6 +157,7 @@ local function LFDFrameStyle() end end end) + LFDQueueFrameRoleButtonTankIncentiveIcon:SetAlpha(0) LFDQueueFrameRoleButtonHealerIncentiveIcon:SetAlpha(0) LFDQueueFrameRoleButtonDPSIncentiveIcon:SetAlpha(0) @@ -165,6 +173,7 @@ local function LFDFrameStyle() LFGDungeonReadyDialog.filigree:SetAlpha(0) LFGDungeonReadyDialog.bottomArt:SetAlpha(0) STYLE:ApplyCloseButtonStyle(LFGDungeonReadyStatusCloseButton) + for _,name in pairs(LFDFrameList) do local frame = _G[name]; if frame then @@ -174,7 +183,8 @@ local function LFDFrameStyle() frame:DisableDrawLayer("BACKGROUND") frame:DisableDrawLayer("OVERLAY") end - end; + end + LFDQueueFrameRoleButtonLeader.leadIcon = LFDQueueFrameRoleButtonLeader:CreateTexture(nil, 'BACKGROUND') LFDQueueFrameRoleButtonLeader.leadIcon:SetTexture([[Interface\GroupFrame\UI-Group-LeaderIcon]]) LFDQueueFrameRoleButtonLeader.leadIcon:SetPoint(LFDQueueFrameRoleButtonLeader:GetNormalTexture():GetPoint()) @@ -185,46 +195,54 @@ local function LFDFrameStyle() RaidFinderQueueFrameRoleButtonLeader.leadIcon:SetPoint(RaidFinderQueueFrameRoleButtonLeader:GetNormalTexture():GetPoint()) RaidFinderQueueFrameRoleButtonLeader.leadIcon:Size(50) RaidFinderQueueFrameRoleButtonLeader.leadIcon:SetAlpha(0.4) + hooksecurefunc('LFG_DisableRoleButton', function(self) if self.checkButton:GetChecked() then self.checkButton:SetAlpha(1) else self.checkButton:SetAlpha(0) - end; + end if self.background then self.background:Show() end end) + hooksecurefunc('LFG_EnableRoleButton', function(self) self.checkButton:SetAlpha(1) end) + hooksecurefunc("LFG_PermanentlyDisableRoleButton", function(self) if self.background then self.background:Show() self.background:SetDesaturated(true) end end) - for u = 1, 4 do - local v = GroupFinderFrame["groupButton"..u] - v.ring:Hide() - v.bg:SetTexture(0,0,0,0) - v.bg:SetAllPoints() - v:SetFixedPanelTemplate('Button') - v:SetButtonTemplate() - v.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - v.icon:SetPoint("LEFT", v, "LEFT") - v.icon:SetDrawLayer("OVERLAY") - v.icon:Size(40) - v.icon:ClearAllPoints() - v.icon:SetPoint("LEFT", 10, 0) - v.border = CreateFrame("Frame", nil, v) - v.border:SetFixedPanelTemplate('Default') - v.border:WrapOuter(v.icon) - v.icon:SetParent(v.border) - end; + + for i = 1, 4 do + local button = GroupFinderFrame["groupButton"..i] + if(button) then + button.ring:Hide() + button.bg:SetTexture("") + button.bg:SetAllPoints() + button:SetFixedPanelTemplate('Button') + button:SetButtonTemplate() + button.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) + button.icon:SetPoint("LEFT", button, "LEFT") + button.icon:SetDrawLayer("OVERLAY") + button.icon:Size(40) + button.icon:ClearAllPoints() + button.icon:SetPoint("LEFT", 10, 0) + button.border = CreateFrame("Frame", nil, button) + button.border:SetFixedPanelTemplate('Default') + button.border:WrapOuter(button.icon) + button.icon:SetParent(button.border) + end + end + for u = 1, 2 do STYLE:ApplyTabStyle(_G['PVEFrameTab'..u]) - end; + end + PVEFrameTab1:SetPoint('BOTTOMLEFT', PVEFrame, 'BOTTOMLEFT', 19, -31) STYLE:ApplyCloseButtonStyle(PVEFrameCloseButton) LFDParentFrame:Formula409() @@ -233,9 +251,10 @@ local function LFDFrameStyle() LFDQueueFrameSpecificListScrollFrame:Formula409() LFDQueueFrameFindGroupButton:SetButtonTemplate() hooksecurefunc("LFDQueueFrameRandom_UpdateFrame", LFDQueueRandom_OnUpdate) + hooksecurefunc("ScenarioQueueFrameSpecific_Update", function() - for u = 1, NUM_SCENARIO_CHOICE_BUTTONS do - local box = _G["ScenarioQueueFrameSpecificButton"..u.."EnableButton"] + for i = 1, NUM_SCENARIO_CHOICE_BUTTONS do + local box = _G["ScenarioQueueFrameSpecificButton"..i.."EnableButton"] if(box and (not box.Panel)) then box:Formula409() box:SetCheckboxTemplate(true, -2, -3) @@ -244,13 +263,7 @@ local function LFDFrameStyle() end) STYLE:ApplyDropdownStyle(LFDQueueFrameTypeDropDown) - FlexRaidFrameScrollFrame:Formula409() - FlexRaidFrameBottomInset:Formula409() - hooksecurefunc("FlexRaidFrame_Update", function() - FlexRaidFrame.ScrollFrame.Background:SetTexture(0,0,0,0) - end) - STYLE:ApplyDropdownStyle(FlexRaidFrameSelectionDropDown) - FlexRaidFrameStartRaidButton:SetButtonTemplate() + RaidFinderFrame:Formula409() RaidFinderFrameBottomInset:Formula409() RaidFinderFrameRoleInset:Formula409() @@ -263,6 +276,7 @@ local function LFDFrameStyle() RaidFinderFrameFindRaidButton:Formula409() RaidFinderFrameFindRaidButton:SetButtonTemplate() RaidFinderQueueFrame:Formula409() + for u = 1, LFD_MAX_REWARDS do local t = _G["RaidFinderQueueFrameScrollFrameChildFrameItem"..u] local icon = _G["RaidFinderQueueFrameScrollFrameChildFrameItem"..u.."IconTexture"] @@ -286,7 +300,8 @@ local function LFDFrameStyle() t.restyled = true end end - end; + end + ScenarioFinderFrameInset:DisableDrawLayer("BORDER") ScenarioFinderFrame.TopTileStreaks:Hide() ScenarioFinderFrameBtnCornerRight:Hide() @@ -302,20 +317,23 @@ local function LFDFrameStyle() LFRQueueFrameSpecificListScrollFrameScrollBackgroundTopLeft:Hide() LFRQueueFrameSpecificListScrollFrameScrollBackgroundBottomRight:Hide() LFRBrowseFrameRoleInsetBg:Hide() + for u = 1, 14 do if u ~= 6 and u ~= 8 then select(u, RaidBrowserFrame:GetRegions()):Hide() end - end; + end + RaidBrowserFrame:SetPanelTemplate('Pattern') STYLE:ApplyCloseButtonStyle(RaidBrowserFrameCloseButton) LFRQueueFrameFindGroupButton:SetButtonTemplate() LFRQueueFrameAcceptCommentButton:SetButtonTemplate() - STYLE:ApplyScrollStyle(LFRQueueFrameCommentScrollFrameScrollBar) - STYLE:ApplyScrollStyle(LFDQueueFrameSpecificListScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(LFRQueueFrameCommentScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(LFDQueueFrameSpecificListScrollFrameScrollBar) + RaidBrowserFrame:HookScript('OnShow', function() if not LFRQueueFrameSpecificListScrollFrameScrollBar.styled then - STYLE:ApplyScrollStyle(LFRQueueFrameSpecificListScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(LFRQueueFrameSpecificListScrollFrameScrollBar) LFRBrowseFrame:Formula409() for u = 1, 2 do local C = _G['LFRParentFrameSideTab'..u] @@ -328,19 +346,19 @@ local function LFDFrameStyle() C:SetPanelTemplate() hooksecurefunc(C:GetHighlightTexture(), "SetTexture", function(o, D) if D ~= nil then - o:SetTexture(0,0,0,0) + o:SetTexture("") end end) hooksecurefunc(C:GetCheckedTexture(), "SetTexture", function(o, D) if D ~= nil then - o:SetTexture(0,0,0,0) + o:SetTexture("") end end) - end; + end for u = 1, 7 do local C = _G['LFRBrowseFrameColumnHeader'..u] C:DisableDrawLayer('BACKGROUND') - end; + end STYLE:ApplyDropdownStyle(LFRBrowseFrameRaidDropDown) LFRBrowseFrameRefreshButton:SetButtonTemplate() LFRBrowseFrameInviteButton:SetButtonTemplate() @@ -348,10 +366,12 @@ local function LFDFrameStyle() LFRQueueFrameSpecificListScrollFrameScrollBar.styled = true end end) + LFGInvitePopup:Formula409() LFGInvitePopup:SetPanelTemplate("Pattern", true, 2, 4, 4) LFGInvitePopupAcceptButton:SetButtonTemplate() LFGInvitePopupDeclineButton:SetButtonTemplate() + _G[LFDQueueFrame.PartyBackfill:GetName().."BackfillButton"]:SetButtonTemplate() _G[LFDQueueFrame.PartyBackfill:GetName().."NoBackfillButton"]:SetButtonTemplate() _G[RaidFinderQueueFrame.PartyBackfill:GetName().."BackfillButton"]:SetButtonTemplate() @@ -359,12 +379,12 @@ local function LFDFrameStyle() _G[ScenarioQueueFrame.PartyBackfill:GetName().."BackfillButton"]:SetButtonTemplate() _G[ScenarioQueueFrame.PartyBackfill:GetName().."NoBackfillButton"]:SetButtonTemplate() - STYLE:ApplyScrollStyle(LFDQueueFrameRandomScrollFrameScrollBar) - STYLE:ApplyScrollStyle(ScenarioQueueFrameSpecificScrollFrameScrollBar) - LFDQueueFrameRandomScrollFrame:SetFixedPanelTemplate("Inset") - ScenarioQueueFrameRandomScrollFrame:SetFixedPanelTemplate("Inset") - RaidFinderQueueFrameScrollFrame:SetFixedPanelTemplate("Inset") - FlexRaidFrameScrollFrame:SetFixedPanelTemplate("Inset") + STYLE:ApplyScrollFrameStyle(LFDQueueFrameRandomScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(ScenarioQueueFrameSpecificScrollFrameScrollBar) + LFDQueueFrameRandomScrollFrame:SetBasicPanel() + ScenarioQueueFrameRandomScrollFrame:SetBasicPanel() + RaidFinderQueueFrameScrollFrame:SetBasicPanel() + for u = 1, NUM_LFD_CHOICE_BUTTONS do local box = _G["LFDQueueFrameSpecificListButton"..u.."EnableButton"] if(box and (not box.Panel)) then @@ -373,6 +393,7 @@ local function LFDFrameStyle() box:SetFrameLevel(box:GetFrameLevel() + 50) end end + for u = 1, NUM_LFR_CHOICE_BUTTONS do local box = _G["LFRQueueFrameSpecificListButton"..u.."EnableButton"] if(box and (not box.Panel)) then diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/loothistory.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/loothistory.lua index 0f729c0..8664c68 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/loothistory.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/loothistory.lua @@ -25,7 +25,7 @@ local MissingLootFrame_OnShow = function() for u = 1, N do local O = _G["MissingLootFrameItem"..u] local icon = O.icon; - STYLE:ApplyLinkButtonStyle(O, true) + STYLE:ApplyItemButtonStyle(O, true) local g, f, y, P = GetMissingLootItemInfo(u) local color = GetItemQualityColor(P) or 0,0,0,1 icon:SetTexture(g) @@ -83,7 +83,7 @@ local function LootHistoryStyle() txt:SetText("RESIZE") LootHistoryFrameScrollFrame:Formula409() - STYLE:ApplyScrollStyle(LootHistoryFrameScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(LootHistoryFrameScrollFrameScrollBar) hooksecurefunc("LootHistoryFrame_FullUpdate", LootHistoryFrame_OnUpdate) MasterLooterFrame:Formula409() MasterLooterFrame:SetFixedPanelTemplate() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/macro.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/macro.lua index 2ff47f6..5ef3578 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/macro.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/macro.lua @@ -34,9 +34,9 @@ MACRO UI STYLER local function MacroUIStyle() if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.macro ~= true then return end; STYLE:ApplyCloseButtonStyle(MacroFrameCloseButton) - STYLE:ApplyScrollStyle(MacroButtonScrollFrameScrollBar) - STYLE:ApplyScrollStyle(MacroFrameScrollFrameScrollBar) - STYLE:ApplyScrollStyle(MacroPopupScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(MacroButtonScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(MacroFrameScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(MacroPopupScrollFrameScrollBar) MacroFrame:Width(360) for b = 1, #MacroButtonList do _G[MacroButtonList[b]]:Formula409() @@ -57,22 +57,22 @@ local function MacroUIStyle() MacroFrame.Panel:SetPoint("BOTTOMRIGHT",MacroFrame,"BOTTOMRIGHT",0,-25) MacroFrameText:SetFont(SuperVillain.Media.font.roboto, 10, "OUTLINE") MacroFrameTextBackground:Formula409() - STYLE:SetBasicBG(MacroFrameTextBackground) + MacroFrameTextBackground:SetBasicPanel() MacroPopupFrame:Formula409() - STYLE:SetBasicBG(MacroPopupFrame) + MacroPopupFrame:SetBasicPanel() MacroPopupScrollFrame:Formula409() MacroPopupScrollFrame:SetPanelTemplate("Pattern") MacroPopupScrollFrame.Panel:Point("TOPLEFT", 51, 2) MacroPopupScrollFrame.Panel:Point("BOTTOMRIGHT", -4, 4) - STYLE:SetBasicBG(MacroButtonScrollFrame) + MacroButtonScrollFrame:SetBasicPanel() MacroPopupEditBox:SetEditboxTemplate() - MacroPopupNameLeft:SetTexture(0,0,0,0) - MacroPopupNameMiddle:SetTexture(0,0,0,0) - MacroPopupNameRight:SetTexture(0,0,0,0) + MacroPopupNameLeft:SetTexture("") + MacroPopupNameMiddle:SetTexture("") + MacroPopupNameRight:SetTexture("") MacroFrameInset:MUNG() MacroEditButton:ClearAllPoints() MacroEditButton:Point("BOTTOMLEFT", MacroFrameSelectedMacroButton, "BOTTOMRIGHT", 10, 0) - STYLE:ApplyScrollStyle(MacroButtonScrollFrame) + STYLE:ApplyScrollFrameStyle(MacroButtonScrollFrame) MacroPopupFrame:HookScript("OnShow", function(c) c:ClearAllPoints() c:Point("TOPLEFT", MacroFrame, "TOPRIGHT", 5, -2) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/mailbox.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/mailbox.lua index d6f8527..23a6456 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/mailbox.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/mailbox.lua @@ -66,7 +66,7 @@ local function MailBoxStyle() STYLE:ApplyTabStyle(MailFrameTab2) SendMailScrollFrame:Formula409(true) SendMailScrollFrame:SetFixedPanelTemplate("Inset") - STYLE:ApplyScrollStyle(SendMailScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(SendMailScrollFrameScrollBar) SendMailNameEditBox:SetEditboxTemplate() SendMailSubjectEditBox:SetEditboxTemplate() SendMailMoneyGold:SetEditboxTemplate() @@ -104,7 +104,7 @@ local function MailBoxStyle() MailFrameInset:MUNG() OpenMailScrollFrame:Formula409(true) OpenMailScrollFrame:SetFixedPanelTemplate("Default") - STYLE:ApplyScrollStyle(OpenMailScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(OpenMailScrollFrameScrollBar) SendMailBodyEditBox:SetTextColor(1, 1, 1) OpenMailBodyText:SetTextColor(1, 1, 1) InvoiceTextFontNormal:SetTextColor(1, 1, 1) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/petbattle.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/petbattle.lua index e990a11..d4a3a33 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/petbattle.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/petbattle.lua @@ -215,7 +215,7 @@ local function PetBattleStyle() end PetBattleQueueReadyFrame:Formula409() - STYLE:SetBasicBG(PetBattleQueueReadyFrame) + PetBattleQueueReadyFrame:SetBasicPanel() PetBattleQueueReadyFrame.AcceptButton:SetButtonTemplate() PetBattleQueueReadyFrame.DeclineButton:SetButtonTemplate() PetBattleQueueReadyFrame.Art:SetTexture([[Interface\PetBattles\PetBattlesQueue]]) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/petjournal.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/petjournal.lua index 7442216..17af6e7 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/petjournal.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/petjournal.lua @@ -29,7 +29,7 @@ local function Button_OnLeave(this) end local function StyleListButton(this, adjust, shrink) - if(not this or (this and this.appliedStyle)) then return end + if(not this or (this and this.StyleHooked)) then return end local link = this:GetName() local barName = this.MountBar @@ -73,7 +73,7 @@ local function StyleListButton(this, adjust, shrink) this:HookScript("OnEnter", Button_OnEnter) this:HookScript("OnLeave", Button_OnLeave) - this.appliedStyle = true + this.StyleHooked = true end local function PetJournal_UpdateMounts() @@ -159,7 +159,7 @@ local function PetJournalStyle() MountJournalListScrollFrame:Formula409() MountJournalMountButton:SetButtonTemplate() MountJournalSearchBox:SetEditboxTemplate() - STYLE:ApplyScrollStyle(MountJournalListScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(MountJournalListScrollFrameScrollBar) MountJournal.MountDisplay:SetFixedPanelTemplate("Comic") for i = 1, #MountJournal.ListScrollFrame.buttons do local button = _G["MountJournalListScrollFrameButton"..i] @@ -189,12 +189,12 @@ local function PetJournalStyle() PetJournalFilterButton:Formula409(true) PetJournalFilterButton:SetButtonTemplate() PetJournalListScrollFrame:Formula409() - STYLE:ApplyScrollStyle(PetJournalListScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(PetJournalListScrollFrameScrollBar) for i = 1, #PetJournal.listScroll.buttons do local button = _G["PetJournalListScrollFrameButton" .. i] local favorite = _G["PetJournalListScrollFrameButton" .. i .. "Favorite"] - STYLE:ApplyLinkButtonStyle(button, false, true) + STYLE:ApplyItemButtonStyle(button, false, true) if(favorite) then local fg = CreateFrame("Frame", nil, button) fg:SetSize(40,40) @@ -213,7 +213,7 @@ local function PetJournalStyle() PetJournalListScrollFrame:HookScript("OnVerticalScroll", PetJournal_UpdatePets) PetJournalListScrollFrame:HookScript("OnMouseWheel", PetJournal_UpdatePets) PetJournalAchievementStatus:DisableDrawLayer('BACKGROUND') - STYLE:ApplyLinkButtonStyle(PetJournalHealPetButton, true) + STYLE:ApplyItemButtonStyle(PetJournalHealPetButton, true) PetJournalHealPetButton.texture:SetTexture([[Interface\Icons\spell_magic_polymorphrabbit]]) PetJournalLoadoutBorder:Formula409() @@ -232,7 +232,7 @@ local function PetJournalStyle() pjPet.hover = true; pjPet.pushed = true; pjPet.checked = true; - STYLE:ApplyLinkButtonStyle(pjPet) + STYLE:ApplyItemButtonStyle(pjPet) pjPet.setButton:Formula409() _G['PetJournalLoadoutPet'..b..'HealthFrame'].healthBar:Formula409() _G['PetJournalLoadoutPet'..b..'HealthFrame'].healthBar:SetPanelTemplate('Default') @@ -243,7 +243,7 @@ local function PetJournalStyle() _G['PetJournalLoadoutPet'..b..'XPBar']:SetFrameLevel(_G['PetJournalLoadoutPet'..b..'XPBar']:GetFrameLevel()+2) for v = 1, 3 do local s = _G['PetJournalLoadoutPet'..b..'Spell'..v] - STYLE:ApplyLinkButtonStyle(s) + STYLE:ApplyItemButtonStyle(s) s.FlyoutArrow:SetTexture([[Interface\Buttons\ActionBarFlyoutButton]]) _G['PetJournalLoadoutPet'..b..'Spell'..v..'Icon']:FillInner(s) s.Panel:SetFrameLevel(s:GetFrameLevel() + 1) @@ -255,7 +255,7 @@ local function PetJournalStyle() for b = 1, 2 do local Q = _G['PetJournalSpellSelectSpell'..b] - STYLE:ApplyLinkButtonStyle(Q) + STYLE:ApplyItemButtonStyle(Q) _G['PetJournalSpellSelectSpell'..b..'Icon']:FillInner(Q) _G['PetJournalSpellSelectSpell'..b..'Icon']:SetDrawLayer('BORDER') end @@ -280,19 +280,19 @@ local function PetJournalStyle() PetJournalPetCardPetInfo.Panel:WrapOuter(PetJournalPetCardPetInfoIcon) PetJournalPetCardPetInfoIcon:SetParent(PetJournalPetCardPetInfo.Panel) PetJournalPetCardPetInfo.level:SetParent(PetJournalPetCardPetInfo.Panel) - local R = PetJournalPrimaryAbilityTooltip;R.Background:SetTexture(0,0,0,0) + local R = PetJournalPrimaryAbilityTooltip;R.Background:SetTexture("") if R.Delimiter1 then - R.Delimiter1:SetTexture(0,0,0,0) - R.Delimiter2:SetTexture(0,0,0,0) + R.Delimiter1:SetTexture("") + R.Delimiter2:SetTexture("") end - R.BorderTop:SetTexture(0,0,0,0) - R.BorderTopLeft:SetTexture(0,0,0,0) - R.BorderTopRight:SetTexture(0,0,0,0) - R.BorderLeft:SetTexture(0,0,0,0) - R.BorderRight:SetTexture(0,0,0,0) - R.BorderBottom:SetTexture(0,0,0,0) - R.BorderBottomRight:SetTexture(0,0,0,0) - R.BorderBottomLeft:SetTexture(0,0,0,0) + R.BorderTop:SetTexture("") + R.BorderTopLeft:SetTexture("") + R.BorderTopRight:SetTexture("") + R.BorderLeft:SetTexture("") + R.BorderRight:SetTexture("") + R.BorderBottom:SetTexture("") + R.BorderBottomRight:SetTexture("") + R.BorderBottomLeft:SetTexture("") R:SetFixedPanelTemplate("Transparent", true) for b = 1, 6 do local S = _G['PetJournalPetCardSpell'..b] diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/petstable.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/petstable.lua index 8fe11da..d4a632e 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/petstable.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/petstable.lua @@ -34,10 +34,10 @@ local function PetStableStyle() STYLE:ApplyPaginationStyle(PetStablePrevPageButton) STYLE:ApplyPaginationStyle(PetStableNextPageButton) for j = 1, NUM_PET_ACTIVE_SLOTS do - STYLE:ApplyLinkButtonStyle(_G['PetStableActivePet'..j], true) + STYLE:ApplyItemButtonStyle(_G['PetStableActivePet'..j], true) end; for j = 1, NUM_PET_STABLE_SLOTS do - STYLE:ApplyLinkButtonStyle(_G['PetStableStabledPet'..j], true) + STYLE:ApplyItemButtonStyle(_G['PetStableStabledPet'..j], true) end; PetStableSelectedPetIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9) end; diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/pvp.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/pvp.lua index ed9ec47..6844de3 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/pvp.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/pvp.lua @@ -52,7 +52,7 @@ local function PVPFrameStyle() STYLE:ApplyDropdownStyle(HonorFrameTypeDropDown) HonorFrame.Inset:Formula409() HonorFrame.Inset:SetFixedPanelTemplate("Inset") - STYLE:ApplyScrollStyle(HonorFrameSpecificFrameScrollBar) + STYLE:ApplyScrollFrameStyle(HonorFrameSpecificFrameScrollBar) HonorFrameSoloQueueButton:Formula409() HonorFrameGroupQueueButton:Formula409() HonorFrameSoloQueueButton:SetButtonTemplate() @@ -118,8 +118,8 @@ local function PVPFrameStyle() WarGamesFrameInfoScrollFrameScrollBar:Formula409() WarGameStartButton:Formula409() WarGameStartButton:SetButtonTemplate() - STYLE:ApplyScrollStyle(WarGamesFrameScrollFrameScrollBar) - STYLE:ApplyScrollStyle(WarGamesFrameInfoScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(WarGamesFrameScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(WarGamesFrameInfoScrollFrameScrollBar) WarGamesFrame.HorizontalBar:Formula409() PVPUIFrame.LeftInset:Formula409() PVPReadyDialog:Formula409() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua index c4e3c37..28ffe30 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua @@ -38,10 +38,10 @@ local function QuestScrollHelper(b, c, d, e) b.spellTex:SetPoint("TOPLEFT", 2, -2) else b.spellTex:SetPoint("TOPLEFT") - end; + end b.spellTex:Size(c or 506, d or 615) b.spellTex:SetTexCoord(0, 1, 0.02, 1) -end; +end local function QueuedWatchFrameItems() for i=1, WATCHFRAME_NUM_ITEMS do @@ -59,7 +59,59 @@ local function QueuedWatchFrameItems() button.styled = true end end -end; +end + +-- local QuestLogScrollFrame_OnShow = function() +-- if not QuestLogScrollFrame.spellTex then +-- QuestLogScrollFrame:SetFixedPanelTemplate("Default") +-- QuestLogScrollFrame.spellTex = QuestLogScrollFrame:CreateTexture(nil, 'ARTWORK') +-- QuestLogScrollFrame.spellTex:SetTexture([[Interface\QuestFrame\QuestBookBG]]) +-- QuestLogScrollFrame.spellTex:SetPoint("TOPLEFT", 2, -2) +-- QuestLogScrollFrame.spellTex:Size(514, 616) +-- QuestLogScrollFrame.spellTex:SetTexCoord(0, 1, 0.02, 1) +-- QuestLogScrollFrame.spellTex2 = QuestLogScrollFrame:CreateTexture(nil, 'BORDER') +-- QuestLogScrollFrame.spellTex2:SetTexture([[Interface\FrameGeneral\UI-Background-Rock]]) +-- QuestLogScrollFrame.spellTex2:FillInner() +-- end +-- end + +local QuestRewardScrollFrame_OnShow = function(self) + if(not self.Panel) then + self:SetPanelTemplate("Default") + QuestScrollHelper(self, 509, 630, false) + self:Height(self:GetHeight() - 2) + end + if(self.spellTex) then + self.spellTex:Height(self:GetHeight() + 217) + end +end + +local Hook_QuestInfo_Display = function(self, ...) + for i = 1, MAX_NUM_ITEMS do + local name = ("QuestInfoItem%d"):format(i) + local item = _G[name] + if(item and item:IsShown()) then + local initialAnchor, anchorParent, relativeAnchor, xPosition, yPosition = item:GetPoint() + if(i == 1) then + item:Point(initialAnchor, anchorParent, relativeAnchor, 0, yPosition) + elseif(relativeAnchor == "BOTTOMLEFT") then + item:Point(initialAnchor, anchorParent, relativeAnchor, 0, -4) + else + item:Point(initialAnchor, anchorParent, relativeAnchor, 4, 0) + end + end + end +end + +local Hook_QuestInfoItem_OnClick = function(self) + QuestInfoItemHighlight:ClearAllPoints() + QuestInfoItemHighlight:SetAllPoints(self) +end + +local Hook_QuestNPCModel = function(self, _, _, _, x, y) + QuestNPCModel:ClearAllPoints() + QuestNPCModel:SetPoint("TOPLEFT", self, "TOPRIGHT", x + 18, y) +end --[[ ########################################################## QUEST STYLERS @@ -68,68 +120,28 @@ QUEST STYLERS local function QuestGreetingStyle() if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.greeting ~= true then return - end; + end QuestFrameGreetingPanel:HookScript("OnShow", function() QuestFrameGreetingPanel:Formula409() QuestFrameGreetingGoodbyeButton:SetButtonTemplate() QuestGreetingFrameHorizontalBreak:MUNG() end) -end; +end local function QuestFrameStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.quest ~= true then return end; - - --[[ WIPE TEXTURES ]]-- - QuestInfoSkillPointFrame:Formula409() - QuestLogFrame:Formula409() - QuestLogScrollFrame:Formula409() - QuestLogCount:Formula409() - EmptyQuestLogFrame:Formula409() - QuestProgressScrollFrame:Formula409() - QuestLogFrameShowMapButton:Formula409() - QuestGreetingScrollFrame:Formula409() - QuestLogFrameCompleteButton:Formula409() - QuestFrame:Formula409(true) - QuestFrameDetailPanel:Formula409(true) - QuestDetailScrollFrame:Formula409(true) - QuestInfoItemHighlight:Formula409() - QuestDetailScrollChildFrame:Formula409(true) - QuestRewardScrollFrame:Formula409(true) - QuestRewardScrollChildFrame:Formula409(true) - QuestFrameProgressPanel:Formula409(true) - QuestFrameRewardPanel:Formula409(true) - QuestNPCModel:Formula409() - QuestNPCModelTextFrame:Formula409() - QuestLogDetailFrame:Formula409() - QuestLogDetailScrollFrame:Formula409() - - QuestFrameInset:MUNG() - QuestLogFrameInset:MUNG() - QuestLogDetailFrameInset:MUNG() - + if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.quest ~= true then return end STYLE:ApplyCloseButtonStyle(QuestLogFrameCloseButton) - STYLE:ApplyScrollStyle(QuestLogDetailScrollFrameScrollBar) - STYLE:ApplyScrollStyle(QuestLogScrollFrameScrollBar, 5) - STYLE:ApplyScrollStyle(QuestProgressScrollFrameScrollBar) - STYLE:ApplyScrollStyle(QuestRewardScrollFrameScrollBar) - - QuestLogFrame:SetPanelTemplate("Halftone") - QuestLogCount:SetFixedPanelTemplate("Default") - STYLE:ApplyScrollStyle(QuestDetailScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(QuestLogDetailScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(QuestLogScrollFrameScrollBar, 5) + STYLE:ApplyScrollFrameStyle(QuestProgressScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(QuestRewardScrollFrameScrollBar) - QuestLogFrameShowMapButton:SetButtonTemplate() - QuestLogFrameShowMapButton.text:ClearAllPoints() - QuestLogFrameShowMapButton.text:SetPoint("CENTER") - QuestLogFrameShowMapButton:Size(QuestLogFrameShowMapButton:GetWidth()-30, QuestLogFrameShowMapButton:GetHeight(), -40) - - STYLE:ApplyScrollStyle(QuestGreetingScrollFrameScrollBar) + --[[MISC STYLINGS REMOVED HERE]]-- + + QuestGreetingScrollFrame:Formula409() + STYLE:ApplyScrollFrameStyle(QuestGreetingScrollFrameScrollBar) - for _,i in pairs(QuestFrameList)do - _G[i]:SetButtonTemplate() - _G[i]:SetFrameLevel(_G[i]:GetFrameLevel() + 2) - end; - QuestLogFramePushQuestButton:Point("LEFT", QuestLogFrameAbandonButton, "RIGHT", 2, 0) - QuestLogFramePushQuestButton:Point("RIGHT", QuestLogFrameTrackButton, "LEFT", -2, 0) + --[[MISC STYLINGS REMOVED HERE]]-- for i = 1, MAX_NUM_ITEMS do local item = _G["QuestInfoItem"..i] @@ -146,96 +158,55 @@ local function QuestFrameStyle() tex:SetPoint("TOPLEFT", 2, -2) tex:Size(tex:GetWidth() - 2, tex:GetHeight() - 2) end - STYLE:ApplyLinkButtonStyle(item) + STYLE:ApplyItemButtonStyle(item) end - end; - + end + QuestInfoSkillPointFrame:Formula409() QuestInfoSkillPointFrame:Width(QuestInfoSkillPointFrame:GetWidth() - 4) - QuestInfoSkillPointFrame:SetFrameLevel(QuestInfoSkillPointFrame:GetFrameLevel() + 1) + + local curLvl = QuestInfoSkillPointFrame:GetFrameLevel() + 1 + QuestInfoSkillPointFrame:SetFrameLevel(curLvl) QuestInfoSkillPointFrame:SetFixedPanelTemplate("Slot") - QuestInfoSkillPointFrame:SetBackdropColor(1,1,0,0.5) + QuestInfoSkillPointFrame:SetBackdropColor(1, 1, 0, 0.5) QuestInfoSkillPointFrameIconTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9) QuestInfoSkillPointFrameIconTexture:SetDrawLayer("OVERLAY") QuestInfoSkillPointFrameIconTexture:Point("TOPLEFT", 2, -2) - QuestInfoSkillPointFrameIconTexture:Size(QuestInfoSkillPointFrameIconTexture:GetWidth() - 2, QuestInfoSkillPointFrameIconTexture:GetHeight() - 2) + QuestInfoSkillPointFrameIconTexture:Size(QuestInfoSkillPointFrameIconTexture:GetWidth()-2, QuestInfoSkillPointFrameIconTexture:GetHeight()-2) QuestInfoSkillPointFrameCount:SetDrawLayer("OVERLAY") - QuestInfoSkillPointFramePoints:ClearAllPoints() - QuestInfoSkillPointFramePoints:Point("BOTTOMRIGHT", QuestInfoSkillPointFrameIconTexture, "BOTTOMRIGHT") - + QuestInfoItemHighlight:Formula409() QuestInfoItemHighlight:SetFixedPanelTemplate("Slot") QuestInfoItemHighlight:SetBackdropBorderColor(1, 1, 0) QuestInfoItemHighlight:SetBackdropColor(0, 0, 0, 0) QuestInfoItemHighlight:Size(142, 40) - hooksecurefunc("QuestInfoItem_OnClick", function(k) - QuestInfoItemHighlight:ClearAllPoints() - QuestInfoItemHighlight:SetAllPoints(k) - end) + hooksecurefunc("QuestInfoItem_OnClick", Hook_QuestInfoItem_OnClick) - QuestLogFrame:HookScript("OnShow", function() - if not QuestLogScrollFrame.spellTex then - QuestLogScrollFrame:SetFixedPanelTemplate("Default") - QuestLogScrollFrame.spellTex = QuestLogScrollFrame:CreateTexture(nil, 'ARTWORK') - QuestLogScrollFrame.spellTex:SetTexture([[Interface\QuestFrame\QuestBookBG]]) - QuestLogScrollFrame.spellTex:SetPoint("TOPLEFT", 2, -2) - QuestLogScrollFrame.spellTex:Size(514, 616) - QuestLogScrollFrame.spellTex:SetTexCoord(0, 1, 0.02, 1) - QuestLogScrollFrame.spellTex2 = QuestLogScrollFrame:CreateTexture(nil, 'BORDER') - QuestLogScrollFrame.spellTex2:SetTexture([[Interface\FrameGeneral\UI-Background-Rock]]) - QuestLogScrollFrame.spellTex2:FillInner() - end - end) - - QuestLogDetailScrollFrame:HookScript('OnShow', function(k) - if not QuestLogDetailScrollFrame.Panel then - QuestLogDetailScrollFrame:SetPanelTemplate("Default") - QuestScrollHelper(QuestLogDetailScrollFrame, 509, 630, false) - QuestLogDetailScrollFrame:Height(k:GetHeight() - 2) - end; - QuestLogDetailScrollFrame.spellTex:Height(k:GetHeight() + 217) - end) + --QuestLogFrame:HookScript("OnShow", QuestLogScrollFrame_OnShow) - QuestRewardScrollFrame:HookScript('OnShow', function(k) - if not k.Panel then - k:SetPanelTemplate("Default") - QuestScrollHelper(k, 509, 630, false) - k:Height(k:GetHeight() - 2) - end; - k.spellTex:Height(k:GetHeight() + 217) - end) - - hooksecurefunc("QuestInfo_Display", function(l, m) - for j = 1, MAX_NUM_ITEMS do - local n = _G["QuestInfoItem"..j] - if not n:IsShown() then - break - end; - local o, p, q, r, s = n:GetPoint() - if j == 1 then - n:Point(o, p, q, 0, s) - elseif q == "BOTTOMLEFT"then - n:Point(o, p, q, 0, -4) - else - n:Point(o, p, q, 4, 0) - end - end - end) - - QuestProgressScrollFrame:SetFixedPanelTemplate() - QuestGreetingScrollFrame:SetFixedPanelTemplate() + QuestRewardScrollFrame:HookScript("OnShow", QuestRewardScrollFrame_OnShow) + hooksecurefunc("QuestInfo_Display", Hook_QuestInfo_Display) + QuestFrame:Formula409(true) + QuestFrameInset:MUNG() + QuestFrameDetailPanel:Formula409(true) + QuestDetailScrollFrame:Formula409(true) QuestScrollHelper(QuestDetailScrollFrame, 506, 615, true) + QuestProgressScrollFrame:SetFixedPanelTemplate() QuestScrollHelper(QuestProgressScrollFrame, 506, 615, true) + QuestGreetingScrollFrame:SetFixedPanelTemplate() QuestScrollHelper(QuestGreetingScrollFrame, 506, 615, true) - + QuestDetailScrollChildFrame:Formula409(true) + QuestRewardScrollFrame:Formula409(true) + QuestRewardScrollChildFrame:Formula409(true) + QuestFrameProgressPanel:Formula409(true) + QuestFrameRewardPanel:Formula409(true) QuestFrame:SetPanelTemplate("Action") QuestFrameAcceptButton:SetButtonTemplate() QuestFrameDeclineButton:SetButtonTemplate() QuestFrameCompleteButton:SetButtonTemplate() QuestFrameGoodbyeButton:SetButtonTemplate() QuestFrameCompleteQuestButton:SetButtonTemplate() - STYLE:ApplyCloseButtonStyle(QuestFrameCloseButton, QuestFrame.Panel) for j = 1, 6 do @@ -249,28 +220,18 @@ local function QuestFrameStyle() texture:Point("TOPLEFT", 2, -2) texture:Size(texture:GetWidth() - 2, texture:GetHeight() - 2) _G["QuestProgressItem"..j.."Count"]:SetDrawLayer("OVERLAY") - end; + end + QuestNPCModel:Formula409() QuestNPCModel:SetPanelTemplate("Comic") - QuestNPCModel:Point("TOPLEFT", QuestLogDetailFrame, "TOPRIGHT", 4, -34) + QuestNPCModelTextFrame:Formula409() QuestNPCModelTextFrame:SetPanelTemplate("Default") QuestNPCModelTextFrame.Panel:Point("TOPLEFT", QuestNPCModel.Panel, "BOTTOMLEFT", 0, -2) - QuestLogDetailFrame:SetPanelTemplate("Action") - - STYLE:ApplyCloseButtonStyle(QuestLogDetailFrameCloseButton) - - hooksecurefunc("QuestFrame_ShowQuestPortrait", function(m, t, text, u, r, s) - QuestNPCModel:ClearAllPoints() - QuestNPCModel:SetPoint("TOPLEFT", m, "TOPRIGHT", r+18, s) - end) + hooksecurefunc("QuestFrame_ShowQuestPortrait", Hook_QuestNPCModel) - if not SuperVillain.db.system.questWatch then - WatchFrame:HookScript("OnEvent", QueuedWatchFrameItems) - WatchFrame:HookScript("OnUpdate", QueuedWatchFrameItems) - end; -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/raid.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/raid.lua index 90c87b3..e839fd6 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/raid.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/raid.lua @@ -77,11 +77,11 @@ local function RaidInfoStyle() end end; RaidInfoScrollFrame:Formula409() - STYLE:SetBasicBG(RaidInfoFrame) - RaidInfoFrame.BasicBG:Point("TOPLEFT", RaidInfoFrame, "TOPLEFT") - RaidInfoFrame.BasicBG:Point("BOTTOMRIGHT", RaidInfoFrame, "BOTTOMRIGHT") + RaidInfoFrame:SetBasicPanel() + RaidInfoFrame.Panel:Point("TOPLEFT", RaidInfoFrame, "TOPLEFT") + RaidInfoFrame.Panel:Point("BOTTOMRIGHT", RaidInfoFrame, "BOTTOMRIGHT") STYLE:ApplyCloseButtonStyle(RaidInfoCloseButton, RaidInfoFrame) - STYLE:ApplyScrollStyle(RaidInfoScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(RaidInfoScrollFrameScrollBar) RaidFrameRaidBrowserButton:SetButtonTemplate() RaidFrameAllAssistCheckButton:SetCheckboxTemplate(true) end; diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/reforging.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/reforging.lua index 4f437f2..56599f0 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/reforging.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/reforging.lua @@ -39,7 +39,7 @@ local function ReforgingStyle() if x then ReforgingFrame.ItemButton.IconTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9) else - ReforgingFrame.ItemButton.IconTexture:SetTexture(0,0,0,0) + ReforgingFrame.ItemButton.IconTexture:SetTexture("") end end) STYLE:ApplyCloseButtonStyle(ReforgingFrameCloseButton) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/spellbook.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/spellbook.lua index 90ad3bc..9485111 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/spellbook.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/spellbook.lua @@ -145,7 +145,7 @@ local function AbilityButtonHelper(j) local N = select(j, i:GetRegions()) if N:GetObjectType() == "Texture"then if N:GetTexture() ~= "Interface\\Buttons\\ActionBarFlyoutButton" then - N:SetTexture(0,0,0,0) + N:SetTexture("") end end end @@ -181,7 +181,7 @@ local function ButtonUpdateHelper(k, M) local N = select(j, i:GetRegions()) if N:GetObjectType() == "Texture"then if N ~= i.FlyoutArrow then - N:SetTexture(0,0,0,0) + N:SetTexture("") end end end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/supervillain.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/supervillain.lua index d1a75cf..ebba7ee 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/supervillain.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/supervillain.lua @@ -17,67 +17,53 @@ local SuperVillain, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## -ALERTFRAME STYLER +HELPERS ########################################################## ]]-- +local externaltest = false; + +local ProxyLSMType = { + ["LSM30_Font"] = true, + ["LSM30_Sound"] = true, + ["LSM30_Border"] = true, + ["LSM30_Background"] = true, + ["LSM30_Statusbar"] = true +} + +local ProxyType = { + ["InlineGroup"] = true, + ["TreeGroup"] = true, + ["TabGroup"] = true, + ["SimpleGroup"] = true, + ["Frame"] = true, + ["DropdownGroup"] = true +} + local function Widget_OnEnter(b) b:SetBackdropBorderColor(unpack(SuperVillain.Media.color.highlight)) -end; +end + local function Widget_OnLeave(b) b:SetBackdropBorderColor(0,0,0,1) -end; -local function Widget_ScrollStyle(e, f) - if _G[e:GetName().."BG"]then - _G[e:GetName().."BG"]:SetTexture(0,0,0,0) - end; - if _G[e:GetName().."Track"]then - _G[e:GetName().."Track"]:SetTexture(0,0,0,0) - end; - if _G[e:GetName().."Top"]then - _G[e:GetName().."Top"]:SetTexture(0,0,0,0) - _G[e:GetName().."Bottom"]:SetTexture(0,0,0,0) - _G[e:GetName().."Middle"]:SetTexture(0,0,0,0) - end; - if _G[e:GetName().."ScrollUpButton"] and _G[e:GetName().."ScrollDownButton"] then - _G[e:GetName().."ScrollUpButton"]:Formula409() - if not _G[e:GetName().."ScrollUpButton"].icon then - STYLE:ApplyPaginationStyle(_G[e:GetName().."ScrollUpButton"]) - SquareButton_SetIcon(_G[e:GetName().."ScrollUpButton"], "UP") - _G[e:GetName().."ScrollUpButton"]:Size(_G[e:GetName().."ScrollUpButton"]:GetWidth()+7, _G[e:GetName().."ScrollUpButton"]:GetHeight()+7) - end; - _G[e:GetName().."ScrollDownButton"]:Formula409() - if not _G[e:GetName().."ScrollDownButton"].icon then - STYLE:ApplyPaginationStyle(_G[e:GetName().."ScrollDownButton"]) - SquareButton_SetIcon(_G[e:GetName().."ScrollDownButton"], "DOWN") - _G[e:GetName().."ScrollDownButton"]:Size(_G[e:GetName().."ScrollDownButton"]:GetWidth()+7, _G[e:GetName().."ScrollDownButton"]:GetHeight()+7) - end; - if not e.styledBackground then - e.styledBackground = CreateFrame("Frame", nil, e) - e.styledBackground:Point("TOPLEFT", _G[e:GetName().."ScrollUpButton"], "BOTTOMLEFT", 0, -1) - e.styledBackground:Point("BOTTOMRIGHT", _G[e:GetName().."ScrollDownButton"], "TOPRIGHT", 0, 1) - e.styledBackground:SetPanelTemplate("Inset", true) - end; - if e:GetThumbTexture()then - if not f then - f = 3 - end; - e:GetThumbTexture():SetTexture("Interface\\Buttons\\UI-ScrollBar-Knob") - end - end -end; - -local function Widget_ButtonStyle(h, i, j) - if h.Left then h.Left:SetAlpha(0)end; - if h.Middle then h.Middle:SetAlpha(0)end; - if h.Right then h.Right:SetAlpha(0)end; - if h.SetNormalTexture then h:SetNormalTexture("")end; - if h.SetHighlightTexture then h:SetHighlightTexture("")end; - if h.SetPushedTexture then h:SetPushedTexture("")end; - if h.SetDisabledTexture then h:SetDisabledTexture("")end; - if i then h:Formula409()end; - if not h.template and not j then h:SetFixedPanelTemplate("Button")end; - h:HookScript("OnEnter", Widget_OnEnter)h:HookScript("OnLeave", Widget_OnLeave) -end; +end + +local function Widget_ScrollStyle(frame, arg) + return STYLE:ApplyScrollFrameStyle(frame) +end + +local function Widget_ButtonStyle(frame, strip, bypass) + if frame.Left then frame.Left:SetAlpha(0) end + if frame.Middle then frame.Middle:SetAlpha(0) end + if frame.Right then frame.Right:SetAlpha(0) end + if frame.SetNormalTexture then frame:SetNormalTexture("") end + if frame.SetHighlightTexture then frame:SetHighlightTexture(0,0,0,0) end + if frame.SetPushedTexture then frame:SetPushedTexture(0,0,0,0) end + if frame.SetDisabledTexture then frame:SetDisabledTexture("") end + if strip then frame:Formula409() end + if not frame.Panel and not bypass then frame:SetButtonTemplate() end + frame:HookScript("OnEnter", Widget_OnEnter) + frame:HookScript("OnLeave", Widget_OnLeave) +end local function Widget_PaginationStyle(...) STYLE:ApplyPaginationStyle(...) @@ -85,45 +71,52 @@ end local NOOP = SuperVillain.fubar +local WidgetButton_OnClick = function(self) + local obj = self.obj; + if(obj and obj.pullout and obj.pullout.frame and (not obj.pullout.frame.Panel)) then + obj.pullout.frame:SetFixedPanelTemplate("Default") + end +end + +local WidgetDropButton_OnClick = function(self) + local obj = self.obj; + local widgetFrame = obj.dropdown + if(widgetFrame and not widgetFrame.Panel) then + widgetFrame:SetBasicPanel() + widgetFrame.Panel:SetPoint("TOPLEFT", widgetFrame, "TOPLEFT", 20, -2) + widgetFrame.Panel:SetPoint("BOTTOMRIGHT", widgetFrame, "BOTTOMRIGHT", -20, 2) + end +end +--[[ +########################################################## +AceGUI STYLE +########################################################## +]]-- local function StyleAceGUI(event, addon) assert((LibStub("AceGUI-3.0") and (addon == "SVUI_ConfigOMatic")), "Addon Not Loaded") local AceGUI = LibStub("AceGUI-3.0") - for i = 1, 4 do - local alert = _G["SVUI_SystemAlert"..i]; - if(alert) then - for b = 1, 3 do - alert.buttons[b]:SetButtonTemplate() - end; - alert:Formula409() - STYLE:ApplyAlertStyle(alert) - alert.input:SetEditboxTemplate() - alert.input.Panel:Point("TOPLEFT", -2, -4) - alert.input.Panel:Point("BOTTOMRIGHT", 2, 4) - alert.gold:SetEditboxTemplate() - alert.silver:SetEditboxTemplate() - alert.copper:SetEditboxTemplate() - end - end - local regWidget = AceGUI.RegisterAsWidget; local regContainer = AceGUI.RegisterAsContainer; AceGUI.RegisterAsWidget = function(self, widget) - local n = widget.type; - if n == "MultiLineEditBox"then - local e = widget.frame; - e:SetFixedPanelTemplate("Pattern") - if not widget.scrollBG.template then - widget.scrollBG:SetFixedPanelTemplate("Inset") + + local widgetType = widget.type; + + if(widgetType == "MultiLineEditBox") then + local widgetFrame = widget.frame; + widgetFrame:SetFixedPanelTemplate("Default") + if not widget.scrollBG.Panel then + widget.scrollBG:SetBasicPanel() end Widget_ButtonStyle(widget.button) - Widget_ScrollStyle(widget.scrollBar) - widget.scrollBar:SetPoint("RIGHT", e, "RIGHT", -4) + STYLE:ApplyScrollFrameStyle(widget.scrollBar) + widget.scrollBar:SetPoint("RIGHT", widgetFrame, "RIGHT", -4) widget.scrollBG:SetPoint("TOPRIGHT", widget.scrollBar, "TOPLEFT", -2, 19) widget.scrollBG:SetPoint("BOTTOMLEFT", widget.button, "TOPLEFT") widget.scrollFrame:SetPoint("BOTTOMRIGHT", widget.scrollBG, "BOTTOMRIGHT", -4, 8) - elseif n == "CheckBox"then + + elseif(widgetType == "CheckBox") then widget.checkbg:MUNG() widget.highlight:MUNG() if not widget.styledCheckBG then @@ -132,184 +125,173 @@ local function StyleAceGUI(event, addon) widget.styledCheckBG:SetFixedPanelTemplate("Inset") end widget.check:SetParent(widget.styledCheckBG) - elseif n == "Dropdown"then - local e = widget.dropdown; - local o = widget.button; - local p = widget.text; - e:Formula409() - o:ClearAllPoints() - o:Point("RIGHT", e, "RIGHT", -20, 0) - o:SetFrameLevel(o:GetFrameLevel() + 1) - Widget_PaginationStyle(o, true) - if not e.Panel then - e:SetPanelTemplate("Inset") - e.Panel:Point("TOPLEFT", e, "TOPLEFT", 20, -2) - e.Panel:Point("BOTTOMRIGHT", e, "BOTTOMRIGHT", -20, 2) - local level = e:GetFrameLevel() - if(level > 0) then - e.Panel:SetFrameLevel(level - 1) - else - e.Panel:SetFrameLevel(0) - end - end - o:SetParent(e.Panel) - p:SetParent(e.Panel) - o:HookScript("OnClick", function(s) - local self = s.obj; - self.pullout.frame:SetFixedPanelTemplate("Default") - end) - elseif n == "LSM30_Font" or n == "LSM30_Sound" or n == "LSM30_Border" or n == "LSM30_Background" or n == "LSM30_Statusbar" then - local e = widget.frame; - local o = e.dropButton; - local p = e.text; - e:Formula409() - Widget_PaginationStyle(o, true) - e.text:ClearAllPoints() - e.text:Point("RIGHT", o, "LEFT", -2, 0) - o:ClearAllPoints() - o:Point("RIGHT", e, "RIGHT", -10, -6) - if not e.Panel then - e:SetFixedPanelTemplate("Inset") - if n == "LSM30_Font"then - e.Panel:Point("TOPLEFT", 20, -17) - elseif n == "LSM30_Sound"then - e.Panel:Point("TOPLEFT", 20, -17) - widget.soundbutton:SetParent(e.Panel) - widget.soundbutton:ClearAllPoints() - widget.soundbutton:Point("LEFT", e.Panel, "LEFT", 2, 0) - elseif n == "LSM30_Statusbar"then - e.Panel:Point("TOPLEFT", 20, -17) - widget.bar:SetParent(e.Panel) - widget.bar:FillInner() - elseif n == "LSM30_Border"or n == "LSM30_Background"then - e.Panel:Point("TOPLEFT", 42, -16) - end - e.Panel:Point("BOTTOMRIGHT", o, "BOTTOMRIGHT", 2, -2) + + elseif(widgetType == "Dropdown") then + local widgetDropdown = widget.dropdown; + local widgetButton = widget.button; + + widgetDropdown:Formula409() + widgetButton:ClearAllPoints() + widgetButton:Point("RIGHT", widgetDropdown, "RIGHT", -20, 0) + widgetButton:SetFrameLevel(widgetButton:GetFrameLevel() + 1) + Widget_PaginationStyle(widgetButton, true) + + if(not widgetDropdown.Panel) then + widgetDropdown:SetBasicPanel() + widgetDropdown.Panel:Point("TOPLEFT", widgetDropdown, "TOPLEFT", 20, -2) + widgetDropdown.Panel:Point("BOTTOMRIGHT", widgetDropdown, "BOTTOMRIGHT", -20, 2) end - o:SetParent(e.Panel) - p:SetParent(e.Panel) - o:HookScript("OnClick", function(s, o) - local self = s.obj; - if(self.dropdown and not self.dropdown.Panel) then - local e = self.dropdown - e:SetPanelTemplate("Inset") - e.Panel:Point("TOPLEFT", e, "TOPLEFT", 20, -2) - e.Panel:Point("BOTTOMRIGHT", e, "BOTTOMRIGHT", -20, 2) - local level = e:GetFrameLevel() - if(level > 0) then - e.Panel:SetFrameLevel(level - 1) - else - e.Panel:SetFrameLevel(0) - end - end - end) - elseif n == "EditBox" then - local e = widget.editbox; - local o = widget.button; - local boxName = e:GetName() + + widgetButton:SetParent(widgetDropdown.Panel) + widget.text:SetParent(widgetDropdown.Panel) + widgetButton:HookScript("OnClick", WidgetButton_OnClick) + + elseif(widgetType == "EditBox") then + local widgetEditbox = widget.editbox; + local boxName = widgetEditbox:GetName() + if(_G[boxName.."Left"]) then _G[boxName.."Left"]:MUNG() end + if(_G[boxName.."Middle"]) then _G[boxName.."Middle"]:MUNG() end + if(_G[boxName.."Right"]) then _G[boxName.."Right"]:MUNG() end - e:Height(17) - e:SetFixedPanelTemplate("Inset") - local level = e:GetFrameLevel() - if(level > 0) then - e.Panel:SetFrameLevel(level - 1) - else - e.Panel:SetFrameLevel(0) + + widgetEditbox:Height(17) + --widgetEditbox:SetFixedPanelTemplate("Default") + Widget_ButtonStyle(widget.button) + + elseif(widgetType == "Button") then + local widgetFrame = widget.frame; + Widget_ButtonStyle(widgetFrame, nil, true) + + if(not widgetFrame.Panel) then + widgetFrame:Formula409() + widgetFrame:SetFixedPanelTemplate("Button", true) + end + widget.text:SetParent(widgetFrame.Panel) + + elseif(widgetType == "Slider") then + local widgetSlider = widget.slider; + local widgetEditbox = widget.editbox; + + if(not widgetSlider.Panel) then + widgetSlider:Formula409() + widgetSlider:SetFixedPanelTemplate("Bar") end - Widget_ButtonStyle(o) - elseif n == "Button"then - local e = widget.frame; - Widget_ButtonStyle(e, nil, true) - e:Formula409() - e:SetFixedPanelTemplate("Button", true) - e.Panel:FillInner() - widget.text:SetParent(e.Panel) - elseif n == "Slider"then - local e = widget.slider; - local t = widget.editbox; - local u = widget.lowtext; - local v = widget.hightext; - local w = 20; - e:Formula409() - e:SetFixedPanelTemplate("Inset") - e:Height(w) - e:SetThumbTexture("Interface\\Buttons\\UI-ScrollBar-Knob") - e:GetThumbTexture():SetVertexColor(0.8, 0.8, 0.8) - t:SetFixedPanelTemplate("Inset") - t:Height(15) - t:Point("TOP", e, "BOTTOM", 0, -1) - u:SetPoint("TOPLEFT", e, "BOTTOMLEFT", 2, -2) - v:SetPoint("TOPRIGHT", e, "BOTTOMRIGHT", -2, -2) + + widgetSlider:Height(20) + widgetSlider:SetThumbTexture("Interface\\Buttons\\UI-ScrollBar-Knob") + widgetSlider:GetThumbTexture():SetVertexColor(0.8, 0.8, 0.8) + + widgetEditbox:Height(15) + widgetEditbox:SetPoint("TOP", widgetSlider, "BOTTOM", 0, -1) + + -- if(not widgetEditbox.Panel) then + -- widgetEditbox:SetFixedPanelTemplate("Default") + -- end + + widget.lowtext:SetPoint("TOPLEFT", widgetSlider, "BOTTOMLEFT", 2, -2) + widget.hightext:SetPoint("TOPRIGHT", widgetSlider, "BOTTOMRIGHT", -2, -2) + + elseif(ProxyLSMType[widgetType]) then + local widgetFrame = widget.frame; + local dropButton = widgetFrame.dropButton; + + widgetFrame:Formula409() + Widget_PaginationStyle(dropButton, true) + widgetFrame.text:ClearAllPoints() + widgetFrame.text:Point("RIGHT", dropButton, "LEFT", -2, 0) + dropButton:ClearAllPoints() + dropButton:Point("RIGHT", widgetFrame, "RIGHT", -10, -6) + if(not widgetFrame.Panel) then + widgetFrame:SetBasicPanel() + if(widgetType == "LSM30_Font") then + widgetFrame.Panel:Point("TOPLEFT", 20, -17) + elseif(widgetType == "LSM30_Sound") then + widgetFrame.Panel:Point("TOPLEFT", 20, -17) + widget.soundbutton:SetParent(widgetFrame.Panel) + widget.soundbutton:ClearAllPoints() + widget.soundbutton:Point("LEFT", widgetFrame.Panel, "LEFT", 2, 0) + elseif(widgetType == "LSM30_Statusbar") then + widgetFrame.Panel:Point("TOPLEFT", 20, -17) + widget.bar:SetParent(widgetFrame.Panel) + widget.bar:FillInner() + elseif(widgetType == "LSM30_Border" or widgetType == "LSM30_Background") then + widgetFrame.Panel:Point("TOPLEFT", 42, -16) + end + widgetFrame.Panel:Point("BOTTOMRIGHT", dropButton, "BOTTOMRIGHT", 2, -2) + end + dropButton:SetParent(widgetFrame.Panel) + widgetFrame.text:SetParent(widgetFrame.Panel) + dropButton:HookScript("OnClick", WidgetDropButton_OnClick) end return regWidget(self, widget) end - local externaltest = false; - AceGUI.RegisterAsContainer = function(self, widget) - local n = widget.type; - if n == "ScrollFrame" then - local e = widget.scrollbar; - Widget_ScrollStyle(e) - elseif n == "Window" then - local e = widget.content:GetParent() - e:SetPanelTemplate("Halftone") - elseif n == "InlineGroup" or n == "TreeGroup" or n == "TabGroup" or n == "SimpleGroup" or n == "Frame" or n == "DropdownGroup" then - local e = widget.content:GetParent() - if n == "Frame" then - e:Formula409() - for z = 1, e:GetNumChildren()do - local A = select(z, e:GetChildren()) - if A:GetObjectType() == "Button"and A:GetText() then - Widget_ButtonStyle(A) + local widgetType = widget.type; + local widgetParent = widget.content:GetParent() + if widgetType == "ScrollFrame" then + STYLE:ApplyScrollFrameStyle(widget.scrollBar) + elseif widgetType == "Window" then + widgetParent:SetPanelTemplate("Halftone") + elseif(ProxyType[widgetType]) then + if widgetType == "Frame" then + widgetParent:Formula409() + for i = 1, widgetParent:GetNumChildren()do + local childFrame = select(i, widgetParent:GetChildren()) + if childFrame:GetObjectType() == "Button" and childFrame:GetText() then + Widget_ButtonStyle(childFrame) else - A:Formula409() + childFrame:Formula409() end end - end - if not widget.treeframe then + end + + if widget.treeframe then + widget.treeframe:SetBasicPanel() + widgetParent:SetPoint("TOPLEFT", widget.treeframe, "TOPRIGHT", 1, 0) + local oldFunc = widget.CreateButton; + widget.CreateButton = function(self) + local newButton = oldFunc(self) + newButton.toggle:Formula409() + newButton.toggle.SetNormalTexture = NOOP; + newButton.toggle.SetPushedTexture = NOOP; + newButton.toggle:SetButtonTemplate() + newButton.toggleText = newButton.toggle:CreateFontString(nil, "OVERLAY") + newButton.toggleText:SetFont([[Interface\AddOns\SVUI\assets\fonts\Roboto.ttf]], 19) + newButton.toggleText:SetPoint("CENTER") + newButton.toggleText:SetText("*") + return newButton + end + else if not externaltest then - e:SetPanelTemplate("Halftone") - e.Panel:SetFrameLevel(0) + widgetParent:SetPanelTemplate("Halftone") + widgetParent.Panel:SetFrameLevel(0) externaltest = true else - e:SetFixedPanelTemplate("Default") - end - end - if widget.treeframe then - widget.treeframe:SetFixedPanelTemplate("Inset") - e:Point("TOPLEFT", widget.treeframe, "TOPRIGHT", 1, 0) - local B = widget.CreateButton; - widget.CreateButton = function(self) - local o = B(self) - o.toggle:Formula409() - o.toggle.SetNormalTexture = NOOP; - o.toggle.SetPushedTexture = NOOP; - o.toggle:SetButtonTemplate() - o.toggleText = o.toggle:CreateFontString(nil, "OVERLAY") - o.toggleText:SetFont([[Interface\AddOns\SVUI\assets\fonts\Roboto.ttf]], 19) - o.toggleText:SetPoint("CENTER") - o.toggleText:SetText("*") - return o - end - end - if n == "TabGroup" then - local createTab = widget.CreateTab; + widgetParent:SetFixedPanelTemplate("Default") + end + end + + if(widgetType == "TabGroup") then + local oldFunc = widget.CreateTab; widget.CreateTab = function(self, arg) - local tab = createTab(self, arg) - tab:Formula409() - return tab + local newTab = oldFunc(self, arg) + newTab:Formula409() + return newTab end end - if widget.scrollbar then Widget_ScrollStyle(widget.scrollbar) end + + if widget.scrollbar then + STYLE:ApplyScrollFrameStyle(widget.scrollBar) + end end return regContainer(self, widget) end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/system.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/system.lua index 70e580d..4880f9a 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/system.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/system.lua @@ -46,12 +46,6 @@ local SystemFrameList2 = { "VideoOptionsFrame", "AudioOptionsFrame", }; -local SystemFrameList3 = { - "ChatMenu", - "EmoteMenu", - "LanguageMenu", - "VoiceMacroMenu", -}; local SystemFrameList4 = { "Options", "Store", @@ -65,7 +59,9 @@ local SystemFrameList4 = { "Quit", "Continue", "MacOptions", - "Help" + "Help", + "WhatsNew", + "Addons" }; local SystemFrameList5 = { "GameMenuFrame", @@ -90,100 +86,7 @@ local SystemFrameList6 = { "StackSplitCancelButton", "RolePollPopupAcceptButton" }; -local SystemFrameList7 = { - "ChatConfigFrame", - "ChatConfigBackgroundFrame", - "ChatConfigCategoryFrame", - "ChatConfigChatSettingsClassColorLegend", - "ChatConfigChatSettingsLeft", - "ChatConfigChannelSettingsLeft", - "ChatConfigChannelSettingsClassColorLegend", - "ChatConfigOtherSettingsCombat", - "ChatConfigOtherSettingsPVP", - "ChatConfigOtherSettingsSystem", - "ChatConfigOtherSettingsCreature", - "ChatConfigCombatSettingsFilters", - "CombatConfigMessageSourcesDoneBy", - "CombatConfigMessageSourcesDoneTo", - "CombatConfigColorsUnitColors", - "CombatConfigColorsHighlighting", - "CombatConfigColorsColorizeUnitName", - "CombatConfigColorsColorizeSpellNames", - "CombatConfigColorsColorizeDamageNumber", - "CombatConfigColorsColorizeDamageSchool", - "CombatConfigColorsColorizeEntireLine", -}; -local SystemFrameList8 = { - "ChatConfigFrameDefaultButton", - "ChatConfigFrameOkayButton", - "CombatLogDefaultButton", - "ChatConfigCombatSettingsFiltersCopyFilterButton", - "ChatConfigCombatSettingsFiltersAddFilterButton", - "ChatConfigCombatSettingsFiltersDeleteButton", - "CombatConfigSettingsSaveButton", - "ChatConfigFrameCancelButton", -}; -local SystemFrameList9 = { - "ChatConfigCategoryFrame", - "ChatConfigBackgroundFrame", - "ChatConfigChatSettingsClassColorLegend", - "ChatConfigChannelSettingsClassColorLegend", - "ChatConfigCombatSettingsFilters", - "ChatConfigCombatSettingsFiltersScrollFrame", - "CombatConfigColorsHighlighting", - "CombatConfigColorsColorizeUnitName", - "CombatConfigColorsColorizeSpellNames", - "CombatConfigColorsColorizeDamageNumber", - "CombatConfigColorsColorizeDamageSchool", - "CombatConfigColorsColorizeEntireLine", - "ChatConfigChatSettingsLeft", - "ChatConfigOtherSettingsCombat", - "ChatConfigOtherSettingsPVP", - "ChatConfigOtherSettingsSystem", - "ChatConfigOtherSettingsCreature", - "ChatConfigChannelSettingsLeft", - "CombatConfigMessageSourcesDoneBy", - "CombatConfigMessageSourcesDoneTo", - "CombatConfigColorsUnitColors", -}; -local SystemFrameList10 = { - "CombatConfigColorsColorizeSpellNames", - "CombatConfigColorsColorizeDamageNumber", - "CombatConfigColorsColorizeDamageSchool", - "CombatConfigColorsColorizeEntireLine", -}; -local SystemFrameList11 = { - "ChatConfigFrameOkayButton", - "ChatConfigFrameDefaultButton", - "CombatLogDefaultButton", - "ChatConfigCombatSettingsFiltersDeleteButton", - "ChatConfigCombatSettingsFiltersAddFilterButton", - "ChatConfigCombatSettingsFiltersCopyFilterButton", - "CombatConfigSettingsSaveButton", -}; -local SystemFrameList12 = { - "CombatConfigColorsHighlightingLine", - "CombatConfigColorsHighlightingAbility", - "CombatConfigColorsHighlightingDamage", - "CombatConfigColorsHighlightingSchool", - "CombatConfigColorsColorizeUnitNameCheck", - "CombatConfigColorsColorizeSpellNamesCheck", - "CombatConfigColorsColorizeSpellNamesSchoolColoring", - "CombatConfigColorsColorizeDamageNumberCheck", - "CombatConfigColorsColorizeDamageNumberSchoolColoring", - "CombatConfigColorsColorizeDamageSchoolCheck", - "CombatConfigColorsColorizeEntireLineCheck", - "CombatConfigFormattingShowTimeStamp", - "CombatConfigFormattingShowBraces", - "CombatConfigFormattingUnitNames", - "CombatConfigFormattingSpellNames", - "CombatConfigFormattingItemNames", - "CombatConfigFormattingFullText", - "CombatConfigSettingsShowQuickButton", - "CombatConfigSettingsSolo", - "CombatConfigSettingsParty", - "CombatConfigSettingsRaid", -}; + local SystemFrameList13 = { "VideoOptionsFrameCategoryFrame", "VideoOptionsFramePanelContainer", @@ -489,9 +392,6 @@ end SYSTEM WIDGET STYLERS ########################################################## ]]-- -local ChatGeneric_OnShow = function(self) if(not self.Panel) then self:SetPanelTemplate("Halftone") end end -local ChatMenu_OnShow = function(self) if(not self.Panel) then self:SetPanelTemplate("Halftone") end self:ClearAllPoints() self:Point("BOTTOMLEFT", ChatFrame1, "TOPLEFT", 0, 30) end - local function SystemPanelQue() if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.misc ~= true then return end QueueStatusFrame:Formula409() @@ -524,17 +424,7 @@ local function SystemPanelQue() this:SetPanelTemplate("Halftone") end end - for i = 1, #SystemFrameList3 do - local name = SystemFrameList3[i] - local this = _G[name] - if(this) then - if(name == "ChatMenu") then - this:HookScript("OnShow", ChatMenu_OnShow) - else - this:HookScript("OnShow", ChatGeneric_OnShow) - end - end - end + LFDRoleCheckPopup:Formula409() LFDRoleCheckPopup:SetFixedPanelTemplate() LFDRoleCheckPopupAcceptButton:SetButtonTemplate() @@ -580,7 +470,7 @@ local function SystemPanelQue() GhostFrame:ClearAllPoints() GhostFrame:SetPoint("TOP", SuperVillain.UIParent, "TOP", 0, -150) GhostFrameContentsFrame:SetButtonTemplate() - GhostFrameContentsFrameIcon:SetTexture(0,0,0,0) + GhostFrameContentsFrameIcon:SetTexture("") local x = CreateFrame("Frame", nil, GhostFrame) x:SetFrameStrata("MEDIUM") x:SetFixedPanelTemplate("Default") @@ -593,7 +483,7 @@ local function SystemPanelQue() for i = 1, #SystemFrameList5 do local this = _G[SystemFrameList5[i].."Header"] if(this) then - this:SetTexture(0,0,0,0) + this:SetTexture("") this:ClearAllPoints() if this == _G["GameMenuFrameHeader"] then this:SetPoint("TOP", GameMenuFrame, 0, 7) @@ -642,7 +532,7 @@ local function SystemPanelQue() end) if IsMacClient() then MacOptionsFrame:SetFixedPanelTemplate("Default") - MacOptionsFrameHeader:SetTexture(0,0,0,0) + MacOptionsFrameHeader:SetTexture("") MacOptionsFrameHeader:ClearAllPoints() MacOptionsFrameHeader:SetPoint("TOP", MacOptionsFrame, 0, 0) MacOptionsFrameMovieRecording:SetFixedPanelTemplate("Default") @@ -675,205 +565,32 @@ local function SystemPanelQue() OpacityFrame:Formula409() OpacityFrame:SetFixedPanelTemplate("Transparent", true) - for i = 1, #SystemFrameList7 do - local this = _G[SystemFrameList7[i]] - if(this) then - this:Formula409() - end - end - - for i = 1, #SystemFrameList8 do - local this = _G[SystemFrameList8[i]] - if(this) then - this:SetButtonTemplate() - end - end - - ChatConfigFrameOkayButton:Point("RIGHT", ChatConfigFrameCancelButton, "RIGHT", -11, -1) - ChatConfigCombatSettingsFiltersDeleteButton:Point("TOPRIGHT", ChatConfigCombatSettingsFilters, "BOTTOMRIGHT", 0, -1) - ChatConfigCombatSettingsFiltersAddFilterButton:Point("RIGHT", ChatConfigCombatSettingsFiltersDeleteButton, "LEFT", -1, 0) - ChatConfigCombatSettingsFiltersCopyFilterButton:Point("RIGHT", ChatConfigCombatSettingsFiltersAddFilterButton, "LEFT", -1, 0) - for i=1, 5 do - local this = _G["CombatConfigTab"..i] - if(this) then - this:Formula409() - end - end - CombatConfigSettingsNameEditBox:SetEditboxTemplate() - ChatConfigFrame:SetPanelTemplate("Halftone", true) - - for i = 1, #SystemFrameList9 do - local this = _G[SystemFrameList9[i]] - if(this) then - this:Formula409() - STYLE:SetBasicBG(this) - end - end - - for i = 1, #SystemFrameList10 do - local this = _G[SystemFrameList10[i]] - if(this) then - this:ClearAllPoints() - if this == CombatConfigColorsColorizeSpellNames then - this:Point("TOP",CombatConfigColorsColorizeUnitName,"BOTTOM",0,-2) - else - this:Point("TOP",_G[SystemFrameList10[i-1]],"BOTTOM",0,-2) - end - end - end - - ChatConfigChannelSettingsLeft:RegisterEvent("PLAYER_ENTERING_WORLD") - ChatConfigChannelSettingsLeft:SetScript("OnEvent", function(self, event) - ChatConfigChannelSettingsLeft:UnregisterEvent("PLAYER_ENTERING_WORLD") - for i = 1,#ChatConfigChannelSettingsLeft.checkBoxTable do - _G["ChatConfigChannelSettingsLeftCheckBox"..i]:Formula409() - _G["ChatConfigChannelSettingsLeftCheckBox"..i]:SetPanelTemplate() - _G["ChatConfigChannelSettingsLeftCheckBox"..i].Panel:Point("TOPLEFT",3,-1) - _G["ChatConfigChannelSettingsLeftCheckBox"..i].Panel:Point("BOTTOMRIGHT",-3,1) - _G["ChatConfigChannelSettingsLeftCheckBox"..i]:SetHeight(ChatConfigOtherSettingsCombatCheckBox1:GetHeight()) - _G["ChatConfigChannelSettingsLeftCheckBox"..i.."Check"]:SetCheckboxTemplate(true) - _G["ChatConfigChannelSettingsLeftCheckBox"..i.."ColorClasses"]:SetCheckboxTemplate(true) - _G["ChatConfigChannelSettingsLeftCheckBox"..i.."ColorClasses"]:SetHeight(ChatConfigChatSettingsLeftCheckBox1Check:GetHeight()) - end - end) - CreateChatChannelList(self, GetChannelList()) - ChatConfig_CreateCheckboxes(ChatConfigChannelSettingsLeft, CHAT_CONFIG_CHANNEL_LIST, "ChatConfigCheckBoxWithSwatchAndClassColorTemplate", CHANNELS) - ChatConfig_UpdateCheckboxes(ChatConfigChannelSettingsLeft) - ChatConfigBackgroundFrame:SetScript("OnShow", function(self) - for i = 1,#CHAT_CONFIG_CHAT_LEFT do - _G["ChatConfigChatSettingsLeftCheckBox"..i]:Formula409() - _G["ChatConfigChatSettingsLeftCheckBox"..i]:SetPanelTemplate() - _G["ChatConfigChatSettingsLeftCheckBox"..i].Panel:Point("TOPLEFT",3,-1) - _G["ChatConfigChatSettingsLeftCheckBox"..i].Panel:Point("BOTTOMRIGHT",-3,1) - _G["ChatConfigChatSettingsLeftCheckBox"..i]:SetHeight(ChatConfigOtherSettingsCombatCheckBox1:GetHeight()) - _G["ChatConfigChatSettingsLeftCheckBox"..i.."Check"]:SetCheckboxTemplate(true) - _G["ChatConfigChatSettingsLeftCheckBox"..i.."ColorClasses"]:SetCheckboxTemplate(true) - _G["ChatConfigChatSettingsLeftCheckBox"..i.."ColorClasses"]:SetHeight(ChatConfigChatSettingsLeftCheckBox1Check:GetHeight()) - end - for i = 1,#CHAT_CONFIG_OTHER_COMBAT do - _G["ChatConfigOtherSettingsCombatCheckBox"..i]:Formula409() - _G["ChatConfigOtherSettingsCombatCheckBox"..i]:SetPanelTemplate() - _G["ChatConfigOtherSettingsCombatCheckBox"..i].Panel:Point("TOPLEFT",3,-1) - _G["ChatConfigOtherSettingsCombatCheckBox"..i].Panel:Point("BOTTOMRIGHT",-3,1) - _G["ChatConfigOtherSettingsCombatCheckBox"..i.."Check"]:SetCheckboxTemplate(true) - end - for i = 1,#CHAT_CONFIG_OTHER_PVP do - _G["ChatConfigOtherSettingsPVPCheckBox"..i]:Formula409() - _G["ChatConfigOtherSettingsPVPCheckBox"..i]:SetPanelTemplate() - _G["ChatConfigOtherSettingsPVPCheckBox"..i].Panel:Point("TOPLEFT",3,-1) - _G["ChatConfigOtherSettingsPVPCheckBox"..i].Panel:Point("BOTTOMRIGHT",-3,1) - _G["ChatConfigOtherSettingsPVPCheckBox"..i.."Check"]:SetCheckboxTemplate(true) - end - for i = 1,#CHAT_CONFIG_OTHER_SYSTEM do - _G["ChatConfigOtherSettingsSystemCheckBox"..i]:Formula409() - _G["ChatConfigOtherSettingsSystemCheckBox"..i]:SetPanelTemplate() - _G["ChatConfigOtherSettingsSystemCheckBox"..i].Panel:Point("TOPLEFT",3,-1) - _G["ChatConfigOtherSettingsSystemCheckBox"..i].Panel:Point("BOTTOMRIGHT",-3,1) - _G["ChatConfigOtherSettingsSystemCheckBox"..i.."Check"]:SetCheckboxTemplate(true) - end - for i = 1,#CHAT_CONFIG_CHAT_CREATURE_LEFT do - _G["ChatConfigOtherSettingsCreatureCheckBox"..i]:Formula409() - _G["ChatConfigOtherSettingsCreatureCheckBox"..i]:SetPanelTemplate() - _G["ChatConfigOtherSettingsCreatureCheckBox"..i].Panel:Point("TOPLEFT",3,-1) - _G["ChatConfigOtherSettingsCreatureCheckBox"..i].Panel:Point("BOTTOMRIGHT",-3,1) - _G["ChatConfigOtherSettingsCreatureCheckBox"..i.."Check"]:SetCheckboxTemplate(true) - end - for i = 1,#COMBAT_CONFIG_MESSAGESOURCES_BY do - _G["CombatConfigMessageSourcesDoneByCheckBox"..i]:Formula409() - _G["CombatConfigMessageSourcesDoneByCheckBox"..i]:SetPanelTemplate() - _G["CombatConfigMessageSourcesDoneByCheckBox"..i].Panel:Point("TOPLEFT",3,-1) - _G["CombatConfigMessageSourcesDoneByCheckBox"..i].Panel:Point("BOTTOMRIGHT",-3,1) - _G["CombatConfigMessageSourcesDoneByCheckBox"..i.."Check"]:SetCheckboxTemplate(true) - end - for i = 1,#COMBAT_CONFIG_MESSAGESOURCES_TO do - _G["CombatConfigMessageSourcesDoneToCheckBox"..i]:Formula409() - _G["CombatConfigMessageSourcesDoneToCheckBox"..i]:SetPanelTemplate() - _G["CombatConfigMessageSourcesDoneToCheckBox"..i].Panel:Point("TOPLEFT",3,-1) - _G["CombatConfigMessageSourcesDoneToCheckBox"..i].Panel:Point("BOTTOMRIGHT",-3,1) - _G["CombatConfigMessageSourcesDoneToCheckBox"..i.."Check"]:SetCheckboxTemplate(true) - end - for i = 1,#COMBAT_CONFIG_UNIT_COLORS do - _G["CombatConfigColorsUnitColorsSwatch"..i]:Formula409() - _G["CombatConfigColorsUnitColorsSwatch"..i]:SetPanelTemplate() - _G["CombatConfigColorsUnitColorsSwatch"..i].Panel:Point("TOPLEFT",3,-1) - _G["CombatConfigColorsUnitColorsSwatch"..i].Panel:Point("BOTTOMRIGHT",-3,1) - end - for i=1,4 do - for j=1,4 do - if _G["CombatConfigMessageTypesLeftCheckBox"..i] and _G["CombatConfigMessageTypesLeftCheckBox"..i.."_"..j] then - _G["CombatConfigMessageTypesLeftCheckBox"..i]:SetCheckboxTemplate(true) - _G["CombatConfigMessageTypesLeftCheckBox"..i.."_"..j]:SetCheckboxTemplate(true) - end - end - for j=1,10 do - if _G["CombatConfigMessageTypesRightCheckBox"..i] and _G["CombatConfigMessageTypesRightCheckBox"..i.."_"..j] then - _G["CombatConfigMessageTypesRightCheckBox"..i]:SetCheckboxTemplate(true) - _G["CombatConfigMessageTypesRightCheckBox"..i.."_"..j]:SetCheckboxTemplate(true) - end - end - _G["CombatConfigMessageTypesMiscCheckBox"..i]:SetCheckboxTemplate(true) - end - end) - for i = 1,#COMBAT_CONFIG_TABS do - local this = _G["CombatConfigTab"..i] - if(this) then - STYLE:ApplyTabStyle(this) - this:SetHeight(this:GetHeight()-2) - this:SetWidth(ceil(this:GetWidth()+1.6)) - _G["CombatConfigTab"..i.."Text"]:SetPoint("BOTTOM",0,10) - end - end - CombatConfigTab1:ClearAllPoints() - CombatConfigTab1:SetPoint("BOTTOMLEFT",ChatConfigBackgroundFrame,"TOPLEFT",6,-2) - for i = 1, #SystemFrameList11 do - local this = _G[SystemFrameList11[i]] - if(this) then - this:SetButtonTemplate() - end - end - ChatConfigFrameOkayButton:SetPoint("TOPRIGHT",ChatConfigBackgroundFrame,"BOTTOMRIGHT",-3,-5) - ChatConfigFrameDefaultButton:SetPoint("TOPLEFT",ChatConfigCategoryFrame,"BOTTOMLEFT",1,-5) - CombatLogDefaultButton:SetPoint("TOPLEFT",ChatConfigCategoryFrame,"BOTTOMLEFT",1,-5) - ChatConfigCombatSettingsFiltersDeleteButton:SetPoint("TOPRIGHT",ChatConfigCombatSettingsFilters,"BOTTOMRIGHT",-3,-1) - ChatConfigCombatSettingsFiltersCopyFilterButton:SetPoint("RIGHT",ChatConfigCombatSettingsFiltersDeleteButton,"LEFT",-2,0) - ChatConfigCombatSettingsFiltersAddFilterButton:SetPoint("RIGHT",ChatConfigCombatSettingsFiltersCopyFilterButton,"LEFT",-2,0) - for i = 1, #SystemFrameList12 do - local this = _G[SystemFrameList12[i]] - if(this) then - this:SetCheckboxTemplate(true) - end - end - STYLE:ApplyPaginationStyle(ChatConfigMoveFilterUpButton,true) - STYLE:ApplyPaginationStyle(ChatConfigMoveFilterDownButton,true) - ChatConfigMoveFilterUpButton:ClearAllPoints() - ChatConfigMoveFilterDownButton:ClearAllPoints() - ChatConfigMoveFilterUpButton:SetPoint("TOPLEFT",ChatConfigCombatSettingsFilters,"BOTTOMLEFT",3,0) - ChatConfigMoveFilterDownButton:SetPoint("LEFT",ChatConfigMoveFilterUpButton,24,0) - CombatConfigSettingsNameEditBox:SetEditboxTemplate() - ChatConfigFrame:Size(680,596) - ChatConfigFrameHeader:ClearAllPoints() - ChatConfigFrameHeader:SetPoint("TOP", ChatConfigFrame, 0, -5) - hooksecurefunc("UIDropDownMenu_InitializeHelper", function(frame) + hooksecurefunc("UIDropDownMenu_InitializeHelper", function(self) for i = 1, UIDROPDOWNMENU_MAXLEVELS do - _G["DropDownList"..i.."Backdrop"]:SetFixedPanelTemplate("Transparent", true) - _G["DropDownList"..i.."MenuBackdrop"]:SetFixedPanelTemplate("Transparent", true) + local name = ("DropDownList%d"):format(i) + local bg = _G[("%sBackdrop"):format(name)] + bg:SetBasicPanel() + local menu = _G[("%sMenuBackdrop"):format(name)] + menu:SetBasicPanel() end - end) + end) + GuildInviteFrame:Formula409() GuildInviteFrame:SetFixedPanelTemplate('Transparent') GuildInviteFrameLevel:Formula409() GuildInviteFrameLevel:ClearAllPoints() - GuildInviteFrameLevel:Point('TOP', GuildInviteFrame, 'CENTER', -15, -25) + GuildInviteFrameLevel:SetPoint('TOP', GuildInviteFrame, 'CENTER', -15, -25) GuildInviteFrameJoinButton:SetButtonTemplate() GuildInviteFrameDeclineButton:SetButtonTemplate() GuildInviteFrame:Height(225) GuildInviteFrame:HookScript("OnEvent", function() GuildInviteFrame:Height(225) end) + GuildInviteFrameWarningText:MUNG() BattleTagInviteFrame:Formula409() BattleTagInviteFrame:SetFixedPanelTemplate('Transparent') - BattleTagInviteFrameScrollFrame:SetEditboxTemplate() + --BattleTagInviteFrameScrollFrame:SetEditboxTemplate() for i=1, BattleTagInviteFrame:GetNumChildren() do local child = select(i, BattleTagInviteFrame:GetChildren()) @@ -883,10 +600,10 @@ local function SystemPanelQue() end for i = 1, #SystemFrameList13 do - local this = _G[SystemFrameList13[i]] - if(this) then - this:Formula409() - STYLE:SetBasicBG(this) + local frame = _G[SystemFrameList13[i]] + if(frame) then + frame:Formula409() + frame:SetBasicPanel() end end @@ -952,7 +669,7 @@ local function SystemPanelQue() for i = 1, #SystemFrameList21 do local this = _G[SystemFrameList21[i]] if(this) then - STYLE:ApplyScrollbarStyle(this) + STYLE:ApplyScrollBarStyle(this) end end MacOptionsFrame:Formula409() @@ -968,7 +685,7 @@ local function SystemPanelQue() STYLE:ApplyDropdownStyle(MacOptionsFrameResolutionDropDown) STYLE:ApplyDropdownStyle(MacOptionsFrameFramerateDropDown) STYLE:ApplyDropdownStyle(MacOptionsFrameCodecDropDown) - STYLE:ApplyScrollbarStyle(MacOptionsFrameQualitySlider) + STYLE:ApplyScrollBarStyle(MacOptionsFrameQualitySlider) for i = 1, 11 do local this = _G["MacOptionsFrameCheckButton"..i] if(this) then diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/tabard.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/tabard.lua index 6b9730d..0a747a2 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/tabard.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/tabard.lua @@ -29,11 +29,11 @@ local function cleanT(a,b) if b and type(b)=='boolean'then d:MUNG() elseif d:GetDrawLayer()==b then - d:SetTexture(0,0,0,0) + d:SetTexture("") elseif b and type(b)=='string'and d:GetTexture()~=b then - d:SetTexture(0,0,0,0) + d:SetTexture("") else - d:SetTexture(0,0,0,0) + d:SetTexture("") end end end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/talents.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/talents.lua index 2d7fda0..83248b8 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/talents.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/talents.lua @@ -114,13 +114,7 @@ local function TalentFrameStyle() PlayerTalentFrame.Panel = CreateFrame('Frame', nil, PlayerTalentFrame) PlayerTalentFrame.Panel:WrapOuter(PlayerTalentFrame) - local panelLevel = PlayerTalentFrame:GetFrameLevel() - - if((panelLevel - 1) >= 0) then - PlayerTalentFrame.Panel:SetFrameLevel(panelLevel - 1) - else - PlayerTalentFrame.Panel:SetFrameLevel(0) - end + PlayerTalentFrame.Panel:SetFrameLevel(0) PlayerTalentFrame.Panel:SetPanelTemplate("Halftone") PlayerTalentFrame.Panel:Point("BOTTOMRIGHT", PlayerTalentFrame, "BOTTOMRIGHT", 0, -5) @@ -135,12 +129,12 @@ local function TalentFrameStyle() if(button) then button:Formula409() button:SetButtonTemplate() - local d, e, k, g = button:GetPoint() - button:Point(d, e, k, g, -28) + local initialAnchor, anchorParent, relativeAnchor, xPosition, yPosition = button:GetPoint() + button:SetPoint(initialAnchor, anchorParent, relativeAnchor, xPosition, -28) end end - PlayerTalentFrameTalents:SetFixedPanelTemplate('Transparent') + PlayerTalentFrameTalents:SetFixedPanelTemplate('FramedTop') PlayerTalentFrameTalentsClearInfoFrame:SetFixedPanelTemplate('Transparent') PlayerTalentFrameTalentsClearInfoFrame.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) PlayerTalentFrameTalentsClearInfoFrame:Width(PlayerTalentFrameTalentsClearInfoFrame:GetWidth()-2) @@ -148,50 +142,50 @@ local function TalentFrameStyle() PlayerTalentFrameTalentsClearInfoFrame.icon:Size(PlayerTalentFrameTalentsClearInfoFrame:GetSize()) PlayerTalentFrameTalentsClearInfoFrame:Point('TOPLEFT', PlayerTalentFrameTalents, 'BOTTOMLEFT', 8, -8) - for b = 1, 4 do - STYLE:ApplyTabStyle(_G['PlayerTalentFrameTab'..b]) - if b == 1 then - local d, e, k, g = _G['PlayerTalentFrameTab'..b]:GetPoint() - _G['PlayerTalentFrameTab'..b]:Point(d, e, k, g, -4) + for i = 1, 4 do + STYLE:ApplyTabStyle(_G["PlayerTalentFrameTab"..i]) + if i == 1 then + local d, e, k, g = _G["PlayerTalentFrameTab"..i]:GetPoint() + _G["PlayerTalentFrameTab"..i]:Point(d, e, k, g, -4) end end - hooksecurefunc('PlayerTalentFrame_UpdateTabs', function() - for b = 1, 4 do - local d, e, k, g = _G['PlayerTalentFrameTab'..b]:GetPoint() - _G['PlayerTalentFrameTab'..b]:Point(d, e, k, g, -4) + hooksecurefunc("PlayerTalentFrame_UpdateTabs", function() + for i = 1, 4 do + local d, e, k, g = _G["PlayerTalentFrameTab"..i]:GetPoint() + _G["PlayerTalentFrameTab"..i]:Point(d, e, k, g, -4) end end) PlayerTalentFrameSpecializationSpellScrollFrameScrollChild.Seperator:SetTexture(1, 1, 1) PlayerTalentFrameSpecializationSpellScrollFrameScrollChild.Seperator:SetAlpha(0.2) - for b = 1, 2 do - local v = _G['PlayerSpecTab'..b] - _G['PlayerSpecTab'..b..'Background']:MUNG() + for i = 1, 2 do + local v = _G["PlayerSpecTab"..i] + _G["PlayerSpecTab"..i.."Background"]:MUNG() ChangeTabHelper(v) end - hooksecurefunc('PlayerTalentFrame_UpdateSpecs', function() + hooksecurefunc("PlayerTalentFrame_UpdateSpecs", function() local d, x, f, g, h = PlayerSpecTab1:GetPoint() PlayerSpecTab1:Point(d, x, f, -1, h) end) - for b = 1, MAX_NUM_TALENT_TIERS do - local y = _G["PlayerTalentFrameTalentsTalentRow"..b] - _G["PlayerTalentFrameTalentsTalentRow"..b.."Bg"]:Hide() + for i = 1, MAX_NUM_TALENT_TIERS do + local y = _G["PlayerTalentFrameTalentsTalentRow"..i] + _G["PlayerTalentFrameTalentsTalentRow"..i.."Bg"]:Hide() y:DisableDrawLayer("BORDER") y:Formula409() y.TopLine:Point("TOP", 0, 4) y.BottomLine:Point("BOTTOM", 0, -4) for z = 1, NUM_TALENT_COLUMNS do - local A = _G["PlayerTalentFrameTalentsTalentRow"..b.."Talent"..z] - local B = _G["PlayerTalentFrameTalentsTalentRow"..b.."Talent"..z.."IconTexture"] + local A = _G["PlayerTalentFrameTalentsTalentRow"..i.."Talent"..z] + local B = _G["PlayerTalentFrameTalentsTalentRow"..i.."Talent"..z.."IconTexture"] if(A and B) then A:Formula409() A:SetFrameLevel(A:GetFrameLevel()+5) - STYLE:SetBasicBG(A) - A.BasicBG:WrapOuter(B) + A:SetBasicPanel() + A.Panel:WrapOuter(B) B:SetDrawLayer("OVERLAY") B:SetTexCoord(0.1, 0.9, 0.1, 0.9) A.bg = CreateFrame("Frame", nil, A) @@ -199,7 +193,7 @@ local function TalentFrameStyle() A.bg:Point("TOPLEFT", 15, -1) A.bg:Point("BOTTOMRIGHT", -10, 1) A.bg:SetFixedPanelTemplate("Default") - A.bg.SelectedTexture = A.bg:CreateTexture(nil, 'ARTWORK') + A.bg.SelectedTexture = A.bg:CreateTexture(nil, "ARTWORK") A.bg.SelectedTexture:Point("TOPLEFT", A, "TOPLEFT", 15, -1) A.bg.SelectedTexture:Point("BOTTOMRIGHT", A, "BOTTOMRIGHT", -10, 1) end @@ -356,7 +350,7 @@ local function GlyphStyle() GlyphFrame:Formula409() GlyphFrame.background:ClearAllPoints() GlyphFrame.background:SetAllPoints(PlayerTalentFrameInset) - GlyphFrame:SetFixedPanelTemplate("Comic", false, 0, 3, 3) + GlyphFrame:SetPanelTemplate("Comic", false, 0, 3, 3) GlyphFrameSideInset:Formula409() GlyphFrameClearInfoFrame:SetFixedPanelTemplate("Comic") GlyphFrameClearInfoFrame.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9 ) @@ -366,13 +360,13 @@ local function GlyphStyle() GlyphFrameClearInfoFrame:Point("TOPLEFT", GlyphFrame, "BOTTOMLEFT", 6, -10) STYLE:ApplyDropdownStyle(GlyphFrameFilterDropDown, 212) GlyphFrameSearchBox:SetEditboxTemplate() - STYLE:ApplyScrollStyle(GlyphFrameScrollFrameScrollBar, 5) + STYLE:ApplyScrollFrameStyle(GlyphFrameScrollFrameScrollBar, 5) for b = 1, 10 do local e = _G["GlyphFrameScrollFrameButton"..b] local icon = _G["GlyphFrameScrollFrameButton"..b.."Icon"] e:Formula409() - STYLE:ApplyLinkButtonStyle(e) + STYLE:ApplyItemButtonStyle(e) icon:SetTexCoord(0.1, 0.9, 0.1, 0.9 ) end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/taxi.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/taxi.lua index 94a9559..5a5c6ed 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/taxi.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/taxi.lua @@ -26,8 +26,10 @@ local function TaxiStyle() end; TaxiFrame:Formula409() TaxiFrame:SetPanelTemplate("Default") - STYLE:SetBasicBG(TaxiRouteMap) - TaxiRouteMap.BasicBG:WrapOuter(TaxiRouteMap, 4, 4) + + TaxiRouteMap:SetBasicPanel() + TaxiRouteMap.Panel:WrapOuter(TaxiRouteMap, 4, 4) + STYLE:ApplyCloseButtonStyle(TaxiFrame.CloseButton) end; --[[ diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/ACP.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/ACP.lua index 2b4e388..a225e8b 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/ACP.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/ACP.lua @@ -80,7 +80,7 @@ local function StyleACP() end; for c=1,20 do _G["ACP_AddonListEntry"..c.."Enabled"]:SetCheckboxTemplate(true)end; ACP_AddonList_NoRecurse:SetCheckboxTemplate(true) - STYLE:ApplyScrollStyle(ACP_AddonList_ScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(ACP_AddonList_ScrollFrameScrollBar) STYLE:ApplyDropdownStyle(ACP_AddonListSortDropDown) ACP_AddonListSortDropDown:Width(130) ACP_AddonList_ScrollFrame:SetWidth(590) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AdiBags.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AdiBags.lua index ab23932..500109e 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AdiBags.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AdiBags.lua @@ -43,7 +43,7 @@ local function StyleAdiBags(event) local function SkinFrame(frame) local region = frame.HeaderRightRegion - STYLE:SetBasicBG(frame) + frame:SetBasicPanel() _G[frame:GetName()..'Bags']:SetPanelTemplate("Default") for i = 1, 3 do region.widgets[i].widget:SetButtonTemplate() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Altoholic.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Altoholic.lua index a673cf8..17fa321 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Altoholic.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Altoholic.lua @@ -73,10 +73,10 @@ local function StyleAltoholic(event, addon) STYLE:ApplyFrameStyle(AltoholicFrameBagUsage) STYLE:ApplyFrameStyle(AltoholicFrameSkills) STYLE:ApplyFrameStyle(AltoholicFrameActivity) - STYLE:ApplyScrollbarStyle(AltoholicFrameSummaryScrollFrameScrollBar) - STYLE:ApplyScrollbarStyle(AltoholicFrameBagUsageScrollFrameScrollBar) - STYLE:ApplyScrollbarStyle(AltoholicFrameSkillsScrollFrameScrollBar) - STYLE:ApplyScrollbarStyle(AltoholicFrameActivityScrollFrameScrollBar) + STYLE:ApplyScrollBarStyle(AltoholicFrameSummaryScrollFrameScrollBar) + STYLE:ApplyScrollBarStyle(AltoholicFrameBagUsageScrollFrameScrollBar) + STYLE:ApplyScrollBarStyle(AltoholicFrameSkillsScrollFrameScrollBar) + STYLE:ApplyScrollBarStyle(AltoholicFrameActivityScrollFrameScrollBar) STYLE:ApplyDropdownStyle(AltoholicTabSummary_SelectLocation, 200) if(AltoholicFrameSummaryScrollFrame) then @@ -122,9 +122,9 @@ local function StyleAltoholic(event, addon) STYLE:ApplyFrameStyle(AltoholicFrameSpellbook) STYLE:ApplyFrameStyle(AltoholicFramePets) STYLE:ApplyFrameStyle(AltoholicFrameAuctions) - STYLE:ApplyScrollbarStyle(AltoholicFrameContainersScrollFrameScrollBar) - STYLE:ApplyScrollbarStyle(AltoholicFrameQuestsScrollFrameScrollBar) - STYLE:ApplyScrollbarStyle(AltoholicFrameRecipesScrollFrameScrollBar) + STYLE:ApplyScrollBarStyle(AltoholicFrameContainersScrollFrameScrollBar) + STYLE:ApplyScrollBarStyle(AltoholicFrameQuestsScrollFrameScrollBar) + STYLE:ApplyScrollBarStyle(AltoholicFrameRecipesScrollFrameScrollBar) STYLE:ApplyDropdownStyle(AltoholicFrameTalents_SelectMember) STYLE:ApplyDropdownStyle(AltoholicTabCharacters_SelectRealm) STYLE:ApplyPaginationStyle(AltoholicFrameSpellbookPrevPage) @@ -159,7 +159,7 @@ local function StyleAltoholic(event, addon) for i = 1, 7 do for j = 1, 14 do - STYLE:ApplyLinkButtonStyle(_G["AltoholicFrameContainersEntry"..i.."Item"..j]) + STYLE:ApplyItemButtonStyle(_G["AltoholicFrameContainersEntry"..i.."Item"..j]) _G["AltoholicFrameContainersEntry"..i.."Item"..j]:HookScript('OnShow', ColorAltoBorder) end end @@ -169,8 +169,8 @@ local function StyleAltoholic(event, addon) STYLE:ApplyUnderlayStyle(AltoholicFrameAchievements) AltoholicFrameAchievementsScrollFrame:Formula409(true) AltoholicAchievementsMenuScrollFrame:Formula409(true) - STYLE:ApplyScrollbarStyle(AltoholicFrameAchievementsScrollFrameScrollBar) - STYLE:ApplyScrollbarStyle(AltoholicAchievementsMenuScrollFrameScrollBar) + STYLE:ApplyScrollBarStyle(AltoholicFrameAchievementsScrollFrameScrollBar) + STYLE:ApplyScrollBarStyle(AltoholicAchievementsMenuScrollFrameScrollBar) STYLE:ApplyDropdownStyle(AltoholicTabAchievements_SelectRealm) AltoholicTabAchievements_SelectRealm:Point("TOPLEFT", AltoholicFrame, "TOPLEFT", 205, -57) @@ -191,7 +191,7 @@ local function StyleAltoholic(event, addon) if IsAddOnLoaded("Altoholic_Agenda") or addon == "Altoholic_Agenda" then STYLE:ApplyFrameStyle(AltoholicFrameCalendarScrollFrame) STYLE:ApplyFrameStyle(AltoholicTabAgendaMenuItem1) - STYLE:ApplyScrollbarStyle(AltoholicFrameCalendarScrollFrameScrollBar) + STYLE:ApplyScrollBarStyle(AltoholicFrameCalendarScrollFrameScrollBar) STYLE:ApplyPaginationStyle(AltoholicFrameCalendar_NextMonth) STYLE:ApplyPaginationStyle(AltoholicFrameCalendar_PrevMonth) STYLE:ApplyButtonStyle(AltoholicTabAgendaMenuItem1, true) @@ -204,7 +204,7 @@ local function StyleAltoholic(event, addon) if IsAddOnLoaded("Altoholic_Grids") or addon == "Altoholic_Grids" then AltoholicFrameGridsScrollFrame:Formula409(true) STYLE:ApplyUnderlayStyle(AltoholicFrameGrids) - STYLE:ApplyScrollbarStyle(AltoholicFrameGridsScrollFrameScrollBar) + STYLE:ApplyScrollBarStyle(AltoholicFrameGridsScrollFrameScrollBar) STYLE:ApplyDropdownStyle(AltoholicTabGrids_SelectRealm) STYLE:ApplyDropdownStyle(AltoholicTabGrids_SelectView) @@ -230,7 +230,7 @@ local function StyleAltoholic(event, addon) if IsAddOnLoaded("Altoholic_Guild") or addon == "Altoholic_Guild" then STYLE:ApplyFrameStyle(AltoholicFrameGuildMembers) STYLE:ApplyFrameStyle(AltoholicFrameGuildBank) - STYLE:ApplyScrollbarStyle(AltoholicFrameGuildMembersScrollFrameScrollBar) + STYLE:ApplyScrollBarStyle(AltoholicFrameGuildMembersScrollFrameScrollBar) AltoholicFrameGuildMembersScrollFrame:Formula409(true) for i = 1, 2 do @@ -239,12 +239,12 @@ local function StyleAltoholic(event, addon) for i = 1, 7 do for j = 1, 14 do - STYLE:ApplyLinkButtonStyle(_G["AltoholicFrameGuildBankEntry"..i.."Item"..j]) + STYLE:ApplyItemButtonStyle(_G["AltoholicFrameGuildBankEntry"..i.."Item"..j]) end end for i = 1, 19 do - STYLE:ApplyLinkButtonStyle(_G["AltoholicFrameGuildMembersItem"..i]) + STYLE:ApplyItemButtonStyle(_G["AltoholicFrameGuildMembersItem"..i]) end for i = 1, 5 do @@ -256,8 +256,8 @@ local function StyleAltoholic(event, addon) STYLE:ApplyUnderlayStyle(AltoholicFrameSearch, true) AltoholicFrameSearchScrollFrame:Formula409(true) AltoholicSearchMenuScrollFrame:Formula409(true) - STYLE:ApplyScrollbarStyle(AltoholicFrameSearchScrollFrameScrollBar) - STYLE:ApplyScrollbarStyle(AltoholicSearchMenuScrollFrameScrollBar) + STYLE:ApplyScrollBarStyle(AltoholicFrameSearchScrollFrameScrollBar) + STYLE:ApplyScrollBarStyle(AltoholicSearchMenuScrollFrameScrollBar) STYLE:ApplyDropdownStyle(AltoholicTabSearch_SelectRarity) STYLE:ApplyDropdownStyle(AltoholicTabSearch_SelectSlot) STYLE:ApplyDropdownStyle(AltoholicTabSearch_SelectLocation) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AtlasLoot.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AtlasLoot.lua index 004c1b0..cd01913 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AtlasLoot.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AtlasLoot.lua @@ -208,8 +208,8 @@ local function StyleAtlasLoot(event, addon) AtlasLootPanel.Titel:SetTextColor(23/255, 132/255, 209/255) AtlasLootPanel.Titel:SetPoint("BOTTOM", AtlasLootPanel.TitelBg, "BOTTOM", 0, 40) - STYLE:ApplyScrollStyle(AtlasLootCompareFrame_ScrollFrameItemFrameScrollBar) - STYLE:ApplyScrollStyle(AtlasLootCompareFrame_WishlistScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(AtlasLootCompareFrame_ScrollFrameItemFrameScrollBar) + STYLE:ApplyScrollFrameStyle(AtlasLootCompareFrame_WishlistScrollFrameScrollBar) AtlasLootDefaultFrame:HookScript("OnShow", AL_OnShow) AtlasLootCompareFrame:HookScript("OnShow", Compare_OnShow) AtlasLootPanel.timeLapse = 0; diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Bugsack.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Bugsack.lua index 6b44e49..0132037 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Bugsack.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Bugsack.lua @@ -39,9 +39,9 @@ BUGSACK local function StyleBugSack(event, addon) assert(BugSack, "AddOn Not Loaded") hooksecurefunc(BugSack, "OpenSack", function() - if BugSackFrame.BasicBG then return end + if BugSackFrame.Panel then return end BugSackFrame:Formula409() - STYLE:SetBasicBG(BugSackFrame) + BugSackFrame:SetBasicPanel() STYLE:ApplyTabStyle(BugSackTabAll) BugSackTabAll:SetPoint("TOPLEFT", BugSackFrame, "BOTTOMLEFT", 0, 1) STYLE:ApplyTabStyle(BugSackTabSession) @@ -49,7 +49,7 @@ local function StyleBugSack(event, addon) BugSackNextButton:SetButtonTemplate() BugSackSendButton:SetButtonTemplate() BugSackPrevButton:SetButtonTemplate() - STYLE:ApplyScrollbarStyle(BugSackScrollScrollBar) + STYLE:ApplyScrollBarStyle(BugSackScrollScrollBar) end) end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DBM.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DBM.lua index 89efad3..e08606b 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DBM.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DBM.lua @@ -77,7 +77,7 @@ local function StyleBars(self) frame:SetScale(bar.owner.options.Scale) end spark:SetAlpha(0) - spark:SetTexture(0,0,0,0) + spark:SetTexture("") icon1:SetTexCoord(0.1,0.9,0.1,0.9) icon1:ClearAllPoints() icon1:SetAllPoints(icon1.overlay) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DXE.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DXE.lua index 38c03e4..31f9cc1 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DXE.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DXE.lua @@ -41,7 +41,7 @@ DXE ]]-- local function StyleDXEBar(bar) bar:SetFixedPanelTemplate("Transparent") - bar.bg:SetTexture(0,0,0,0) + bar.bg:SetTexture("") bar.border.Show = SuperVillain.fubar bar.border:Hide() bar.statusbar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/LightHeaded.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/LightHeaded.lua index 126e8f3..a23da07 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/LightHeaded.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/LightHeaded.lua @@ -76,7 +76,7 @@ local function StyleLightHeaded() lhsub.next:SetHeight(16) lhsub.prev:SetPoint("RIGHT", lhsub.page, "LEFT", -25, 0) lhsub.next:SetPoint("LEFT", lhsub.page, "RIGHT", 25, 0) - STYLE:ApplyScrollStyle(LightHeadedScrollFrameScrollBar, 5) + STYLE:ApplyScrollFrameStyle(LightHeadedScrollFrameScrollBar, 5) lhsub.title:SetTextColor(23/255, 132/255, 209/255) lhframe.timeLapse = 0; diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Mogit.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Mogit.lua index 2b073ea..a1057e8 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Mogit.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Mogit.lua @@ -55,7 +55,7 @@ local function StyleMogItPreview() } for _, object in pairs(MogItGearSlots) do if _G["MogItPreview"..i..object] then - STYLE:ApplyLinkButtonStyle(_G["MogItPreview"..i..object]) + STYLE:ApplyItemButtonStyle(_G["MogItPreview"..i..object]) _G["MogItPreview"..i..object]:SetPushedTexture(nil) _G["MogItPreview"..i..object]:SetHighlightTexture(nil) end @@ -81,7 +81,7 @@ local function StyleMogIt() STYLE:ApplyCloseButtonStyle(MogItFiltersCloseButton) MogItFrameFiltersDefaults:Formula409(true) MogItFrameFiltersDefaults:SetButtonTemplate() - STYLE:ApplyScrollStyle(MogItScroll) - STYLE:ApplyScrollStyle(MogItFiltersScrollScrollBar) + STYLE:ApplyScrollFrameStyle(MogItScroll) + STYLE:ApplyScrollFrameStyle(MogItFiltersScrollScrollBar) end STYLE:SaveAddonStyle("MogIt", StyleMogIt) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Outfitter.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Outfitter.lua index 8acfaf2..7bee43f 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Outfitter.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Outfitter.lua @@ -65,7 +65,7 @@ local function StyleOutfitter() OutfitterFrameTab1:SetButtonTemplate() OutfitterFrameTab2:SetButtonTemplate() OutfitterFrameTab3:SetButtonTemplate() - STYLE:ApplyScrollStyle(OutfitterMainFrameScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(OutfitterMainFrameScrollFrameScrollBar) STYLE:ApplyCloseButtonStyle(OutfitterCloseButton) OutfitterNewButton:SetButtonTemplate() OutfitterEnableNone:SetButtonTemplate() @@ -107,7 +107,7 @@ local function StyleOutfitter() OutfitterShowOutfitBar:Point("TOPLEFT", OutfitterAutoSwitch, "BOTTOMLEFT", 0, -5) OutfitterEditScriptDialogDoneButton:SetButtonTemplate() OutfitterEditScriptDialogCancelButton:SetButtonTemplate() - STYLE:ApplyScrollStyle(OutfitterEditScriptDialogSourceScriptScrollBar) + STYLE:ApplyScrollFrameStyle(OutfitterEditScriptDialogSourceScriptScrollBar) STYLE:ApplyFrameStyle(OutfitterEditScriptDialogSourceScript,"Transparent") STYLE:ApplyFrameStyle(OutfitterEditScriptDialog) STYLE:ApplyCloseButtonStyle(OutfitterEditScriptDialog.CloseButton) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Recount.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Recount.lua index 736a240..5e7aece 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Recount.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Recount.lua @@ -42,7 +42,7 @@ local function NoColor(a) if q:GetObjectType()=='Texture'then q:SetDesaturated(true) if q:GetTexture()=='Interface\\DialogFrame\\UI-DialogBox-Corner'then - q:SetTexture(0,0,0,0) + q:SetTexture("") q:MUNG() end end @@ -102,7 +102,7 @@ local function StyleRecount() end end - STYLE:ApplyScrollStyle(Recount_MainWindow_ScrollBarScrollBar) + STYLE:ApplyScrollFrameStyle(Recount_MainWindow_ScrollBarScrollBar) Recount_MainWindow:HookScript('OnShow', function(self) if InCombatLockdown() then return end;if SuperVillain.CurrentlyDocked["Recount_MainWindow"] then SuperDockWindowRight:Show() end end) Recount.MainWindow.FileButton:HookScript('OnClick', function(self) if LibDropdownFrame0 then STYLE:ApplyFrameStyle(LibDropdownFrame0) end end) @@ -116,7 +116,7 @@ local function StyleRecount() Recount_ReportWindow.isStyled = true STYLE:ApplyFrameStyle(Recount_ReportWindow.Whisper) Recount_ReportWindow.ReportButton:SetButtonTemplate() - STYLE:ApplyScrollbarStyle(Recount_ReportWindow_Slider) + STYLE:ApplyScrollBarStyle(Recount_ReportWindow_Slider) Recount_ReportWindow_Slider:GetThumbTexture():Size(6,6) end) end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Skada.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Skada.lua index 00dd257..ae4d0d1 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Skada.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Skada.lua @@ -116,9 +116,9 @@ local function StyleSkada() if not SuperVillain.CurrentlyDocked["SkadaHolder"] or not SuperVillain.CurrentlyDocked["SkadaHolder2"] then return end for index, window in ipairs(Skada:GetWindows()) do if window:IsShown() then - SuperDockWindow:Show() + SuperDockWindowRight:Show() else - SuperDockWindow:Hide() + SuperDockWindowRight:Hide() end end end) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TradeSkillDW.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TradeSkillDW.lua index c95abd2..777bce6 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TradeSkillDW.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TradeSkillDW.lua @@ -62,7 +62,7 @@ local function StyleTradeSkillDW() end) TradeSkillFrame:Height(TradeSkillFrame:GetHeight() + 12) - STYLE:SetBasicBG(TradeSkillRankFrame) + TradeSkillRankFrame:SetBasicPanel() TradeSkillRankFrame:SetStatusBarTexture(SuperVillain.Media.bar.default) TradeSkillCreateButton:SetButtonTemplate() TradeSkillCancelButton:SetButtonTemplate() @@ -79,7 +79,7 @@ local function StyleTradeSkillDW() TradeSkillInputBox:SetEditboxTemplate() TradeSkillIncrementButton:Point("RIGHT", TradeSkillCreateButton, "LEFT", -13, 0) STYLE:ApplyCloseButtonStyle(TradeSkillFrameCloseButton) - STYLE:ApplyScrollStyle(TradeSkillDetailScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(TradeSkillDetailScrollFrameScrollBar) local once = false hooksecurefunc("TradeSkillFrame_SetSelection", function(id) TradeSkillSkillIcon:SetButtonTemplate() @@ -136,7 +136,7 @@ local function StyleTradeSkillDW() TradeSkillDW_QueueFrameDetailScrollFrameChildFrameReagent6:Formula409() TradeSkillDW_QueueFrameDetailScrollFrameChildFrameReagent7:Formula409() TradeSkillDW_QueueFrameDetailScrollFrameChildFrameReagent8:Formula409() - STYLE:ApplyScrollStyle(TradeSkillDW_QueueFrameDetailScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(TradeSkillDW_QueueFrameDetailScrollFrameScrollBar) TradeSkillListScrollFrame:Formula409() end STYLE:SaveAddonStyle("TradeSkillDW", StyleTradeSkillDW) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/VEM.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/VEM.lua index 3487c57..d56667f 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/VEM.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/VEM.lua @@ -84,7 +84,7 @@ local function StyleBars(self) end spark:SetAlpha(0) - spark:SetTexture(0,0,0,0) + spark:SetTexture("") icon1:SetTexCoord(0.1,0.9,0.1,0.9) icon1:ClearAllPoints() @@ -241,7 +241,7 @@ local function StyleVEM(event, addon) STYLE:ApplyTabStyle(VEM_GUI_OptionsFrameTab2) VEM_GUI_OptionsFrameOkay:SetButtonTemplate() VEM_GUI_OptionsFrameWebsiteButton:SetButtonTemplate() - STYLE:ApplyScrollStyle(VEM_GUI_OptionsFramePanelContainerFOVScrollBar) + STYLE:ApplyScrollFrameStyle(VEM_GUI_OptionsFramePanelContainerFOVScrollBar) STYLE:SafeEventRemoval("VEM", event) end end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/WeakAuras.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/WeakAuras.lua index 82ea63a..cfad321 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/WeakAuras.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/WeakAuras.lua @@ -36,6 +36,9 @@ local STYLE = _G.StyleVillain; WEAKAURAS ########################################################## ]]-- +local ProxyCreateFunc = function() return end; +local ProxyModifyFunc = function() return end; + local function Style_WeakAuras(frame) if not frame.Panel then STYLE:ApplyFrameStyle(frame,"Transparent") @@ -51,27 +54,29 @@ local function Style_WeakAuras(frame) end local function Create_WeakAuras(parent, data) - local region = WeakAuras.regionTypes.icon.OldCreate(parent, data) + local region = ProxyCreateFunc(parent, data) Style_WeakAuras(region) return region end local function Modify_WeakAuras(parent, region, data) - WeakAuras.regionTypes.icon.OldModify(parent, region, data) + ProxyModifyFunc(parent, region, data) Style_WeakAuras(region) end local function StyleWeakAuras() assert(WeakAuras, "AddOn Not Loaded") - WeakAuras.regionTypes.icon.OldCreate = WeakAuras.regionTypes.icon.create + ProxyCreateFunc = WeakAuras.regionTypes.icon.create + ProxyModifyFunc = WeakAuras.regionTypes.icon.modify + WeakAuras.regionTypes.icon.create = Create_WeakAuras - WeakAuras.regionTypes.icon.OldModify = WeakAuras.regionTypes.icon.modify WeakAuras.regionTypes.icon.modify = Modify_WeakAuras + for weakAura, _ in pairs(WeakAuras.regions) do if WeakAuras.regions[weakAura].regionType == 'icon' then Style_WeakAuras(WeakAuras.regions[weakAura].region) end end end -STYLE:SaveAddonStyle("WeakAuras", StyleWeakAuras) \ No newline at end of file +STYLE:SaveAddonStyle("WeakAuras", StyleWeakAuras, nil, true) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/timemanager.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/timemanager.lua index 1529b9d..f3d6d58 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/timemanager.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/timemanager.lua @@ -44,11 +44,14 @@ local function TimeManagerStyle() sWatch:Point("TOPLEFT", TimeManagerStopwatchCheck, 2, -2) sWatch:Point("BOTTOMRIGHT", TimeManagerStopwatchCheck, -2, 2) TimeManagerStopwatchCheck:SetHighlightTexture(sWatch) + StopwatchFrame:Formula409() - STYLE:SetBasicBG(StopwatchFrame) - StopwatchFrame.BasicBG:Point("TOPLEFT", 0, -17) - StopwatchFrame.BasicBG:Point("BOTTOMRIGHT", 0, 2) + StopwatchFrame:SetBasicPanel() + StopwatchFrame.Panel:Point("TOPLEFT", 0, -17) + StopwatchFrame.Panel:Point("BOTTOMRIGHT", 0, 2) + StopwatchTabFrame:Formula409() + STYLE:ApplyCloseButtonStyle(StopwatchCloseButton) STYLE:ApplyPaginationStyle(StopwatchPlayPauseButton) STYLE:ApplyPaginationStyle(StopwatchResetButton) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/tradeskill.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/tradeskill.lua index b53960c..85ab9dd 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/tradeskill.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/tradeskill.lua @@ -43,8 +43,8 @@ local function TradeSkillStyle() TradeSkillFilterButton.Panel:SetAllPoints() TradeSkillCreateAllButton:SetButtonTemplate() TradeSkillViewGuildCraftersButton:SetButtonTemplate() - STYLE:ApplyScrollStyle(TradeSkillListScrollFrameScrollBar) - STYLE:ApplyScrollStyle(TradeSkillDetailScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(TradeSkillListScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(TradeSkillDetailScrollFrameScrollBar) TradeSkillLinkButton:GetNormalTexture():SetTexCoord(0.25, 0.7, 0.37, 0.75) TradeSkillLinkButton:GetPushedTexture():SetTexCoord(0.25, 0.7, 0.45, 0.8) TradeSkillLinkButton:GetHighlightTexture():MUNG() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/trainer.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/trainer.lua index 50b2469..3d237c2 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/trainer.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/trainer.lua @@ -51,7 +51,7 @@ local function TrainerStyle() _G["ClassTrainerScrollFrameButton"..i].selectedTex:SetTexture(1, 1, 1, 0.3) _G["ClassTrainerScrollFrameButton"..i].selectedTex:FillInner() end; - STYLE:ApplyScrollStyle(ClassTrainerScrollFrameScrollBar, 5) + STYLE:ApplyScrollFrameStyle(ClassTrainerScrollFrameScrollBar, 5) for _,frame in pairs(ClassTrainerFrameList)do _G[frame]:Formula409() end; diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/transmog.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/transmog.lua index 175a916..f07a2f2 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/transmog.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/transmog.lua @@ -81,8 +81,8 @@ local function TransmogStyle() TransmogrifyConfirmationPopup:SetPanelTemplate("Pattern") TransmogrifyConfirmationPopup.Button1:SetButtonTemplate() TransmogrifyConfirmationPopup.Button2:SetButtonTemplate() - STYLE:ApplyLinkButtonStyle(TransmogrifyConfirmationPopupItemFrame1, true) - STYLE:ApplyLinkButtonStyle(TransmogrifyConfirmationPopupItemFrame2, true) + STYLE:ApplyItemButtonStyle(TransmogrifyConfirmationPopupItemFrame1, true) + STYLE:ApplyItemButtonStyle(TransmogrifyConfirmationPopupItemFrame2, true) end; --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/worldmap.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/worldmap.lua index b68b500..b2f1a32 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/worldmap.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/worldmap.lua @@ -80,7 +80,7 @@ local function WorldMap_OnShow() if not SuperVillain.db.SVMap.tinyWorldMap then BlackoutWorld:SetTexture(0, 0, 0, 1) else - BlackoutWorld:SetTexture(0,0,0,0) + BlackoutWorld:SetTexture("") end if WORLDMAP_SETTINGS.size == WORLDMAP_FULLMAP_SIZE then WorldMap_FullView() @@ -110,12 +110,13 @@ end WORLDMAP STYLER ########################################################## ]]-- -local function WorldMapQuestStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.worldmap ~= true then return end +local function WorldMapStyle() + if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.worldmap ~= true then return end + WorldMapFrame:SetFrameLevel(2) - STYLE:ApplyScrollStyle(WorldMapQuestScrollFrameScrollBar) - STYLE:ApplyScrollStyle(WorldMapQuestDetailScrollFrameScrollBar, 4) - STYLE:ApplyScrollStyle(WorldMapQuestRewardScrollFrameScrollBar, 4) + STYLE:ApplyScrollFrameStyle(WorldMapQuestScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(WorldMapQuestDetailScrollFrameScrollBar, 4) + STYLE:ApplyScrollFrameStyle(WorldMapQuestRewardScrollFrameScrollBar, 4) WorldMapFrame:SetPanelTemplate("Transparent") WorldMapFrame.Panel:SetFrameLevel(1) WorldMapFrame.backdrop = CreateFrame("Frame", nil, WorldMapFrame) @@ -129,9 +130,9 @@ local function WorldMapQuestStyle() STYLE:ApplyCloseButtonStyle(WorldMapFrameCloseButton) STYLE:ApplyCloseButtonStyle(WorldMapFrameSizeDownButton) STYLE:ApplyCloseButtonStyle(WorldMapFrameSizeUpButton) - WorldMapFrameSizeDownButton:SetFrameLevel(50) - WorldMapFrameSizeUpButton:SetFrameLevel(50) - WorldMapFrameCloseButton:SetFrameLevel(50) + WorldMapFrameSizeDownButton:SetFrameLevel(999) + WorldMapFrameSizeUpButton:SetFrameLevel(999) + WorldMapFrameCloseButton:SetFrameLevel(999) STYLE:ApplyDropdownStyle(WorldMapLevelDropDown) STYLE:ApplyDropdownStyle(WorldMapZoneMinimapDropDown) STYLE:ApplyDropdownStyle(WorldMapContinentDropDown) @@ -150,7 +151,7 @@ end STYLE LOADING ########################################################## ]]-- -STYLE:SaveCustomStyle(WorldMapQuestStyle) +STYLE:SaveCustomStyle(WorldMapStyle) --[[ function ArchaeologyDigSiteFrame_OnUpdate() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/worldstate.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/worldstate.lua index 1f809df..89573dd 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/worldstate.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/worldstate.lua @@ -26,7 +26,7 @@ local function WorldStateStyle() WorldStateScoreFrame:Formula409() WorldStateScoreFrame:SetPanelTemplate("Halftone") STYLE:ApplyCloseButtonStyle(WorldStateScoreFrameCloseButton) - STYLE:ApplyScrollStyle(WorldStateScoreScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(WorldStateScoreScrollFrameScrollBar) WorldStateScoreFrameInset:SetAlpha(0) WorldStateScoreFrameLeaveButton:SetButtonTemplate() for b = 1, 3 do diff --git a/Interface/AddOns/SVUI_StyleOMatic/common/methods.lua b/Interface/AddOns/SVUI_StyleOMatic/common/methods.lua index 4fa71fa..0646e07 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/common/methods.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/common/methods.lua @@ -39,93 +39,16 @@ local SuperVillain, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## -LOCAL FUNCTIONS + /$$$$$$$$/$$$$$$$ /$$$$$$ /$$ /$$ /$$$$$$$$ +| $$_____/ $$__ $$ /$$__ $$| $$$ /$$$| $$_____/ +| $$ | $$ \ $$| $$ \ $$| $$$$ /$$$$| $$ +| $$$$$ | $$$$$$$/| $$$$$$$$| $$ $$/$$ $$| $$$$$ +| $$__/ | $$__ $$| $$__ $$| $$ $$$| $$| $$__/ +| $$ | $$ \ $$| $$ | $$| $$\ $ | $$| $$ +| $$ | $$ | $$| $$ | $$| $$ \/ | $$| $$$$$$$$ +|__/ |__/ |__/|__/ |__/|__/ |__/|________/ ########################################################## ]]-- -local function Button_OnEnter(this) - this:SetBackdropColor(unpack(SuperVillain.Media.color.highlight)) -end - -local function Button_OnLeave(this) - this:SetBackdropColor(unpack(SuperVillain.Media.color.default)) -end - -local function Button_OnEnter2(this) - this:SetBackdropColor(unpack(SuperVillain.Media.color.highlight)) - this:SetBackdropBorderColor(unpack(SuperVillain.Media.color.highlight)) -end - -local function Button_OnLeave2(this) - this:SetBackdropColor(unpack(SuperVillain.Media.color.default)) - this:SetBackdropBorderColor(0,0,0,1) -end - -local function Tab_OnEnter(this) - this.backdrop:SetPanelColor("highlight") - this.backdrop:SetBackdropBorderColor(unpack(SuperVillain.Media.color.highlight)) -end - -local function Tab_OnLeave(this) - this.backdrop:SetPanelColor("dark") - this.backdrop:SetBackdropBorderColor(0,0,0,1) -end - -local function DD_OnClick(btn) - btn.func() - btn:GetParent():Hide() -end - -local function DD_OnEnter(btn) - btn.hoverTex:Show() -end - -local function DD_OnLeave(btn) - btn.hoverTex:Hide() -end - -local function CloseButton_OnEnter(this) - this:SetBackdropBorderColor(unpack(SuperVillain.Media.color.highlight)) -end - -local function CloseButton_OnLeave(this) - this:SetBackdropBorderColor(0,0,0,1) -end ---[[ -########################################################## -CORE FUNCTIONS -########################################################## -]]-- -function STYLE:SetBasicBG(this) - if(not this or (this and this.BasicBG)) then return end - - local currentLevel = this:GetFrameLevel() - if(currentLevel == 0) then - currentLevel = 1 - end - - local bg = CreateFrame("Frame", nil, this) - bg:SetAllPoints(this) - bg:SetFrameLevel(currentLevel - 1) - bg:SetBackdrop({ - bgFile = [[Interface\BUTTONS\WHITE8X8]], - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 1, - insets = - { - left = 1, - right = 1, - top = 1, - bottom = 1, - }, - }) - bg:SetBackdropColor(0,0,0,0.65) - bg:SetBackdropBorderColor(0,0,0) - - this.BasicBG = bg -end - function STYLE:ApplyFrameStyle(this, template, noStripping, fullStripping) if(not this or (this and this.Panel)) then return end if not noStripping then this:Formula409(fullStripping) end @@ -139,26 +62,38 @@ function STYLE:ApplyUnderlayStyle(this, template, noStripping, fullStripping) template = template or "Transparent" this:SetFixedPanelTemplate(template) end +--[[ +########################################################## + /$$$$$$$ /$$ /$$ /$$$$$$$$/$$$$$$$$/$$$$$$ /$$ /$$ +| $$__ $$| $$ | $$|__ $$__/__ $$__/$$__ $$| $$$ | $$ +| $$ \ $$| $$ | $$ | $$ | $$ | $$ \ $$| $$$$| $$ +| $$$$$$$ | $$ | $$ | $$ | $$ | $$ | $$| $$ $$ $$ +| $$__ $$| $$ | $$ | $$ | $$ | $$ | $$| $$ $$$$ +| $$ \ $$| $$ | $$ | $$ | $$ | $$ | $$| $$\ $$$ +| $$$$$$$/| $$$$$$/ | $$ | $$ | $$$$$$/| $$ \ $$ +|_______/ \______/ |__/ |__/ \______/ |__/ \__/ +########################################################## +]]-- +local Button_OnEnter = function(self) + self:SetBackdropColor(unpack(SuperVillain.Media.color.highlight)) +end + +local Button_OnLeave = function(self) + self:SetBackdropColor(unpack(SuperVillain.Media.color.default)) +end function STYLE:ApplyButtonStyle(this) if not this then return end this:SetButtonTemplate() end -function STYLE:ApplyEditBoxStyle(this, width, height) - if not this then return end - this:SetEditboxTemplate() - if width then this:Width(width) end - if height then this:Height(height) end +--[[ CLOSE BUTTON ]]-- +local CloseButton_OnEnter = function(self) + self:SetBackdropBorderColor(unpack(SuperVillain.Media.color.highlight)) end -function STYLE:ApplyTextureStyle(this) - if not this then return end - this:SetTexCoord(0.1, 0.9, 0.1, 0.9) - local parent = this:GetParent() - if(parent) then - this:FillInner(parent, 1, 1) - end +local CloseButton_OnLeave = function(self) + self:SetBackdropBorderColor(0,0,0,1) end function STYLE:ApplyCloseButtonStyle(this, anchor) @@ -173,53 +108,134 @@ function STYLE:ApplyCloseButtonStyle(this, anchor) end end -function STYLE:ApplyRotateStyle(this) - -- Do stuff -end +--[[ ITEM BUTTON ]]-- -function STYLE:ApplyScrollStyle(this) - if(not this or (this and this.appliedStyle)) then return end - if _G[this:GetName().."BG"]then - _G[this:GetName().."BG"]:SetTexture(0,0,0,0) - end - if _G[this:GetName().."Track"]then - _G[this:GetName().."Track"]:SetTexture(0,0,0,0) - end - if _G[this:GetName().."Top"]then - _G[this:GetName().."Top"]:SetTexture(0,0,0,0) - end - if _G[this:GetName().."Bottom"]then - _G[this:GetName().."Bottom"]:SetTexture(0,0,0,0) - end - if _G[this:GetName().."Middle"]then - _G[this:GetName().."Middle"]:SetTexture(0,0,0,0) +function STYLE:ApplyItemButtonStyle(frame, adjust, shrink) + if(not frame or (frame and frame.StyleHooked)) then return end + + local link = frame:GetName() + + frame:Formula409() + + if(not frame.Panel) then + if shrink then + frame:SetPanelTemplate("Button", true, 1, -2, -2) + else + frame:SetFixedPanelTemplate("Button") + end + end + + if(link) then + local nameObject = _G[("%sName"):format(link)] + local iconObject = _G[("%sIcon"):format(link)] or _G[("%sIconTexture"):format(link)] + local countObject = _G[("%sCount"):format(link)] + + if(nameObject) then nameObject:SetParent(frame.Panel) end + + if(iconObject and not frame.IconShadow) then + iconObject:SetTexCoord(0.1, 0.9, 0.1, 0.9) + + if adjust then + iconObject:FillInner(frame, 2, 2) + end + + frame.IconShadow = CreateFrame("Frame", nil, frame) + frame.IconShadow:WrapOuter(iconObject) + frame.IconShadow:SetBasicPanel(0,0,0,0,true) + + iconObject:SetParent(frame.IconShadow) + end + + if(countObject and not frame.CountRaised) then + local fg = CreateFrame("Frame", nil, frame) + fg:SetSize(120, 22) + fg:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", 0, -11) + fg:SetFrameLevel(frame:GetFrameLevel() + 30) + + countObject:SetParent(fg) + countObject:SetAllPoints(fg) + countObject:SetFont(SuperVillain.Shared:Fetch("font", SuperVillain.db.media.fonts.number), SuperVillain.db.media.fonts.size, "OUTLINE") + countObject:SetDrawLayer("ARTWORK", 7) + + frame.CountRaised = true + end end - if _G[this:GetName().."ScrollUpButton"] and _G[this:GetName().."ScrollDownButton"]then - _G[this:GetName().."ScrollUpButton"]:Formula409() - if not _G[this:GetName().."ScrollUpButton"].icon then - STYLE:ApplyPaginationStyle(_G[this:GetName().."ScrollUpButton"]) - SquareButton_SetIcon(_G[this:GetName().."ScrollUpButton"], "UP") - _G[this:GetName().."ScrollUpButton"]:Size(_G[this:GetName().."ScrollUpButton"]:GetWidth() + 7, _G[this:GetName().."ScrollUpButton"]:GetHeight() + 7) + frame:HookScript("OnEnter", Button_OnEnter) + frame:HookScript("OnLeave", Button_OnLeave) + + frame.StyleHooked = true +end +--[[ +########################################################## + /$$$$$$ /$$$$$$ /$$$$$$$ /$$$$$$ /$$ /$$ + /$$__ $$ /$$__ $$| $$__ $$ /$$__ $$| $$ | $$ +| $$ \__/| $$ \__/| $$ \ $$| $$ \ $$| $$ | $$ +| $$$$$$ | $$ | $$$$$$$/| $$ | $$| $$ | $$ + \____ $$| $$ | $$__ $$| $$ | $$| $$ | $$ + /$$ \ $$| $$ $$| $$ \ $$| $$ | $$| $$ | $$ +| $$$$$$/| $$$$$$/| $$ | $$| $$$$$$/| $$$$$$$$| $$$$$$$$ + \______/ \______/ |__/ |__/ \______/ |________/|________/ +########################################################## +--]] +function STYLE:ApplyScrollFrameStyle(this, scale) + if(not this or (this and this.StyleHooked)) then return end + + local scrollName = this:GetName() + local bg, track, top, bottom, mid, upButton, downButton + + + bg = _G[("%sBG"):format(scrollName)] + if(bg) then bg:SetTexture("") end + + track = _G[("%sTrack"):format(scrollName)] + if(track) then track:SetTexture("") end + + top = _G[("%sTop"):format(scrollName)] + if(top) then top:SetTexture("") end + + bottom = _G[("%sBottom"):format(scrollName)] + if(bottom) then bottom:SetTexture("") end + + mid = _G[("%sMiddle"):format(scrollName)] + if(mid) then mid:SetTexture("") end + + upButton = _G[("%sScrollUpButton"):format(scrollName)] + downButton = _G[("%sScrollDownButton"):format(scrollName)] + + if(upButton and downButton) then + upButton:Formula409() + if(not upButton.icon) then + local upW, upH = upButton:GetSize() + STYLE:ApplyPaginationStyle(upButton) + SquareButton_SetIcon(upButton, "UP") + upButton:Size(upW + scale, upH + scale) end - _G[this:GetName().."ScrollDownButton"]:Formula409() - if not _G[this:GetName().."ScrollDownButton"].icon then - STYLE:ApplyPaginationStyle(_G[this:GetName().."ScrollDownButton"]) - SquareButton_SetIcon(_G[this:GetName().."ScrollDownButton"], "DOWN") - _G[this:GetName().."ScrollDownButton"]:Size(_G[this:GetName().."ScrollDownButton"]:GetWidth() + 7, _G[this:GetName().."ScrollDownButton"]:GetHeight() + 7) + + downButton:Formula409() + if(not downButton.icon) then + local dnW, dnH = downButton:GetSize() + STYLE:ApplyPaginationStyle(downButton) + SquareButton_SetIcon(downButton, "DOWN") + downButton:Size(dnW + scale, dnH + scale) end - if not this.styledBackground then - this.styledBackground = CreateFrame("Frame", nil, this) - this.styledBackground:Point("TOPLEFT", _G[this:GetName().."ScrollUpButton"], "BOTTOMLEFT", 0, -1) - this.styledBackground:Point("BOTTOMRIGHT", _G[this:GetName().."ScrollDownButton"], "TOPRIGHT", 0, 1) - STYLE:SetBasicBG(this.styledBackground) + + if(not this.ScrollBG) then + this.ScrollBG = CreateFrame("Frame", nil, this) + this.ScrollBG:SetPoint("TOPLEFT", upButton, "BOTTOMLEFT", 0, -1) + this.ScrollBG:SetPoint("BOTTOMRIGHT", downButton, "TOPRIGHT", 0, 1) + this.ScrollBG:SetBasicPanel() end - this:SetThumbTexture("Interface\\Buttons\\UI-ScrollBar-Knob") + + if(this:GetThumbTexture()) then + this:SetThumbTexture("Interface\\Buttons\\UI-ScrollBar-Knob") + end end - this.appliedStyle = true + + this.StyleHooked = true end -function STYLE:ApplyScrollbarStyle(this) - if(not this or (this and this.appliedStyle)) then return end +function STYLE:ApplyScrollBarStyle(this) + if(not this or (this and this.StyleHooked) or (this and not this.GetOrientation)) then return end this:Formula409() this:SetThumbTexture("Interface\\Buttons\\UI-ScrollBar-Knob") @@ -239,113 +255,121 @@ function STYLE:ApplyScrollbarStyle(this) end end - local currentLevel = this:GetFrameLevel() - if(currentLevel == 0) then - currentLevel = 1 - end + this:SetBasicPanel() + this.Panel:SetBackdropBorderColor(0.2,0.2,0.2) - local bg = CreateFrame("Frame", nil, this) - bg:SetAllPoints(this) - bg:SetFrameLevel(currentLevel) - bg:SetBackdrop({ - bgFile = [[Interface\BUTTONS\WHITE8X8]], - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 1, - insets = - { - left = 1, - right = 1, - top = 1, - bottom = 1, - }, - }) - bg:SetBackdropColor(0,0,0) - bg:SetBackdropBorderColor(0.2,0.2,0.2) + this.StyleHooked = true +end +--[[ +########################################################## + /$$$$$$$$/$$$$$$ /$$$$$$$ /$$$$$$ +|__ $$__/$$__ $$| $$__ $$ /$$__ $$ + | $$ | $$ \ $$| $$ \ $$| $$ \__/ + | $$ | $$$$$$$$| $$$$$$$ | $$$$$$ + | $$ | $$__ $$| $$__ $$ \____ $$ + | $$ | $$ | $$| $$ \ $$ /$$ \ $$ + | $$ | $$ | $$| $$$$$$$/| $$$$$$/ + |__/ |__/ |__/|_______/ \______/ +########################################################## +--]] +local Tab_OnEnter = function(self) + self.backdrop:SetPanelColor("highlight") + self.backdrop:SetBackdropBorderColor(unpack(SuperVillain.Media.color.highlight)) +end - this.appliedStyle = true +local Tab_OnLeave = function(self) + self.backdrop:SetPanelColor("dark") + self.backdrop:SetBackdropBorderColor(0,0,0,1) end -local function TabHelper(this) - this:Formula409() - local nTex = this:GetNormalTexture() - if(nTex) then - nTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) - nTex:FillInner() - end - this.pushed = true; - this.backdrop = CreateFrame("Frame", nil, this) - this.backdrop:WrapOuter(this,1,1) - this.backdrop:SetFrameLevel(0) - this.backdrop:SetBackdrop({ - bgFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], - edgeSize = 3, - insets = { - left = 0, - right = 0, - top = 0, - bottom = 0 - } - }); - this.backdrop:SetBackdropColor(0,0,0,1) - this.backdrop:SetBackdropBorderColor(0,0,0,1) - this:HookScript("OnEnter",Tab_OnEnter) - this:HookScript("OnLeave",Tab_OnLeave) - - local a,b,c,d,e = this:GetPoint() - this:Point(a,b,c,1,e) -end; - -function STYLE:ApplyTabStyle(this, full) - if(not this or (this and this.appliedStyle)) then return end +function STYLE:ApplyTabStyle(this, addBackground) + if(not this or (this and this.StyleHooked)) then return end local tab = this:GetName(); - if _G[tab.."Left"] then _G[tab.."Left"]:SetTexture(0,0,0,0) end - if _G[tab.."LeftDisabled"] then _G[tab.."LeftDisabled"]:SetTexture(0,0,0,0) end - if _G[tab.."Right"] then _G[tab.."Right"]:SetTexture(0,0,0,0) end - if _G[tab.."RightDisabled"] then _G[tab.."RightDisabled"]:SetTexture(0,0,0,0) end - if _G[tab.."Middle"] then _G[tab.."Middle"]:SetTexture(0,0,0,0) end - if _G[tab.."MiddleDisabled"] then _G[tab.."MiddleDisabled"]:SetTexture(0,0,0,0) end - - if this.GetHighlightTexture and this:GetHighlightTexture()then - this:GetHighlightTexture():SetTexture(0,0,0,0) - else - this:Formula409() - end - if(full) then - TabHelper(this) + if _G[tab.."Left"] then _G[tab.."Left"]:SetTexture("") end + if _G[tab.."LeftDisabled"] then _G[tab.."LeftDisabled"]:SetTexture("") end + if _G[tab.."Right"] then _G[tab.."Right"]:SetTexture("") end + if _G[tab.."RightDisabled"] then _G[tab.."RightDisabled"]:SetTexture("") end + if _G[tab.."Middle"] then _G[tab.."Middle"]:SetTexture("") end + if _G[tab.."MiddleDisabled"] then _G[tab.."MiddleDisabled"]:SetTexture("") end + + if(this.GetHighlightTexture and this:GetHighlightTexture()) then + this:GetHighlightTexture():SetTexture("") end - local text = _G[tab.."Text"] - this.backdrop = CreateFrame("Frame", nil, this) - this.backdrop:FillInner(this, 10, 3) - this.backdrop:SetFixedPanelTemplate("Component", true) - this.backdrop:SetPanelColor("dark") - if(this:GetFrameLevel() > 0) then - this.backdrop:SetFrameLevel(this:GetFrameLevel() - 1) + this:Formula409() + + if(addBackground) then + local nTex = this:GetNormalTexture() + + if(nTex) then + nTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) + nTex:FillInner() + end + + this.pushed = true; + this.backdrop = CreateFrame("Frame", nil, this) + this.backdrop:WrapOuter(this,1,1) + this.backdrop:SetFrameLevel(0) + this.backdrop:SetBackdrop({ + bgFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], + edgeSize = 3, + insets = { + left = 0, + right = 0, + top = 0, + bottom = 0 + } + }); + this.backdrop:SetBackdropColor(0,0,0,1) + this.backdrop:SetBackdropBorderColor(0,0,0,1) + + local initialAnchor, anchorParent, relativeAnchor, xPosition, yPosition = this:GetPoint() + this:Point(initialAnchor, anchorParent, relativeAnchor, 1, yPosition) + else + this.backdrop = CreateFrame("Frame", nil, this) + this.backdrop:FillInner(this, 10, 3) + this.backdrop:SetFixedPanelTemplate("Component", true) + this.backdrop:SetPanelColor("dark") + + if(this:GetFrameLevel() > 0) then + this.backdrop:SetFrameLevel(this:GetFrameLevel() - 1) + end end - this:HookScript("OnEnter",Tab_OnEnter) - this:HookScript("OnLeave",Tab_OnLeave) - this.appliedStyle = true -end + this:HookScript("OnEnter", Tab_OnEnter) + this:HookScript("OnLeave", Tab_OnLeave) + + this.StyleHooked = true +end +--[[ +########################################################## + /$$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$$ +| $$__ $$ /$$__ $$ /$$__ $$| $$_____/ +| $$ \ $$| $$ \ $$| $$ \__/| $$ +| $$$$$$$/| $$$$$$$$| $$ /$$$$| $$$$$ +| $$____/ | $$__ $$| $$|_ $$| $$__/ +| $$ | $$ | $$| $$ \ $$| $$ +| $$ | $$ | $$| $$$$$$/| $$$$$$$$ +|__/ |__/ |__/ \______/ |________/ +########################################################## +--]] function STYLE:ApplyPaginationStyle(button, isVertical) - if(not button or (button and not button:GetName()) or (button and button.appliedStyle)) then return end + if(not button or (button and not button:GetName()) or (button and button.StyleHooked)) then return end local bName = button:GetName() local testName = bName:lower() local leftDown = ((bName and testName:find('left')) or testName:find('prev') or testName:find('decrement')) or false button:Formula409() - button:SetNormalTexture(0,0,0,0) + button:SetNormalTexture("") button:SetPushedTexture(0,0,0,0) button:SetHighlightTexture(0,0,0,0) - button:SetDisabledTexture(0,0,0,0) + button:SetDisabledTexture("") button:SetButtonTemplate() button:Size((button:GetWidth() - 7), (button:GetHeight() - 7)) @@ -388,15 +412,40 @@ function STYLE:ApplyPaginationStyle(button, isVertical) if leftDown then SquareButton_SetIcon(button,'LEFT') else SquareButton_SetIcon(button,'RIGHT')end end - button.appliedStyle = true + button.StyleHooked = true end +--[[ +########################################################## + /$$$$$$$ /$$$$$$$ /$$$$$$ /$$$$$$$ +| $$__ $$| $$__ $$ /$$__ $$| $$__ $$ +| $$ \ $$| $$ \ $$| $$ \ $$| $$ \ $$ +| $$ | $$| $$$$$$$/| $$ | $$| $$$$$$$/ +| $$ | $$| $$__ $$| $$ | $$| $$____/ +| $$ | $$| $$ \ $$| $$ | $$| $$ +| $$$$$$$/| $$ | $$| $$$$$$/| $$ +|_______/ |__/ |__/ \______/ |__/ + /$$$$$$$ /$$$$$$ /$$ /$$ /$$ /$$ +| $$__ $$ /$$__ $$| $$ /$ | $$| $$$ | $$ +| $$ \ $$| $$ \ $$| $$ /$$$| $$| $$$$| $$ +| $$ | $$| $$ | $$| $$/$$ $$ $$| $$ $$ $$ +| $$ | $$| $$ | $$| $$$$_ $$$$| $$ $$$$ +| $$ | $$| $$ | $$| $$$/ \ $$$| $$\ $$$ +| $$$$$$$/| $$$$$$/| $$/ \ $$| $$ \ $$ +|_______/ \______/ |__/ \__/|__/ \__/ +########################################################## +--]] +local DropDownButton_SetPoint = function(self, _, _, _, _, _, breaker) + if not breaker then + self:Point("RIGHT", self.AnchorParent, "RIGHT", -10, 3, true) + end +end function STYLE:ApplyDropdownStyle(this, width) - if(not this or (this and this.appliedStyle)) then return end + if(not this or (this and this.StyleHooked)) then return end local ddName = this:GetName(); - local ddText = _G[ddName.."Text"] - local ddButton = _G[ddName.."Button"] + local ddText = _G[("%sText"):format(ddName)] + local ddButton = _G[("%sButton"):format(ddName)] if not width then width = 155 end @@ -405,18 +454,14 @@ function STYLE:ApplyDropdownStyle(this, width) if(ddButton) then if(ddText) then - ddText:SetPoint("RIGHT", ddButton, "LEFT", -2, 0) + ddText:SetPoint("RIGHT", ddButton, "LEFT", 2, 0) end ddButton:ClearAllPoints() ddButton:Point("RIGHT", this, "RIGHT", -10, 3) ddButton.AnchorParent = this - hooksecurefunc(ddButton, "SetPoint", function(self, _, _, _, _, _, breaker) - if not breaker then - self:Point("RIGHT", self.AnchorParent, "RIGHT", -10, 3, true) - end - end) + hooksecurefunc(ddButton, "SetPoint", DropDownButton_SetPoint) STYLE:ApplyPaginationStyle(ddButton, true) @@ -426,95 +471,58 @@ function STYLE:ApplyDropdownStyle(this, width) end local bg = CreateFrame("Frame", nil, this) - bg:Point("TOPLEFT", this, "TOPLEFT", 20, -2) + bg:Point("TOPLEFT", this, "TOPLEFT", 18, -2) bg:Point("BOTTOMRIGHT", ddButton, "BOTTOMRIGHT", 2, -2) - bg:SetFrameLevel(currentLevel - 1) - bg:SetBackdrop({ - bgFile = [[Interface\BUTTONS\WHITE8X8]], - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 1, - insets = - { - left = 1, - right = 1, - top = 1, - bottom = 1, - }, - }) - bg:SetBackdropColor(0,0,0,0.75) - bg:SetBackdropBorderColor(0.2,0.2,0.2) + bg:SetBasicPanel() + bg:SetBackdropBorderColor(0.2,0.2,0.2) + this.Panel = bg end - this.appliedStyle = true -end - -function STYLE:ApplyLinkButtonStyle(this, adjust, shrink) - if(not this or (this and this.appliedStyle)) then return end - - local link = this:GetName() - this:Formula409() - - if shrink then - this:SetPanelTemplate("Button", true, 1, -2, -2) - else - this:SetFixedPanelTemplate("Button") - end - if link then - if _G[link.."Name"] then - _G[link.."Name"]:SetParent(this.Panel) - end - local icon = this.icon or this.IconTexture; - if _G[link.."IconTexture"] then - icon = _G[link.."IconTexture"] - elseif _G[link.."Icon"]then - icon = _G[link.."Icon"] - end - if icon then - icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - if adjust then - icon:FillInner(this, 2, 2) - end - local bg = CreateFrame("Frame", nil, this) - bg:WrapOuter(icon) - bg:SetFixedPanelTemplate("Transparent") - icon:SetParent(bg) - this.IconShadow = bg - end - if(_G[link.."Count"]) then - local fg = CreateFrame("Frame", nil, this) - fg:SetSize(120, 22) - fg:SetPoint("BOTTOMLEFT", this, "BOTTOMLEFT", 0, -11) - fg:SetFrameLevel(this:GetFrameLevel() + 30) - _G[link.."Count"]:SetParent(fg) - _G[link.."Count"]:SetAllPoints(fg) - _G[link.."Count"]:SetFontTemplate(SuperVillain.Media.font.numbers, 12, "OUTLINE", "LEFT") - _G[link.."Count"]:SetDrawLayer("ARTWORK",7) - end - end - this:HookScript("OnEnter",Button_OnEnter) - this:HookScript("OnLeave",Button_OnLeave) - this.appliedStyle = true + this.StyleHooked = true end +--[[ +########################################################## + /$$$$$$$$/$$$$$$ /$$$$$$ /$$ /$$$$$$$$/$$$$$$ /$$$$$$$ +|__ $$__/$$__ $$ /$$__ $$| $$ |__ $$__/_ $$_/| $$__ $$ + | $$ | $$ \ $$| $$ \ $$| $$ | $$ | $$ | $$ \ $$ + | $$ | $$ | $$| $$ | $$| $$ | $$ | $$ | $$$$$$$/ + | $$ | $$ | $$| $$ | $$| $$ | $$ | $$ | $$____/ + | $$ | $$ | $$| $$ | $$| $$ | $$ | $$ | $$ + | $$ | $$$$$$/| $$$$$$/| $$$$$$$$| $$ /$$$$$$| $$ + |__/ \______/ \______/ |________/|__/ |______/|__/ +########################################################## +--]] +local Tooltip_OnShow = function(self) + self:SetBackdrop({ + bgFile = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]], + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + edgeSize=1 + }) + self:SetBackdropColor(0,0,0,0.8) + self:SetBackdropBorderColor(0,0,0) +end function STYLE:ApplyTooltipStyle(frame) - if(not frame or (frame and frame.appliedStyle)) then return end - frame:HookScript('OnShow',function(this) - this:SetBackdrop({ - bgFile = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]], - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - edgeSize=1 - }) - this:SetBackdropColor(0,0,0,0.8) - this:SetBackdropBorderColor(0,0,0) - end) - frame.appliedStyle = true + if(not frame or (frame and frame.StyleHooked)) then return end + frame:HookScript('OnShow', Tooltip_OnShow) + frame.StyleHooked = true end - +--[[ +########################################################## + /$$$$$$ /$$ /$$$$$$$$ /$$$$$$$ /$$$$$$$$ + /$$__ $$| $$ | $$_____/| $$__ $$|__ $$__/ +| $$ \ $$| $$ | $$ | $$ \ $$ | $$ +| $$$$$$$$| $$ | $$$$$ | $$$$$$$/ | $$ +| $$__ $$| $$ | $$__/ | $$__ $$ | $$ +| $$ | $$| $$ | $$ | $$ \ $$ | $$ +| $$ | $$| $$$$$$$$| $$$$$$$$| $$ | $$ | $$ +|__/ |__/|________/|________/|__/ |__/ |__/ +########################################################## +--]] function STYLE:ApplyAlertStyle(frame) - if(not frame or (frame and frame.appliedStyle)) then return end + if(not frame or (frame and frame.StyleHooked)) then return end + local alertpanel = CreateFrame("Frame", nil, frame) alertpanel:SetAllPoints(frame) alertpanel:SetFrameLevel(frame:GetFrameLevel() - 1) @@ -522,12 +530,14 @@ function STYLE:ApplyAlertStyle(frame) bgFile = "Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\Alert\\ALERT-BG" }) alertpanel:SetBackdropColor(0.8, 0.2, 0.2) + --[[ LEFT ]]-- local left = alertpanel:CreateTexture(nil, "BORDER") left:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\Alert\\ALERT-LEFT") left:Point("TOPRIGHT", alertpanel,"TOPLEFT", 0, 0) left:Point("BOTTOMRIGHT", alertpanel, "BOTTOMLEFT", 0, 0) left:Width(frame:GetHeight()) + --[[ RIGHT ]]-- local right = alertpanel:CreateTexture(nil, "BORDER") right:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\Alert\\ALERT-RIGHT") @@ -535,12 +545,14 @@ function STYLE:ApplyAlertStyle(frame) right:Point("TOPLEFT", alertpanel,"TOPRIGHT", -1, 0) right:Point("BOTTOMLEFT", alertpanel, "BOTTOMRIGHT", -1, 0) right:Width(frame:GetHeight() * 2) + --[[ TOP ]]-- local top = alertpanel:CreateTexture(nil, "BORDER") top:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\Alert\\ALERT-TOP") top:Point("BOTTOMLEFT", alertpanel,"TOPLEFT", 0, 0) top:Point("BOTTOMRIGHT", alertpanel, "TOPRIGHT", 0, 0) top:Height(frame:GetHeight() * 0.5) + --[[ BOTTOM ]]-- local bottom = alertpanel:CreateTexture(nil, "BORDER") bottom:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\Alert\\ALERT-BOTTOM") @@ -548,5 +560,37 @@ function STYLE:ApplyAlertStyle(frame) bottom:Point("TOPRIGHT", alertpanel, "BOTTOMRIGHT", 0, 0) bottom:Width(frame:GetHeight() * 0.5) - frame.appliedStyle = true -end \ No newline at end of file + frame.StyleHooked = true +end +--[[ +########################################################## + /$$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ +| $$$ /$$$|_ $$_/ /$$__ $$ /$$__ $$ +| $$$$ /$$$$ | $$ | $$ \__/| $$ \__/ +| $$ $$/$$ $$ | $$ | $$$$$$ | $$ +| $$ $$$| $$ | $$ \____ $$| $$ +| $$\ $ | $$ | $$ /$$ \ $$| $$ $$ +| $$ \/ | $$ /$$$$$$| $$$$$$/| $$$$$$/ +|__/ |__/|______/ \______/ \______/ +########################################################## +--]] +function STYLE:ApplyEditBoxStyle(this, width, height) + if not this then return end + this:Formula409(true) + this:SetEditboxTemplate() + if width then this:Width(width) end + if height then this:Height(height) end +end + +function STYLE:ApplyTextureStyle(this) + if not this then return end + this:SetTexCoord(0.1, 0.9, 0.1, 0.9) + local parent = this:GetParent() + if(parent) then + this:FillInner(parent, 1, 1) + end +end + +function STYLE:ApplyRotateStyle(this) + -- Do stuff +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.lua b/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.lua new file mode 100644 index 0000000..cf69147 --- /dev/null +++ b/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.lua @@ -0,0 +1,660 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local type = _G.type; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local tinsert = _G.tinsert; +local tremove = _G.tremove; +local string = _G.string; +local math = _G.math; +local bit = _G.bit; +local table = _G.table; +--[[ STRING METHODS ]]-- +local format, find, lower, match = string.format, string.find, string.lower, string.match; +--[[ MATH METHODS ]]-- +local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; -- Basic +local fmod, modf, sqrt = math.fmod, math.modf, math.sqrt; -- Algebra +local atan2, cos, deg, rad, sin = math.atan2, math.cos, math.deg, math.rad, math.sin; -- Trigonometry +local min, huge, random = math.min, math.huge, math.random; -- Uncommon +local sqrt2, max = math.sqrt(2), math.max; +--[[ TABLE METHODS ]]-- +local tcopy, twipe, tsort, tconcat, tdump = table.copy, table.wipe, table.sort, table.concat, table.dump; +--[[ BINARY METHODS ]]-- +local band = bit.band; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SVUIAddOnName, PLUGIN = ...; +local SuperVillain, L = unpack(SVUI); + +PLUGIN = SuperVillain:Prototype(SVUIAddOnName) + +_G["TrackingVillain"] = PLUGIN; +--[[ +########################################################## +LOCALS AND BINDING +########################################################## +]]-- +BINDING_HEADER_SVUITRACK = "SuperVillain UI: Tracking Device"; + +local CONFIGS = SuperVillain.Configs +local NewHook = hooksecurefunc; +local playerGUID = UnitGUID('player') +local classColor = RAID_CLASS_COLORS +local radian90 = (3.141592653589793 / 2) * -1; +local GetDistance, GetTarget, GetFromPlayer; + +local SCHEMA = PLUGIN.___schema; +local VERSION = PLUGIN.___version; +--[[ +########################################################## +BUILD +########################################################## +]]-- +function SVUI_TrackingDoodad_OnLoad() + local frame = _G["SVUI_TrackingDoodad"] + frame.Border:SetGradient(unpack(SuperVillain.Media.gradient.dark)) + frame.Arrow:SetVertexColor(0.1, 0.8, 0.8) + frame.Range:SetFont(SuperVillain.Media.font.roboto, 14, "OUTLINE") + frame.Range:SetTextColor(1, 1, 1, 0.75) + SuperVillain.Animate:Orbit(frame.Radar, 8, true) + frame:RegisterForDrag("LeftButton"); +end + +do + local WORLDMAPAREA_DEFAULT_DUNGEON_FLOOR_IS_TERRAIN = 0x00000004 + local WORLDMAPAREA_VIRTUAL_CONTINENT = 0x00000008 + local DUNGEONMAP_MICRO_DUNGEON = 0x00000001 + local _failsafe, _cache, _dungeons, _transform = {}, {}, {}, {}; + + local _mapdata = { + [0] = { + height = 22266.74312, + system = -1, + width = 33400.121, + xOffset = 0, + yOffset = 0, + [1] = { + xOffset = -10311.71318, + yOffset = -19819.33898, + scale = 0.56089997291565, + }, + [0] = { + xOffset = -48226.86993, + yOffset = -16433.90283, + scale = 0.56300002336502, + }, + [571] = { + xOffset = -29750.89905, + yOffset = -11454.50802, + scale = 0.5949000120163, + }, + [870] = { + xOffset = -27693.71178, + yOffset = -29720.0585, + scale = 0.65140002965927, + }, + }, + } + + local _failsafeFunc = function(tbl, key) + if(type(key) == "number") then + return _failsafe; + else + return rawget(_failsafe, key); + end + end + + setmetatable(_failsafe, { xOffset = 0, height = 1, yOffset = 0, width = 1, __index = _failsafeFunc }); + setmetatable(_mapdata, _failsafe); + + for _, ID in ipairs(GetWorldMapTransforms()) do + local terrain, newterrain, _, _, transformMinY, transformMaxY, transformMinX, transformMaxX, offsetY, offsetX = GetWorldMapTransformInfo(ID) + if ( offsetX ~= 0 or offsetY ~= 0 ) then + _transform[ID] = { + terrain = terrain, + newterrain = newterrain, + BRy = -transformMinY, + TLy = -transformMaxY, + BRx = -transformMinX, + TLx = -transformMaxX, + offsetY = offsetY, + offsetX = offsetX, + } + end + end + + local function _getmapdata(t) + local chunk = {} + local mapName = GetMapInfo(); + local id = GetCurrentMapAreaID(); + local numFloors = GetNumDungeonMapLevels(); + chunk.mapName = mapName; + chunk.cont = (GetCurrentMapContinent()) or -100; + chunk.zone = (GetCurrentMapZone()) or -100; + chunk.numFloors = numFloors; + local _, TLx, TLy, BRx, BRy = GetCurrentMapZone(); + if(TLx and TLy and BRx and BRy and (TLx~=0 or TLy~=0 or BRx~=0 or BRy~=0)) then + chunk[0] = {}; + chunk[0].TLx = TLx; + chunk[0].TLy = TLy; + chunk[0].BRx = BRx; + chunk[0].BRy = BRy; + end + if(not chunk[0] and numFloors == 0 and (GetCurrentMapDungeonLevel()) == 1) then + numFloors = 1; + chunk.hiddenFloor = true; + end + if(numFloors > 0) then + for f = 1, numFloors do + SetDungeonMapLevel(f); + local _, TLx, TLy, BRx, BRy = GetCurrentMapDungeonLevel(); + if(TLx and TLy and BRx and BRy) then + chunk[f] = {}; + chunk[f].TLx = TLx; + chunk[f].TLy = TLy; + chunk[f].BRx = BRx; + chunk[f].BRy = BRy; + end + end + end + + t[id] = chunk; + end + + do + local continents = { GetMapContinents() }; + for C in pairs(continents) do + local zones = { GetMapZones(C) }; + continents[C] = zones; + local pass, error = pcall(SetMapZoom, C, 0) + if(pass) then + zones[0] = GetCurrentMapAreaID(); + _getmapdata(_cache); + for Z in ipairs(zones) do + SetMapZoom(C, Z); + zones[Z] = GetCurrentMapAreaID(); + _getmapdata(_cache); + end + end + end + + for _, id in ipairs(GetAreaMaps()) do + if not (_cache[id]) then + if(SetMapByID(id)) then + _getmapdata(_cache); + end + end + end + end + + for id, map in pairs(_cache) do + local terrain, _, _, _, _, _, _, _, _, flags = GetAreaMapInfo(id) + local origin = terrain; + local chunk = _mapdata[id]; + if not (chunk) then chunk = {}; end + if(map.numFloors > 0 or map.hiddenFloor) then + for f, coords in pairs(map) do + if(type(f) == "number" and f > 0) then + if not (chunk[f]) then + chunk[f] = {}; + end + local flr = chunk[f] + local TLx, TLy, BRx, BRy = -coords.BRx, -coords.BRy, -coords.TLx, -coords.TLy + if not (flr.width) then + flr.width = BRx - TLx + end + if not (flr.height) then + flr.height = BRy - TLy + end + if not (flr.xOffset) then + flr.xOffset = TLx + end + if not (flr.yOffset) then + flr.yOffset = TLy + end + end + end + for f = 1, map.numFloors do + if not (chunk[f]) then + if(f == 1 and map[0] and map[0].TLx and map[0].TLy and map[0].BRx and map[0].BRy and + band(flags, WORLDMAPAREA_DEFAULT_DUNGEON_FLOOR_IS_TERRAIN) == WORLDMAPAREA_DEFAULT_DUNGEON_FLOOR_IS_TERRAIN) then + chunk[f] = {}; + local flr = chunk[f] + local coords = map[0] + local TLx, TLy, BRx, BRy = -coords.TLx, -coords.TLy, -coords.BRx, -coords.BRy + flr.width = BRx - TLx + flr.height = BRy - TLy + flr.xOffset = TLx + flr.yOffset = TLy + end + end + end + if(map.hiddenFloor) then + chunk.width = chunk[1].width + chunk.height = chunk[1].height + chunk.xOffset = chunk[1].xOffset + chunk.yOffset = chunk[1].yOffset + end + else + local coords = map[0] + if(coords ~= nil) then + local TLx, TLy, BRx, BRy = -coords.TLx, -coords.TLy, -coords.BRx, -coords.BRy + for _, trans in pairs(_transform) do + if(trans.terrain == terrain) then + if((trans.TLx < TLx and BRx < trans.BRx) and (trans.TLy < TLy and BRy < trans.BRy)) then + TLx = TLx - trans.offsetX; + BRx = BRx - trans.offsetX; + BRy = BRy - trans.offsetY; + TLy = TLy - trans.offsetY; + terrain = trans.newterrain; + break; + end + end + end + if not (TLx==0 and TLy==0 and BRx==0 and BRy==0) then + if not (TLx < BRx) then + printError("Bad x-axis Orientation (Zone): ", id, TLx, BRx); + end + if not (TLy < BRy) then + printError("Bad y-axis Orientation (Zone): ", id, TLy, BRy); + end + end + if not (chunk.width) then + chunk.width = BRx - TLx + end + if not (chunk.height) then + chunk.height = BRy - TLy + end + if not (chunk.xOffset) then + chunk.xOffset = TLx + end + if not (chunk.yOffset) then + chunk.yOffset = TLy + end + end + end + if not (next(chunk, nil)) then + chunk = { xOffset = 0, height = 1, yOffset = 0, width = 1 }; + end + if not (chunk.origin) then + chunk.origin = origin; + end + _mapdata[id] = chunk; + if(chunk and chunk ~= _failsafe) then + if not (chunk.system) then + chunk.system = terrain; + end + if(map.cont > 0 and map.zone > 0) then + _dungeons[terrain] = {} + end + setmetatable(chunk, _failsafe); + end + end + + local function _getpos(map, mapFloor, x, y) + if (mapFloor ~= 0) then + map = rawget(map, mapFloor) or _dungeons[map.origin][mapFloor]; + end + x = x * map.width + map.xOffset; + y = y * map.height + map.yOffset; + return x, y; + end + + function GetDistance(map1, floor1, x1, y1, map2, floor2, x2, y2) + if not (map1 and map2) then return end + floor1 = floor1 or min(#_mapdata[map1], 1); + floor2 = floor2 or min(#_mapdata[map2], 1); + local dist, xDelta, yDelta, angle; + if(map1 == map2 and floor1 == floor2) then + local chunk = _mapdata[map1]; + local tmp = chunk + if(floor1 ~= 0) then + tmp = rawget(chunk, floor1) + end + local w,h = 1,1 + if(not tmp) then + if(_dungeons[chunk.origin] and _dungeons[chunk.origin][floor1]) then + chunk = _dungeons[chunk.origin][floor1] + w = chunk.width + h = chunk.height + else + w = 1 + h = 1 + end + else + w = chunk.width + h = chunk.height + end + xDelta = (x2 - x1) * (w or 1); + yDelta = (y2 - y1) * (h or 1); + else + local map1 = _mapdata[map1]; + local map2 = _mapdata[map2]; + if(map1.system == map2.system) then + x1, y1 = _getpos(map1, floor1, x1, y1); + x2, y2 = _getpos(map2, floor2, x2, y2); + xDelta = (x2 - x1); + yDelta = (y2 - y1); + else + local s1 = map1.system; + local s2 = map2.system; + if((map1==0 or _mapdata[0][s1]) and (map2 == 0 or _mapdata[0][s2])) then + x1, y1 = _getpos(map1, floor1, x1, y1); + x2, y2 = _getpos(map2, floor2, x2, y2); + if(map1 ~= 0) then + local cont1 = _mapdata[0][s1]; + x1 = (x1 - cont1.xOffset) * cont1.scale; + y1 = (y1 - cont1.yOffset) * cont1.scale; + end + if(map2 ~= 0) then + local cont2 = _mapdata[0][s2]; + x2 = (x2 - cont2.xOffset) * cont2.scale; + y2 = (y2 - cont2.yOffset) * cont2.scale; + end + xDelta = x2 - x1; + yDelta = y2 - y1; + end + end + end + + if(xDelta and yDelta) then + local playerAngle = GetPlayerFacing() + dist = sqrt(xDelta * xDelta + yDelta * yDelta); + angle = (radian90 - playerAngle) - atan2(yDelta, xDelta) + end + + return dist, angle; + end +end + +do + local function _findunit(unit, doNotCheckMap) + local x, y = GetPlayerMapPosition(unit); + if(x <= 0 and y <= 0) then + if(doNotCheckMap) then return; end + local lastMapID, lastFloor = GetCurrentMapAreaID(), GetCurrentMapDungeonLevel(); + SetMapToCurrentZone(); + x, y = GetPlayerMapPosition(unit); + if(x <= 0 and y <= 0) then + if(ZoomOut()) then + elseif(GetCurrentMapZone() ~= WORLDMAP_WORLD_ID) then + SetMapZoom(GetCurrentMapContinent()); + else + SetMapZoom(WORLDMAP_WORLD_ID); + end + x, y = GetPlayerMapPosition(unit); + if(x <= 0 and y <= 0) then + return; + end + end + local thisMapID, thisFloor = GetCurrentMapAreaID(), GetCurrentMapDungeonLevel(); + if(thisMapID ~= lastMapID or thisFloor ~= lastFloor) then + SetMapByID(lastMapID); + SetDungeonMapLevel(lastFloor); + end + return thisMapID, thisFloor, x, y; + end + return GetCurrentMapAreaID(), GetCurrentMapDungeonLevel(), x, y; + end + + local function _findplayer() + local x, y = GetPlayerMapPosition("player"); + if(x <= 0 and y <= 0) then + if(WorldMap and WorldMap:IsShown()) then return end + SetMapToCurrentZone(); + x, y = GetPlayerMapPosition("player"); + if(x <= 0 and y <= 0) then + if(ZoomOut()) then + elseif(GetCurrentMapZone() ~= WORLDMAP_WORLD_ID) then + SetMapZoom(GetCurrentMapContinent()); + else + SetMapZoom(WORLDMAP_WORLD_ID); + end + x, y = GetPlayerMapPosition("player"); + if(x <= 0 and y <= 0) then + return; + end + end + end + return GetCurrentMapAreaID(), GetCurrentMapDungeonLevel(), x, y; + end + + function GetTarget(unit, doNotCheckMap) + local plot1, plot2, plot3, plot4; + if unit == "player" or UnitIsUnit("player", unit) then + plot1, plot2, plot3, plot4 = _findplayer() + else + plot1, plot2, plot3, plot4 = _findunit(unit, doNotCheckMap or WorldMapFrame:IsVisible()) + end + if not (plot1 and plot4) then + return false + else + return true, plot1, plot2, plot3, plot4 + end + end + + function GetFromPlayer(unit, noMapLocation) + if(WorldMap and WorldMap:IsShown()) then return end + local plot3, plot4 = GetPlayerMapPosition("player"); + if(plot3 <= 0 and plot4 <= 0) then + SetMapToCurrentZone(); + plot3, plot4 = GetPlayerMapPosition("player"); + if(plot3 <= 0 and plot4 <= 0) then + if(ZoomOut()) then + elseif(GetCurrentMapZone() ~= WORLDMAP_WORLD_ID) then + SetMapZoom(GetCurrentMapContinent()); + else + SetMapZoom(WORLDMAP_WORLD_ID); + end + plot3, plot4 = GetPlayerMapPosition("player"); + if(plot3 <= 0 and plot4 <= 0) then + return; + end + end + end + + local plot1 = GetCurrentMapAreaID() + local plot2 = GetCurrentMapDungeonLevel() + + local plot5, plot6; + local plot7, plot8 = GetPlayerMapPosition(unit); + + if(noMapLocation and (plot7 <= 0 and plot8 <= 0)) then + local lastMapID, lastFloor = GetCurrentMapAreaID(), GetCurrentMapDungeonLevel(); + SetMapToCurrentZone(); + plot7, plot8 = GetPlayerMapPosition(unit); + if(plot7 <= 0 and plot8 <= 0) then + if(ZoomOut()) then + elseif(GetCurrentMapZone() ~= WORLDMAP_WORLD_ID) then + SetMapZoom(GetCurrentMapContinent()); + else + SetMapZoom(WORLDMAP_WORLD_ID); + end + plot7, plot8 = GetPlayerMapPosition(unit); + if(plot7 <= 0 and plot8 <= 0) then + return; + end + end + plot5, plot6 = GetCurrentMapAreaID(), GetCurrentMapDungeonLevel(); + if(plot5 ~= lastMapID or plot6 ~= lastFloor) then + SetMapByID(lastMapID); + SetDungeonMapLevel(lastFloor); + end + local distance, angle = GetDistance(plot1, plot2, plot3, plot4, plot5, plot6, plot7, plot8) + return distance, angle + end + + local distance, angle = GetDistance(plot1, plot2, plot3, plot4, plot1, plot2, plot7, plot8) + return distance, angle + end +end + +local function Triangulate(unit, noMapLocation) + local distance, angle = GetFromPlayer(unit, noMapLocation) + return distance, angle +end + +local function _calc(radius) + return 0.5 + cos(radius) / sqrt2, 0.5 + sin(radius) / sqrt2; +end + +local function ArrowSpin(texture, angle) + local LRx, LRy = _calc(angle + 0.785398163); + local LLx, LLy = _calc(angle + 2.35619449); + local ULx, ULy = _calc(angle + 3.92699082); + local URx, URy = _calc(angle - 0.785398163); + + texture:SetTexCoord(ULx, ULy, LLx, LLy, URx, URy, LRx, LRy); +end + +function PLUGIN:PLAYER_TARGET_CHANGED() + if not SVUI_TrackingDoodad then return end + if((UnitInParty("target") or UnitInRaid("target")) and not UnitIsUnit("target", "player")) then + SVUI_TrackingDoodad.Trackable = true + SVUI_TrackingDoodad:Show() + else + SVUI_TrackingDoodad.Trackable = false + end +end + +local TargetFrame_OnChange = function() + if not SVUI_TrackingDoodad then return end + if((UnitInParty("target") or UnitInRaid("target")) and not UnitIsUnit("target", "player")) then + SVUI_TrackingDoodad.Trackable = true + SVUI_TrackingDoodad:Show() + else + SVUI_TrackingDoodad.Trackable = false + end +end + +local Tracker_OnUpdate = function(self, elapsed) + if self.elapsed and self.elapsed > (self.throttle or 0.02) then + if(self.Trackable) then + local distance, angle = Triangulate("target", true) + local _ARROW = self.Arrow + local _SPINNER = self.Radar + local _TEXT = self.Range + local _BG = self.BG + if not angle then + _ARROW:SetAlpha(0) + else + local out = floor(tonumber(distance)) + ArrowSpin(_ARROW, angle) + if(out > 100) then + _ARROW:SetVertexColor(1,0.1,0.1) + _SPINNER:SetVertexColor(0.8,0.1,0.1,0.5) + _BG:SetVertexColor(0.8,0.4,0.1,0.5) + elseif(out > 40) then + _ARROW:SetVertexColor(1,0.8,0.1) + _SPINNER:SetVertexColor(0.8,0.8,0.1,0.5) + _BG:SetVertexColor(0.4,0.8,0.1,0.5) + elseif(out > 5) then + _ARROW:SetVertexColor(0.1,1,0.8) + _SPINNER:SetVertexColor(0.1,0.8,0.8,0.5) + _BG:SetVertexColor(0.1,0.8,0.1,0.5) + end + _ARROW:SetAlpha(1) + _TEXT:SetText(out) + end + else + self:Hide() + end + self.elapsed = 0 + self.throttle = 0.02 + else + self.elapsed = (self.elapsed or 0) + elapsed + end +end +--[[ +########################################################## +CORE +########################################################## +]]-- +local function LoadOptions() + SuperVillain.Options.args.plugins.args.pluginOptions.args[SCHEMA] = { + type = 'group', + name = L['Tracking Device'], + get = function(key)return SuperVillain.db[SCHEMA][key[#key]]end, + set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key]) end, + args = { + intro = { + order = 1, + type = 'description', + name = L["Options for the tracking device"] + }, + enable = { + type = "toggle", + order = 2, + name = L['Enable'], + desc = L['Enable/Disable the tracking device'], + get = function(key)return SuperVillain.db[SCHEMA][key[#key]] end, + set = function(key, value) SuperVillain.db[SCHEMA].enable = value; SuperVillain:StaticPopup_Show("RL_CLIENT") end + }, + fontSize = { + order = 3, + name = L["Font Size"], + desc = L["Set the font size of the range text"], + type = "range", + min = 6, + max = 22, + step = 1, + set = function(j,value) PLUGIN:ChangeDBVar(value,j[#j]); PLUGIN:UpdateLogWindow()end + } + } + } +end + +function PLUGIN:Load() + if(not SuperVillain.db[SCHEMA].enable) then return end + + local _TRACKER = _G.SVUI_TrackingDoodad + local _TARGET = _G.SVUI_Target + + if(_TRACKER and _TARGET) then + self.db = SuperVillain.db[SCHEMA] + + _TRACKER.Unit = SVUI_Target.unit + _TRACKER:SetParent(SVUI_Target) + _TRACKER:SetScript("OnUpdate", Tracker_OnUpdate) + + self:RegisterEvent("PLAYER_TARGET_CHANGED") + + _TRACKER:Hide() + + _TARGET:HookScript("OnShow", TargetFrame_OnChange) + + LoadOptions() + end +end + +CONFIGS[SCHEMA] = { + ["enable"] = true, + ["size"] = 75, + ["fontSize"] = 12, +} + +SuperVillain.Registry:NewPlugin(PLUGIN) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.toc b/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.toc new file mode 100644 index 0000000..8055941 --- /dev/null +++ b/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.toc @@ -0,0 +1,9 @@ +## Interface: 50400 +## Author: Munglunch +## Version: 4.084 +## Title: |cffFF9900SVUI |r|cffFFEF00Tracking Device|r +## Notes: Supervillain UI [|cff9911FFRaid & Party Member Tracking|r]. +## RequiredDeps: SVUI +## X-SVUI: SVTracker + +SVUI_TrackingDevice.xml diff --git a/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.xml b/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.xml new file mode 100644 index 0000000..b25cf77 --- /dev/null +++ b/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.xml @@ -0,0 +1,50 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Script file='SVUI_TrackingDevice.lua'/> + + <Frame name="SVUI_TrackingDoodad" movable="true" frameStrata="DIALOG"> + <Size x="75" y="75"/> + <Anchors> + <Anchor point="CENTER" relativeTo="UIParent" relativePoint="CENTER"/> + </Anchors> + <Layers> + <Layer level="BACKGROUND"> + <Texture parentKey="BG" setAllPoints="true" file="Interface\AddOns\SVUI_TrackingDevice\artwork\DOODAD-BG"/> + </Layer> + <Layer level="BORDER"> + <Texture parentKey="Border" setAllPoints="true" file="Interface\AddOns\SVUI_TrackingDevice\artwork\DOODAD-BORDER"/> + <Texture parentKey="Arrow" file="Interface\AddOns\SVUI_TrackingDevice\artwork\DOODAD-ARROW"> + <Size x="40" y="40"/> + <Anchors> + <Anchor point="CENTER" relativeTo="$parent" relativePoint="CENTER"/> + </Anchors> + </Texture> + </Layer> + <Layer level="OVERLAY"> + <Texture parentKey="Radar" file="Interface\AddOns\SVUI_TrackingDevice\artwork\DOODAD-RADAR"> + <Size x="75" y="75"/> + <Anchors> + <Anchor point="CENTER" relativeTo="$parent" relativePoint="CENTER"/> + </Anchors> + </Texture> + </Layer> + <Layer level="ARTWORK"> + <FontString parentKey="Range" inherits="GameFontNormal"> + <Anchors> + <Anchor point="TOP" relativeTo="$parent" relativePoint="BOTTOM"/> + </Anchors> + </FontString> + </Layer> + </Layers> + <Scripts> + <OnLoad function="SVUI_TrackingDoodad_OnLoad"/> + <OnDragStart> + _G["SVUI_TrackingDoodad"].moving = true; + _G["SVUI_TrackingDoodad"]:StartMoving(); + </OnDragStart> + <OnDragStop> + _G["SVUI_TrackingDoodad"].moving = nil; + _G["SVUI_TrackingDoodad"]:StopMovingOrSizing(); + </OnDragStop> + </Scripts> + </Frame> +</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-ARROW.blp b/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-ARROW.blp new file mode 100644 index 0000000..b20f63d Binary files /dev/null and b/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-ARROW.blp differ diff --git a/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-BG.blp b/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-BG.blp new file mode 100644 index 0000000..7f60ca2 Binary files /dev/null and b/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-BG.blp differ diff --git a/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-BORDER.blp b/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-BORDER.blp new file mode 100644 index 0000000..8bc4525 Binary files /dev/null and b/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-BORDER.blp differ diff --git a/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-RADAR.blp b/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-RADAR.blp new file mode 100644 index 0000000..53d920b Binary files /dev/null and b/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-RADAR.blp differ