diff --git a/Interface/AddOns/SVUI/SVUI.lua b/Interface/AddOns/SVUI/SVUI.lua index 7870806..0a1eac1 100644 --- a/Interface/AddOns/SVUI/SVUI.lua +++ b/Interface/AddOns/SVUI/SVUI.lua @@ -35,35 +35,46 @@ local format, find, match, gsub = string.format, string.find, string.match, stri --[[ MATH METHODS ]]-- local floor = math.floor --[[ TABLE METHODS ]]-- -local tsort, tconcat = table.sort, table.concat; ---[[ -########################################################## -ADDON DATA -########################################################## -]]-- -local SVUI = {}; +local twipe, tsort, tconcat = table.wipe, table.sort, table.concat; + +--[[ LOCALS ]]-- + local SVUINameSpace, SVUICore = ...; -local version = GetAddOnMetadata(..., "Version"); -local build = select(2, GetBuildInfo()); -local playerName = UnitName("player"); -local playerRealm = GetRealmName(); -local SetAddonCore; +local SVUIVersion = GetAddOnMetadata(..., "Version"); +local clientVersion, internalVersion, releaseDate, uiVersion = GetBuildInfo(); local callbacks = {}; local numCallbacks = 0; ---[[ -########################################################## -CONSTANTS -########################################################## -]]-- -BINDING_HEADER_SVUI = "SuperVillain UI"; +local playerClass = select(2,UnitClass("player")); +local dumb = function() return end + +local messagePattern = "|cffFF2F00%s:|r" +local debugPattern = "|cffFF2F00%s|r [|cff992FFF%s|r]|cffFF2F00:|r" +local PLUGIN_LISTING = ""; +local ModuleQueue, ScriptQueue = {},{}; + +local INFO_BY = "%s |cff0099FFby %s|r"; +local INFO_VERSION = "%s%s |cff33FF00Version: %s|r"; +local INFO_NAME = "Plugins"; +local INFO_HEADER = "Supervillain UI (version %.3f): Plugins"; + +if GetLocale() == "ruRU" then + INFO_BY = "%s |cff0099FFот %s|r"; + INFO_VERSION = "%s%s |cff33FF00Версия: %s|r"; + INFO_NAME = "Плагины"; + INFO_HEADER = "Supervillain UI (устарела %.3f): Плагины"; +end + +local actualWidth, actualHeight = UIParent:GetSize() + +--[[ 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 @@ -77,11 +88,56 @@ function enforce(condition, ...) end end local assert = enforce; ---[[ -########################################################## -LOCAL FUNCTIONS -########################################################## -]]-- + +--[[ META METHODS ]]-- + +local rootstring = function(self) return self.___addonName end + +--[[ ENSURE META METHODS ]]-- + +local function SaveMetaMethods(obj) + local mt = {} + local old = getmetatable(obj) + if old then + for k, v in pairs(old) do mt[k] = v end + end + mt.__tostring = rootstring + setmetatable(obj, mt) +end + +--[[ LOCALIZATION HELPERS ]]-- + +local failsafe = function() assert(false) end + +local metaread = { + __index = function(self, key) + rawset(self, key, key) + return key + end +} + +local activeLocale + +local defaultwrite = setmetatable({}, { + __newindex = function(self, key, value) + if not rawget(activeLocale, key) then + rawset(activeLocale, key, value == true and key or value) + end + end, + __index = failsafe +}) + +local metawrite = setmetatable({}, { + __newindex = function(self, key, value) + rawset(activeLocale, key, value == true and key or value) + end, + __index = failsafe +}) + +local Localization = setmetatable({}, metaread); + +--[[ CLASS COLOR LOCALS ]]-- + local function formatValueString(text) if "string" == type(text) then text = gsub(text,"\n","\\n") @@ -93,14 +149,16 @@ local function formatValueString(text) else return tostring(text); end -end +end + local function formatKeyString(text) if "string"==type(text) and match(text,"^[_%a][_%a%d]*$") then return text; else return "["..formatValueString(text).."]"; end -end +end + local function RegisterCallback(self, m, h) assert(type(m) == "string" or type(m) == "function", "Bad argument #1 to :RegisterCallback (string or function expected)") if type(m) == "string" then @@ -110,7 +168,8 @@ local function RegisterCallback(self, m, h) end callbacks[m] = h or true numCallbacks = numCallbacks + 1 -end +end + local function UnregisterCallback(self, m, h) assert(type(m) == "string" or type(m) == "function", "Bad argument #1 to :UnregisterCallback (string or function expected)") if type(m) == "string" then @@ -120,7 +179,8 @@ local function UnregisterCallback(self, m, h) end callbacks[m] = nil numCallbacks = numCallbacks + 1 -end +end + local function DispatchCallbacks() if (numCallbacks < 1) then return end for m, h in pairs(callbacks) do @@ -129,12 +189,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 +234,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; @@ -248,58 +304,172 @@ function string.explode(str, delim) end return res end ---[[ -########################################################## -DEFINE REGISTRY HELPERS -########################################################## -]]-- -do - local PackageQueue, ScriptQueue = {},{}; - - local INFO_BY = "%s |cff0099FFby %s|r"; - local INFO_VERSION = "%s%s |cff33FF00Version: %s|r"; - local INFO_NAME = "Plugins"; - local INFO_HEADER = "SuperVillain UI (version %.3f): Plugins"; - - if GetLocale() == "ruRU" then - INFO_BY = "%s |cff0099FFот %s|r"; - INFO_VERSION = "%s%s |cff33FF00Версия: %s|r"; - INFO_NAME = "Плагины"; - INFO_HEADER = "SuperVillain UI (устарела %.3f): Плагины"; - end - - local rootstring = function(self) return self.___name end - - local changeDBVar = function(self, value, key, sub1, sub2, sub3) - local config = self.__owner.db[self.___name] - 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 - elseif((sub1 and sub2) and (config[sub1] and config[sub1][sub2])) then - self.__owner.db[self.___name][sub1][sub2][key] = value - elseif(sub1 and config[sub1]) then - self.__owner.db[self.___name][sub1][key] = value - else - self.__owner.db[self.___name][key] = value - end - self.db = self.__owner.db[self.___name] - if(self.UpdateLocals) then - self:UpdateLocals() - end + +--[[ CORE ENGINE CONSTRUCT ]]-- + +local Core_StaticPopup_Show = function(self, arg) + if arg == "ADDON_ACTION_FORBIDDEN" then + StaticPopup_Hide(arg) end +end - local innerOnEvent = function(self, event, ...) - local obj = self.__owner - if self[event] and type(self[event]) == "function" then - self[event](obj, event, ...) - end +local Core_ResetAllUI = function(self, confirmed) + if InCombatLockdown()then + SendAddonMessage(ERR_NOT_IN_COMBAT) + return + end + if(not confirmed) then + self:StaticPopup_Show('RESET_UI_CHECK') + return + end + self.Setup:Reset() +end + +local Core_ResetUI = function(self, confirmed) + if InCombatLockdown()then + SendAddonMessage(ERR_NOT_IN_COMBAT) + return + end + if(not confirmed) then + self:StaticPopup_Show('RESETMOVERS_CHECK') + return + end + self:ResetMovables() +end + +local Core_ToggleConfig = function(self) + if InCombatLockdown() then + SendAddonMessage(ERR_NOT_IN_COMBAT) + self.UIParent:RegisterEvent('PLAYER_REGEN_ENABLED') + return + end + if not IsAddOnLoaded("SVUI_ConfigOMatic") then + local _,_,_,_,_,state = GetAddOnInfo("SVUI_ConfigOMatic") + if state ~= "MISSING" and state ~= "DISABLED" then + LoadAddOn("SVUI_ConfigOMatic") + local config_version = GetAddOnMetadata("SVUI_ConfigOMatic", "Version") + if(tonumber(config_version) < 4) then + self:StaticPopup_Show("CLIENT_UPDATE_REQUEST") + end + else + self:AddonMessage("|cffff0000Error -- Addon 'SVUI_ConfigOMatic' not found or is disabled.|r") + return + end + end + local aceConfig = LibStub("AceConfigDialog-3.0") + local switch = not aceConfig.OpenFrames["SVUI"] and "Open" or "Close" + aceConfig[switch](aceConfig, "SVUI") + GameTooltip:Hide() +end + +--/script SVUI[1]:TaintHandler("SVUI", "Script", "Function") +local Core_TaintHandler = function(self, taint, sourceName, sourceFunc) + if GetCVarBool('scriptErrors') ~= 1 then return end + local errorString = ("Error Captured: %s->%s->{%s}"):format(taint, sourceName or "Unknown", sourceFunc or "Unknown") + self:AddonMessage(errorString) + self:StaticPopup_Show("TAINT_RL") +end + +local function _sendmessage(msg, prefix) + if(type(msg) == "table") then + msg = tostring(msg) end - local registerEvent = function(self, eventname, eventfunc) - if not self.___eventframe then - self.___eventframe = CreateFrame("Frame", nil) - self.___eventframe.__owner = self - self.___eventframe:SetScript("OnEvent", innerOnEvent) - end + if(not msg) then return end + + if(prefix) then + local outbound = ("%s %s"):format(prefix, msg); + print(outbound) + else + print(msg) + end +end + +local Core_Debugger = function(self, msg) + if(not self.DebuggingMode) then return end + local outbound = (debugPattern):format("SVUI", "DEBUG") + _sendmessage(msg, outbound) +end + +local Core_AddonMessage = function(self, msg) + local outbound = (messagePattern):format("SVUI") + _sendmessage(msg, outbound) +end + +local Core_SetLocaleStrings = function(self, locale, isDefault) + local gameLocale = GetLocale() + if gameLocale == "enGB" then gameLocale = "enUS" end + + activeLocale = Localization + + if isDefault then + return defaultwrite + elseif(locale == GAME_LOCALE or locale == gameLocale) then + return metawrite + end +end + +local Core_Prototype = function(self, name) + local version = GetAddOnMetadata(name, "Version") + local schema = GetAddOnMetadata(name, "X-SVUI-Schema") + + self.Configs[schema] = {["enable"] = false} + + local obj = { + ___addonName = name, + ___version = version, + ___schema = schema + } + + local mt = {} + local old = getmetatable(obj) + if old then + for k, v in pairs(old) do mt[k] = v end + end + mt.__tostring = rootstring + setmetatable(obj, mt) + return obj +end + +--[[ REGISTRY CONSTRUCT ]]-- + +local changeDBVar = function(self, value, key, sub1, sub2, sub3) + 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 + core.db[schema][sub1][sub2][sub3][key] = value + elseif((sub1 and sub2) and (config[sub1] and config[sub1][sub2])) then + core.db[schema][sub1][sub2][key] = value + elseif(sub1 and config[sub1]) then + core.db[schema][sub1][key] = value + else + core.db[schema][key] = value + end + + self.db = core.db[schema] + + if(self.UpdateLocals) then + self:UpdateLocals() + end +end + +local innerOnEvent = function(self, event, ...) + local obj = self.module + if self[event] and type(self[event]) == "function" then + self[event](obj, event, ...) + end +end + +local registerEvent = function(self, eventname, eventfunc) + if not self.___eventframe then + self.___eventframe = CreateFrame("Frame", nil) + self.___eventframe.module = self + self.___eventframe:SetScript("OnEvent", innerOnEvent) + end + + if(not self.___eventframe[eventname]) then local fn = eventfunc if type(eventfunc) == "string" then fn = self[eventfunc] @@ -307,311 +477,474 @@ do fn = self[eventname] end self.___eventframe[eventname] = fn - self.___eventframe:RegisterEvent(eventname) end + + self.___eventframe:RegisterEvent(eventname) +end - local unregisterEvent = function(self, event, ...) - if(self.___eventframe) then - self.___eventframe:UnregisterEvent(event) - end +local unregisterEvent = function(self, event, ...) + if(self.___eventframe) then + self.___eventframe:UnregisterEvent(event) 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() - end +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 function SetNewComponent(obj, name, parent, plugin) - 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 ) - obj.___name = name - obj.__owner = parent - obj.initialized = false - obj.CombatLocked = false - obj.ChangeDBVar = changeDBVar - obj.RegisterEvent = registerEvent - obj.UnregisterEvent = unregisterEvent - if(not plugin) then - return obj +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 Registry_SetCallback = function(self, fn) - if(fn and type(fn) == "function") then - self.Callbacks[#self.Callbacks+1] = fn - end +local add_OptionsIndex = function(self, index, data) + local addonName = self.___addonName + local schema = self.___schema + local core = self.___core + local header = GetAddOnMetadata(addonName, "X-SVUI-Header") + + core.Options.args.plugins.args.pluginOptions.args[schema].args[index] = data +end + +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 SetInternalModule(obj, core, schema) + 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 Registry_NewScript = function(self, fn) - if(fn and type(fn) == "function") then - ScriptQueue[#ScriptQueue+1] = fn - end + 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 + obj.RegisterUpdate = registerUpdate + obj.UnregisterUpdate = unregisterUpdate + + return obj +end + +local function SetExternalModule(obj, core, schema, addonName, header, lod) + 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 ) + + obj.___addonName = addonName + obj.___schema = schema + obj.___header = header + obj.___core = core + obj.___lod = lod + + obj.initialized = false + obj.CombatLocked = false + obj.ChangeDBVar = changeDBVar + obj.RegisterEvent = registerEvent + obj.UnregisterEvent = unregisterEvent + obj.RegisterUpdate = registerUpdate + obj.UnregisterUpdate = unregisterUpdate + obj.AddOption = add_OptionsIndex + + if(lod) then + -- print("PLUGIN: " .. addonName) + core.Options.args.plugins.args.pluginOptions.args[schema] = { + type = "group", + name = header, + childGroups = "tree", + args = { + enable = { + order = 1, + type = "execute", + width = "full", + name = function() + local nameString = "Disable" + if(not IsAddOnLoaded(addonName)) then + nameString = "Enable" + end + return nameString + end, + func = function() + if(not IsAddOnLoaded(addonName)) then + local loaded, reason = LoadAddOn(addonName) + core:UpdateDatabase() + obj:ChangeDBVar(true, "enable") + else + obj:ChangeDBVar(false, "enable") + core:StaticPopup_Show("RL_CLIENT") + end + end, + } + } + } + else + core.Options.args.plugins.args.pluginOptions.args[schema] = { + type = "group", + name = header, + childGroups = "tree", + args = { + enable = { + order = 1, + type = "toggle", + name = "Enable", + get = function() return obj.db.enable end, + set = function(key, value) obj:ChangeDBVar(value, "enable"); core:StaticPopup_Show("RL_CLIENT") 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 + return obj +end - self.__owner[name] = SetNewComponent(obj, name, self.__owner) - - if(self.__owner.AddonLaunched) then - if(self.__owner[name].Load) then - self.__owner[name]:Load() - end +local Registry_NewCallback = function(self, fn) + if(fn and type(fn) == "function") then + self.Callbacks[#self.Callbacks+1] = fn + end +end + +local Registry_NewScript = function(self, fn) + if(fn and type(fn) == "function") then + ScriptQueue[#ScriptQueue+1] = fn + end +end + +local Registry_NewPackage = function(self, obj, schema) + local core = self.___core + if(core[schema]) then return end + + ModuleQueue[#ModuleQueue+1] = schema + self.Modules[#self.Modules+1] = schema + + core[schema] = SetInternalModule(obj, core, schema) + + 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 +local Registry_NewPlugin = function(self, obj) + local core = self.___core + local coreName = core.___addonName + local addonName = obj.___addonName + + if(addonName and addonName ~= coreName) then + local schema = GetAddOnMetadata(addonName, "X-SVUI-Schema"); + local header = GetAddOnMetadata(addonName, "X-SVUI-Header"); + local lod = IsAddOnLoadOnDemand(addonName) + if(not schema) then return end + + ModuleQueue[#ModuleQueue+1] = schema + self.Modules[#self.Modules+1] = schema + + SetPluginString(addonName) + + core[schema] = SetExternalModule(obj, core, schema, addonName, header, lod) + + if(core.AddonLaunched and core[schema].Load) then + core[schema]:Load() + --print(schema) end - return list end +end - 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 +local Registry_NewAddon = function(self, addonName, schema, header) + local core = self.___core + self.Addons[addonName] = schema; + + core.Options.args.plugins.args.pluginOptions.args[schema] = { + type = "group", + name = header, + childGroups = "tree", + args = { + enable = { + order = 1, + type = "execute", + width = "full", + name = function() + local nameString = "Disable" + if(not IsAddOnLoaded(addonName)) then + nameString = "Enable" + end + return nameString + end, + func = function() + if(not IsAddOnLoaded(addonName)) then + local loaded, reason = LoadAddOn(addonName) + core:UpdateDatabase() + core.db[schema].enable = true + self:LoadPackages() + else + core.db[schema].enable = false + core:StaticPopup_Show("RL_CLIENT") + end + end, } - if addon ~= self.__owner.___name then - local fetch = self:FetchPlugins() or "" - self.__owner.Options.args.plugins.args.pluginOptions.args.pluginlist.args.active.name = fetch - end - callbackFunc() + } + } +end + +local Registry_FetchAddons = function(self) + local addonCount = GetNumAddOns() + local core = self.___core + + for i = 1, addonCount do + local addonName, _, _, _, _, reason = GetAddOnInfo(i) + local lod = IsAddOnLoadOnDemand(i) + local header = GetAddOnMetadata(i, "X-SVUI-Header") + local schema = GetAddOnMetadata(i, "X-SVUI-Schema") + + if(lod and schema) then + self:NewAddon(addonName, schema, header) end + end +end - SetNewComponent(obj, name, self.__owner, true) +local Registry_RunCallbacks = function(self) + local callbacks = self.Callbacks + for i=1, #callbacks do + local fn = callbacks[i] + if(fn and type(fn) == "function") then + fn() + end end +end - local Registry_RunCallbacks = function(self) - for i=1, #self.Callbacks do - local fn = self.Callbacks[i] - if(fn and type(fn) == "function") then - fn() - end +local Registry_Update = function(self, name, dataOnly) + local core = self.___core + local obj = core[name] + if obj then + if core.db[name] then + obj.db = core.db[name] + end + if obj.ReLoad and not dataOnly then + obj:ReLoad() end end +end - local Registry_Update = function(self, name, dataOnly) - local obj = self.__owner[name] - if obj then - if self.__owner.db[name] then - obj.db = self.__owner.db[name] - end - if obj.ReLoad and not dataOnly then - obj:ReLoad() - end +local Registry_UpdateAll = function(self) + 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 end +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] - end - if obj and obj.ReLoad then - obj:ReLoad() +local Registry_LoadOnDemand = function(self) + local core = self.___core + local addons = self.Addons + for name,schema in pairs(addons) do + local config = core.db[schema] + if(config and (config.enable or config.enable ~= false)) then + if(not IsAddOnLoaded(name)) then + local loaded, reason = LoadAddOn(name) end + EnableAddOn(name) end end +end - local Registry_Load = function(self) - if not PackageQueue then return end - for i=1,#PackageQueue do - local name = PackageQueue[i] - local obj = self.__owner[name] - if obj and not obj.initialized then - if self.__owner.db[name] then - obj.db = self.__owner.db[name] - end - if obj.Load then - local halt = false - if(obj.db.incompatible) then - for addon,_ in pairs(obj.db.incompatible) do - if IsAddOnLoaded(addon) then halt = true end - end - end - if(not halt) then - obj:Load() - obj.Load = nil +local Registry_Load = function(self) + if not ModuleQueue then return end + local core = self.___core + + for i=1,#ModuleQueue do + local name = ModuleQueue[i] + local obj = core[name] + if obj and not obj.initialized then + if core.db[name] then + obj.db = core.db[name] + end + + if obj.Load then + local halt = false + if(obj.db.incompatible) then + for addon,_ in pairs(obj.db.incompatible) do + if IsAddOnLoaded(addon) then halt = true end end end - obj.initialized = true; - end - end + if(not halt) then + obj:Load() + obj.Load = nil + --print(name) + end + end + obj.initialized = true; + end + end - PackageQueue = nil + twipe(ModuleQueue) - if not ScriptQueue then return end - for i=1, #ScriptQueue do - local fn = ScriptQueue[i] - if(fn and type(fn) == "function") then - fn() - end - end + if not ScriptQueue then return end + for i=1, #ScriptQueue do + local fn = ScriptQueue[i] + if(fn and type(fn) == "function") then + fn() + end + end - ScriptQueue = nil - end - - --[[ GLOBAL NAMESPACE ]]-- - - function SetAddonCore(obj,n,v) - obj = { - ___name = n, - ___ver = v, - db = {}, - Global = { - Accountant = {}, - profiles = {}, - profileKeys = {}, - }, - Configs = {}, - Media = {}, - DisplayAudit = {}, - DynamicOptions = {}, - Dispellable = {}, - Snap = {}, - Options = { - type = "group", - name = "|cff339fffConfig-O-Matic|r", + ScriptQueue = nil +end +--[[ +##################################################################################### + /$$$$$$ /$$ /$$ /$$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$$$$$$$ + /$$__ $$| $$ | $$| $$ | $$|_ $$_/ /$$__ $$ /$$__ $$| $$__ $$| $$_____/ +| $$ \__/| $$ | $$| $$ | $$ | $$ | $$ \__/| $$ \ $$| $$ \ $$| $$ +| $$$$$$ | $$ / $$/| $$ | $$ | $$ | $$ | $$ | $$| $$$$$$$/| $$$$$ + \____ $$ \ $$ $$/ | $$ | $$ | $$ | $$ | $$ | $$| $$__ $$| $$__/ + /$$ \ $$ \ $$$/ | $$ | $$ | $$ | $$ $$| $$ | $$| $$ \ $$| $$ +| $$$$$$/ \ $/ | $$$$$$/ /$$$$$$ | $$$$$$/| $$$$$$/| $$ | $$| $$$$$$$$ + \______/ \_/ \______/ |______/ \______/ \______/ |__/ |__/|________/ +##################################################################################### +]]-- +local SVUI = { + ___addonName = SVUINameSpace, + ___version = GetAddOnMetadata(SVUINameSpace, "Version"), + ___interface = tonumber(uiVersion), + + db = {}, + Global = { Accountant = {}, profiles = {}, profileKeys = {} }, + Configs = {}, + Media = {}, + DisplayAudit = {}, + DynamicOptions = {}, + Dispellable = {}, + Snap = {}, + class = playerClass, + fubar = dumb, + ClassRole = "", + UnitRole = "NONE", + ConfigurationMode = false, + DebuggingMode = false, + EffectiveScale = 1, + ActualHeight = actualHeight, + ActualWidth = actualWidth, + yScreenArea = (actualHeight * 0.33), + xScreenArea = (actualWidth * 0.33), + SetLocaleStrings = Core_SetLocaleStrings, + Prototype = Core_Prototype, + AddonMessage = Core_AddonMessage, + Debugger = Core_Debugger, + StaticPopup_Show = Core_StaticPopup_Show, + ResetAllUI = Core_ResetAllUI, + ResetUI = Core_ResetUI, + ToggleConfig = Core_ToggleConfig, + TaintHandler = Core_TaintHandler, + Options = { + type = "group", + name = "|cff339fffConfig-O-Matic|r", + args = { + plugins = { + order = -2, + type = "group", + name = "Plugins", + childGroups = "tab", args = { - plugins = { - order = -2, + pluginheader = { + order = 1, + type = "header", + name = "Supervillain Plugins", + }, + pluginOptions = { + order = 2, type = "group", - name = "Plugins", - childGroups = "tab", + name = "", args = { - pluginheader = { + pluginlist = { order = 1, - type = "header", - name = "SuperVillain Plugins", - }, - pluginOptions = { - order = 2, type = "group", - name = "", + name = "Summary", args = { - pluginlist = { + active = { order = 1, - type = "group", - name = "Summary", - args = { - active = { - order = 1, - type = "description", - name = "" - } - } - }, + type = "description", + name = function() return PLUGIN_LISTING end + } } - } + }, } } } - }, - Registry = { - Packages = {}, - 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, - NewScript = Registry_NewScript, - NewPackage = Registry_NewPackage, - FetchPlugins = Registry_FetchPlugins, - NewPlugin = Registry_NewPlugin, - RunCallbacks = Registry_RunCallbacks, - Update = Registry_Update, - UpdateAll = Registry_UpdateAll, - LoadPackages = Registry_Load, } } - local mt = {} - local old = getmetatable(obj) - if old then - for k, v in pairs(old) do mt[k] = v end - end - mt.__tostring = rootstring - setmetatable(obj, mt) - - obj.Registry.__owner = obj - - return obj - end -end - -SVUI = SetAddonCore(SVUI, SVUINameSpace, version) - ---[[ LOCALIZATION HELPERS ]]-- -local failsafe = function() assert(false) end - -local metaread = { - __index = function(self, key) - rawset(self, key, key) - return key - end + } } -local activeLocale - -local defaultwrite = setmetatable({}, { - __newindex = function(self, key, value) - if not rawget(activeLocale, key) then - rawset(activeLocale, key, value == true and key or value) - end - end, - __index = failsafe -}) - -local metawrite = setmetatable({}, { - __newindex = function(self, key, value) - rawset(activeLocale, key, value == true and key or value) - end, - __index = failsafe -}) - -SVUI.Localization = setmetatable({}, metaread) - ---[[ MISC ]]-- -SVUI.fubar = function() return end -SVUI.class = select(2,UnitClass("player")); -SVUI.ClassRole = ""; -SVUI.ConfigurationMode = false; -SVUI.DebuggingMode = false ---[[ MISC ]]-- +SaveMetaMethods(SVUI) --[[ UTILITY FRAMES ]]-- + SVUI.UIParent = CreateFrame("Frame", "SVUIParent", UIParent); SVUI.UIParent:SetFrameLevel(UIParent:GetFrameLevel()); SVUI.UIParent:SetPoint("CENTER", UIParent, "CENTER"); @@ -620,68 +953,37 @@ SVUI.Snap[1] = SVUI.UIParent; SVUI.Cloaked = CreateFrame("Frame", nil, UIParent); SVUI.Cloaked:Hide(); ---[[ UTILITY FRAMES ]]-- - -function SVUI:SetLocaleStrings(locale, isDefault) - local gameLocale = GetLocale() - if gameLocale == "enGB" then gameLocale = "enUS" end - - activeLocale = self.Localization - - if isDefault then - return defaultwrite - elseif(locale == GAME_LOCALE or locale == gameLocale) then - return metawrite - end -end - -function SVUI:Prototype(n, v) - local obj = { - ___name = n, - ___ver = v - } - local mt = {} - local old = getmetatable(obj) - if old then - for k, v in pairs(old) do mt[k] = v end - end - mt.__tostring = rootstring - setmetatable(obj, mt) - return obj -end -do - local messagePattern = "|cffFF2F00%s:|r" - local debugPattern = "|cffFF2F00%s|r [|cff992FFF%s|r]|cffFF2F00:|r" - - local function _sendmessage(msg, prefix) - if(type(msg) == "table") then - msg = tostring(msg) - end - - if(not msg) then return end - - if(prefix) then - local outbound = ("%s %s"):format(prefix, msg); - print(outbound) - else - print(msg) - end - end +local Registry = { + ___core = SVUI, + Modules = {}, + Addons = {}, + Callbacks = {}, + INFO_VERSION = INFO_VERSION, + INFO_NEW = INFO_NEW, + INFO_NAME = INFO_NAME, + INFO_HEADER = INFO_HEADER, + NewCallback = Registry_NewCallback, + NewScript = Registry_NewScript, + NewPackage = Registry_NewPackage, + NewPlugin = Registry_NewPlugin, + NewAddon = Registry_NewAddon, + FindAddons = Registry_FetchAddons, + LoadRegisteredAddons = Registry_LoadOnDemand, + RunCallbacks = Registry_RunCallbacks, + Update = Registry_Update, + UpdateAll = Registry_UpdateAll, + LoadPackages = Registry_Load, +} - function SVUI:Debugger(msg) - if(not self.DebuggingMode) then return end - local outbound = (debugPattern):format("SVUI", "DEBUG") - _sendmessage(msg, outbound) - end +SaveMetaMethods(Registry) - function SVUI:AddonMessage(msg) - local outbound = (messagePattern):format("SVUI") - _sendmessage(msg, outbound) - end -end +--[[ COMMON FUNCTIONS ]]-- SVUICore[1] = SVUI -SVUICore[2] = SVUI.Localization +SVUICore[2] = Localization +SVUICore[3] = Registry + +--[[ 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 c8682c4..4e786df 100644 --- a/Interface/AddOns/SVUI/SVUI.toc +++ b/Interface/AddOns/SVUI/SVUI.toc @@ -1,12 +1,12 @@ ## Interface: 60000 ## Author: Munglunch -## Version: 5.02 +## Version: 4.4 ## Title: |cffFF9900SVUI|r ## Notes: Supervillain UI [|cff9911FFCore Framework|r]. ## SavedVariables: SVUI_Global ## SavedVariablesPerCharacter: SVUI_Profile, SVUI_Cache ## OptionalDeps: Blizzard_DebugTools, Blizzard_PetJournal, SharedMedia -## X-oUF: oUF_SuperVillain +## X-oUF: oUF_Villain ## X-Notes: Special thanks to Elv and Tukz for their incredible work. ## X-Email: munglunch@gmail.com diff --git a/Interface/AddOns/SVUI/SVUI.xml b/Interface/AddOns/SVUI/SVUI.xml index a162118..dbe1328 100644 --- a/Interface/AddOns/SVUI/SVUI.xml +++ b/Interface/AddOns/SVUI/SVUI.xml @@ -1,5 +1,7 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Script file="SVUI.lua"/> + <Frame name="SVUI_PanelTemplate" virtual="true" toplevel="true"> <Layers> <Layer level="BACKGROUND"> @@ -94,8 +96,6 @@ </Button> </Frames> </Frame> - - <Script file='SVUI.lua'/> <Script file="libs\LibStub\LibStub.lua"/> <Script file="libs\CallbackHandler-1.0\CallbackHandler-1.0.lua"/> @@ -117,19 +117,16 @@ <Script file="language\portuguese_ui.lua"/> <Script file="system\database.lua"/> - <Script file="system\system.lua"/> + <Script file="system\media.lua"/> + <Script file="system\utilities.lua"/> + <Script file="system\animate.lua"/> <Script file="system\common.lua"/> <Script file="system\visibility.lua"/> - <Script file="system\utilities.lua"/> <Script file="system\timers.lua"/> - <Script file="system\updates.lua"/> <Script file="system\slash.lua"/> <Script file="system\alerts.lua"/> - <Script file="system\presets.lua"/> - <Script file="system\installer.lua"/> - <Script file="system\mentalo.lua"/> <Include file="system\mentalo.xml"/> - <Script file="system\cartography.lua"/> + <Script file="system\setup.lua"/> <Include file="packages\stats\SVStats.xml"/> <Script file="packages\dock\SVDock.lua"/> @@ -153,4 +150,6 @@ <Script file="scripts\raid.lua"/> <Script file="scripts\reactions.lua"/> <Script file="scripts\spellbind.lua"/> + + <Script file="system\load.lua"/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/assets/artwork/Doodads/GPS-ANIMATION.blp b/Interface/AddOns/SVUI/assets/artwork/Doodads/GPS-ANIMATION.blp deleted file mode 100644 index 53d920b..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Doodads/GPS-ANIMATION.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Doodads/GPS-ARROW.blp b/Interface/AddOns/SVUI/assets/artwork/Doodads/GPS-ARROW.blp deleted file mode 100644 index 9fb0a32..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Doodads/GPS-ARROW.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Doodads/GPS-BORDER.blp b/Interface/AddOns/SVUI/assets/artwork/Doodads/GPS-BORDER.blp deleted file mode 100644 index 8bc4525..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Doodads/GPS-BORDER.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Doodads/GPS-CLOSE.blp b/Interface/AddOns/SVUI/assets/artwork/Doodads/GPS-CLOSE.blp deleted file mode 100644 index 6ff35be..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Doodads/GPS-CLOSE.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Doodads/GPS-OPEN.blp b/Interface/AddOns/SVUI/assets/artwork/Doodads/GPS-OPEN.blp deleted file mode 100644 index f705797..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Doodads/GPS-OPEN.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Template/Background/COMIC-MODEL.blp b/Interface/AddOns/SVUI/assets/artwork/Template/Background/COMIC-MODEL.blp new file mode 100644 index 0000000..cc16871 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Template/Background/COMIC-MODEL.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Template/Background/PAPER.blp b/Interface/AddOns/SVUI/assets/artwork/Template/Background/PAPER.blp new file mode 100644 index 0000000..9f8b2b7 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Template/Background/PAPER.blp differ diff --git a/Interface/AddOns/SVUI/installer/presets/auras.lua b/Interface/AddOns/SVUI/installer/presets/auras.lua new file mode 100644 index 0000000..5ee13c4 --- /dev/null +++ b/Interface/AddOns/SVUI/installer/presets/auras.lua @@ -0,0 +1,283 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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; +--[[ +########################################################## +LOCALIZED GLOBALS +########################################################## +]]-- +local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS +local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV, L = unpack(select(2, ...)); +local scc = SVUI_CLASS_COLORS[SV.class]; +local rcc = RAID_CLASS_COLORS[SV.class]; +local r2 = .1 + (rcc.r * .1) +local g2 = .1 + (rcc.g * .1) +local b2 = .1 + (rcc.b * .1) +--[[ +########################################################## +LAYOUT PRESETS +########################################################## +]]-- +local presets = { + ["auras"] = { + ["link"] = "SVUnit", + ["default"] = { + ["player"] = { + ["buffs"] = { + enable = false, + attachTo = "DEBUFFS", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["debuffs"] = { + enable = false, + attachTo = "FRAME", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["aurabar"] = { + enable = false + } + }, + ["target"] = { + ["smartAuraDisplay"] = "DISABLED", + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = false + } + }, + ["focus"] = { + ["smartAuraDisplay"] = "DISABLED", + ["buffs"] = { + enable = false, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = false + } + } + }, + ["icons"] = { + ["player"] = { + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["aurabar"] = { + enable = false + } + }, + ["target"] = { + ["smartAuraDisplay"] = "DISABLED", + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = false + } + }, + ["focus"] = { + ["smartAuraDisplay"] = "DISABLED", + ["buffs"] = { + enable = false, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = false + } + } + }, + ["bars"] = { + ["player"] = { + ["buffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["debuffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["aurabar"] = { + enable = true, + attachTo = "FRAME" + } + }, + ["target"] = { + ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", + ["buffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["debuffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["aurabar"] = { + enable = true, + attachTo = "FRAME" + } + }, + ["focus"] = { + ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", + ["buffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["debuffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["aurabar"] = { + enable = true, + attachTo = "FRAME" + } + } + }, + ["theworks"] = { + ["player"] = { + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["aurabar"] = { + enable = true, + attachTo = "DEBUFFS" + } + }, + ["target"] = { + ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = true, + attachTo = "DEBUFFS" + } + }, + ["focus"] = { + ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = true, + attachTo = "DEBUFFS" + } + } + }, + } +}; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/installer/presets/bars.lua b/Interface/AddOns/SVUI/installer/presets/bars.lua new file mode 100644 index 0000000..2e667df --- /dev/null +++ b/Interface/AddOns/SVUI/installer/presets/bars.lua @@ -0,0 +1,133 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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; +--[[ +########################################################## +LOCALIZED GLOBALS +########################################################## +]]-- +local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS +local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV, L = unpack(select(2, ...)); +local scc = SVUI_CLASS_COLORS[SV.class]; +local rcc = RAID_CLASS_COLORS[SV.class]; +local r2 = .1 + (rcc.r * .1) +local g2 = .1 + (rcc.g * .1) +local b2 = .1 + (rcc.b * .1) +--[[ +########################################################## +LAYOUT PRESETS +########################################################## +]]-- +local presets = { + ["bars"] = { + ["link"] = "SVBar", + ["default"] = { + ["Bar1"] = { + buttonsize = 32 + }, + ["Bar2"] = { + enable = false + }, + ["Bar3"] = { + buttons = 6, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 32 + }, + ["Bar5"] = { + buttons = 6, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 32 + } + }, + ["onebig"] = { + ["Bar1"] = { + buttonsize = 40 + }, + ["Bar2"] = { + enable = false + }, + ["Bar3"] = { + buttons = 6, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 40 + }, + ["Bar5"] = { + buttons = 6, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 40 + } + }, + ["twosmall"] = { + ["Bar1"] = { + buttonsize = 32 + }, + ["Bar2"] = { + enable = true, + buttonsize = 32 + }, + ["Bar3"] = { + buttons = 12, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 32 + }, + ["Bar5"] = { + buttons = 12, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 32 + } + }, + ["twobig"] = { + ["Bar1"] = { + buttonsize = 40 + }, + ["Bar2"] = { + enable = true, + buttonsize = 40 + }, + ["Bar3"] = { + buttons = 12, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 40 + }, + ["Bar5"] = { + buttons = 12, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 40 + } + }, + }, +}; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/installer/presets/layouts.lua b/Interface/AddOns/SVUI/installer/presets/layouts.lua new file mode 100644 index 0000000..63248ee --- /dev/null +++ b/Interface/AddOns/SVUI/installer/presets/layouts.lua @@ -0,0 +1,394 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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; +--[[ +########################################################## +LOCALIZED GLOBALS +########################################################## +]]-- +local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS +local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV, L = unpack(select(2, ...)); +local scc = SVUI_CLASS_COLORS[SV.class]; +local rcc = RAID_CLASS_COLORS[SV.class]; +local r2 = .1 + (rcc.r * .1) +local g2 = .1 + (rcc.g * .1) +local b2 = .1 + (rcc.b * .1) +--[[ +########################################################## +LAYOUT PRESETS +########################################################## +]]-- +local presets = { + ["layouts"] = { + ["link"] = "SVUnit", + ["default"] = { + ["grid"] = { + ["enable"] = false, + }, + ["party"] = { + width = 75, + height = 60, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + icons = { + roleIcon = { + ["attachTo"] = "INNERBOTTOMRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + name = { + ["font"] = "SVUI Default Font", + ["fontOutline"] = "OUTLINE", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + ["raid10"] = { + width = 50, + height = 30, + gRowCol = 1, + wrapXOffset = 9, + wrapYOffset = 13, + showBy = "RIGHT_DOWN", + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid25"] = { + width = 50, + height = 30, + gRowCol = 1, + wrapXOffset = 9, + wrapYOffset = 13, + showBy = "RIGHT_DOWN", + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid40"] = { + width = 50, + height = 30, + gRowCol = 1, + wrapXOffset = 9, + wrapYOffset = 13, + showBy = "RIGHT_DOWN", + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + }, + ["healer"] = { + ["grid"] = { + ["enable"] = false, + }, + ["party"] = { + width = 75, + height = 60, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["fontOutline"] = "OUTLINE", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + ["raid10"] = { + width = 50, + height = 30, + ["showBy"] = "DOWN_RIGHT", + ["gRowCol"] = 1, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = true, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid25"] = { + width = 50, + height = 30, + ["showBy"] = "DOWN_RIGHT", + ["gRowCol"] = 1, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = true, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid40"] = { + width = 50, + height = 30, + ["showBy"] = "DOWN_RIGHT", + ["gRowCol"] = 1, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = true, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + }, + ["dps"] = { + ["grid"] = { + ["enable"] = false, + }, + ["party"] = { + width = 115, + height = 25, + wrapXOffset = 9, + wrapYOffset = 13, + ["power"] = { + ["enable"] = false, + }, + portrait = { + enable = false, + overlay = false, + style = "2D", + width = 35, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "LEFT", + ["xOffset"] = -2, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["fontOutline"] = "NONE", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + }, + ["raid10"] = { + ["showBy"] = "UP_RIGHT", + ["gRowCol"] = 2, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 10, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + ["width"] = 80, + ["height"] = 20, + }, + ["raid25"] = { + ["showBy"] = "UP_RIGHT", + ["gRowCol"] = 3, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 10, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + ["width"] = 80, + ["height"] = 20, + }, + ["raid40"] = { + ["showBy"] = "UP_RIGHT", + ["gRowCol"] = 4, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 10, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + ["width"] = 80, + ["height"] = 20, + }, + }, + ["grid"] = { + ["grid"] = { + ["enable"] = true, + ["size"] = 34, + ["shownames"] = true, + }, + ["party"] = { + ["gridAllowed"] = true, + ["wrapXOffset"] = 1, + ["wrapYOffset"] = 1, + }, + ["raid10"] = { + ["gridAllowed"] = true, + ["wrapXOffset"] = 1, + ["wrapYOffset"] = 1, + ["gRowCol"] = 1, + ["showBy"] = "RIGHT_DOWN", + }, + ["raid25"] = { + ["gridAllowed"] = true, + ["wrapXOffset"] = 1, + ["wrapYOffset"] = 1, + ["gRowCol"] = 1, + ["showBy"] = "RIGHT_DOWN", + }, + ["raid40"] = { + ["gridAllowed"] = true, + ["wrapXOffset"] = 1, + ["wrapYOffset"] = 1, + ["gRowCol"] = 1, + ["showBy"] = "RIGHT_DOWN", + }, + }, + } +}; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/installer/presets/media.lua b/Interface/AddOns/SVUI/installer/presets/media.lua new file mode 100644 index 0000000..6724b9b --- /dev/null +++ b/Interface/AddOns/SVUI/installer/presets/media.lua @@ -0,0 +1,119 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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; +--[[ +########################################################## +LOCALIZED GLOBALS +########################################################## +]]-- +local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS +local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV, L = unpack(select(2, ...)); +local scc = SVUI_CLASS_COLORS[SV.class]; +local rcc = RAID_CLASS_COLORS[SV.class]; +local r2 = .1 + (rcc.r * .1) +local g2 = .1 + (rcc.g * .1) +local b2 = .1 + (rcc.b * .1) +--[[ +########################################################## +LAYOUT PRESETS +########################################################## +]]-- +local presets = { + ["media"] = { + ["link"] = "media", + ["default"] = { + ["colors"] = { + ["special"] = {.37, .32, .29, 1}, + }, + ["textures"] = { + ["pattern"] = "SVUI Backdrop 1", + ["comic"] = "SVUI Comic 1", + ["unitlarge"] = "SVUI Unit BG 1", + ["unitsmall"] = "SVUI Small BG 1", + }, + ["unitframes"] = { + ["buff_bars"] = {.91, .91, .31, 1}, + ["health"] = {.1, .6, .02, 1}, + ["casting"] = {.91, .91, .31, 1}, + ["spark"] = {1, .72, 0, 1}, + }, + }, + ["kaboom"] = { + ["colors"] = { + ["special"] = {.28, .31, .32, 1}, + }, + ["textures"] = { + ["pattern"] = "SVUI Backdrop 2", + ["comic"] = "SVUI Comic 2", + ["unitlarge"] = "SVUI Unit BG 2", + ["unitsmall"] = "SVUI Small BG 2", + }, + ["unitframes"] = { + ["buff_bars"] = {.51, .79, 0, 1}, + ["health"] = {.16, .86, .22, 1}, + ["casting"] = {.91, .91, 0, 1}, + ["spark"] = {1, .72, 0, 1}, + }, + }, + ["classy"] = { + ["colors"] = { + ["special"] = {r2, g2, b2, 1}, + }, + ["textures"] = { + ["pattern"] = "SVUI Backdrop 3", + ["comic"] = "SVUI Comic 3", + ["unitlarge"] = "SVUI Unit BG 3", + ["unitsmall"] = "SVUI Small BG 3", + }, + ["unitframes"] = { + ["buff_bars"] = {scc.r, scc.g, scc.b, 1}, + ["health"] = {.16, .86, .22, 1}, + ["casting"] = {.91, .91, 0, 1}, + ["spark"] = {1, .72, 0, 1}, + }, + }, + ["dark"] = { + ["colors"] = { + ["special"] = {.25, .26, .27, 1}, + }, + ["textures"] = { + ["pattern"] = "SVUI Backdrop 4", + ["comic"] = "SVUI Comic 4", + ["unitlarge"] = "SVUI Unit BG 4", + ["unitsmall"] = "SVUI Small BG 4", + }, + ["unitframes"] = { + ["buff_bars"] = {.45, .55, .15, 1}, + ["health"] = {.06, .06, .06, 1}, + ["casting"] = {.8, .8, 0, 1}, + ["spark"] = {1, .72, 0, 1}, + }, + }, + } +}; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/installer/presets/units.lua b/Interface/AddOns/SVUI/installer/presets/units.lua new file mode 100644 index 0000000..2e997ce --- /dev/null +++ b/Interface/AddOns/SVUI/installer/presets/units.lua @@ -0,0 +1,385 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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; +--[[ +########################################################## +LOCALIZED GLOBALS +########################################################## +]]-- +local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS +local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV, L = unpack(select(2, ...)); +local scc = SVUI_CLASS_COLORS[SV.class]; +local rcc = RAID_CLASS_COLORS[SV.class]; +local r2 = .1 + (rcc.r * .1) +local g2 = .1 + (rcc.g * .1) +local b2 = .1 + (rcc.b * .1) +--[[ +########################################################## +LAYOUT PRESETS +########################################################## +]]-- +local presets = { + ["units"] = { + ["link"] = "SVUnit", + ["default"] = { + ["player"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["target"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["pet"] = { + width = 130, + height = 30, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "CENTER" + }, + }, + ["targettarget"] = { + width = 130, + height = 30, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "CENTER" + }, + }, + ["boss"] = { + width = 200, + height = 45, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["party"] = { + width = 75, + height = 60, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "INNERTOPLEFT" + }, + }, + ["raid10"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid25"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid40"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + }, + ["super"] = { + ["player"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["target"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["pet"] = { + width = 150, + height = 30, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "CENTER" + }, + }, + ["targettarget"] = { + width = 150, + height = 30, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "CENTER" + }, + }, + ["boss"] = { + width = 200, + height = 45, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["party"] = { + width = 75, + height = 60, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "INNERTOPLEFT" + }, + }, + ["raid10"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid25"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid40"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + }, + ["simple"] = { + ["player"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 60, + } + }, + ["target"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 60, + } + }, + ["pet"] = { + width = 150, + height = 30, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 30, + }, + name = { + position = "INNERLEFT" + }, + }, + ["targettarget"] = { + width = 150, + height = 30, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 30, + }, + name = { + position = "INNERLEFT" + }, + }, + ["boss"] = { + width = 200, + height = 45, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 45, + } + }, + ["party"] = { + width = 100, + height = 35, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 35, + }, + name = { + position = "INNERRIGHT" + }, + }, + ["raid10"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid25"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid40"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + }, + ["compact"] = { + ["player"] = { + width = 215, + height = 50, + portrait = { + enable = false + } + }, + ["target"] = { + width = 215, + height = 50, + portrait = { + enable = false + } + }, + ["pet"] = { + width = 130, + height = 30, + portrait = { + enable = false + }, + name = { + position = "CENTER" + }, + }, + ["targettarget"] = { + width = 130, + height = 30, + portrait = { + enable = false + }, + name = { + position = "CENTER" + }, + }, + ["boss"] = { + width = 200, + height = 45, + portrait = { + enable = false + } + }, + ["party"] = { + width = 70, + height = 30, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = false + }, + name = { + position = "INNERTOPLEFT" + }, + }, + ["raid10"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid25"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid40"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + }, + } +}; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/installer/setup.lua b/Interface/AddOns/SVUI/installer/setup.lua new file mode 100644 index 0000000..bb2b478 --- /dev/null +++ b/Interface/AddOns/SVUI/installer/setup.lua @@ -0,0 +1,2401 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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 type = _G.type; +local string = _G.string; +local table = _G.table; +local format = string.format; +local tcopy = table.copy; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV, L, Registry = unpack(select(2, ...)); +--[[ +########################################################## +LOCAL VARS +########################################################## +]]-- +local CURRENT_PAGE, MAX_PAGE, XOFF = 0, 9, (GetScreenWidth() * 0.025) +local okToResetMOVE = false +local mungs = false; +local user_music_vol; +local musicIsPlaying; + +local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS +local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS +local scc = SVUI_CLASS_COLORS[SV.class]; +local rcc = RAID_CLASS_COLORS[SV.class]; +local r2 = .1 + (rcc.r * .1) +local g2 = .1 + (rcc.g * .1) +local b2 = .1 + (rcc.b * .1) +--[[ +########################################################## +SETUP CLASS OBJECT +########################################################## +]]-- +local Setup = {}; +--[[ +########################################################## +LAYOUT PRESETS +########################################################## +]]-- +local PRESET_DATA; + +local function LoadAllPresets() + PRESET_DATA = {} + + PRESET_DATA["media"] = { + ["link"] = "media", + ["default"] = { + ["colors"] = { + ["special"] = {.37, .32, .29, 1}, + }, + ["textures"] = { + ["pattern"] = "SVUI Backdrop 1", + ["comic"] = "SVUI Comic 1", + ["unitlarge"] = "SVUI Unit BG 1", + ["unitsmall"] = "SVUI Small BG 1", + }, + ["unitframes"] = { + ["buff_bars"] = {.91, .91, .31, 1}, + ["health"] = {.1, .6, .02, 1}, + ["casting"] = {.91, .91, .31, 1}, + ["spark"] = {1, .72, 0, 1}, + }, + }, + ["kaboom"] = { + ["colors"] = { + ["special"] = {.28, .31, .32, 1}, + }, + ["textures"] = { + ["pattern"] = "SVUI Backdrop 2", + ["comic"] = "SVUI Comic 2", + ["unitlarge"] = "SVUI Unit BG 2", + ["unitsmall"] = "SVUI Small BG 2", + }, + ["unitframes"] = { + ["buff_bars"] = {.51, .79, 0, 1}, + ["health"] = {.16, .86, .22, 1}, + ["casting"] = {.91, .91, 0, 1}, + ["spark"] = {1, .72, 0, 1}, + }, + }, + ["classy"] = { + ["colors"] = { + ["special"] = {r2, g2, b2, 1}, + }, + ["textures"] = { + ["pattern"] = "SVUI Backdrop 3", + ["comic"] = "SVUI Comic 3", + ["unitlarge"] = "SVUI Unit BG 3", + ["unitsmall"] = "SVUI Small BG 3", + }, + ["unitframes"] = { + ["buff_bars"] = {scc.r, scc.g, scc.b, 1}, + ["health"] = {.16, .86, .22, 1}, + ["casting"] = {.91, .91, 0, 1}, + ["spark"] = {1, .72, 0, 1}, + }, + }, + ["dark"] = { + ["colors"] = { + ["special"] = {.25, .26, .27, 1}, + }, + ["textures"] = { + ["pattern"] = "SVUI Backdrop 4", + ["comic"] = "SVUI Comic 4", + ["unitlarge"] = "SVUI Unit BG 4", + ["unitsmall"] = "SVUI Small BG 4", + }, + ["unitframes"] = { + ["buff_bars"] = {.45, .55, .15, 1}, + ["health"] = {.06, .06, .06, 1}, + ["casting"] = {.8, .8, 0, 1}, + ["spark"] = {1, .72, 0, 1}, + }, + }, + } + PRESET_DATA["auras"] = { + ["link"] = "SVUnit", + ["default"] = { + ["player"] = { + ["buffs"] = { + enable = false, + attachTo = "DEBUFFS", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["debuffs"] = { + enable = false, + attachTo = "FRAME", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["aurabar"] = { + enable = false + } + }, + ["target"] = { + ["smartAuraDisplay"] = "DISABLED", + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = false + } + }, + ["focus"] = { + ["smartAuraDisplay"] = "DISABLED", + ["buffs"] = { + enable = false, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = false + } + } + }, + ["icons"] = { + ["player"] = { + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["aurabar"] = { + enable = false + } + }, + ["target"] = { + ["smartAuraDisplay"] = "DISABLED", + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = false + } + }, + ["focus"] = { + ["smartAuraDisplay"] = "DISABLED", + ["buffs"] = { + enable = false, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = false + } + } + }, + ["bars"] = { + ["player"] = { + ["buffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["debuffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["aurabar"] = { + enable = true, + attachTo = "FRAME" + } + }, + ["target"] = { + ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", + ["buffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["debuffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["aurabar"] = { + enable = true, + attachTo = "FRAME" + } + }, + ["focus"] = { + ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", + ["buffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["debuffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["aurabar"] = { + enable = true, + attachTo = "FRAME" + } + } + }, + ["theworks"] = { + ["player"] = { + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["aurabar"] = { + enable = true, + attachTo = "DEBUFFS" + } + }, + ["target"] = { + ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = true, + attachTo = "DEBUFFS" + } + }, + ["focus"] = { + ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = true, + attachTo = "DEBUFFS" + } + } + }, + } + PRESET_DATA["bars"] = { + ["link"] = "SVBar", + ["default"] = { + ["Bar1"] = { + buttonsize = 32 + }, + ["Bar2"] = { + enable = false + }, + ["Bar3"] = { + buttons = 6, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 32 + }, + ["Bar5"] = { + buttons = 6, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 32 + } + }, + ["onebig"] = { + ["Bar1"] = { + buttonsize = 40 + }, + ["Bar2"] = { + enable = false + }, + ["Bar3"] = { + buttons = 6, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 40 + }, + ["Bar5"] = { + buttons = 6, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 40 + } + }, + ["twosmall"] = { + ["Bar1"] = { + buttonsize = 32 + }, + ["Bar2"] = { + enable = true, + buttonsize = 32 + }, + ["Bar3"] = { + buttons = 12, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 32 + }, + ["Bar5"] = { + buttons = 12, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 32 + } + }, + ["twobig"] = { + ["Bar1"] = { + buttonsize = 40 + }, + ["Bar2"] = { + enable = true, + buttonsize = 40 + }, + ["Bar3"] = { + buttons = 12, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 40 + }, + ["Bar5"] = { + buttons = 12, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 40 + } + }, + } + PRESET_DATA["units"] = { + ["link"] = "SVUnit", + ["default"] = { + ["player"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["target"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["pet"] = { + width = 130, + height = 30, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "CENTER" + }, + }, + ["targettarget"] = { + width = 130, + height = 30, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "CENTER" + }, + }, + ["boss"] = { + width = 200, + height = 45, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["party"] = { + width = 75, + height = 60, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "INNERTOPLEFT" + }, + }, + ["raid10"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid25"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid40"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + }, + ["super"] = { + ["player"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["target"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["pet"] = { + width = 150, + height = 30, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "CENTER" + }, + }, + ["targettarget"] = { + width = 150, + height = 30, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "CENTER" + }, + }, + ["boss"] = { + width = 200, + height = 45, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["party"] = { + width = 75, + height = 60, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "INNERTOPLEFT" + }, + }, + ["raid10"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid25"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid40"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + }, + ["simple"] = { + ["player"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 60, + } + }, + ["target"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 60, + } + }, + ["pet"] = { + width = 150, + height = 30, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 30, + }, + name = { + position = "INNERLEFT" + }, + }, + ["targettarget"] = { + width = 150, + height = 30, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 30, + }, + name = { + position = "INNERLEFT" + }, + }, + ["boss"] = { + width = 200, + height = 45, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 45, + } + }, + ["party"] = { + width = 100, + height = 35, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 35, + }, + name = { + position = "INNERRIGHT" + }, + }, + ["raid10"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid25"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid40"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + }, + ["compact"] = { + ["player"] = { + width = 215, + height = 50, + portrait = { + enable = false + } + }, + ["target"] = { + width = 215, + height = 50, + portrait = { + enable = false + } + }, + ["pet"] = { + width = 130, + height = 30, + portrait = { + enable = false + }, + name = { + position = "CENTER" + }, + }, + ["targettarget"] = { + width = 130, + height = 30, + portrait = { + enable = false + }, + name = { + position = "CENTER" + }, + }, + ["boss"] = { + width = 200, + height = 45, + portrait = { + enable = false + } + }, + ["party"] = { + width = 70, + height = 30, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = false + }, + name = { + position = "INNERTOPLEFT" + }, + }, + ["raid10"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid25"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid40"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + }, + } + PRESET_DATA["layouts"] = { + ["link"] = "SVUnit", + ["default"] = { + ["grid"] = { + ["enable"] = false, + }, + ["party"] = { + width = 75, + height = 60, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + icons = { + roleIcon = { + ["attachTo"] = "INNERBOTTOMRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + name = { + ["font"] = "SVUI Default Font", + ["fontOutline"] = "OUTLINE", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + ["raid10"] = { + width = 50, + height = 30, + gRowCol = 1, + wrapXOffset = 9, + wrapYOffset = 13, + showBy = "RIGHT_DOWN", + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid25"] = { + width = 50, + height = 30, + gRowCol = 1, + wrapXOffset = 9, + wrapYOffset = 13, + showBy = "RIGHT_DOWN", + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid40"] = { + width = 50, + height = 30, + gRowCol = 1, + wrapXOffset = 9, + wrapYOffset = 13, + showBy = "RIGHT_DOWN", + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + }, + ["healer"] = { + ["grid"] = { + ["enable"] = false, + }, + ["party"] = { + width = 75, + height = 60, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["fontOutline"] = "OUTLINE", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + ["raid10"] = { + width = 50, + height = 30, + ["showBy"] = "DOWN_RIGHT", + ["gRowCol"] = 1, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = true, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid25"] = { + width = 50, + height = 30, + ["showBy"] = "DOWN_RIGHT", + ["gRowCol"] = 1, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = true, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid40"] = { + width = 50, + height = 30, + ["showBy"] = "DOWN_RIGHT", + ["gRowCol"] = 1, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = true, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + }, + ["dps"] = { + ["grid"] = { + ["enable"] = false, + }, + ["party"] = { + width = 115, + height = 25, + wrapXOffset = 9, + wrapYOffset = 13, + ["power"] = { + ["enable"] = false, + }, + portrait = { + enable = false, + overlay = false, + style = "2D", + width = 35, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "LEFT", + ["xOffset"] = -2, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["fontOutline"] = "NONE", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + }, + ["raid10"] = { + ["showBy"] = "UP_RIGHT", + ["gRowCol"] = 2, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 10, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + ["width"] = 80, + ["height"] = 20, + }, + ["raid25"] = { + ["showBy"] = "UP_RIGHT", + ["gRowCol"] = 3, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 10, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + ["width"] = 80, + ["height"] = 20, + }, + ["raid40"] = { + ["showBy"] = "UP_RIGHT", + ["gRowCol"] = 4, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 10, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + ["width"] = 80, + ["height"] = 20, + }, + }, + ["grid"] = { + ["grid"] = { + ["enable"] = true, + ["size"] = 34, + ["shownames"] = true, + }, + ["party"] = { + ["gridAllowed"] = true, + ["wrapXOffset"] = 1, + ["wrapYOffset"] = 1, + }, + ["raid10"] = { + ["gridAllowed"] = true, + ["wrapXOffset"] = 1, + ["wrapYOffset"] = 1, + ["gRowCol"] = 1, + ["showBy"] = "RIGHT_DOWN", + }, + ["raid25"] = { + ["gridAllowed"] = true, + ["wrapXOffset"] = 1, + ["wrapYOffset"] = 1, + ["gRowCol"] = 1, + ["showBy"] = "RIGHT_DOWN", + }, + ["raid40"] = { + ["gridAllowed"] = true, + ["wrapXOffset"] = 1, + ["wrapYOffset"] = 1, + ["gRowCol"] = 1, + ["showBy"] = "RIGHT_DOWN", + }, + }, + } +end + +local function _copyPresets(saved, preset) + if(type(preset) == 'table') then + for key,val in pairs(preset) do + if(not saved[key]) then saved[key] = {} end + if(type(val) == "table") then + _copyPresets(saved[key], val) + elseif(saved[key]) then + saved[key] = val + end + end + else + saved = preset + end +end +--[[ +########################################################## +LOCAL FUNCTIONS +########################################################## +]]-- +local function SetInstallButton(button) + if(not button) then return end + button.Left:SetAlpha(0) + button.Middle:SetAlpha(0) + button.Right:SetAlpha(0) + button:SetNormalTexture("") + button:SetPushedTexture("") + button:SetPushedTexture("") + button:SetDisabledTexture("") + button:RemoveTextures() + button:SetFrameLevel(button:GetFrameLevel() + 1) +end + +local function forceCVars() + SetCVar("alternateResourceText",1) + SetCVar("statusTextDisplay","BOTH") + SetCVar("ShowClassColorInNameplate",1) + SetCVar("screenshotQuality",10) + SetCVar("chatMouseScroll",1) + SetCVar("chatStyle","classic") + SetCVar("WholeChatWindowClickable",0) + SetCVar("ConversationMode","inline") + SetCVar("showTutorials",0) + SetCVar("UberTooltips",1) + SetCVar("threatWarning",3) + SetCVar('alwaysShowActionBars',1) + SetCVar('lockActionBars',1) + SetCVar('SpamFilter',0) + InterfaceOptionsActionBarsPanelPickupActionKeyDropDown:SetValue('SHIFT') + InterfaceOptionsActionBarsPanelPickupActionKeyDropDown:RefreshValue() +end + +local function ShowLayout(show40) + if(not _G["SVUI_Raid40"] or (show40 and _G["SVUI_Raid40"].forceShow == true)) then return end + if(not show40 and _G["SVUI_Raid40"].forceShow ~= true) then return end + SV.SVUnit:UpdateGroupConfig(_G["SVUI_Raid40"], show40) +end + +local function BarShuffle() + local bar2 = SV.db.SVBar.Bar2.enable; + local base = 30; + local bS = SV.db.SVBar.Bar1.buttonspacing; + local tH = SV.db.SVBar.Bar1.buttonsize + (base - bS); + local b2h = bar2 and tH or base; + local sph = (400 - b2h); + if not SV.db.framelocations then SV.db.framelocations = {} end + SV.db.framelocations.SVUI_SpecialAbility_MOVE = "BOTTOMSVUIParentBOTTOM0"..sph; + SV.db.framelocations.SVUI_ActionBar2_MOVE = "BOTTOMSVUI_ActionBar1TOP0"..(-bS); + SV.db.framelocations.SVUI_ActionBar3_MOVE = "BOTTOMLEFTSVUI_ActionBar1BOTTOMRIGHT40"; + SV.db.framelocations.SVUI_ActionBar5_MOVE = "BOTTOMRIGHTSVUI_ActionBar1BOTTOMLEFT-40"; + if bar2 then + SV.db.framelocations.SVUI_PetActionBar_MOVE = "BOTTOMLEFTSVUI_ActionBar2TOPLEFT04" + SV.db.framelocations.SVUI_StanceBar_MOVE = "BOTTOMRIGHTSVUI_ActionBar2TOPRIGHT04"; + else + SV.db.framelocations.SVUI_PetActionBar_MOVE = "BOTTOMLEFTSVUI_ActionBar1TOPLEFT04" + SV.db.framelocations.SVUI_StanceBar_MOVE = "BOTTOMRIGHTSVUI_ActionBar1TOPRIGHT04"; + end +end + +local function UFMoveBottomQuadrant(toggle) + if not SV.db.framelocations then SV.db.framelocations = {} end + if not toggle then + SV.db.framelocations.SVUI_Player_MOVE = "BOTTOMSVUIParentBOTTOM-278182" + SV.db.framelocations.SVUI_PlayerCastbar_MOVE = "BOTTOMSVUIParentBOTTOM-278122" + SV.db.framelocations.SVUI_Target_MOVE = "BOTTOMSVUIParentBOTTOM278182" + SV.db.framelocations.SVUI_TargetCastbar_MOVE = "BOTTOMSVUIParentBOTTOM278122" + SV.db.framelocations.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM0181" + SV.db.framelocations.SVUI_TargetTarget_MOVE = "BOTTOMSVUIParentBOTTOM0214" + SV.db.framelocations.SVUI_Focus_MOVE = "BOTTOMSVUIParentBOTTOM310432" + SV.db.framelocations.SVUI_ThreatBar_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-495182" + elseif toggle == "shift" then + SV.db.framelocations.SVUI_Player_MOVE = "BOTTOMSVUIParentBOTTOM-278210" + SV.db.framelocations.SVUI_PlayerCastbar_MOVE = "BOTTOMSVUIParentBOTTOM-278150" + SV.db.framelocations.SVUI_Target_MOVE = "BOTTOMSVUIParentBOTTOM278210" + SV.db.framelocations.SVUI_TargetCastbar_MOVE = "BOTTOMSVUIParentBOTTOM278150" + SV.db.framelocations.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM0209" + SV.db.framelocations.SVUI_TargetTarget_MOVE = "BOTTOMSVUIParentBOTTOM0242" + SV.db.framelocations.SVUI_Focus_MOVE = "BOTTOMSVUIParentBOTTOM310432" + SV.db.framelocations.SVUI_ThreatBar_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-495210" + else + local c = 136; + local d = 135; + local e = 80; + SV.db.framelocations.SVUI_Player_MOVE = "BOTTOMSVUIParentBOTTOM"..-c..""..d; + SV.db.framelocations.SVUI_PlayerCastbar_MOVE = "BOTTOMSVUIParentBOTTOM"..-c..""..(d-60); + SV.db.framelocations.SVUI_Target_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..d; + SV.db.framelocations.SVUI_TargetCastbar_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..(d-60); + SV.db.framelocations.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM"..-c..""..e; + SV.db.framelocations.SVUI_TargetTarget_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..e; + SV.db.framelocations.SVUI_Focus_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..(d + 150); + SV.db.framelocations.SVUI_ThreatBar_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-495"..d; + end +end + +local function UFMoveLeftQuadrant(toggle) + if not SV.db.framelocations then SV.db.framelocations = {} end + if not toggle then + SV.db.framelocations.SVUI_Assist_MOVE = "TOPLEFTSVUIParentTOPLEFT"..XOFF.."-250" + SV.db.framelocations.SVUI_Tank_MOVE = "TOPLEFTSVUIParentTOPLEFT"..XOFF.."-175" + SV.db.framelocations.SVUI_Raidpet_MOVE = "TOPLEFTSVUIParentTOPLEFT"..XOFF.."-325" + SV.db.framelocations.SVUI_Party_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" + SV.db.framelocations.SVUI_Raid10_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" + SV.db.framelocations.SVUI_Raid25_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" + SV.db.framelocations.SVUI_Raid40_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" + else + SV.db.framelocations.SVUI_Assist_MOVE = "TOPLEFTSVUIParentTOPLEFT4-250" + SV.db.framelocations.SVUI_Tank_MOVE = "TOPLEFTSVUIParentTOPLEFT4-175" + SV.db.framelocations.SVUI_Raidpet_MOVE = "TOPLEFTSVUIParentTOPLEFT4-325" + SV.db.framelocations.SVUI_Party_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" + SV.db.framelocations.SVUI_Raid40_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" + SV.db.framelocations.SVUI_Raid10_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" + SV.db.framelocations.SVUI_Raid25_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" + end +end + +local function UFMoveTopQuadrant(toggle) + if not SV.db.framelocations then SV.db.framelocations = {} end + if not toggle then + SV.db.framelocations.GM_MOVE = "TOPLEFTSVUIParentTOPLEFT250-25" + SV.db.framelocations.SVUI_LootFrame_MOVE = "BOTTOMSVUIParentBOTTOM0350" + SV.db.framelocations.SVUI_AltPowerBar_MOVE = "TOPSVUIParentTOP0-40" + SV.db.framelocations.LoC_MOVE = "BOTTOMSVUIParentBOTTOM0350" + SV.db.framelocations.BNET_MOVE = "TOPRIGHTSVUIParentTOPRIGHT-4-250" + else + SV.db.framelocations.GM_MOVE = "TOPLEFTSVUIParentTOPLEFT344-25" + SV.db.framelocations.SVUI_LootFrame_MOVE = "BOTTOMSVUIParentBOTTOM0254" + SV.db.framelocations.SVUI_AltPowerBar_MOVE = "TOPSVUIParentTOP0-39" + SV.db.framelocations.LoC_MOVE = "BOTTOMSVUIParentBOTTOM0443" + SV.db.framelocations.BNET_MOVE = "TOPRIGHTSVUIParentTOPRIGHT-4-248" + end +end + +local function UFMoveRightQuadrant(toggle) + if not SV.db.framelocations then SV.db.framelocations = {} end + local dH = SV.db.SVDock.dockRightHeight + 60 + if not toggle or toggle == "high" then + SV.db.framelocations.SVUI_BossHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" + SV.db.framelocations.SVUI_ArenaHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" + SV.db.framelocations.Tooltip_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-284"..dH; + else + SV.db.framelocations.SVUI_BossHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" + SV.db.framelocations.SVUI_ArenaHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" + SV.db.framelocations.Tooltip_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-284"..dH; + end +end + +local function InitializeChatFrames(mungs) + forceCVars() + FCF_ResetChatWindows() + FCF_SetLocked(ChatFrame1, 1) + FCF_DockFrame(ChatFrame2) + FCF_SetLocked(ChatFrame2, 1) + FCF_OpenNewWindow(LOOT) + FCF_DockFrame(ChatFrame3) + FCF_SetLocked(ChatFrame3, 1) + for i = 1, NUM_CHAT_WINDOWS do + local chat = _G["ChatFrame"..i] + local chatID = chat:GetID() + if i == 1 then + chat:ClearAllPoints() + chat:Point("BOTTOMLEFT", LeftSuperDock, "BOTTOMLEFT", 5, 5) + chat:Point("TOPRIGHT", LeftSuperDock, "TOPRIGHT", -5, -10) + end + FCF_SavePositionAndDimensions(chat) + FCF_StopDragging(chat) + FCF_SetChatWindowFontSize(nil, chat, 12) + if i == 1 then + FCF_SetWindowName(chat, GENERAL) + elseif i == 2 then + FCF_SetWindowName(chat, GUILD_EVENT_LOG) + elseif i == 3 then + FCF_SetWindowName(chat, LOOT) + end + end + ChatFrame_RemoveAllMessageGroups(ChatFrame1) + ChatFrame_AddMessageGroup(ChatFrame1, "SAY") + ChatFrame_AddMessageGroup(ChatFrame1, "EMOTE") + ChatFrame_AddMessageGroup(ChatFrame1, "YELL") + ChatFrame_AddMessageGroup(ChatFrame1, "GUILD") + ChatFrame_AddMessageGroup(ChatFrame1, "OFFICER") + ChatFrame_AddMessageGroup(ChatFrame1, "GUILD_ACHIEVEMENT") + ChatFrame_AddMessageGroup(ChatFrame1, "WHISPER") + ChatFrame_AddMessageGroup(ChatFrame1, "MONSTER_SAY") + ChatFrame_AddMessageGroup(ChatFrame1, "MONSTER_EMOTE") + ChatFrame_AddMessageGroup(ChatFrame1, "MONSTER_YELL") + ChatFrame_AddMessageGroup(ChatFrame1, "MONSTER_BOSS_EMOTE") + ChatFrame_AddMessageGroup(ChatFrame1, "PARTY") + ChatFrame_AddMessageGroup(ChatFrame1, "PARTY_LEADER") + ChatFrame_AddMessageGroup(ChatFrame1, "RAID") + ChatFrame_AddMessageGroup(ChatFrame1, "RAID_LEADER") + ChatFrame_AddMessageGroup(ChatFrame1, "RAID_WARNING") + ChatFrame_AddMessageGroup(ChatFrame1, "INSTANCE_CHAT") + ChatFrame_AddMessageGroup(ChatFrame1, "INSTANCE_CHAT_LEADER") + ChatFrame_AddMessageGroup(ChatFrame1, "BATTLEGROUND") + ChatFrame_AddMessageGroup(ChatFrame1, "BATTLEGROUND_LEADER") + ChatFrame_AddMessageGroup(ChatFrame1, "BG_HORDE") + ChatFrame_AddMessageGroup(ChatFrame1, "BG_ALLIANCE") + ChatFrame_AddMessageGroup(ChatFrame1, "BG_NEUTRAL") + ChatFrame_AddMessageGroup(ChatFrame1, "SYSTEM") + ChatFrame_AddMessageGroup(ChatFrame1, "ERRORS") + ChatFrame_AddMessageGroup(ChatFrame1, "AFK") + ChatFrame_AddMessageGroup(ChatFrame1, "DND") + ChatFrame_AddMessageGroup(ChatFrame1, "IGNORED") + ChatFrame_AddMessageGroup(ChatFrame1, "ACHIEVEMENT") + ChatFrame_AddMessageGroup(ChatFrame1, "BN_WHISPER") + ChatFrame_AddMessageGroup(ChatFrame1, "BN_CONVERSATION") + ChatFrame_AddMessageGroup(ChatFrame1, "BN_INLINE_TOAST_ALERT") + ChatFrame_AddMessageGroup(ChatFrame1, "COMBAT_FACTION_CHANGE") + ChatFrame_AddMessageGroup(ChatFrame1, "SKILL") + ChatFrame_AddMessageGroup(ChatFrame1, "LOOT") + ChatFrame_AddMessageGroup(ChatFrame1, "MONEY") + ChatFrame_AddMessageGroup(ChatFrame1, "COMBAT_XP_GAIN") + ChatFrame_AddMessageGroup(ChatFrame1, "COMBAT_HONOR_GAIN") + ChatFrame_AddMessageGroup(ChatFrame1, "COMBAT_GUILD_XP_GAIN") + + ChatFrame_RemoveAllMessageGroups(ChatFrame3) + ChatFrame_AddMessageGroup(ChatFrame3, "COMBAT_FACTION_CHANGE") + ChatFrame_AddMessageGroup(ChatFrame3, "SKILL") + ChatFrame_AddMessageGroup(ChatFrame3, "LOOT") + ChatFrame_AddMessageGroup(ChatFrame3, "MONEY") + ChatFrame_AddMessageGroup(ChatFrame3, "COMBAT_XP_GAIN") + ChatFrame_AddMessageGroup(ChatFrame3, "COMBAT_HONOR_GAIN") + ChatFrame_AddMessageGroup(ChatFrame3, "COMBAT_GUILD_XP_GAIN") + + ChatFrame_AddChannel(ChatFrame1, GENERAL) + + ToggleChatColorNamesByClassGroup(true, "SAY") + ToggleChatColorNamesByClassGroup(true, "EMOTE") + ToggleChatColorNamesByClassGroup(true, "YELL") + ToggleChatColorNamesByClassGroup(true, "GUILD") + ToggleChatColorNamesByClassGroup(true, "OFFICER") + ToggleChatColorNamesByClassGroup(true, "GUILD_ACHIEVEMENT") + ToggleChatColorNamesByClassGroup(true, "ACHIEVEMENT") + ToggleChatColorNamesByClassGroup(true, "WHISPER") + ToggleChatColorNamesByClassGroup(true, "PARTY") + ToggleChatColorNamesByClassGroup(true, "PARTY_LEADER") + ToggleChatColorNamesByClassGroup(true, "RAID") + ToggleChatColorNamesByClassGroup(true, "RAID_LEADER") + ToggleChatColorNamesByClassGroup(true, "RAID_WARNING") + ToggleChatColorNamesByClassGroup(true, "BATTLEGROUND") + ToggleChatColorNamesByClassGroup(true, "BATTLEGROUND_LEADER") + ToggleChatColorNamesByClassGroup(true, "INSTANCE_CHAT") + ToggleChatColorNamesByClassGroup(true, "INSTANCE_CHAT_LEADER") + ToggleChatColorNamesByClassGroup(true, "CHANNEL1") + ToggleChatColorNamesByClassGroup(true, "CHANNEL2") + ToggleChatColorNamesByClassGroup(true, "CHANNEL3") + ToggleChatColorNamesByClassGroup(true, "CHANNEL4") + ToggleChatColorNamesByClassGroup(true, "CHANNEL5") + ToggleChatColorNamesByClassGroup(true, "CHANNEL6") + ToggleChatColorNamesByClassGroup(true, "CHANNEL7") + ToggleChatColorNamesByClassGroup(true, "CHANNEL8") + ToggleChatColorNamesByClassGroup(true, "CHANNEL9") + ToggleChatColorNamesByClassGroup(true, "CHANNEL10") + ToggleChatColorNamesByClassGroup(true, "CHANNEL11") + + ChangeChatColor("CHANNEL1", 195 / 255, 230 / 255, 232 / 255) + ChangeChatColor("CHANNEL2", 232 / 255, 158 / 255, 121 / 255) + ChangeChatColor("CHANNEL3", 232 / 255, 228 / 255, 121 / 255) + + if not mungs then + if SV.Chat then + SV.Chat:ReLoad(true) + if SVUI_Cache["Dock"].RightSuperDockFaded == true then RightSuperDockToggleButton:Click()end + if SVUI_Cache["Dock"].LeftSuperDockFaded == true then LeftSuperDockToggleButton:Click()end + end + SV:SavedPopup() + end +end + +local function SetUserScreen(rez, preserve) + if not preserve then + if okToResetMOVE then + SV:ResetMovables("") + okToResetMOVE = false; + end + SV.db:SetDefault("SVUnit") + end + + if not SV.db.framelocations then SV.db.framelocations = {} end + if rez == "low" then + if not preserve then + SV.db.SVDock.dockLeftWidth = 350; + SV.db.SVDock.dockLeftHeight = 180; + SV.db.SVDock.dockRightWidth = 350; + SV.db.SVDock.dockRightHeight = 180; + SV.db.SVAura.wrapAfter = 10 + SV.db.SVUnit.fontSize = 10; + SV.db.SVUnit.player.width = 200; + SV.db.SVUnit.player.castbar.width = 200; + SV.db.SVUnit.player.classbar.fill = "fill" + SV.db.SVUnit.player.health.tags = "[health:color][health:current]" + SV.db.SVUnit.target.width = 200; + SV.db.SVUnit.target.castbar.width = 200; + SV.db.SVUnit.target.health.tags = "[health:color][health:current]" + SV.db.SVUnit.pet.power.enable = false; + SV.db.SVUnit.pet.width = 200; + SV.db.SVUnit.pet.height = 26; + SV.db.SVUnit.targettarget.debuffs.enable = false; + SV.db.SVUnit.targettarget.power.enable = false; + SV.db.SVUnit.targettarget.width = 200; + SV.db.SVUnit.targettarget.height = 26; + SV.db.SVUnit.boss.width = 200; + SV.db.SVUnit.boss.castbar.width = 200; + SV.db.SVUnit.arena.width = 200; + SV.db.SVUnit.arena.castbar.width = 200 + end + if not mungs then + UFMoveBottomQuadrant(true) + UFMoveLeftQuadrant(true) + UFMoveTopQuadrant(true) + UFMoveRightQuadrant(true) + end + SV.ghettoMonitor = true + else + SV.db:SetDefault("SVDock") + SV.db:SetDefault("SVAura") + if not mungs then + UFMoveBottomQuadrant() + UFMoveLeftQuadrant() + UFMoveTopQuadrant() + UFMoveRightQuadrant() + end + SV.ghettoMonitor = nil + end + + if(not preserve and not mungs) then + BarShuffle() + SV:SetSVMovablesPositions() + Registry:Update('SVDock') + Registry:Update('SVAura') + Registry:Update('SVBar') + Registry:Update('SVUnit') + SV:SavedPopup() + end +end +--[[ +########################################################## +GLOBAL/MODULE FUNCTIONS +########################################################## +]]-- +function Setup:LoadPresetData(category, theme) + if(not PRESET_DATA) then LoadAllPresets() end + if(PRESET_DATA and PRESET_DATA[category] and PRESET_DATA[category]["link"]) then + theme = theme or "default" + local saved = PRESET_DATA[category]["link"] + local preset = PRESET_DATA[category][theme] + _copyPresets(SV.db[saved], preset) + end +end + +function Setup:SetColorTheme(style, preserve) + style = style or "default"; + + if not preserve then + SV.db:SetDefault("media") + end + + local presets = self:LoadPresetData("media", style) + SV.db.LAYOUT.mediastyle = style; + + if(style == "default") then + SV.db.SVUnit.healthclass = true; + else + SV.db.SVUnit.healthclass = false; + end + + if(not mungs) then + SV:MediaUpdate() + Registry:Update('SVStats') + Registry:Update('SVUnit') + if(not preserve) then + SV:SavedPopup() + end + end +end + +function Setup:SetUnitframeLayout(style, preserve) + style = style or "default"; + + if not SV.db.framelocations then SV.db.framelocations = {} end + + if not preserve then + SV.db:SetDefault("SVUnit") + SV.db:SetDefault("SVStats") + if okToResetMOVE then + SV:ResetMovables('') + okToResetMOVE = false + end + end + + local presets = self:LoadPresetData("units", style) + SV.db.LAYOUT.unitstyle = style + + if(SV.db.LAYOUT.mediastyle == "default") then + SV.db.SVUnit.healthclass = true; + end + + if(not mungs) then + if(not preserve) then + if SV.db.LAYOUT.barstyle and (SV.db.LAYOUT.barstyle == "twosmall" or SV.db.LAYOUT.barstyle == "twobig") then + UFMoveBottomQuadrant("shift") + else + UFMoveBottomQuadrant() + end + SV:SetSVMovablesPositions() + end + Registry:Update('SVStats') + Registry:Update('SVUnit') + if(not preserve) then + SV:SavedPopup() + end + end +end + +function Setup:SetGroupframeLayout(style, preserve) + style = style or "default"; + + local presets = self:LoadPresetData("layouts", style) + SV.db.LAYOUT.groupstyle = style + + if(not mungs) then + Registry:Update('SVUnit') + if(not preserve) then + SV:SavedPopup() + end + end +end + +function Setup:SetupBarLayout(style, preserve) + style = style or "default"; + + if not SV.db.framelocations then SV.db.framelocations={} end + if not preserve then + SV.db:SetDefault("SVBar") + if okToResetMOVE then + SV:ResetMovables('') + okToResetMOVE=false + end + end + + local presets = self:LoadPresetData("bars", style) + SV.db.LAYOUT.barstyle = style; + + if(not mungs) then + if(not preserve) then + if(style == 'twosmall' or style == 'twobig') then + UFMoveBottomQuadrant("shift") + else + UFMoveBottomQuadrant() + end + end + if(not preserve) then + BarShuffle() + SV:SetSVMovablesPositions() + end + Registry:Update('SVStats') + Registry:Update('SVBar') + if(not preserve) then + SV:SavedPopup() + end + end +end + +function Setup:SetupAuralayout(style, preserve) + style = style or "default"; + local presets = self:LoadPresetData("auras", style) + SV.db.LAYOUT.aurastyle = style; + + if(not mungs) then + Registry:Update('SVStats') + Registry:Update('SVAura') + Registry:Update('SVUnit') + if(not preserve) then + SV:SavedPopup() + end + end +end + +local function PlayThemeSong() + if(not musicIsPlaying) then + SetCVar("Sound_MusicVolume", 100) + SetCVar("Sound_EnableMusic", 1) + StopMusic() + PlayMusic([[Interface\AddOns\SVUI\assets\sounds\SV.mp3]]) + musicIsPlaying = true + end +end + +local function InstallComplete() + SVUI_Profile.SAFEDATA.install_version = SV.___version; + StopMusic() + SetCVar("Sound_MusicVolume",user_music_vol) + okToResetMOVE = false; + ReloadUI() +end + +local function InstallMungsChoice() + mungs = true; + okToResetMOVE = false; + InitializeChatFrames(true); + SetUserScreen('high'); + SV:SetColorTheme(); + SV.db.LAYOUT.unitstyle = nil; + SV:SetUnitframeLayout(); + SV.db.LAYOUT.groupstyle = nil; + SV.db.LAYOUT.barstyle = nil; + SV:SetupBarLayout(); + SV:SetupAuralayout(); + SVUI_Profile.SAFEDATA.install_version = SV.___version; + StopMusic() + SetCVar("Sound_MusicVolume",user_music_vol) + ReloadUI() +end + +local function ResetAll() + SVUI_InstallNextButton:Disable() + SVUI_InstallPrevButton:Disable() + SVUI_InstallOption01Button:Hide() + SVUI_InstallOption01Button:SetScript("OnClick",nil) + SVUI_InstallOption01Button:SetText("") + SVUI_InstallOption02Button:Hide() + SVUI_InstallOption02Button:SetScript("OnClick",nil) + SVUI_InstallOption02Button:SetText("") + SVUI_InstallOption03Button:Hide() + SVUI_InstallOption03Button:SetScript("OnClick",nil) + SVUI_InstallOption03Button:SetText("") + SVUI_InstallOption1Button:Hide() + SVUI_InstallOption1Button:SetScript("OnClick",nil) + SVUI_InstallOption1Button:SetText("") + SVUI_InstallOption2Button:Hide() + SVUI_InstallOption2Button:SetScript('OnClick',nil) + SVUI_InstallOption2Button:SetText('') + SVUI_InstallOption3Button:Hide() + SVUI_InstallOption3Button:SetScript('OnClick',nil) + SVUI_InstallOption3Button:SetText('') + SVUI_InstallOption4Button:Hide() + SVUI_InstallOption4Button:SetScript('OnClick',nil) + SVUI_InstallOption4Button:SetText('') + SVUI_SetupHolder.SubTitle:SetText("") + SVUI_SetupHolder.Desc1:SetText("") + SVUI_SetupHolder.Desc2:SetText("") + SVUI_SetupHolder.Desc3:SetText("") + SVUI_SetupHolder:Size(550,400) +end + +local function SetPage(newPage) + CURRENT_PAGE = newPage; + ResetAll() + InstallStatus.text:SetText(CURRENT_PAGE.." / "..MAX_PAGE) + local setupFrame = SVUI_SetupHolder; + if newPage ~= MAX_PAGE then + SVUI_InstallNextButton:Enable() + SVUI_InstallNextButton:Show() + end + if newPage ~= 1 then + SVUI_InstallPrevButton:Enable() + SVUI_InstallPrevButton:Show() + end + --[[ + more useful globalstrings + + CUSTOM + SETTINGS + DEFAULT + DEFAULTS + USE + UIOPTIONS_MENU + LFGWIZARD_TITLE + CONTINUE + ]]-- + ShowLayout() + if newPage == 1 then + local hasOldConfig = SVUI_Profile.SAFEDATA.install_version + SVUI_InstallPrevButton:Disable() + SVUI_InstallPrevButton:Hide() + okToResetMOVE = true + setupFrame.SubTitle:SetText(format(L["This is Supervillain UI version %s!"], SV.___version)) + setupFrame.Desc1:SetText(L["Before I can turn you loose, persuing whatever villainy you feel will advance your professional career... I need to ask some questions and turn a few screws first."]) + setupFrame.Desc2:SetText(L["At any time you can get to the config options by typing the command / sv. For quick changes to frame, bar or color sets, call your henchman by clicking the button on the bottom right of your screen. (Its the one with his stupid face on it)"]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + SVUI_InstallOption01Button:Show() + SVUI_InstallOption01Button:SetScript("OnClick", InstallMungsChoice) + SVUI_InstallOption01Button:SetText(USE.."\n"..DEFAULT.."\n"..SETTINGS) + + SVUI_InstallOption02Button:Show() + SVUI_InstallOption02Button:SetScript("OnClick", InstallComplete) + SVUI_InstallOption02Button:SetText("PRETEND YOU\nDID THIS\nALREADY") + + if(hasOldConfig) then + SVUI_InstallOption03Button:Show() + SVUI_InstallOption03Button:SetScript("OnClick", InstallComplete) + SVUI_InstallOption03Button:SetText("Keep\nSaved\n"..SETTINGS) + end + + elseif newPage == 2 then + setupFrame.SubTitle:SetText(CHAT) + setupFrame.Desc1:SetText(L["Whether you want to or not, you will be needing a communicator so other villains can either update you on their doings-of-evil or inform you about the MANY abilities of Chuck Norris"]) + setupFrame.Desc2:SetText(L["The chat windows function the same as standard chat windows, you can right click the tabs and drag them, rename them, slap them around, you know... whatever. Clickity-click to setup your chat windows."]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", function() + InitializeChatFrames(false) + end) + SVUI_InstallOption1Button:SetText(CHAT_DEFAULTS) + + elseif newPage == 3 then + local rez = GetCVar("gxResolution") + setupFrame.SubTitle:SetText(RESOLUTION) + setupFrame.Desc1:SetText(format(L["Your current resolution is %s, this is considered a %s resolution."], rez, (SV.ghettoMonitor and LOW or HIGH))) + if SV.ghettoMonitor then + setupFrame.Desc2:SetText(L["This resolution requires that you change some settings to get everything to fit on your screen."].." "..L["Click the button below to resize your chat frames, unitframes, and reposition your actionbars."].." "..L["You may need to further alter these settings depending how low your resolution is."]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + else + setupFrame.Desc2:SetText(L["This resolution doesn't require that you change settings for the UI to fit on your screen."].." "..L["Click the button below to resize your chat frames, unitframes, and reposition your actionbars."].." "..L["This is completely optional."]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + end + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", function() + SetUserScreen("high") + SVUI_SetupHolder.Desc1:SetText(L["|cffFF9F00"..HIGH.." "..RESOLUTION.."!|r"]) + SVUI_SetupHolder.Desc2:SetText(L["So what you think your better than me with your big monitor? HUH?!?!"]) + SVUI_SetupHolder.Desc3:SetText(L["Dont forget whos in charge here! But enjoy the incredible detail."]) + end) + SVUI_InstallOption1Button:SetText(HIGH) + SVUI_InstallOption2Button:Show() + SVUI_InstallOption2Button:SetScript("OnClick", function() + SetUserScreen("low") + SVUI_SetupHolder.Desc1:SetText(L["|cffFF9F00"..LOW.." "..RESOLUTION.."|r"]) + SVUI_SetupHolder.Desc2:SetText(L["Why are you playing this on what I would assume is a calculator display?"]) + SVUI_SetupHolder.Desc3:SetText(L["Enjoy the ONE incredible pixel that fits on this screen."]) + end) + SVUI_InstallOption2Button:SetText(LOW) + + elseif newPage == 4 then + setupFrame.SubTitle:SetText(COLOR.." "..SETTINGS) + setupFrame.Desc1:SetText(L["Choose a theme layout you wish to use for your initial setup."]) + setupFrame.Desc2:SetText(L["You can always change fonts and colors of any element of Supervillain UI from the in-game configuration."]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", function() + SV:SetColorTheme("kaboom") + SVUI_SetupHolder.Desc1:SetText(L["|cffFF9F00KABOOOOM!|r"]) + SVUI_SetupHolder.Desc2:SetText(L["This theme tells the world that you are a villain who can put on a show"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["or better yet, you ARE the show!"]) + end) + SVUI_InstallOption1Button:SetText(L["Kaboom!"]) + SVUI_InstallOption2Button:Show() + SVUI_InstallOption2Button:SetScript("OnClick", function() + SV:SetColorTheme("dark") + SVUI_SetupHolder.Desc1:SetText(L["|cffAF30FFThe Darkest Night|r"]) + SVUI_SetupHolder.Desc2:SetText(L["This theme indicates that you have no interest in wasting time"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L[" the dying begins NOW!"]) + end) + SVUI_InstallOption2Button:SetText(L["Darkness"]) + SVUI_InstallOption3Button:Show() + SVUI_InstallOption3Button:SetScript("OnClick", function() + SV:SetColorTheme("classy") + SVUI_SetupHolder.Desc1:SetText(L["|cffFFFF00"..CLASS_COLORS.."|r"]) + SVUI_SetupHolder.Desc2:SetText(L["This theme is for villains who take pride in their class"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L[" villains know how to reprezent!"]) + end) + SVUI_InstallOption3Button:SetText(L["Class" .. "\n" .. "Colors"]) + SVUI_InstallOption4Button:Show() + SVUI_InstallOption4Button:SetScript("OnClick", function() + SV:SetColorTheme() + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFPlain and Simple|r"]) + SVUI_SetupHolder.Desc2:SetText(L["This theme is for any villain who sticks to their traditions"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["you don't need fancyness to kick some ass!"]) + end) + SVUI_InstallOption4Button:SetText(L["Vintage"]) + + elseif newPage == 5 then + ShowLayout(true) + setupFrame.SubTitle:SetText(UNITFRAME_LABEL.." "..SETTINGS) + setupFrame.Desc1:SetText(L["You can now choose what primary unitframe style you wish to use."]) + setupFrame.Desc2:SetText(L["This will change the layout of your unitframes (ie.. Player, Target, Pet, Party, Raid ...etc)."]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", function() + SV.db.LAYOUT.unitstyle = nil; + SV:SetUnitframeLayout("super") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFLets Do This|r"]) + SVUI_SetupHolder.Desc2:SetText(L["This layout is anything but minimal! Using this is like being at a rock concert"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["then annihilating the crowd with frickin lazer beams!"]) + end) + SVUI_InstallOption1Button:SetText(L["Super"]) + SVUI_InstallOption2Button:Show() + SVUI_InstallOption2Button:SetScript("OnClick", function() + SV.db.LAYOUT.unitstyle = nil; + SV:SetUnitframeLayout("simple") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFSimply Simple|r"]) + SVUI_SetupHolder.Desc2:SetText(L["This layout is for the villain who just wants to get things done!"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["but he still wants to see your face before he hits you!"]) + end) + SVUI_InstallOption2Button:SetText(L["Simple"]) + SVUI_InstallOption3Button:Show() + SVUI_InstallOption3Button:SetScript("OnClick", function() + SV.db.LAYOUT.unitstyle = nil; + SV:SetUnitframeLayout("compact") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFEl Compacto|r"]) + SVUI_SetupHolder.Desc2:SetText(L["Just the necessities so you can see more of the world around you"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["you dont need no fanciness getting in the way of world domination do you?"]) + end) + SVUI_InstallOption3Button:SetText(L["Compact"]) + + elseif newPage == 6 then + ShowLayout(true) + setupFrame.SubTitle:SetText("Group Layout") + setupFrame.Desc1:SetText(L["You can now choose what group layout you prefer."]) + setupFrame.Desc2:SetText(L["This will adjust various settings on group units, attempting to make certain roles more usable"]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", function() + SV.db.LAYOUT.groupstyle = "default"; + SV:SetGroupframeLayout("default") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFStandard|r"]) + SVUI_SetupHolder.Desc2:SetText(L["You are good to go with the default layout"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["frames schmames, lets kill some stuff!"]) + end) + SVUI_InstallOption1Button:SetText(L["Standard"]) + + SVUI_InstallOption2Button:Show() + SVUI_InstallOption2Button:SetScript("OnClick", function() + SV.db.LAYOUT.groupstyle = nil; + SV:SetGroupframeLayout("healer") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFMEDIC!!|r"]) + SVUI_SetupHolder.Desc2:SetText(L["You are pretty helpful.. for a VILLAIN!"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["Hey, even a super villain gets his ass kicked once in awhile. We need the likes of you!"]) + end) + SVUI_InstallOption2Button:SetText(L["Healer"]) + + SVUI_InstallOption3Button:Show() + SVUI_InstallOption3Button:SetScript("OnClick", function() + SV.db.LAYOUT.groupstyle = nil; + SV:SetGroupframeLayout("dps") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFDeath Dealer|r"]) + SVUI_SetupHolder.Desc2:SetText(L["You are the kings of our craft. Handing out pain like its halloween candy."]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["I will move and squeeze group frames out of your way so you have more room for BOOM!"]) + end) + SVUI_InstallOption3Button:SetText(L["DPS"]) + + SVUI_InstallOption4Button:Show() + SVUI_InstallOption4Button:SetScript("OnClick", function() + SV.db.LAYOUT.groupstyle = nil; + SV:SetGroupframeLayout("grid") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFCubed|r"]) + SVUI_SetupHolder.Desc2:SetText(L["You are cold and calculated, your frames should reflect as much."]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["I'm gonna make these frames so precise that you can cut your finger on them!"]) + end) + SVUI_InstallOption4Button:SetText(L["Grid"]) + + elseif newPage == 7 then + setupFrame.SubTitle:SetText(ACTIONBAR_LABEL.." "..SETTINGS) + setupFrame.Desc1:SetText(L["Choose a layout for your action bars."]) + setupFrame.Desc2:SetText(L["Sometimes you need big buttons, sometimes you don't. Your choice here."]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", function() + SV.db.LAYOUT.barstyle = nil; + SV:SetupBarLayout("default") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFLean And Clean|r"]) + SVUI_SetupHolder.Desc2:SetText(L["Lets keep it slim and deadly, not unlike a ninja sword."]) + SVUI_SetupHolder.Desc3:SetText(L["You dont ever even look at your bar hardly, so pick this one!"]) + end) + SVUI_InstallOption1Button:SetText(L["Small" .. "\n" .. "Row"]) + SVUI_InstallOption2Button:Show() + SVUI_InstallOption2Button:SetScript("OnClick", function() + SV.db.LAYOUT.barstyle = nil; + SV:SetupBarLayout("twosmall") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFMore For Less|r"]) + SVUI_SetupHolder.Desc2:SetText(L["Granted, you dont REALLY need the buttons due to your hotkey-leetness, you just like watching cooldowns!"]) + SVUI_SetupHolder.Desc3:SetText(L["Sure thing cowboy, your secret is safe with me!"]) + end) + SVUI_InstallOption2Button:SetText(L["2 Small" .. "\n" .. "Rows"]) + SVUI_InstallOption3Button:Show() + SVUI_InstallOption3Button:SetScript("OnClick", function() + SV.db.LAYOUT.barstyle = nil; + SV:SetupBarLayout("onebig") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFWhat Big Buttons You Have|r"]) + SVUI_SetupHolder.Desc2:SetText(L["The better to PEW-PEW you with my dear!"]) + SVUI_SetupHolder.Desc3:SetText(L["When you have little time for mouse accuracy, choose this set!"]) + end) + SVUI_InstallOption3Button:SetText(L["Big" .. "\n" .. "Row"]) + SVUI_InstallOption4Button:Show() + SVUI_InstallOption4Button:SetScript("OnClick", function() + SV.db.LAYOUT.barstyle = nil; + SV:SetupBarLayout("twobig") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFThe Double Down|r"]) + SVUI_SetupHolder.Desc2:SetText(L["Lets be honest for a moment. Who doesnt like a huge pair in their face?"]) + SVUI_SetupHolder.Desc3:SetText(L["Double your bars then double their size for maximum button goodness!"]) + end) + SVUI_InstallOption4Button:SetText(L["2 Big" .. "\n" .. "Rows"]) + + elseif newPage == 8 then + setupFrame.SubTitle:SetText(AURAS.." "..SETTINGS) + setupFrame.Desc1:SetText(L["Select an aura layout. \"Icons\" will display only icons and aurabars won't be used. \"Bars\" will display only aurabars and icons won't be used (duh). \"The Works!\" does just what it says.... icons, bars and awesomeness."]) + setupFrame.Desc2:SetText(L["If you have an aura that you don't want to display simply hold down shift and right click the icon for it to suffer a painful death."]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", function() + SV:SetupAuralayout() + end) + SVUI_InstallOption1Button:SetText(L["Vintage"]) + + SVUI_InstallOption2Button:Show() + SVUI_InstallOption2Button:SetScript("OnClick", function() + SV:SetupAuralayout("icons") + end) + SVUI_InstallOption2Button:SetText(L["Icons"]) + + SVUI_InstallOption3Button:Show() + SVUI_InstallOption3Button:SetScript("OnClick", function() + SV:SetupAuralayout("bars") + end) + SVUI_InstallOption3Button:SetText(L["Bars"]) + + SVUI_InstallOption4Button:Show() + SVUI_InstallOption4Button:SetScript("OnClick", function() + SV:SetupAuralayout("theworks") + end) + SVUI_InstallOption4Button:SetText(L["The" .. "\n" .. "Works!"]) + + elseif newPage == 9 then + SVUI_InstallNextButton:Disable() + SVUI_InstallNextButton:Hide() + setupFrame.SubTitle:SetText(BASIC_OPTIONS_TOOLTIP..CONTINUED..AUCTION_TIME_LEFT0) + setupFrame.Desc1:SetText(L["Thats it! All done! Now we just need to hand these choices off to the henchmen so they can get you ready to (..insert evil tasks here..)!"]) + setupFrame.Desc2:SetText(L["Click the button below to reload and get on your way! Good luck villain!"]) + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", InstallComplete) + SVUI_InstallOption1Button:SetText(L["THE_BUTTON_BELOW"]) + SVUI_SetupHolder:Size(550, 350) + end +end + +local function NextPage() + if CURRENT_PAGE ~= MAX_PAGE then + CURRENT_PAGE = CURRENT_PAGE + 1; + SetPage(CURRENT_PAGE) + end +end + +local function PreviousPage() + if CURRENT_PAGE ~= 1 then + CURRENT_PAGE = CURRENT_PAGE - 1; + SetPage(CURRENT_PAGE) + end +end + +local function ResetGlobalVariables() + for k,v in pairs(SVUI_Cache) do + SVUI_Cache[k] = nil + end +end + +function Setup:Reset() + mungs = true; + okToResetMOVE = false; + InitializeChatFrames(true); + SV.db:Reset() + SetUserScreen(); + + if SV.db.LAYOUT.mediastyle then + SV:SetColorTheme(SV.db.LAYOUT.mediastyle) + else + SV.db.LAYOUT.mediastyle = nil; + SV:SetColorTheme() + end + + if SV.db.LAYOUT.unitstyle then + SV:SetUnitframeLayout(SV.db.LAYOUT.unitstyle) + else + SV.db.LAYOUT.unitstyle = nil; + SV:SetUnitframeLayout() + end + + if SV.db.LAYOUT.barstyle then + SV:SetupBarLayout(SV.db.LAYOUT.barstyle) + else + SV.db.LAYOUT.barstyle = nil; + SV:SetupBarLayout() + end + + if SV.db.LAYOUT.aurastyle then + SV:SetupAuralayout(SV.db.LAYOUT.aurastyle) + else + SV.db.LAYOUT.aurastyle = nil; + SV:SetupAuralayout() + end + + SVUI_Profile.SAFEDATA.install_version = SV.___version; + ResetGlobalVariables() + ReloadUI() +end + +function Setup:Install(autoLoaded) + if(not user_music_vol) then + user_music_vol = GetCVar("Sound_MusicVolume") + end + + -- frame + if not SVUI_SetupHolder then + local frame = CreateFrame("Button", "SVUI_SetupHolder", UIParent) + frame.SetPage = SetPage; + frame:Size(550, 400) + frame:SetPanelTemplate("Action") + frame:SetPoint("CENTER") + frame:SetFrameStrata("TOOLTIP") + frame.Title = frame:CreateFontString(nil, "OVERLAY") + frame.Title:SetFont(SV.Media.font.narrator, 22, "OUTLINE") + frame.Title:Point("TOP", 0, -5) + frame.Title:SetText(L["Supervillain UI Installation"]) + + frame.Next = CreateFrame("Button", "SVUI_InstallNextButton", frame, "UIPanelButtonTemplate") + frame.Next:RemoveTextures() + frame.Next:Size(110, 25) + frame.Next:Point("BOTTOMRIGHT", 50, 5) + SetInstallButton(frame.Next) + frame.Next.texture = frame.Next:CreateTexture(nil, "BORDER") + frame.Next.texture:Size(110, 75) + frame.Next.texture:Point("RIGHT") + frame.Next.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION-ARROW") + frame.Next.texture:SetVertexColor(1, 0.5, 0) + frame.Next.text = frame.Next:CreateFontString(nil, "OVERLAY") + frame.Next.text:SetFont(SV.Media.font.action, 18, "OUTLINE") + frame.Next.text:SetPoint("CENTER") + frame.Next.text:SetText(CONTINUE) + frame.Next:Disable() + frame.Next:SetScript("OnClick", NextPage) + frame.Next:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(1, 1, 0) + end) + frame.Next:SetScript("OnLeave", function(this) + this.texture:SetVertexColor(1, 0.5, 0) + end) + + frame.Prev = CreateFrame("Button", "SVUI_InstallPrevButton", frame, "UIPanelButtonTemplate") + frame.Prev:RemoveTextures() + frame.Prev:Size(110, 25) + frame.Prev:Point("BOTTOMLEFT", -50, 5) + SetInstallButton(frame.Prev) + frame.Prev.texture = frame.Prev:CreateTexture(nil, "BORDER") + frame.Prev.texture:Size(110, 75) + frame.Prev.texture:Point("LEFT") + frame.Prev.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION-ARROW") + frame.Prev.texture:SetTexCoord(1, 0, 1, 1, 0, 0, 0, 1) + frame.Prev.texture:SetVertexColor(1, 0.5, 0) + frame.Prev.text = frame.Prev:CreateFontString(nil, "OVERLAY") + frame.Prev.text:SetFont(SV.Media.font.action, 18, "OUTLINE") + frame.Prev.text:SetPoint("CENTER") + frame.Prev.text:SetText(PREVIOUS) + frame.Prev:Disable() + frame.Prev:SetScript("OnClick", PreviousPage) + frame.Prev:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(1, 1, 0) + end) + frame.Prev:SetScript("OnLeave", function(this) + this.texture:SetVertexColor(1, 0.5, 0) + end) + frame.Status = CreateFrame("Frame", "InstallStatus", frame) + frame.Status:SetFrameLevel(frame.Status:GetFrameLevel() + 2) + frame.Status:Size(150, 30) + frame.Status:Point("BOTTOM", frame, "TOP", 0, 2) + frame.Status.text = frame.Status:CreateFontString(nil, "OVERLAY") + frame.Status.text:SetFont(SV.Media.font.numbers, 22, "OUTLINE") + frame.Status.text:SetPoint("CENTER") + frame.Status.text:SetText(CURRENT_PAGE.." / "..MAX_PAGE) + + frame.Option01 = CreateFrame("Button", "SVUI_InstallOption01Button", frame, "UIPanelButtonTemplate") + frame.Option01:RemoveTextures() + frame.Option01:Size(160, 30) + frame.Option01:Point("BOTTOM", 0, 15) + frame.Option01:SetText("") + SetInstallButton(frame.Option01) + frame.Option01.texture = frame.Option01:CreateTexture(nil, "BORDER") + frame.Option01.texture:Size(160, 160) + frame.Option01.texture:Point("CENTER", frame.Option01, "BOTTOM", 0, -15) + frame.Option01.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") + frame.Option01.texture:SetGradient("VERTICAL", 0, 0.3, 0, 0, 0.7, 0) + frame.Option01:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(0.5, 1, 0.4) + end) + frame.Option01:SetScript("OnLeave", function(this) + this.texture:SetGradient("VERTICAL", 0, 0.3, 0, 0, 0.7, 0) + end) + hooksecurefunc(frame.Option01, "SetWidth", function(g, h) + g.texture:Size(h, h) + g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) + end) + frame.Option01:SetFrameLevel(frame.Option01:GetFrameLevel() + 10) + frame.Option01:Hide() + + frame.Option02 = CreateFrame("Button", "SVUI_InstallOption02Button", frame, "UIPanelButtonTemplate") + frame.Option02:RemoveTextures() + frame.Option02:Size(130, 30) + frame.Option02:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) + frame.Option02:SetText("") + SetInstallButton(frame.Option02) + frame.Option02.texture = frame.Option02:CreateTexture(nil, "BORDER") + frame.Option02.texture:Size(130, 110) + frame.Option02.texture:Point("CENTER", frame.Option02, "BOTTOM", 0, -15) + frame.Option02.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") + frame.Option02.texture:SetGradient("VERTICAL", 0.3, 0, 0, 0.7, 0, 0) + frame.Option02:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(0.5, 1, 0.4) + end) + frame.Option02:SetScript("OnLeave", function(this) + this.texture:SetGradient("VERTICAL", 0.3, 0, 0, 0.7, 0, 0) + end) + hooksecurefunc(frame.Option02, "SetWidth", function(g, h) + g.texture:Size(h, h) + g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) + end) + frame.Option02:SetScript("OnShow", function() + frame.Option01:SetWidth(130) + frame.Option01:ClearAllPoints() + frame.Option01:Point("BOTTOMRIGHT", frame, "BOTTOM", -4, 15) + end) + frame.Option02:SetScript("OnHide", function() + frame.Option01:SetWidth(160) + frame.Option01:ClearAllPoints() + frame.Option01:Point("BOTTOM", 0, 15) + end) + frame.Option02:SetFrameLevel(frame.Option01:GetFrameLevel() + 10) + frame.Option02:Hide() + + frame.Option03 = CreateFrame("Button", "SVUI_InstallOption03Button", frame, "UIPanelButtonTemplate") + frame.Option03:RemoveTextures() + frame.Option03:Size(130, 30) + frame.Option03:Point("BOTTOM", frame, "BOTTOM", 0, 15) + frame.Option03:SetText("") + SetInstallButton(frame.Option03) + frame.Option03.texture = frame.Option03:CreateTexture(nil, "BORDER") + frame.Option03.texture:Size(130, 110) + frame.Option03.texture:Point("CENTER", frame.Option03, "BOTTOM", 0, -15) + frame.Option03.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") + frame.Option03.texture:SetGradient("VERTICAL", 0, 0.1, 0.3, 0, 0.5, 0.7) + frame.Option03:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(0.2, 0.5, 1) + end) + frame.Option03:SetScript("OnLeave", function(this) + this.texture:SetGradient("VERTICAL", 0, 0.1, 0.3, 0, 0.5, 0.7) + end) + hooksecurefunc(frame.Option03, "SetWidth", function(g, h) + g.texture:Size(h, h) + g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) + end) + frame.Option03:SetScript("OnShow", function(self) + self:SetWidth(130) + frame.Option01:SetWidth(130) + frame.Option01:ClearAllPoints() + frame.Option01:Point("RIGHT", self, "LEFT", -8, 0) + frame.Option02:SetWidth(130) + frame.Option02:ClearAllPoints() + frame.Option02:Point("LEFT", self, "RIGHT", 8, 0) + end) + frame.Option03:SetScript("OnHide", function() + frame.Option01:SetWidth(160) + frame.Option01:ClearAllPoints() + frame.Option01:Point("BOTTOM", 0, 15) + frame.Option02:ClearAllPoints() + frame.Option02:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) + end) + frame.Option03:SetFrameLevel(frame.Option01:GetFrameLevel() + 10) + frame.Option03:Hide() + + frame.Option1 = CreateFrame("Button", "SVUI_InstallOption1Button", frame, "UIPanelButtonTemplate") + frame.Option1:RemoveTextures() + frame.Option1:Size(160, 30) + frame.Option1:Point("BOTTOM", 0, 15) + frame.Option1:SetText("") + SetInstallButton(frame.Option1) + frame.Option1.texture = frame.Option1:CreateTexture(nil, "BORDER") + frame.Option1.texture:Size(160, 160) + frame.Option1.texture:Point("CENTER", frame.Option1, "BOTTOM", 0, -15) + frame.Option1.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") + frame.Option1.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + frame.Option1:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(0.5, 1, 0.4) + end) + frame.Option1:SetScript("OnLeave", function(this) + this.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + end) + hooksecurefunc(frame.Option1, "SetWidth", function(g, h) + g.texture:Size(h, h) + g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) + end) + frame.Option1:SetFrameLevel(frame.Option1:GetFrameLevel() + 10) + frame.Option1:Hide() + + frame.Option2 = CreateFrame("Button", "SVUI_InstallOption2Button", frame, "UIPanelButtonTemplate") + frame.Option2:RemoveTextures() + frame.Option2:Size(120, 30) + frame.Option2:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) + frame.Option2:SetText("") + SetInstallButton(frame.Option2) + frame.Option2.texture = frame.Option2:CreateTexture(nil, "BORDER") + frame.Option2.texture:Size(120, 110) + frame.Option2.texture:Point("CENTER", frame.Option2, "BOTTOM", 0, -15) + frame.Option2.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") + frame.Option2.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + frame.Option2:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(0.5, 1, 0.4) + end) + frame.Option2:SetScript("OnLeave", function(this) + this.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + end) + hooksecurefunc(frame.Option2, "SetWidth", function(g, h) + g.texture:Size(h, h) + g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) + end) + frame.Option2:SetScript("OnShow", function() + frame.Option1:SetWidth(120) + frame.Option1:ClearAllPoints() + frame.Option1:Point("BOTTOMRIGHT", frame, "BOTTOM", -4, 15) + end) + frame.Option2:SetScript("OnHide", function() + frame.Option1:SetWidth(160) + frame.Option1:ClearAllPoints() + frame.Option1:Point("BOTTOM", 0, 15) + end) + frame.Option2:SetFrameLevel(frame.Option1:GetFrameLevel() + 10) + frame.Option2:Hide() + + frame.Option3 = CreateFrame("Button", "SVUI_InstallOption3Button", frame, "UIPanelButtonTemplate") + frame.Option3:RemoveTextures() + frame.Option3:Size(110, 30) + frame.Option3:Point("LEFT", frame.Option2, "RIGHT", 4, 0) + frame.Option3:SetText("") + SetInstallButton(frame.Option3) + frame.Option3.texture = frame.Option3:CreateTexture(nil, "BORDER") + frame.Option3.texture:Size(110, 100) + frame.Option3.texture:Point("CENTER", frame.Option3, "BOTTOM", 0, -9) + frame.Option3.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") + frame.Option3.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + frame.Option3:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(0.5, 1, 0.4) + end) + frame.Option3:SetScript("OnLeave", function(this) + this.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + end) + frame.Option3:SetScript("OnShow", function() + frame.Option1:SetWidth(110) + frame.Option1:ClearAllPoints() + frame.Option1:Point("RIGHT", frame.Option2, "LEFT", -4, 0) + frame.Option2:SetWidth(110) + frame.Option2:ClearAllPoints() + frame.Option2:Point("BOTTOM", frame, "BOTTOM", 0, 15) + end) + frame.Option3:SetScript("OnHide", function() + frame.Option1:SetWidth(160) + frame.Option1:ClearAllPoints() + frame.Option1:Point("BOTTOM", 0, 15) + frame.Option2:SetWidth(120) + frame.Option2:ClearAllPoints() + frame.Option2:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) + end) + frame.Option3:SetFrameLevel(frame.Option1:GetFrameLevel() + 10) + frame.Option3:Hide() + + frame.Option4 = CreateFrame("Button", "SVUI_InstallOption4Button", frame, "UIPanelButtonTemplate") + frame.Option4:RemoveTextures() + frame.Option4:Size(110, 30) + frame.Option4:Point("LEFT", frame.Option3, "RIGHT", 4, 0) + frame.Option4:SetText("") + SetInstallButton(frame.Option4) + frame.Option4.texture = frame.Option4:CreateTexture(nil, "BORDER") + frame.Option4.texture:Size(110, 100) + frame.Option4.texture:Point("CENTER", frame.Option4, "BOTTOM", 0, -9) + frame.Option4.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") + frame.Option4.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + frame.Option4:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(0.5, 1, 0.4) + end) + frame.Option4:SetScript("OnLeave", function(this) + this.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + end) + frame.Option4:SetScript("OnShow", function() + frame.Option1:Width(110) + frame.Option2:Width(110) + frame.Option1:ClearAllPoints() + frame.Option1:Point("RIGHT", frame.Option2, "LEFT", -4, 0) + frame.Option2:ClearAllPoints() + frame.Option2:Point("BOTTOMRIGHT", frame, "BOTTOM", -4, 15) + end) + frame.Option4:SetScript("OnHide", function() + frame.Option1:SetWidth(160) + frame.Option1:ClearAllPoints() + frame.Option1:Point("BOTTOM", 0, 15) + frame.Option2:SetWidth(120) + frame.Option2:ClearAllPoints() + frame.Option2:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) + end) + + frame.Option4:SetFrameLevel(frame.Option1:GetFrameLevel() + 10) + frame.Option4:Hide() + + frame.SubTitle = frame:CreateFontString(nil, "OVERLAY") + frame.SubTitle:SetFont(SV.Media.font.roboto, 16, "OUTLINE") + frame.SubTitle:Point("TOP", 0, -40) + frame.Desc1 = frame:CreateFontString(nil, "OVERLAY") + frame.Desc1:SetFont(SV.Media.font.roboto, 14, "OUTLINE") + frame.Desc1:Point("TOPLEFT", 20, -75) + frame.Desc1:Width(frame:GetWidth()-40) + frame.Desc2 = frame:CreateFontString(nil, "OVERLAY") + frame.Desc2:SetFont(SV.Media.font.roboto, 14, "OUTLINE") + frame.Desc2:Point("TOPLEFT", 20, -125) + frame.Desc2:Width(frame:GetWidth()-40) + frame.Desc3 = frame:CreateFontString(nil, "OVERLAY") + frame.Desc3:SetFont(SV.Media.font.roboto, 14, "OUTLINE") + frame.Desc3:Point("TOPLEFT", 20, -175) + frame.Desc3:Width(frame:GetWidth()-40) + local closeButton = CreateFrame("Button", "SVUI_InstallCloseButton", frame, "UIPanelCloseButton") + closeButton:SetPoint("TOPRIGHT", frame, "TOPRIGHT") + closeButton:SetScript("OnClick", function()frame:Hide()end) + frame.tutorialImage = frame:CreateTexture("InstallTutorialImage", "OVERLAY") + frame.tutorialImage:Size(256, 128) + frame.tutorialImage:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\SPLASH") + frame.tutorialImage:Point("BOTTOM", 0, 70) + end + + SVUI_SetupHolder:SetScript("OnHide", function() + StopMusic() + SetCVar("Sound_MusicVolume", user_music_vol) + musicIsPlaying = nil + end) + + SVUI_SetupHolder:Show() + NextPage() + if(not autoLoaded) then + PlayThemeSong() + else + SV.Timers:ExecuteTimer(PlayThemeSong, 5) + end +end + +SV.Setup = Setup \ No newline at end of file diff --git a/Interface/AddOns/SVUI/language/chinese_ui.lua b/Interface/AddOns/SVUI/language/chinese_ui.lua index 01848f6..a21ab8e 100644 --- a/Interface/AddOns/SVUI/language/chinese_ui.lua +++ b/Interface/AddOns/SVUI/language/chinese_ui.lua @@ -1,5 +1,5 @@ -local SuperVillain, L = unpack(select(2, ...)) -local L = SuperVillain:SetLocaleStrings("zhCN"); +local SV, L = unpack(select(2, ...)) +local L = SV:SetLocaleStrings("zhCN"); if not L then return end --[[REACTION TEXTS]]-- L[" is drinking."] = true; diff --git a/Interface/AddOns/SVUI/language/english_ui.lua b/Interface/AddOns/SVUI/language/english_ui.lua index 42f231c..9447d8e 100644 --- a/Interface/AddOns/SVUI/language/english_ui.lua +++ b/Interface/AddOns/SVUI/language/english_ui.lua @@ -1,5 +1,5 @@ -local SuperVillain, L = unpack(select(2, ...)) -local L = SuperVillain:SetLocaleStrings("enUS", true); +local SV, L = unpack(select(2, ...)) +local L = SV:SetLocaleStrings("enUS", true); if not L then return; end --[[REACTION TEXTS]]-- L[" is drinking."] = true; diff --git a/Interface/AddOns/SVUI/language/french_ui.lua b/Interface/AddOns/SVUI/language/french_ui.lua index 4a4b166..68862c7 100644 --- a/Interface/AddOns/SVUI/language/french_ui.lua +++ b/Interface/AddOns/SVUI/language/french_ui.lua @@ -1,5 +1,5 @@ -local SuperVillain, L = unpack(select(2, ...)) -local L = SuperVillain:SetLocaleStrings("frFR"); +local SV, L = unpack(select(2, ...)) +local L = SV:SetLocaleStrings("frFR"); if not L then return; end --[[REACTION TEXTS]]-- L[" is drinking."] = true; diff --git a/Interface/AddOns/SVUI/language/german_ui.lua b/Interface/AddOns/SVUI/language/german_ui.lua index b66787d..08bc236 100644 --- a/Interface/AddOns/SVUI/language/german_ui.lua +++ b/Interface/AddOns/SVUI/language/german_ui.lua @@ -1,5 +1,5 @@ -local SuperVillain, L = unpack(select(2, ...)) -local L = SuperVillain:SetLocaleStrings("deDE"); +local SV, L = unpack(select(2, ...)) +local L = SV:SetLocaleStrings("deDE"); if not L then return end --[[REACTION TEXTS]]-- L[" is drinking."] = true; diff --git a/Interface/AddOns/SVUI/language/italian_ui.lua b/Interface/AddOns/SVUI/language/italian_ui.lua index c507a6d..17e2ef9 100644 --- a/Interface/AddOns/SVUI/language/italian_ui.lua +++ b/Interface/AddOns/SVUI/language/italian_ui.lua @@ -1,5 +1,5 @@ -local SuperVillain, L = unpack(select(2, ...)) -local L = SuperVillain:SetLocaleStrings("itIT"); +local SV, L = unpack(select(2, ...)) +local L = SV:SetLocaleStrings("itIT"); if not L then return; end --[[REACTION TEXTS]]-- L[" is drinking."] = true; diff --git a/Interface/AddOns/SVUI/language/korean_ui.lua b/Interface/AddOns/SVUI/language/korean_ui.lua index 03d21f5..05bfd00 100644 --- a/Interface/AddOns/SVUI/language/korean_ui.lua +++ b/Interface/AddOns/SVUI/language/korean_ui.lua @@ -1,5 +1,5 @@ -local SuperVillain, L = unpack(select(2, ...)) -local L = SuperVillain:SetLocaleStrings("koKR"); +local SV, L = unpack(select(2, ...)) +local L = SV:SetLocaleStrings("koKR"); if not L then return; end --[[REACTION TEXTS]]-- L[" is drinking."] = true; diff --git a/Interface/AddOns/SVUI/language/portuguese_ui.lua b/Interface/AddOns/SVUI/language/portuguese_ui.lua index 8d18575..c2f89aa 100644 --- a/Interface/AddOns/SVUI/language/portuguese_ui.lua +++ b/Interface/AddOns/SVUI/language/portuguese_ui.lua @@ -1,5 +1,5 @@ -local SuperVillain, L = unpack(select(2, ...)) -local L = SuperVillain:SetLocaleStrings("ptBR"); +local SV, L = unpack(select(2, ...)) +local L = SV:SetLocaleStrings("ptBR"); if not L then return; end --[[REACTION TEXTS]]-- L[" is drinking."] = true; diff --git a/Interface/AddOns/SVUI/language/russian_ui.lua b/Interface/AddOns/SVUI/language/russian_ui.lua index feae31d..c4dc965 100644 --- a/Interface/AddOns/SVUI/language/russian_ui.lua +++ b/Interface/AddOns/SVUI/language/russian_ui.lua @@ -1,5 +1,5 @@ -local SuperVillain, L = unpack(select(2, ...)) -local L = SuperVillain:SetLocaleStrings("ruRU"); +local SV, L = unpack(select(2, ...)) +local L = SV:SetLocaleStrings("ruRU"); if not L then return; end --[[REACTION TEXTS]]-- L[" is drinking."] = true; diff --git a/Interface/AddOns/SVUI/language/spanish_ui.lua b/Interface/AddOns/SVUI/language/spanish_ui.lua index 94b5d87..83dfdf0 100644 --- a/Interface/AddOns/SVUI/language/spanish_ui.lua +++ b/Interface/AddOns/SVUI/language/spanish_ui.lua @@ -1,7 +1,7 @@ -local SuperVillain, L = unpack(select(2, ...)) -local L = SuperVillain:SetLocaleStrings("esES"); +local SV, L = unpack(select(2, ...)) +local L = SV:SetLocaleStrings("esES"); if not L then - L = SuperVillain:SetLocaleStrings("esMX") + L = SV:SetLocaleStrings("esMX") end if not L then return; end --[[REACTION TEXTS]]-- @@ -426,7 +426,7 @@ L["You can access copy chat and chat menu functions by mouse over the top right L["You can see someones average item level of their gear by holding shift and mousing over them. It should appear inside the tooltip."]="Puedes ver la media de nivel de objeto de un objetivo manteniendo pulsado shift mientras pasas el ratón por encima de él. El iNvl aparecerá en la descripción emergente." L["You can set your keybinds quickly by typing /kb."]="Puedes establecer tus atajos rapidamente escribiendo /kb." L["You can toggle the microbar by using your middle mouse button on the minimap you can also accomplish this by enabling the actual microbar located in the actionbar settings."]="Puedes acceder a la microbarra usando tu botón central del ratón sobre el minimapa. También puedes activarla desde las opciones de las barras de acción." -L["You can use the /resetui command to reset all of your moveables. You can also use the command to reset a specific mover, /resetui <mover name>.\nExample: /resetui Player Frame"]="Puedes usar el commando /resetui para restablecer todos tus fijadores. También puedes usar el comando para restablecer alguno en específico, /resetui <fijador>. PSuperVillain: /resetui Player Frame" +L["You can use the /resetui command to reset all of your moveables. You can also use the command to reset a specific mover, /resetui <mover name>.\nExample: /resetui Player Frame"]="Puedes usar el commando /resetui para restablecer todos tus fijadores. También puedes usar el comando para restablecer alguno en específico, /resetui <fijador>. PSV: /resetui Player Frame" L["Ghost"]="Fantasma" L["Offline"]="Fuera de Línea" L["ENH_LOGIN_MSG"]="You are using |cff1784d1SVUI Enhanced|r version %s%s|r." diff --git a/Interface/AddOns/SVUI/language/taiwanese_ui.lua b/Interface/AddOns/SVUI/language/taiwanese_ui.lua index 67bd5d8..fecf485 100644 --- a/Interface/AddOns/SVUI/language/taiwanese_ui.lua +++ b/Interface/AddOns/SVUI/language/taiwanese_ui.lua @@ -1,5 +1,5 @@ -local SuperVillain, L = unpack(select(2, ...)) -local L = SuperVillain:SetLocaleStrings("zhTW"); +local SV, L = unpack(select(2, ...)) +local L = SV:SetLocaleStrings("zhTW"); if not L then return; end --[[REACTION TEXTS]]-- L[" is drinking."] = true; diff --git a/Interface/AddOns/SVUI/libs/LibActionButton-1.0/LibActionButton-1.0.lua b/Interface/AddOns/SVUI/libs/LibActionButton-1.0/LibActionButton-1.0.lua index 9a7be27..cdc1bd1 100644 --- a/Interface/AddOns/SVUI/libs/LibActionButton-1.0/LibActionButton-1.0.lua +++ b/Interface/AddOns/SVUI/libs/LibActionButton-1.0/LibActionButton-1.0.lua @@ -25,7 +25,7 @@ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGSuperVillain. +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ]] local MAJOR_VERSION = "LibActionButton-1.0" diff --git a/Interface/AddOns/SVUI/libs/LibBalancePowerTracker-1.1/LibBalancePowerTracker-1.1.lua b/Interface/AddOns/SVUI/libs/LibBalancePowerTracker-1.1/LibBalancePowerTracker-1.1.lua index e6a0d04..a3e2b2d 100644 --- a/Interface/AddOns/SVUI/libs/LibBalancePowerTracker-1.1/LibBalancePowerTracker-1.1.lua +++ b/Interface/AddOns/SVUI/libs/LibBalancePowerTracker-1.1/LibBalancePowerTracker-1.1.lua @@ -54,7 +54,7 @@ v 1.1.4 Checks eclipse direction more often Removed double check for no energy change v 1.1.3 Cast failed detection improved - Included LICENSSuperVillain.txt in Lib + Included LICENSE.txt in Lib CPU usage by critter detection recalculated Fixed bug in loading check @@ -138,8 +138,8 @@ v 1.0.4 Changed Euphoria chance based on Hamlet's findings on www.elitistjerks.c v 1.0.3 Changed to use propperly SpellQueueADT 1.1.2 Now erases flying spells when teleporting. - FEATURSuperVillain: Eclipse chance calculation. - FEATURSuperVillain: Energy statistically calculation. + FEATURE: Eclipse chance calculation. + FEATURE: Energy statistically calculation. v 1.0.2 Fixed sometimes not fetching the direction properly. Fixed PvP bonus @@ -150,7 +150,7 @@ v 1.0.0 Release --]] local version = {1,1,5}; -if (LibBalancePowerTracker and LibBalancePowerTracker.CompareVersion and LibBalancePowerTracker:CompareVersion(version)) then return; end; +if (LibBalancePowerTracker and LibBalancePowerTracker.CompareVersion and LibBalancePowerTracker:CompareVersion(version)) then return; end if select(4, GetBuildInfo())<50001 then return end --Initialize Global Lib @@ -370,7 +370,7 @@ end local function checkCelestialAligmentBuff() local tim_end = select(7,UnitBuff('player',data.CA.name)) or 0; vars.celestial_lockout_end = tim_end*1000; - return vars.celestial_lockout_end; + return vars.celestial_lockout_end end local function isBalance() return GetSpecialization() == 1 @@ -396,7 +396,7 @@ do --Loading if vars.isDruid and number_callbacks ~= 0 then LBPT.load() end - end; + end --[[loading: energia ok on login @@ -449,7 +449,7 @@ do --Loading function LBPT.ECLIPSE_DIRECTION_CHANGE() LBPT.Reset(true) timers.delayedUpdate:SetCooldown(GetTime(),.05) - end; + end function LBPT.RegisterCombatEvents(balanceNow) if balanceNow then @@ -764,8 +764,8 @@ do --Calling callbacks functions function LBPT.FireCallbacks() for k,v in pairs(callbacks) do v(vars.energy,vars.direction,vars.vEnergy,vars.vDirection,vars.vEclipse); - end; - end; + end + end end do --Called functions (API) @@ -795,7 +795,7 @@ do --Called functions (API) LBPT.unload(); end end - function LibBalancePowerTracker:GetVersion() return version[1],version[2],version[3]; end; + function LibBalancePowerTracker:GetVersion() return version[1],version[2],version[3]; end -- Only used when AC was cast in CA (Who would want to...?, begins to fail when being hit after CA ends but before a energize event fires, pretty low chance, but taken care of anyway) --[[ time 0 1 2 3 4 @@ -983,8 +983,8 @@ do ----DEBUG--------------------- drawn = true; for k,v in pairs(callbacks) do v(vars.energy,vars.direction,vars.vEnergy,vars.vDirection,vars.vEclipse); - end; - end; + end + end combatFrame:SetScript("OnEvent", function(_, event, ...) drawn = false; LBPT.combat[event](...) insert(event,drawn,...) end); frame:SetScript("OnEvent", function(_, event, ...) drawn = false; LBPT[event](...) insert(event,drawn,...) end); diff --git a/Interface/AddOns/SVUI/libs/oUF/LICENSE b/Interface/AddOns/SVUI/libs/oUF/LICENSE index a78d4f9..f67ac68 100644 --- a/Interface/AddOns/SVUI/libs/oUF/LICENSE +++ b/Interface/AddOns/SVUI/libs/oUF/LICENSE @@ -19,4 +19,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARSuperVillain. +OTHER DEALINGS IN THE SOFTWARE. diff --git a/Interface/AddOns/SVUI/libs/oUF/elements/castbar.lua b/Interface/AddOns/SVUI/libs/oUF/elements/castbar.lua index 38cec70..bf553fb 100644 --- a/Interface/AddOns/SVUI/libs/oUF/elements/castbar.lua +++ b/Interface/AddOns/SVUI/libs/oUF/elements/castbar.lua @@ -5,7 +5,7 @@ ]] local parent, ns = ... local oUF = ns.oUF -local SuperVillain = SVUI[1] + local updateSafeZone = function(self) local sz = self.SafeZone local width = self:GetWidth() @@ -269,8 +269,7 @@ local UNIT_SPELLCAST_CHANNEL_START = function(self, event, unit, spellname) end if(castbar.PostChannelStart) then castbar:PostChannelStart(unit, name) end - --castbar:Show() - SuperVillain:SecureFadeIn(castbar, 0.2, 0, 1) + castbar:Show() end local UNIT_SPELLCAST_CHANNEL_UPDATE = function(self, event, unit, spellname) diff --git a/Interface/AddOns/SVUI/libs/oUF/elements/health.lua b/Interface/AddOns/SVUI/libs/oUF/elements/health.lua index d2863b4..3019292 100644 --- a/Interface/AddOns/SVUI/libs/oUF/elements/health.lua +++ b/Interface/AddOns/SVUI/libs/oUF/elements/health.lua @@ -9,7 +9,6 @@ local updateFrequentUpdates local random = math.random oUF.colors.health = {49/255, 207/255, 37/255} - local Update = function(self, event, unit) if(self.unit ~= unit) or not unit then return end local health = self.Health @@ -17,6 +16,7 @@ local Update = function(self, event, unit) local min, max = UnitHealth(unit), UnitHealthMax(unit) local disconnected = not UnitIsConnected(unit) local invisible = ((min == max) or UnitIsDeadOrGhost(unit) or disconnected) + if invisible then health.lowAlerted = false end if health.fillInverted then health:SetReverseFill(true) @@ -24,16 +24,18 @@ local Update = function(self, event, unit) health:SetMinMaxValues(0, max) + local percent = 100 if(disconnected) then health:SetValue(max) - health.percent = 100 + percent = 100 else health:SetValue(min) - health.percent = (min / max) * 100 + percent = (min / max) * 100 end - health.percent = invisible and 100 or ((min / max) * 100) + percent = invisible and 100 or ((min / max) * 100) + health.percent = percent health.disconnected = disconnected if health.frequentUpdates ~= health.__frequentUpdates then @@ -89,15 +91,22 @@ local Update = function(self, event, unit) if self.ResurrectIcon then self.ResurrectIcon:SetAlpha(min == 0 and 1 or 0) - end + end + if self.isForced then min = random(1,max) health:SetValue(min) - end + end + if(health.gridMode) then health:SetOrientation("VERTICAL") end + if(health.LowAlertFunc and UnitIsPlayer("target") and health.percent < 6 and UnitIsEnemy("target", "player") and not health.lowAlerted) then + health.lowAlerted = true + health.LowAlertFunc(self) + end + if(health.PostUpdate) then return health.PostUpdate(self, health.percent) end @@ -111,6 +120,7 @@ local CustomUpdate = function(self, event, unit) local disconnected = not UnitIsConnected(unit) local invisible = ((min == max) or UnitIsDeadOrGhost(unit) or disconnected); local tapped = (UnitIsTapped(unit) and (not UnitIsTappedByPlayer(unit))); + if invisible then health.lowAlerted = false end if health.fillInverted then health:SetReverseFill(true) @@ -145,7 +155,7 @@ local CustomUpdate = function(self, event, unit) health:SetStatusBarColor(0.6,0.4,1,0.5) health.animation[1]:SetVertexColor(0.8,0.3,1,0.4) elseif(health.colorOverlay) then - local t = oUF_SuperVillain.colors.health + local t = oUF_Villain.colors.health health:SetStatusBarColor(t[1], t[2], t[3], 0.9) else health:SetStatusBarColor(1, 0.25 * mu, 0, 0.85) @@ -168,12 +178,18 @@ local CustomUpdate = function(self, event, unit) if self.ResurrectIcon then self.ResurrectIcon:SetAlpha(min == 0 and 1 or 0) - end + end + if self.isForced then local current = random(1,max) health:SetValue(-current) end + if(health.LowAlertFunc and UnitIsPlayer("target") and health.percent < 6 and UnitIsEnemy("target", "player") and not health.lowAlerted) then + health.lowAlerted = true + health.LowAlertFunc(self) + end + if(health.PostUpdate) then return health.PostUpdate(self, health.percent) end diff --git a/Interface/AddOns/SVUI/libs/oUF/elements/portraits.lua b/Interface/AddOns/SVUI/libs/oUF/elements/portraits.lua index b4e7402..66b810b 100644 --- a/Interface/AddOns/SVUI/libs/oUF/elements/portraits.lua +++ b/Interface/AddOns/SVUI/libs/oUF/elements/portraits.lua @@ -44,7 +44,7 @@ local Update = function(self, event, unit) color = self.colors.reaction[UnitReaction(unit,"player")] if(color ~= nil) then r,g,b = color[1], color[2], color[3] - end; + end else local _,unitClass = UnitClass(unit) if unitClass then diff --git a/Interface/AddOns/SVUI/libs/oUF/elements/runebar.lua b/Interface/AddOns/SVUI/libs/oUF/elements/runebar.lua index f7e7f61..45f02cb 100644 --- a/Interface/AddOns/SVUI/libs/oUF/elements/runebar.lua +++ b/Interface/AddOns/SVUI/libs/oUF/elements/runebar.lua @@ -126,7 +126,7 @@ local Enable = function(self, unit) self:RegisterEvent("RUNE_TYPE_UPDATE", UpdateType, true) --I have no idea why this won't fire on initial login. self:RegisterEvent("PLAYER_ENTERING_WORLD", UpdateAllRuneTypes) - if not runes.UpdateAllRuneTypes then runes.UpdateAllRuneTypes = UpdateAllRuneTypes end; + if not runes.UpdateAllRuneTypes then runes.UpdateAllRuneTypes = UpdateAllRuneTypes end for i=1, 6 do local rune = runes[runemap[i]] 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 129e085..28b273d 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: 5.02 +## Version: 4.4 ## 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 ee5034f..c8b4d84 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: 5.02 +## Version: 4.4 ## 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 021f782..8d226c3 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: 5.02 +## Version: 4.4 ## Dependencies: oUF oUF_ArcaneCharge.lua \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_CombatFader/oUF_CombatFader.lua b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_CombatFader/oUF_CombatFader.lua index 342ee8c..f299d09 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_CombatFader/oUF_CombatFader.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_CombatFader/oUF_CombatFader.lua @@ -2,7 +2,7 @@ local parent, ns = ... local oUF = ns.oUF local frames, allFrames = {}, {} local showStatus -local SuperVillain; +local CORE; local CheckForReset = function() for frame, unit in pairs(allFrames) do @@ -14,16 +14,16 @@ local CheckForReset = function() end local FadeFramesInOut = function(fade, unit) - if(not SuperVillain) then SuperVillain = SVUI[1] end + if(not CORE) then return end for frame, unit in pairs(frames) do if not UnitExists(unit) then return end if fade then - if frame:GetAlpha() ~= 1 or (frame._secureFade and frame._secureFade.endAlpha == 0) then - SVUI[1]:SecureFadeIn(frame, 0.15) + if(frame:GetAlpha() ~= 1 or (frame._secureFade and frame._secureFade.endAlpha == 0)) then + CORE:SecureFadeIn(frame, 0.15) end else if frame:GetAlpha() ~= 0 then - SVUI[1]:SecureFadeOut(frame, 0.15) + CORE:SecureFadeOut(frame, 0.15) frame._secureFade.finishedFunc = CheckForReset else showStatus = false; @@ -38,13 +38,15 @@ local FadeFramesInOut = function(fade, unit) end local Update = function(self, arg1, arg2) + if(not CORE) then return end if arg1 == "UNIT_HEALTH" and self and self.unit ~= arg2 then return end if type(arg1) == 'boolean' and not frames[self] then return end - if not frames[self] then - if(not SuperVillain) then SuperVillain = SVUI[1] end - SVUI[1]:SecureFadeIn(self, 0.15) - self._secureFade.reset = true + if(not frames[self]) then + if(CORE) then + CORE:SecureFadeIn(self, 0.15) + self._secureFade.reset = true + end return end @@ -71,6 +73,8 @@ local Update = function(self, arg1, arg2) end local Enable = function(self, unit) + if(not CORE) then CORE = SVUI[1] end + if self.CombatFade then frames[self] = self.unit allFrames[self] = self.unit 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 2e2d68f..10740d3 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: 5.020 +## Version: 4.40 ## X-Category: oUF ## Dependencies: oUF diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_GPS/oUF_GPS.lua b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_GPS/oUF_GPS.lua deleted file mode 100644 index b39f859..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_GPS/oUF_GPS.lua +++ /dev/null @@ -1,136 +0,0 @@ -local _, ns = ... -local oUF = ns.oUF or oUF -assert(oUF, 'oUF not loaded') - -local cos, sin, sqrt2, max, atan2, floor = math.cos, math.sin, math.sqrt(2), math.max, math.atan2, math.floor; -local tinsert, tremove, tsort, twipe = table.insert, table.remove, table.sort, table.wipe; -local SuperVillain = SVUI[1] -local playerGUID = UnitGUID("player") -local _FRAMES, _PROXIMITY, OnUpdateFrame = {}, {} -local GPSMonitorFrame; - -local function _calc(radius) - return 0.5 + cos(radius) / sqrt2, 0.5 + sin(radius) / sqrt2; -end - -local function spin(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 - -local sortFunc = function(a,b) return a[1] < b[1] end - -local minThrottle = 0.02 -local numArrows, inRange, unit, angle, GPS, distance -local Update = function(self, elapsed) - if self.elapsed and self.elapsed > (self.throttle or minThrottle) then - numArrows = 0 - twipe(_PROXIMITY) - for _, object in next, _FRAMES do - if(object:IsShown()) then - GPS = object.GPS - unit = object.unit - if(unit) then - if(GPS.PreUpdate) then GPS:PreUpdate(frame) end - - if unit and GPS.outOfRange then - inRange = UnitInRange(unit) - end - - local available = (GPS.OnlyProximity == false and GPS.onMouseOver == false) - - if(not unit or not (UnitInParty(unit) or UnitInRaid(unit)) or UnitIsUnit(unit, "player") or not UnitIsConnected(unit) or (not GPS.OnlyProximity and ((GPS.onMouseOver and (GetMouseFocus() ~= object)) or (GPS.outOfRange and inRange)))) then - GPS:Hide() - else - distance, angle = SuperVillain:PositionFromPlayer(unit, available) - if not angle then - GPS:Hide() - else - if(GPS.OnlyProximity == false) then - GPS:Show() - else - GPS:Hide() - end - - if GPS.Arrow then - if(distance > 40) then - GPS.Arrow:SetVertexColor(1,0.1,0.1) - else - if(distance > 30) then - GPS.Arrow:SetVertexColor(0.4,0.8,0.1) - else - GPS.Arrow:SetVertexColor(0.1,1,0.1) - end - if(GPS.OnlyProximity and object.Health.percent and object.Health.percent < 80) then - local value = object.Health.percent + distance - _PROXIMITY[#_PROXIMITY + 1] = {value, GPS} - end - end - spin(GPS.Arrow, angle) - end - - if GPS.Text then - GPS.Text:SetText(floor(distance)) - end - - if(GPS.PostUpdate) then GPS:PostUpdate(frame, distance, angle) end - numArrows = numArrows + 1 - end - end - else - GPS:Hide() - end - end - end - - if(_PROXIMITY[1]) then - tsort(_PROXIMITY, sortFunc) - if(_PROXIMITY[1][2]) then - _PROXIMITY[1][2]:Show() - end - end - - self.elapsed = 0 - self.throttle = max(minThrottle, 0.005 * numArrows) - else - self.elapsed = (self.elapsed or 0) + elapsed - end -end - -local Enable = function(self) - local GPS = self.GPS - if GPS then - tinsert(_FRAMES, self) - - if not OnUpdateFrame then - OnUpdateFrame = CreateFrame("Frame") - OnUpdateFrame:SetScript("OnUpdate", Update) - end - - OnUpdateFrame:Show() - return true - end -end - -local Disable = function(self) - local GPS = self.GPS - if GPS then - for k, frame in next, _FRAMES do - if(frame == self) then - tremove(_FRAMES, k) - GPS:Hide() - break - end - end - - if #_FRAMES == 0 and OnUpdateFrame then - OnUpdateFrame:Hide() - end - end -end - -oUF:AddElement('GPS', nil, Enable, Disable) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_GPS/oUF_GPS.toc b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_GPS/oUF_GPS.toc deleted file mode 100644 index cdca787..0000000 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_GPS/oUF_GPS.toc +++ /dev/null @@ -1,9 +0,0 @@ -## Interface: 50001 -## Title: oUF GPS -## Notes: Adds GPS arrow to frames. -## Author: Omega1970, Munglunch -## Version: 1.00 -## X-Category: oUF -## Dependencies: oUF - -oUF_GPS.lua \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Plugins.xml b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Plugins.xml index c8f4b75..98378e7 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Plugins.xml +++ b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Plugins.xml @@ -9,7 +9,6 @@ <Script file='oUF_Reputation\oUF_Reputation.lua'/> <Script file='oUF_Friendship\oUF_Friendship.lua'/> <Script file="oUF_ArcaneCharge\oUF_ArcaneCharge.lua"/> - <Script file='oUF_GPS\oUF_GPS.lua'/> <Script file='oUF_ActionPanel\oUF_ActionPanel.lua'/> <Script file='oUF_Afflicted\oUF_Afflicted.lua'/> <Script file='oUF_MainTank\oUF_MainTank.lua'/> diff --git a/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua b/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua index 2015717..300d4ec 100644 --- a/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua +++ b/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua @@ -36,8 +36,8 @@ local tonumber = tonumber; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVBar; +local SV, L = unpack(select(2, ...)); +local MOD = SV.SVBar; local _G = getfenv(0); @@ -66,14 +66,14 @@ do for i = 1, count do self:AddDoubleLine(i, Binder.button.bindings[i]) end - end; + end self:Show() self:SetScript("OnHide", nil) end --[[ END OF HANDLERS ]]-- function RefreshBindings(bindTarget, bindType) - if(not Binder.active or InCombatLockdown()) then return end; + if(not Binder.active or InCombatLockdown()) then return end Binder.button = bindTarget; Binder.spellmacro = bindType; Binder:ClearAllPoints() @@ -84,7 +84,7 @@ do Binder:EnableMouse(false) elseif(not Binder:IsMouseEnabled()) then Binder:EnableMouse(true) - end; + end local keyBindID, keyBindName, keyBindString; if bindType == "FLYOUT" then keyBindName = GetSpellInfo(bindTarget.spellID); @@ -108,7 +108,7 @@ do keyBindID = bindTarget:GetID() if(floor(.5 + select(2, MacroFrameTab1Text:GetTextColor()) * 10) / 10 == .8) then keyBindID = keyBindID + 36 - end; + end keyBindName = GetMacroInfo(keyBindID) keyBindString = ("MACRO %s"):format(keyBindName); Binder.button.id = keyBindID @@ -126,18 +126,18 @@ do local lineName = ("%s%d"):format(L["Binding"], i) GameTooltip:AddDoubleLine(lineName, Binder.button.bindings[i], 1, 1, 1) end - end; + end GameTooltip:Show() elseif bindType == "STANCE" or bindType == "PET" then keyBindID = tonumber(bindTarget:GetID()) keyBindName = bindTarget:GetName() - if(not keyBindName) then return end; + if(not keyBindName) then return end if ((not keyBindID) or (keyBindID < 1) or (keyBindID > (bindType == "STANCE" and 10 or 12))) then keyBindString = ("CLICK %s: LeftButton"):format(keyBindName); else local tmpStr = bindType == "STANCE" and "StanceButton" or "BONUSACTIONBUTTON" keyBindString = ("%s%d"):format(tmpStr, keyBindID); - end; + end Binder.button.id = keyBindID Binder.button.name = keyBindName Binder.button.bindstring = keyBindString @@ -147,7 +147,7 @@ do else keyBindID = tonumber(bindTarget.action) keyBindName = bindTarget:GetName() - if(not keyBindName) then return end; + if(not keyBindName) then return end if(not bindTarget.keyBoundTarget and ((not keyBindID) or (keyBindID < 1) or (keyBindID > 132))) then keyBindString = ("CLICK %s: LeftButton"):format(keyBindName); elseif(bindTarget.keyBoundTarget) then @@ -165,7 +165,7 @@ do elseif(keyBindID < 37 and keyBindID > 24) then keyBindString = ("MULTIACTIONBAR3BUTTON%s"):format(slotID); end - end; + end Binder.button.action = keyBindID Binder.button.name = keyBindName Binder.button.bindstring = keyBindString @@ -173,7 +173,7 @@ do GameTooltip:Show() GameTooltip:SetScript("OnHide", GameTooltip_OnHide) end - end; + end end --[[ ########################################################## @@ -183,25 +183,25 @@ PACKAGE PLUGIN function MOD:ToggleKeyBindingMode(deactivate, saveRequested) if not deactivate then Binder.active = true; - SuperVillain:StaticPopupSpecial_Show(SVUI_KeyBindPopup) + SV:StaticPopupSpecial_Show(SVUI_KeyBindPopup) MOD:RegisterEvent('PLAYER_REGEN_DISABLED','ToggleKeyBindingMode',true,false) else if saveRequested then SaveBindings(GetCurrentBindingSet()) - SuperVillain:AddonMessage(L["Binding Changes Stored"]) + SV:AddonMessage(L["Binding Changes Stored"]) else LoadBindings(GetCurrentBindingSet()) - SuperVillain:AddonMessage(L["Binding Changes Discarded"]) - end; + SV:AddonMessage(L["Binding Changes Discarded"]) + end Binder.active = false; Binder:ClearAllPoints() Binder:Hide() GameTooltip:Hide() MOD:UnregisterEvent("PLAYER_REGEN_DISABLED") - SuperVillain:StaticPopupSpecial_Hide(SVUI_KeyBindPopup) + SV:StaticPopupSpecial_Hide(SVUI_KeyBindPopup) MOD.bindingsChanged = false end -end; +end blockedButtons = { LSHIFT = true, RSHIFT = true, LCTRL = true, RCTRL = true, LALT = true, RALT = true, UNKNOWN = true, LeftButton = true} @@ -213,29 +213,29 @@ local GameTooltip_OnUpdate = function(self, elapsed) return else tipTimeLapse = 0 - end; + end if(not self.comparing and IsModifiedClick("COMPAREITEMS")) then GameTooltip_ShowCompareItem(self) self.comparing = true elseif(self.comparing and not IsModifiedClick("COMPAREITEMS")) then for _,tip in pairs(self.shoppingTooltips)do tip:Hide() - end; + end self.comparing = false end -end; +end local GameTooltip_OnHide = function(self) for _, tip in pairs(self.shoppingTooltips)do tip:Hide() end -end; +end local GameTooltip_OnHide = function(self) for _, tip in pairs(self.shoppingTooltips)do tip:Hide() end -end; +end local SpellButton_OnEnter = function(self) RefreshBindings(self, "SPELL") @@ -260,9 +260,9 @@ end local BinderButton_OnEnter = function(self) local parent = self.button:GetParent() if parent and parent._fade then - SuperVillain:SecureFadeIn(parent, 0.2, parent:GetAlpha(), parent._alpha) + SV:SecureFadeIn(parent, 0.2, parent:GetAlpha(), parent._alpha) end -end; +end local BinderButton_OnLeave = function(self) local parent = self.button:GetParent() @@ -270,9 +270,9 @@ local BinderButton_OnLeave = function(self) self:Hide() GameTooltip:Hide() if parent and parent._fade then - SuperVillain:SecureFadeOut(parent, 1, parent:GetAlpha(), 0) + SV:SecureFadeOut(parent, 1, parent:GetAlpha(), 0) end -end; +end local Binder_OnBinding = function(self, event) MOD.bindingsChanged = true; @@ -280,24 +280,24 @@ local Binder_OnBinding = function(self, event) local count = #Binder.button.bindings for i=1, count do SetBinding(Binder.button.bindings[i]) - end; + end local prefix = L["All keybindings cleared for |cff00ff00%s|r."] local strMsg = prefix:format(Binder.button.name) - SuperVillain:AddonMessage(strMsg) + SV:AddonMessage(strMsg) RefreshBindings(Binder.button, Binder.spellmacro) if(Binder.spellmacro ~= "MACRO") then GameTooltip:Hide() - end; + end return - end; + end - if(blockedButtons[event]) then return end; + if(blockedButtons[event]) then return end if(event == "MiddleButton") then event = "BUTTON3" - end; + end if(event:find('Button%d')) then event = event:upper() - end; + end local altText = IsAltKeyDown() and "ALT-" or ""; local ctrlText = IsControlKeyDown() and "CTRL-" or ""; @@ -309,17 +309,17 @@ local Binder_OnBinding = function(self, event) else local strMacro = ("%s %s"):format(Binder.spellmacro, Binder.button.name) SetBinding(strBind, strMacro) - end; + end local glue = L[" |cff00ff00bound to |r"] local addMsg = ("%s%s%s."):format(strBind, glue, Binder.button.name) - SuperVillain:AddonMessage(addMsg) + SV:AddonMessage(addMsg) RefreshBindings(Binder.button, Binder.spellmacro) if Binder.spellmacro ~= "MACRO" then GameTooltip:Hide() end -end; +end local BinderButton_OnMouseWheel = function(self, delta) if delta > 0 then @@ -327,7 +327,7 @@ local BinderButton_OnMouseWheel = function(self, delta) else Binder_OnBinding(self, "MOUSEWHEELDOWN") end -end; +end local SetBindingMacro = function(self, arg) if(arg == "Blizzard_MacroUI") then @@ -337,20 +337,20 @@ local SetBindingMacro = function(self, arg) btn:HookScript("OnEnter", MacroBinding_OnEnter) end end -end; +end local Check_OnShow = function(self) self:SetChecked(GetCurrentBindingSet() == 2) -end; +end local Check_OnEnter = function(self) GameTooltip:SetOwner(self, "ANCHOR_RIGHT") GameTooltip:SetText(CHARACTER_SPECIFIC_KEYBINDING_TOOLTIP, nil, nil, nil, nil, 1) -end; +end local Check_OnClick = function(self) if(MOD.bindingsChanged) then - SuperVillain:StaticPopup_Show("CONFIRM_LOSE_BINDING_CHANGES") + SV:StaticPopup_Show("CONFIRM_LOSE_BINDING_CHANGES") else if SVUI_KeyBindPopupCheckButton:GetChecked() then LoadBindings(2) @@ -360,15 +360,15 @@ local Check_OnClick = function(self) SaveBindings(1) end end -end; +end local Save_OnClick = function(self) MOD:ToggleKeyBindingMode(true, true) -end; +end local Discard_OnClick = function(self) MOD:ToggleKeyBindingMode(true, false) -end; +end --[[ END OF HANDLERS ]]-- local function SetBindingButton(button, force) @@ -383,7 +383,7 @@ local function SetBindingButton(button, force) elseif button_OnClick == click2 then button:HookScript("OnEnter", Pet_Proxy) end -end; +end local function RefreshAllFlyouts() local count = GetNumFlyouts() @@ -403,11 +403,11 @@ local function RefreshAllFlyouts() end end end -end; +end function MOD:LoadKeyBinder() self:RefreshActionBars() - Binder:SetParent(SuperVillain.UIParent) + Binder:SetParent(SV.UIParent) Binder:SetFrameStrata("DIALOG") Binder:SetFrameLevel(99) Binder:EnableMouse(true) @@ -433,19 +433,19 @@ function MOD:LoadKeyBinder() SetBindingButton(OBJECT) end OBJECT = EnumerateFrames(OBJECT) - end; + end for OBJECT, _ in pairs(self.ButtonCache)do if(OBJECT.IsProtected and OBJECT:IsProtected() and OBJECT.GetObjectType and OBJECT:GetObjectType() == "CheckButton" and OBJECT.GetScript) then SetBindingButton(OBJECT, true) end - end; + end for i = 1, 12 do local btnName = ("SpellButton%d"):format(i) local spellButton = _G[btnName] spellButton:HookScript("OnEnter", SpellButton_OnEnter) - end; + end if not IsAddOnLoaded("Blizzard_MacroUI")then NewHook("LoadAddOn", SetBindingMacro) @@ -455,7 +455,7 @@ function MOD:LoadKeyBinder() local btn = _G[btnName] btn:HookScript("OnEnter", Macro_Proxy) end - end; + end NewHook("ActionButton_UpdateFlyout", RefreshAllFlyouts) RefreshAllFlyouts() diff --git a/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua b/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua index 0c4c502..29bff9f 100644 --- a/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua +++ b/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua @@ -33,8 +33,8 @@ local ceil = math.ceil; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local CONFIGS = SuperVillain.Configs +local SV, L, Registry = unpack(select(2, ...)); +local CONFIGS = SV.Configs local MOD = {}; MOD.ButtonCache = {}; --[[ @@ -71,7 +71,7 @@ LOCAL FUNCTIONS local LibAB = LibStub("LibActionButton-1.0"); local function NewActionBar(barName) - local bar = CreateFrame("Frame", barName, SuperVillain.UIParent, "SecureHandlerStateTemplate") + local bar = CreateFrame("Frame", barName, SV.UIParent, "SecureHandlerStateTemplate") bar.buttons = {} bar.conditions = "" bar.config = { @@ -126,13 +126,13 @@ end local Bar_OnEnter = function(self) if(self._fade) then - SuperVillain:SecureFadeIn(self, 0.2, self:GetAlpha(), self._alpha) + SV:SecureFadeIn(self, 0.2, self:GetAlpha(), self._alpha) end end local Bar_OnLeave = function(self) if(self._fade) then - SuperVillain:SecureFadeOut(self, 1, self:GetAlpha(), 0) + SV:SecureFadeOut(self, 1, self:GetAlpha(), 0) end end @@ -164,23 +164,23 @@ local SVUIMicroButtonsParent = function(self) end local MicroButton_OnEnter = function(self) + if(self._fade) then + SV:SecureFadeIn(SVUI_MicroBar,0.2,SVUI_MicroBar:GetAlpha(),1) + SV:SecureFadeOut(SVUI_MicroBar.screenMarker,0.1,SVUI_MicroBar:GetAlpha(),0) + end if InCombatLockdown()then return end self.overlay:SetPanelColor("highlight") self.overlay.icon:SetGradient("VERTICAL", 0.75, 0.75, 0.75, 1, 1, 1) - if(self._fade) then - SuperVillain:SecureFadeIn(SVUI_MicroBar,0.2,SVUI_MicroBar:GetAlpha(),1) - SuperVillain:SecureFadeOut(SVUI_MicroBar.screenMarker,0.1,SVUI_MicroBar:GetAlpha(),0) - end end local MicroButton_OnLeave = function(self) + if(self._fade) then + SV:SecureFadeOut(SVUI_MicroBar,1,SVUI_MicroBar:GetAlpha(),0) + SV:SecureFadeIn(SVUI_MicroBar.screenMarker,5,SVUI_MicroBar:GetAlpha(),1) + end if InCombatLockdown()then return end self.overlay:SetPanelColor("special") self.overlay.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - if(self._fade) then - SuperVillain:SecureFadeOut(SVUI_MicroBar,1,SVUI_MicroBar:GetAlpha(),0) - SuperVillain:SecureFadeIn(SVUI_MicroBar.screenMarker,5,SVUI_MicroBar:GetAlpha(),1) - end end local MicroButton_OnUpdate = function() @@ -262,7 +262,7 @@ local function SaveActionButton(parent) cooldown.SizeOverride = MOD.db.cooldownSize MOD:FixKeybindText(parent) if not MOD.ButtonCache[parent] then - SuperVillain:AddCD(cooldown) + SV.Timers:AddCooldown(cooldown) MOD.ButtonCache[parent] = true end parent:SetSlotTemplate(true, 2, 0, 0) @@ -337,6 +337,7 @@ local function ModifyActionButton(parent) local checked = parent:GetCheckedTexture() if cooldown then cooldown.SizeOverride = MOD.db.cooldownSize + --cooldown:SetAlpha(0) end if highlight then highlight:SetTexture(1,1,1,.2) @@ -360,30 +361,30 @@ local function ModifyActionButton(parent) parentTex:Hide() parentTex:SetAlpha(0) end - if border then border:MUNG()end + if border then border:Die()end if count then count:ClearAllPoints() count:SetPoint("BOTTOMRIGHT",1,1) count:SetShadowOffset(1,-1) - count:SetFontTemplate(SuperVillain.Shared:Fetch("font",MOD.db.countFont),MOD.db.countFontSize,MOD.db.countFontOutline) + count:SetFontTemplate(SV.Shared:Fetch("font",MOD.db.countFont),MOD.db.countFontSize,MOD.db.countFontOutline) end if icon then icon:SetTexCoord(.1,.9,.1,.9) - icon:SetGradient("VERTICAL",.5,.5,.5,1,1,1) + --icon:SetGradient("VERTICAL",.5,.5,.5,1,1,1) icon:FillInner() end if shine then shine:SetAllPoints()end if MOD.db.hotkeytext then hotkey:ClearAllPoints() hotkey:SetAllPoints() - hotkey:SetFontTemplate(SuperVillain.Shared:Fetch("font",MOD.db.font),MOD.db.fontSize,MOD.db.fontOutline) + hotkey:SetFontTemplate(SV.Shared:Fetch("font",MOD.db.font),MOD.db.fontSize,MOD.db.fontOutline) hotkey:SetJustifyH("RIGHT") hotkey:SetJustifyV("TOP") hotkey:SetShadowOffset(1,-1) end - if parent.style then - parent.style:SetDrawLayer('BACKGROUND',-7) - end + -- if parent.style then + -- parent.style:SetDrawLayer('BACKGROUND',-7) + -- end parent.FlyoutUpdateFunc = SetFlyoutButton; MOD:FixKeybindText(parent) end @@ -397,7 +398,7 @@ do if anchorParent._fade then local alpha = anchorParent._alpha local actual = anchorParent:GetAlpha() - SuperVillain:SecureFadeIn(anchorParent, 0.2, actual, alpha) + SV:SecureFadeIn(anchorParent, 0.2, actual, alpha) end end @@ -408,7 +409,7 @@ do local anchorParent = anchor:GetParent() if anchorParent._fade then local actual = anchorParent:GetAlpha() - SuperVillain:SecureFadeOut(anchorParent, 1, actual, 0) + SV:SecureFadeOut(anchorParent, 1, actual, 0) end end @@ -458,7 +459,7 @@ do function SetSpellFlyoutHook() SpellFlyout:HookScript("OnShow",SpellFlyout_OnShow); - SuperVillain:ExecuteTimer(QualifyFlyouts, 5) + SV.Timers:ExecuteTimer(QualifyFlyouts, 5) end end --[[ @@ -572,7 +573,7 @@ function MOD:UpdateBarPagingDefaults() local mainbar = _G["SVUI_ActionBar1"] if(mainbar) then if self.db.Bar1.useCustomPaging then - custom = self.db.Bar1.customPaging[SuperVillain.class]; + custom = self.db.Bar1.customPaging[SV.class]; else custom = "" end @@ -584,11 +585,11 @@ function MOD:UpdateBarPagingDefaults() local id = ("Bar%d"):format(i) local bar = _G["SVUI_Action" .. id] if(bar and self.db[id].useCustomPaging) then - bar.conditions = self.db[id].customPaging[SuperVillain.class]; + bar.conditions = self.db[id].customPaging[SV.class]; end end - if((not SuperVillain.db.SVBar.enable or InCombatLockdown()) or not self.isInitialized) then return end + if((not SV.db.SVBar.enable or InCombatLockdown()) or not self.isInitialized) then return end local Bar2Option = InterfaceOptionsActionBarsPanelBottomRight local Bar3Option = InterfaceOptionsActionBarsPanelBottomLeft local Bar4Option = InterfaceOptionsActionBarsPanelRightTwo @@ -633,7 +634,7 @@ do local Button_OnEnter = function(self) local parent = self:GetParent() if parent and parent._fade then - SuperVillain:SecureFadeIn(parent, 0.2, parent:GetAlpha(), parent._alpha) + SV:SecureFadeIn(parent, 0.2, parent:GetAlpha(), parent._alpha) end end @@ -641,7 +642,7 @@ do local parent = self:GetParent() GameTooltip:Hide() if parent and parent._fade then - SuperVillain:SecureFadeOut(parent, 1, parent:GetAlpha(), 0) + SV:SecureFadeOut(parent, 1, parent:GetAlpha(), 0) end end @@ -732,7 +733,7 @@ do end local function _getPage(bar, defaultPage, condition) - local page = MOD.db[bar].customPaging[SuperVillain.class] + local page = MOD.db[bar].customPaging[SV.class] if not condition then condition = '' end if not page then page = '' end if page then @@ -844,7 +845,7 @@ do bar:Hide() UnregisterStateDriver(bar, "visibility") end - SuperVillain:SetSnapOffset(("SVUI_Action%d_MOVE"):format(id), (space / 2)) + SV:SetSnapOffset(("SVUI_Action%d_MOVE"):format(id), (space / 2)) end end end @@ -962,13 +963,13 @@ CreateActionBars = function(self) thisBar.page = barPageIndex[i] if(i == 1) then - thisBar:Point("BOTTOM", SuperVillain.UIParent, "BOTTOM", 0, 28) + thisBar:Point("BOTTOM", SV.UIParent, "BOTTOM", 0, 28) elseif(i == 2) then thisBar:Point("BOTTOM", _G["SVUI_ActionBar1"], "TOP", 0, 4) elseif(i == 3) then thisBar:Point("BOTTOMLEFT", _G["SVUI_ActionBar1"], "BOTTOMRIGHT", 4, 0) elseif(i == 4) then - thisBar:Point("RIGHT", SuperVillain.UIParent, "RIGHT", -4, 0) + thisBar:Point("RIGHT", SV.UIParent, "RIGHT", -4, 0) elseif(i == 5) then thisBar:Point("BOTTOMRIGHT", _G["SVUI_ActionBar1"], "BOTTOMLEFT", -4, 0) else @@ -990,7 +991,7 @@ CreateActionBars = function(self) for x = 1, 14 do local calc = (x - 1) * buttonMax + k; thisBar.buttons[k]:SetState(x, "action", calc) - end; + end if k == 12 then thisBar.buttons[k]:SetState(12, "custom", { func = function(...) @@ -1033,63 +1034,67 @@ CreateActionBars = function(self) ]]) self:RefreshBar(barID) - SuperVillain:SetSVMovable(thisBar, L[barID], nil, nil, nil, "ALL, ACTIONBARS") + SV:SetSVMovable(thisBar, L[barID], nil, nil, nil, "ALL, ACTIONBARS") end end do local function SetStanceBarButtons() - local maxForms = GetNumShapeshiftForms(); - local currentForm = GetShapeshiftForm(); - local maxButtons = NUM_STANCE_SLOTS; - local texture, name, isActive, isCastable, _; - for i = 1, maxButtons do - local button = _G["SVUI_StanceBarButton"..i] - local icon = _G["SVUI_StanceBarButton"..i.."Icon"] - local cd = _G["SVUI_StanceBarButton"..i.."Cooldown"] - if i <= maxForms then - texture, name, isActive, isCastable = GetShapeshiftFormInfo(i) - if texture == "Interface\\Icons\\Spell_Nature_WispSplode" and MOD.db.Stance.style == "darkenInactive" then - _, _, texture = GetSpellInfo(name) - end - icon:SetTexture(texture) - if texture then - cd:SetAlpha(1) - else - cd:SetAlpha(0) - end - if isActive then - StanceBarFrame.lastSelected = button:GetID() - if maxForms == 1 then - button:SetChecked(1) - else - if button.checked then button.checked:SetTexture(0, 0.5, 0, 0.2) end - button:SetBackdropBorderColor(0.4, 0.8, 0) - button:SetChecked(MOD.db.Stance.style ~= "darkenInactive") - end - else - if maxForms == 1 or currentForm == 0 then - button:SetChecked(0) - else - button:SetBackdropBorderColor(0, 0, 0) - button:SetChecked(MOD.db.Stance.style == "darkenInactive") - if button.checked then - button.checked:SetAlpha(1) - if MOD.db.Stance.style == "darkenInactive" then - button.checked:SetTexture(0, 0, 0, 0.75) + local maxForms = GetNumShapeshiftForms(); + local currentForm = GetShapeshiftForm(); + local maxButtons = NUM_STANCE_SLOTS; + local texture, name, isActive, isCastable, _; + for i = 1, maxButtons do + local button = _G["SVUI_StanceBarButton"..i] + local icon = _G["SVUI_StanceBarButton"..i.."Icon"] + local cd = _G["SVUI_StanceBarButton"..i.."Cooldown"] + if i <= maxForms then + texture, name, isActive, isCastable = GetShapeshiftFormInfo(i) + if texture == "Interface\\Icons\\Spell_Nature_WispSplode" and MOD.db.Stance.style == "darkenInactive" then + _, _, texture = GetSpellInfo(name) + end + + icon:SetTexture(texture) + + if texture then + cd:SetAlpha(1) + else + cd:SetAlpha(0) + end + + if isActive then + StanceBarFrame.lastSelected = button:GetID() + + if maxForms > 1 then + if button.checked then button.checked:SetTexture(0, 0.5, 0, 0.2) end + button:SetBackdropBorderColor(0.4, 0.8, 0) + end + icon:SetVertexColor(1, 1, 1) + button:SetChecked(1) else - button.checked:SetTexture(1, 1, 1, 0.25) + if maxForms > 1 and currentForm > 0 then + button:SetBackdropBorderColor(0, 0, 0) + if button.checked then + button.checked:SetAlpha(1) + end + if MOD.db.Stance.style == "darkenInactive" then + icon:SetVertexColor(0.25, 0.25, 0.25) + else + icon:SetVertexColor(1, 1, 1) + end + end + + button:SetChecked(0) + end + if isCastable then + icon:SetDesaturated(false) + button:SetAlpha(1) + else + icon:SetDesaturated(true) + button:SetAlpha(0.4) end - end end - end - if isCastable then - icon:SetVertexColor(1.0, 1.0, 1.0) - else - icon:SetVertexColor(0.4, 0.4, 0.4) - end end - end end local function UpdateShapeshiftForms(self, event) @@ -1119,9 +1124,7 @@ do MOD:RefreshBar("Stance") - if event == "UPDATE_SHAPESHIFT_FORMS" then - SetStanceBarButtons() - end + SetStanceBarButtons() if not C_PetBattles.IsInBattle() or ready then if maxForms == 0 then UnregisterStateDriver(stanceBar, "show") @@ -1183,7 +1186,7 @@ do self:RegisterEvent("UPDATE_SHAPESHIFT_FORM", SetStanceBarButtons) self:RegisterEvent("ACTIONBAR_PAGE_CHANGED", SetStanceBarButtons) UpdateShapeshiftForms() - SuperVillain:SetSVMovable(stanceBar, L["Stance Bar"], nil, -3, nil, "ALL, ACTIONBARS") + SV:SetSVMovable(stanceBar, L["Stance Bar"], nil, -3, nil, "ALL, ACTIONBARS") self:RefreshBar("Stance") SetStanceBarButtons() self:UpdateBarBindings(false, true) @@ -1301,7 +1304,7 @@ do self:RegisterEvent("PLAYER_FARSIGHT_FOCUS_CHANGED", RefreshPet) self:RegisterEvent("PET_BAR_UPDATE_COOLDOWN", PetActionBar_UpdateCooldowns) - SuperVillain:SetSVMovable(petBar, L["Pet Bar"], nil, nil, nil, "ALL, ACTIONBARS") + SV:SetSVMovable(petBar, L["Pet Bar"], nil, nil, nil, "ALL, ACTIONBARS") end end @@ -1309,12 +1312,12 @@ CreateMicroBar = function(self) local buttonSize = self.db.Micro.buttonsize or 30; local spacing = self.db.Micro.buttonspacing or 1; local barWidth = (buttonSize + spacing) * 13; - local microBar = NewFrame('Frame','SVUI_MicroBar',SuperVillain.UIParent) + local microBar = NewFrame('Frame','SVUI_MicroBar',SV.UIParent) microBar:Size(barWidth,buttonSize + 6) microBar:SetFrameStrata("HIGH") microBar:SetFrameLevel(0) - microBar:Point('TOP',SuperVillain.UIParent,'TOP',0,4) - SuperVillain:AddToDisplayAudit(microBar) + microBar:Point('TOP',SV.UIParent,'TOP',0,4) + SV:AddToDisplayAudit(microBar) for i=1,13 do local data = ICON_DATA[i] @@ -1336,7 +1339,7 @@ CreateMicroBar = function(self) if button.SetHighlightTexture then button:SetHighlightTexture("") end - button:Formula409() + button:RemoveTextures() local buttonMask = NewFrame("Frame",nil,button) buttonMask:SetPoint("TOPLEFT",button,"TOPLEFT",0,-28) @@ -1370,12 +1373,12 @@ CreateMicroBar = function(self) SVUIMicroButtonsParent(microBar) SVUIMicroButton_SetNormal() - SuperVillain:SetSVMovable(microBar, L["Micro Bar"]) + SV:SetSVMovable(microBar, L["Micro Bar"]) RefreshMicrobar() - microBar.screenMarker = NewFrame('Frame',nil,SuperVillain.UIParent) - microBar.screenMarker:Point('TOP',SuperVillain.UIParent,'TOP',0,2) + microBar.screenMarker = NewFrame('Frame',nil,SV.UIParent) + microBar.screenMarker:Point('TOP',SV.UIParent,'TOP',0,2) microBar.screenMarker:Size(20,20) microBar.screenMarker:SetFrameStrata("BACKGROUND") microBar.screenMarker:SetFrameLevel(4) @@ -1388,8 +1391,8 @@ CreateMicroBar = function(self) end local CreateExtraBar = function(self) - local specialBar = CreateFrame("Frame", "SVUI_SpecialAbility", SuperVillain.UIParent) - specialBar:Point("TOP", SuperVillain.UIParent, "CENTER", 0, -50) + local specialBar = CreateFrame("Frame", "SVUI_SpecialAbility", SV.UIParent) + specialBar:Point("TOP", SV.UIParent, "CENTER", 0, -50) specialBar:Size(ExtraActionBarFrame:GetSize()) ExtraActionBarFrame:SetParent(specialBar) ExtraActionBarFrame:ClearAllPoints() @@ -1418,7 +1421,7 @@ local CreateExtraBar = function(self) if HasExtraActionBar()then ExtraActionBarFrame:Show() end - SuperVillain:SetSVMovable(specialBar, L["Boss Button"], nil, nil, nil, "ALL, ACTIONBAR") + SV:SetSVMovable(specialBar, L["Boss Button"], nil, nil, nil, "ALL, ACTIONBAR") end --[[ ########################################################## @@ -1799,4 +1802,4 @@ CONFIGS["SVBar"] = { }, } -SuperVillain.Registry:NewPackage(MOD, "SVBar") \ No newline at end of file +Registry:NewPackage(MOD, "SVBar") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/aura/SVAura.lua b/Interface/AddOns/SVUI/packages/aura/SVAura.lua index 91f5cb7..6399d93 100644 --- a/Interface/AddOns/SVUI/packages/aura/SVAura.lua +++ b/Interface/AddOns/SVUI/packages/aura/SVAura.lua @@ -42,17 +42,54 @@ local tremove, twipe = table.remove, table.wipe; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local CONFIGS = SuperVillain.Configs +local SV, L, Registry = unpack(select(2, ...)); +local CONFIGS = SV.Configs local MOD = {}; --[[ ########################################################## LOCAL VARS ########################################################## ]]-- -local invertMap1 = {DOWN_RIGHT = "TOPLEFT", DOWN_LEFT = "TOPRIGHT", UP_RIGHT = "BOTTOMLEFT", UP_LEFT = "BOTTOMRIGHT", RIGHT_DOWN = "TOPLEFT", RIGHT_UP = "BOTTOMLEFT", LEFT_DOWN = "TOPRIGHT", LEFT_UP = "BOTTOMRIGHT"}; -local showMap1 = {DOWN_RIGHT = 1, DOWN_LEFT = -1, UP_RIGHT = 1, UP_LEFT = -1, RIGHT_DOWN = 1, RIGHT_UP = 1, LEFT_DOWN = -1, LEFT_UP = -1}; -local showMap2 = {DOWN_RIGHT = -1, DOWN_LEFT = -1, UP_RIGHT = 1, UP_LEFT = 1, RIGHT_DOWN = -1, RIGHT_UP = 1, LEFT_DOWN = -1, LEFT_UP = 1}; +local DIRECTION_TO_POINT = { + DOWN_RIGHT = "TOPLEFT", + DOWN_LEFT = "TOPRIGHT", + UP_RIGHT = "BOTTOMLEFT", + UP_LEFT = "BOTTOMRIGHT", + RIGHT_DOWN = "TOPLEFT", + RIGHT_UP = "BOTTOMLEFT", + LEFT_DOWN = "TOPRIGHT", + LEFT_UP = "BOTTOMRIGHT", +} + +local DIRECTION_TO_HORIZONTAL_SPACING_MULTIPLIER = { + DOWN_RIGHT = 1, + DOWN_LEFT = -1, + UP_RIGHT = 1, + UP_LEFT = -1, + RIGHT_DOWN = 1, + RIGHT_UP = 1, + LEFT_DOWN = -1, + LEFT_UP = -1, +} + +local DIRECTION_TO_VERTICAL_SPACING_MULTIPLIER = { + DOWN_RIGHT = -1, + DOWN_LEFT = -1, + UP_RIGHT = 1, + UP_LEFT = 1, + RIGHT_DOWN = -1, + RIGHT_UP = 1, + LEFT_DOWN = -1, + LEFT_UP = 1, +} + +local IS_HORIZONTAL_GROWTH = { + RIGHT_DOWN = true, + RIGHT_UP = true, + LEFT_DOWN = true, + LEFT_UP = true, +} + local AURA_FADE_TIME = 5; local AURA_ICONS = { [[Interface\Addons\SVUI\assets\artwork\Icons\AURA-STATS]], @@ -157,9 +194,9 @@ do end if(self.timeLeft > AURA_FADE_TIME) then - SuperVillain.Animate:StopFlash(self) + SV.Animate:StopFlash(self) else - SuperVillain.Animate:Flash(self, 1) + SV.Animate:Flash(self, 1) end end @@ -252,7 +289,7 @@ do end aura.Skinned = true end - local font = SuperVillain.Shared:Fetch("font", MOD.db.font) + local font = SV.Shared:Fetch("font", MOD.db.font) aura.texture = aura:CreateTexture(nil, "BORDER") aura.texture:FillInner(aura, 2, 2) aura.texture:SetTexCoord(0.1, 0.9, 0.1, 0.9) @@ -265,7 +302,7 @@ do aura.highlight = aura:CreateTexture(nil, "HIGHLIGHT") aura.highlight:SetTexture(0, 0, 0, 0.45) aura.highlight:FillInner() - SuperVillain.Animate:Flash(aura) + SV.Animate:Flash(aura) aura:SetScript("OnAttributeChanged", Aura_OnAttributeChanged) end end @@ -353,7 +390,7 @@ do MOD:RegisterEvent("UNIT_AURA", UpdateConsolidatedReminder) MOD:RegisterEvent("GROUP_ROSTER_UPDATE", UpdateConsolidatedReminder) MOD:RegisterEvent("PLAYER_SPECIALIZATION_CHANGED", UpdateConsolidatedReminder) - SuperVillain.RoleChangedCallback = MOD.Update_ConsolidatedBuffsSettings + SV.RoleChangedCallback = MOD.Update_ConsolidatedBuffsSettings UpdateConsolidatedReminder() else SVUI_ConsolidatedBuffs:Hide() @@ -361,7 +398,7 @@ do MOD:UnregisterEvent("UNIT_AURA") MOD:UnregisterEvent("GROUP_ROSTER_UPDATE") MOD:UnregisterEvent("PLAYER_SPECIALIZATION_CHANGED") - SuperVillain.RoleChangedCallback = SuperVillain.fubar + SV.RoleChangedCallback = SV.fubar end end end @@ -389,7 +426,7 @@ do SVUI_ConsolidatedBuffs:SetAllPoints(SVUI_AurasAnchor) local swapIndex1, swapIndex2, hideIndex1, hideIndex2 if MOD.db.hyperBuffs.filter then - if SuperVillain.ClassRole == 'C' then + if SV.ClassRole == 'C' then swapIndex1 = 4 hideIndex1 = 3 swapIndex2 = 5 @@ -441,49 +478,56 @@ do end end -function MOD:UpdateAuraHeader(auraHeader) +function MOD:UpdateAuraHeader(auraHeader, auraType) if(InCombatLockdown() or not auraHeader) then return end - local db = MOD.db.debuffs + + local db = self.db[auraType] local showBy = db.showBy - local font = SuperVillain.Shared:Fetch("font", MOD.db.font) - if auraHeader:GetAttribute("filter") == "HELPFUL" then - db = MOD.db.buffs; - auraHeader:SetAttribute("consolidateTo", MOD.db.hyperBuffs.enable == true and 1 or 0) + local font = SV.Shared:Fetch("font", self.db.font) + + if auraType == "buffs" then + auraHeader:SetAttribute("consolidateTo", self.db.hyperBuffs.enable == true and 1 or 0) auraHeader:SetAttribute("weaponTemplate", ("SVUI_AuraTemplate%d"):format(db.size)) - end + end + auraHeader:SetAttribute("separateOwn", db.isolate) auraHeader:SetAttribute("sortMethod", db.sortMethod) auraHeader:SetAttribute("sortDir", db.sortDir) auraHeader:SetAttribute("maxWraps", db.maxWraps) auraHeader:SetAttribute("wrapAfter", db.wrapAfter) - auraHeader:SetAttribute("point", invertMap1[showBy]) - if(showBy == "RIGHT_DOWN" or showBy == "RIGHT_UP" or showBy == "LEFT_DOWN" or showBy == "LEFT_UP") then + + auraHeader:SetAttribute("point", DIRECTION_TO_POINT[showBy]) + + if(IS_HORIZONTAL_GROWTH[showBy]) then auraHeader:SetAttribute("minWidth", ((db.wrapAfter == 1 and 0 or db.wrapXOffset) + db.size) * db.wrapAfter) auraHeader:SetAttribute("minHeight", (db.wrapYOffset + db.size) * db.maxWraps) - auraHeader:SetAttribute("xOffset", showMap1[showBy] * (db.wrapXOffset + db.size)) + auraHeader:SetAttribute("xOffset", DIRECTION_TO_HORIZONTAL_SPACING_MULTIPLIER[showBy] * (db.wrapXOffset + db.size)) auraHeader:SetAttribute("yOffset", 0) - auraHeader:SetAttribute("wrapOffsetH", 0) - auraHeader:SetAttribute("wrapOffsetV", showMap2[showBy] * (db.wrapYOffset + db.size)) + auraHeader:SetAttribute("wrapXOffset", 0) + auraHeader:SetAttribute("wrapYOffset", DIRECTION_TO_VERTICAL_SPACING_MULTIPLIER[showBy] * (db.wrapYOffset + db.size)) else auraHeader:SetAttribute("minWidth", (db.wrapXOffset + db.size) * db.maxWraps) auraHeader:SetAttribute("minHeight", ((db.wrapAfter == 1 and 0 or db.wrapYOffset) + db.size) * db.wrapAfter) auraHeader:SetAttribute("xOffset", 0) - auraHeader:SetAttribute("yOffset", showMap2[showBy] * (db.wrapYOffset + db.size)) - auraHeader:SetAttribute("wrapOffsetH", showMap1[showBy] * (db.wrapXOffset + db.size)) - auraHeader:SetAttribute("wrapOffsetV", 0) - end + auraHeader:SetAttribute("yOffset", DIRECTION_TO_VERTICAL_SPACING_MULTIPLIER[showBy] * (db.wrapYOffset + db.size)) + auraHeader:SetAttribute("wrapXOffset", DIRECTION_TO_HORIZONTAL_SPACING_MULTIPLIER[showBy] * (db.wrapXOffset + db.size)) + auraHeader:SetAttribute("wrapYOffset", 0) + end + auraHeader:SetAttribute("template", ("SVUI_AuraTemplate%d"):format(db.size)) + local i = 1; local auraChild = select(i, auraHeader:GetChildren()) + while(auraChild) do if ((floor(auraChild:GetWidth() * 100 + 0.5) / 100) ~= db.size) then auraChild:SetSize(db.size, db.size) end if(auraChild.time) then auraChild.time:ClearAllPoints() - auraChild.time:SetPoint("TOP", auraChild, "BOTTOM", 1 + MOD.db.timeOffsetH, MOD.db.timeOffsetV) + auraChild.time:SetPoint("TOP", auraChild, "BOTTOM", 1 + self.db.timeOffsetH, self.db.timeOffsetV) auraChild.count:ClearAllPoints() - auraChild.count:SetPoint("BOTTOMRIGHT", -1 + MOD.db.countOffsetH, MOD.db.countOffsetV) + auraChild.count:SetPoint("BOTTOMRIGHT", -1 + self.db.countOffsetH, self.db.countOffsetV) end if (i > (db.maxWraps * db.wrapAfter) and auraChild:IsShown()) then auraChild:Hide() @@ -494,8 +538,8 @@ function MOD:UpdateAuraHeader(auraHeader) end local function CreateAuraHeader(filter) - local frameName = "SVUI_PlayerDebuffs" - if filter == "HELPFUL" then frameName = "SVUI_PlayerBuffs" end + local frameName, auraType = "SVUI_PlayerDebuffs", "debuffs" + if filter == "HELPFUL" then frameName = "SVUI_PlayerBuffs"; auraType = "buffs" end local auraHeader = CreateFrame("Frame", frameName, SVUI_AurasAnchor, "SecureAuraHeaderTemplate") auraHeader:SetClampedToScreen(true) auraHeader:SetAttribute("unit", "player") @@ -506,7 +550,7 @@ local function CreateAuraHeader(filter) auraHeader:SetAttribute("consolidateDuration", -1) auraHeader:SetAttribute("includeWeapons", 1) end - MOD:UpdateAuraHeader(auraHeader) + MOD:UpdateAuraHeader(auraHeader, auraType) auraHeader:Show() return auraHeader end @@ -516,21 +560,21 @@ function MOD:ReLoad() CB_WIDTH = (CB_HEIGHT / 5) + 4 SVUI_AurasAnchor:SetSize(CB_WIDTH, CB_HEIGHT) AURA_FADE_TIME = MOD.db.fadeBy - MOD:UpdateAuraHeader(SVUI_PlayerBuffs); - MOD:UpdateAuraHeader(SVUI_PlayerDebuffs); + MOD:UpdateAuraHeader(SVUI_PlayerBuffs, "buffs"); + MOD:UpdateAuraHeader(SVUI_PlayerDebuffs, "debuffs"); end function MOD:Load() CB_HEIGHT = Minimap:GetHeight() CB_WIDTH = (CB_HEIGHT / 5) + 4 - if not SuperVillain.db.SVAura.enable then return end - if SuperVillain.db.SVAura.disableBlizzard then - BuffFrame:MUNG() - ConsolidatedBuffs:MUNG() - TemporaryEnchantFrame:MUNG() + if not SV.db.SVAura.enable then return end + if SV.db.SVAura.disableBlizzard then + BuffFrame:Die() + ConsolidatedBuffs:Die() + TemporaryEnchantFrame:Die() InterfaceOptionsFrameCategoriesButton12:SetScale(0.0001) end - local auras = CreateFrame("Frame", "SVUI_AurasAnchor", SuperVillain.UIParent) + local auras = CreateFrame("Frame", "SVUI_AurasAnchor", SV.UIParent) auras:SetSize(CB_WIDTH, CB_HEIGHT) auras:Point("TOPRIGHT", Minimap, "TOPLEFT", -8, 0) self.BuffFrame = CreateAuraHeader("HELPFUL") @@ -538,7 +582,7 @@ function MOD:Load() self.DebuffFrame = CreateAuraHeader("HARMFUL") self.DebuffFrame:SetPoint( "BOTTOMRIGHT", auras, "BOTTOMLEFT", -8, 0) - SVUI_ConsolidatedBuffs:SetParent(SuperVillain.UIParent) + SVUI_ConsolidatedBuffs:SetParent(SV.UIParent) SVUI_ConsolidatedBuffs:SetAllPoints(auras) for i = 1, NUM_LE_RAID_BUFF_TYPES do @@ -548,7 +592,7 @@ function MOD:Load() self:Update_ConsolidatedBuffsSettings() - SuperVillain:SetSVMovable(auras, L["Auras Frame"]) + SV:SetSVMovable(auras, L["Auras Frame"]) end --[[ ########################################################## @@ -594,4 +638,4 @@ CONFIGS["SVAura"] = { }, } -SuperVillain.Registry:NewPackage(MOD, "SVAura") \ No newline at end of file +Registry:NewPackage(MOD, "SVAura") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/bag/SVBag.lua b/Interface/AddOns/SVUI/packages/bag/SVBag.lua index d3c9d59..093b9d7 100644 --- a/Interface/AddOns/SVUI/packages/bag/SVBag.lua +++ b/Interface/AddOns/SVUI/packages/bag/SVBag.lua @@ -40,10 +40,10 @@ local twipe = table.wipe; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local CONFIGS = SuperVillain.Configs +local SV, L, Registry = unpack(select(2, ...)); +local CONFIGS = SV.Configs local MOD = {}; -local TTIP = SuperVillain.SVTip; +local TTIP = SV.SVTip; --[[ ########################################################## LOCAL VARS @@ -99,13 +99,13 @@ local function StyleBagToolButton(button) local hover = button:CreateTexture(nil, "HIGHLIGHT") hover:WrapOuter(button, 6, 6) hover:SetTexture(borderTex) - hover:SetGradient(unpack(SuperVillain.Media.gradient.yellow)) + hover:SetGradient(unpack(SV.Media.gradient.yellow)) if button.SetPushedTexture then local pushed = button:CreateTexture(nil, "BORDER") pushed:WrapOuter(button, 6, 6) pushed:SetTexture(borderTex) - pushed:SetGradient(unpack(SuperVillain.Media.gradient.highlight)) + pushed:SetGradient(unpack(SV.Media.gradient.highlight)) button:SetPushedTexture(pushed) end @@ -113,7 +113,7 @@ local function StyleBagToolButton(button) local checked = button:CreateTexture(nil, "BORDER") checked:WrapOuter(button, 6, 6) checked:SetTexture(borderTex) - checked:SetGradient(unpack(SuperVillain.Media.gradient.green)) + checked:SetGradient(unpack(SV.Media.gradient.green)) button:SetCheckedTexture(checked) end @@ -121,7 +121,7 @@ local function StyleBagToolButton(button) local disabled = button:CreateTexture(nil, "BORDER") disabled:WrapOuter(button, 6, 6) disabled:SetTexture(borderTex) - disabled:SetGradient(unpack(SuperVillain.Media.gradient.default)) + disabled:SetGradient(unpack(SV.Media.gradient.default)) button:SetDisabledTexture(disabled) end @@ -190,25 +190,21 @@ end CORE FUNCTIONS ########################################################## ]]-- -function MOD:GetContainerFrame(e) - if type(e) == "boolean" and e == true then - return MOD.BankFrame - elseif type(e) == "number" then - if MOD.BankFrame then - for f, g in ipairs(MOD.BankFrame.BagIDs) do - if g == e then - return MOD.BankFrame - end - end - end +function MOD:GetContainerFrame(isBank, isReagent) + if(type(isBank) == "boolean" and isBank == true) then + if(type(isReagent) == "boolean" and isReagent == true and self.ReagentFrame) then + return self.ReagentFrame + elseif(self.BankFrame) then + return self.BankFrame + end end - return MOD.BagFrame + return self.BagFrame end function MOD:DisableBlizzard() BankFrame:UnregisterAllEvents() for h = 1, NUM_CONTAINER_FRAMES do - _G["ContainerFrame"..h]:MUNG() + _G["ContainerFrame"..h]:Die() end end @@ -345,13 +341,13 @@ function MOD:FlushSlotFading(this) end end -function MOD:Layout(isBank) - if SuperVillain.db.SVBag.enable ~= true then return; end - local f = MOD:GetContainerFrame(isBank); +function MOD:Layout(isBank, isReagent) + if SV.db.SVBag.enable ~= true then return; end + local f = MOD:GetContainerFrame(isBank, isReagent); if not f then return; end local buttonSize = isBank and MOD.db.bankSize or MOD.db.bagSize; local buttonSpacing = 8; - local containerWidth = (MOD.db.alignToChat == true and (isBank and (SuperVillain.db.SVDock.dockLeftWidth - 14) or (SuperVillain.db.SVDock.dockRightWidth - 14))) or (isBank and MOD.db.bankWidth) or MOD.db.bagWidth + local containerWidth = (MOD.db.alignToChat == true and (isBank and (SV.db.SVDock.dockLeftWidth - 14) or (SV.db.SVDock.dockRightWidth - 14))) or (isBank and MOD.db.bankWidth) or MOD.db.bagWidth local numContainerColumns = floor(containerWidth / (buttonSize + buttonSpacing)); local holderWidth = ((buttonSize + buttonSpacing) * numContainerColumns) - buttonSpacing; local numContainerRows = 0; @@ -364,11 +360,11 @@ function MOD:Layout(isBank) local globalName; local numContainerSlots, fullContainerSlots = GetNumBankSlots(); for i, bagID in ipairs(f.BagIDs) do - if (not isBank and bagID <= 3) or (isBank and bagID ~= -1 and numContainerSlots >= 1 and not (i - 1 > numContainerSlots)) then - if not f.ContainerHolder[i] then - if isBank then + if (not isReagent and (not isBank and bagID <= 3) or (isBank and bagID ~= -1 and numContainerSlots >= 1 and not (i - 1 > numContainerSlots))) then + if not f.ContainerHolder[i] then + if isBank then globalName = "SuperBankBag" .. (bagID - 4); - f.ContainerHolder[i] = NewFrame("CheckButton", globalName, f.ContainerHolder, "BankItemButtonBagTemplate") + f.ContainerHolder[i] = NewFrame("CheckButton", globalName, f.ContainerHolder, "BankItemButtonBagTemplate") else globalName = "SuperMainBag" .. bagID .. "Slot"; f.ContainerHolder[i] = NewFrame("CheckButton", globalName, f.ContainerHolder, "BagSlotButtonTemplate") @@ -395,7 +391,8 @@ function MOD:Layout(isBank) end f.ContainerHolder:Size(((buttonSize + buttonSpacing) * (isBank and i - 1 or i)) + buttonSpacing, buttonSize + (buttonSpacing * 2)) if isBank then - BankFrameItemButton_Update(f.ContainerHolder[i])BankFrameItemButton_UpdateLocked(f.ContainerHolder[i]) + BankFrameItemButton_Update(f.ContainerHolder[i]) + BankFrameItemButton_UpdateLocked(f.ContainerHolder[i]) end f.ContainerHolder[i]:Size(buttonSize) f.ContainerHolder[i]:ClearAllPoints() @@ -405,8 +402,10 @@ function MOD:Layout(isBank) f.ContainerHolder[i]:SetPoint("LEFT", lastContainerButton, "RIGHT", buttonSpacing, 0) end lastContainerButton = f.ContainerHolder[i]; - end + end + local numSlots = GetContainerNumSlots(bagID); + if numSlots > 0 then if not f.Bags[bagID] then f.Bags[bagID] = NewFrame("Frame", f:GetName().."Bag"..bagID, f); @@ -445,7 +444,7 @@ function MOD:Layout(isBank) f.Bags[bagID][slotID].iconTexture:FillInner(f.Bags[bagID][slotID]); f.Bags[bagID][slotID].iconTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9 ); f.Bags[bagID][slotID].cooldown = _G[f.Bags[bagID][slotID]:GetName().."Cooldown"]; - SuperVillain:AddCD(f.Bags[bagID][slotID].cooldown) + SV.Timers:AddCooldown(f.Bags[bagID][slotID].cooldown) f.Bags[bagID][slotID].bagID = bagID f.Bags[bagID][slotID].slotID = slotID end @@ -479,7 +478,7 @@ function MOD:Layout(isBank) if f.Bags[bagID] then f.Bags[bagID].numSlots = numSlots; end - if self.isBank then + if(self.isBank and not self.isReagent) then if self.ContainerHolder[i] then BankFrameItemButton_Update(self.ContainerHolder[i]) BankFrameItemButton_UpdateLocked(self.ContainerHolder[i]) @@ -496,7 +495,10 @@ function MOD:RefreshBags() end if MOD.BankFrame then MOD:Layout(true) - end + end + if MOD.ReagentFrame then + MOD:Layout(true, true) + end end function MOD:UpdateGoldText() @@ -505,7 +507,7 @@ end function MOD:VendorGrays(arg1, arg2, arg3) if(not MerchantFrame or not MerchantFrame:IsShown()) and not arg1 and not arg3 then - SuperVillain:AddonMessage(L["You must be at a vendor."]) + SV:AddonMessage(L["You must be at a vendor."]) return end local copper = 0; @@ -550,41 +552,41 @@ function MOD:VendorGrays(arg1, arg2, arg3) elseif not arg2 then strMsg = L["No gray items to delete."] end - SuperVillain:AddonMessage(strMsg) + SV:AddonMessage(strMsg) end function MOD:ModifyBags() local docked = self.db.alignToChat local anchor, x, y if self.BagFrame then - local parent = docked and RightSuperDock or SuperVillain.UIParent + local parent = docked and RightSuperDock or SV.UIParent local anchor, x, y = self.db.bags.point, self.db.bags.xOffset, self.db.bags.yOffset self.BagFrame:ClearAllPoints() self.BagFrame:Point(anchor, parent, anchor, x, y) end if self.BankFrame then - local parent = docked and LeftSuperDock or SuperVillain.UIParent + local parent = docked and LeftSuperDock or SV.UIParent local anchor, x, y = self.db.bank.point, self.db.bank.xOffset, self.db.bank.yOffset self.BankFrame:ClearAllPoints() self.BankFrame:Point(anchor, parent, anchor, x, y) - end + end end do local function Bags_OnEnter() if MOD.db.bagBar.mouseover ~= true then return end - UIFrameFadeIn(SVUI_BagBar, 0.2, SVUI_BagBar:GetAlpha(), 1) + SV:SecureFadeIn(SVUI_BagBar, 0.2, SVUI_BagBar:GetAlpha(), 1) end local function Bags_OnLeave() if MOD.db.bagBar.mouseover ~= true then return end - UIFrameFadeOut(SVUI_BagBar, 0.2, SVUI_BagBar:GetAlpha(), 0) + SV:SecureFadeOut(SVUI_BagBar, 0.2, SVUI_BagBar:GetAlpha(), 0) end local function AlterBagBar(bar) local icon = _G[bar:GetName().."IconTexture"] bar.oldTex = icon:GetTexture() - bar:Formula409() + bar:RemoveTextures() bar:SetFixedPanelTemplate("Default") bar:SetSlotTemplate(false, 1, nil, nil, true) icon:SetTexture(bar.oldTex) @@ -593,93 +595,112 @@ do end local function LoadBagBar() - if MOD.BagBarLoaded then return end - local bar = NewFrame("Frame", "SVUI_BagBar", SuperVillain.UIParent) + if MOD.BagBarLoaded then return end + + local bar = NewFrame("Frame", "SVUI_BagBar", SV.UIParent) bar:SetPoint("TOPRIGHT", RightSuperDock, "TOPLEFT", -4, 0) bar.buttons = {} - bar:SetPanelTemplate() bar:EnableMouse(true) bar:SetScript("OnEnter", Bags_OnEnter) bar:SetScript("OnLeave", Bags_OnLeave) + MainMenuBarBackpackButton:SetParent(bar) - MainMenuBarBackpackButton.SetParent = SuperVillain.dummy; + MainMenuBarBackpackButton.SetParent = SV.Cloaked; MainMenuBarBackpackButton:ClearAllPoints() MainMenuBarBackpackButtonCount:SetFontTemplate(nil, 10) MainMenuBarBackpackButtonCount:ClearAllPoints() MainMenuBarBackpackButtonCount:Point("BOTTOMRIGHT", MainMenuBarBackpackButton, "BOTTOMRIGHT", -1, 4) MainMenuBarBackpackButton:HookScript("OnEnter", Bags_OnEnter) MainMenuBarBackpackButton:HookScript("OnLeave", Bags_OnLeave) + tinsert(bar.buttons, MainMenuBarBackpackButton) AlterBagBar(MainMenuBarBackpackButton) + local count = #bar.buttons local frameCount = NUM_BAG_FRAMES - 1; + for i = 0, frameCount do local bagSlot = _G["CharacterBag"..i.."Slot"] bagSlot:SetParent(bar) - bagSlot.SetParent = SuperVillain.dummy; + bagSlot.SetParent = SV.Cloaked; bagSlot:HookScript("OnEnter", Bags_OnEnter) bagSlot:HookScript("OnLeave", Bags_OnLeave) AlterBagBar(bagSlot) count = count + 1 bar.buttons[count] = bagSlot - end - SuperVillain:SetSVMovable(bar, L["Bags"]) + end + MOD.BagBarLoaded = true end function MOD:ModifyBagBar() - if not SuperVillain.db.SVBag.bagBar.enable then return end - if not MOD.BagBarLoaded then + if not SV.db.SVBag.bagBar.enable then return end + + if not self.BagBarLoaded then LoadBagBar() end - if MOD.db.bagBar.mouseover then + if self.db.bagBar.mouseover then SVUI_BagBar:SetAlpha(0) else SVUI_BagBar:SetAlpha(1) end - if MOD.db.bagBar.showBackdrop then - SVUI_BagBar.Panel:Show() - else - SVUI_BagBar.Panel:Hide() - end + + local showBy = self.db.bagBar.showBy + local sortDir = self.db.bagBar.sortDirection + local bagSize = self.db.bagBar.size + local bagSpacing = self.db.bagBar.spacing + for i = 1, #SVUI_BagBar.buttons do local button = SVUI_BagBar.buttons[i] local lastButton = SVUI_BagBar.buttons[i - 1] - button:Size(MOD.db.bagBar.size) + + button:Size(bagSize) button:ClearAllPoints() - if MOD.db.bagBar.showBy == "HORIZONTAL" and MOD.db.bagBar.sortDirection == "ASCENDING" then + + if(showBy == "HORIZONTAL" and sortDir == "ASCENDING") then if i == 1 then - button:SetPoint("LEFT", SVUI_BagBar, "LEFT", MOD.db.bagBar.spacing, 0) + button:SetPoint("LEFT", SVUI_BagBar, "LEFT", bagSpacing, 0) elseif lastButton then - button:SetPoint("LEFT", lastButton, "RIGHT", MOD.db.bagBar.spacing, 0) + button:SetPoint("LEFT", lastButton, "RIGHT", bagSpacing, 0) end - elseif MOD.db.bagBar.showBy == "VERTICAL" and MOD.db.bagBar.sortDirection == "ASCENDING" then + elseif(showBy == "VERTICAL" and sortDir == "ASCENDING") then if i == 1 then - button:SetPoint("TOP", SVUI_BagBar, "TOP", 0, -MOD.db.bagBar.spacing) + button:SetPoint("TOP", SVUI_BagBar, "TOP", 0, -bagSpacing) elseif lastButton then - button:SetPoint("TOP", lastButton, "BOTTOM", 0, -MOD.db.bagBar.spacing) + button:SetPoint("TOP", lastButton, "BOTTOM", 0, -bagSpacing) end - elseif MOD.db.bagBar.showBy == "HORIZONTAL" and MOD.db.bagBar.sortDirection == "DESCENDING" then + elseif(showBy == "HORIZONTAL" and sortDir == "DESCENDING") then if i == 1 then - button:SetPoint("RIGHT", SVUI_BagBar, "RIGHT", -MOD.db.bagBar.spacing, 0) + button:SetPoint("RIGHT", SVUI_BagBar, "RIGHT", -bagSpacing, 0) elseif lastButton then - button:SetPoint("RIGHT", lastButton, "LEFT", -MOD.db.bagBar.spacing, 0) + button:SetPoint("RIGHT", lastButton, "LEFT", -bagSpacing, 0) end else if i == 1 then - button:SetPoint("BOTTOM", SVUI_BagBar, "BOTTOM", 0, MOD.db.bagBar.spacing) + button:SetPoint("BOTTOM", SVUI_BagBar, "BOTTOM", 0, bagSpacing) elseif lastButton then - button:SetPoint("BOTTOM", lastButton, "TOP", 0, MOD.db.bagBar.spacing) + button:SetPoint("BOTTOM", lastButton, "TOP", 0, bagSpacing) end end end - if MOD.db.bagBar.showBy == "HORIZONTAL" then - SVUI_BagBar:Width(MOD.db.bagBar.size * numBagFrame + MOD.db.bagBar.spacing * numBagFrame + MOD.db.bagBar.spacing) - SVUI_BagBar:Height(MOD.db.bagBar.size + MOD.db.bagBar.spacing * 2) + if showBy == "HORIZONTAL" then + SVUI_BagBar:Width((bagSize * numBagFrame) + (bagSpacing * numBagFrame) + bagSpacing) + SVUI_BagBar:Height(bagSize + (bagSpacing * 2)) else - SVUI_BagBar:Height(MOD.db.bagBar.size * numBagFrame + MOD.db.bagBar.spacing * numBagFrame + MOD.db.bagBar.spacing) - SVUI_BagBar:Width(MOD.db.bagBar.size + MOD.db.bagBar.spacing * 2) - end + SVUI_BagBar:Height((bagSize * numBagFrame) + (bagSpacing * numBagFrame) + bagSpacing) + SVUI_BagBar:Width(bagSize + (bagSpacing * 2)) + end + + if not SVUI_BagBar_MOVE then + SVUI_BagBar:SetPanelTemplate("Default") + SV:SetSVMovable(SVUI_BagBar, L["Bags Bar"]) + end + + if self.db.bagBar.showBackdrop then + SVUI_BagBar.Panel:Show() + else + SVUI_BagBar.Panel:Hide() + end end end --[[ @@ -691,7 +712,7 @@ do local function UpdateEquipmentInfo(slot, bag, index) if not slot.equipmentinfo then slot.equipmentinfo = slot:CreateFontString(nil,"OVERLAY") - slot.equipmentinfo:SetFontTemplate(SuperVillain.Media.font.roboto, 10, "OUTLINE") + slot.equipmentinfo:SetFontTemplate(SV.Media.font.roboto, 10, "OUTLINE") slot.equipmentinfo:SetAllPoints(slot) slot.equipmentinfo:SetWordWrap(true) slot.equipmentinfo:SetJustifyH('LEFT') @@ -765,10 +786,10 @@ do for _, id in ipairs(self.BagIDs) do local numSlots = GetContainerNumSlots(id) if(not self.Bags[id] and numSlots ~= 0 or self.Bags[id] and numSlots ~= self.Bags[id].numSlots) then - MOD:Layout(self.isBank) + MOD:Layout(self.isBank, self.isReagent) return end - if(SuperVillain.db.SVGear.misc.setoverlay) then + if(SV.db.SVGear.misc.setoverlay) then for i = 1, numSlots do if self.Bags[id] and self.Bags[id][i] then UpdateEquipmentInfo(self.Bags[id][i], id, i) @@ -779,15 +800,15 @@ do self:RefreshBagSlots(...) elseif(event == "BAG_UPDATE_COOLDOWN") then self:RefreshCD() - elseif(event == "PLAYERBANKSLOTS_CHANGED") then + elseif(event == "PLAYERBANKSLOTS_CHANGED" or event == "PLAYERREAGENTBANKSLOTS_CHANGED") then self:RefreshBagsSlots() end end local Vendor_OnClick = function(self) if IsShiftKeyDown()then - SuperVillain.SystemAlert["DELETE_GRAYS"].Money = MOD:VendorGrays(false,true,true) - SuperVillain:StaticPopup_Show('DELETE_GRAYS') + SV.SystemAlert["DELETE_GRAYS"].Money = MOD:VendorGrays(false,true,true) + SV:StaticPopup_Show('DELETE_GRAYS') else MOD:VendorGrays() end @@ -816,7 +837,7 @@ do GameTooltip:AddLine(' ') GameTooltip:AddDoubleLine(self.ttText2,self.ttText2desc,1,1,1) end - self:GetNormalTexture():SetGradient(unpack(SuperVillain.Media.gradient.highlight)) + self:GetNormalTexture():SetGradient(unpack(SV.Media.gradient.highlight)) GameTooltip:Show() end @@ -848,7 +869,7 @@ do container = MOD.BagFrame for _,id in ipairs(container.BagIDs) do numSlots = GetContainerNumSlots(id) - if(SuperVillain.db.SVGear.misc.setoverlay) then + if(SV.db.SVGear.misc.setoverlay) then for i=1,numSlots do if container.Bags[id] and container.Bags[id][i] then UpdateEquipmentInfo(container.Bags[id][i], id, i) @@ -867,7 +888,26 @@ do container = MOD.BankFrame for _,id in ipairs(container.BagIDs) do numSlots = GetContainerNumSlots(id) - if(SuperVillain.db.SVGear.misc.setoverlay) then + if(SV.db.SVGear.misc.setoverlay) then + for i=1,numSlots do + if container.Bags[id] and container.Bags[id][i] then + UpdateEquipmentInfo(container.Bags[id][i], id, i) + end + end + else + for i=1,numSlots do + if(container.Bags[id] and container.Bags[id][i] and container.Bags[id][i].equipmentinfo) then + container.Bags[id][i].equipmentinfo:SetText() + end + end + end + end + end + if(MOD.ReagentFrame) then + container = MOD.ReagentFrame + for _,id in ipairs(container.BagIDs) do + numSlots = GetContainerNumSlots(id) + if(SV.db.SVGear.misc.setoverlay) then for i=1,numSlots do if container.Bags[id] and container.Bags[id][i] then UpdateEquipmentInfo(container.Bags[id][i], id, i) @@ -888,29 +928,35 @@ do local bagName = "SVUI_ContainerFrame" local uisCount = #UISpecialFrames + 1; local bagsCount = #self.BagFrames + 1; - local frame = NewFrame("Button", bagName, SuperVillain.UIParent) + local frame = NewFrame("Button", bagName, SV.UIParent) frame:SetPanelTemplate("Container") frame:SetFrameStrata("HIGH") frame.RefreshSlot = MOD.RefreshSlot; frame.RefreshBagsSlots = MOD.RefreshBagsSlots; frame.RefreshBagSlots = MOD.RefreshBagSlots; frame.RefreshCD = MOD.RefreshCD; + frame:RegisterEvent("ITEM_LOCK_CHANGED") frame:RegisterEvent("ITEM_UNLOCKED") frame:RegisterEvent("BAG_UPDATE_COOLDOWN") frame:RegisterEvent("BAG_UPDATE") frame:RegisterEvent("EQUIPMENT_SETS_CHANGED") frame:RegisterEvent("PLAYERBANKSLOTS_CHANGED") + frame:RegisterEvent("PLAYERREAGENTBANKSLOTS_CHANGED") frame:SetMovable(true) + frame:RegisterForDrag("LeftButton", "RightButton") frame:RegisterForClicks("AnyUp") + frame:SetScript("OnDragStart", Container_OnDragStart) frame:SetScript("OnDragStop", Container_OnDragStop) frame:SetScript("OnClick", Container_OnClick) frame:SetScript("OnEnter", Container_OnEnter) frame:SetScript("OnLeave", Token_OnLeave) frame:SetScript("OnEvent", Container_OnEvent) + frame.isBank = false; + frame.isReagent = false; frame:Hide() frame.bottomOffset = 32; frame.topOffset = 65; @@ -927,7 +973,7 @@ do frame.ContainerHolder:Hide() frame.goldText = frame:CreateFontString(nil, "OVERLAY") - frame.goldText:SetFontTemplate(SuperVillain.Media.font.numbers) + frame.goldText:SetFontTemplate(SV.Media.font.numbers) frame.goldText:Point("BOTTOMRIGHT", frame.holderFrame, "TOPRIGHT", -2, 4) frame.goldText:SetJustifyH("RIGHT") frame.editBox = NewFrame("EditBox", bagName.."EditBox", frame) @@ -946,7 +992,7 @@ do frame.editBox:SetScript("OnChar", Search_OnInput) frame.editBox.SearchReset = Search_OnKeyPressed frame.editBox:SetText(SEARCH) - frame.editBox:SetFontTemplate(SuperVillain.Media.font.roboto) + frame.editBox:SetFontTemplate(SV.Media.font.roboto) local searchButton = NewFrame("Button", nil, frame) searchButton:RegisterForClicks("LeftButtonUp", "RightButtonUp") @@ -955,7 +1001,7 @@ do searchButton:SetButtonTemplate() searchButton:SetScript("OnClick", Search_OnClick) local searchText = searchButton:CreateFontString(nil, "OVERLAY") - searchText:SetFont(SuperVillain.Media.font.roboto, 12, "NONE") + searchText:SetFont(SV.Media.font.roboto, 12, "NONE") searchText:SetAllPoints(searchButton) searchText:SetJustifyH("CENTER") searchText:SetText("|cff9999ff"..SEARCH.."|r") @@ -970,7 +1016,7 @@ do frame.sortButton.ttText = L["Sort Bags"] frame.sortButton:SetScript("OnEnter", Tooltip_Show) frame.sortButton:SetScript("OnLeave", Tooltip_Hide) - local Sort_OnClick = MOD:RunSortingProcess(MOD.Sort, "bags") + local Sort_OnClick = (SV.___interface >= 60000) and SortBankBags or MOD:RunSortingProcess(MOD.Sort, "bags") frame.sortButton:SetScript("OnClick", Sort_OnClick) frame.stackButton = NewFrame("Button", nil, frame) @@ -1034,7 +1080,7 @@ do frame.currencyButton[h].icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) frame.currencyButton[h].text = frame.currencyButton[h]:CreateFontString(nil, "OVERLAY") frame.currencyButton[h].text:Point("LEFT", frame.currencyButton[h], "RIGHT", 2, 0) - frame.currencyButton[h].text:SetFontTemplate(SuperVillain.Media.font.numbers, 18, "NONE") + frame.currencyButton[h].text:SetFontTemplate(SV.Media.font.numbers, 18, "NONE") frame.currencyButton[h]:SetScript("OnEnter", Token_OnEnter) frame.currencyButton[h]:SetScript("OnLeave", Token_OnLeave) frame.currencyButton[h]:SetScript("OnClick", Token_OnClick) @@ -1048,23 +1094,30 @@ do self.BagFrame = frame end - function MOD:MakeBank() - local bagName = "SVUI_BankContainerFrame" + function MOD:MakeBankOrReagent(isReagent) + -- Reagent Slots: 1 - 98 + -- /script print(ReagentBankFrameItem1:GetInventorySlot()) + local bagName = isReagent and "SVUI_ReagentContainerFrame" or "SVUI_BankContainerFrame" + local otherName = isReagent and "SVUI_BankContainerFrame" or "SVUI_ReagentContainerFrame" local uisCount = #UISpecialFrames + 1; local bagsCount = #self.BagFrames + 1; - local frame = NewFrame("Button", bagName, SuperVillain.UIParent) - frame:SetPanelTemplate("Container") + + local frame = NewFrame("Button", bagName, isReagent and self.BankFrame or SV.UIParent) + frame:SetPanelTemplate(isReagent and "Action" or "Container") frame:SetFrameStrata("HIGH") frame.RefreshSlot = MOD.RefreshSlot; frame.RefreshBagsSlots = MOD.RefreshBagsSlots; frame.RefreshBagSlots = MOD.RefreshBagSlots; frame.RefreshCD = MOD.RefreshCD; + frame:RegisterEvent("ITEM_LOCK_CHANGED") frame:RegisterEvent("ITEM_UNLOCKED") frame:RegisterEvent("BAG_UPDATE_COOLDOWN") frame:RegisterEvent("BAG_UPDATE") frame:RegisterEvent("EQUIPMENT_SETS_CHANGED") frame:RegisterEvent("PLAYERBANKSLOTS_CHANGED") + frame:RegisterEvent("PLAYERREAGENTBANKSLOTS_CHANGED") + frame:SetMovable(true) frame:RegisterForDrag("LeftButton", "RightButton") frame:RegisterForClicks("AnyUp") @@ -1074,12 +1127,19 @@ do frame:SetScript("OnEnter", Container_OnEnter) frame:SetScript("OnLeave", Token_OnLeave) frame:SetScript("OnEvent", Container_OnEvent) + frame.isBank = true; + frame.isReagent = isReagent; frame:Hide() frame.bottomOffset = 8; frame.topOffset = 60; - frame.BagIDs = {-1, 5, 6, 7, 8, 9, 10, 11} + if(isReagent) then + frame.BagIDs = {} + else + frame.BagIDs = {-1, 5, 6, 7, 8, 9, 10, 11} + end frame.Bags = {} + frame.closeButton = NewFrame("Button", bagName.."CloseButton", frame, "UIPanelCloseButton") frame.closeButton:Point("TOPRIGHT", -4, -4) frame.holderFrame = NewFrame("Frame", nil, frame) @@ -1098,7 +1158,7 @@ do frame.sortButton.ttText = L["Sort Bags"] frame.sortButton:SetScript("OnEnter", Tooltip_Show) frame.sortButton:SetScript("OnLeave", Tooltip_Hide) - local Sort_OnClick = MOD:RunSortingProcess(MOD.Sort, "bank") + local Sort_OnClick = (SV.___interface >= 60000) and SortReagentBankBags or MOD:RunSortingProcess(MOD.Sort, "bank") frame.sortButton:SetScript("OnClick", Sort_OnClick) frame.stackButton = NewFrame("Button", nil, frame) @@ -1123,48 +1183,72 @@ do local Transfer_OnClick = MOD:RunSortingProcess(MOD.Transfer, "bank bags") frame.transferButton:SetScript("OnClick", Transfer_OnClick) - frame.bagsButton = NewFrame("Button", nil, frame) - frame.bagsButton:Point("RIGHT", frame.sortButton, "LEFT", -10, 0) - frame.bagsButton:Size(25, 25) - frame.bagsButton:SetNormalTexture(ICON_BAGS) - StyleBagToolButton(frame.bagsButton) - frame.bagsButton.ttText = L["Toggle Bags"] - frame.bagsButton:SetScript("OnEnter", Tooltip_Show) - frame.bagsButton:SetScript("OnLeave", Tooltip_Hide) - local BagBtn_OnClick = function() - local numSlots, _ = GetNumBankSlots() - if numSlots >= 1 then - ToggleFrame(frame.ContainerHolder) - else - SuperVillain:StaticPopup_Show("NO_BANK_BAGS") - end - end - frame.bagsButton:SetScript("OnClick", BagBtn_OnClick) - - frame.purchaseBagButton = NewFrame("Button", nil, frame) - frame.purchaseBagButton:Size(25, 25) - frame.purchaseBagButton:Point("RIGHT", frame.bagsButton, "LEFT", -10, 0) - frame.purchaseBagButton:SetFrameLevel(frame.purchaseBagButton:GetFrameLevel()+2) - frame.purchaseBagButton:SetNormalTexture(ICON_PURCHASE) - StyleBagToolButton(frame.purchaseBagButton) - frame.purchaseBagButton.ttText = L["Purchase"] - frame.purchaseBagButton:SetScript("OnEnter", Tooltip_Show) - frame.purchaseBagButton:SetScript("OnLeave", Tooltip_Hide) - local PurchaseBtn_OnClick = function() - local _, full = GetNumBankSlots() - if not full then - SuperVillain:StaticPopup_Show("BUY_BANK_SLOT") - else - SuperVillain:StaticPopup_Show("CANNOT_BUY_BANK_SLOT") - end - end - frame.purchaseBagButton:SetScript("OnClick", PurchaseBtn_OnClick) - - frame:SetScript("OnHide", CloseBankFrame) - UISpecialFrames[uisCount] = "SVUI_BankContainerFrame"; + + UISpecialFrames[uisCount] = bagName; self.BagFrames[bagsCount] = frame - self.BankFrame = frame + + if(not isReagent) then + frame.bagsButton = NewFrame("Button", nil, frame) + frame.bagsButton:Point("RIGHT", frame.sortButton, "LEFT", -10, 0) + frame.bagsButton:Size(25, 25) + frame.bagsButton:SetNormalTexture(ICON_BAGS) + StyleBagToolButton(frame.bagsButton) + frame.bagsButton.ttText = L["Toggle Bags"] + frame.bagsButton:SetScript("OnEnter", Tooltip_Show) + frame.bagsButton:SetScript("OnLeave", Tooltip_Hide) + local BagBtn_OnClick = function() + local numSlots, _ = GetNumBankSlots() + if numSlots >= 1 then + ToggleFrame(frame.ContainerHolder) + else + SV:StaticPopup_Show("NO_BANK_BAGS") + end + end + frame.bagsButton:SetScript("OnClick", BagBtn_OnClick) + + frame.purchaseBagButton = NewFrame("Button", nil, frame) + frame.purchaseBagButton:Size(25, 25) + frame.purchaseBagButton:Point("RIGHT", frame.bagsButton, "LEFT", -10, 0) + frame.purchaseBagButton:SetFrameLevel(frame.purchaseBagButton:GetFrameLevel()+2) + frame.purchaseBagButton:SetNormalTexture(ICON_PURCHASE) + StyleBagToolButton(frame.purchaseBagButton) + frame.purchaseBagButton.ttText = L["Purchase"] + frame.purchaseBagButton:SetScript("OnEnter", Tooltip_Show) + frame.purchaseBagButton:SetScript("OnLeave", Tooltip_Hide) + local PurchaseBtn_OnClick = function() + local _, full = GetNumBankSlots() + if not full then + SV:StaticPopup_Show("BUY_BANK_SLOT") + else + SV:StaticPopup_Show("CANNOT_BUY_BANK_SLOT") + end + end + frame.purchaseBagButton:SetScript("OnClick", PurchaseBtn_OnClick) + + if(SV.___interface >= 60000) then + frame.swapButton = NewFrame("Button", nil, frame) + frame.swapButton:Point("TOPRIGHT", frame, "TOPRIGHT", -40, -10) + frame.swapButton:Size(25, 25) + frame.swapButton:SetNormalTexture(ICON_BAGS) + StyleBagToolButton(frame.swapButton) + frame.swapButton.ttText = isReagent and L["View Bank"] or L["View Reagents"] + frame.swapButton:SetScript("OnEnter", Tooltip_Show) + frame.swapButton:SetScript("OnLeave", Tooltip_Hide) + frame.swapButton:SetScript("OnClick", function() + if(_G["SVUI_ReagentContainerFrame"]:IsShown()) then + _G["SVUI_ReagentContainerFrame"]:Hide() + else + _G["SVUI_ReagentContainerFrame"]:Show() + end + end) + end + frame:SetScript("OnHide", CloseBankFrame) + self.BankFrame = frame + else + frame:SetPoint("TOPLEFT", self.BankFrame, "TOPRIGHT", 2, 0) + self.ReagentFrame = frame + end end end @@ -1229,7 +1313,10 @@ do MOD.BagFrame:Hide() if(MOD.BankFrame) then MOD.BankFrame:Hide() - end + end + if(MOD.ReagentFrame) then + MOD.ReagentFrame:Hide() + end if(BreakStuffHandler and BreakStuffButton and BreakStuffButton.icon) then BreakStuffHandler:MODIFIER_STATE_CHANGED() BreakStuffHandler.ReadyToSmash = false @@ -1259,11 +1346,18 @@ do end function MOD:BANKFRAME_OPENED() + local hasReagent = (SV.___interface >= 60000) if not MOD.BankFrame then - MOD:MakeBank() + MOD:MakeBankOrReagent() MOD:ModifyBags() - end + end MOD:Layout(true) + + if(hasReagent and not MOD.ReagentFrame) then + MOD:MakeBankOrReagent(true) + MOD:Layout(true, true) + end + MOD.BankFrame:Show() MOD.BankFrame:RefreshBagsSlots() MOD.BagFrame:Show() @@ -1272,8 +1366,12 @@ do end function MOD:BANKFRAME_CLOSED() - if not MOD.BankFrame then return end - MOD.BankFrame:Hide() + if(MOD.BankFrame and MOD.BankFrame:IsShown()) then + MOD.BankFrame:Hide() + end + if(MOD.ReagentFrame and MOD.ReagentFrame:IsShown()) then + MOD.ReagentFrame:Hide() + end end function SetBagHooks() @@ -1302,7 +1400,7 @@ BUILD FUNCTION / UPDATE ########################################################## ]]-- function MOD:ReLoad() - if not SuperVillain.db.SVBag.enable then return end + if not SV.db.SVBag.enable then return end self:Layout(); self:Layout(true); self:ModifyBags(); @@ -1313,22 +1411,22 @@ function MOD:Load() if IsAddOnLoaded("AdiBags") then return end - if not SuperVillain.db.SVBag.enable then return end + if not SV.db.SVBag.enable then return end self:ModifyBagBar() - SuperVillain.bags = self; + SV.bags = self; self.BagFrames = {} self:MakeBags() SetBagHooks() self:ModifyBags() self:Layout(false) self:DisableBlizzard() - SuperVillain:ExecuteTimer(MOD.BreakStuffLoader, 5) + SV.Timers:ExecuteTimer(MOD.BreakStuffLoader, 5) self:RegisterEvent("INVENTORY_SEARCH_UPDATE") self:RegisterEvent("PLAYER_MONEY", "UpdateGoldText") self:RegisterEvent("PLAYER_ENTERING_WORLD") self:RegisterEvent("PLAYER_TRADE_MONEY", "UpdateGoldText") self:RegisterEvent("TRADE_MONEY_CHANGED", "UpdateGoldText") - self:RegisterEvent("PLAYERBANKBAGSLOTS_CHANGED"); + if(SV.___interface >= 60000) then self:RegisterEvent("PLAYERBANKBAGSLOTS_CHANGED"); end StackSplitFrame:SetFrameStrata("DIALOG") self.BagFrame:RefreshBagsSlots() end @@ -1358,8 +1456,8 @@ CONFIGS["SVBag"] = { ["bagSize"] = 34, ["bankSize"] = 34, ["alignToChat"] = false, - ["bagWidth"] = 450, - ["bankWidth"] = 450, + ["bagWidth"] = 525, + ["bankWidth"] = 525, ["currencyFormat"] = "ICON", ["ignoreItems"] = "", ["bagTools"] = true, @@ -1374,4 +1472,4 @@ CONFIGS["SVBag"] = { }, } -SuperVillain.Registry:NewPackage(MOD, "SVBag"); \ No newline at end of file +Registry:NewPackage(MOD, "SVBag"); \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/bag/tools/breakstuff.lua b/Interface/AddOns/SVUI/packages/bag/tools/breakstuff.lua index b6335e9..d32f201 100644 --- a/Interface/AddOns/SVUI/packages/bag/tools/breakstuff.lua +++ b/Interface/AddOns/SVUI/packages/bag/tools/breakstuff.lua @@ -32,9 +32,9 @@ local tremove, tcopy, twipe, tsort, tcat = table.remove, table.copy, table.wipe, GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVBag; -local TTIP = SuperVillain.SVTip; +local SV, L = unpack(select(2, ...)); +local MOD = SV.SVBag; +local TTIP = SV.SVTip; --[[ ########################################################## LOCAL VARS @@ -187,7 +187,7 @@ local BreakStuff_OnEnter = function(self) end if BreakStuffHandler.ReadyToSmash ~= true then self:SetPanelColor("class") - self.icon:SetGradient(unpack(SuperVillain.Media.gradient.highlight)) + self.icon:SetGradient(unpack(SV.Media.gradient.highlight)) end GameTooltip:Show() end @@ -212,7 +212,7 @@ local BreakStuff_OnClick = function(self) BreakStuffHandler.ReadyToSmash = true self.ttText = "BreakStuff : ON"; self:SetPanelColor("green") - self.icon:SetGradient(unpack(SuperVillain.Media.gradient.green)) + self.icon:SetGradient(unpack(SV.Media.gradient.green)) if(not MOD.BagFrame:IsShown()) then GameTooltip:Hide() MOD.BagFrame:Show() diff --git a/Interface/AddOns/SVUI/packages/bag/tools/sorting.lua b/Interface/AddOns/SVUI/packages/bag/tools/sorting.lua index 4cd636e..bfebcc7 100644 --- a/Interface/AddOns/SVUI/packages/bag/tools/sorting.lua +++ b/Interface/AddOns/SVUI/packages/bag/tools/sorting.lua @@ -42,8 +42,8 @@ local tremove, tcopy, twipe, tsort = table.remove, table.copy, table.wipe, table GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVBag; +local SV, L = unpack(select(2, ...)); +local MOD = SV.SVBag; --[[ ########################################################## LOCAL VARS diff --git a/Interface/AddOns/SVUI/packages/chat/SVChat.lua b/Interface/AddOns/SVUI/packages/chat/SVChat.lua index 32de19d..0bec632 100644 --- a/Interface/AddOns/SVUI/packages/chat/SVChat.lua +++ b/Interface/AddOns/SVUI/packages/chat/SVChat.lua @@ -34,8 +34,8 @@ local twipe = table.wipe; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local CONFIGS = SuperVillain.Configs +local SV, L, Registry = unpack(select(2, ...)); +local CONFIGS = SV.Configs local MOD = {}; --[[ ########################################################## @@ -170,10 +170,10 @@ do end local function SetEmoticon(text) - if not text then return end; + if not text then return end if (not MOD.db.smileys or text:find(" / run") or text:find(" / dump") or text:find(" / script")) then return text - end; + end local result = ""; local maxLen = len(text); local count = 1; @@ -181,7 +181,7 @@ do while count <= maxLen do temp = maxLen; local section = find(text, "|H", count, true) - if section ~= nil then temp = section end; + if section ~= nil then temp = section end pattern = sub(text, count, temp); result = result .. GetEmoticon(pattern) count = temp + 1; @@ -193,7 +193,7 @@ do count = temp + 1; end end - end; + end return result end @@ -201,25 +201,25 @@ do if ((event == "CHAT_MSG_WHISPER" or event == "CHAT_MSG_BN_WHISPER") and CHAT_PSST) then if text:sub(1, 3) == "OQ, " then return false, text, ... - end; + end PlaySoundFile(CHAT_PSST, "Master") - end; + end if(not CHAT_ALLOW_URL) then text = SetEmoticon(text) return false, text, ... - end; + end local result, ct = text:gsub("(%a+)://(%S+)%s?", "%1://%2") if ct > 0 then return false, SetEmoticon(result), ... - end; + end result, ct = text:gsub("www%.([_A-Za-z0-9-]+)%.(%S+)%s?", "www.%1.%2") if ct > 0 then return false, SetEmoticon(result), ... - end; + end result, ct = text:gsub("([_A-Za-z0-9-%.]+)@([_A-Za-z0-9-]+)(%.+)([_A-Za-z0-9-%.]+)%s?", "%1@%2%3%4") if ct > 0 then return false, SetEmoticon(result), ... - end; + end text = SetEmoticon(text) return false, text, ... end @@ -246,13 +246,13 @@ do internalTest = false; if text:find("%pTInterface%p+") or text:find("%pTINTERFACE%p+") then internalTest = true - end; - if not internalTest then text = text:gsub("(%s?)(%d%d?%d?%.%d%d?%d?%.%d%d?%d?%.%d%d?%d?:%d%d?%d?%d?%d?)(%s?)", _parse) end; - if not internalTest then text = text:gsub("(%s?)(%d%d?%d?%.%d%d?%d?%.%d%d?%d?%.%d%d?%d?)(%s?)", _parse) end; - if not internalTest then text = text:gsub("(%s?)([%w_-]+%.?[%w_-]+%.[%w_-]+:%d%d%d?%d?%d?)(%s?)", _parse) end; - if not internalTest then text = text:gsub("(%s?)(%a+://[%w_/%.%?%%=~&-'%-]+)(%s?)", _parse) end; - if not internalTest then text = text:gsub("(%s?)(www%.[%w_/%.%?%%=~&-'%-]+)(%s?)", _parse) end; - if not internalTest then text = text:gsub("(%s?)([_%w-%.~-]+@[_%w-]+%.[_%w-%.]+)(%s?)", _parse) end; + end + if not internalTest then text = text:gsub("(%s?)(%d%d?%d?%.%d%d?%d?%.%d%d?%d?%.%d%d?%d?:%d%d?%d?%d?%d?)(%s?)", _parse) end + if not internalTest then text = text:gsub("(%s?)(%d%d?%d?%.%d%d?%d?%.%d%d?%d?%.%d%d?%d?)(%s?)", _parse) end + if not internalTest then text = text:gsub("(%s?)([%w_-]+%.?[%w_-]+%.[%w_-]+:%d%d%d?%d?%d?)(%s?)", _parse) end + if not internalTest then text = text:gsub("(%s?)(%a+://[%w_/%.%?%%=~&-'%-]+)(%s?)", _parse) end + if not internalTest then text = text:gsub("(%s?)(www%.[%w_/%.%?%%=~&-'%-]+)(%s?)", _parse) end + if not internalTest then text = text:gsub("(%s?)([_%w-%.~-]+@[_%w-]+%.[_%w-%.]+)(%s?)", _parse) end self.TempAddMessage(self, _concatTimeStamp(text), ...) end @@ -268,7 +268,7 @@ do end local blockFlag = false local msg = author:upper() .. message; - if(author ~= UnitName("player") and msg ~= nil and (event == "CHAT_MSG_YELL" or event == "CHAT_MSG_CHANNEL")) then + if(author ~= UnitName("player") and msg ~= nil and (event == "CHAT_MSG_YELL")) then if THROTTLE_CACHE[msg] and CHAT_THROTTLE ~= 0 then if difftime(time(), THROTTLE_CACHE[msg]) <= CHAT_THROTTLE then blockFlag = true @@ -292,8 +292,8 @@ do chat.TempAddMessage = chat.AddMessage; chat.AddMessage = AddModifiedMessage end - end; - ChatFrame_AddMessageEventFilter("CHAT_MSG_CHANNEL", ChatEventFilter) + end + --ChatFrame_AddMessageEventFilter("CHAT_MSG_CHANNEL", ChatEventFilter) ChatFrame_AddMessageEventFilter("CHAT_MSG_YELL", ChatEventFilter) ChatFrame_AddMessageEventFilter("CHAT_MSG_SAY", ChatEventFilter) ChatFrame_AddMessageEventFilter("CHAT_MSG_WHISPER_INFORM", ChatEventFilter) @@ -311,7 +311,7 @@ do ChatFrame_AddMessageEventFilter("CHAT_MSG_BN_WHISPER_INFORM", ChatEventFilter) ChatFrame_AddMessageEventFilter("CHAT_MSG_BN_INLINE_TOAST_BROADCAST", ChatEventFilter); end -end; +end --[[ ########################################################## CORE FUNCTIONS @@ -382,11 +382,11 @@ do FCF_Tab_OnClick(self,button); local chatFrame = _G[("ChatFrame%d"):format(self:GetID())]; if(chatFrame:AtBottom() and ScrollIndicator:IsShown()) then - SuperVillain.Animate:StopFlash(ScrollIndicator) + SV.Animate:StopFlash(ScrollIndicator) ScrollIndicator:Hide() elseif(not chatFrame:AtBottom() and not ScrollIndicator:IsShown()) then ScrollIndicator:Show() - SuperVillain.Animate:Flash(ScrollIndicator,1,true) + SV.Animate:Flash(ScrollIndicator,1,true) end if ( chatFrame.isDocked and FCFDock_GetSelectedWindow(GENERAL_CHAT_DOCK) ~= chatFrame ) then self.IsOpen = true @@ -412,7 +412,7 @@ do if LeftSuperDock:IsShown()then LeftSuperDockToggleButton:GetScript("OnLeave")(LeftSuperDockToggleButton) end - end; + end self:Hide() SuperDockAlertLeft:Deactivate() end @@ -428,29 +428,29 @@ do testText = false; break end - end; + end if testText then self:Hide() return end end - end; + end if text:len() < 5 then if text:sub(1, 4) == "/tt " then local name, realm = UnitName("target") if name then name = gsub(name, " ", "") - end; + end if name and not UnitIsSameServer("player", "target") then name = name.."-"..gsub(realm, " ", "") - end; + end ChatFrame_SendTell(name or L["Invalid Target"], ChatFrame1) - end; + end if text:sub(1, 4) == "/gr " then self:SetText(MOD:GetGroupDistribution()..text:sub(5)) ChatEdit_ParseText(self, 0) end - end; + end local result, ct = text:gsub("|Kf(%S+)|k(%S+)%s(%S+)|k", "%2 %3") if ct > 0 then result = result:gsub("|", "") @@ -475,12 +475,12 @@ do lastTab = frame end end - end; + end local function _removeTab(frame,chat) - if(not frame or not frame.chatID) then return end; + if(not frame or not frame.chatID) then return end local name = frame:GetName(); - if(not TabSafety[name]) then return end; + if(not TabSafety[name]) then return end TabSafety[name] = false; local chatID = frame.chatID; if(TabsList[chatID]) then @@ -496,7 +496,7 @@ do local function _addTab(frame,chatID) local name = frame:GetName(); - if(TabSafety[name]) then return end; + if(TabSafety[name]) then return end TabSafety[name] = true; TabsList[chatID] = frame frame.chatID = chatID; @@ -505,7 +505,7 @@ do end local function _customTab(tab, chatID, enabled) - if(tab.IsStyled) then return end; + if(tab.IsStyled) then return end local tabName = tab:GetName(); local tabSize = SuperDockChatTabBar.currentSize; local tabText = tab.text:GetText() or "Chat "..chatID; @@ -530,13 +530,13 @@ do tab.icon:SetAlpha(0.5) tab.TText = tabText; - --tab.SetWidth = SuperVillain.fubar - tab.SetHeight = SuperVillain.fubar - tab.SetSize = SuperVillain.fubar - tab.SetParent = SuperVillain.fubar - tab.ClearAllPoints = SuperVillain.fubar - tab.SetAllPoints = SuperVillain.fubar - tab.SetPoint = SuperVillain.fubar + --tab.SetWidth = SV.fubar + tab.SetHeight = SV.fubar + tab.SetSize = SV.fubar + tab.SetParent = SV.fubar + tab.ClearAllPoints = SV.fubar + tab.SetAllPoints = SV.fubar + tab.SetPoint = SV.fubar tab:SetScript("OnEnter", Tab_OnEnter); tab:SetScript("OnLeave", Tab_OnLeave); @@ -575,8 +575,8 @@ do chat:SetFrameLevel(4) chat:SetClampRectInsets(0, 0, 0, 0) chat:SetClampedToScreen(false) - chat:Formula409(true) - _G[chatName.."ButtonFrame"]:MUNG() + chat:RemoveTextures(true) + _G[chatName.."ButtonFrame"]:Die() ------------------------------------------- _G[tabName .."Left"]:SetTexture(0,0,0,0) _G[tabName .."Middle"]:SetTexture(0,0,0,0) @@ -599,23 +599,23 @@ do if tab.conversationIcon then tab.conversationIcon:ClearAllPoints() tab.conversationIcon:Point("RIGHT", tab.text, "LEFT", -1, 0) - end; + end if(TAB_SKINS and not tab.IsStyled) then local arg3 = (chat.inUse or chat.isDocked or chat.isTemporary) _customTab(tab, chatID, arg3) else tab:SetHeight(TAB_HEIGHT) tab:SetWidth(TAB_WIDTH) - tab.SetWidth = SuperVillain.fubar; + tab.SetWidth = SV.fubar; end ------------------------------------------- local ebPoint1, ebPoint2, ebPoint3 = select(6, editBox:GetRegions()) - ebPoint1:MUNG() - ebPoint2:MUNG() - ebPoint3:MUNG() - _G[editBoxName.."FocusLeft"]:MUNG() - _G[editBoxName.."FocusMid"]:MUNG() - _G[editBoxName.."FocusRight"]:MUNG() + ebPoint1:Die() + ebPoint2:Die() + ebPoint3:Die() + _G[editBoxName.."FocusLeft"]:Die() + _G[editBoxName.."FocusMid"]:Die() + _G[editBoxName.."FocusRight"]:Die() editBox:SetFixedPanelTemplate("Button", true) editBox:SetAltArrowKeyMode(false) editBox:SetAllPoints(SuperDockAlertLeft) @@ -640,7 +640,7 @@ do chat.InitConfig = true end - end; + end local function _modifyTab(tab, floating) if(not floating) then @@ -663,7 +663,7 @@ do end function MOD:RefreshChatFrames(forced) - if (not SuperVillain.db.SVChat.enable) then return; end + if (not SV.db.SVChat.enable) then return; end if ((not forced) and refreshLocked and (IsMouseButtonDown("LeftButton") or InCombatLockdown())) then return; end for i,name in pairs(CHAT_FRAMES)do @@ -696,7 +696,7 @@ do chat:Height(CHAT_HEIGHT) chat:Point("BOTTOMRIGHT",SuperDockWindowLeft,"BOTTOMRIGHT",-6,10) FCF_SavePositionAndDimensions(chat) - end; + end chat:SetParent(SuperDockWindowLeft) if(not TAB_SKINS) then tab.owner = chat; @@ -716,10 +716,10 @@ do chat:SetUserPlaced(true) end end - end; + end refreshLocked = true end -end; +end function MOD:PET_BATTLE_CLOSE() for _, frameName in pairs(CHAT_FRAMES) do @@ -752,11 +752,11 @@ do end end if(self:AtBottom() and ScrollIndicator:IsShown()) then - SuperVillain.Animate:StopFlash(ScrollIndicator) + SV.Animate:StopFlash(ScrollIndicator) ScrollIndicator:Hide() elseif(not self:AtBottom() and not ScrollIndicator:IsShown()) then ScrollIndicator:Show() - SuperVillain.Animate:Flash(ScrollIndicator,1,true) + SV.Animate:Flash(ScrollIndicator,1,true) end end @@ -824,11 +824,11 @@ do ActiveHyperLink = false; end if(self:AtBottom() and ScrollIndicator:IsShown()) then - SuperVillain.Animate:StopFlash(ScrollIndicator) + SV.Animate:StopFlash(ScrollIndicator) ScrollIndicator:Hide() elseif(not self:AtBottom() and not ScrollIndicator:IsShown()) then ScrollIndicator:Show() - SuperVillain.Animate:Flash(ScrollIndicator,1,true) + SV.Animate:Flash(ScrollIndicator,1,true) end end @@ -863,12 +863,12 @@ do local _hook_FCFStartAlertFlash = function(self) if(not self.WhisperAlert) then return end self.WhisperAlert:Show() - SuperVillain.Animate:Flash(self.WhisperAlert,1,true) + SV.Animate:Flash(self.WhisperAlert,1,true) end local _hook_FCFStopAlertFlash = function(self) if(not self.WhisperAlert) then return end - SuperVillain.Animate:StopFlash(self.WhisperAlert) + SV.Animate:StopFlash(self.WhisperAlert) self.WhisperAlert:Hide() end @@ -901,23 +901,23 @@ do end function MOD:UpdateLocals() - CHAT_WIDTH = (SuperVillain.db.SVDock.dockLeftWidth or 350) - 10; - CHAT_HEIGHT = (SuperVillain.db.SVDock.dockLeftHeight or 180) - 15; + CHAT_WIDTH = (SV.db.SVDock.dockLeftWidth or 350) - 10; + CHAT_HEIGHT = (SV.db.SVDock.dockLeftHeight or 180) - 15; CHAT_THROTTLE = self.db.throttleInterval; CHAT_ALLOW_URL = self.db.url; CHAT_HOVER_URL = self.db.hyperlinkHover; CHAT_STICKY = self.db.sticky; - CHAT_FONT = SuperVillain.Shared:Fetch("font", self.db.font); - CHAT_FONTSIZE = SuperVillain.db.media.fonts.size or 12; + CHAT_FONT = SV.Shared:Fetch("font", self.db.font); + CHAT_FONTSIZE = SV.db.media.fonts.size or 12; CHAT_FONTOUTLINE = self.db.fontOutline; TAB_WIDTH = self.db.tabWidth; TAB_HEIGHT = self.db.tabHeight; TAB_SKINS = self.db.tabStyled; - TAB_FONT = SuperVillain.Shared:Fetch("font", self.db.tabFont); + TAB_FONT = SV.Shared:Fetch("font", self.db.tabFont); TAB_FONTSIZE = self.db.tabFontSize; TAB_FONTOUTLINE = self.db.tabFontOutline; CHAT_FADING = self.db.fade; - CHAT_PSST = SuperVillain.Shared:Fetch("sound", self.db.psst); + CHAT_PSST = SV.Shared:Fetch("sound", self.db.psst); TIME_STAMP_MASK = self.db.timeStampFormat; if(CHAT_THROTTLE and CHAT_THROTTLE == 0) then twipe(THROTTLE_CACHE) @@ -925,12 +925,12 @@ function MOD:UpdateLocals() end function MOD:ReLoad() - if(not SuperVillain.db.SVChat.enable) then return end + if(not SV.db.SVChat.enable) then return end self:RefreshChatFrames(true) end function MOD:Load() - if(not SuperVillain.db.SVChat.enable) then return end + if(not SV.db.SVChat.enable) then return end ScrollIndicator:SetParent(SuperDockWindowLeft) ScrollIndicator:SetSize(20,20) @@ -955,8 +955,8 @@ function MOD:Load() _G.GeneralDockManagerOverflowButtonList:SetFixedPanelTemplate('Transparent') _G.GeneralDockManager:SetAllPoints(SuperDockChatTabBar) SetAllChatHooks() - FriendsMicroButton:MUNG() - ChatFrameMenuButton:MUNG() + FriendsMicroButton:Die() + ChatFrameMenuButton:Die() _G.InterfaceOptionsSocialPanelTimestampsButton:SetAlpha(0) _G.InterfaceOptionsSocialPanelTimestampsButton:SetScale(0.000001) _G.InterfaceOptionsSocialPanelTimestamps:SetAlpha(0) @@ -995,4 +995,4 @@ CONFIGS["SVChat"] = { ["basicTools"] = true, } -SuperVillain.Registry:NewPackage(MOD, "SVChat") \ No newline at end of file +Registry:NewPackage(MOD, "SVChat") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/dock/SVDock.lua b/Interface/AddOns/SVUI/packages/dock/SVDock.lua index d0c945e..acae141 100644 --- a/Interface/AddOns/SVUI/packages/dock/SVDock.lua +++ b/Interface/AddOns/SVUI/packages/dock/SVDock.lua @@ -33,8 +33,8 @@ local format, gsub, strfind, strmatch, tonumber = format, gsub, strfind, strmatc GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local CONFIGS = SuperVillain.Configs +local SV, L, Registry = unpack(select(2, ...)); +local CONFIGS = SV.Configs local MOD, DOCKLET_CACHE, TOOL_CACHE, SAFETY_CACHE = {}, {}, {}, {}; local PREV_TOOL, DEFAULT_DOCKLET; --[[ @@ -115,12 +115,12 @@ local ToggleDocks = function(self) GameTooltip:Hide() if MOD.SuperDockFaded then MOD.SuperDockFaded = nil; - SuperVillain:SecureFadeIn(LeftSuperDock, 0.2, LeftSuperDock:GetAlpha(), 1) - SuperVillain:SecureFadeIn(RightSuperDock, 0.2, RightSuperDock:GetAlpha(), 1) + SV:SecureFadeIn(LeftSuperDock, 0.2, LeftSuperDock:GetAlpha(), 1) + SV:SecureFadeIn(RightSuperDock, 0.2, RightSuperDock:GetAlpha(), 1) else MOD.SuperDockFaded = true; - SuperVillain:SecureFadeOut(LeftSuperDock, 0.2, LeftSuperDock:GetAlpha(), 0, true) - SuperVillain:SecureFadeOut(RightSuperDock, 0.2, RightSuperDock:GetAlpha(), 0, true) + SV:SecureFadeOut(LeftSuperDock, 0.2, LeftSuperDock:GetAlpha(), 0, true) + SV:SecureFadeOut(RightSuperDock, 0.2, RightSuperDock:GetAlpha(), 0, true) end SVUI_Cache["Dock"].SuperDockFaded = MOD.SuperDockFaded end @@ -142,7 +142,7 @@ local DockletButton_SaveColors = function(self, pG, iG, locked) self._iconGradient = iG self._colorLocked = locked self:SetPanelColor(pG) - self.icon:SetGradient(unpack(SuperVillain.Media.gradient[iG])) + self.icon:SetGradient(unpack(SV.Media.gradient[iG])) end local DockButtonActivate = function(self) @@ -158,13 +158,13 @@ end local DockletButton_OnEnter = function(self, ...) if MOD.SuperDockFaded then LeftSuperDock:Show() - SuperVillain:SecureFadeIn(LeftSuperDock, 0.2, LeftSuperDock:GetAlpha(), 1) + SV:SecureFadeIn(LeftSuperDock, 0.2, LeftSuperDock:GetAlpha(), 1) RightSuperDock:Show() - SuperVillain:SecureFadeIn(RightSuperDock, 0.2, RightSuperDock:GetAlpha(), 1) + SV:SecureFadeIn(RightSuperDock, 0.2, RightSuperDock:GetAlpha(), 1) end self:SetPanelColor("highlight") - self.icon:SetGradient(unpack(SuperVillain.Media.gradient.bizzaro)) + self.icon:SetGradient(unpack(SV.Media.gradient.bizzaro)) GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) GameTooltip:ClearLines() @@ -178,12 +178,12 @@ end local DockletButton_OnLeave = function(self, ...) if MOD.SuperDockFaded then - SuperVillain:SecureFadeOut(LeftSuperDock, 0.2, LeftSuperDock:GetAlpha(), 0, true) - SuperVillain:SecureFadeOut(RightSuperDock, 0.2, RightSuperDock:GetAlpha(), 0, true) + SV:SecureFadeOut(LeftSuperDock, 0.2, LeftSuperDock:GetAlpha(), 0, true) + SV:SecureFadeOut(RightSuperDock, 0.2, RightSuperDock:GetAlpha(), 0, true) end self:SetPanelColor(self._panelGradient) - self.icon:SetGradient(unpack(SuperVillain.Media.gradient[self._iconGradient])) + self.icon:SetGradient(unpack(SV.Media.gradient[self._iconGradient])) GameTooltip:Hide() end @@ -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(0,0,0,0) backdrop.top:Point("TOPLEFT", 1, -1) backdrop.top:Point("TOPRIGHT", -1, 1) backdrop.top:SetAlpha(0) @@ -300,7 +300,7 @@ local function SetSuperDockStyle(dock) return backdrop end -SuperVillain.CycleDocklets = CycleDocklets +SV.CycleDocklets = CycleDocklets --[[ ########################################################## CORE FUNCTIONS @@ -349,7 +349,7 @@ function MOD:CreateBasicToolButton(name,texture,onclick,frameName,isdefault) local clickFunction = (type(onclick)=="function") and onclick or DockletButton_OnClick; local size = SuperDockToolBarRight.currentSize; local button = _G[fName .. "_ToolBarButton"] or CreateFrame("Button", ("%s_ToolBarButton"):format(fName), SuperDockToolBarRight) - SuperVillain.AddTool(button) + SV.AddTool(button) button:Size(size,size) button:SetFramedButtonTemplate() button.icon = button:CreateTexture(nil,"OVERLAY") @@ -372,9 +372,9 @@ DOCKS function MOD:CreateSuperBorders() local texture = [[Interface\AddOns\SVUI\assets\artwork\Template\BUTTON]]; - local TopPanel = CreateFrame("Frame", "SVUITopPanel", SuperVillain.UIParent) - TopPanel:Point("TOPLEFT", SuperVillain.UIParent, "TOPLEFT", -1, 1) - TopPanel:Point("TOPRIGHT", SuperVillain.UIParent, "TOPRIGHT", 1, 1) + local TopPanel = CreateFrame("Frame", "SVUITopPanel", SV.UIParent) + TopPanel:Point("TOPLEFT", SV.UIParent, "TOPLEFT", -1, 1) + TopPanel:Point("TOPRIGHT", SV.UIParent, "TOPRIGHT", 1, 1) TopPanel:Height(14) TopPanel:SetBackdrop({ bgFile = texture, @@ -384,7 +384,7 @@ function MOD:CreateSuperBorders() edgeSize = 1, insets = {left = 0, right = 0, top = 0, bottom = 0} }) - TopPanel:SetBackdropColor(unpack(SuperVillain.Media.color.special)) + TopPanel:SetBackdropColor(unpack(SV.Media.color.special)) TopPanel:SetBackdropBorderColor(0,0,0,1) TopPanel:SetFrameLevel(0) TopPanel:SetFrameStrata('BACKGROUND') @@ -395,9 +395,9 @@ function MOD:CreateSuperBorders() end) self:TopPanelVisibility() - local BottomPanel = CreateFrame("Frame", "SVUIBottomPanel", SuperVillain.UIParent) - BottomPanel:Point("BOTTOMLEFT", SuperVillain.UIParent, "BOTTOMLEFT", -1, -1) - BottomPanel:Point("BOTTOMRIGHT", SuperVillain.UIParent, "BOTTOMRIGHT", 1, -1) + local BottomPanel = CreateFrame("Frame", "SVUIBottomPanel", SV.UIParent) + BottomPanel:Point("BOTTOMLEFT", SV.UIParent, "BOTTOMLEFT", -1, -1) + BottomPanel:Point("BOTTOMRIGHT", SV.UIParent, "BOTTOMRIGHT", 1, -1) BottomPanel:Height(14) BottomPanel:SetBackdrop({ bgFile = texture, @@ -407,7 +407,7 @@ function MOD:CreateSuperBorders() edgeSize = 1, insets = {left = 0, right = 0, top = 0, bottom = 0} }) - BottomPanel:SetBackdropColor(unpack(SuperVillain.Media.color.special)) + BottomPanel:SetBackdropColor(unpack(SV.Media.color.special)) BottomPanel:SetBackdropBorderColor(0,0,0,1) BottomPanel:SetFrameLevel(0) BottomPanel:SetFrameStrata('BACKGROUND') @@ -420,13 +420,13 @@ function MOD:CreateSuperBorders() end local function BorderColorUpdates() - SVUITopPanel:SetBackdropColor(unpack(SuperVillain.Media.color.special)) + SVUITopPanel:SetBackdropColor(unpack(SV.Media.color.special)) SVUITopPanel:SetBackdropBorderColor(0,0,0,1) - SVUIBottomPanel:SetBackdropColor(unpack(SuperVillain.Media.color.special)) + SVUIBottomPanel:SetBackdropColor(unpack(SV.Media.color.special)) SVUIBottomPanel:SetBackdropBorderColor(0,0,0,1) end -SuperVillain.Registry:SetCallback(BorderColorUpdates) +Registry:NewCallback(BorderColorUpdates) function MOD:CreateDockPanels() self.SuperDockFaded = SVUI_Cache["Dock"].SuperDockFaded @@ -438,12 +438,12 @@ function MOD:CreateDockPanels() local buttonsize = self.db.buttonSize or 22; local spacing = self.db.buttonSpacing or 4; local statBarWidth = self.db.dockStatWidth - local STATS = SuperVillain.SVStats; + local STATS = SV.SVStats; -- [[ CORNER BUTTON ]] -- - local leftbutton = CreateFrame("Button", "LeftSuperDockToggleButton", SuperVillain.UIParent) - leftbutton:Point("BOTTOMLEFT", SuperVillain.UIParent, "BOTTOMLEFT", 1, 2) + local leftbutton = CreateFrame("Button", "LeftSuperDockToggleButton", SV.UIParent) + leftbutton:Point("BOTTOMLEFT", SV.UIParent, "BOTTOMLEFT", 1, 2) leftbutton:Size(buttonsize, buttonsize) leftbutton:SetFramedButtonTemplate() leftbutton.icon = leftbutton:CreateTexture(nil, "OVERLAY", nil, 0) @@ -454,24 +454,24 @@ function MOD:CreateDockPanels() MOD:ActivateDockletButton(leftbutton, ToggleDocks) -- [[ TOOLBARS AND OTHER NONSENSE ]] -- - local toolbarLeft = CreateFrame("Frame", "SuperDockToolBarLeft", SuperVillain.UIParent) + local toolbarLeft = CreateFrame("Frame", "SuperDockToolBarLeft", SV.UIParent) toolbarLeft:Point("LEFT", leftbutton, "RIGHT", spacing, 0) toolbarLeft:Width(1) toolbarLeft:Height(buttonsize) toolbarLeft.currentSize = buttonsize; - local leftstation = CreateFrame("Frame", "SuperDockChatTabBar", SuperVillain.UIParent) + local leftstation = CreateFrame("Frame", "SuperDockChatTabBar", SV.UIParent) leftstation:SetFrameStrata("BACKGROUND") leftstation:Size(leftWidth - buttonsize, buttonsize) leftstation:Point("LEFT", toolbarLeft, "RIGHT", spacing, 0) leftstation:SetFrameLevel(leftstation:GetFrameLevel() + 2) leftstation.currentSize = buttonsize; - local leftdock = CreateFrame("Frame", "LeftSuperDock", SuperVillain.UIParent) + local leftdock = CreateFrame("Frame", "LeftSuperDock", SV.UIParent) leftdock:SetFrameStrata("BACKGROUND") - leftdock:Point("BOTTOMLEFT", SuperVillain.UIParent, "BOTTOMLEFT", 1, buttonsize + 10) + leftdock:Point("BOTTOMLEFT", SV.UIParent, "BOTTOMLEFT", 1, buttonsize + 10) leftdock:Size(leftWidth, leftHeight) - SuperVillain:SetSVMovable(leftdock, L["Left Dock"]) + SV:SetSVMovable(leftdock, L["Left Dock"]) leftalert:SetParent(leftdock) leftalert:SetFrameStrata("BACKGROUND") @@ -489,8 +489,8 @@ function MOD:CreateDockPanels() -- [[ CORNER BUTTON ]] -- - local rightbutton = CreateFrame("Button", "RightSuperDockToggleButton", SuperVillain.UIParent) - rightbutton:Point("BOTTOMRIGHT", SuperVillain.UIParent, "BOTTOMRIGHT", -1, 2) + local rightbutton = CreateFrame("Button", "RightSuperDockToggleButton", SV.UIParent) + rightbutton:Point("BOTTOMRIGHT", SV.UIParent, "BOTTOMRIGHT", -1, 2) rightbutton:Size(buttonsize, buttonsize) rightbutton:SetFramedButtonTemplate() rightbutton.icon = rightbutton:CreateTexture(nil, "OVERLAY") @@ -498,24 +498,24 @@ function MOD:CreateDockPanels() rightbutton.icon:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-HENCHMAN]]) rightbutton.TText = "Call Henchman!" rightbutton:RegisterForClicks("AnyUp") - MOD:ActivateDockletButton(rightbutton, SuperVillain.ToggleHenchman) + MOD:ActivateDockletButton(rightbutton, SV.ToggleHenchman) -- [[ TOOLBARS AND OTHER NONSENSE ]] -- - local toolbarRight = CreateFrame("Frame", "SuperDockToolBarRight", SuperVillain.UIParent) + local toolbarRight = CreateFrame("Frame", "SuperDockToolBarRight", SV.UIParent) toolbarRight:Point("RIGHT", rightbutton, "LEFT", -spacing, 0) toolbarRight:Size(1, buttonsize) toolbarRight.currentSize = buttonsize; - local macrobar = CreateFrame("Frame", "SuperDockMacroBar", SuperVillain.UIParent) + local macrobar = CreateFrame("Frame", "SuperDockMacroBar", SV.UIParent) macrobar:Point("RIGHT", toolbarRight, "LEFT", -spacing, 0) macrobar:Size(1, buttonsize) macrobar.currentSize = buttonsize; - local rightdock = CreateFrame("Frame", "RightSuperDock", SuperVillain.UIParent) + local rightdock = CreateFrame("Frame", "RightSuperDock", SV.UIParent) rightdock:SetFrameStrata("BACKGROUND") - rightdock:Point("BOTTOMRIGHT", SuperVillain.UIParent, "BOTTOMRIGHT", -1, buttonsize + 10) + rightdock:Point("BOTTOMRIGHT", SV.UIParent, "BOTTOMRIGHT", -1, buttonsize + 10) rightdock:Size(rightWidth, rightHeight) - SuperVillain:SetSVMovable(rightdock, L["Right Dock"]) + SV:SetSVMovable(rightdock, L["Right Dock"]) rightalert:SetParent(rightdock) rightalert:SetFrameStrata("BACKGROUND") @@ -533,17 +533,17 @@ function MOD:CreateDockPanels() if MOD.SuperDockFaded then LeftSuperDock:Hide()RightSuperDock:Hide() end - local toolbarTop = CreateFrame("Frame", "SuperDockToolBarTop", SuperVillain.UIParent) - toolbarTop:Point("TOPLEFT", SuperVillain.UIParent, "TOPLEFT", 2, -4) + local toolbarTop = CreateFrame("Frame", "SuperDockToolBarTop", SV.UIParent) + toolbarTop:Point("TOPLEFT", SV.UIParent, "TOPLEFT", 2, -4) toolbarTop:Size(1, buttonsize - 12) toolbarTop.openWidth = (leftWidth - 1) / 3; --TOP STAT HOLDERS local topWidth = (leftWidth + rightWidth) * 0.8 - local topanchor = CreateFrame("Frame", "SuperDockTopDataAnchor", SuperVillain.UIParent) + local topanchor = CreateFrame("Frame", "SuperDockTopDataAnchor", SV.UIParent) topanchor:Size(topWidth - 2, buttonsize - 8) topanchor:Point("LEFT", toolbarTop, "RIGHT", spacing, 0) - SuperVillain:AddToDisplayAudit(topanchor) + SV:AddToDisplayAudit(topanchor) local topleftdata = CreateFrame("Frame", "TopLeftDataPanel", topanchor) topleftdata:Size((topWidth * 0.5) - 1, buttonsize - 8) @@ -556,10 +556,10 @@ function MOD:CreateDockPanels() STATS:NewAnchor(toprightdata, 3, "ANCHOR_CURSOR", true) --BOTTOM STAT HOLDERS - local bottomanchor = CreateFrame("Frame", "SuperDockBottomDataAnchor", SuperVillain.UIParent) + local bottomanchor = CreateFrame("Frame", "SuperDockBottomDataAnchor", SV.UIParent) bottomanchor:Size(statBarWidth - 2, buttonsize - 8) - bottomanchor:Point("BOTTOM", SuperVillain.UIParent, "BOTTOM", 0, 2) - SuperVillain:AddToDisplayAudit(bottomanchor) + bottomanchor:Point("BOTTOM", SV.UIParent, "BOTTOM", 0, 2) + --SV:AddToDisplayAudit(bottomanchor) local bottomleftdata = CreateFrame("Frame", "BottomLeftDataPanel", bottomanchor) bottomleftdata:Size((statBarWidth * 0.5) - 1, buttonsize - 8) @@ -744,8 +744,8 @@ end EXTERNALLY ACCESSIBLE METHODS ########################################################## ]]-- -SuperVillain.CurrentlyDocked = {}; -function SuperVillain:IsDockletReady(arg) +SV.CurrentlyDocked = {}; +function SV:IsDockletReady(arg) local addon = arg; if arg == "DockletMain" or arg == "DockletExtra" then addon = MOD.db.docklets[arg] @@ -757,7 +757,7 @@ function SuperVillain:IsDockletReady(arg) return true end -function SuperVillain:RemoveTool() +function SV:RemoveTool() if not self or not self.listIndex then return end local name = self:GetName(); if not SAFETY_CACHE[name] then return end @@ -772,7 +772,7 @@ function SuperVillain:RemoveTool() self:Hide() end -function SuperVillain:AddTool() +function SV:AddTool() local name = self:GetName(); if SAFETY_CACHE[name] then return end SAFETY_CACHE[name] = true; @@ -801,19 +801,19 @@ do local function UnregisterDocklets() local frame, i; - twipe(SuperVillain.CurrentlyDocked); - if SuperVillain:IsDockletReady("DockletMain") then + twipe(SV.CurrentlyDocked); + if SV:IsDockletReady("DockletMain") then frame = MOD.db.docklets.MainWindow if frame ~= nil and frame ~= "None" and _G[frame] then UnregisterDocklet(frame) MOD.db.docklets.MainWindow = "None" end elseif AddOnButton.IsRegistered then - SuperVillain.RemoveTool(AddOnButton) + SV.RemoveTool(AddOnButton) AddOnButton.TText = ""; AddOnButton.IsRegistered = false; end - if SuperVillain:IsDockletReady("DockletExtra") then + if SV:IsDockletReady("DockletExtra") then frame = MOD.db.docklets.ExtraWindow if frame ~= nil and frame ~= "None" and _G[frame] then UnregisterDocklet(frame) @@ -824,13 +824,13 @@ do SuperDockletExtra.FrameName = "None" end - function SuperVillain:ReloadDocklets(alert) + function SV:ReloadDocklets(alert) UnregisterDocklets() if InCombatLockdown()then return end local width = MOD.db.dockRightWidth or 350; local height = (MOD.db.dockRightHeight or 180) - 22 - if SuperVillain:IsDockletReady('DockletMain') then - if SuperVillain:IsDockletReady("DockletExtra") and MOD.db.docklets.enableExtra then + if SV:IsDockletReady('DockletMain') then + if SV:IsDockletReady("DockletExtra") and MOD.db.docklets.enableExtra then width = width * 0.5; end SuperDockletMain:ClearAllPoints() @@ -843,7 +843,7 @@ do end end -function SuperVillain:RegisterDocklet(name, tooltip, texture, onclick, isdefault) +function SV:RegisterDocklet(name, tooltip, texture, onclick, isdefault) local frame = _G[name]; if frame and (frame.IsObjectType and frame:IsObjectType("Frame")) and (frame.IsProtected and not frame:IsProtected()) then frame:ClearAllPoints() @@ -856,7 +856,7 @@ function SuperVillain:RegisterDocklet(name, tooltip, texture, onclick, isdefault end end -function SuperVillain:RegisterMainDocklet(name) +function SV:RegisterMainDocklet(name) local frame = _G[name]; if (frame and (frame.IsObjectType and frame:IsObjectType("Frame")) and (frame.IsProtected and not frame:IsProtected())) then SuperDockletMain.FrameName = name; @@ -875,7 +875,7 @@ function SuperVillain:RegisterMainDocklet(name) end end -function SuperVillain:RegisterExtraDocklet(name) +function SV:RegisterExtraDocklet(name) local frame = _G[name]; if (frame and (frame.IsObjectType and frame:IsObjectType("Frame")) and (frame.IsProtected and not frame:IsProtected())) then SuperDockletExtra.FrameName = name; @@ -918,7 +918,7 @@ function MOD:UpdateSuperDock() self:BottomPanelVisibility(); self:TopPanelVisibility(); self:UpdateDockBackdrops(); - SuperVillain:ReloadDocklets() + SV:ReloadDocklets() end function MOD:UpdateDockBackdrops() @@ -999,8 +999,8 @@ function MOD:Load() SuperDockletMain:SetScript("OnShow", DockletFrame_OnShow) SuperDockletExtra:SetScript("OnShow", DockletFrame_OnShow) - SuperVillain:ReloadDocklets(true) - SuperVillain:ExecuteTimer(self.LoadToolBarProfessions, 5) + SV:ReloadDocklets(true) + SV.Timers:ExecuteTimer(self.LoadToolBarProfessions, 5) end --[[ ########################################################## @@ -1030,4 +1030,4 @@ CONFIGS["SVDock"] = { }, } -SuperVillain.Registry:NewPackage(MOD, "SVDock") \ No newline at end of file +Registry:NewPackage(MOD, "SVDock") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/gear/SVGear.lua b/Interface/AddOns/SVUI/packages/gear/SVGear.lua index d9c989d..496cfcf 100644 --- a/Interface/AddOns/SVUI/packages/gear/SVGear.lua +++ b/Interface/AddOns/SVUI/packages/gear/SVGear.lua @@ -32,8 +32,8 @@ local ceil, floor, round = math.ceil, math.floor, math.round; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local CONFIGS = SuperVillain.Configs +local SV, L, Registry = unpack(select(2, ...)); +local CONFIGS = SV.Configs local MOD = {}; --[[ ########################################################## @@ -99,7 +99,7 @@ local function SetItemDurabilityDisplay(globalName, slotId) if(current ~= total) then actual = current / total; perc = actual * 100; - r,g,b = SuperVillain:ColorGradient(actual,1,0,0,1,1,0,0,1,0) + r,g,b = SV:ColorGradient(actual,1,0,0,1,1,0,0,1,0) frame.DurabilityInfo.bar:SetValue(perc) frame.DurabilityInfo.bar:SetStatusBarColor(r,g,b) if not frame.DurabilityInfo:IsShown() then @@ -129,14 +129,14 @@ local function GetActiveGear() end if(count == 0) then return resultSpec,false - end; + end for i=1, count do local setName,_,_,setUsed = GetEquipmentSetInfo(i) if setUsed then resultSet = setName break end - end; + end return resultSpec,resultSet end @@ -148,8 +148,8 @@ local function SetDisplayStats(arg) if(flags[1]) then frame.ItemLevel = frame:CreateFontString(nil, "OVERLAY") frame.ItemLevel:Point("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 2, 1) - frame.ItemLevel:SetFontTemplate(SuperVillain.Media.font.roboto, 10, "OUTLINE", "RIGHT") - end; + frame.ItemLevel:SetFontTemplate(SV.Media.font.roboto, 10, "OUTLINE", "RIGHT") + end if(arg == "Character" and flags[2]) then frame.DurabilityInfo = CreateFrame("Frame", nil, frame) @@ -179,7 +179,7 @@ local function SetDisplayStats(arg) frame.DurabilityInfo:SetBackdropBorderColor(0, 0, 0, 0.8) frame.DurabilityInfo.bar = CreateFrame("StatusBar", nil, frame.DurabilityInfo) frame.DurabilityInfo.bar:FillInner(frame.DurabilityInfo, 2, 2) - frame.DurabilityInfo.bar:SetStatusBarTexture(SuperVillain.Media.bar.default) + frame.DurabilityInfo.bar:SetStatusBarTexture(SV.Media.bar.default) frame.DurabilityInfo.bar:SetOrientation("VERTICAL") frame.DurabilityInfo.bg = frame.DurabilityInfo:CreateTexture(nil, "BORDER") frame.DurabilityInfo.bg:FillInner(frame.DurabilityInfo, 2, 2) @@ -187,49 +187,49 @@ local function SetDisplayStats(arg) frame.DurabilityInfo.bg:SetVertexColor("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) end end -end; +end --[[ ########################################################## CORE FUNCTIONS ########################################################## ]]-- local function RefreshInspectedGear() - if(not MOD.PreBuildComplete) then return end; + if(not MOD.PreBuildComplete) then return end if(InCombatLockdown()) then MOD:RegisterEvent("PLAYER_REGEN_ENABLED", RefreshInspectedGear) return else MOD:UnregisterEvent("PLAYER_REGEN_ENABLED") - end; + end local unit = InspectFrame and InspectFrame.unit or "player"; - if(not unit or (unit and not CanInspect(unit,false))) then return end; + if(not unit or (unit and not CanInspect(unit,false))) then return end if(SHOW_LEVEL) then - SuperVillain:ParseGearSlots(unit, true, SetItemLevelDisplay) + SV:ParseGearSlots(unit, true, SetItemLevelDisplay) else - SuperVillain:ParseGearSlots(unit, true) + SV:ParseGearSlots(unit, true) end end local function RefreshGear() - if(not MOD.PreBuildComplete) then return end; + if(not MOD.PreBuildComplete) then return end if(InCombatLockdown()) then MOD:RegisterEvent("PLAYER_REGEN_ENABLED", RefreshGear) return else MOD:UnregisterEvent("PLAYER_REGEN_ENABLED") - end; + end MOD:UpdateLocals() if(SHOW_LEVEL) then - SuperVillain:ParseGearSlots("player", false, SetItemLevelDisplay, SetItemDurabilityDisplay) + SV:ParseGearSlots("player", false, SetItemLevelDisplay, SetItemDurabilityDisplay) else - SuperVillain:ParseGearSlots("player", false, nil, SetItemDurabilityDisplay) + SV:ParseGearSlots("player", false, nil, SetItemDurabilityDisplay) end end local Gear_UpdateTabs = function() - SuperVillain:ExecuteTimer(RefreshInspectedGear, 0.2) + SV.Timers:ExecuteTimer(RefreshInspectedGear, 0.2) end local function GearSwap() @@ -242,7 +242,7 @@ local function GearSwap() if EQUIP_SET ~= "none" and EQUIP_SET ~= gearSet then LIVESET = EQUIP_SET; UseEquipmentSet(EQUIP_SET) - end; + end return end end @@ -262,7 +262,7 @@ function MOD:PLAYER_ENTERING_WORLD() SetDisplayStats("Character") SetDisplayStats("Inspect") NewHook('InspectFrame_UpdateTabs', Gear_UpdateTabs) - SuperVillain:ExecuteTimer(RefreshGear, 10) + SV.Timers:ExecuteTimer(RefreshGear, 10) GearSwap() self.PreBuildComplete = true end @@ -271,7 +271,7 @@ local MSG_PREFIX = "You have equipped equipment set: " local GearSwapComplete = function() if LIVESET then local strMsg = ("%s%s"):format(MSG_PREFIX, LIVESET) - SuperVillain:AddonMessage(strMsg) + SV:AddonMessage(strMsg) LIVESET = nil end end @@ -326,4 +326,4 @@ CONFIGS["SVGear"] = { setoverlay = true, } } -SuperVillain.Registry:NewPackage(MOD, "SVGear"); \ No newline at end of file +Registry:NewPackage(MOD, "SVGear"); \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua index dc2b981..61afd9d 100644 --- a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua +++ b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua @@ -13,8 +13,8 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(select(2, ...)); -local CONFIGS = SuperVillain.Configs +local SV, L, Registry = unpack(select(2, ...)); +local CONFIGS = SV.Configs local MOD = {} --[[ ########################################################## @@ -78,11 +78,11 @@ local AutomatedEvents = { SCRIPT HANDLERS ########################################################## ]]-- -local ColorFunc = function(arg) SuperVillain:SetColorTheme(arg, true); SuperVillain:ToggleHenchman() end -local UnitFunc = function(arg) SuperVillain:SetUnitframeLayout(arg, true); SuperVillain:ToggleHenchman() end -local BarFunc = function(arg) SuperVillain:SetupBarLayout(arg, true); SuperVillain:ToggleHenchman() end -local AuraFunc = function(arg) SuperVillain:SetupAuralayout(arg, true); SuperVillain:ToggleHenchman() end -local ConfigFunc = function() SuperVillain:ToggleConfig(); SuperVillain:ToggleHenchman() end +local ColorFunc = function(arg) SV.Setup:SetColorTheme(arg, true); SV:ToggleHenchman() end +local UnitFunc = function(arg) SV.Setup:SetUnitframeLayout(arg, true); SV:ToggleHenchman() end +local BarFunc = function(arg) SV.Setup:SetupBarLayout(arg, true); SV:ToggleHenchman() end +local AuraFunc = function(arg) SV.Setup:SetupAuralayout(arg, true); SV:ToggleHenchman() end +local ConfigFunc = function() SV:ToggleConfig(); SV:ToggleHenchman() end local speechTimer; local Tooltip_Show = function(self) @@ -140,8 +140,8 @@ local Speech_OnTimeout = function() end local Speech_OnEnter = function(self) - SuperVillain:SecureFadeOut(self, 0.5, 1, 0) - local newTimer = SuperVillain:ExecuteTimer(Speech_OnTimeout, 0.5, speechTimer) + SV:SecureFadeOut(self, 0.5, 1, 0) + local newTimer = SV.Timers:ExecuteTimer(Speech_OnTimeout, 0.5, speechTimer) speechTimer = newTimer self:SetScript("OnEnter", nil) end @@ -149,7 +149,7 @@ end local Speech_OnShow = function(self) if self.message then self.txt:SetText(self.message) - local newTimer = SuperVillain:ExecuteTimer(Speech_OnTimeout, 5, speechTimer) + local newTimer = SV.Timers:ExecuteTimer(Speech_OnTimeout, 5, speechTimer) speechTimer = newTimer self.message = nil self:SetScript("OnEnter", Speech_OnEnter) @@ -183,7 +183,7 @@ function GetAllMail() SVUI_GetMailButton:SetScript("OnClick",nil) SVUI_GetGoldButton:SetScript("OnClick",nil) baseInboxFrame_OnClick=InboxFrame_OnClick; - InboxFrame_OnClick = SuperVillain.fubar + InboxFrame_OnClick = SV.fubar SVUI_GetMailButton:RegisterEvent("UI_ERROR_MESSAGE") OpenMailItem(GetInboxNumItems()) end @@ -248,7 +248,7 @@ function StopOpeningMail(msg, ...) total_cash = nil; needsToWait = false; if msg then - SuperVillain:HenchmanSays(msg) + SV:HenchmanSays(msg) end end @@ -288,7 +288,7 @@ local function CreateMinionOptions(i) MOD.db[setting] = toggle; end end - SuperVillain.Animate:Slide(option,-500,-500) + SV.Animate:Slide(option,-500,-500) option:SetFrameStrata("DIALOG") option:SetFrameLevel(24) option:EnableMouse(true) @@ -299,14 +299,14 @@ local function CreateMinionOptions(i) option.bg:SetVertexColor(1,1,1,0.6) option.txt = option:CreateFontString(nil,"DIALOG") option.txt:FillInner(option) - option.txt:SetFont(SuperVillain.Media.font.dialog,12,"NONE") + option.txt:SetFont(SV.Media.font.dialog,12,"NONE") option.txt:SetJustifyH("CENTER") option.txt:SetJustifyV("MIDDLE") option.txt:SetText(options[2]) option.txt:SetTextColor(0,0,0) option.txthigh = option:CreateFontString(nil,"HIGHLIGHT") option.txthigh:FillInner(option) - option.txthigh:SetFont(SuperVillain.Media.font.dialog,12,"OUTLINE") + option.txthigh:SetFont(SV.Media.font.dialog,12,"OUTLINE") option.txthigh:SetJustifyH("CENTER") option.txthigh:SetJustifyV("MIDDLE") option.txthigh:SetText(options[2]) @@ -338,7 +338,7 @@ local function CreateHenchmenOptions(i) else option:Point("TOP",_G["HenchmenOptionButton"..lastIndex],"BOTTOM",offsetX,-32) end - SuperVillain.Animate:Slide(option,500,-500) + SV.Animate:Slide(option,500,-500) option:SetFrameStrata("DIALOG") option:SetFrameLevel(24) option:EnableMouse(true) @@ -349,14 +349,14 @@ local function CreateHenchmenOptions(i) option.bg:SetVertexColor(1,1,1,0.6) option.txt = option:CreateFontString(nil,"DIALOG") option.txt:FillInner(option) - option.txt:SetFont(SuperVillain.Media.font.dialog,12,"NONE") + option.txt:SetFont(SV.Media.font.dialog,12,"NONE") option.txt:SetJustifyH("CENTER") option.txt:SetJustifyV("MIDDLE") option.txt:SetText(options[2]) option.txt:SetTextColor(0,0,0) option.txthigh = option:CreateFontString(nil,"HIGHLIGHT") option.txthigh:FillInner(option) - option.txthigh:SetFont(SuperVillain.Media.font.dialog,12,"OUTLINE") + option.txthigh:SetFont(SV.Media.font.dialog,12,"OUTLINE") option.txthigh:SetJustifyH("CENTER") option.txthigh:SetJustifyV("MIDDLE") option.txthigh:SetText(options[2]) @@ -392,19 +392,19 @@ local function CreateHenchmenSubOptions(buttonIndex,optionIndex) frame.txthigh:FillInner(frame) frame.txthigh:SetFontTemplate(false,12,"OUTLINE","CENTER","MIDDLE") frame.txthigh:SetTextColor(1,1,0) - SuperVillain.Animate:Slide(frame,500,0) + SV.Animate:Slide(frame,500,0) tinsert(SUBOPTIONS,frame) end local function CreateHenchmenFrame() - HenchmenFrame:SetParent(SuperVillain.UIParent) + HenchmenFrame:SetParent(SV.UIParent) HenchmenFrame:SetPoint("CENTER",UIParent,"CENTER",0,0) HenchmenFrame:SetWidth(500) HenchmenFrame:SetHeight(500) HenchmenFrame:SetFrameStrata("DIALOG") HenchmenFrame:SetFrameLevel(24) - SuperVillain.Animate:Slide(HenchmenFrame,0,-500) + SV.Animate:Slide(HenchmenFrame,0,-500) local model = CreateFrame("PlayerModel", "HenchmenFrameModel", HenchmenFrame) model:SetPoint("TOPLEFT",HenchmenFrame,25,-25) @@ -415,26 +415,26 @@ local function CreateHenchmenFrame() HenchmenFrame:Hide() - local HenchmenCalloutFrame = CreateFrame("Frame","HenchmenCalloutFrame",SuperVillain.UIParent) + local HenchmenCalloutFrame = CreateFrame("Frame","HenchmenCalloutFrame",SV.UIParent) HenchmenCalloutFrame:SetPoint("BOTTOM",UIParent,"BOTTOM",100,150) HenchmenCalloutFrame:SetWidth(256) HenchmenCalloutFrame:SetHeight(128) HenchmenCalloutFrame:SetFrameStrata("DIALOG") HenchmenCalloutFrame:SetFrameLevel(24) - SuperVillain.Animate:Slide(HenchmenCalloutFrame,-356,-278) + SV.Animate:Slide(HenchmenCalloutFrame,-356,-278) HenchmenCalloutFramePic = HenchmenCalloutFrame:CreateTexture("HenchmenCalloutFramePic","ARTWORK") HenchmenCalloutFramePic:SetTexture([[Interface\Addons\SVUI\assets\artwork\Doodads\HENCHMEN-CALLOUT]]) HenchmenCalloutFramePic:SetAllPoints(HenchmenCalloutFrame) HenchmenCalloutFrame:Hide() - local HenchmenFrameBG = CreateFrame("Frame","HenchmenFrameBG",SuperVillain.UIParent) + local HenchmenFrameBG = CreateFrame("Frame","HenchmenFrameBG",SV.UIParent) HenchmenFrameBG:SetAllPoints(WorldFrame) HenchmenFrameBG:SetBackdrop({bgFile = [[Interface\BUTTONS\WHITE8X8]]}) HenchmenFrameBG:SetBackdropColor(0,0,0,0.9) HenchmenFrameBG:SetFrameStrata("DIALOG") HenchmenFrameBG:SetFrameLevel(22) HenchmenFrameBG:Hide() - HenchmenFrameBG:SetScript("OnMouseUp", SuperVillain.ToggleHenchman) + HenchmenFrameBG:SetScript("OnMouseUp", SV.ToggleHenchman) for i=1, 5 do CreateHenchmenOptions(i) @@ -565,7 +565,7 @@ local function CreateHenchmenFrame() MOD.PostLoaded = true end -function SuperVillain:ToggleHenchman() +function SV:ToggleHenchman() if InCombatLockdown()then return end if(not MOD.PostLoaded) then CreateHenchmenFrame() @@ -594,7 +594,7 @@ function SuperVillain:ToggleHenchman() minion:Show() minion.anim:Play() end - RightSuperDockToggleButton.icon:SetGradient(unpack(SuperVillain.Media.gradient.green)) + RightSuperDockToggleButton.icon:SetGradient(unpack(SV.Media.gradient.green)) else UpdateHenchmanModel(true) for _,frame in pairs(SUBOPTIONS)do @@ -622,7 +622,7 @@ function SuperVillain:ToggleHenchman() end end -function SuperVillain:HenchmanSays(msg) +function SV:HenchmanSays(msg) HenchmenSpeechBubble.message = msg; HenchmenSpeechBubble:Show(); end @@ -691,58 +691,69 @@ end INVITE AUTOMATONS ########################################################## ]]-- -local function AutoGroupInvite(self, 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) +function MOD:PARTY_INVITE_REQUEST(event, arg) + if not SV.db.SVHenchmen.autoAcceptInvite then return end + + 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; + SV: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!") + SV: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; + SV: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 ########################################################## ]]-- function MOD:MERCHANT_SHOW() - if self.db.vendorGrays then SuperVillain.SVBag:VendorGrays(nil,true) end + if self.db.vendorGrays then SV.SVBag:VendorGrays(nil,true) end local autoRepair = self.db.autoRepair; if IsShiftKeyDown() or autoRepair == "NONE" or not CanMerchantRepair() then return end local repairCost,canRepair=GetRepairAllCost() @@ -753,12 +764,12 @@ function MOD:MERCHANT_SHOW() RepairAllItems(autoRepair=='GUILD') local x,y,z= repairCost % 100,floor((repairCost % 10000)/100), floor(repairCost / 10000) if autoRepair=='GUILD' then - SuperVillain:HenchmanSays("Repairs Complete! ...Using Guild Money!\n"..GetCoinTextureString(repairCost,12)) + SV:HenchmanSays("Repairs Complete! ...Using Guild Money!\n"..GetCoinTextureString(repairCost,12)) else - SuperVillain:HenchmanSays("Repairs Complete!\n"..GetCoinTextureString(repairCost,12)) + SV:HenchmanSays("Repairs Complete!\n"..GetCoinTextureString(repairCost,12)) end else - SuperVillain:HenchmanSays("The Minions Say You Are Too Broke To Repair! They Are Laughing..") + SV:HenchmanSays("The Minions Say You Are Too Broke To Repair! They Are Laughing..") end end end @@ -780,7 +791,7 @@ function MOD:CHAT_MSG_COMBAT_FACTION_CHANGE(event, msg) if name == faction and name ~= active then -- local inactive = IsFactionInactive(factionIndex) or SetWatchedFactionIndex(factionIndex) local strMsg = ("Watching Faction: %s"):format(name) - SuperVillain:AddonMessage(strMsg) + SV:AddonMessage(strMsg) break end end @@ -869,7 +880,7 @@ function MOD:QUEST_COMPLETE() QuestInfoItemHighlight:SetAllPoints(chosenItem) QuestInfoItemHighlight:Show() QuestInfoFrame.itemChoice = chosenItem:GetID() - SuperVillain:HenchmanSays("A Minion Has Chosen Your Reward!") + SV:HenchmanSays("A Minion Has Chosen Your Reward!") end end auto_select = selection @@ -888,7 +899,7 @@ BUILD FUNCTION / UPDATE ########################################################## ]]-- function MOD:Load() - local bubble = CreateFrame("Frame", "HenchmenSpeechBubble", SuperVillain.UIParent) + local bubble = CreateFrame("Frame", "HenchmenSpeechBubble", SV.UIParent) bubble:SetSize(256,128) bubble:Point("BOTTOMRIGHT", RightSuperDockToggleButton, "TOPLEFT", 0, 0) bubble:SetFrameStrata("DIALOG") @@ -900,7 +911,7 @@ function MOD:Load() bubble.txt = bubble:CreateFontString(nil,"DIALOG") bubble.txt:Point("TOPLEFT", bubble, "TOPLEFT", 5, -5) bubble.txt:Point("BOTTOMRIGHT", bubble, "BOTTOMRIGHT", -5, 20) - bubble.txt:SetFont(SuperVillain.Media.font.dialog,12,"NONE") + bubble.txt:SetFont(SV.Media.font.dialog,12,"NONE") bubble.txt:SetText("") bubble.txt:SetTextColor(0,0,0) bubble.txt:SetWordWrap(true) @@ -914,20 +925,20 @@ 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 - if SuperVillain.db.SVHenchmen.pvpautorelease then + if SV.db.SVHenchmen.pvpautorelease then local autoReleaseHandler = CreateFrame("frame") autoReleaseHandler:RegisterEvent("PLAYER_DEAD") autoReleaseHandler:SetScript("OnEvent",function(self,event) local isInstance, instanceType = IsInInstance() if(isInstance and instanceType == "pvp") then local spell = GetSpellInfo(20707) - if(SuperVillain.class ~= "SHAMAN" and not(spell and UnitBuff("player",spell))) then + if(SV.class ~= "SHAMAN" and not(spell and UnitBuff("player",spell))) then RepopMe() end end @@ -978,4 +989,4 @@ CONFIGS["SVHenchmen"] = { ["autoRepair"] = "PLAYER", } -SuperVillain.Registry:NewPackage(MOD, "SVHenchmen") \ No newline at end of file +Registry:NewPackage(MOD, "SVHenchmen") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/map/SVMap.lua b/Interface/AddOns/SVUI/packages/map/SVMap.lua index 09ede7f..4dcd9af 100644 --- a/Interface/AddOns/SVUI/packages/map/SVMap.lua +++ b/Interface/AddOns/SVUI/packages/map/SVMap.lua @@ -36,8 +36,8 @@ local parsefloat = math.parsefloat; -- Uncommon GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local CONFIGS = SuperVillain.Configs +local SV, L, Registry = unpack(select(2, ...)); +local CONFIGS = SV.Configs local MOD = {}; --[[ ########################################################## @@ -53,7 +53,7 @@ LOCAL VARS ]]-- local temp = SLASH_CALENDAR1:gsub("/", ""); local calendar_string = temp:gsub("^%l", upper) -local cColor = RAID_CLASS_COLORS[SuperVillain.class]; +local cColor = RAID_CLASS_COLORS[SV.class]; local MM_COLOR = {"VERTICAL", 0.65, 0.65, 0.65, 0.95, 0.95, 0.95} local MM_BRDR = 0 local MM_SIZE = 240 @@ -63,6 +63,7 @@ local MM_WIDTH = MM_SIZE + (MM_BRDR * 2) local MM_HEIGHT = (MM_SIZE - (MM_OFFSET_TOP + MM_OFFSET_BOTTOM) + (MM_BRDR * 2)) local MMBHolder, MMBBar, SetMiniMapCoords; local SVUI_MinimapFrame = CreateFrame("Frame", "SVUI_MinimapFrame", UIParent) +SVUI_MinimapFrame:SetFrameStrata("BACKGROUND") SVUI_MinimapFrame.backdrop = SVUI_MinimapFrame:CreateTexture(nil, "BACKGROUND", nil, -2) local SVUI_MinimapZonetext = CreateFrame("Frame", "SVUI_MinimapZonetext", SVUI_MinimapFrame) local SVUI_MinimapNarrator = CreateFrame("Frame", "SVUI_MinimapNarrator", SVUI_MinimapFrame) @@ -115,17 +116,20 @@ do } local function UpdateMinimapButtons() - if(not MOD.db.minimapbar.enable) then return end + if(not MOD.db.minimapbar.enable) then return end + MMBBar:SetPoint("CENTER", MMBHolder, "CENTER", 0, 0) MMBBar:Height(MOD.db.minimapbar.buttonSize + 4) MMBBar:Width(MOD.db.minimapbar.buttonSize + 4) + local lastButton, anchor, relative, xPos, yPos; local list = buttonCache[2] local count = #list + for i = 1, count do local btn = _G[list[i]] local preset = btn.preset; - if MOD.db.minimapbar.styleType == "NOANCHOR"then + if(MOD.db.minimapbar.styleType == "NOANCHOR") then btn:SetParent(preset.Parent) if preset.DragStart then btn:SetScript("OnDragStart", preset.DragStart) @@ -194,6 +198,7 @@ do if name:find(reserved[i]) ~= nil then return end end end + btn:SetPushedTexture(nil) btn:SetHighlightTexture(nil) btn:SetDisabledTexture(nil) @@ -202,21 +207,21 @@ do btn:HookScript("OnEnter", MMB_OnEnter) btn:HookScript("OnLeave", MMB_OnLeave) btn:HookScript("OnClick", UpdateMinimapButtons) + btn.preset = {} + btn.preset.Width, btn.preset.Height = btn:GetSize() + btn.preset.Point, btn.preset.relativeTo, btn.preset.relativePoint, btn.preset.xOfs, btn.preset.yOfs = btn:GetPoint() + btn.preset.Parent = btn:GetParent() + btn.preset.FrameStrata = btn:GetFrameStrata() + btn.preset.FrameLevel = btn:GetFrameLevel() + btn.preset.Scale = btn:GetScale() + if btn:HasScript("OnDragStart") then + btn.preset.DragStart = btn:GetScript("OnDragStart") + end + if btn:HasScript("OnDragEnd") then + btn.preset.DragEnd = btn:GetScript("OnDragEnd") + end for i = 1, btn:GetNumRegions() do local frame = select(i, btn:GetRegions()) - btn.preset = {} - btn.preset.Width, btn.preset.Height = btn:GetSize() - btn.preset.Point, btn.preset.relativeTo, btn.preset.relativePoint, btn.preset.xOfs, btn.preset.yOfs = btn:GetPoint() - btn.preset.Parent = btn:GetParent() - btn.preset.FrameStrata = btn:GetFrameStrata() - btn.preset.FrameLevel = btn:GetFrameLevel() - btn.preset.Scale = btn:GetScale() - if btn:HasScript("OnDragStart") then - btn.preset.DragStart = btn:GetScript("OnDragStart") - end - if btn:HasScript("OnDragEnd") then - btn.preset.DragEnd = btn:GetScript("OnDragEnd") - end 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 @@ -228,31 +233,39 @@ do frame:SetTexCoord(0.1, 0.9, 0.1, 0.9 ) frame:SetDrawLayer("ARTWORK") if name == "PS_MinimapButton" then - frame.SetPoint = SuperVillain.fubar + frame.SetPoint = SV.fubar end end end end + btn:SetSlotTemplate(true, 2, -1, -1) - if name == "DBMMinimapButton" then + + if(name == "DBMMinimapButton") then btn:SetNormalTexture("Interface\\Icons\\INV_Helmet_87") end - if name == "SmartBuff_MiniMapButton" then + + if(name == "SmartBuff_MiniMapButton") then btn:SetNormalTexture(select(3, GetSpellInfo(12051))) end + btn.isStyled = true + local nextindex = #buttonCache[2] + 1 buttonCache[2][nextindex] = name - end + end end local StyleMinimapButtons = function() local count = Minimap:GetNumChildren() + for i=1, count do local child = select(i,Minimap:GetChildren()) SetMinimapButton(child) - end + end + UpdateMinimapButtons() + if MOD.db.minimapbar.mouseover then MMBBar:SetAlpha(0) else @@ -260,16 +273,20 @@ do end end - function MOD:UpdateMinimapButtonSettings() - if(not self.db.minimapbar.enable) then return end - SuperVillain:ExecuteTimer(StyleMinimapButtons, 4) + function MOD:UpdateMinimapButtonSettings(notimer) + if(not self.db.minimapbar.enable or not MMBBar:IsShown()) then return end + if(notimer) then + StyleMinimapButtons() + else + SV.Timers:ExecuteTimer(StyleMinimapButtons, 4) + end end end local function SetLargeWorldMap() if InCombatLockdown() then return end if MOD.db.tinyWorldMap == true then - WorldMapFrame:SetParent(SuperVillain.UIParent) + WorldMapFrame:SetParent(SV.UIParent) WorldMapFrame:EnableMouse(false) WorldMapFrame:EnableKeyboard(false) WorldMapFrame:SetScale(1) @@ -282,7 +299,24 @@ local function SetLargeWorldMap() end WorldMapFrameSizeUpButton:Hide() WorldMapFrameSizeDownButton:Show() -end +end + +local function SetQuestWorldMap() + if InCombatLockdown() then return end + if MOD.db.tinyWorldMap == true then + WorldMapFrame:SetParent(SV.UIParent) + WorldMapFrame:EnableMouse(false) + WorldMapFrame:EnableKeyboard(false) + if WorldMapFrame:GetAttribute('UIPanelLayout-area') ~= 'center'then + SetUIPanelAttribute(WorldMapFrame, "area", "center") + end + if WorldMapFrame:GetAttribute('UIPanelLayout-allowOtherPanels') ~= true then + SetUIPanelAttribute(WorldMapFrame, "allowOtherPanels", true) + end + end + WorldMapFrameSizeUpButton:Hide() + WorldMapFrameSizeDownButton:Show() +end local function SetSmallWorldMap() if InCombatLockdown() then return end @@ -308,18 +342,22 @@ local function AdjustMapSize() SetLargeWorldMap() elseif WORLDMAP_SETTINGS.size == WORLDMAP_WINDOWED_SIZE then SetSmallWorldMap() + elseif WORLDMAP_SETTINGS.size == WORLDMAP_QUESTLIST_SIZE then + SetQuestWorldMap() end BlackoutWorld:SetTexture(0,0,0,0) else if WORLDMAP_SETTINGS.size == WORLDMAP_FULLMAP_SIZE then - WorldMap_ToggleSizeUp() + WorldMapFrame_SetFullMapView() elseif WORLDMAP_SETTINGS.size == WORLDMAP_WINDOWED_SIZE then WorldMap_ToggleSizeDown() + elseif WORLDMAP_SETTINGS.size == WORLDMAP_QUESTLIST_SIZE then + WorldMapFrame_SetQuestMapView() end BlackoutWorld:SetTexture(0, 0, 0, 1) end AdjustMapLevel() -end +end local function CheckMovement() if(not WorldMapFrame:IsShown()) then return end @@ -385,12 +423,16 @@ local function UpdateWorldMapConfig() if(not MOD.WorldMapHooked) then NewHook("WorldMap_ToggleSizeUp", AdjustMapSize) NewHook("WorldMap_ToggleSizeDown", SetSmallWorldMap) + if(SV.___interface < 60000) then + NewHook("WorldMapFrame_SetFullMapView", SetLargeWorldMap) + NewHook("WorldMapFrame_SetQuestMapView", SetQuestWorldMap) + end MOD.WorldMapHooked = true end if(not MOD.db.playercoords or MOD.db.playercoords == "HIDE") then if MOD.CoordTimer then - SuperVillain:RemoveLoop(MOD.CoordTimer) + SV.Timers:RemoveLoop(MOD.CoordTimer) MOD.CoordTimer = nil; end SVUI_MiniMapCoords.playerXCoords:SetText("") @@ -398,16 +440,21 @@ local function UpdateWorldMapConfig() SVUI_MiniMapCoords:Hide() else SVUI_MiniMapCoords:Show() - MOD.CoordTimer = SuperVillain:ExecuteLoop(UpdateMapCoords, 0.2) + MOD.CoordTimer = SV.Timers:ExecuteLoop(UpdateMapCoords, 0.2) UpdateMapCoords() end AdjustMapSize() -end +end + +local ResetDropDownList_Hook = function(self) + DropDownList1:ClearAllPoints() + DropDownList1:Point("TOPRIGHT",self,"BOTTOMRIGHT",-17,-4) +end local WorldMapFrameOnShow_Hook = function() MOD:RegisterEvent("PLAYER_REGEN_DISABLED"); if InCombatLockdown()then return end - if(not SuperVillain.db.SVMap.tinyWorldMap and not Initialized) then + if(not SV.db.SVMap.tinyWorldMap and not Initialized) then WorldMap_ToggleSizeUp() Initialized = true end @@ -444,11 +491,11 @@ do GameTooltip:AddDoubleLine(L["ShiftClick : "], L["Announce your position in chat"],0.7, 0.7, 1, 0.7, 0.7, 1) GameTooltip:Show() end - end; + end local function Tour_OnLeave(self,...) GameTooltip:Hide() - end; + end local function Tour_OnClick(self, btn) local zoneText = GetRealZoneText() or UNKNOWN; @@ -509,20 +556,20 @@ do CoordsHolder.playerXCoords:SetPoint("BOTTOMLEFT", CoordsHolder, "BOTTOMLEFT", 0, 0) CoordsHolder.playerXCoords:SetWidth(70) CoordsHolder.playerXCoords:SetHeight(22) - CoordsHolder.playerXCoords:SetFontTemplate(SuperVillain.Media.font.numbers, 12, "OUTLINE") + CoordsHolder.playerXCoords:SetFontTemplate(SV.Media.font.numbers, 12, "OUTLINE") CoordsHolder.playerXCoords:SetTextColor(cColor.r, cColor.g, cColor.b) CoordsHolder.playerYCoords = CoordsHolder:CreateFontString(nil, "OVERLAY") CoordsHolder.playerYCoords:SetPoint("BOTTOMLEFT", CoordsHolder.playerXCoords, "BOTTOMRIGHT", 4, 0) CoordsHolder.playerXCoords:SetWidth(70) CoordsHolder.playerYCoords:SetHeight(22) - CoordsHolder.playerYCoords:SetFontTemplate(SuperVillain.Media.font.numbers, 12, "OUTLINE") + CoordsHolder.playerYCoords:SetFontTemplate(SV.Media.font.numbers, 12, "OUTLINE") CoordsHolder.playerYCoords:SetTextColor(cColor.r, cColor.g, cColor.b) local calendarButton = CreateFrame("Button", "SVUI_CalendarButton", CoordsHolder) calendarButton:SetSize(22,22) calendarButton:SetPoint("RIGHT", CoordsHolder, "RIGHT", 0, 0) - calendarButton:Formula409() + calendarButton:RemoveTextures() calendarButton:SetNormalTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Minimap\\MINIMAP-CALENDAR") calendarButton:SetPushedTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Minimap\\MINIMAP-CALENDAR") calendarButton:SetHighlightTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Minimap\\MINIMAP-CALENDAR") @@ -535,7 +582,7 @@ do local trackingButton = CreateFrame("Button", "SVUI_TrackingButton", CoordsHolder) trackingButton:SetSize(22,22) trackingButton:SetPoint("RIGHT", calendarButton, "LEFT", -4, 0) - trackingButton:Formula409() + trackingButton:RemoveTextures() trackingButton:SetNormalTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Minimap\\MINIMAP-TRACKING") trackingButton:SetPushedTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Minimap\\MINIMAP-TRACKING") trackingButton:SetHighlightTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Minimap\\MINIMAP-TRACKING") @@ -550,11 +597,11 @@ end local function UpdateMinimapNarration() SVUI_MinimapNarrator.Text:SetText(MOD.narrative) -end; +end local function UpdateMinimapLocation() SVUI_MinimapZonetext.Text:SetText(MOD.locationPrefix .. strsub(GetMinimapZoneText(), 1, 25)) -end; +end local function UpdateMinimapTexts() MOD.narrative = ""; @@ -575,20 +622,20 @@ local function UpdateMinimapTexts() UpdateMinimapLocation() UpdateMinimapNarration() end -end; +end local function UpdateSizing() - MM_COLOR = SuperVillain.Media.gradient[MOD.db.bordercolor] + MM_COLOR = SV.Media.gradient[MOD.db.bordercolor] MM_BRDR = MOD.db.bordersize or 0 MM_SIZE = MOD.db.size or 240 MM_OFFSET_TOP = (MM_SIZE * 0.07) MM_OFFSET_BOTTOM = (MM_SIZE * 0.11) MM_WIDTH = MM_SIZE + (MM_BRDR * 2) MM_HEIGHT = MOD.db.customshape and (MM_SIZE - (MM_OFFSET_TOP + MM_OFFSET_BOTTOM) + (MM_BRDR * 2)) or MM_WIDTH -end; +end function MOD:RefreshMiniMap() - if(not SuperVillain.db.SVMap.enable) then return; end + if(not SV.db.SVMap.enable) then return; end if(InCombatLockdown()) then self.CombatLocked = true return @@ -619,7 +666,7 @@ function MOD:RefreshMiniMap() if SVUI_AurasAnchor then SVUI_AurasAnchor:Height(MM_HEIGHT) - if SVUI_AurasAnchor_MOVE and not SuperVillain:TestMovableMoved('SVUI_AurasAnchor_MOVE') and not SuperVillain:TestMovableMoved('SVUI_MinimapFrame_MOVE') then + if SVUI_AurasAnchor_MOVE and not SV:TestMovableMoved('SVUI_AurasAnchor_MOVE') and not SV:TestMovableMoved('SVUI_MinimapFrame_MOVE') then SVUI_AurasAnchor_MOVE:ClearAllPoints() SVUI_AurasAnchor_MOVE:Point("TOPRIGHT", SVUI_MinimapFrame_MOVE, "TOPLEFT", -8, 0) end @@ -628,10 +675,10 @@ function MOD:RefreshMiniMap() end end if SVUI_HyperBuffs then - SuperVillain.SVAura:Update_HyperBuffsSettings() + SV.SVAura:Update_HyperBuffsSettings() end if TimeManagerClockButton then - TimeManagerClockButton:MUNG() + TimeManagerClockButton:Die() end SetMiniMapCoords() @@ -647,12 +694,13 @@ local function CreateMiniMapElements() Minimap:SetBlipTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Minimap\\MINIMAP_ICONS") Minimap:SetClampedToScreen(false) - SVUI_MinimapFrame:Point("TOPRIGHT", SuperVillain.UIParent, "TOPRIGHT", -10, -10) + SVUI_MinimapFrame:Point("TOPRIGHT", SV.UIParent, "TOPRIGHT", -10, -10) SVUI_MinimapFrame:Size(MM_WIDTH, MM_HEIGHT) SVUI_MinimapFrame.backdrop:ClearAllPoints() SVUI_MinimapFrame.backdrop:WrapOuter(SVUI_MinimapFrame, 2) SVUI_MinimapFrame.backdrop:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) SVUI_MinimapFrame.backdrop:SetGradient(unpack(MM_COLOR)) + SVUI_MinimapFrame:SetPanelTemplate("Blackout") local border = CreateFrame("Frame", nil, SVUI_MinimapFrame) border:WrapOuter(SVUI_MinimapFrame.backdrop) @@ -679,12 +727,13 @@ local function CreateMiniMapElements() -- MOD:RefreshMiniMap() if TimeManagerClockButton then - TimeManagerClockButton:MUNG() + TimeManagerClockButton:Die() end Minimap:SetQuestBlobRingAlpha(0) Minimap:SetArchBlobRingAlpha(0) Minimap:SetParent(SVUI_MinimapFrame) + Minimap:SetFrameStrata("LOW") Minimap:SetFrameLevel(Minimap:GetFrameLevel() + 2) ShowUIPanel(SpellBookFrame) HideUIPanel(SpellBookFrame) @@ -693,7 +742,7 @@ local function CreateMiniMapElements() MinimapZoomIn:Hide() MinimapZoomOut:Hide() MiniMapVoiceChatFrame:Hide() - MinimapNorthTag:MUNG() + MinimapNorthTag:Die() GameTimeFrame:Hide() MinimapZoneTextButton:Hide() MiniMapTracking:Hide() @@ -727,10 +776,10 @@ local function CreateMiniMapElements() MiniMapChallengeMode:Point("BOTTOMLEFT", SVUI_MinimapFrame, "BOTTOMLEFT", 8, -8) end) if FeedbackUIButton then - FeedbackUIButton:MUNG() + FeedbackUIButton:Die() end - local mwfont = SuperVillain.Media.font.dialog + local mwfont = SV.Media.font.dialog SVUI_MinimapNarrator:Point("TOPLEFT", SVUI_MinimapFrame, "TOPLEFT", 2, -2) SVUI_MinimapNarrator:SetSize(100, 22) @@ -771,17 +820,23 @@ local function CreateMiniMapElements() PetJournalParent:SetAttribute("UIPanelLayout-"..name, value); end PetJournalParent:SetAttribute("UIPanelLayout-defined", true); - SuperVillain:SetSVMovable(SVUI_MinimapFrame, L["Minimap"]) + SV:SetSVMovable(SVUI_MinimapFrame, L["Minimap"]) MOD:RefreshMiniMap() end local function LoadWorldMap() - setfenv(WorldMapFrame_OnShow, setmetatable({ UpdateMicroButtons = SuperVillain.fubar }, { __index = _G })) - - --[[MISC WORLDMAP STYLINGS REMOVED HERE]]-- + setfenv(WorldMapFrame_OnShow, setmetatable({ UpdateMicroButtons = SV.fubar }, { __index = _G })) + + if(SV.___interface < 60000) then + WorldMapShowDropDown:Point('BOTTOMRIGHT',WorldMapPositioningGuide,'BOTTOMRIGHT',-2,-4) + WorldMapZoomOutButton:Point("LEFT",WorldMapZoneDropDown,"RIGHT",0,4) + WorldMapLevelUpButton:Point("TOPLEFT",WorldMapLevelDropDown,"TOPRIGHT",-2,8) + WorldMapLevelDownButton:Point("BOTTOMLEFT",WorldMapLevelDropDown,"BOTTOMRIGHT",-2,2) + WorldMapZoneDropDownButton:HookScript('OnClick', ResetDropDownList_Hook) + end - WorldMapFrame:SetParent(SuperVillain.UIParent) + WorldMapFrame:SetParent(SV.UIParent) WorldMapFrame:SetFrameLevel(4) WorldMapFrame:SetFrameStrata('HIGH') WorldMapDetailFrame:SetFrameLevel(6) @@ -804,7 +859,7 @@ local function LoadWorldMap() CoordsHolder.mouseCoords:SetText(MOUSE_LABEL..": 0, 0") DropDownList1:HookScript('OnShow',function(self) - if(DropDownList1:GetScale() ~= UIParent:GetScale() and SuperVillain.db.SVMap.tinyWorldMap) then + if(DropDownList1:GetScale() ~= UIParent:GetScale() and SV.db.SVMap.tinyWorldMap) then DropDownList1:SetScale(UIParent:GetScale()) end end) @@ -817,11 +872,11 @@ HOOKED / REGISTERED FUNCTIONS ]]-- function MOD:ADDON_LOADED(event, addon) if TimeManagerClockButton then - TimeManagerClockButton:MUNG() + TimeManagerClockButton:Die() end self:UnregisterEvent("ADDON_LOADED") if addon == "Blizzard_FeedbackUI" then - FeedbackUIButton:MUNG() + FeedbackUIButton:Die() end self:UpdateMinimapButtonSettings() end @@ -841,18 +896,22 @@ function MOD:PLAYER_REGEN_DISABLED() WorldMapFrameSizeDownButton:Disable() WorldMapFrameSizeUpButton:Disable() end + +function MOD:PET_BATTLE_CLOSE() + self:UpdateMinimapButtonSettings() +end --[[ ########################################################## BUILD FUNCTION / UPDATE ########################################################## ]]-- function MOD:ReLoad() - if(not SuperVillain.db.SVMap.enable) then return; end + if(not SV.db.SVMap.enable) then return; end self:RefreshMiniMap() end function MOD:Load() - if(not SuperVillain.db.SVMap.enable) then + if(not SV.db.SVMap.enable) then Minimap:SetMaskTexture('Textures\\MinimapMask') return end @@ -866,6 +925,7 @@ function MOD:Load() self:RegisterEvent("ZONE_CHANGED", UpdateMinimapLocation) self:RegisterEvent("ZONE_CHANGED_INDOORS", UpdateMinimapLocation) self:RegisterEvent('ADDON_LOADED') + --self:RegisterEvent("PET_BATTLE_CLOSE") if(self.db.minimapbar.enable == true) then MMBHolder = CreateFrame("Frame", "SVUI_MiniMapButtonHolder", SVUI_MinimapFrame) @@ -878,12 +938,12 @@ function MOD:Load() MMBBar:SetPoint("CENTER", MMBHolder, "CENTER", 0, 0) MMBBar:SetScript("OnEnter", MMB_OnEnter) MMBBar:SetScript("OnLeave", MMB_OnLeave) - SuperVillain:SetSVMovable(MMBHolder, L["Minimap Button Bar"]) + SV:SetSVMovable(MMBHolder, L["Minimap Button Bar"]) self:UpdateMinimapButtonSettings() end LoadWorldMap() - SuperVillain:AddToDisplayAudit(SVUI_MinimapFrame) + SV:AddToDisplayAudit(SVUI_MinimapFrame) self:ReLoad() end --[[ @@ -915,4 +975,4 @@ CONFIGS["SVMap"] = { }, } -SuperVillain.Registry:NewPackage(MOD, "SVMap") \ No newline at end of file +Registry:NewPackage(MOD, "SVMap") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/override/SVOverride.lua b/Interface/AddOns/SVUI/packages/override/SVOverride.lua index 0edbff1..46888cf 100644 --- a/Interface/AddOns/SVUI/packages/override/SVOverride.lua +++ b/Interface/AddOns/SVUI/packages/override/SVOverride.lua @@ -33,8 +33,8 @@ local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local CONFIGS = SuperVillain.Configs +local SV, L, Registry = unpack(select(2, ...)); +local CONFIGS = SV.Configs local MOD = {}; MOD.LewtRollz = {}; --[[ @@ -125,7 +125,7 @@ local CaptureBarHandler = function() end local ErrorFrameHandler = function(self, event) - if not SuperVillain.db.system.hideErrorFrame then return end + if not SV.db.system.hideErrorFrame then return end if event == 'PLAYER_REGEN_DISABLED' then UIErrorsFrame:UnregisterEvent('UI_ERROR_MESSAGE') else @@ -139,8 +139,8 @@ local Vehicle_OnSetPoint = function(self,_,parent) if _G.VehicleSeatIndicator_MOVE then VehicleSeatIndicator:Point("BOTTOM", VehicleSeatIndicator_MOVE, "BOTTOM", 0, 0) else - VehicleSeatIndicator:Point("TOPLEFT", SuperVillain.UIParent, "TOPLEFT", 22, -45) - SuperVillain:SetSVMovable(VehicleSeatIndicator, L["Vehicle Seat Frame"]) + VehicleSeatIndicator:Point("TOPLEFT", SV.UIParent, "TOPLEFT", 22, -45) + SV:SetSVMovable(VehicleSeatIndicator, L["Vehicle Seat Frame"]) end VehicleSeatIndicator:SetScale(0.8) end @@ -286,7 +286,7 @@ afrm:SetHeight(20); local AlertFramePostMove_Hook = function(forced) local b, c = SVUI_AlertFrame_MOVE:GetCenter() - local d = SuperVillain.UIParent:GetTop() + local d = SV.UIParent:GetTop() if(c > (d / 2)) then POSITION = "TOP" ANCHOR_POINT = "BOTTOM" @@ -343,7 +343,7 @@ MIRROR BARS ]]-- local SetMirrorPosition = function(bar) local yOffset = mirrorYOffset[bar.type] - return bar:Point("TOP", SuperVillain.UIParent, "TOP", 0, -yOffset) + return bar:Point("TOP", SV.UIParent, "TOP", 0, -yOffset) end local MirrorBar_OnUpdate = function(self, elapsed) @@ -377,12 +377,12 @@ local function MirrorBarRegistry(barType) if RegisteredMirrorBars[barType] then return RegisteredMirrorBars[barType] end - local bar = CreateFrame('StatusBar', nil, SuperVillain.UIParent) + local bar = CreateFrame('StatusBar', nil, SV.UIParent) bar:SetPanelTemplate("Bar", false, 3, 3, 3) bar:SetScript("OnUpdate", MirrorBar_OnUpdate) local r, g, b = unpack(mirrorTypeColor[barType]) bar.text = bar:CreateFontString(nil, 'OVERLAY') - bar.text:SetFontTemplate(SuperVillain.Media.font.roboto, 12, 'OUTLINE') + bar.text:SetFontTemplate(SV.Media.font.roboto, 12, 'OUTLINE') bar.text:SetJustifyH('CENTER') bar.text:SetTextColor(1, 1, 1) bar.text:SetPoint('LEFT', bar) @@ -406,7 +406,7 @@ local function SetTimerStyle(bar) if child:GetObjectType() == "Texture"then child:SetTexture(0,0,0,0) elseif child:GetObjectType() == "FontString" then - child:SetFontTemplate(SuperVillain.Media.font.roboto, 12, 'OUTLINE') + child:SetFontTemplate(SV.Media.font.roboto, 12, 'OUTLINE') end end bar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) @@ -435,7 +435,7 @@ local MirrorBarToggleHandler = function(_, event, arg, ...) end local MirrorBarUpdateHandler = function(_, event) - if not GetCVarBool("lockActionBars") and SuperVillain.db.SVBar.enable then + if not GetCVarBool("lockActionBars") and SV.db.SVBar.enable then SetCVar("lockActionBars", 1) end if(event == "PLAYER_ENTERING_WORLD") then @@ -458,11 +458,11 @@ local function UpdateLootUpvalues() end local Loot_OnHide = function(self) - SuperVillain:StaticPopup_Hide("CONFIRM_LOOT_DISTRIBUTION"); + SV:StaticPopup_Hide("CONFIRM_LOOT_DISTRIBUTION"); CloseLoot() end -local SVUI_LootFrameHolder = CreateFrame("Frame","SVUI_LootFrameHolder",SuperVillain.UIParent); +local SVUI_LootFrameHolder = CreateFrame("Frame","SVUI_LootFrameHolder",SV.UIParent); local SVUI_LootFrame = CreateFrame('Button', 'SVUI_LootFrame', SVUI_LootFrameHolder); SVUI_LootFrameHolder:Point("TOPLEFT",36,-195); SVUI_LootFrameHolder:Width(150); @@ -643,7 +643,7 @@ local function MakeSlots(id) slot.count = slot.iconFrame:CreateFontString(nil, "OVERLAY") slot.count:SetJustifyH("RIGHT") slot.count:Point("BOTTOMRIGHT", slot.iconFrame, -2, 2) - slot.count:SetFont(SuperVillain.Shared:Fetch("font", "Roboto"), 12, "OUTLINE") + slot.count:SetFont(SV.Shared:Fetch("font", "Roboto"), 12, "OUTLINE") slot.count:SetText(1) slot.name = slot:CreateFontString(nil, "OVERLAY") @@ -651,7 +651,7 @@ local function MakeSlots(id) slot.name:SetPoint("LEFT", slot) slot.name:SetPoint("RIGHT", slot.icon, "LEFT") slot.name:SetNonSpaceWrap(true) - slot.name:SetFont(SuperVillain.Shared:Fetch("font", "Roboto"), 12, "OUTLINE") + slot.name:SetFont(SV.Shared:Fetch("font", "Roboto"), 12, "OUTLINE") slot.drop = slot:CreateTexture(nil, "ARTWORK") slot.drop:SetTexture("Interface\\QuestFrame\\UI-QuestLogTitleHighlight") @@ -687,14 +687,14 @@ local function CreateRollButton(rollFrame, type, locale, anchor) rollButton:SetScript("OnClick", DoDaRoll) rollButton:SetMotionScriptsWhileDisabled(true) local text = rollButton:CreateFontString(nil, nil) - text:SetFont(SuperVillain.Shared:Fetch("font", "Roboto"),14,"OUTLINE") + text:SetFont(SV.Shared:Fetch("font", "Roboto"),14,"OUTLINE") text:Point("CENTER", 0, ((type == 2 and 1) or (type == 0 and -1.2) or 0)) return rollButton, text end local function CreateRollFrame() UpdateLootUpvalues() - local rollFrame = CreateFrame("Frame",nil,SuperVillain.UIParent) + local rollFrame = CreateFrame("Frame",nil,SV.UIParent) rollFrame:Size(LOOT_WIDTH,LOOT_HEIGHT) rollFrame:SetFixedPanelTemplate('Default') rollFrame:SetScript("OnEvent",LootRoll_OnEvent) @@ -741,16 +741,16 @@ local function CreateRollFrame() rollFrame.need,rollFrame.greed,rollFrame.pass,rollFrame.disenchant = needText,greedText,passText,deText; rollFrame.bindText = rollFrame:CreateFontString() rollFrame.bindText:Point("LEFT",passButton,"RIGHT",3,1) - rollFrame.bindText:SetFont(SuperVillain.Shared:Fetch("font", "SVUI Number Font"),14,"OUTLINE") + rollFrame.bindText:SetFont(SV.Shared:Fetch("font", "SVUI Number Font"),14,"OUTLINE") rollFrame.lootText = rollFrame:CreateFontString(nil,"ARTWORK") - rollFrame.lootText:SetFont(SuperVillain.Shared:Fetch("font", "SVUI Number Font"),14,"OUTLINE") + rollFrame.lootText:SetFont(SV.Shared:Fetch("font", "SVUI Number Font"),14,"OUTLINE") rollFrame.lootText:Point("LEFT",rollFrame.bindText,"RIGHT",0,0) rollFrame.lootText:Point("RIGHT",rollFrame,"RIGHT",-5,0) rollFrame.lootText:Size(200,10) rollFrame.lootText:SetJustifyH("LEFT") rollFrame.yourRoll = rollFrame:CreateFontString(nil,"ARTWORK") - rollFrame.yourRoll:SetFont(SuperVillain.Shared:Fetch("font", "SVUI Number Font"),18,"OUTLINE") + rollFrame.yourRoll:SetFont(SV.Shared:Fetch("font", "SVUI Number Font"),18,"OUTLINE") rollFrame.yourRoll:Size(22,22) rollFrame.yourRoll:Point("LEFT",rollFrame,"RIGHT",5,0) rollFrame.yourRoll:SetJustifyH("CENTER") @@ -957,7 +957,7 @@ local LootComplexEventsHandler = function(_, event, arg1, arg2) rollFrame:SetPoint("CENTER",WorldFrame,"CENTER") rollFrame:Show() AlertFrame_FixAnchors() - if SuperVillain.db.SVHenchmen.autoRoll and UnitLevel('player') == MAX_PLAYER_LEVEL and quality == 2 and not bindOnPickUp then + if SV.db.SVHenchmen.autoRoll and UnitLevel('player') == MAX_PLAYER_LEVEL and quality == 2 and not bindOnPickUp then if canBreak then RollOnLoot(arg1,3) else @@ -984,19 +984,19 @@ end local GroupLootDropDown_GiveLoot = function(self) if lastQuality >= MASTER_LOOT_THREHOLD then - local confirmed = SuperVillain:StaticPopup_Show("CONFIRM_LOOT_DISTRIBUTION",ITEM_QUALITY_COLORS[lastQuality].hex..lastName..FONT_COLOR_CODE_CLOSE,self:GetText()); + local confirmed = SV:StaticPopup_Show("CONFIRM_LOOT_DISTRIBUTION",ITEM_QUALITY_COLORS[lastQuality].hex..lastName..FONT_COLOR_CODE_CLOSE,self:GetText()); if confirmed then confirmed.data = self.value end else GiveMasterLoot(lastID, self.value) end CloseDropDownMenus() - SuperVillain.SystemAlert["CONFIRM_LOOT_DISTRIBUTION"].OnAccept = function(self,index) GiveMasterLoot(lastID,index) end + SV.SystemAlert["CONFIRM_LOOT_DISTRIBUTION"].OnAccept = function(self,index) GiveMasterLoot(lastID,index) end end local BailOut_OnEvent = function(self, event, ...) - if (event == "UNIT_ENTERED_VEHICLE" or CanExitVehicle()) then + if((event == "UNIT_ENTERED_VEHICLE" and CanExitVehicle()) or UnitControllingVehicle("player") or UnitInVehicle("player")) then self:Show() - elseif(event == "UNIT_EXITED_VEHICLE") then + else self:Hide() end end @@ -1006,19 +1006,19 @@ LOAD / UPDATE ########################################################## ]]-- function MOD:Load() - HelpOpenTicketButtonTutorial:MUNG() - TalentMicroButtonAlert:MUNG() - HelpPlate:MUNG() - HelpPlateTooltip:MUNG() - CompanionsMicroButtonAlert:MUNG() + HelpOpenTicketButtonTutorial:Die() + TalentMicroButtonAlert:Die() + HelpPlate:Die() + HelpPlateTooltip:Die() + CompanionsMicroButtonAlert:Die() UIPARENT_MANAGED_FRAME_POSITIONS["GroupLootContainer"] = nil; DurabilityFrame:SetFrameStrata("HIGH") NewHook(DurabilityFrame, "SetPoint", Dura_OnSetPoint) TicketStatusFrame:ClearAllPoints() - TicketStatusFrame:SetPoint("TOPLEFT", SuperVillain.UIParent, "TOPLEFT", 250, -5) - SuperVillain:SetSVMovable(TicketStatusFrame, L["GM Ticket Frame"], nil, nil, nil, nil, "GM") + TicketStatusFrame:SetPoint("TOPLEFT", SV.UIParent, "TOPLEFT", 250, -5) + SV:SetSVMovable(TicketStatusFrame, L["GM Ticket Frame"], nil, nil, nil, nil, "GM") HelpOpenTicketButton:SetParent(Minimap) HelpOpenTicketButton:ClearAllPoints() HelpOpenTicketButton:SetPoint("TOPRIGHT", Minimap, "TOPRIGHT") @@ -1032,9 +1032,9 @@ function MOD:Load() self:RegisterEvent('PLAYER_REGEN_DISABLED', ErrorFrameHandler) self:RegisterEvent('PLAYER_REGEN_ENABLED', ErrorFrameHandler) - SVUI_AlertFrame:SetParent(SuperVillain.UIParent) - SVUI_AlertFrame:SetPoint("TOP", SuperVillain.UIParent, "TOP", 0, -18); - SuperVillain:SetSVMovable(SVUI_AlertFrame, L["Loot / Alert Frames"], nil, nil, AlertFramePostMove_Hook) + SVUI_AlertFrame:SetParent(SV.UIParent) + SVUI_AlertFrame:SetPoint("TOP", SV.UIParent, "TOP", 0, -18); + SV:SetSVMovable(SVUI_AlertFrame, L["Loot / Alert Frames"], nil, nil, AlertFramePostMove_Hook) NewHook('AlertFrame_FixAnchors', AlertFramePostMove_Hook) NewHook('AlertFrame_SetLootAnchors', _hook_AlertFrame_SetLootAnchors) NewHook('AlertFrame_SetLootWonAnchors', _hook_AlertFrame_SetLootWonAnchors) @@ -1049,8 +1049,8 @@ function MOD:Load() LootFrame:UnregisterAllEvents(); SVUI_LootFrame:SetFixedPanelTemplate('Transparent'); - SVUI_LootFrame.title:SetFont(SuperVillain.Shared:Fetch("font", "SVUI Number Font"),18,"OUTLINE") - SuperVillain:SetSVMovable(SVUI_LootFrameHolder, L["Loot Frame"], nil, nil, nil, nil, "SVUI_LootFrame"); + SVUI_LootFrame.title:SetFont(SV.Shared:Fetch("font", "SVUI Number Font"),18,"OUTLINE") + SV:SetSVMovable(SVUI_LootFrameHolder, L["Loot Frame"], nil, nil, nil, nil, "SVUI_LootFrame"); tinsert(UISpecialFrames, "SVUI_LootFrame"); UIParent:UnregisterEvent("LOOT_BIND_CONFIRM") @@ -1081,7 +1081,7 @@ function MOD:Load() self:RegisterEvent("MIRROR_TIMER_PAUSE", MirrorBarToggleHandler) self:RegisterEvent("START_TIMER", MirrorBarToggleHandler) - local exit = CreateFrame("Button", "SVUI_BailOut", SuperVillain.UIParent) + local exit = CreateFrame("Button", "SVUI_BailOut", SV.UIParent) exit:Size(40, 40) exit:Point("TOPLEFT", SVUI_MinimapFrame, "BOTTOMLEFT", 0, -30) exit:SetNormalTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Icons\\EXIT") @@ -1094,27 +1094,28 @@ 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() - SuperVillain:SetSVMovable(exit, L["Bail Out"]) + SV:SetSVMovable(exit, L["Bail Out"]) local altPower = CreateFrame("Frame", "SVUI_AltPowerBar", UIParent) - altPower:SetPoint("TOP", SuperVillain.UIParent, "TOP", 0, -18) + altPower:SetPoint("TOP", SV.UIParent, "TOP", 0, -18) altPower:Size(128, 50) PlayerPowerBarAlt:ClearAllPoints() PlayerPowerBarAlt:SetPoint("CENTER", altPower, "CENTER") PlayerPowerBarAlt:SetParent(altPower) PlayerPowerBarAlt.ignoreFramePositionManager = true; - SuperVillain:SetSVMovable(altPower, L["Alternative Power"]) + SV:SetSVMovable(altPower, L["Alternative Power"]) - local wsc = CreateFrame("Frame", "SVUI_WorldStateHolder", SuperVillain.UIParent) + local wsc = CreateFrame("Frame", "SVUI_WorldStateHolder", SV.UIParent) wsc:SetSize(200, 45) - wsc:SetPoint("TOP", SuperVillain.UIParent, "TOP", 0, -100) - SuperVillain:SetSVMovable(wsc, L["Capture Bars"]) + wsc:SetPoint("TOP", SV.UIParent, "TOP", 0, -100) + SV:SetSVMovable(wsc, L["Capture Bars"]) NewHook("UIParent_ManageFramePositions", CaptureBarHandler) - SuperVillain:SetSVMovable(LossOfControlFrame, L["Loss Control Icon"], nil, nil, nil, nil, "LoC") + SV:SetSVMovable(LossOfControlFrame, L["Loss Control Icon"], nil, nil, nil, nil, "LoC") end --[[ ########################################################## @@ -1129,4 +1130,4 @@ CONFIGS["SVOverride"] = { ["lootRollHeight"] = 28, } -SuperVillain.Registry:NewPackage(MOD, "SVOverride"); \ No newline at end of file +Registry:NewPackage(MOD, "SVOverride"); \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/plates/SVPlate.lua b/Interface/AddOns/SVUI/packages/plates/SVPlate.lua index d581191..62ae4b0 100644 --- a/Interface/AddOns/SVUI/packages/plates/SVPlate.lua +++ b/Interface/AddOns/SVUI/packages/plates/SVPlate.lua @@ -49,8 +49,8 @@ local tremove, tcopy, twipe, tsort, tconcat = table.remove, table.copy, table.wi GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local CONFIGS = SuperVillain.Configs +local SV, L, Registry = unpack(select(2, ...)); +local CONFIGS = SV.Configs local MOD = {}; --[[ ########################################################## @@ -83,7 +83,7 @@ local PLATE_LEFT = [[Interface\Addons\SVUI\assets\artwork\Template\Plate\PLATE-L is used to refresh these any time a change is made to configs and once when the mod is loaded. ]]-- -local NPClassRole = SuperVillain.ClassRole; +local NPClassRole = SV.ClassRole; local NPBaseAlpha = 0.6; local NPCombatHide = false; local NPNameMatch = false; @@ -200,7 +200,7 @@ local function TruncateString(value) end local function SetTextStyle(style, min, max) - if max == 0 then max = 1 end; + if max == 0 then max = 1 end local result; local textFormat = formatting[style] if style == "DEFICIT" then @@ -227,7 +227,7 @@ local function SetTextStyle(style, min, max) result = result:gsub(".0%%", "%%") return result end -end; +end local function SetPlateBorder(plate, point) point = point or plate @@ -236,7 +236,7 @@ local function SetPlateBorder(plate, point) point.backdrop = plate:CreateTexture(nil, "BORDER") point.backdrop:SetDrawLayer("BORDER", -4) point.backdrop:SetAllPoints(point) - point.backdrop:SetTexture(SuperVillain.Media.bar.default) + point.backdrop:SetTexture(SV.Media.bar.default) point.backdrop:SetVertexColor(0.1,0.1,0.1) point.bordertop = plate:CreateTexture(nil, "BORDER") @@ -578,7 +578,7 @@ local function CleanUnitPlateAurass() end function MOD:UpdateAuras(plate) - if plate.setting.tiny then return end; + if plate.setting.tiny then return end local guid = plate.guid local frame = plate.frame if not guid then @@ -1103,18 +1103,18 @@ do if not PLATE_ARGS.scaled and not PLATE_ARGS.tiny then SVUI_PLATE.health:SetSize(HBWidth, HBHeight) end - SVUI_PLATE.health:SetStatusBarTexture(SuperVillain.Media.bar.textured) - SVUI_PLATE.health.text:SetFontTemplate(SuperVillain.Media.font.roboto, 8, "OUTLINE") + SVUI_PLATE.health:SetStatusBarTexture(SV.Media.bar.textured) + SVUI_PLATE.health.text:SetFontTemplate(SV.Media.font.roboto, 8, "OUTLINE") SVUI_PLATE.cast:SetSize(HBWidth, (CBHeight + 20)) - SVUI_PLATE.cast:SetStatusBarTexture(SuperVillain.Media.bar.lazer) - SVUI_PLATE.cast.text:SetFont(SuperVillain.Media.font.roboto, 8, "OUTLINE") - plate.cast.text:SetFont(SuperVillain.Media.font.roboto, 8, "OUTLINE") + SVUI_PLATE.cast:SetStatusBarTexture(SV.Media.bar.lazer) + SVUI_PLATE.cast.text:SetFont(SV.Media.font.roboto, 8, "OUTLINE") + plate.cast.text:SetFont(SV.Media.font.roboto, 8, "OUTLINE") plate.cast.icon:Size((CBHeight + HBHeight) + 5) PLATE_REF.raidicon:ClearAllPoints() - SuperVillain:ReversePoint(PLATE_REF.raidicon, RIAnchor, SVUI_PLATE.health, RIXoffset, RIYoffset) + SV:ReversePoint(PLATE_REF.raidicon, RIAnchor, SVUI_PLATE.health, RIXoffset, RIYoffset) PLATE_REF.raidicon:SetSize(RISize, RISize) SVUI_PLATE.health.icon:ClearAllPoints() - SuperVillain:ReversePoint(SVUI_PLATE.health.icon, RIAnchor, SVUI_PLATE.health, RIXoffset, RIYoffset) + SV:ReversePoint(SVUI_PLATE.health.icon, RIAnchor, SVUI_PLATE.health, RIXoffset, RIYoffset) SVUI_PLATE.health.icon:SetSize(RISize, RISize) for index = 1, #PLATE_AURAICONS do if PLATE_AURAICONS and PLATE_AURAICONS[index] then @@ -1469,17 +1469,17 @@ UPDATE AND BUILD ]]-- function MOD:UpdateLocals() local db = self.db - if not db then return end; + if not db then return end - NPClassRole = SuperVillain.ClassRole; + NPClassRole = SV.ClassRole; NPBaseAlpha = db.nonTargetAlpha; NPCombatHide = db.combatHide; - NPFont = SuperVillain.Shared:Fetch("font", db.font); + NPFont = SV.Shared:Fetch("font", db.font); NPFSize = db.fontSize; NPFOutline = db.fontOutline; - AuraFont = SuperVillain.Shared:Fetch("font", db.auras.font); + AuraFont = SV.Shared:Fetch("font", db.auras.font); AuraFSize = db.auras.fontSize; AuraFOutline = db.auras.fontOutline; AuraMaxCount = db.auras.numAuras; @@ -1524,14 +1524,14 @@ function MOD:UpdateLocals() NPReactNeutral = {rc.neutral[1], rc.neutral[2], rc.neutral[3]} NPReactEnemy = {rc.enemy[1], rc.enemy[2], rc.enemy[3]} - AuraFont = SuperVillain.Shared:Fetch("font", db.auras.font); + AuraFont = SV.Shared:Fetch("font", db.auras.font); AuraFSize = db.auras.fontSize; AuraFOutline = db.auras.fontOutline; AuraMaxCount = db.auras.numAuras; AuraFilterName = db.auras.additionalFilter - AuraFilter = SuperVillain.db.filter[AuraFilterName] + AuraFilter = SV.db.filter[AuraFilterName] - if (db.comboPoints and (SuperVillain.class == 'ROGUE' or SuperVillain.class == 'DRUID')) then + if (db.comboPoints and (SV.class == 'ROGUE' or SV.class == 'DRUID')) then self.UseCombo = true self:RegisterEvent("UNIT_COMBO_POINTS") else @@ -1557,15 +1557,15 @@ function MOD:CombatToggle(noToggle) end function MOD:ReLoad() - if SuperVillain.db["SVPlate"].enable ~= true then + if SV.db["SVPlate"].enable ~= true then self:DisableTracking() return end self:UpdateAllPlates(); -end; +end function MOD:Load() - if SuperVillain.db["SVPlate"].enable ~= true then return end + if SV.db["SVPlate"].enable ~= true then return end self:UpdateLocals() self:RegisterEvent("PLAYER_ENTERING_WORLD") self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") @@ -1645,4 +1645,4 @@ CONFIGS["SVPlate"] = { }, } -SuperVillain.Registry:NewPackage(MOD, "SVPlate") \ No newline at end of file +Registry:NewPackage(MOD, "SVPlate") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/SVStats.lua b/Interface/AddOns/SVUI/packages/stats/SVStats.lua index c8dad65..eac71af 100644 --- a/Interface/AddOns/SVUI/packages/stats/SVStats.lua +++ b/Interface/AddOns/SVUI/packages/stats/SVStats.lua @@ -33,8 +33,8 @@ local min = math.min; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local CONFIGS = SuperVillain.Configs +local SV, L, Registry = unpack(select(2, ...)); +local CONFIGS = SV.Configs local MOD = {}; MOD.Anchors = {}; MOD.Statistics = {}; @@ -215,7 +215,7 @@ function MOD:NewAnchor(parent, maxCount, tipAnchor, isTop, customTemplate, isVer parent.holders[position].barframe.bg = parent.holders[position].barframe:CreateTexture(nil, "BORDER") parent.holders[position].barframe.bg:FillInner(parent.holders[position].barframe, 2, 2) parent.holders[position].barframe.bg:SetTexture([[Interface\BUTTONS\WHITE8X8]]) - parent.holders[position].barframe.bg:SetGradient(unpack(SuperVillain.Media.gradient.dark)) + parent.holders[position].barframe.bg:SetGradient(unpack(SV.Media.gradient.dark)) end parent.holders[position].barframe:SetFrameLevel(parent.holders[position]:GetFrameLevel()-1) parent.holders[position].barframe:SetBackdrop({ @@ -236,11 +236,11 @@ function MOD:NewAnchor(parent, maxCount, tipAnchor, isTop, customTemplate, isVer parent.holders[position].barframe.icon.texture:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\PLACEHOLDER") parent.holders[position].barframe.bar = CreateFrame("StatusBar", nil, parent.holders[position].barframe) parent.holders[position].barframe.bar:FillInner(parent.holders[position].barframe, 2, 2) - parent.holders[position].barframe.bar:SetStatusBarTexture(SuperVillain.Media.bar.default) + parent.holders[position].barframe.bar:SetStatusBarTexture(SV.Media.bar.default) parent.holders[position].barframe.bar.extra = CreateFrame("StatusBar", nil, parent.holders[position].barframe.bar) parent.holders[position].barframe.bar.extra:SetAllPoints() - parent.holders[position].barframe.bar.extra:SetStatusBarTexture(SuperVillain.Media.bar.default) + parent.holders[position].barframe.bar.extra:SetStatusBarTexture(SV.Media.bar.default) parent.holders[position].barframe.bar.extra:Hide() parent.holders[position].barframe:Hide() parent.holders[position].textframe = CreateFrame("Frame", nil, parent.holders[position]) @@ -249,11 +249,11 @@ function MOD:NewAnchor(parent, maxCount, tipAnchor, isTop, customTemplate, isVer parent.holders[position].text = parent.holders[position].textframe:CreateFontString(nil, "OVERLAY", nil, 7) parent.holders[position].text:SetAllPoints() if(MOD.db.showBackground) then - parent.holders[position].text:SetFontTemplate(SuperVillain.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, "NONE", "CENTER", "MIDDLE") + parent.holders[position].text:SetFontTemplate(SV.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, "NONE", "CENTER", "MIDDLE") parent.holders[position].text:SetShadowColor(0, 0, 0, 0.5) parent.holders[position].text:SetShadowOffset(2, -4) else - parent.holders[position].text:SetFontTemplate(SuperVillain.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + parent.holders[position].text:SetFontTemplate(SV.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) parent.holders[position].text:SetJustifyH("CENTER") parent.holders[position].text:SetJustifyV("MIDDLE") end @@ -392,7 +392,7 @@ do StatMenuFrame.buttons[i].hoverTex:Hide() StatMenuFrame.buttons[i].text = StatMenuFrame.buttons[i]:CreateFontString(nil, 'BORDER') StatMenuFrame.buttons[i].text:SetAllPoints() - StatMenuFrame.buttons[i].text:SetFont(SuperVillain.Media.font.roboto,12,"OUTLINE") + StatMenuFrame.buttons[i].text:SetFont(SV.Media.font.roboto,12,"OUTLINE") StatMenuFrame.buttons[i].text:SetJustifyH("LEFT") StatMenuFrame.buttons[i]:SetScript("OnEnter", DD_OnEnter) StatMenuFrame.buttons[i]:SetScript("OnLeave", DD_OnLeave) @@ -537,7 +537,7 @@ do local BG_OnClick = function() ForceHideBGStats = true; MOD:Generate() - SuperVillain:AddonMessage(L["Battleground statistics temporarily hidden, to show type \"/sv bg\" or \"/sv pvp\""]) + SV:AddonMessage(L["Battleground statistics temporarily hidden, to show type \"/sv bg\" or \"/sv pvp\""]) end local function SetMenuLists() @@ -574,9 +574,9 @@ do parent.holders[position]:SetScript("OnClick", nil) if(db.showBackground) then - parent.holders[position].text:SetFont(SuperVillain.Shared:Fetch("font", db.font), db.fontSize, "NONE") + parent.holders[position].text:SetFont(SV.Shared:Fetch("font", db.font), db.fontSize, "NONE") else - parent.holders[position].text:SetFont(SuperVillain.Shared:Fetch("font", db.font), db.fontSize, db.fontOutline) + parent.holders[position].text:SetFont(SV.Shared:Fetch("font", db.font), db.fontSize, db.fontOutline) end parent.holders[position].text:SetText(nil) @@ -628,7 +628,7 @@ function MOD:ReLoad() end function MOD:Load() - local hexHighlight = SuperVillain:HexColor("highlight") or "FFFFFF" + local hexHighlight = SV:HexColor("highlight") or "FFFFFF" local hexClass = classColor.colorStr BGStatString = "|cff" .. hexHighlight .. "%s: |c" .. hexClass .. "%s|r"; SVUI_Global["Accountant"] = SVUI_Global["Accountant"] or {}; @@ -642,11 +642,11 @@ function MOD:Load() self:CacheRepData() self:CacheTokenData() - StatMenuFrame:SetParent(SuperVillain.UIParent); + StatMenuFrame:SetParent(SV.UIParent); StatMenuFrame:SetPanelTemplate("Transparent"); StatMenuFrame:Hide() - self.tooltip:SetParent(SuperVillain.UIParent) + self.tooltip:SetParent(SV.UIParent) self.tooltip:SetFrameStrata("DIALOG") self.tooltip:HookScript("OnShow", _hook_TooltipOnShow) @@ -698,4 +698,4 @@ CONFIGS["SVStats"] = { ["panelTransparency"] = false, } -SuperVillain.Registry:NewPackage(MOD, "SVStats") \ No newline at end of file +Registry:NewPackage(MOD, "SVStats") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/bags.lua b/Interface/AddOns/SVUI/packages/stats/stats/bags.lua index 9156da3..a078d3d 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/bags.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/bags.lua @@ -49,8 +49,8 @@ local twipe, tsort = table.wipe, table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVStats; +local SV, L, Registry = unpack(select(2, ...)); +local MOD = SV.SVStats; --[[ ########################################################## BAG STATS @@ -67,14 +67,14 @@ local function bags_events(this, e, ...) for i = 0, NUM_BAG_SLOTS do f, g = f + GetContainerNumFreeSlots(i), g + GetContainerNumSlots(i) - end; + end h = g - f; this.text:SetFormattedText(bags_text, L["Bags"]..": ", hexColor, h, g) -end; +end local function bags_click() ToggleAllBags() -end; +end local function bags_focus(this) MOD:Tip(this) @@ -83,20 +83,20 @@ local function bags_focus(this) if l and i == 1 then MOD.tooltip:AddLine(CURRENCY) MOD.tooltip:AddLine(" ") - end; + end if l and m then MOD.tooltip:AddDoubleLine(l, m, 1, 1, 1) end - end; + end MOD:ShowTip() -end; +end local BagsColorUpdate = function() - hexColor = SuperVillain:HexColor("highlight") + hexColor = SV:HexColor("highlight") if currentObject ~= nil then bags_events(currentObject) end -end; +end -SuperVillain.Registry:SetCallback(BagsColorUpdate) +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..d3b9d13 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/cta.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/cta.lua @@ -49,8 +49,8 @@ local twipe, tsort = table.wipe, table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVStats; +local SV, L, Registry = unpack(select(2, ...)); +local MOD = SV.SVStats; --[[ ########################################################## CALL TO ARMS STATS @@ -65,15 +65,15 @@ local function formatCTAtext(tanks, heals, dps) local result = "" if tanks then result = result.."|TInterface\\AddOns\\SVUI\\assets\\textures\\default\\tank.tga:14:14|t" - end; + end if heals then result = result.."|TInterface\\AddOns\\SVUI\\assets\\textures\\default\\healer.tga:14:14|t" - end; + end if dps then result = result.."|TInterface\\AddOns\\SVUI\\assets\\textures\\default\\dps.tga:14:14|t" - end; + end return result -end; +end local function CTA_OnEvent(self, ...) local isTank = false; @@ -86,29 +86,29 @@ local function CTA_OnEvent(self, ...) local eligible, forTank, forHealer, forDamage, itemCount = GetLFGRoleShortageRewards(id, i) if eligible then isNormal = false - end; + end if eligible and forTank and itemCount > 0 then isTank = true; - end; + end if eligible and forHealer and itemCount > 0 then isHeal = true; - end; + end if eligible and forDamage and itemCount > 0 then isDPS = true; end end - end; + end if isNormal then self.text:SetText(tooltipString) else self.text:SetText(BATTLEGROUND_HOLIDAY..": "..formatCTAtext(isTank, isHeal, isDPS)) - end; + end currentObject = self -end; +end local function CTA_OnClick() ToggleFrame(LFDParentFrame) -end; +end local function CTA_OnEnter(self) MOD:Tip(self) @@ -123,13 +123,13 @@ local function CTA_OnEnter(self) local eligible, forTank, forHealer, forDamage, itemCount = GetLFGRoleShortageRewards(id, i) if eligible then isNormal = false - end; + end if eligible and forTank and itemCount > 0 then isTank = true; - end; + end if eligible and forHealer and itemCount > 0 then isHeal = true; - end; + end if eligible and forDamage and itemCount > 0 then isDPS = true; end @@ -138,22 +138,22 @@ local function CTA_OnEnter(self) local text = formatCTAtext(isTank,isHeal,isDPS) if text ~= "" then MOD.tooltip:AddDoubleLine(name..":", text, 1, 1, 1) - end; + end if isTank or isHeal or isDPS then counter = counter + 1 end end - end; + end MOD:ShowTip() -end; +end local CTAColorUpdate = function() - local hexColor = SuperVillain:HexColor("highlight"); + local hexColor = SV:HexColor("highlight"); tooltipString = ("%s: |cff%sN/A|r"):format(BATTLEGROUND_HOLIDAY, hexColor) if currentObject ~= nil then CTA_OnEvent(currentObject) end -end; -SuperVillain.Registry:SetCallback(CTAColorUpdate) +end +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..2cef27d 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/dps.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/dps.lua @@ -31,8 +31,8 @@ local match, sub, join = string.match, string.sub, string.join; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVStats; +local SV, L, Registry = unpack(select(2, ...)); +local MOD = SV.SVStats; --[[ ########################################################## CALL TO ARMS STATS @@ -117,11 +117,11 @@ local function DPS_OnEvent(self, event, ...) end local DPSColorUpdate = function() - hexColor = SuperVillain:HexColor("highlight") + hexColor = SV:HexColor("highlight") if lastPanel ~= nil then DPS_OnEvent(lastPanel) end end -SuperVillain.Registry:SetCallback(DPSColorUpdate) +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..61014b9 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/durability.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/durability.lua @@ -49,8 +49,8 @@ local twipe, tsort = table.wipe, table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVStats; +local SV, L, Registry = unpack(select(2, ...)); +local MOD = SV.SVStats; --[[ ########################################################## DURABILITY STATS @@ -83,8 +83,8 @@ local function Durability_OnEvent(self, ...) self.text:SetAllPoints(self) self.text:SetJustifyH("CENTER") self.barframe:Hide() - self.text:SetFontTemplate(SuperVillain.Shared:Fetch("font",SuperVillain.db.SVStats.font),SuperVillain.db.SVStats.fontSize,SuperVillain.db.SVStats.fontOutline) - end; + self.text:SetFontTemplate(SV.Shared:Fetch("font",SV.db.SVStats.font),SV.db.SVStats.fontSize,SV.db.SVStats.fontOutline) + end for slot,name in pairs(inventoryMap)do local slotID = GetInventorySlotInfo(slot) min,max = GetInventoryItemDurability(slotID) @@ -94,9 +94,9 @@ local function Durability_OnEvent(self, ...) overall = min / max * 100 end end - end; + end self.text:SetFormattedText(displayString, DURABILITY, hexColor, overall) -end; +end local function DurabilityBar_OnEvent(self, ...) currentObject = nil; @@ -104,8 +104,8 @@ local function DurabilityBar_OnEvent(self, ...) if not self.barframe:IsShown() then self.barframe:Show() self.barframe.icon.texture:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\STAT-DUR") - self.text:SetFontTemplate(SuperVillain.Shared:Fetch("font",SuperVillain.db.SVStats.font),SuperVillain.db.SVStats.fontSize,"NONE") - end; + self.text:SetFontTemplate(SV.Shared:Fetch("font",SV.db.SVStats.font),SV.db.SVStats.fontSize,"NONE") + end for slot,name in pairs(inventoryMap)do local slotID = GetInventorySlotInfo(slot) min,max = GetInventoryItemDurability(slotID) @@ -115,34 +115,34 @@ local function DurabilityBar_OnEvent(self, ...) overall = min / max * 100 end end - end; + end local newRed = (100 - overall) * 0.01; local newGreen = overall * 0.01; self.barframe.bar:SetMinMaxValues(0, 100) self.barframe.bar:SetValue(overall) self.barframe.bar:SetStatusBarColor(newRed, newGreen, 0) self.text:SetText('') -end; +end local function Durability_OnClick() ToggleCharacter("PaperDollFrame") -end; +end local function Durability_OnEnter(self) MOD:Tip(self) for name,amt in pairs(equipment)do - MOD.tooltip:AddDoubleLine(name, format("%d%%", amt),1, 1, 1, SuperVillain:ColorGradient(amt * 0.01, 1, 0, 0, 1, 1, 0, 0, 1, 0)) - end; + MOD.tooltip:AddDoubleLine(name, format("%d%%", amt),1, 1, 1, SV:ColorGradient(amt * 0.01, 1, 0, 0, 1, 1, 0, 0, 1, 0)) + end MOD:ShowTip() -end; +end local DurColorUpdate = function() - hexColor = SuperVillain:HexColor("highlight") + hexColor = SV:HexColor("highlight") if currentObject ~= nil then Durability_OnEvent(currentObject) end -end; -SuperVillain.Registry:SetCallback(DurColorUpdate) +end +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/experience.lua b/Interface/AddOns/SVUI/packages/stats/stats/experience.lua index 4d47b94..093f9c9 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/experience.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/experience.lua @@ -32,8 +32,8 @@ local gsub = string.gsub; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVStats; +local SV, L = unpack(select(2, ...)); +local MOD = SV.SVStats; --[[ ########################################################## EXPERIENCE STATS @@ -66,7 +66,7 @@ local function Experience_OnEvent(self, ...) self.text:SetAllPoints(self) self.text:SetJustifyH("CENTER") self.barframe:Hide() - self.text:SetFontTemplate(SuperVillain.Shared:Fetch("font",SuperVillain.db.SVStats.font),SuperVillain.db.SVStats.fontSize,SuperVillain.db.SVStats.fontOutline) + self.text:SetFontTemplate(SV.Shared:Fetch("font",SV.db.SVStats.font),SV.db.SVStats.fontSize,SV.db.SVStats.fontOutline) end local f, g = getUnitXP("player") local h = GetXPExhaustion() @@ -88,7 +88,7 @@ local function ExperienceBar_OnEvent(self, ...) if (not self.barframe:IsShown())then self.barframe:Show() self.barframe.icon.texture:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\STAT-XP") - self.text:SetFontTemplate(SuperVillain.Shared:Fetch("font",SuperVillain.db.SVStats.font),SuperVillain.db.SVStats.fontSize,"NONE") + self.text:SetFontTemplate(SV.Shared:Fetch("font",SV.db.SVStats.font),SV.db.SVStats.fontSize,"NONE") end if not self.barframe.bar.extra:IsShown() then self.barframe.bar.extra:Show() diff --git a/Interface/AddOns/SVUI/packages/stats/stats/friends.lua b/Interface/AddOns/SVUI/packages/stats/stats/friends.lua index 8b364e4..4fbf942 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/friends.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/friends.lua @@ -49,8 +49,8 @@ local twipe, tsort = table.wipe, table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVStats; +local SV, L, Registry = unpack(select(2, ...)); +local MOD = SV.SVStats; --[[ ########################################################## LOCALIZED GLOBALS @@ -74,7 +74,7 @@ local StatEvents = { "CHAT_MSG_SYSTEM" }; -SuperVillain.SystemAlert.SET_BN_BROADCAST={ +SV.SystemAlert.SET_BN_BROADCAST={ text = BN_BROADCAST_TOOLTIP, button1 = ACCEPT, button2 = CANCEL, @@ -93,7 +93,7 @@ SuperVillain.SystemAlert.SET_BN_BROADCAST={ preferredIndex = 3 }; -local menuFrame = CreateFrame("Frame", "FriendDatatextRightClickMenu", SuperVillain.UIParent, "UIDropDownMenuTemplate") +local menuFrame = CreateFrame("Frame", "FriendDatatextRightClickMenu", SV.UIParent, "UIDropDownMenuTemplate") local menuList = { { text = OPTIONS_MENU, isTitle = true,notCheckable=true}, { text = INVITE, hasArrow = true,notCheckable=true, }, @@ -105,7 +105,7 @@ local menuList = { { text = "|cffFF0000"..AFK.."|r", notCheckable=true, func = function() if not IsChatAFK() then SendChatMessage("", "AFK") end end }, }, }, - { text = BN_BROADCAST_TOOLTIP, notCheckable=true, func = function() SuperVillain:StaticPopup_Show("SET_BN_BROADCAST") end }, + { text = BN_BROADCAST_TOOLTIP, notCheckable=true, func = function() SV:StaticPopup_Show("SET_BN_BROADCAST") end }, } local function inviteClick(self, name) @@ -373,12 +373,12 @@ local function OnEnter(self) end local FriendsColorUpdate = function() - hexColor = SuperVillain:HexColor("highlight") + hexColor = SV:HexColor("highlight") if lastPanel ~= nil then OnEvent(lastPanel,'SVUI_COLOR_UPDATE') end -end; +end -SuperVillain.Registry:SetCallback(FriendsColorUpdate) +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/gold.lua b/Interface/AddOns/SVUI/packages/stats/stats/gold.lua index 8c96ea2..51e69b8 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/gold.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/gold.lua @@ -49,8 +49,8 @@ local twipe, tsort = table.wipe, table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVStats; +local SV, L = unpack(select(2, ...)); +local MOD = SV.SVStats; --[[ ########################################################## GOLD STATS @@ -74,7 +74,7 @@ local tiptext = join("","|cffaaaaaa",L["Reset Data: Hold Left Ctrl + Shift then local serverGold = {}; local function FormatCurrency(amount, short) - if not amount then return end; + if not amount then return end local gold, silver, copper = floor(abs(amount/10000)), abs(mod(amount/100,100)), abs(mod(amount,100)) if(short) then if gold ~= 0 then @@ -95,10 +95,10 @@ local function FormatCurrency(amount, short) return copperFormat:format(copper) end end -end; +end local function Gold_OnEvent(self, event,...) - if not IsLoggedIn() then return end; + if not IsLoggedIn() then return end local current = GetMoney() recorded = SVUI_Global["Accountant"][playerRealm]["gold"][playerName] or GetMoney(); local adjusted = current - recorded; @@ -106,10 +106,10 @@ local function Gold_OnEvent(self, event,...) loss = loss - adjusted else gains = gains + adjusted - end; + end self.text:SetText(FormatCurrency(current, MOD.db.shortGold)) SVUI_Global["Accountant"][playerRealm]["gold"][playerName] = GetMoney() -end; +end local function Gold_OnClick(self, button) if IsLeftControlKeyDown() and IsShiftKeyDown() then @@ -120,7 +120,7 @@ local function Gold_OnClick(self, button) else ToggleAllBags() end -end; +end local function Gold_OnEnter(self) MOD:Tip(self) @@ -131,7 +131,7 @@ local function Gold_OnEnter(self) MOD.tooltip:AddDoubleLine(L["Deficit:"],FormatCurrency(gains - loss),1,0,0,1,1,1) elseif (gains - loss) > 0 then MOD.tooltip:AddDoubleLine(L["Profit:"],FormatCurrency(gains - loss),0,1,0,1,1,1) - end; + end MOD.tooltip:AddLine(" ") local cash = SVUI_Global["Accountant"][playerRealm]["gold"][playerName]; MOD.tooltip:AddLine(L[playerName..": "]) @@ -144,14 +144,14 @@ local function Gold_OnEnter(self) cash = cash + amount; MOD.tooltip:AddDoubleLine(name, FormatCurrency(amount), 1,1,1,1,1,1) end - end; + end MOD.tooltip:AddLine(" ") MOD.tooltip:AddLine(L["Server: "]) MOD.tooltip:AddDoubleLine(L["Total: "], FormatCurrency(cash), 1,1,1,1,1,1) MOD.tooltip:AddLine(" ") MOD.tooltip:AddLine(tiptext) MOD:ShowTip() -end; +end MOD:Extend('Gold', StatEvents, Gold_OnEvent, nil, Gold_OnClick, Gold_OnEnter); @@ -162,6 +162,6 @@ function MOD:LoadServerGold() serverGold[name] = amount; totalGold = totalGold + amount end - end; + end serverGold['total'] = totalGold; end \ 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 69e5856..dba2cf8 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/guild.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/guild.lua @@ -36,8 +36,8 @@ local twipe, tsort = table.wipe, table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVStats; +local SV, L, Registry = unpack(select(2, ...)); +local MOD = SV.SVStats; --[[ ########################################################## GUILD STATS @@ -49,7 +49,7 @@ local playerRealm = GetRealmName(); local StatEvents = {"PLAYER_ENTERING_WORLD","GUILD_ROSTER_UPDATE","GUILD_XP_UPDATE","PLAYER_GUILD_UPDATE","GUILD_MOTD"}; local updatedString = ""; -local patternColor = SuperVillain:HexColor(0.75,0.9,1); +local patternColor = SV:HexColor(0.75,0.9,1); local pattern1 = ("|cff%s%s"):format(patternColor, GUILD_EXPERIENCE_CURRENT); local pattern2 = ("|cff%s%s"):format(patternColor, GUILD_EXPERIENCE_DAILY); local guildFormattedName = "%s: %d/%d"; @@ -74,7 +74,7 @@ local MobileFlagFormat = { [2] = function()return "|TInterface\\ChatFrame\\UI-ChatIcon-ArmoryChat-BusyMobile:14:14:0:0:16:16:0:16:0:16|t" end }; -local GuildDatatTextRightClickMenu = CreateFrame("Frame", "GuildDatatTextRightClickMenu", SuperVillain.UIParent, "UIDropDownMenuTemplate") +local GuildDatatTextRightClickMenu = CreateFrame("Frame", "GuildDatatTextRightClickMenu", SV.UIParent, "UIDropDownMenuTemplate") local MenuMap = { {text = OPTIONS_MENU, isTitle = true, notCheckable = true}, @@ -144,8 +144,8 @@ local GuildStatEventHandler = { ["GUILD_MOTD"] = function(arg1, arg2) GuildStatMOTD = arg2 end, - ["SVUI_FORCE_RUN"] = SuperVillain.fubar, - ["SVUI_COLOR_UPDATE"] = SuperVillain.fubar + ["SVUI_FORCE_RUN"] = SV.fubar, + ["SVUI_COLOR_UPDATE"] = SV.fubar }; local function MenuInvite(self, unit) @@ -248,7 +248,7 @@ local function Guild_OnEnter(self, _, ap) MOD.tooltip:AddLine(' ') MOD.tooltip:AddLine(("%s |cffaaaaaa- |cffffffff%s"):format(GUILD_MOTD, GuildStatMOTD), 0.75, 0.9, 1, 1) end - local av = SuperVillain:HexColor(0.75,0.9,1) + local av = SV:HexColor(0.75,0.9,1) local _, _, standingID, barMin, barMax, barValue = GetGuildFactionInfo() if standingID ~= 8 then barMax = barMax - barMin; @@ -298,12 +298,12 @@ local function Guild_OnEnter(self, _, ap) end local GuildColorUpdate = function() - local hexColor = SuperVillain:HexColor("highlight"); + local hexColor = SV:HexColor("highlight"); updatedString = join("", GUILD, ": |cff", hexColor, "%d|r") if currentObject ~= nil then Guild_OnEvent(currentObject, 'SVUI_COLOR_UPDATE') end end -SuperVillain.Registry:SetCallback(GuildColorUpdate) +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..734575f 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/hps.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/hps.lua @@ -32,8 +32,8 @@ local max = math.max; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVStats; +local SV, L, Registry = unpack(select(2, ...)); +local MOD = SV.SVStats; --[[ ########################################################## CALL TO ARMS STATS @@ -124,11 +124,11 @@ local function HPS_OnEvent(self, event, ...) end local HPSColorUpdate = function() - hexColor = SuperVillain:HexColor("highlight"); + hexColor = SV:HexColor("highlight"); if lastPanel ~= nil then HPS_OnEvent(lastPanel) end end -SuperVillain.Registry:SetCallback(HPSColorUpdate) +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/reputation.lua b/Interface/AddOns/SVUI/packages/stats/stats/reputation.lua index 74f3209..9396f07 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/reputation.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/reputation.lua @@ -33,8 +33,8 @@ local format, gsub = string.format, string.gsub; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVStats; +local SV, L = unpack(select(2, ...)); +local MOD = SV.SVStats; --[[ ########################################################## REPUTATION STATS @@ -75,7 +75,7 @@ function MOD:CacheRepData() if factionName ~= active then SetWatchedFactionIndex(factionIndex) end - end; + end tinsert(RepMenuList, {text = factionName, func = fn}) end end @@ -88,7 +88,7 @@ local function Reputation_OnEvent(self, ...) self.barframe:Hide() self.text:SetAlpha(1) self.text:SetShadowOffset(2, -4) - end; + end local ID = 100 local isFriend, friendText local name, reaction, min, max, value = GetWatchedFactionInfo() @@ -109,8 +109,8 @@ local function Reputation_OnEvent(self, ...) end end self.text:SetFormattedText("|cff22EF5F%s|r|cff888888 - [|r%d%%|cff888888]|r", isFriend and friendText or _G["FACTION_STANDING_LABEL"..ID], ((value - min) / (max - min) * 100)) - end; -end; + end +end local function ReputationBar_OnEvent(self, ...) if not self.barframe:IsShown()then @@ -118,7 +118,7 @@ local function ReputationBar_OnEvent(self, ...) self.barframe.icon.texture:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\STAT-REP") self.text:SetAlpha(1) self.text:SetShadowOffset(1, -2) - end; + end local bar = self.barframe.bar; local name, reaction, min, max, value = GetWatchedFactionInfo() local numFactions = GetNumFactions(); @@ -145,8 +145,8 @@ local function ReputationBar_OnEvent(self, ...) bar:SetMinMaxValues(min, max) bar:SetValue(value) self.text:SetText(txt) - end; -end; + end +end local function Reputation_OnEnter(self) MOD:Tip(self) @@ -159,16 +159,16 @@ local function Reputation_OnEnter(self) MOD.tooltip:AddLine(' ') MOD.tooltip:AddDoubleLine(STANDING..':', friendID and friendTextLevel or _G['FACTION_STANDING_LABEL'..reaction], 1, 1, 1) MOD.tooltip:AddDoubleLine(REPUTATION..':', format('%d / %d (%d%%)', value - min, max - min, (value - min) / (max - min) * 100), 1, 1, 1) - end; + end MOD.tooltip:AddLine(" ", 1, 1, 1) MOD.tooltip:AddDoubleLine("[Click]", "Change Watched Faction", 0,1,0, 0.5,1,0.5) MOD:ShowTip(true) -end; +end local function Reputation_OnClick(self, button) MOD:CacheRepData() MOD:SetStatMenu(self, RepMenuList) -end; +end MOD:Extend("Reputation", StatEvents, Reputation_OnEvent, nil, Reputation_OnClick, Reputation_OnEnter) MOD:Extend("Reputation Bar", StatEvents, ReputationBar_OnEvent, nil, Reputation_OnClick, Reputation_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/system.lua b/Interface/AddOns/SVUI/packages/stats/stats/system.lua index 255bba8..f043880 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/system.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/system.lua @@ -37,8 +37,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVStats; +local SV, L = unpack(select(2, ...)); +local MOD = SV.SVStats; --[[ ########################################################## SYSTEM STATS (Credit: Elv) diff --git a/Interface/AddOns/SVUI/packages/stats/stats/time.lua b/Interface/AddOns/SVUI/packages/stats/stats/time.lua index 3bec845..2bc1030 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/time.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/time.lua @@ -35,8 +35,8 @@ local floor = math.floor; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVStats; +local SV, L, Registry = unpack(select(2, ...)); +local MOD = SV.SVStats; --[[ ########################################################## TIME STATS (Credit: Elv) @@ -192,9 +192,9 @@ function Update(self, t) if int > 0 then return end if GameTimeFrame.flashInvite then - SuperVillain.Animate:Flash(self, 0.53) + SV.Animate:Flash(self, 0.53) else - SuperVillain.Animate:StopFlash(self) + SV.Animate:StopFlash(self) end if enteredFrame then @@ -223,14 +223,14 @@ function Update(self, t) end local ColorUpdate = function() - local hexColor = SuperVillain:HexColor("highlight") + local hexColor = SV:HexColor("highlight") europeDisplayFormat = join("", "%02d|cff", hexColor, ":|r%02d") ukDisplayFormat = join("", "", "%d|cff", hexColor, ":|r%02d|cff", hexColor, " %s|r") if lastPanel ~= nil then Update(lastPanel, 20000) end -end; +end -SuperVillain.Registry:SetCallback(ColorUpdate) +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/stats/stats/tokens.lua b/Interface/AddOns/SVUI/packages/stats/stats/tokens.lua index 3239ff8..1825913 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/tokens.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/tokens.lua @@ -31,8 +31,8 @@ local twipe = table.wipe; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVStats; +local SV, L = unpack(select(2, ...)); +local MOD = SV.SVStats; --[[ ########################################################## GOLD STATS @@ -78,12 +78,12 @@ local function TokenInquiry(id, weekly, capped) end local function TokensEventHandler(self, event,...) - if not IsLoggedIn() or not self then return end; + if not IsLoggedIn() or not self then return end local id = SVUI_Global["Accountant"][playerRealm]["tokens"][playerName]; local _, current, tex = GetCurrencyInfo(id) local currentText = ("\124T%s:12\124t %s"):format(tex, current); self.text:SetText(currentText) -end; +end local function AddToTokenMenu(id) local name, _, tex, _, _, _, _ = GetCurrencyInfo(id) @@ -91,7 +91,7 @@ local function AddToTokenMenu(id) local fn = function() SVUI_Global["Accountant"][playerRealm]["tokens"][playerName] = id; TokensEventHandler(TokenParent) - end; + end tinsert(TokenMenuList, {text = itemName, func = fn}); end @@ -195,12 +195,12 @@ local function Tokens_OnEnter(self) MOD.tooltip:AddLine(" ") MOD.tooltip:AddDoubleLine("[Shift + Click]", "Change Watched Token", 0,1,0, 0.5,1,0.5) MOD:ShowTip(true) -end; +end local function Tokens_OnClick(self, button) TokenParent = self; MOD:CacheTokenData() MOD:SetStatMenu(self, TokenMenuList) -end; +end MOD:Extend('Tokens', TokenEvents, TokensEventHandler, nil, Tokens_OnClick, Tokens_OnEnter) \ 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..d5e7c9a 100644 --- a/Interface/AddOns/SVUI/packages/tip/SVTip.lua +++ b/Interface/AddOns/SVUI/packages/tip/SVTip.lua @@ -36,8 +36,8 @@ local twipe, tconcat = table.wipe, table.concat; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local CONFIGS = SuperVillain.Configs +local SV, L, Registry = unpack(select(2, ...)); +local CONFIGS = SV.Configs local MOD = {}; --[[ ########################################################## @@ -302,7 +302,7 @@ function MOD:INSPECT_READY(_,guid) if MOD.lastGUID ~= guid then return end local unit = "mouseover" if UnitExists(unit) then - local itemLevel = SuperVillain:ParseGearSlots(unit, true) + local itemLevel = SV:ParseGearSlots(unit, true) local spec = GetTalentSpec(unit) inspectCache[guid] = {time = GetTime()} if spec then @@ -478,7 +478,7 @@ local _hook_GameTooltip_OnTooltipSetUnit = function(self) if(creatureType) then local family = UnitCreatureFamily(unit) or creatureType - if(SuperVillain.class == "HUNTER" and creatureType == PET_TYPE_SUFFIX[8] and (family and TAMABLE_FAMILIES[family])) then + if(SV.class == "HUNTER" and creatureType == PET_TYPE_SUFFIX[8] and (family and TAMABLE_FAMILIES[family])) then local hunterLevel = UnitLevel("player") if(unitLevel <= hunterLevel) then TamablePet = true @@ -577,7 +577,7 @@ local _hook_GameTooltip_ShowStatusBar = function(self, ...) local barName = ("%sStatusBar%d"):format(name, self.shownStatusBars) local bar = _G[barName] if bar and not bar.styled then - bar:Formula409() + bar:RemoveTextures() bar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) bar:SetFixedPanelTemplate('Inset',true) if not bar.border then @@ -656,7 +656,7 @@ local _hook_GameTooltip_OnTooltipSetSpell = function(self) end local _hook_GameTooltip_SetDefaultAnchor = function(self, parent) - if SuperVillain.db.SVTip.enable ~= true then return end + if SV.db.SVTip.enable ~= true then return end if(self:GetAnchorType() ~= "ANCHOR_NONE") then return end if InCombatLockdown() and MOD.db.visibility.combat then self:Hide() @@ -670,13 +670,13 @@ local _hook_GameTooltip_SetDefaultAnchor = function(self, parent) self:SetOwner(parent, "ANCHOR_NONE") end end - if not SuperVillain:TestMovableMoved("SVUI_ToolTip_MOVE")then + if not SV:TestMovableMoved("SVUI_ToolTip_MOVE")then if(SVUI_ContainerFrame and SVUI_ContainerFrame:IsShown()) then self:SetPoint("BOTTOMLEFT", SVUI_ContainerFrame, "TOPLEFT", 0, 18) elseif(RightSuperDock:GetAlpha() == 1 and RightSuperDock:IsShown()) then self:SetPoint("BOTTOMRIGHT", RightSuperDock, "TOPRIGHT", -44, 18) else - self:SetPoint("BOTTOMRIGHT", SuperVillain.UIParent, "BOTTOMRIGHT", -44, 78) + self:SetPoint("BOTTOMRIGHT", SV.UIParent, "BOTTOMRIGHT", -44, 78) end else local point = Pinpoint(SVUI_ToolTip_MOVE) @@ -778,7 +778,7 @@ local _hook_OnTipHide = function(self) end local function ApplyTooltipSkins() - local barHeight = SuperVillain.db.SVTip.healthBar.height + local barHeight = SV.db.SVTip.healthBar.height for i, tooltip in pairs(tooltips) do if(not tooltip) then return end @@ -946,28 +946,28 @@ end function MOD:Load() BNToastFrame:Point("TOPRIGHT", SVUI_MinimapFrame, "BOTTOMLEFT", 0, -10) - SuperVillain:SetSVMovable(BNToastFrame, L["BNet Frame"], nil, nil, nil, nil, "BNET") + SV:SetSVMovable(BNToastFrame, L["BNet Frame"], nil, nil, nil, nil, "BNET") NewHook(BNToastFrame, "SetPoint", _hook_BNToastOnShow) - if not SuperVillain.db.SVTip.enable then return end + if not SV.db.SVTip.enable then return end - local anchor = CreateFrame("Frame", "SVUI_ToolTip", SuperVillain.UIParent) + local anchor = CreateFrame("Frame", "SVUI_ToolTip", SV.UIParent) anchor:Point("BOTTOMRIGHT", RightSuperDock, "TOPRIGHT", 0, 60) anchor:Size(130, 20) anchor:SetFrameLevel(anchor:GetFrameLevel() + 50) - SuperVillain:SetSVMovable(anchor, L["Tooltip"]) + SV:SetSVMovable(anchor, L["Tooltip"]) local barHeight = self.db.healthBar.height ApplyTooltipSkins() GameTooltipStatusBar:Height(barHeight) - GameTooltipStatusBar:SetStatusBarTexture(SuperVillain.Media.bar.default) + GameTooltipStatusBar:SetStatusBarTexture(SV.Media.bar.default) GameTooltipStatusBar:ClearAllPoints() GameTooltipStatusBar:SetPoint("BOTTOMLEFT", GameTooltip.SuperBorder, "BOTTOMLEFT", 3, 3) GameTooltipStatusBar:SetPoint("BOTTOMRIGHT", GameTooltip.SuperBorder, "BOTTOMRIGHT", -3, 3) GameTooltipStatusBar.text = GameTooltipStatusBar:CreateFontString(nil, "OVERLAY") GameTooltipStatusBar.text:Point("CENTER", GameTooltipStatusBar, "CENTER", 0, 0) - GameTooltipStatusBar.text:SetFontTemplate(SuperVillain.Shared:Fetch("font", MOD.db.healthBar.font), MOD.db.healthBar.fontSize, "OUTLINE") + GameTooltipStatusBar.text:SetFontTemplate(SV.Shared:Fetch("font", MOD.db.healthBar.font), MOD.db.healthBar.fontSize, "OUTLINE") if not GameTooltipStatusBar.border then local border = CreateFrame("Frame", nil, GameTooltipStatusBar) @@ -1024,4 +1024,4 @@ CONFIGS["SVTip"] = { }, } -SuperVillain.Registry:NewPackage(MOD, "SVTip") \ No newline at end of file +Registry:NewPackage(MOD, "SVTip") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua index 626e670..04c9b48 100644 --- a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua +++ b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua @@ -41,10 +41,10 @@ local NewHook = hooksecurefunc; GET ADDON DATA AND TEST FOR oUF ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SV, L, Registry = unpack(select(2, ...)); local _, ns = ... -local oUF_SuperVillain = ns.oUF -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") +local oUF_Villain = ns.oUF +assert(oUF_Villain, "SVUI was unable to locate oUF.") --[[ ########################################################## MODULE AND INNER CLASSES @@ -53,9 +53,8 @@ MODULE AND INNER CLASSES local MOD = {} MOD.Units = {} MOD.Headers = {} -MOD.Roster = {} -oUF_SuperVillain.SVConfigs = {} +oUF_Villain.SVConfigs = {} --[[ ########################################################## LOCALS @@ -155,8 +154,8 @@ do end end - function oUF_SuperVillain:DisableBlizzard(unit) - if(not SuperVillain.db.SVUnit.enable) then return end + function oUF_Villain:DisableBlizzard(unit) + if(not SV.db.SVUnit.enable) then return end if (not unit) or InCombatLockdown() then return end if (unit == "player") then @@ -296,35 +295,35 @@ function MOD:RestrictChildren(parentFrame, ...) end function MOD:ResetUnitOptions(unit) - SuperVillain.db:SetDefault("SVUnit", unit) + SV.db:SetDefault("SVUnit", unit) self:RefreshUnitFrames() end function MOD:RefreshUnitColors() - local db = SuperVillain.db.media.unitframes + local db = SV.db.media.unitframes for i, setting in pairs(db) do if setting and type(setting) == "table" then if(setting[1]) then - oUF_SuperVillain.colors[i] = setting + oUF_Villain.colors[i] = setting else local bt = {} for x, color in pairs(setting) do if(color)then bt[x] = color end - oUF_SuperVillain.colors[i] = bt + oUF_Villain.colors[i] = bt end end elseif setting then - oUF_SuperVillain.colors[i] = setting + oUF_Villain.colors[i] = setting end end local r, g, b = db.health[1], db.health[2], db.health[3] - oUF_SuperVillain.colors.smooth = {1, 0, 0, 1, 1, 0, r, g, b} + oUF_Villain.colors.smooth = {1, 0, 0, 1, 1, 0, r, g, b} - oUF_SuperVillain.SVConfigs.classbackdrop = SuperVillain.db.SVUnit.classbackdrop - oUF_SuperVillain.SVConfigs.healthclass = SuperVillain.db.SVUnit.healthclass - oUF_SuperVillain.SVConfigs.colorhealthbyvalue = SuperVillain.db.SVUnit.colorhealthbyvalue + oUF_Villain.SVConfigs.classbackdrop = SV.db.SVUnit.classbackdrop + oUF_Villain.SVConfigs.healthclass = SV.db.SVUnit.healthclass + oUF_Villain.SVConfigs.colorhealthbyvalue = SV.db.SVUnit.colorhealthbyvalue end function MOD:RefreshAllUnitMedia() @@ -358,9 +357,9 @@ function MOD:RefreshUnitFrames() if raidDebuffs then raidDebuffs:ResetDebuffData() if groupType == "party" or groupType == "raid" then - raidDebuffs:RegisterDebuffs(SuperVillain.db.filter["Raid"]) + raidDebuffs:RegisterDebuffs(SV.db.filter["Raid"]) else - raidDebuffs:RegisterDebuffs(SuperVillain.db.filter["CC"]) + raidDebuffs:RegisterDebuffs(SV.db.filter["CC"]) end end @@ -370,8 +369,8 @@ function MOD:RefreshUnitFrames() group:SetConfigEnvironment() end end - if SuperVillain.db.SVUnit.disableBlizzard then - oUF_SuperVillain:DisableBlizzard('party') + if SV.db.SVUnit.disableBlizzard then + oUF_Villain:DisableBlizzard('party') end collectgarbage("collect") end @@ -380,10 +379,10 @@ function MOD:RefreshUnitMedia(unitName) local db = MOD.db local key = unitName or self.___key if(not (db and db.enable) or not self) then return end - local CURRENT_BAR_TEXTURE = SuperVillain.Shared:Fetch("statusbar", db.statusbar) - local CURRENT_AURABAR_TEXTURE = SuperVillain.Shared:Fetch("statusbar", db.auraBarStatusbar); - local CURRENT_FONT = SuperVillain.Shared:Fetch("font", db.font) - local CURRENT_AURABAR_FONT = SuperVillain.Shared:Fetch("font", db.auraFont); + local CURRENT_BAR_TEXTURE = SV.Shared:Fetch("statusbar", db.statusbar) + local CURRENT_AURABAR_TEXTURE = SV.Shared:Fetch("statusbar", db.auraBarStatusbar); + local CURRENT_FONT = SV.Shared:Fetch("font", db.font) + local CURRENT_AURABAR_FONT = SV.Shared:Fetch("font", db.auraFont); local CURRENT_AURABAR_FONTSIZE = db.auraFontSize local CURRENT_AURABAR_FONTOUTLINE = db.auraFontOutline local unitDB = db[key] @@ -392,11 +391,11 @@ function MOD:RefreshUnitMedia(unitName) if(panel) then if(panel.Name and unitDB.name) then if(db.grid.enable and unitDB.gridAllowed) then - panel.Name:SetFont(SuperVillain.Media.font.pixel, 8, "MONOCHROMEOUTLINE") + panel.Name:SetFont(SV.Media.font.pixel, 8, "MONOCHROMEOUTLINE") panel.Name:SetShadowOffset(1, -1) panel.Name:SetShadowColor(0, 0, 0, 0.75) else - panel.Name:SetFont(SuperVillain.Shared:Fetch("font", unitDB.name.font), unitDB.name.fontSize, unitDB.name.fontOutline) + panel.Name:SetFont(SV.Shared:Fetch("font", unitDB.name.font), unitDB.name.fontSize, unitDB.name.fontOutline) panel.Name:SetShadowOffset(2, -2) panel.Name:SetShadowColor(0, 0, 0, 1) end @@ -424,8 +423,8 @@ function MOD:RefreshUnitMedia(unitName) cr,cg,cb = unitDB.castbar.sparkColor[1], unitDB.castbar.sparkColor[2], unitDB.castbar.sparkColor[3]; self.Castbar.SparkColor = {cr,cg,cb} else - self.Castbar.CastColor = oUF_SuperVillain.colors.casting - self.Castbar.SparkColor = oUF_SuperVillain.colors.spark + self.Castbar.CastColor = oUF_Villain.colors.casting + self.Castbar.SparkColor = oUF_Villain.colors.spark end end if(self.AuraBars and (unitDB.aurabar and unitDB.aurabar.enable)) then @@ -434,13 +433,13 @@ function MOD:RefreshUnitMedia(unitName) ab.textFont = CURRENT_AURABAR_FONT ab.textSize = db.auraFontSize ab.textOutline = db.auraFontOutline - ab.buffColor = oUF_SuperVillain.colors.buff_bars + ab.buffColor = oUF_Villain.colors.buff_bars if MOD.db.auraBarByType then ab.debuffColor = nil; - ab.defaultDebuffColor = oUF_SuperVillain.colors.debuff_bars + ab.defaultDebuffColor = oUF_Villain.colors.debuff_bars else - ab.debuffColor = oUF_SuperVillain.colors.debuff_bars + ab.debuffColor = oUF_Villain.colors.debuff_bars ab.defaultDebuffColor = nil end end @@ -556,7 +555,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() @@ -566,7 +567,24 @@ function MOD:RefreshUnitLayout(frame, template) cX = db.name.xOffset cY = db.name.yOffset nametext:ClearAllPoints() - SuperVillain:ReversePoint(nametext, point, infoPanel, cX, cY) + SV: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 @@ -581,7 +599,7 @@ function MOD:RefreshUnitLayout(frame, template) cX = db.health.xOffset cY = db.health.yOffset healthtext:ClearAllPoints() - SuperVillain:ReversePoint(healthtext, point, infoPanel, cX, cY) + SV:ReversePoint(healthtext, point, infoPanel, cX, cY) frame:Tag(healthtext, db.health.tags) end end @@ -597,7 +615,7 @@ function MOD:RefreshUnitLayout(frame, template) cX = db.power.xOffset cY = db.power.yOffset powertext:ClearAllPoints() - SuperVillain:ReversePoint(powertext, point, infoPanel, cX, cY) + SV:ReversePoint(powertext, point, infoPanel, cX, cY) if db.power.attachTextToPower then powertext:SetParent(frame.Power) else @@ -824,7 +842,7 @@ function MOD:RefreshUnitLayout(frame, template) castbar.Spark[1]:SetAllPoints(castbar.Spark) castbar.Spark[2]:FillInner(castbar.Spark, 4, 4) end - castbar.Spark.SetHeight = SuperVillain.fubar + castbar.Spark.SetHeight = SV.fubar end castbar:SetFrameStrata("HIGH") if castbar.Holder then @@ -861,14 +879,14 @@ function MOD:RefreshUnitLayout(frame, template) cr,cg,cb = db.castbar.sparkColor[1], db.castbar.sparkColor[2], db.castbar.sparkColor[3]; castbar.SparkColor = {cr,cg,cb} else - castbar.CastColor = oUF_SuperVillain.colors.casting - castbar.SparkColor = oUF_SuperVillain.colors.spark + castbar.CastColor = oUF_Villain.colors.casting + castbar.SparkColor = oUF_Villain.colors.spark end if db.castbar.enable and not frame:IsElementEnabled('Castbar')then frame:EnableElement('Castbar') elseif not db.castbar.enable and frame:IsElementEnabled('Castbar')then - SuperVillain:AddonMessage("No castbar") + SV:AddonMessage("No castbar") frame:DisableElement('Castbar') end end @@ -910,7 +928,7 @@ function MOD:RefreshUnitLayout(frame, template) local attachTo = FindAnchorFrame(frame, db.buffs.attachTo, db.debuffs.attachTo == 'BUFFS' and db.buffs.attachTo == 'DEBUFFS') - SuperVillain:ReversePoint(buffs, db.buffs.anchorPoint, attachTo, db.buffs.xOffset + BOTTOM_MODIFIER, db.buffs.yOffset) + SV:ReversePoint(buffs, db.buffs.anchorPoint, attachTo, db.buffs.xOffset + BOTTOM_MODIFIER, db.buffs.yOffset) buffs:SetWidth((auraSize + buffs.spacing) * perRow) buffs:Height((auraSize + buffs.spacing) * numRows) buffs["growth-y"] = db.buffs.verticalGrowth; @@ -942,7 +960,7 @@ function MOD:RefreshUnitLayout(frame, template) local attachTo = FindAnchorFrame(frame, db.debuffs.attachTo, db.debuffs.attachTo == 'BUFFS' and db.buffs.attachTo == 'DEBUFFS') - SuperVillain:ReversePoint(debuffs, db.debuffs.anchorPoint, attachTo, db.debuffs.xOffset + BOTTOM_MODIFIER, db.debuffs.yOffset) + SV:ReversePoint(debuffs, db.debuffs.anchorPoint, attachTo, db.debuffs.xOffset + BOTTOM_MODIFIER, db.debuffs.yOffset) debuffs:SetWidth((auraSize + debuffs.spacing) * perRow) debuffs:Height((auraSize + debuffs.spacing) * numRows) debuffs["growth-y"] = db.debuffs.verticalGrowth; @@ -990,13 +1008,13 @@ function MOD:RefreshUnitLayout(frame, template) auraBar:Point("BOTTOMLEFT", attachTo, "TOPLEFT", 1, preOffset) auraBar.down = false end - auraBar.buffColor = oUF_SuperVillain.colors.buff_bars + auraBar.buffColor = oUF_Villain.colors.buff_bars if self.db.auraBarByType then auraBar.debuffColor = nil; - auraBar.defaultDebuffColor = oUF_SuperVillain.colors.debuff_bars + auraBar.defaultDebuffColor = oUF_Villain.colors.debuff_bars else - auraBar.debuffColor = oUF_SuperVillain.colors.debuff_bars + auraBar.debuffColor = oUF_Villain.colors.debuff_bars auraBar.defaultDebuffColor = nil end @@ -1030,7 +1048,7 @@ function MOD:RefreshUnitLayout(frame, template) else raidIcon:SetAlpha(1) raidIcon:Size(size) - SuperVillain:ReversePoint(raidIcon, ico.raidicon.attachTo, healthPanel, ico.raidicon.xOffset, ico.raidicon.yOffset) + SV:ReversePoint(raidIcon, ico.raidicon.attachTo, healthPanel, ico.raidicon.xOffset, ico.raidicon.yOffset) end else frame:DisableElement('RaidIcon') @@ -1055,7 +1073,7 @@ function MOD:RefreshUnitLayout(frame, template) else lfd:SetAlpha(1) lfd:Size(size) - SuperVillain:ReversePoint(lfd, ico.roleIcon.attachTo, healthPanel, ico.roleIcon.xOffset, ico.roleIcon.yOffset) + SV:ReversePoint(lfd, ico.roleIcon.attachTo, healthPanel, ico.roleIcon.xOffset, ico.roleIcon.yOffset) end else frame:DisableElement('LFDRole') @@ -1081,7 +1099,7 @@ function MOD:RefreshUnitLayout(frame, template) else roles:SetAlpha(1) roles:Size(size) - SuperVillain:ReversePoint(roles, ico.raidRoleIcons.attachTo, healthPanel, ico.raidRoleIcons.xOffset, ico.raidRoleIcons.yOffset) + SV:ReversePoint(roles, ico.raidRoleIcons.attachTo, healthPanel, ico.raidRoleIcons.xOffset, ico.raidRoleIcons.yOffset) end else roles:Hide() @@ -1134,22 +1152,6 @@ function MOD:RefreshUnitLayout(frame, template) end end end - - if(frame.GPS) then - if(template ~= "target") then - frame.GPS.OnlyProximity = self.db.gpsLowHealth - end - if(db.gps) then - local actualSz = min(frame.GPS.DefaultSize, (UNIT_HEIGHT - 2)) - if(not frame:IsElementEnabled("GPS")) then - frame:EnableElement("GPS") - end - else - if(frame:IsElementEnabled("GPS")) then - frame:DisableElement("GPS") - end - end - end end --[[ ########################################################## @@ -1193,7 +1195,7 @@ local _ENV = { end return format("|cff%02x%02x%02x", r*255, g*255, b*255) end, - ColorGradient = oUF_SuperVillain.ColorGradient, + ColorGradient = oUF_Villain.ColorGradient, }; --[[ ########################################################## @@ -1203,27 +1205,27 @@ GROUP CONFIG VISIBILITY local function SetProxyEnv() if(_PROXY ~= nil) then return end _PROXY = setmetatable(_ENV, {__index = _G, __newindex = function(_,key,value) _G[key]=value end}); - tags['name:color'] = oUF_SuperVillain.Tags.Methods['name:color'] + tags['name:color'] = oUF_Villain.Tags.Methods['name:color'] for i=1, 30 do - tags['name:'..i] = oUF_SuperVillain.Tags.Methods['name:'..i] + tags['name:'..i] = oUF_Villain.Tags.Methods['name:'..i] end - tags['name:grid'] = oUF_SuperVillain.Tags.Methods['name:grid'] - tags['health:color'] = oUF_SuperVillain.Tags.Methods['health:color'] - tags['health:current'] = oUF_SuperVillain.Tags.Methods['health:current'] - tags['health:deficit'] = oUF_SuperVillain.Tags.Methods['health:deficit'] - tags['health:curpercent'] = oUF_SuperVillain.Tags.Methods['health:curpercent'] - tags['health:curmax'] = oUF_SuperVillain.Tags.Methods['health:curmax'] - tags['health:curmax-percent'] = oUF_SuperVillain.Tags.Methods['health:curmax-percent'] - tags['health:max'] = oUF_SuperVillain.Tags.Methods['health:max'] - tags['health:percent'] = oUF_SuperVillain.Tags.Methods['health:percent'] - tags['power:color'] = oUF_SuperVillain.Tags.Methods['power:color'] - tags['power:current'] = oUF_SuperVillain.Tags.Methods['power:current'] - tags['power:deficit'] = oUF_SuperVillain.Tags.Methods['power:deficit'] - tags['power:curpercent'] = oUF_SuperVillain.Tags.Methods['power:curpercent'] - tags['power:curmax'] = oUF_SuperVillain.Tags.Methods['power:curmax'] - tags['power:curmax-percent'] = oUF_SuperVillain.Tags.Methods['power:curmax-percent'] - tags['power:max'] = oUF_SuperVillain.Tags.Methods['power:max'] - tags['power:percent'] = oUF_SuperVillain.Tags.Methods['power:percent'] + tags['name:grid'] = oUF_Villain.Tags.Methods['name:grid'] + tags['health:color'] = oUF_Villain.Tags.Methods['health:color'] + tags['health:current'] = oUF_Villain.Tags.Methods['health:current'] + tags['health:deficit'] = oUF_Villain.Tags.Methods['health:deficit'] + tags['health:curpercent'] = oUF_Villain.Tags.Methods['health:curpercent'] + tags['health:curmax'] = oUF_Villain.Tags.Methods['health:curmax'] + tags['health:curmax-percent'] = oUF_Villain.Tags.Methods['health:curmax-percent'] + tags['health:max'] = oUF_Villain.Tags.Methods['health:max'] + tags['health:percent'] = oUF_Villain.Tags.Methods['health:percent'] + tags['power:color'] = oUF_Villain.Tags.Methods['power:color'] + tags['power:current'] = oUF_Villain.Tags.Methods['power:current'] + tags['power:deficit'] = oUF_Villain.Tags.Methods['power:deficit'] + tags['power:curpercent'] = oUF_Villain.Tags.Methods['power:curpercent'] + tags['power:curmax'] = oUF_Villain.Tags.Methods['power:curmax'] + tags['power:curmax-percent'] = oUF_Villain.Tags.Methods['power:curmax-percent'] + tags['power:max'] = oUF_Villain.Tags.Methods['power:max'] + tags['power:percent'] = oUF_Villain.Tags.Methods['power:percent'] end local function ChangeGroupIndex(self) @@ -1268,7 +1270,7 @@ function MOD:UpdateGroupConfig(headerFrame, setForced) SetProxyEnv() local key = headerFrame.___groupkey - local db = MOD.db[key] + local db = self.db[key] headerFrame.forceShow = setForced; headerFrame.forceShowAuras = setForced; headerFrame.isForced = setForced; @@ -1289,7 +1291,10 @@ function MOD:UpdateGroupConfig(headerFrame, setForced) definedEnvs[func] = nil end RegisterStateDriver(headerFrame, "visibility", db.visibility) - headerFrame:GetScript("OnEvent")(headerFrame, "PLAYER_ENTERING_WORLD") + local eventScript = headerFrame:GetScript("OnEvent") + if eventScript then + eventScript(headerFrame, "PLAYER_ENTERING_WORLD") + end end for i = 1, #headerFrame.groups do @@ -1311,7 +1316,7 @@ function MOD:UpdateGroupConfig(headerFrame, setForced) groupFrame:SetAttribute(attr, true) end - MOD:RestrictChildren(groupFrame, groupFrame:GetChildren()) + self:RestrictChildren(groupFrame, groupFrame:GetChildren()) groupFrame:SetAttribute("startingIndex", 1) groupFrame:Update() end @@ -1353,9 +1358,9 @@ end function MOD:KillBlizzardRaidFrames() if InCombatLockdown() then return end - CompactRaidFrameManager:MUNG() - CompactRaidFrameContainer:MUNG() - CompactUnitFrameProfiles:MUNG() + CompactRaidFrameManager:Die() + CompactRaidFrameContainer:Die() + CompactUnitFrameProfiles:Die() local crfmTest = CompactRaidFrameManager_GetSetting("IsShown") if crfmTest and crfmTest ~= "0" then CompactRaidFrameManager_SetSetting("IsShown","0") @@ -1384,7 +1389,7 @@ end function MOD:ADDON_LOADED(event, addon) self:KillBlizzardRaidFrames() if addon == 'Blizzard_ArenaUI' then - oUF_SuperVillain:DisableBlizzard('arena') + oUF_Villain:DisableBlizzard('arena') self:UnregisterEvent("ADDON_LOADED") end end @@ -1402,22 +1407,22 @@ BUILD FUNCTION / UPDATE ########################################################## ]]-- function MOD:ReLoad() - if(not SuperVillain.db.SVUnit.enable) then return end + if(not SV.db.SVUnit.enable) then return end self:RefreshUnitFrames() end function MOD:Load() - if(not SuperVillain.db.SVUnit.enable) then return end + if(not SV.db.SVUnit.enable) then return end self:RefreshUnitColors() - local SVUI_UnitFrameParent = CreateFrame("Frame", "SVUI_UnitFrameParent", SuperVillain.UIParent, "SecureHandlerStateTemplate") + local SVUI_UnitFrameParent = CreateFrame("Frame", "SVUI_UnitFrameParent", SV.UIParent, "SecureHandlerStateTemplate") RegisterStateDriver(SVUI_UnitFrameParent, "visibility", "[petbattle] hide; show") self:FrameForge() self:RegisterEvent("PLAYER_ENTERING_WORLD") self:RegisterEvent("PLAYER_REGEN_DISABLED") - if(SuperVillain.db.SVUnit.disableBlizzard) then + if(SV.db.SVUnit.disableBlizzard) then self:KillBlizzardRaidFrames() NewHook("CompactUnitFrame_RegisterEvents", CompactUnitFrame_UnregisterEvents) NewHook("UnitFrameThreatIndicator_Initialize", UnitFrameThreatIndicator_Hook) @@ -1444,7 +1449,7 @@ function MOD:Load() if not IsAddOnLoaded("Blizzard_ArenaUI") then self:RegisterEvent("ADDON_LOADED") else - oUF_SuperVillain:DisableBlizzard("arena") + oUF_Villain:DisableBlizzard("arena") end self:RegisterEvent("GROUP_ROSTER_UPDATE", "KillBlizzardRaidFrames") @@ -1464,4 +1469,4 @@ end DEFINE CONFIG AND REGISTER ########################################################## ]]-- -SuperVillain.Registry:NewPackage(MOD, "SVUnit") \ No newline at end of file +Registry:NewPackage(MOD, "SVUnit") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/config.lua b/Interface/AddOns/SVUI/packages/unit/config.lua index 897661f..043e8ff 100644 --- a/Interface/AddOns/SVUI/packages/unit/config.lua +++ b/Interface/AddOns/SVUI/packages/unit/config.lua @@ -25,8 +25,8 @@ local select = _G.select; GET ADDON DATA AND TEST FOR oUF ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local CONFIGS = SuperVillain.Configs +local SV, L = unpack(select(2, ...)); +local CONFIGS = SV.Configs --[[ ########################################################## LOCALS @@ -277,7 +277,6 @@ CONFIGS["SVUnit"] = { ["predict"] = false, ["smartAuraDisplay"] = "DISABLED", ["middleClickFocus"] = true, - ["gps"] = true, ["formatting"] = { ["power_colored"] = true, ["power_type"] = "none", @@ -1595,7 +1594,6 @@ CONFIGS["SVUnit"] = { ["colorOverride"] = "USE_DEFAULT", ["width"] = 70, ["height"] = 70, - ["gps"] = true, ["gridAllowed"] = true, ["formatting"] = { ["power_colored"] = true, @@ -1773,7 +1771,6 @@ CONFIGS["SVUnit"] = { ["colorOverride"] = "USE_DEFAULT", ["width"] = 75, ["height"] = 34, - ["gps"] = false, ["gridAllowed"] = true, ["formatting"] = { ["power_colored"] = true, @@ -1924,7 +1921,6 @@ CONFIGS["SVUnit"] = { ["colorOverride"] = "USE_DEFAULT", ["width"] = 50, ["height"] = 30, - ["gps"] = false, ["gridAllowed"] = true, ["formatting"] = { ["power_colored"] = true, @@ -2074,7 +2070,6 @@ CONFIGS["SVUnit"] = { ["colorOverride"] = "USE_DEFAULT", ["width"] = 50, ["height"] = 30, - ["gps"] = false, ["gridAllowed"] = true, ["formatting"] = { ["power_colored"] = true, diff --git a/Interface/AddOns/SVUI/packages/unit/elements/auras.lua b/Interface/AddOns/SVUI/packages/unit/elements/auras.lua index 32a36fe..e5ae83c 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/auras.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/auras.lua @@ -40,14 +40,14 @@ local tremove, tsort, twipe = table.remove, table.sort, table.wipe; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(select(2, ...)); +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ... -local oUF_SuperVillain = ns.oUF +local oUF_Villain = ns.oUF --[[ MUNGLUNCH"s FASTER ASSERT FUNCTION ]]-- local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF."); +assert(oUF_Villain, "SVUI was unable to locate oUF."); local CustomAuraFilter,CustomBarFilter; local AURA_FONT = [[Interface\AddOns\SVUI\assets\fonts\Display.ttf]]; @@ -83,8 +83,8 @@ local AuraRemover_OnClick = function(self) if not IsShiftKeyDown() then return end local name = self.name; if name then - SuperVillain:AddonMessage((L["The spell '%s' has been added to the Blocked unitframe aura filter."]):format(name)) - SuperVillain.db.filter["Blocked"][name] = {["enable"] = true, ["priority"] = 0} + SV:AddonMessage((L["The spell '%s' has been added to the Blocked unitframe aura filter."]):format(name)) + SV.db.filter["Blocked"][name] = {["enable"] = true, ["priority"] = 0} MOD:RefreshUnitFrames() end end @@ -93,8 +93,8 @@ local AuraBarRemover_OnClick = function(self) if not IsShiftKeyDown() then return end local name = self:GetParent().aura.name if name then - SuperVillain:AddonMessage((L["The spell '%s' has been added to the Blocked unitframe aura filter."]):format(name)) - SuperVillain.db.filter["Blocked"][name] = {["enable"] = true, ["priority"] = 0} + SV:AddonMessage((L["The spell '%s' has been added to the Blocked unitframe aura filter."]):format(name)) + SV.db.filter["Blocked"][name] = {["enable"] = true, ["priority"] = 0} MOD:RefreshUnitFrames() end end @@ -147,10 +147,10 @@ local ColorizeAuraBars = function(self) local color local spellName = auraBar.statusBar.aura.name; local spellID = auraBar.statusBar.aura.spellID; - if(SuperVillain.db.filter["Shield"][spellName]) then - color = oUF_SuperVillain.colors.shield_bars - elseif(SuperVillain.db.media.unitframes.spellcolor[spellName]) then - color = SuperVillain.db.media.unitframes.spellcolor[spellName] + if(SV.db.filter["Shield"][spellName]) then + color = oUF_Villain.colors.shield_bars + elseif(SV.db.media.unitframes.spellcolor[spellName]) then + color = SV.db.media.unitframes.spellcolor[spellName] end if color then auraBar.statusBar:SetStatusBarColor(unpack(color)) @@ -164,24 +164,26 @@ end local UpdateAuraTimer = function(self, elapsed) self.expiration = self.expiration - elapsed; - if(self.nextUpdate > 0) then - self.nextUpdate = self.nextUpdate - elapsed; - return - end - if(self.expiration <= 0) then + + if(self.expiration <= 0) then self:SetScript("OnUpdate", nil) if(self.text:GetFont()) then self.text:SetText("") end return - end + end + + if(self.nextUpdate > 0) then + self.nextUpdate = self.nextUpdate - elapsed; + return + end local expires = self.expiration; local calc, timeLeft = 0, 0; local timeFormat; if expires < 60 then - if expires >= 4 then + if expires >= 4 then timeLeft = floor(expires) timeFormat = "|cffffff00%d|r" self.nextUpdate = 0.51 @@ -222,7 +224,7 @@ local PostUpdateAuraIcon = function(self, unit, button, index, offset) button.icon:SetDesaturated((unit and not unit:find('arena%d')) and true or false) else local color = DebuffTypeColor[dtype] or DebuffTypeColor.none - if (name == "Unstable Affliction" or name == "Vampiric Touch") and SuperVillain.class ~= "WARLOCK" then + if (name == "Unstable Affliction" or name == "Vampiric Touch") and SV.class ~= "WARLOCK" then button:SetBackdropBorderColor(0.05, 0.85, 0.94) else button:SetBackdropBorderColor(color.r * 0.6, color.g * 0.6, color.b * 0.6) @@ -245,13 +247,12 @@ local PostUpdateAuraIcon = function(self, unit, button, index, offset) button.spell = name button.isStealable = isStealable if expiration and duration ~= 0 then - if not button:GetScript('OnUpdate') then + if(not button:GetScript('OnUpdate')) then button.expirationTime = expiration button.expiration = expiration - GetTime() button.nextUpdate = -1 button:SetScript('OnUpdate', UpdateAuraTimer) - end - if button.expirationTime ~= expiration then + elseif(button.expirationTime ~= expiration) then button.expirationTime = expiration button.expiration = expiration - GetTime() button.nextUpdate = -1 @@ -284,7 +285,7 @@ do CustomAuraFilter = function(self, unit, icon, name, _, _, _, debuffType, duration, _, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossAura) local db = MOD.db[self.db] local auraType = self.type; - if(not auraType) then return true end; + if(not auraType) then return true end if((not db) or (db and not db[auraType]) or (spellID == 65148)) then return false; end @@ -300,7 +301,7 @@ do icon.name = name; icon.priority = 0; - local shieldSpell = SuperVillain.db.filter["Shield"][name] + local shieldSpell = SV.db.filter["Shield"][name] if shieldSpell and shieldSpell.enable then icon.priority = shieldSpell.priority end @@ -315,7 +316,7 @@ do pass = true end if _test(auraDB.filterDispellable, friendly) then - if (auraType == "buffs" and not isStealable) or (auraType == "debuffs" and debuffType and not SuperVillain.Dispellable[debuffType]) or debuffType == nil then + if (auraType == "buffs" and not isStealable) or (auraType == "debuffs" and debuffType and not SV.Dispellable[debuffType]) or debuffType == nil then filtered = false end pass = true @@ -331,14 +332,14 @@ do pass = true end if _test(auraDB.filterBlocked, friendly) then - local blackListSpell = SuperVillain.db.filter["Blocked"][name] + local blackListSpell = SV.db.filter["Blocked"][name] if blackListSpell and blackListSpell.enable then filtered = false end pass = true end if _test(auraDB.filterAllowed, friendly) then - local whiteListSpell = SuperVillain.db.filter["Allowed"][name] + local whiteListSpell = SV.db.filter["Allowed"][name] if whiteListSpell and whiteListSpell.enable then filtered = true; icon.priority = whiteListSpell.priority @@ -348,8 +349,8 @@ do pass = true end local active = auraDB.useFilter - if active and active ~= "" and SuperVillain.db.filter[active] then - local spellDB = SuperVillain.db.filter[active]; + if active and active ~= "" and SV.db.filter[active] then + local spellDB = SV.db.filter[active]; if active ~= "Blocked" then if spellDB[name] and spellDB[name].enable and fromPlayer then filtered = true; @@ -390,7 +391,7 @@ do pass = true end if _test(barDB.filterDispellable, friendly) then - if (debuffType and not SuperVillain.Dispellable[debuffType]) or debuffType == nil then + if (debuffType and not SV.Dispellable[debuffType]) or debuffType == nil then filtered = false end pass = true @@ -406,12 +407,12 @@ do pass = true end if _test(barDB.filterBlocked, friendly) then - local blackList = SuperVillain.db.filter["Blocked"][name] + local blackList = SV.db.filter["Blocked"][name] if blackList and blackList.enable then filtered = false end pass = true end if _test(barDB.filterAllowed, friendly) then - local whiteList = SuperVillain.db.filter["Allowed"][name] + local whiteList = SV.db.filter["Allowed"][name] if whiteList and whiteList.enable then filtered = true elseif not pass then @@ -420,8 +421,8 @@ do pass = true end local active = barDB.useFilter - if active and active ~= "" and SuperVillain.db.filter[active] then - local spellsDB = SuperVillain.db.filter[active]; + if active and active ~= "" and SV.db.filter[active] then + local spellsDB = SV.db.filter[active]; if active ~= "Blocked" then if spellsDB[name] and spellsDB[name].enable and fromPlayer then filtered = true @@ -449,7 +450,7 @@ function MOD:CreateBuffs(frame, unit) aura.CustomFilter = CustomAuraFilter; aura:SetFrameLevel(10) aura.type = "buffs" - aura.textFont = SuperVillain.Shared:Fetch("font", MOD.db.auraFont) + aura.textFont = SV.Shared:Fetch("font", MOD.db.auraFont) aura.textSize = MOD.db.auraFontSize aura.textOutline = MOD.db.auraFontOutline return aura @@ -464,7 +465,7 @@ function MOD:CreateDebuffs(frame, unit) aura.CustomFilter = CustomAuraFilter; aura.type = "debuffs" aura:SetFrameLevel(10) - aura.textFont = SuperVillain.Shared:Fetch("font", MOD.db.auraFont) + aura.textFont = SV.Shared:Fetch("font", MOD.db.auraFont) aura.textSize = MOD.db.auraFontSize aura.textOutline = MOD.db.auraFontOutline return aura @@ -490,9 +491,9 @@ function MOD:CreateAuraBarHeader(frame, unitName) auraBarParent.spark = true; auraBarParent.filter = CustomBarFilter; auraBarParent.PostUpdate = ColorizeAuraBars; - auraBarParent.barTexture = SuperVillain.Shared:Fetch("statusbar", MOD.db.auraBarStatusbar) - auraBarParent.timeFont = SuperVillain.Shared:Fetch("font", "Roboto") - auraBarParent.textFont = SuperVillain.Shared:Fetch("font", MOD.db.auraFont) + auraBarParent.barTexture = SV.Shared:Fetch("statusbar", MOD.db.auraBarStatusbar) + auraBarParent.timeFont = SV.Shared:Fetch("font", "Roboto") + auraBarParent.textFont = SV.Shared:Fetch("font", MOD.db.auraFont) auraBarParent.textSize = MOD.db.auraFontSize auraBarParent.textOutline = MOD.db.auraFontOutline return auraBarParent @@ -527,7 +528,7 @@ function MOD:SmartAuraDisplay() if buffs:IsShown() then buffs:ClearAllPoints() - SuperVillain:ReversePoint(buffs, db.buffs.anchorPoint, self, db.buffs.xOffset, db.buffs.yOffset) + SV:ReversePoint(buffs, db.buffs.anchorPoint, self, db.buffs.xOffset, db.buffs.yOffset) if db.aurabar.attachTo ~= 'FRAME' then bars:ClearAllPoints() bars:SetPoint('BOTTOMLEFT', buffs, 'TOPLEFT', 0, 1) @@ -537,7 +538,7 @@ function MOD:SmartAuraDisplay() if debuffs:IsShown() then debuffs:ClearAllPoints() - SuperVillain:ReversePoint(debuffs, db.debuffs.anchorPoint, self, db.debuffs.xOffset, db.debuffs.yOffset) + SV:ReversePoint(debuffs, db.debuffs.anchorPoint, self, db.debuffs.xOffset, db.debuffs.yOffset) if db.aurabar.attachTo ~= 'FRAME' then bars:ClearAllPoints() bars:SetPoint('BOTTOMLEFT', debuffs, 'TOPLEFT', 0, 1) @@ -567,7 +568,7 @@ function MOD:UpdateAuraWatch(frame, key, override) local bwSize = db.size; if key == "pet" and not override then - local petBW = SuperVillain.db.filter["PetBuffWatch"] + local petBW = SV.db.filter["PetBuffWatch"] if(petBW) then for _, buff in pairs(petBW)do if buff.style == "text" then @@ -577,7 +578,7 @@ function MOD:UpdateAuraWatch(frame, key, override) end end else - local unitBW = SuperVillain.db.filter["BuffWatch"] + local unitBW = SV.db.filter["BuffWatch"] if(unitBW) then for _, buff in pairs(unitBW)do if buff.style == "text" then @@ -604,7 +605,7 @@ function MOD:UpdateAuraWatch(frame, key, override) end end - local fontFile = SuperVillain.Shared:Fetch("font", self.db.auraFont) + local fontFile = SV.Shared:Fetch("font", self.db.auraFont) local fontSize = self.db.auraFontSize local fontOutline = self.db.auraFontOutline diff --git a/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua b/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua index 2e02985..e13c52a 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua @@ -40,14 +40,14 @@ local tremove, tcopy, twipe, tsort, tconcat = table.remove, table.copy, table.wi GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(select(2, ...)); +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ... -local oUF_SuperVillain = ns.oUF +local oUF_Villain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF."); +assert(oUF_Villain, "SVUI was unable to locate oUF."); --[[ ########################################################## LOCAL VARIABLES @@ -57,7 +57,7 @@ local ticks = {} local function SpellName(id) local name, _, _, _, _, _, _, _, _ = GetSpellInfo(id) if not name then - SuperVillain:Debugger('|cffFF9900SVUI:|r Spell not found: (#ID) '..id) + SV:Debugger('|cffFF9900SVUI:|r Spell not found: (#ID) '..id) name = "Voodoo Doll"; end return name @@ -121,7 +121,7 @@ local function SetCastTicks(bar,count,mod) for i=1,count do if not ticks[i] then ticks[i] = bar:CreateTexture(nil,'OVERLAY') - ticks[i]:SetTexture(SuperVillain.Media.bar.lazer) + ticks[i]:SetTexture(SV.Media.bar.lazer) ticks[i]:SetVertexColor(0,0,0,0.8) ticks[i]:Width(1) ticks[i]:SetHeight(bar:GetHeight()) @@ -215,7 +215,7 @@ local function SetCastbarFading(frame, castbar, texture) fader.mask:SetBackdropColor(0, 0, 0, 0) fader.mask:SetAlpha(0) fader.txt = fader:CreateFontString(nil, "OVERLAY") - fader.txt:SetFont(SuperVillain.Media.font.alert, 16) + fader.txt:SetFont(SV.Media.font.alert, 16) fader.txt:SetAllPoints(fader) fader.txt:SetJustifyH("CENTER") fader.txt:SetJustifyV("CENTER") @@ -446,7 +446,7 @@ local CustomChannelUpdate = function(self, unit, index, hasTicks) end local CustomInterruptible = function(self, unit, useClass) - local colors = oUF_SuperVillain.colors + local colors = oUF_Villain.colors local r, g, b = self.CastColor[1], self.CastColor[2], self.CastColor[3] if useClass then local colorOverride; @@ -480,7 +480,7 @@ BUILD FUNCTION ########################################################## ]]-- function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss) - local colors = oUF_SuperVillain.colors; + local colors = oUF_Villain.colors; local castbar = CreateFrame("StatusBar", nil, frame) castbar.OnUpdate = CustomCastBarUpdate; castbar.CustomDelayText = CustomCastDelayText; @@ -523,19 +523,19 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss) local hadouken = CreateFrame("Frame", nil, castbar) if ryu then - castbar.Time:SetFont(SuperVillain.Media.font.numbers, 12, "OUTLINE") + castbar.Time:SetFont(SV.Media.font.numbers, 12, "OUTLINE") castbar.Time:SetShadowOffset(1, -1) castbar.Time:SetTextColor(1, 1, 1) - castbar.Text:SetFont(SuperVillain.Media.font.alert, 13, "OUTLINE") + castbar.Text:SetFont(SV.Media.font.alert, 13, "OUTLINE") castbar.Text:SetShadowOffset(1, -1) castbar.Text:SetTextColor(1, 1, 1) - castbar:SetStatusBarTexture(SuperVillain.Media.bar.lazer) + castbar:SetStatusBarTexture(SV.Media.bar.lazer) bgFrame:FillInner(castbar, -2, 10) bgFrame:SetFrameLevel(bgFrame:GetFrameLevel() - 1) - castbar.LatencyTexture:SetTexture(SuperVillain.Media.bar.lazer) + castbar.LatencyTexture:SetTexture(SV.Media.bar.lazer) castbar.noupdate = true; castbar.pewpew = true hadouken.iscustom = true; @@ -560,7 +560,7 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss) hadouken[1].overlay:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Castbar\\SKULLS-REVERSED") hadouken[1].overlay:SetVertexColor(1, 1, 1) - SuperVillain.Animate:Sprite(hadouken[1],false,false,true) + SV.Animate:Sprite(hadouken[1],false,false,true) hadouken[2] = hadouken:CreateTexture(nil, "ARTWORK") hadouken[2]:FillInner(hadouken, 4, 4) @@ -575,7 +575,7 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss) hadouken[2].overlay:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Castbar\\CHANNEL-REVERSED") hadouken[2].overlay:SetVertexColor(1, 1, 1) - SuperVillain.Animate:Sprite(hadouken[2],false,false,true) + SV.Animate:Sprite(hadouken[2],false,false,true) castbar:Point("BOTTOMLEFT", castbarHolder, "BOTTOMLEFT", 1, 1) iconHolder:Point("LEFT", castbar, "RIGHT", 4, 0) @@ -596,7 +596,7 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss) hadouken[1].overlay:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Castbar\\HADOUKEN") hadouken[1].overlay:SetVertexColor(1, 1, 1) - SuperVillain.Animate:Sprite(hadouken[1],false,false,true) + SV.Animate:Sprite(hadouken[1],false,false,true) hadouken[2] = hadouken:CreateTexture(nil, "ARTWORK") hadouken[2]:FillInner(hadouken, 4, 4) @@ -611,7 +611,7 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss) hadouken[2].overlay:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Castbar\\CHANNEL") hadouken[2].overlay:SetVertexColor(1, 1, 1) - SuperVillain.Animate:Sprite(hadouken[2],false,false,true) + SV.Animate:Sprite(hadouken[2],false,false,true) castbar:Point("BOTTOMRIGHT", castbarHolder, "BOTTOMRIGHT", -1, 1) iconHolder:Point("RIGHT", castbar, "LEFT", -4, 0) @@ -626,13 +626,13 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss) castbar.Text:SetPoint("CENTER", castbar, "CENTER", 0, 0) castbar.Text:SetJustifyH("CENTER") else - castbar.Time:SetFont(SuperVillain.Media.font.roboto, 11) + castbar.Time:SetFont(SV.Media.font.roboto, 11) castbar.Time:SetShadowOffset(1, -1) castbar.Time:SetTextColor(1, 1, 1, 0.9) castbar.Time:SetPoint("RIGHT", castbar, "LEFT", -1, 0) castbar.Time:SetJustifyH("RIGHT") - castbar.Text:SetFont(SuperVillain.Media.font.roboto, 11) + castbar.Text:SetFont(SV.Media.font.roboto, 11) castbar.Text:SetShadowOffset(1, -1) castbar.Text:SetTextColor(1, 1, 1, 0.9) castbar.Text:Point("CENTER", castbar, "CENTER", 0, 0) @@ -640,14 +640,14 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss) castbar.pewpew = false - castbar:SetStatusBarTexture(SuperVillain.Media.bar.glow) + castbar:SetStatusBarTexture(SV.Media.bar.glow) castbarHolder:Point("TOP", frame, "BOTTOM", 0, -4) castbar:FillInner(castbarHolder, 2, 2) bgFrame:SetAllPoints(castbarHolder) bgFrame:SetFrameLevel(bgFrame:GetFrameLevel() - 1) - castbar.LatencyTexture:SetTexture(SuperVillain.Media.bar.default) + castbar.LatencyTexture:SetTexture(SV.Media.bar.default) if reversed then castbar:SetReverseFill(true) @@ -659,7 +659,7 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss) castbar.bg = bgFrame:CreateTexture(nil, "BACKGROUND") castbar.bg:SetAllPoints(bgFrame) - castbar.bg:SetTexture(SuperVillain.Media.bar.default) + castbar.bg:SetTexture(SV.Media.bar.default) castbar.bg:SetVertexColor(0,0,0,0.5) local borderB = bgFrame:CreateTexture(nil,"OVERLAY") @@ -692,15 +692,15 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss) castbar.Spark = hadouken; castbar.Holder = castbarHolder; - castbar.CastColor = oUF_SuperVillain.colors.casting - castbar.SparkColor = oUF_SuperVillain.colors.spark + castbar.CastColor = oUF_Villain.colors.casting + castbar.SparkColor = oUF_Villain.colors.spark if moverName then - SuperVillain:SetSVMovable(castbar.Holder, moverName, nil, -6, nil, "ALL, SOLO") + SV:SetSVMovable(castbar.Holder, moverName, nil, -6, nil, "ALL, SOLO") end if useFader then - SetCastbarFading(frame, castbar, SuperVillain.Media.bar.lazer) + SetCastbarFading(frame, castbar, SV.Media.bar.lazer) end castbar.TimeFormat = "REMAINING" diff --git a/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua b/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua index 426dbbc..bbd9019 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua @@ -28,14 +28,14 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(select(2, ...)); +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ... -local oUF_SuperVillain = ns.oUF +local oUF_Villain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF."); +assert(oUF_Villain, "SVUI was unable to locate oUF."); --[[ ########################################################## LOCALS @@ -206,7 +206,7 @@ local function CreateThreat(frame, unit) aggro.bg = aggro:CreateTexture(nil, "BORDER") aggro.bg:FillInner(aggro) aggro.bg:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\UNIT-AGGRO") - SuperVillain.Animate:Pulse(aggro) + SV.Animate:Pulse(aggro) aggro:Hide() aggro:SetScript("OnShow", OhShit_OnShow) @@ -306,13 +306,17 @@ local function CreateNameText(frame, unitName) db = MOD.db[unitName].name end local name = frame:CreateFontString(nil, "OVERLAY") - name:SetFont(SuperVillain.Shared:Fetch("font", db.font), db.fontSize, db.fontOutline) + name:SetFont(SV.Shared:Fetch("font", db.font), db.fontSize, db.fontOutline) name:SetShadowOffset(2, -2) 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 @@ -335,7 +339,8 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) bg:SetGradientAlpha("VERTICAL", 0, 0, 0, 0, 0, 0, 0, 0.7) frame.InfoPanel = CreateFrame("Frame", nil, info) - frame.InfoPanel:SetFrameStrata("MEDIUM") + frame.InfoPanel:SetFrameStrata("LOW") + frame.InfoPanel:SetFrameLevel(20) frame.InfoPanel:SetAllPoints(info) if(unit == "target") then @@ -378,7 +383,7 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) stunned:SetSize(96, 96) stunned:SetTexture(STUNNED_ANIM) stunned:SetBlendMode("ADD") - SuperVillain.Animate:Sprite(stunned, 0.12, false, true) + SV.Animate:Sprite(stunned, 0.12, false, true) stunned:Hide() frame.LossOfControl.stunned = stunned @@ -396,10 +401,10 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) else frame.ActionPanel = CreateActionPanel(frame, 2) frame.InfoPanel = CreateFrame("Frame", nil, frame) - frame.InfoPanel:SetFrameStrata("MEDIUM") + frame.InfoPanel:SetFrameStrata("LOW") + frame.InfoPanel:SetFrameLevel(20) frame.InfoPanel:Point("TOPLEFT", frame.ActionPanel, "TOPLEFT", 2, -2) frame.InfoPanel:Point("BOTTOMRIGHT", frame.ActionPanel, "BOTTOMRIGHT", -2, 2) - frame.InfoPanel:SetFrameLevel(frame.InfoPanel:GetFrameLevel() + 30) end frame.InfoPanel.Name = CreateNameText(frame.InfoPanel, unit) @@ -409,7 +414,7 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) if(not noHealthText) then frame.InfoPanel.Health = frame.InfoPanel:CreateFontString(nil, "OVERLAY") - frame.InfoPanel.Health:SetFont(SuperVillain.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + frame.InfoPanel.Health:SetFont(SV.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) offset = reverse and 2 or -2; direction = reverse and "LEFT" or "RIGHT"; frame.InfoPanel.Health:Point(direction, frame.InfoPanel, direction, offset, 0) @@ -417,7 +422,7 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) if(not noPowerText) then frame.InfoPanel.Power = frame.InfoPanel:CreateFontString(nil, "OVERLAY") - frame.InfoPanel.Power:SetFont(SuperVillain.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + frame.InfoPanel.Power:SetFont(SV.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) offset = reverse and -2 or 2; direction = reverse and "RIGHT" or "LEFT"; frame.InfoPanel.Power:Point(direction, frame.InfoPanel, direction, offset, 0) @@ -425,7 +430,7 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) if(not noMiscText) then frame.InfoPanel.Misc = frame.InfoPanel:CreateFontString(nil, "OVERLAY") - frame.InfoPanel.Misc:SetFont(SuperVillain.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + frame.InfoPanel.Misc:SetFont(SV.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) frame.InfoPanel.Misc:Point("CENTER", frame, "CENTER", 0, 0) end @@ -460,7 +465,7 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) -- frame.StatusPanel.texture:SetAlpha(0) frame.StatusPanel:SetFrameStrata("LOW") - frame.StatusPanel:SetFrameLevel(20) + frame.StatusPanel:SetFrameLevel(28) end --[[ ########################################################## @@ -471,11 +476,11 @@ function MOD:CreateHealthBar(frame, hasbg, reverse) local healthBar = CreateFrame("StatusBar", nil, frame) healthBar:SetFrameStrata("LOW") healthBar:SetFrameLevel(4) - healthBar:SetStatusBarTexture(SuperVillain.Media.bar.default) + healthBar:SetStatusBarTexture(SV.Media.bar.default) if hasbg then healthBar.bg = healthBar:CreateTexture(nil, "BORDER") healthBar.bg:SetAllPoints() - healthBar.bg:SetTexture(SuperVillain.Media.bar.gradient) + healthBar.bg:SetTexture(SV.Media.bar.gradient) healthBar.bg:SetVertexColor(0.4, 0.1, 0.1) healthBar.bg.multiplier = 0.25 end @@ -552,6 +557,8 @@ function MOD:CreatePowerBar(frame, bg) local power = CreateFrame("StatusBar", nil, frame) power:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) power:SetPanelTemplate("Bar") + power:SetFrameStrata("LOW") + power:SetFrameLevel(6) if bg then power.bg = power:CreateTexture(nil, "BORDER") power.bg:SetAllPoints() @@ -569,11 +576,12 @@ function MOD:CreateAltPowerBar(frame) altPower:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) altPower:SetPanelTemplate("Bar") altPower:GetStatusBarTexture():SetHorizTile(false) - altPower:SetFrameStrata("MEDIUM") + altPower:SetFrameStrata("LOW") + altPower:SetFrameLevel(8) altPower.text = altPower:CreateFontString(nil, "OVERLAY") altPower.text:SetPoint("CENTER") altPower.text:SetJustifyH("CENTER") - altPower.text:SetFont(SuperVillain.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + altPower.text:SetFont(SV.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) altPower.PostUpdate = PostUpdateAltPower; return altPower end @@ -587,15 +595,15 @@ function MOD:PostUpdatePower(unit, value, max) powerType = random(0, 4) self:SetValue(value) end - local colors = oUF_SuperVillain.colors.power[token[powerType]] + local colors = oUF_Villain.colors.power[token[powerType]] local mult = self.bg.multiplier or 1; local isPlayer = UnitPlayerControlled(unit) if isPlayer and self.colorClass then local _, class = UnitClassBase(unit); - colors = oUF_SuperVillain["colors"].class[class] + colors = oUF_Villain["colors"].class[class] elseif not isPlayer then local react = UnitReaction("player", unit) - colors = oUF_SuperVillain["colors"].reaction[react] + colors = oUF_Villain["colors"].reaction[react] end if not colors then return end self:SetStatusBarColor(colors[1], colors[2], colors[3]) @@ -616,7 +624,7 @@ function MOD:CreatePortrait(frame,smallUnit,isPlayer) portrait3D:SetPanelTemplate("UnitSmall") else portrait3D:SetPanelTemplate("UnitLarge") - end; + end local overlay = CreateFrame("Frame",nil,portrait3D) overlay:SetAllPoints(portrait3D.Panel) @@ -638,7 +646,7 @@ function MOD:CreatePortrait(frame,smallUnit,isPlayer) portrait2Danchor:SetFixedPanelTemplate("UnitSmall") else portrait2Danchor:SetFixedPanelTemplate("UnitLarge") - end; + end portrait2D.Panel = portrait2Danchor.Panel; local overlay = CreateFrame("Frame",nil,portrait2Danchor) diff --git a/Interface/AddOns/SVUI/packages/unit/elements/misc.lua b/Interface/AddOns/SVUI/packages/unit/elements/misc.lua index 0dbf2a3..a2b59fd 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/misc.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/misc.lua @@ -13,14 +13,14 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(select(2, ...)); +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ... -local oUF_SuperVillain = ns.oUF +local oUF_Villain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF."); +assert(oUF_Villain, "SVUI was unable to locate oUF."); --[[ ########################################################## LOCAL VARIABLES @@ -264,40 +264,6 @@ function MOD:RaidRoleUpdate() end end end - -function MOD:CreateGPS(frame, small) - if not frame then return end - local size = 32 - local gps = CreateFrame("Frame", nil, frame.InfoPanel) - gps:SetFrameLevel(99) - gps:Size(size, size) - gps.DefaultSize = size - if(small) then - gps.onMouseOver = true - gps.OnlyProximity = false - gps:Point("RIGHT", frame, "RIGHT", 0, 0) - else - gps.onMouseOver = false - gps.OnlyProximity = false - gps:Point("BOTTOMLEFT", frame.Health, "BOTTOMLEFT", 0, 0) - gps.Text = gps:CreateFontString(nil, "OVERLAY") - gps.Text:SetAllPoints(frame.InfoPanel) - - gps.Text:SetFont(SuperVillain.Media.font.roboto, 10) - gps.Text:SetJustifyH("CENTER") - gps.Text:SetJustifyV("MIDDLE") - gps.Text:SetTextColor(1, 1, 1, 0.5) - end - - gps.Arrow = gps:CreateTexture(nil, "OVERLAY", nil, 7) - gps.Arrow:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\GPS-ARROW]]) - gps.Arrow:Size(size, size) - gps.Arrow:SetPoint("CENTER", gps, "CENTER", 0, 0) - gps.Arrow:SetVertexColor(0.1, 0.8, 0.8) - gps.Arrow:SetBlendMode("ADD") - - return gps -end --[[ ########################################################## PLAYER ONLY COMPONENTS @@ -326,7 +292,7 @@ function MOD:CreateCombatIndicator(frame) combat.bg:SetAllPoints(combat) combat.bg:SetTexture(STATE_ICON_FILE) combat.bg:SetTexCoord(0,0.5,0,0.5) - SuperVillain.Animate:Pulse(combat) + SV.Animate:Pulse(combat) combat:SetScript("OnShow", function(this) if not this.anim:IsPlaying() then this.anim:Play() end end) @@ -356,13 +322,13 @@ function MOD:CreateExperienceRepBar(frame) xp.Rested:SetStatusBarColor(1, 0, 1, 0.6) xp.Value = xp:CreateFontString(nil, "TOOLTIP") xp.Value:SetAllPoints(xp) - xp.Value:SetFontTemplate(SuperVillain.Media.font.roboto, 10, "NONE") + xp.Value:SetFontTemplate(SV.Media.font.roboto, 10, "NONE") xp.Value:SetTextColor(0.2, 0.75, 1) xp.Value:SetShadowColor(0, 0, 0, 0) xp.Value:SetShadowOffset(0, 0) frame:Tag(xp.Value, "[curxp] / [maxxp]") xp.Rested:SetBackdrop({bgFile = [[Interface\BUTTONS\WHITE8X8]]}) - xp.Rested:SetBackdropColor(unpack(SuperVillain.Media.color.default)) + xp.Rested:SetBackdropColor(unpack(SV.Media.color.default)) xp:SetScript("OnEnter", ExRep_OnEnter) xp:SetScript("OnLeave", ExRep_OnLeave) xp:SetAlpha(0) @@ -380,7 +346,7 @@ function MOD:CreateExperienceRepBar(frame) rep.Tooltip = true; rep.Value = rep:CreateFontString(nil, "TOOLTIP") rep.Value:SetAllPoints(rep) - rep.Value:SetFontTemplate(SuperVillain.Media.font.roboto, 10, "NONE") + rep.Value:SetFontTemplate(SV.Media.font.roboto, 10, "NONE") rep.Value:SetTextColor(0.1, 1, 0.2) rep.Value:SetShadowColor(0, 0, 0, 0) rep.Value:SetShadowOffset(0, 0) @@ -560,7 +526,7 @@ function MOD:CreateHealPrediction(frame, fullSet) local absorbBar = CreateFrame('StatusBar', nil, health) absorbBar:SetFrameStrata("LOW") absorbBar:SetFrameLevel(7) - absorbBar:SetStatusBarTexture(SuperVillain.Media.bar.gradient) + absorbBar:SetStatusBarTexture(SV.Media.bar.gradient) absorbBar:SetStatusBarColor(1, 1, 0, 0.5) local healPrediction = { @@ -575,10 +541,10 @@ function MOD:CreateHealPrediction(frame, fullSet) local healAbsorbBar = CreateFrame('StatusBar', nil, health) healAbsorbBar:SetFrameStrata("LOW") healAbsorbBar:SetFrameLevel(9) - healAbsorbBar:SetStatusBarTexture(SuperVillain.Media.bar.gradient) + healAbsorbBar:SetStatusBarTexture(SV.Media.bar.gradient) healAbsorbBar:SetStatusBarColor(0.5, 0.2, 1, 0.9) healPrediction["healAbsorbBar"] = healAbsorbBar; end return healPrediction -end; \ No newline at end of file +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/elements/tags.lua b/Interface/AddOns/SVUI/packages/unit/elements/tags.lua index c957aad..a77812a 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/tags.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/tags.lua @@ -30,12 +30,12 @@ local twipe = table.wipe; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SV, L = unpack(select(2, ...)); local _, ns = ... -local oUF_SuperVillain = ns.oUF +local oUF_Villain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") +assert(oUF_Villain, "SVUI was unable to locate oUF.") --[[ ########################################################## LOCAL VARIABLES @@ -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 @@ -192,7 +192,7 @@ end local function UnitName(unit) local name = _G.UnitName(unit) - if name == UNKNOWN and SuperVillain.class == "MONK" and UnitIsUnit(unit, "pet") then + if name == UNKNOWN and SV.class == "MONK" and UnitIsUnit(unit, "pet") then name = ("%s\'s Spirit"):format(_G.UnitName("player")) else return name @@ -203,38 +203,40 @@ end TAG EVENTS ########################################################## ]]-- -oUF_SuperVillain.Tags.Events["name:color"] = "UNIT_NAME_UPDATE"; +oUF_Villain.Tags.Events["name:color"] = "UNIT_NAME_UPDATE"; for i = 1, 30 do - oUF_SuperVillain.Tags.Events["name:"..i] = "UNIT_NAME_UPDATE"; + oUF_Villain.Tags.Events["name:"..i] = "UNIT_NAME_UPDATE"; end -oUF_SuperVillain.Tags.Events["name:level"] = "UNIT_LEVEL PLAYER_LEVEL_UP PLAYER_FLAGS_CHANGED"; -oUF_SuperVillain.Tags.Events["name:grid"] = "UNIT_NAME_UPDATE"; +oUF_Villain.Tags.Events["name:level"] = "UNIT_LEVEL PLAYER_LEVEL_UP PLAYER_FLAGS_CHANGED"; +oUF_Villain.Tags.Events["name:grid"] = "UNIT_NAME_UPDATE"; -oUF_SuperVillain.Tags.Events["health:color"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"; -oUF_SuperVillain.Tags.Events["health:deficit"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"; -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:percent"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"; +oUF_Villain.Tags.Events["health:color"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"; +oUF_Villain.Tags.Events["health:deficit"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"; +oUF_Villain.Tags.Events["health:current"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"; +oUF_Villain.Tags.Events["health:curmax"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"; +oUF_Villain.Tags.Events["health:curpercent"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"; +oUF_Villain.Tags.Events["health:curmax-percent"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"; +oUF_Villain.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"; -oUF_SuperVillain.Tags.Events["power:deficit"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER"; -oUF_SuperVillain.Tags.Events["power:current"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER"; -oUF_SuperVillain.Tags.Events["power:curmax"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER"; -oUF_SuperVillain.Tags.Events["power:curpercent"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER"; -oUF_SuperVillain.Tags.Events["power:percent"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER"; +oUF_Villain.Tags.Events["power:color"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER"; +oUF_Villain.Tags.Events["power:deficit"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER"; +oUF_Villain.Tags.Events["power:current"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER"; +oUF_Villain.Tags.Events["power:curmax"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER"; +oUF_Villain.Tags.Events["power:curpercent"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER"; +oUF_Villain.Tags.Events["power:curmax-percent"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER"; +oUF_Villain.Tags.Events["power:percent"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER"; -oUF_SuperVillain.Tags.Events["absorbs"] = "UNIT_ABSORB_AMOUNT_CHANGED"; -oUF_SuperVillain.Tags.Events["incoming"] = "UNIT_HEAL_PREDICTION"; -oUF_SuperVillain.Tags.Events["classpower"] = "UNIT_POWER PLAYER_TALENT_UPDATE UPDATE_SHAPESHIFT_FORM"; -oUF_SuperVillain.Tags.Events["altpower"] = "UNIT_POWER UNIT_MAXPOWER"; -oUF_SuperVillain.Tags.Events["threat"] = "UNIT_THREAT_LIST_UPDATE GROUP_ROSTER_UPDATE"; +oUF_Villain.Tags.Events["absorbs"] = "UNIT_ABSORB_AMOUNT_CHANGED"; +oUF_Villain.Tags.Events["incoming"] = "UNIT_HEAL_PREDICTION"; +oUF_Villain.Tags.Events["classpower"] = "UNIT_POWER PLAYER_TALENT_UPDATE UPDATE_SHAPESHIFT_FORM"; +oUF_Villain.Tags.Events["altpower"] = "UNIT_POWER UNIT_MAXPOWER"; +oUF_Villain.Tags.Events["threat"] = "UNIT_THREAT_LIST_UPDATE GROUP_ROSTER_UPDATE"; --[[ ########################################################## NAME TAG METHODS ########################################################## ]]-- -oUF_SuperVillain.Tags.Methods["name:color"] = function(unit) +oUF_Villain.Tags.Methods["name:color"] = function(unit) local unitReaction = UnitReaction(unit, "player") local _, classToken = UnitClass(unit) if UnitIsPlayer(unit) then @@ -242,7 +244,7 @@ oUF_SuperVillain.Tags.Methods["name:color"] = function(unit) if not class then return "" end return Hex(class.r, class.g, class.b) elseif unitReaction then - local reaction = oUF_SuperVillain["colors"].reaction[unitReaction] + local reaction = oUF_Villain["colors"].reaction[unitReaction] return Hex(reaction[1], reaction[2], reaction[3]) else return "|cFFC2C2C2" @@ -250,14 +252,14 @@ oUF_SuperVillain.Tags.Methods["name:color"] = function(unit) end for i = 1, 30 do - oUF_SuperVillain.Tags.Methods["name:"..i] = function(unit) + oUF_Villain.Tags.Methods["name:"..i] = function(unit) local name = UnitName(unit) local result = (name ~= nil) and (TrimTagText(name, i).."|r ") or "" return result end end -oUF_SuperVillain.Tags.Methods["name:level"] = function(unit) +oUF_Villain.Tags.Methods["name:level"] = function(unit) local afk, dnd, c = UnitIsAFK(unit), UnitIsDND(unit), UnitClassification(unit) local r, g, b, color = 0.55, 0.57, 0.61; local hexString = ""; @@ -295,7 +297,7 @@ oUF_SuperVillain.Tags.Methods["name:level"] = function(unit) return ("%s%s|r"):format(hexString, levelString) end -oUF_SuperVillain.Tags.Methods["name:grid"] = function(unit) +oUF_Villain.Tags.Methods["name:grid"] = function(unit) local name = UnitName(unit) if not name then return "" end local unitReaction = UnitReaction(unit, "player") @@ -307,7 +309,7 @@ oUF_SuperVillain.Tags.Methods["name:grid"] = function(unit) result = Hex(class.r, class.g, class.b) end elseif unitReaction then - local reaction = oUF_SuperVillain["colors"].reaction[unitReaction] + local reaction = oUF_Villain["colors"].reaction[unitReaction] result = Hex(reaction[1], reaction[2], reaction[3]) end name = TrimTagText(name, 4) @@ -320,32 +322,34 @@ end HEALTH TAG METHODS ########################################################## ]]-- -oUF_SuperVillain.Tags.Methods["health:color"] = function(f) +oUF_Villain.Tags.Methods["health:color"] = function(f) if UnitIsDeadOrGhost(f) or not UnitIsConnected(f)then return Hex(0.84, 0.75, 0.65) else - local r, g, b = oUF_SuperVillain.ColorGradient(UnitHealth(f), UnitHealthMax(f), 0.89, 0.21, 0.21, 0.85, 0.53, 0.25, 0.23, 0.89, 0.33) + local r, g, b = oUF_Villain.ColorGradient(UnitHealth(f), UnitHealthMax(f), 0.89, 0.21, 0.21, 0.85, 0.53, 0.25, 0.23, 0.89, 0.33) return Hex(r, g, b) end end -oUF_SuperVillain.Tags.Methods["health:current"] = 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", UnitHealth(f), UnitHealthMax(f))end end +oUF_Villain.Tags.Methods["health:current"] = 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", UnitHealth(f), UnitHealthMax(f))end end -oUF_SuperVillain.Tags.Methods["health:curmax"] = 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", UnitHealth(f), UnitHealthMax(f))end end +oUF_Villain.Tags.Methods["health:curmax"] = 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", UnitHealth(f), UnitHealthMax(f))end end -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_Villain.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: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_Villain.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: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 +oUF_Villain.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_Villain.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 --[[ ########################################################## POWER TAG METHODS ########################################################## ]]-- -oUF_SuperVillain.Tags.Methods["power:color"] = function(f) +oUF_Villain.Tags.Methods["power:color"] = function(f) local j, k, l, m, n = UnitPowerType(f) - local o = oUF_SuperVillain["colors"].power[k] + local o = oUF_Villain["colors"].power[k] if o then return Hex(o[1], o[2], o[3]) else @@ -353,21 +357,23 @@ oUF_SuperVillain.Tags.Methods["power:color"] = function(f) end end -oUF_SuperVillain.Tags.Methods["power:current"] = function(f)local j = UnitPowerType(f)local p = UnitPower(f, j)return p == 0 and" "or SetTagStyle("CURRENT", p, UnitPowerMax(f, j))end +oUF_Villain.Tags.Methods["power:current"] = function(f)local j = UnitPowerType(f)local p = UnitPower(f, j)return p == 0 and" "or SetTagStyle("CURRENT", p, UnitPowerMax(f, j))end + +oUF_Villain.Tags.Methods["power:curmax"] = function(f)local j = UnitPowerType(f)local p = UnitPower(f, j)return p == 0 and" "or SetTagStyle("CURRENT_MAX", p, UnitPowerMax(f, j))end -oUF_SuperVillain.Tags.Methods["power:curmax"] = function(f)local j = UnitPowerType(f)local p = UnitPower(f, j)return p == 0 and" "or SetTagStyle("CURRENT_MAX", p, UnitPowerMax(f, j))end +oUF_Villain.Tags.Methods["power:curpercent"] = function(f)local j = UnitPowerType(f)local p = UnitPower(f, j)return p == 0 and" "or SetTagStyle("CURRENT_PERCENT", p, UnitPowerMax(f, j))end -oUF_SuperVillain.Tags.Methods["power:curpercent"] = function(f)local j = UnitPowerType(f)local p = UnitPower(f, j)return p == 0 and" "or SetTagStyle("CURRENT_PERCENT", p, UnitPowerMax(f, j))end +oUF_Villain.Tags.Methods["power:curmax-percent"] = function(f)local j = UnitPowerType(f)local p = UnitPower(f, j)return p == 0 and" "or SetTagStyle("CURRENT_PERCENT", p, UnitPowerMax(f, j))end -oUF_SuperVillain.Tags.Methods["power:percent"] = function(f)local j = UnitPowerType(f)local p = UnitPower(f, j)return p == 0 and" "or SetTagStyle("PERCENT", p, UnitPowerMax(f, j))end +oUF_Villain.Tags.Methods["power:percent"] = function(f)local j = UnitPowerType(f)local p = UnitPower(f, j)return p == 0 and" "or SetTagStyle("PERCENT", p, UnitPowerMax(f, j))end -oUF_SuperVillain.Tags.Methods["power:deficit"] = function(f)local j = UnitPowerType(f)return SetTagStyle("DEFICIT", UnitPower(f, j), UnitPowerMax(f, j), r, g, b)end +oUF_Villain.Tags.Methods["power:deficit"] = function(f)local j = UnitPowerType(f)return SetTagStyle("DEFICIT", UnitPower(f, j), UnitPowerMax(f, j), r, g, b)end --[[ ########################################################## MISC TAG METHODS ########################################################## ]]-- -oUF_SuperVillain.Tags.Methods["absorbs"] = function(unit) +oUF_Villain.Tags.Methods["absorbs"] = function(unit) local asrb = UnitGetTotalAbsorbs(unit) or 0; if asrb == 0 then return " " @@ -377,7 +383,7 @@ oUF_SuperVillain.Tags.Methods["absorbs"] = function(unit) end end -oUF_SuperVillain.Tags.Methods["incoming"] = function(unit) +oUF_Villain.Tags.Methods["incoming"] = function(unit) local fromPlayer = UnitGetIncomingHeals(unit, "player") or 0; local fromOthers = UnitGetIncomingHeals(unit) or 0; local amt = fromPlayer + fromOthers; @@ -389,7 +395,7 @@ oUF_SuperVillain.Tags.Methods["incoming"] = function(unit) end end -oUF_SuperVillain.Tags.Methods["threat"] = function(unit) +oUF_Villain.Tags.Methods["threat"] = function(unit) if UnitCanAttack("player", unit)then local status, threat = select(2, UnitDetailedThreatSituation("player", unit)) if status then @@ -400,8 +406,8 @@ oUF_SuperVillain.Tags.Methods["threat"] = function(unit) return " " end -oUF_SuperVillain.Tags.Methods["classpower"] = function() - local currentPower, maxPower, r, g, b = GetClassPower(SuperVillain.class) +oUF_Villain.Tags.Methods["classpower"] = function() + local currentPower, maxPower, r, g, b = GetClassPower(SV.class) if currentPower == 0 then return " " else @@ -411,7 +417,7 @@ oUF_SuperVillain.Tags.Methods["classpower"] = function() end end -oUF_SuperVillain.Tags.Methods["altpower"] = function(unit) +oUF_Villain.Tags.Methods["altpower"] = function(unit) local power = UnitPower(unit, ALTERNATE_POWER_INDEX) if(power > 0) then local texture, r, g, b = UnitAlternatePowerTextureInfo(unit, 2) @@ -425,7 +431,7 @@ oUF_SuperVillain.Tags.Methods["altpower"] = function(unit) end end -oUF_SuperVillain.Tags.Methods["pvptimer"] = function(unit) +oUF_Villain.Tags.Methods["pvptimer"] = function(unit) if UnitIsPVPFreeForAll(unit) or UnitIsPVP(unit)then local clock = GetPVPTimer() if clock ~= 301000 and clock ~= -1 then @@ -438,91 +444,4 @@ oUF_SuperVillain.Tags.Methods["pvptimer"] = function(unit) else return "" end -end; ---[[ -########################################################## -GROUP TAG HANDLER -########################################################## -]]-- -local taggedUnits = {} -local groupTagManager = CreateFrame("Frame") -groupTagManager:RegisterEvent("GROUP_ROSTER_UPDATE") -groupTagManager:SetScript("OnEvent", function() - local group, count; - twipe(taggedUnits) - if IsInRaid() then - group = "raid" - count = GetNumGroupMembers() - elseif IsInGroup() then - group = "party" - count = GetNumGroupMembers() - 1; - taggedUnits["player"] = true - else - group = "solo" - count = 1 - end - for i = 1, count do - local realName = group..i; - if not UnitIsUnit(realName, "player") then - taggedUnits[realName] = true - end - end -end); - -oUF_SuperVillain.Tags.OnUpdateThrottle['nearbyplayers:8'] = 0.25 -oUF_SuperVillain.Tags.Methods["nearbyplayers:8"] = function(unit) - local unitsInRange, distance = 0; - if UnitIsConnected(unit)then - for taggedUnit, _ in pairs(taggedUnits)do - if not UnitIsUnit(unit, taggedUnit) and UnitIsConnected(taggedUnit)then - distance = SuperVillain:Triangulate(unit, taggedUnit, true) - if distance and distance <= 8 then - unitsInRange = unitsInRange + 1 - end - end - end - end - return unitsInRange -end - -oUF_SuperVillain.Tags.OnUpdateThrottle['nearbyplayers:10'] = 0.25 -oUF_SuperVillain.Tags.Methods["nearbyplayers:10"] = function(unit) - local unitsInRange, distance = 0; - if UnitIsConnected(unit)then - for taggedUnit, _ in pairs(taggedUnits)do - if not UnitIsUnit(unit, taggedUnit) and UnitIsConnected(taggedUnit)then - distance = SuperVillain:Triangulate(unit, taggedUnit, true) - if distance and distance <= 10 then - unitsInRange = unitsInRange + 1 - end - end - end - end - return unitsInRange -end - -oUF_SuperVillain.Tags.OnUpdateThrottle['nearbyplayers:30'] = 0.25 -oUF_SuperVillain.Tags.Methods["nearbyplayers:30"] = function(unit) - local unitsInRange, distance = 0; - if UnitIsConnected(unit)then - for taggedUnit, _ in pairs(taggedUnits)do - if not UnitIsUnit(unit, taggedUnit) and UnitIsConnected(taggedUnit)then - distance = SuperVillain:Triangulate(unit, taggedUnit, true) - if distance and distance <= 30 then - unitsInRange = unitsInRange + 1 - end - end - end - end - return unitsInRange -end - -oUF_SuperVillain.Tags.OnUpdateThrottle['distance'] = 0.25 -oUF_SuperVillain.Tags.Methods["distance"] = function(unit) - if not UnitIsConnected(unit) or UnitIsUnit(unit, "player")then return "" end - local dst = SuperVillain:Triangulate("player", unit, true) - if dst and dst > 0 then - return format("%d", dst) - end - return "" -end \ No newline at end of file +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/frames.lua b/Interface/AddOns/SVUI/packages/unit/frames.lua index 02825c6..f90b17c 100644 --- a/Interface/AddOns/SVUI/packages/unit/frames.lua +++ b/Interface/AddOns/SVUI/packages/unit/frames.lua @@ -29,20 +29,20 @@ local find, format, upper = string.find, string.format, string.upper; local match, gsub = string.match, string.gsub; local numMin = math.min; -local SuperVillain, L = unpack(select(2, ...)); +local SV, L = unpack(select(2, ...)); local _, ns = ... -local oUF_SuperVillain = ns.oUF +local oUF_Villain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") -local MOD = SuperVillain.SVUnit +assert(oUF_Villain, "SVUI was unable to locate oUF.") +local MOD = SV.SVUnit local ceil,tinsert = math.ceil,table.insert --[[ ########################################################## LOCAL DATA ########################################################## ]]-- -local CONSTRUCTORS, UPDATERS = {}, {} +local CONSTRUCTORS, GROUP_UPDATES = {}, {} local lastArenaFrame, lastBossFrame local sortMapping = { ["DOWN_RIGHT"] = {[1]="TOP",[2]="TOPLEFT",[3]="LEFT",[4]="RIGHT",[5]="LEFT",[6]=1,[7]=-1,[8]=false}, @@ -153,7 +153,7 @@ local UpdatePlayerFrame = function(self) MOD.RefreshUnitMedia(self, "player") - self.colors = oUF_SuperVillain.colors; + self.colors = oUF_Villain.colors; self:Size(UNIT_WIDTH, UNIT_HEIGHT) local lossSize = UNIT_WIDTH * 0.6 self.LossOfControl.stunned:SetSize(lossSize, lossSize) @@ -168,7 +168,7 @@ local UpdatePlayerFrame = function(self) local size = iconDB.restIcon.size; resting:ClearAllPoints() resting:Size(size) - SuperVillain:ReversePoint(resting, iconDB.restIcon.attachTo, healthPanel, iconDB.restIcon.xOffset, iconDB.restIcon.yOffset) + SV:ReversePoint(resting, iconDB.restIcon.attachTo, healthPanel, iconDB.restIcon.xOffset, iconDB.restIcon.yOffset) if not self:IsElementEnabled("Resting")then self:EnableElement("Resting") end @@ -185,7 +185,7 @@ local UpdatePlayerFrame = function(self) local size = iconDB.combatIcon.size; combat:ClearAllPoints() combat:Size(size) - SuperVillain:ReversePoint(combat, iconDB.combatIcon.attachTo, healthPanel, iconDB.combatIcon.xOffset, iconDB.combatIcon.yOffset) + SV:ReversePoint(combat, iconDB.combatIcon.attachTo, healthPanel, iconDB.combatIcon.xOffset, iconDB.combatIcon.yOffset) if not self:IsElementEnabled("Combat")then self:EnableElement("Combat") end @@ -203,7 +203,7 @@ local UpdatePlayerFrame = function(self) self:Tag(pvp, db.pvp.tags) end do - if SuperVillain.class == "DRUID" and self.DruidAltMana then + if SV.class == "DRUID" and self.DruidAltMana then if db.power.druidMana then self:EnableElement("DruidAltMana") else @@ -211,7 +211,7 @@ local UpdatePlayerFrame = function(self) self.DruidAltMana:Hide() end end - if SuperVillain.class == "MONK" then + if SV.class == "MONK" then local stagger = self.DrunkenMaster; if db.stagger.enable then if not self:IsElementEnabled("DrunkenMaster")then @@ -288,9 +288,8 @@ local UpdatePlayerFrame = function(self) end self:UpdateAllElements() end -UPDATERS["player"] = UpdatePlayerFrame -local ConstructPlayer = function(self, unit) +CONSTRUCTORS["player"] = function(self, unit) local key = "player" self.unit = unit self.___key = key @@ -314,20 +313,19 @@ local ConstructPlayer = function(self, unit) self.Resting = MOD:CreateRestingIndicator(self) self.Combat = MOD:CreateCombatIndicator(self) self.PvPText = self.InfoPanel:CreateFontString(nil,'OVERLAY') - self.PvPText:SetFontTemplate(SuperVillain.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + self.PvPText:SetFontTemplate(SV.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) self.Afflicted = MOD:CreateAfflicted(self) self.HealPrediction = MOD:CreateHealPrediction(self, true) self.AuraBars = MOD:CreateAuraBarHeader(self, key) self.CombatFade = true; - self:Point("BOTTOMLEFT", SuperVillain.UIParent, "BOTTOM", -413, 182) - SuperVillain:SetSVMovable(self, L["Player Frame"], nil, nil, nil, "ALL, SOLO") + self:Point("BOTTOMLEFT", SV.UIParent, "BOTTOM", -413, 182) + SV:SetSVMovable(self, L["Player Frame"], nil, nil, nil, "ALL, SOLO") self.MediaUpdate = MOD.RefreshUnitMedia self.Update = UpdatePlayerFrame return self end -CONSTRUCTORS["player"] = ConstructPlayer --[[ ########################################################## TARGET @@ -342,7 +340,7 @@ local UpdateTargetFrame = function(self) self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, "target") - self.colors = oUF_SuperVillain.colors; + self.colors = oUF_Villain.colors; self:Size(UNIT_WIDTH, UNIT_HEIGHT) _G[self:GetName().."_MOVE"]:Size(self:GetSize()) if not self:IsElementEnabled("ActionPanel")then @@ -359,7 +357,7 @@ local UpdateTargetFrame = function(self) self.XRay:Hide() end - if not IsAddOnLoaded("Clique")then + if(not IsAddOnLoaded("Clique")) then if db.middleClickFocus then self:SetAttribute("type3", "focus") elseif self:GetAttribute("type3") == "focus"then @@ -367,7 +365,7 @@ local UpdateTargetFrame = function(self) end end - if (SuperVillain.class == "ROGUE" or SuperVillain.class == "DRUID") and self.HyperCombo then + if (SV.class == "ROGUE" or SV.class == "DRUID") and self.HyperCombo then local comboBar = self.HyperCombo; if self.ComboRefresh then self.ComboRefresh(self) @@ -375,7 +373,7 @@ local UpdateTargetFrame = function(self) if db.combobar.autoHide then comboBar:SetParent(self) else - comboBar:SetParent(SuperVillain.UIParent) + comboBar:SetParent(SV.UIParent) end if comboBar.Avatar then @@ -393,7 +391,6 @@ local UpdateTargetFrame = function(self) self:UpdateAllElements() end -UPDATERS["target"] = UpdateTargetFrame CONSTRUCTORS["target"] = function(self, unit) local key = "target" @@ -426,19 +423,19 @@ CONSTRUCTORS["target"] = function(self, unit) self.RaidIcon = MOD:CreateRaidIcon(self) local isSmall = MOD.db[key].combobar.smallIcons - if(SuperVillain.class == "ROGUE") then + if(SV.class == "ROGUE") then self.HyperCombo = MOD:CreateRogueCombobar(self, isSmall) - elseif(SuperVillain.class == "DRUID") then + elseif(SV.class == "DRUID") then self.HyperCombo = MOD:CreateDruidCombobar(self, isSmall) end - self.GPS = MOD:CreateGPS(self) + --self.GPS = MOD:CreateGPS(self) self.Friendship = MOD:CreateFriendshipBar(self) self.Range = { insideAlpha = 1, outsideAlpha = 1 } self.XRay = MOD:CreateXRay(self) self.XRay:SetPoint("TOPRIGHT", 12, 12) - self:Point("BOTTOMRIGHT", SuperVillain.UIParent, "BOTTOM", 413, 182) - SuperVillain:SetSVMovable(self, L["Target Frame"], nil, nil, nil, "ALL, SOLO") + self:Point("BOTTOMRIGHT", SV.UIParent, "BOTTOM", 413, 182) + SV:SetSVMovable(self, L["Target Frame"], nil, nil, nil, "ALL, SOLO") self.MediaUpdate = MOD.RefreshUnitMedia self.Update = UpdateTargetFrame @@ -455,13 +452,12 @@ local UpdateTargetTargetFrame = function(self) local UNIT_HEIGHT = db.height self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, "targettarget") - self.colors = oUF_SuperVillain.colors; + self.colors = oUF_Villain.colors; self:Size(UNIT_WIDTH, UNIT_HEIGHT) _G[self:GetName().."_MOVE"]:Size(self:GetSize()) MOD:RefreshUnitLayout(self, "targettarget") self:UpdateAllElements() end -UPDATERS["targettarget"] = UpdateTargetTargetFrame CONSTRUCTORS["targettarget"] = function(self, unit) local key = "targettarget" @@ -480,8 +476,8 @@ CONSTRUCTORS["targettarget"] = function(self, unit) self.Debuffs = MOD:CreateDebuffs(self, key) self.RaidIcon = MOD:CreateRaidIcon(self) self.Range = { insideAlpha = 1, outsideAlpha = 1 } - self:Point("BOTTOM", SuperVillain.UIParent, "BOTTOM", 0, 213) - SuperVillain:SetSVMovable(self, L["TargetTarget Frame"], nil, nil, nil, "ALL, SOLO") + self:Point("BOTTOM", SV.UIParent, "BOTTOM", 0, 213) + SV:SetSVMovable(self, L["TargetTarget Frame"], nil, nil, nil, "ALL, SOLO") self.MediaUpdate = MOD.RefreshUnitMedia self.Update = UpdateTargetTargetFrame @@ -498,7 +494,7 @@ local UpdatePetFrame = function(self) local UNIT_HEIGHT = db.height; self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, "pet") - self.colors = oUF_SuperVillain.colors; + self.colors = oUF_Villain.colors; self:Size(UNIT_WIDTH, UNIT_HEIGHT) _G[self:GetName().."_MOVE"]:Size(self:GetSize()) MOD:RefreshUnitLayout(self, "pet") @@ -510,7 +506,6 @@ local UpdatePetFrame = function(self) MOD:UpdateAuraWatch(self, "pet") self:UpdateAllElements() end -UPDATERS["pet"] = UpdatePetFrame CONSTRUCTORS["pet"] = function(self, unit) local key = "pet" @@ -532,8 +527,8 @@ CONSTRUCTORS["pet"] = function(self, unit) self.AuraWatch = MOD:CreateAuraWatch(self, key) self.RaidIcon = MOD:CreateRaidIcon(self) self.Range = { insideAlpha = 1, outsideAlpha = 1 } - self:Point("BOTTOM", SuperVillain.UIParent, "BOTTOM", 0, 182) - SuperVillain:SetSVMovable(self, L["Pet Frame"], nil, nil, nil, "ALL, SOLO") + self:Point("BOTTOM", SV.UIParent, "BOTTOM", 0, 182) + SV:SetSVMovable(self, L["Pet Frame"], nil, nil, nil, "ALL, SOLO") self.MediaUpdate = MOD.RefreshUnitMedia self.Update = UpdatePetFrame return self @@ -549,7 +544,7 @@ local UpdatePetTargetFrame = function(self) local UNIT_HEIGHT = db.height; self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, "pettarget") - self.colors = oUF_SuperVillain.colors; + self.colors = oUF_Villain.colors; self:Size(UNIT_WIDTH, UNIT_HEIGHT) _G[self:GetName().."_MOVE"]:Size(self:GetSize()) MOD:RefreshUnitLayout(self, "pettarget") @@ -560,7 +555,6 @@ local UpdatePetTargetFrame = function(self) end self:UpdateAllElements() end -UPDATERS["pettarget"] = UpdatePetTargetFrame CONSTRUCTORS["pettarget"] = function(self, unit) local key = "pettarget" @@ -578,7 +572,7 @@ CONSTRUCTORS["pettarget"] = function(self, unit) self.Debuffs = MOD:CreateDebuffs(self, key) self.Range = { insideAlpha = 1, outsideAlpha = 1 } self:Point("BOTTOM", SVUI_Pet, "TOP", 0, 7) - SuperVillain:SetSVMovable(self, L["PetTarget Frame"], nil, -7, nil, "ALL, SOLO") + SV:SetSVMovable(self, L["PetTarget Frame"], nil, -7, nil, "ALL, SOLO") self.MediaUpdate = MOD.RefreshUnitMedia self.Update = UpdatePetTargetFrame @@ -595,7 +589,7 @@ local UpdateFocusFrame = function(self) local UNIT_HEIGHT = db.height; self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, "focus") - self.colors = oUF_SuperVillain.colors; + self.colors = oUF_Villain.colors; self:Size(UNIT_WIDTH, UNIT_HEIGHT) _G[self:GetName().."_MOVE"]:Size(self:GetSize()) MOD:RefreshUnitLayout(self, "focus") @@ -609,7 +603,6 @@ local UpdateFocusFrame = function(self) MOD:UpdateAuraWatch(self, "focus") self:UpdateAllElements() end -UPDATERS["focus"] = UpdateFocusFrame CONSTRUCTORS["focus"] = function(self, unit) local key = "focus" @@ -643,7 +636,7 @@ CONSTRUCTORS["focus"] = function(self, unit) self.XRay = MOD:CreateXRay_Closer(self) self.XRay:SetPoint("RIGHT", 20, 0) self:Point("BOTTOMRIGHT", SVUI_Target, "TOPRIGHT", 0, 220) - SuperVillain:SetSVMovable(self, L["Focus Frame"], nil, nil, nil, "ALL, SOLO") + SV:SetSVMovable(self, L["Focus Frame"], nil, nil, nil, "ALL, SOLO") self.MediaUpdate = MOD.RefreshUnitMedia self.Update = UpdateFocusFrame @@ -660,13 +653,12 @@ local UpdateFocusTargetFrame = function(self) local UNIT_HEIGHT = db.height; self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, "focustarget") - self.colors = oUF_SuperVillain.colors; + self.colors = oUF_Villain.colors; self:Size(UNIT_WIDTH, UNIT_HEIGHT) _G[self:GetName().."_MOVE"]:Size(self:GetSize()) MOD:RefreshUnitLayout(self, "focustarget") self:UpdateAllElements() end -UPDATERS["focustarget"] = UpdateFocusTargetFrame CONSTRUCTORS["focustarget"] = function(self, unit) local key = "focustarget" @@ -685,7 +677,7 @@ CONSTRUCTORS["focustarget"] = function(self, unit) self.RaidIcon = MOD:CreateRaidIcon(self) self.Range = { insideAlpha = 1, outsideAlpha = 1 } self:Point("BOTTOM", SVUI_Focus, "TOP", 0, 7) - SuperVillain:SetSVMovable(self, L["FocusTarget Frame"], nil, -7, nil, "ALL, SOLO") + SV:SetSVMovable(self, L["FocusTarget Frame"], nil, -7, nil, "ALL, SOLO") self.MediaUpdate = MOD.RefreshUnitMedia self.Update = UpdateFocusTargetFrame @@ -705,9 +697,10 @@ local UpdateBossFrame = function(self) MOD.RefreshUnitMedia(self, "boss") - self.colors = oUF_SuperVillain.colors; + self.colors = oUF_Villain.colors; self:Size(UNIT_WIDTH, UNIT_HEIGHT) self:ClearAllPoints() + if(tonumber(INDEX) == 1) then holder:Width(UNIT_WIDTH) holder:Height(UNIT_HEIGHT + (UNIT_HEIGHT + 12 + db.castbar.height) * 4) @@ -724,11 +717,11 @@ local UpdateBossFrame = function(self) self:Point("TOPRIGHT", holder, "TOPRIGHT", 0, -yOffset) end end + self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") MOD:RefreshUnitLayout(self, "boss") self:UpdateAllElements() end -UPDATERS["boss"] = UpdateBossFrame CONSTRUCTORS["boss"] = function(self, unit) local key = "boss" @@ -743,6 +736,7 @@ CONSTRUCTORS["boss"] = function(self, unit) MOD:SetActionPanel(self, key) self.Health = MOD:CreateHealthBar(self, true, true) + self.Health.frequentUpdates = true self.Power = MOD:CreatePowerBar(self, true, true) MOD:CreatePortrait(self) self.Buffs = MOD:CreateBuffs(self, key) @@ -755,8 +749,8 @@ CONSTRUCTORS["boss"] = function(self, unit) self:SetAttribute("type2", "focus") if(not _G["SVUI_Boss_MOVE"]) then - self:Point("RIGHT", SuperVillain.UIParent, "RIGHT", -105, 0) - SuperVillain:SetSVMovable(self, L["Boss Frames"], nil, nil, nil, "ALL, PARTY, RAID10, RAID25, RAID40", "SVUI_Boss") + self:Point("RIGHT", SV.UIParent, "RIGHT", -105, 0) + SV:SetSVMovable(self, L["Boss Frames"], nil, nil, nil, "ALL, PARTY, RAID10, RAID25, RAID40", "SVUI_Boss") else self:Point("TOPRIGHT", lastBossFrame, "BOTTOMRIGHT", 0, -20) end @@ -807,7 +801,7 @@ local function CreatePrepFrame(frameName, parentFrame, parentID) prep.SpecIcon = icon local text = prep.Health:CreateFontString(nil, "OVERLAY") - text:SetFont(SuperVillain.Media.font.names, 16, "OUTLINE") + text:SetFont(SV.Media.font.names, 16, "OUTLINE") text:SetTextColor(1, 1, 1) text:SetPoint("CENTER") prep.SpecClass = text @@ -824,7 +818,7 @@ local UpdateArenaFrame = function(self) MOD.RefreshUnitMedia(self, "arena") - self.colors = oUF_SuperVillain.colors; + self.colors = oUF_Villain.colors; self:Size(UNIT_WIDTH, UNIT_HEIGHT) self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") @@ -891,8 +885,7 @@ local UpdateArenaFrame = function(self) end self:UpdateAllElements() -end -UPDATERS["arena"] = UpdateArenaFrame +end CONSTRUCTORS["arena"] = function(self, unit) local key = "arena" @@ -923,8 +916,8 @@ CONSTRUCTORS["arena"] = function(self, unit) if(not _G[prepName]) then CreatePrepFrame(prepName, self, selfID) end if(not _G["SVUI_Arena_MOVE"]) then - self:Point("RIGHT", SuperVillain.UIParent, "RIGHT", -105, 0) - SuperVillain:SetSVMovable(self, L["Arena Frames"], nil, nil, nil, "ALL, ARENA", "SVUI_Arena") + self:Point("RIGHT", SV.UIParent, "RIGHT", -105, 0) + SV:SetSVMovable(self, L["Arena Frames"], nil, nil, nil, "ALL, ARENA", "SVUI_Arena") else self:Point("TOPRIGHT", lastArenaFrame, "BOTTOMRIGHT", 0, -20) end @@ -943,7 +936,7 @@ local ArenaPrepHandler = CreateFrame("Frame") local ArenaPrepHandler_OnEvent = function(self, event) local prepframe local _, instanceType = IsInInstance() - if(not SuperVillain.db.SVUnit.arena.enable or instanceType ~= "arena") then return end + if(not SV.db.SVUnit.arena.enable or instanceType ~= "arena") then return end if event == "PLAYER_LOGIN" then for i = 1, 5 do prepframe = _G["SVUI_Arena"..i.."PrepFrame"] @@ -1020,11 +1013,10 @@ function MOD:SetUnitFrame(key) local styleName = "SVUI_"..realName local frame if not self.Units[unit] then - oUF_SuperVillain:RegisterStyle(styleName, CONSTRUCTORS[key]) - oUF_SuperVillain:SetActiveStyle(styleName) - frame = oUF_SuperVillain:Spawn(unit, styleName) + oUF_Villain:RegisterStyle(styleName, CONSTRUCTORS[key]) + oUF_Villain:SetActiveStyle(styleName) + frame = oUF_Villain:Spawn(unit, styleName) self.Units[unit] = frame - self.Roster[#self.Roster+1] = styleName else frame = self.Units[unit] end @@ -1048,11 +1040,10 @@ function MOD:SetEnemyFrames(key, maxCount) local styleName = "SVUI_"..realName local frame if not self.Units[unit] then - oUF_SuperVillain:RegisterStyle(styleName, CONSTRUCTORS[key]) - oUF_SuperVillain:SetActiveStyle(styleName) - frame = oUF_SuperVillain:Spawn(unit, styleName) + oUF_Villain:RegisterStyle(styleName, CONSTRUCTORS[key]) + oUF_Villain:SetActiveStyle(styleName) + frame = oUF_Villain:Spawn(unit, styleName) self.Units[unit] = frame - self.Roster[#self.Roster+1] = styleName else frame = self.Units[unit] end @@ -1182,7 +1173,7 @@ local Raid40Visibility = function(self, event) end local UpdateRaidSubUnit = function(self, key, db) - self.colors = oUF_SuperVillain.colors; + self.colors = oUF_Villain.colors; self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(db) if not InCombatLockdown() then @@ -1212,12 +1203,12 @@ local UpdateRaidSubUnit = function(self, key, db) self:UpdateAllElements() end -local Raid10Update = function(self) +GROUP_UPDATES["raid10"] = function(self) local frame = self:GetParent() if not frame.positioned then frame:ClearAllPoints() - frame:Point("LEFT", SuperVillain.UIParent, "LEFT", 4, 0) - SuperVillain:SetSVMovable(frame, L["Raid 10 Frames"], nil, nil, nil, "ALL, RAID"..10) + frame:Point("LEFT", SV.UIParent, "LEFT", 4, 0) + SV:SetSVMovable(frame, L["Raid 10 Frames"], nil, nil, nil, "ALL, RAID"..10) frame:RegisterEvent("PLAYER_ENTERING_WORLD") frame:RegisterEvent("ZONE_CHANGED_NEW_AREA") frame:SetScript("OnEvent", Raid10Visibility) @@ -1240,14 +1231,13 @@ local Raid10Update = function(self) childFrame = self:GetAttribute("child"..index) end end -UPDATERS["raid10"] = Raid10Update -local Raid25Update = function(self) +GROUP_UPDATES["raid25"] = function(self) local frame = self:GetParent() if not frame.positioned then frame:ClearAllPoints() - frame:Point("LEFT", SuperVillain.UIParent, "LEFT", 4, 0) - SuperVillain:SetSVMovable(frame, L["Raid 25 Frames"], nil, nil, nil, "ALL, RAID"..25) + frame:Point("LEFT", SV.UIParent, "LEFT", 4, 0) + SV:SetSVMovable(frame, L["Raid 25 Frames"], nil, nil, nil, "ALL, RAID"..25) frame:RegisterEvent("PLAYER_ENTERING_WORLD") frame:RegisterEvent("ZONE_CHANGED_NEW_AREA") frame:SetScript("OnEvent", Raid25Visibility) @@ -1270,14 +1260,13 @@ local Raid25Update = function(self) childFrame = self:GetAttribute("child"..index) end end -UPDATERS["raid25"] = Raid25Update -local Raid40Update = function(self) +GROUP_UPDATES["raid40"] = function(self) local frame = self:GetParent() if not frame.positioned then frame:ClearAllPoints() - frame:Point("LEFT", SuperVillain.UIParent, "LEFT", 4, 0) - SuperVillain:SetSVMovable(frame, L["Raid 40 Frames"], nil, nil, nil, "ALL, RAID"..40) + frame:Point("LEFT", SV.UIParent, "LEFT", 4, 0) + SV:SetSVMovable(frame, L["Raid 40 Frames"], nil, nil, nil, "ALL, RAID"..40) frame:RegisterEvent("PLAYER_ENTERING_WORLD") frame:RegisterEvent("ZONE_CHANGED_NEW_AREA") frame:SetScript("OnEvent", Raid40Visibility) @@ -1300,7 +1289,6 @@ local Raid40Update = function(self) childFrame = self:GetAttribute("child"..index) end end -UPDATERS["raid40"] = Raid40Update local function SetRaidFrame(frame) frame:SetScript("OnEnter", UnitFrame_OnEnter) @@ -1352,7 +1340,6 @@ CONSTRUCTORS["raid10"] = function(self, unit) self.Buffs = MOD:CreateBuffs(self, key) self.Debuffs = MOD:CreateDebuffs(self, key) self.AuraWatch = MOD:CreateAuraWatch(self, key) - self.GPS = MOD:CreateGPS(self, true) return SetRaidFrame(self) end @@ -1367,7 +1354,6 @@ CONSTRUCTORS["raid25"] = function(self, unit) self.Buffs = MOD:CreateBuffs(self, key) self.Debuffs = MOD:CreateDebuffs(self, key) self.AuraWatch = MOD:CreateAuraWatch(self, key) - self.GPS = MOD:CreateGPS(self, true) return SetRaidFrame(self) end @@ -1382,7 +1368,6 @@ CONSTRUCTORS["raid40"] = function(self, unit) self.Buffs = MOD:CreateBuffs(self, key) self.Debuffs = MOD:CreateDebuffs(self, key) self.AuraWatch = MOD:CreateAuraWatch(self, key) - self.GPS = MOD:CreateGPS(self, true) return SetRaidFrame(self) end --[[ @@ -1409,12 +1394,12 @@ local RaidPetVisibility = function(self, event) end end -local UpdateRaidPetFrame = function(self) +GROUP_UPDATES["raidpet"] = function(self) local raidPets = self:GetParent() if not raidPets.positioned then raidPets:ClearAllPoints() - raidPets:Point("BOTTOMLEFT", SuperVillain.UIParent, "BOTTOMLEFT", 4, 433) - SuperVillain:SetSVMovable(raidPets, L["Raid Pet Frames"], nil, nil, nil, "ALL, RAID10, RAID25, RAID40") + raidPets:Point("BOTTOMLEFT", SV.UIParent, "BOTTOMLEFT", 4, 433) + SV:SetSVMovable(raidPets, L["Raid Pet Frames"], nil, nil, nil, "ALL, RAID10, RAID25, RAID40") raidPets.positioned = true; raidPets:RegisterEvent("PLAYER_ENTERING_WORLD") raidPets:RegisterEvent("ZONE_CHANGED_NEW_AREA") @@ -1437,7 +1422,6 @@ local UpdateRaidPetFrame = function(self) childFrame = self:GetAttribute("child"..index) end end -UPDATERS["raidpet"] = UpdateRaidPetFrame CONSTRUCTORS["raidpet"] = function(self, unit) local key = "raidpet" @@ -1473,6 +1457,7 @@ CONSTRUCTORS["raidpet"] = function(self, unit) shadow:Hide() self.TargetGlow = shadow tinsert(self.__elements, UpdateTargetGlow) + self:RegisterEvent("PLAYER_TARGET_CHANGED", UpdateTargetGlow) self:RegisterEvent("PLAYER_ENTERING_WORLD", UpdateTargetGlow) return self @@ -1502,7 +1487,7 @@ local PartyVisibility = function(self, event) end local UpdatePartySubUnit = function(self, key, db) - self.colors = oUF_SuperVillain.colors; + self.colors = oUF_Villain.colors; self:RegisterForClicks(MOD.db.fastClickTarget and 'AnyDown' or 'AnyUp') MOD.RefreshUnitMedia(self, key) if self.isChild then @@ -1520,9 +1505,9 @@ local UpdatePartySubUnit = function(self, key, db) self:SetParent(self.originalParent) self:Size(UNIT_WIDTH, UNIT_HEIGHT) self:ClearAllPoints() - SuperVillain:ReversePoint(self, altDB.anchorPoint, self.originalParent, altDB.xOffset, altDB.yOffset) + SV:ReversePoint(self, altDB.anchorPoint, self.originalParent, altDB.xOffset, altDB.yOffset) else - self:SetParent(SuperVillain.Cloaked) + self:SetParent(SV.Cloaked) end end do @@ -1553,12 +1538,12 @@ local UpdatePartySubUnit = function(self, key, db) self:UpdateAllElements() end -local UpdatePartyFrame = function(self) +GROUP_UPDATES["party"] = function(self) local group = self:GetParent() if not group.positioned then group:ClearAllPoints() - group:Point("LEFT",SuperVillain.UIParent,"LEFT",40,0) - SuperVillain:SetSVMovable(group, L['Party Frames'], nil, nil, nil, 'ALL,PARTY,ARENA'); + group:Point("LEFT",SV.UIParent,"LEFT",40,0) + SV:SetSVMovable(group, L['Party Frames'], nil, nil, nil, 'ALL,PARTY,ARENA'); group.positioned = true; group:RegisterEvent("PLAYER_ENTERING_WORLD") group:RegisterEvent("ZONE_CHANGED_NEW_AREA") @@ -1569,6 +1554,7 @@ local UpdatePartyFrame = function(self) local db = MOD.db[key] local index = 1; local childFrame = self:GetAttribute("child"..index) + while childFrame do UpdatePartySubUnit(childFrame, key, db) if(_G[childFrame:GetName().."Pet"]) then @@ -1581,7 +1567,6 @@ local UpdatePartyFrame = function(self) childFrame = self:GetAttribute("child"..index) end end -UPDATERS["party"] = UpdatePartyFrame CONSTRUCTORS["party"] = function(self, unit) local key = "party" @@ -1609,7 +1594,7 @@ CONSTRUCTORS["party"] = function(self, unit) self.RaidIcon = MOD:CreateRaidIcon(self) self.ReadyCheck = MOD:CreateReadyCheckIcon(self) self.HealPrediction = MOD:CreateHealPrediction(self) - self.GPS = MOD:CreateGPS(self, true) + --self.GPS = MOD:CreateGPS(self, true) local shadow = CreateFrame("Frame", nil, self) shadow:SetFrameLevel(1) @@ -1644,7 +1629,7 @@ TANK ########################################################## ]]-- local UpdateTankSubUnit = function(self, key, db) - self.colors = oUF_SuperVillain.colors; + self.colors = oUF_Villain.colors; self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, key) if self.isChild and self.originalParent then @@ -1659,9 +1644,9 @@ local UpdateTankSubUnit = function(self, key, db) self:SetParent(self.originalParent) self:Size(UNIT_WIDTH, UNIT_HEIGHT) self:ClearAllPoints() - SuperVillain:ReversePoint(self, targets.anchorPoint, self.originalParent, targets.xOffset, targets.yOffset) + SV:ReversePoint(self, targets.anchorPoint, self.originalParent, targets.xOffset, targets.yOffset) else - self:SetParent(SuperVillain.Cloaked) + self:SetParent(SV.Cloaked) end end elseif not InCombatLockdown() then @@ -1671,7 +1656,7 @@ local UpdateTankSubUnit = function(self, key, db) MOD:RefreshUnitLayout(self, key) do local nametext = self.InfoPanel.Name; - if oUF_SuperVillain.colors.healthclass then + if oUF_Villain.colors.healthclass then self:Tag(nametext, "[name:10]") else self:Tag(nametext, "[name:color][name:10]") @@ -1701,8 +1686,8 @@ local UpdateTankFrame = function(self) self:SetAttribute("yOffset", 7) if not self.positioned then self:ClearAllPoints() - self:Point("TOPLEFT", SuperVillain.UIParent, "TOPLEFT", 4, -40) - SuperVillain:SetSVMovable(self, L["Tank Frames"], nil, nil, nil, "ALL, RAID10, RAID25, RAID40") + self:Point("TOPLEFT", SV.UIParent, "TOPLEFT", 4, -40) + SV:SetSVMovable(self, L["Tank Frames"], nil, nil, nil, "ALL, RAID10, RAID25, RAID40") self.Avatar.positionOverride = "TOPLEFT" self:SetAttribute("minHeight", self.dirtyHeight) self:SetAttribute("minWidth", self.dirtyWidth) @@ -1719,7 +1704,6 @@ local UpdateTankFrame = function(self) end end end -UPDATERS["tank"] = UpdateTankFrame CONSTRUCTORS["tank"] = function(self, unit) local key = "tank" @@ -1743,7 +1727,7 @@ ASSIST ########################################################## ]]-- local UpdateAssistSubUnit = function(self, key, db) - self.colors = oUF_SuperVillain.colors; + self.colors = oUF_Villain.colors; self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, key) if self.isChild and self.originalParent then @@ -1758,9 +1742,9 @@ local UpdateAssistSubUnit = function(self, key, db) self:SetParent(self.originalParent) self:Size(UNIT_WIDTH, UNIT_HEIGHT) self:ClearAllPoints() - SuperVillain:ReversePoint(self, targets.anchorPoint, self.originalParent, targets.xOffset, targets.yOffset) + SV:ReversePoint(self, targets.anchorPoint, self.originalParent, targets.xOffset, targets.yOffset) else - self:SetParent(SuperVillain.Cloaked) + self:SetParent(SV.Cloaked) end end elseif not InCombatLockdown() then @@ -1772,7 +1756,7 @@ local UpdateAssistSubUnit = function(self, key, db) do local nametext = self.InfoPanel.Name; - if oUF_SuperVillain.colors.healthclass then + if oUF_Villain.colors.healthclass then self:Tag(nametext, "[name:10]") else self:Tag(nametext, "[name:color][name:10]") @@ -1797,8 +1781,8 @@ local UpdateAssistFrame = function(self) self:SetAttribute("yOffset", 7) if not self.positioned then self:ClearAllPoints() - self:Point("TOPLEFT", SuperVillain.UIParent, "TOPLEFT", 4, -140) - SuperVillain:SetSVMovable(self, L["Assist Frames"], nil, nil, nil, "ALL, RAID10, RAID25, RAID40") + self:Point("TOPLEFT", SV.UIParent, "TOPLEFT", 4, -140) + SV:SetSVMovable(self, L["Assist Frames"], nil, nil, nil, "ALL, RAID10, RAID25, RAID40") self.Avatar.positionOverride = "TOPLEFT" self:SetAttribute("minHeight", self.dirtyHeight) self:SetAttribute("minWidth", self.dirtyWidth) @@ -1815,7 +1799,6 @@ local UpdateAssistFrame = function(self) end end end -UPDATERS["assist"] = UpdateAssistFrame CONSTRUCTORS["assist"] = function(self, unit) local key = "assist" @@ -1835,56 +1818,6 @@ CONSTRUCTORS["assist"] = function(self, unit) end --[[ ########################################################## -SUBUNIT CONSTRUCTORS -########################################################## -]]-- -local SecureHeaderClear = function(self) - self:Hide() - self:SetAttribute("showPlayer", true) - self:SetAttribute("showSolo", true) - self:SetAttribute("showParty", true) - self:SetAttribute("showRaid", true) - self:SetAttribute("columnSpacing", nil) - self:SetAttribute("columnAnchorPoint", nil) - self:SetAttribute("sortMethod", nil) - self:SetAttribute("groupFilter", nil) - self:SetAttribute("groupingOrder", nil) - self:SetAttribute("maxColumns", nil) - self:SetAttribute("nameList", nil) - self:SetAttribute("point", nil) - self:SetAttribute("sortDir", nil) - self:SetAttribute("sortMethod", "NAME") - self:SetAttribute("startingIndex", nil) - self:SetAttribute("strictFiltering", nil) - self:SetAttribute("unitsPerColumn", nil) - self:SetAttribute("xOffset", nil) - self:SetAttribute("yOffset", nil) -end - -function MOD:ConstructGroupHeader(parentFrame, filter, styleName, headerName, template1, groupName, template2) - local db = self.db[groupName] - local UNIT_WIDTH, UNIT_HEIGHT = self:GetActiveSize(db) - oUF_SuperVillain:SetActiveStyle(styleName) - local groupHeader = oUF_SuperVillain:SpawnHeader(headerName, template2, nil, - "oUF-initialConfigFunction", ("self:SetWidth(%d); self:SetHeight(%d); self:SetFrameLevel(5)"):format(UNIT_WIDTH, UNIT_HEIGHT), - "groupFilter", filter, - "showParty", true, - "showRaid", true, - "showSolo", true, - template1 and "template", template1 - ) - groupHeader.___groupkey = groupName - groupHeader:SetParent(parentFrame) - groupHeader:Show() - - groupHeader.Update = UPDATERS[groupName] - groupHeader.MediaUpdate = GroupMediaUpdate - groupHeader.ClearAllAttributes = SecureHeaderClear - - return groupHeader -end ---[[ -########################################################## GROUP HEADER METHODS ########################################################## ]]-- @@ -2038,6 +1971,57 @@ local GroupSetActiveState = function(self) end --[[ ########################################################## +SUBUNIT CONSTRUCTORS +########################################################## +]]-- +local SecureHeaderClear = function(self) + self:Hide() + self:SetAttribute("showPlayer", true) + self:SetAttribute("showSolo", true) + self:SetAttribute("showParty", true) + self:SetAttribute("showRaid", true) + self:SetAttribute("columnSpacing", nil) + self:SetAttribute("columnAnchorPoint", nil) + self:SetAttribute("sortMethod", nil) + self:SetAttribute("groupFilter", nil) + self:SetAttribute("groupingOrder", nil) + self:SetAttribute("maxColumns", nil) + self:SetAttribute("nameList", nil) + self:SetAttribute("point", nil) + self:SetAttribute("sortDir", nil) + self:SetAttribute("sortMethod", "NAME") + self:SetAttribute("startingIndex", nil) + self:SetAttribute("strictFiltering", nil) + self:SetAttribute("unitsPerColumn", nil) + self:SetAttribute("xOffset", nil) + self:SetAttribute("yOffset", nil) +end + +function MOD:ConstructGroupHeader(parentFrame, filter, styleName, headerName, template1, groupName, template2, updateFunc) + local db = self.db[groupName] + local UNIT_WIDTH, UNIT_HEIGHT = self:GetActiveSize(db) + + oUF_Villain:SetActiveStyle(styleName) + local groupHeader = oUF_Villain:SpawnHeader(headerName, template2, nil, + "oUF-initialConfigFunction", ("self:SetWidth(%d); self:SetHeight(%d); self:SetFrameLevel(5)"):format(UNIT_WIDTH, UNIT_HEIGHT), + "groupFilter", filter, + "showParty", true, + "showRaid", true, + "showSolo", true, + template1 and "template", template1 + ) + groupHeader.___groupkey = groupName + groupHeader:SetParent(parentFrame) + groupHeader:Show() + + groupHeader.Update = updateFunc or GROUP_UPDATES[groupName] + groupHeader.MediaUpdate = GroupMediaUpdate + groupHeader.ClearAllAttributes = SecureHeaderClear + + return groupHeader +end +--[[ +########################################################## LOAD/UPDATE METHOD ########################################################## ]]-- @@ -2048,13 +2032,15 @@ function MOD:SetGroupFrame(key, filter, template1, forceUpdate, template2) local realName = key:gsub("(.)", upper, 1) local styleName = "SVUI_"..realName local frame, groupName + if(not self.Headers[key]) then - oUF_SuperVillain:RegisterStyle(styleName, CONSTRUCTORS[key]) - oUF_SuperVillain:SetActiveStyle(styleName) + oUF_Villain:RegisterStyle(styleName, CONSTRUCTORS[key]) + oUF_Villain:SetActiveStyle(styleName) - if(key == "tank" or key == "assist") then - frame = self:ConstructGroupHeader(SVUI_UnitFrameParent, filter, styleName, styleName, template1, key, template2) - self.Roster[#self.Roster+1] = styleName + if(key == "tank") then + frame = self:ConstructGroupHeader(SVUI_UnitFrameParent, filter, styleName, styleName, template1, key, template2, UpdateTankFrame) + elseif(key == "assist") then + frame = self:ConstructGroupHeader(SVUI_UnitFrameParent, filter, styleName, styleName, template1, key, template2, UpdateAssistFrame) else frame = CreateFrame("Frame", styleName, SVUI_UnitFrameParent, "SecureHandlerStateTemplate") frame.groups = {} @@ -2082,13 +2068,15 @@ function MOD:SetGroupFrame(key, filter, template1, forceUpdate, template2) if(db.customSorting) then if(not frame.groups[1]) then groupName = styleName .. "Group1" - frame.groups[1] = self:ConstructGroupHeader(frame, 1, styleName, groupName, template1, key, template2) + local subunit = self:ConstructGroupHeader(frame, 1, styleName, groupName, template1, key, template2) + frame.groups[1] = subunit end else for i = 1, db.groupCount do if(not frame.groups[i]) then groupName = styleName .. "Group" .. i - frame.groups[i] = self:ConstructGroupHeader(frame, i, styleName, groupName, template1, key, template2) + local subunit = self:ConstructGroupHeader(frame, i, styleName, groupName, template1, key, template2) + frame.groups[i] = subunit end end end diff --git a/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua b/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua index a028210..09ea35a 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua @@ -35,15 +35,15 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -if(SuperVillain.class ~= "DEATHKNIGHT") then return end; -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(select(2, ...)); +if(SV.class ~= "DEATHKNIGHT") then return end +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ... -local oUF_SuperVillain = ns.oUF +local oUF_Villain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") +assert(oUF_Villain, "SVUI was unable to locate oUF.") --[[ ########################################################## LOCALS @@ -71,7 +71,7 @@ local Reposition = function(self) bar.Holder:Size(width, size) if(not db.classbar.detachFromFrame) then - SuperVillain:ResetMovables(L["Classbar"]) + SV:ResetMovables(L["Classbar"]) end local holderUpdate = bar.Holder:GetScript('OnSizeChanged') if holderUpdate then @@ -118,16 +118,16 @@ function MOD:CreateClassBar(playerFrame) bar[i].bg:SetTexture(graphic) bar[i].bg:SetAlpha(0.5) bar[i].bg.multiplier = 0.1 - end; + end local classBarHolder = CreateFrame("Frame", "Player_ClassBar", classBar) classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SuperVillain:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") + SV:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") playerFrame.MaxClassPower = max; playerFrame.ClassBarRefresh = Reposition; playerFrame.Runes = bar return 'Runes' -end; \ No newline at end of file +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/resources/druid.lua b/Interface/AddOns/SVUI/packages/unit/resources/druid.lua index 5f744ed..5d842f2 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/druid.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/druid.lua @@ -35,15 +35,15 @@ local random,floor = math.random, math.floor; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -if(SuperVillain.class ~= "DRUID") then return end; -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(select(2, ...)); +if(SV.class ~= "DRUID") then return end +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ... -local oUF_SuperVillain = ns.oUF +local oUF_Villain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") +assert(oUF_Villain, "SVUI was unable to locate oUF.") --[[ ########################################################## DRUID ALT MANA @@ -54,8 +54,8 @@ local TRACKER_FONT = [[Interface\AddOns\SVUI\assets\fonts\Combo.ttf]] local UpdateAltPower = function(self, unit, arg1, arg2) local value = self:GetParent().InfoPanel.Power; if(arg1 ~= arg2) then - local color = oUF_SuperVillain.colors.power.MANA - color = SuperVillain:HexColor(color[1],color[2],color[3]) + local color = oUF_Villain.colors.power.MANA + color = SV:HexColor(color[1],color[2],color[3]) local altValue = floor(arg1 / arg2 * 100) local altStr = "" if(value:GetText()) then @@ -85,7 +85,7 @@ local function CreateAltMana(playerFrame, eclipse) bar.PostUpdatePower = UpdateAltPower; bar.ManaBar = CreateFrame("StatusBar", nil, bar) bar.ManaBar.noupdate = true; - bar.ManaBar:SetStatusBarTexture(SuperVillain.Media.bar.glow) + bar.ManaBar:SetStatusBarTexture(SV.Media.bar.glow) bar.ManaBar:FillInner(bar) bar.bg = bar:CreateTexture(nil, "BORDER") bar.bg:SetAllPoints(bar.ManaBar) @@ -93,7 +93,7 @@ local function CreateAltMana(playerFrame, eclipse) bar.bg.multiplier = 0.3; bar.Text = bar.ManaBar:CreateFontString(nil, "OVERLAY") bar.Text:SetAllPoints(bar.ManaBar) - bar.Text:SetFont(SuperVillain.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + bar.Text:SetFont(SV.Shared:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) return bar end --[[ @@ -114,7 +114,7 @@ local Reposition = function(self) bar.Holder:Size(width, height) if(not db.classbar.detachFromFrame) then - SuperVillain:ResetMovables(L["Classbar"]) + SV:ResetMovables(L["Classbar"]) end local holderUpdate = bar.Holder:GetScript('OnSizeChanged') if holderUpdate then @@ -203,7 +203,7 @@ function MOD:CreateClassBar(playerFrame) moon[1]:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\VORTEX") moon[1]:SetBlendMode("ADD") moon[1]:SetVertexColor(0, 0.5, 1) - SuperVillain.Animate:Orbit(moon[1], 10, false) + SV.Animate:Orbit(moon[1], 10, false) moon[2] = moon:CreateTexture(nil, "OVERLAY", nil, 2) moon[2]:Size(30, 30) @@ -214,7 +214,7 @@ function MOD:CreateClassBar(playerFrame) local lunar = CreateFrame('StatusBar', nil, bar) lunar:SetPoint("LEFT", moon, "RIGHT", -10, 0) lunar:Size(100,40) - lunar:SetStatusBarTexture(SuperVillain.Media.bar.lazer) + lunar:SetStatusBarTexture(SV.Media.bar.lazer) lunar.noupdate = true; bar.Moon = moon; @@ -224,7 +224,7 @@ function MOD:CreateClassBar(playerFrame) local solar = CreateFrame('StatusBar', nil, bar) solar:SetPoint('LEFT', lunar:GetStatusBarTexture(), 'RIGHT') solar:Size(100,40) - solar:SetStatusBarTexture(SuperVillain.Media.bar.lazer) + solar:SetStatusBarTexture(SV.Media.bar.lazer) solar.noupdate = true; local sun = CreateFrame('Frame', nil, bar) @@ -237,7 +237,7 @@ function MOD:CreateClassBar(playerFrame) sun[1]:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\VORTEX") sun[1]:SetBlendMode("ADD") sun[1]:SetVertexColor(1, 0.5, 0) - SuperVillain.Animate:Orbit(sun[1], 10, false) + SV.Animate:Orbit(sun[1], 10, false) sun[2] = sun:CreateTexture(nil, "OVERLAY", nil, 2) sun[2]:Size(30, 30) @@ -251,7 +251,7 @@ function MOD:CreateClassBar(playerFrame) bar.Text = lunar:CreateFontString(nil, 'OVERLAY') bar.Text:SetPoint("TOPLEFT", bar, "TOPLEFT", 10, 0) bar.Text:SetPoint("BOTTOMRIGHT", bar, "BOTTOMRIGHT", -10, 0) - bar.Text:SetFont(SuperVillain.Media.font.roboto, 16, "NONE") + bar.Text:SetFont(SV.Media.font.roboto, 16, "NONE") bar.Text:SetShadowOffset(0,0) local hyper = CreateFrame("Frame",nil,playerFrame) @@ -280,7 +280,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SuperVillain:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") + SV:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") playerFrame.ClassBarRefresh = Reposition; playerFrame.EclipseBar = bar @@ -376,7 +376,7 @@ function MOD:CreateDruidCombobar(targetFrame, isSmall) blood:SetBlendMode("ADD") cpoint.Blood = blood - SuperVillain.Animate:SmallSprite(blood,0.08,2,true) + SV.Animate:SmallSprite(blood,0.08,2,true) else icon:SetTexture([[Interface\Addons\SVUI\assets\artwork\Unitframe\Class\COMBO-POINT-SMALL]]) end diff --git a/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua b/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua index f655464..12c98fe 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua @@ -25,15 +25,15 @@ local select = _G.select; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -if(SuperVillain.class ~= "HUNTER") then return end; -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(select(2, ...)); +if(SV.class ~= "HUNTER") then return end +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ... -local oUF_SuperVillain = ns.oUF +local oUF_Villain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") +assert(oUF_Villain, "SVUI was unable to locate oUF.") --[[ ########################################################## PLACEHOLDER diff --git a/Interface/AddOns/SVUI/packages/unit/resources/mage.lua b/Interface/AddOns/SVUI/packages/unit/resources/mage.lua index 5719dfc..4222eac 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/mage.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/mage.lua @@ -35,15 +35,15 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -if(SuperVillain.class ~= "MAGE") then return end; -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(select(2, ...)); +if(SV.class ~= "MAGE") then return end +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ... -local oUF_SuperVillain = ns.oUF +local oUF_Villain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") +assert(oUF_Villain, "SVUI was unable to locate oUF.") --[[ ########################################################## POSITIONING @@ -57,7 +57,7 @@ local Reposition = function(self) local width = size * max; bar.Holder:Size(width, size) if(not db.classbar.detachFromFrame) then - SuperVillain:ResetMovables(L["Classbar"]) + SV:ResetMovables(L["Classbar"]) end local holderUpdate = bar.Holder:GetScript('OnSizeChanged') if holderUpdate then @@ -77,7 +77,7 @@ local Reposition = function(self) bar[i]:Point("LEFT", bar[i - 1], "RIGHT", -1, 0) end end -end; +end --[[ ########################################################## MAGE CHARGES @@ -127,17 +127,17 @@ local Update = function(self, event) if i <= arcaneCharges then bar[i]:Show() bar[i]:SetValue(duration) - if not bar[i].sparks:IsShown() then bar[i].sparks:Show()end; - if not bar[i].charge:IsShown() then bar[i].charge:Show()end; - if not bar[i].under.anim:IsPlaying()then bar[i].under.anim:Play()end; - if not bar[i].sparks.anim:IsPlaying()then bar[i].sparks.anim:Play()end; - if not bar[i].charge.anim:IsPlaying()then bar[i].charge.anim:Play()end; + if not bar[i].sparks:IsShown() then bar[i].sparks:Show()end + if not bar[i].charge:IsShown() then bar[i].charge:Show()end + if not bar[i].under.anim:IsPlaying()then bar[i].under.anim:Play()end + if not bar[i].sparks.anim:IsPlaying()then bar[i].sparks.anim:Play()end + if not bar[i].charge.anim:IsPlaying()then bar[i].charge.anim:Play()end bar[i]:SetScript('OnUpdate', UpdateBar) else bar[i]:SetValue(0) - if bar[i].under.anim:IsPlaying()then bar[i].under.anim:Stop()end; - if bar[i].sparks.anim:IsPlaying()then bar[i].sparks.anim:Stop()end; - if bar[i].charge.anim:IsPlaying()then bar[i].charge.anim:Stop()end; + if bar[i].under.anim:IsPlaying()then bar[i].under.anim:Stop()end + if bar[i].sparks.anim:IsPlaying()then bar[i].sparks.anim:Stop()end + if bar[i].charge.anim:IsPlaying()then bar[i].charge.anim:Stop()end bar[i].sparks:Hide() bar[i].charge:Hide() bar[i]:SetScript('OnUpdate', nil) @@ -174,26 +174,26 @@ function MOD:CreateClassBar(playerFrame) charge:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\MAGE-BG-ANIMATION") charge:SetBlendMode("ADD") charge:SetVertexColor(0.5, 1, 1) - SuperVillain.Animate:Sprite(charge, 10, false, true) + SV.Animate:Sprite(charge, 10, false, true) charge.anim:Play() - SuperVillain.Animate:Sprite(sparks, 0.08, 5, true) + SV.Animate:Sprite(sparks, 0.08, 5, true) sparks.anim:Play() bar[i].charge = charge; bar[i].sparks = sparks; - SuperVillain.Animate:Orbit(under, 15, false) + SV.Animate:Orbit(under, 15, false) bar[i].under = under; bar[i].bg = under.bg; - end; + end bar.Override = Update; local classBarHolder = CreateFrame("Frame", "Player_ClassBar", classBar) classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SuperVillain:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") + SV:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") playerFrame.MaxClassPower = max; playerFrame.ClassBarRefresh = Reposition; playerFrame.ArcaneChargeBar = bar return 'ArcaneChargeBar' -end; \ No newline at end of file +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/resources/monk.lua b/Interface/AddOns/SVUI/packages/unit/resources/monk.lua index e1fcb08..54129d1 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/monk.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/monk.lua @@ -35,15 +35,15 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -if(SuperVillain.class ~= "MONK") then return end; -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(select(2, ...)); +if(SV.class ~= "MONK") then return end +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ... -local oUF_SuperVillain = ns.oUF +local oUF_Villain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") +assert(oUF_Villain, "SVUI was unable to locate oUF.") --[[ ########################################################## POSITIONING @@ -57,7 +57,7 @@ local Reposition = function(self) local width = size * max; bar.Holder:Size(width, size) if(not db.classbar.detachFromFrame) then - SuperVillain:ResetMovables(L["Classbar"]) + SV:ResetMovables(L["Classbar"]) end local holderUpdate = bar.Holder:GetScript('OnSizeChanged') if holderUpdate then @@ -79,10 +79,10 @@ local Reposition = function(self) bar[i]:Point("LEFT", bar[i - 1], "RIGHT", -2, 0) end end -end; +end -local StartFlash = function(self) SuperVillain.Animate:Flash(self.overlay,1,true) end -local StopFlash = function(self) SuperVillain.Animate:StopFlash(self.overlay) end +local StartFlash = function(self) SV.Animate:Flash(self.overlay,1,true) end +local StopFlash = function(self) SV.Animate:StopFlash(self.overlay) end --[[ ########################################################## MONK STAGGER BAR @@ -108,7 +108,7 @@ local function CreateDrunkenMasterBar(playerFrame) stagger.icon:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\MONK-STAGGER-ICON") stagger:Hide() return stagger -end; +end --[[ ########################################################## MONK HARMONY @@ -147,13 +147,13 @@ function MOD:CreateClassBar(playerFrame) bar[i].overlay:SetVertexColor(0, 0, 0) bar[i]:SetScript("OnShow", StartFlash) bar[i]:SetScript("OnHide", StopFlash) - end; + end local classBarHolder = CreateFrame("Frame", "Player_ClassBar", classBar) classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SuperVillain:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") + SV:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") playerFrame.MaxClassPower = max playerFrame.DrunkenMaster = CreateDrunkenMasterBar(playerFrame) @@ -161,4 +161,4 @@ function MOD:CreateClassBar(playerFrame) playerFrame.MonkHarmony = bar return 'MonkHarmony' -end; \ No newline at end of file +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua b/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua index 644363c..21e76b4 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua @@ -35,15 +35,15 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -if(SuperVillain.class ~= "PALADIN") then return end; -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(select(2, ...)); +if(SV.class ~= "PALADIN") then return end +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ... -local oUF_SuperVillain = ns.oUF +local oUF_Villain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") +assert(oUF_Villain, "SVUI was unable to locate oUF.") --[[ ########################################################## LOCAL FUNCTIONS @@ -63,7 +63,7 @@ local Reposition = function(self) local width = size * max; bar.Holder:Size(width, size) if(not db.classbar.detachFromFrame) then - SuperVillain:ResetMovables(L["Classbar"]) + SV:ResetMovables(L["Classbar"]) end local holderUpdate = bar.Holder:GetScript('OnSizeChanged') if holderUpdate then @@ -83,10 +83,10 @@ local Reposition = function(self) bar[i]:Point("LEFT", bar[i - 1], "RIGHT", -1, 0) end end -end; +end local Update = function(self, event, unit, powerType) - if self.unit ~= unit or (powerType and powerType ~= 'HOLY_POWER') then return end; + if self.unit ~= unit or (powerType and powerType ~= 'HOLY_POWER') then return end local bar = self.HolyPower; local baseCount = UnitPower('player',SPELL_POWER_HOLY_POWER) local maxCount = UnitPowerMax('player',SPELL_POWER_HOLY_POWER) @@ -95,7 +95,7 @@ local Update = function(self, event, unit, powerType) bar[i]:SetAlpha(1) else bar[i]:SetAlpha(0) - end; + end if i > maxCount then bar[i]:Hide() else @@ -106,7 +106,7 @@ local Update = function(self, event, unit, powerType) end end self.MaxClassPower = maxCount -end; +end local AlphaHook = function(self,value) self.swirl[3].anim:Finish() @@ -116,7 +116,7 @@ local AlphaHook = function(self,value) else if(not self.swirl[1].anim:IsPlaying()) then self.swirl[1].anim:Play() - end; + end if(not self.swirl[2].anim:IsPlaying()) then self.swirl[2].anim:Play() end @@ -155,7 +155,7 @@ function MOD:CreateClassBar(playerFrame) barAnimation[1]:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\SWIRL") barAnimation[1]:SetBlendMode("ADD") barAnimation[1]:SetVertexColor(0.5,0.5,0.15) - SuperVillain.Animate:Orbit(barAnimation[1],10) + SV.Animate:Orbit(barAnimation[1],10) barAnimation[2] = barAnimation:CreateTexture(nil,"BACKGROUND",nil,2) barAnimation[2]:Size(40,40) @@ -164,28 +164,28 @@ function MOD:CreateClassBar(playerFrame) barAnimation[2]:SetTexCoord(1,0,1,1,0,0,0,1) barAnimation[2]:SetBlendMode("ADD") barAnimation[2]:SetVertexColor(0.5,0.5,0.15) - SuperVillain.Animate:Orbit(barAnimation[2],10,true) + SV.Animate:Orbit(barAnimation[2],10,true) barAnimation[3] = barAnimation:CreateTexture(nil, "OVERLAY") barAnimation[3]:WrapOuter(barAnimation, 3, 3) barAnimation[3]:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Unitframe\\Class\\MAGE-FG-ANIMATION") barAnimation[3]:SetBlendMode("ADD") barAnimation[3]:SetVertexColor(1, 1, 0) - SuperVillain.Animate:Sprite(barAnimation[3], 0.08, 2, true) + SV.Animate:Sprite(barAnimation[3], 0.08, 2, true) bar[i].swirl = barAnimation; hooksecurefunc(bar[i], "SetAlpha", AlphaHook) - end; + end bar.Override = Update; local classBarHolder = CreateFrame("Frame", "Player_ClassBar", classBar) classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SuperVillain:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") + SV:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") playerFrame.MaxClassPower = max; playerFrame.ClassBarRefresh = Reposition; playerFrame.HolyPower = bar return 'HolyPower' -end; \ No newline at end of file +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/resources/priest.lua b/Interface/AddOns/SVUI/packages/unit/resources/priest.lua index 9451add..7ced591 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/priest.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/priest.lua @@ -35,15 +35,15 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -if(SuperVillain.class ~= "PRIEST") then return end; -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(select(2, ...)); +if(SV.class ~= "PRIEST") then return end +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ... -local oUF_SuperVillain = ns.oUF +local oUF_Villain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") +assert(oUF_Villain, "SVUI was unable to locate oUF.") local ICON_FILE = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\Class\PRIEST]] --[[ ########################################################## @@ -59,7 +59,7 @@ local Reposition = function(self) bar.Holder:Size(width, size) if(not db.classbar.detachFromFrame) then - SuperVillain:ResetMovables(L["Classbar"]) + SV:ResetMovables(L["Classbar"]) end local holderUpdate = bar.Holder:GetScript('OnSizeChanged') if holderUpdate then @@ -79,7 +79,7 @@ local Reposition = function(self) bar[i]:Point("LEFT", bar[i - 1], "RIGHT", -1, 0) end end -end; +end --[[ ########################################################## PRIEST @@ -97,7 +97,7 @@ local PreUpdate = function(self, spec) self[i].swirl[1]:SetVertexColor(color[1], color[2], color[3]) self[i].swirl[2]:SetVertexColor(color[4], color[5], color[6]) end -end; +end function MOD:CreateClassBar(playerFrame) local max = 5 @@ -123,7 +123,7 @@ function MOD:CreateClassBar(playerFrame) swirl[1]:SetTexCoord(0.5,1,0.5,1) swirl[1]:SetBlendMode("ADD") swirl[1]:SetVertexColor(0.7, 0.5, 1) - SuperVillain.Animate:Orbit(swirl[1], 10, false) + SV.Animate:Orbit(swirl[1], 10, false) swirl[2] = swirl:CreateTexture(nil, "OVERLAY", nil, 1) swirl[2]:Size(30, 30) swirl[2]:SetPoint("CENTER") @@ -131,12 +131,12 @@ function MOD:CreateClassBar(playerFrame) swirl[2]:SetTexCoord(0.5,1,0.5,1) swirl[2]:SetBlendMode("BLEND") swirl[2]:SetVertexColor(0.2, 0.08, 0.01) - SuperVillain.Animate:Orbit(swirl[2], 10, true) + SV.Animate:Orbit(swirl[2], 10, true) bar[i].swirl = swirl; bar[i]:SetScript("OnShow", function(self) if not self.swirl[1].anim:IsPlaying() then self.swirl[1].anim:Play() - end; + end if not self.swirl[2].anim:IsPlaying() then self.swirl[2].anim:Play() end @@ -146,18 +146,18 @@ function MOD:CreateClassBar(playerFrame) self.swirl[2].anim:Finish() end) - end; + end bar.PreUpdate = PreUpdate local classBarHolder = CreateFrame("Frame", "Player_ClassBar", classBar) classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SuperVillain:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") + SV:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") playerFrame.MaxClassPower = max; playerFrame.ClassBarRefresh = Reposition; playerFrame.PriestOrbs = bar return 'PriestOrbs' -end; \ No newline at end of file +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua b/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua index 4fc1fc1..6c205e7 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua @@ -35,15 +35,15 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -if(SuperVillain.class ~= "ROGUE") then return end; -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(select(2, ...)); +if(SV.class ~= "ROGUE") then return end +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ... -local oUF_SuperVillain = ns.oUF +local oUF_Villain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") +assert(oUF_Villain, "SVUI was unable to locate oUF.") --[[ ########################################################## LOCALS @@ -95,7 +95,7 @@ local Reposition = function(self) bar[i]:Point("LEFT", bar[i - 1], "RIGHT", -2, 0) end end -end; +end --[[ ########################################################## ROGUE COMBO POINTS @@ -103,22 +103,22 @@ ROGUE COMBO POINTS ]]-- local ShowPoint = function(self) self:SetAlpha(1) -end; +end local HidePoint = function(self) local coords = ICON_COORDS[random(2,4)]; self.Icon:SetTexCoord(coords[1],coords[2],coords[3],coords[4]) self:SetAlpha(0) -end; +end local ShowSmallPoint = function(self) self:SetAlpha(1) -end; +end local HideSmallPoint = function(self) self.Icon:SetVertexColor(unpack(cpointColor[i])) self:SetAlpha(0) -end; +end function MOD:CreateRogueCombobar(targetFrame, isSmall) local max = 5 @@ -148,7 +148,7 @@ function MOD:CreateRogueCombobar(targetFrame, isSmall) blood:SetBlendMode("ADD") cpoint.Blood = blood - SuperVillain.Animate:SmallSprite(blood,0.08,2,true) + SV.Animate:SmallSprite(blood,0.08,2,true) else coords = ICON_COORDS[1] icon:SetTexCoord(coords[1],coords[2],coords[3],coords[4]) @@ -156,14 +156,14 @@ function MOD:CreateRogueCombobar(targetFrame, isSmall) cpoint.Icon = icon bar.CPoints[i] = cpoint - end; + end targetFrame.ComboRefresh = Reposition; bar.PointShow = isSmall and ShowSmallPoint or ShowPoint; bar.PointHide = isSmall and HideSmallPoint or HidePoint; return bar -end; +end --[[ ########################################################## ROGUE COMBO TRACKER @@ -178,7 +178,7 @@ local RepositionTracker = function(self) local textwidth = size * 1.25; bar.Holder:Size(width, size) if(not db.classbar.detachFromFrame) then - SuperVillain:ResetMovables(L["Classbar"]) + SV:ResetMovables(L["Classbar"]) end local holderUpdate = bar.Holder:GetScript('OnSizeChanged') if holderUpdate then @@ -214,7 +214,7 @@ local RepositionTracker = function(self) bar.Guile.Text:SetAllPoints(bar.Guile) bar.Guile.Text:SetFont(TRACKER_FONT, size, 'OUTLINE') end -end; +end function MOD:CreateClassBar(playerFrame) local bar = CreateFrame("Frame",nil,playerFrame) @@ -257,10 +257,10 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SuperVillain:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") + SV:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") playerFrame.MaxClassPower = 5; playerFrame.ClassBarRefresh = RepositionTracker; playerFrame.HyperCombo = bar return 'HyperCombo' -end; \ No newline at end of file +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua b/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua index aac7748..fb151df 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua @@ -35,15 +35,15 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -if(SuperVillain.class ~= "SHAMAN") then return end; -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(select(2, ...)); +if(SV.class ~= "SHAMAN") then return end +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ... -local oUF_SuperVillain = ns.oUF +local oUF_Villain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") +assert(oUF_Villain, "SVUI was unable to locate oUF.") --[[ ########################################################## LOCALS @@ -69,7 +69,7 @@ local Reposition = function(self) local width = size * totemMax bar.Holder:Size(width, size) if(not db.classbar.detachFromFrame) then - SuperVillain:ResetMovables(L["Classbar"]) + SV:ResetMovables(L["Classbar"]) end local holderUpdate = bar.Holder:GetScript('OnSizeChanged') if holderUpdate then @@ -89,7 +89,7 @@ local Reposition = function(self) bar[i]:Point("LEFT", bar[i - 1], "RIGHT", -1, 0) end end -end; +end --[[ ########################################################## SHAMAN @@ -110,16 +110,16 @@ function MOD:CreateClassBar(playerFrame) bar[i].backdrop:SetTexture(iconfile) bar[i].backdrop:SetDesaturated(true) bar[i].backdrop:SetVertexColor(0.2,0.2,0.2,0.7) - end; + end local classBarHolder = CreateFrame("Frame", "Player_ClassBar", classBar) classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SuperVillain:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") + SV:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") playerFrame.MaxClassPower = totemMax; playerFrame.ClassBarRefresh = Reposition; playerFrame.TotemBars = bar return 'TotemBars' -end; \ No newline at end of file +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua b/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua index 15540ad..a82625a 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua @@ -35,15 +35,15 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -if(SuperVillain.class ~= "WARLOCK") then return end; -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(select(2, ...)); +if(SV.class ~= "WARLOCK") then return end +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ... -local oUF_SuperVillain = ns.oUF +local oUF_Villain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") +assert(oUF_Villain, "SVUI was unable to locate oUF.") --[[ ########################################################## LOCAL FUNCTIONS @@ -86,7 +86,7 @@ local Reposition = function(self) local dbOffset = (size * 0.15) bar.Holder:Size(width, size) if(not db.classbar.detachFromFrame) then - SuperVillain:ResetMovables(L["Classbar"]) + SV:ResetMovables(L["Classbar"]) end local holderUpdate = bar.Holder:GetScript('OnSizeChanged') if holderUpdate then @@ -109,7 +109,7 @@ local Reposition = function(self) bar[i]:Point("LEFT", bar[i - 1], "RIGHT", -2, 0) end end -end; +end --[[ ########################################################## CUSTOM HANDLERS @@ -120,22 +120,22 @@ local UpdateTextures = function(bar, spec, max) if spec == SPEC_WARLOCK_DEMONOLOGY then bar[1].overlay:SetTexture(0,0,0,0) bar[1].underlay:SetTexture(0,0,0,0) - SuperVillain.Animate:StopFlash(bar[1].overlay) + SV.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) - SuperVillain.Animate:StopFlash(bar[2].overlay) + SV.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) - SuperVillain.Animate:StopFlash(bar[3].overlay) + SV.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) - SuperVillain.Animate:StopFlash(bar[4].overlay) + SV.Animate:StopFlash(bar[4].overlay) bar[4].underlay.anim:Finish() bar.CurrentSpec = spec elseif spec == SPEC_WARLOCK_AFFLICTION then @@ -169,7 +169,7 @@ local UpdateTextures = function(bar, spec, max) end bar.CurrentSpec = spec end -end; +end local Update = function(self, event, unit, powerType) local bar = self.WarlockShards; @@ -212,10 +212,10 @@ local Update = function(self, event, unit, powerType) if (power >= MAX_POWER_PER_EMBER * i) then bar[i].overlay:Show() bar[i].underlay:Show() - SuperVillain.Animate:Flash(bar[i].overlay,1,true) + SV.Animate:Flash(bar[i].overlay,1,true) if not bar[i].underlay.anim:IsPlaying() then bar[i].underlay.anim:Play() end else - SuperVillain.Animate:StopFlash(bar[i].overlay) + SV.Animate:StopFlash(bar[i].overlay) bar[i].overlay:Hide() bar[i].underlay.anim:Stop() bar[i].underlay:Hide() @@ -241,12 +241,12 @@ local Update = function(self, event, unit, powerType) bar[i]:SetAlpha(1) bar[i].overlay:Show() bar[i].underlay:Show() - SuperVillain.Animate:Flash(bar[i].overlay,1,true) + SV.Animate:Flash(bar[i].overlay,1,true) if not bar[i].underlay.anim:IsPlaying() then bar[i].underlay.anim:Play() end else bar[i]:SetValue(0) bar[i]:SetAlpha(0) - SuperVillain.Animate:StopFlash(bar[i].overlay) + SV.Animate:StopFlash(bar[i].overlay) end end elseif spec == SPEC_WARLOCK_DEMONOLOGY then @@ -272,7 +272,7 @@ local Update = function(self, event, unit, powerType) if(bar.PostUpdate) then return bar:PostUpdate(unit, spec) end -end; +end --[[ ########################################################## WARLOCK @@ -306,17 +306,17 @@ function MOD:CreateClassBar(playerFrame) bar[i].underlay:SetTexture('Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\Class\\WARLOCK-SOUL-ANIMATION') bar[i].underlay:SetBlendMode('ADD') bar[i].underlay:Hide() - SuperVillain.Animate:Sprite(bar[i].underlay,0.15,false,true) + SV.Animate:Sprite(bar[i].underlay,0.15,false,true) bar[i].backdrop:SetVertexColor(unpack(shardBGColor[1])) bar[i].overlay:SetVertexColor(unpack(shardOverColor[1])) bar[i].underlay:SetVertexColor(unpack(shardUnderColor[1])) - end; + end local demonBar = CreateFrame("StatusBar",nil,bar) demonBar.noupdate = true; demonBar:SetOrientation("HORIZONTAL") - demonBar:SetStatusBarTexture(SuperVillain.Media.bar.lazer) + demonBar:SetStatusBarTexture(SV.Media.bar.lazer) local bgFrame = CreateFrame("Frame", nil, demonBar) bgFrame:FillInner(demonBar, -2, 10) @@ -359,7 +359,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SuperVillain:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") + SV:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") playerFrame.MaxClassPower = max; playerFrame.ClassBarRefresh = Reposition; diff --git a/Interface/AddOns/SVUI/packages/unit/resources/warrior.lua b/Interface/AddOns/SVUI/packages/unit/resources/warrior.lua index 5e364ef..53f6494 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/warrior.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/warrior.lua @@ -25,15 +25,15 @@ local select = _G.select; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -if(SuperVillain.class ~= "WARRIOR") then return end; -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(select(2, ...)); +if(SV.class ~= "WARRIOR") then return end +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ... -local oUF_SuperVillain = ns.oUF +local oUF_Villain = ns.oUF --[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- local assert = enforce; -assert(oUF_SuperVillain, "SVUI was unable to locate oUF.") +assert(oUF_Villain, "SVUI was unable to locate oUF.") --[[ ########################################################## PLACEHOLDER diff --git a/Interface/AddOns/SVUI/scripts/comix.lua b/Interface/AddOns/SVUI/scripts/comix.lua index 98cd9f2..a518a97 100644 --- a/Interface/AddOns/SVUI/scripts/comix.lua +++ b/Interface/AddOns/SVUI/scripts/comix.lua @@ -28,7 +28,7 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SV, L, Registry = unpack(select(2, ...)); local Comix = CreateFrame("Frame"); --[[ ########################################################## @@ -83,7 +83,7 @@ CORE FUNCTIONS function Comix:ReadyState(state) if(state == nil) then return animReady end animReady = state -end; +end function Comix:LaunchPopup(comicType) local rng = random(1, 16); @@ -106,7 +106,7 @@ function Comix:LaunchPopup(comicType) frame = ComixDeluxePanel end local step1_x = random(-280, 280); - if(step1_x > -30 and step1_x < 30) then step1_x = 150 end; + if(step1_x > -30 and step1_x < 30) then step1_x = 150 end local step2_x = step1_x * 0.5; local step1_y = random(50, 100); local step2_y = step1_y * 0.75; @@ -116,7 +116,7 @@ function Comix:LaunchPopup(comicType) frame.anim[3]:SetOffset(0,0) frame.anim:Play() end -end; +end local Comix_OnEvent = function(self, event, ...) local subEvent = select(2,...) @@ -126,7 +126,7 @@ local Comix_OnEvent = function(self, event, ...) if subEvent == "PARTY_KILL" and guid == playerGUID and ready then self:ReadyState(false) local rng = random(1,15) - if((rng < 3) and SuperVillain.db.system.bigComix) then + if((rng < 3) and SV.db.system.bigComix) then self:LaunchPopup("PREMIUM") elseif rng < 8 then self:LaunchPopup("DELUXE") @@ -136,73 +136,73 @@ local Comix_OnEvent = function(self, event, ...) end end -function SuperVillain:ToggleComix() - if not SuperVillain.db.system.comix then +function SV:ToggleComix() + if not SV.db.system.comix then Comix:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED") Comix:SetScript("OnEvent", nil) else Comix:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") Comix:SetScript("OnEvent", Comix_OnEvent) end -end; +end -function SuperVillain:ToastyKombat() +function SV:ToastyKombat() --Comix:LaunchPopup("DELUXE") ComixToastyPanelBG.anim[2]:SetOffset(256, -256) ComixToastyPanelBG.anim[2]:SetOffset(0, 0) ComixToastyPanelBG.anim:Play() PlaySoundFile([[Interface\AddOns\SVUI\assets\sounds\toasty.mp3]]) -end; +end local Comix_OnUpdate = function() Comix:ReadyState(true) end local Toasty_OnUpdate = function(self) Comix:ReadyState(true);self.parent:SetAlpha(0) end -local function LoadSuperVillainComix() - local basic = CreateFrame("Frame", "ComixBasicPanel", SuperVillain.UIParent) +local function LoadSVComix() + local basic = CreateFrame("Frame", "ComixBasicPanel", SV.UIParent) basic:SetSize(100, 100) basic:SetFrameStrata("DIALOG") - basic:Point("CENTER", SuperVillain.UIParent, "CENTER", 0, -50) + basic:Point("CENTER", SV.UIParent, "CENTER", 0, -50) basic.tex = basic:CreateTexture(nil, "ARTWORK") basic.tex:FillInner(basic) basic.tex:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\COMICS-TYPE1]]) basic.tex:SetTexCoord(0,0.25,0,0.25) - SuperVillain.Animate:RandomSlide(basic, true) + SV.Animate:RandomSlide(basic, true) basic:SetAlpha(0) basic.anim[3]:SetScript("OnFinished", Comix_OnUpdate) - local deluxe = CreateFrame("Frame", "ComixDeluxePanel", SuperVillain.UIParent) + local deluxe = CreateFrame("Frame", "ComixDeluxePanel", SV.UIParent) deluxe:SetSize(100, 100) deluxe:SetFrameStrata("DIALOG") - deluxe:Point("CENTER", SuperVillain.UIParent, "CENTER", 0, -50) + deluxe:Point("CENTER", SV.UIParent, "CENTER", 0, -50) deluxe.tex = deluxe:CreateTexture(nil, "ARTWORK") deluxe.tex:FillInner(deluxe) deluxe.tex:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\COMICS-TYPE2]]) deluxe.tex:SetTexCoord(0,0.25,0,0.25) - SuperVillain.Animate:RandomSlide(deluxe, true) + SV.Animate:RandomSlide(deluxe, true) deluxe:SetAlpha(0) deluxe.anim[3]:SetScript("OnFinished", Comix_OnUpdate) - local premium = CreateFrame("Frame", "ComixPremiumPanel", SuperVillain.UIParent) + local premium = CreateFrame("Frame", "ComixPremiumPanel", SV.UIParent) premium:SetSize(100, 100) premium:SetFrameStrata("DIALOG") - premium:Point("CENTER", SuperVillain.UIParent, "CENTER", 0, -50) + premium:Point("CENTER", SV.UIParent, "CENTER", 0, -50) premium.tex = premium:CreateTexture(nil, "ARTWORK") premium.tex:FillInner(premium) premium.tex:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\COMICS-TYPE3]]) premium.tex:SetTexCoord(0,0.25,0,0.25) - SuperVillain.Animate:RandomSlide(premium, true) + SV.Animate:RandomSlide(premium, true) premium:SetAlpha(0) premium.anim[3]:SetScript("OnFinished", Comix_OnUpdate) - local premiumbg = CreateFrame("Frame", "ComixPremiumPanelBG", SuperVillain.UIParent) + local premiumbg = CreateFrame("Frame", "ComixPremiumPanelBG", SV.UIParent) premiumbg:SetSize(128, 128) premiumbg:SetFrameStrata("BACKGROUND") - premiumbg:Point("CENTER", SuperVillain.UIParent, "CENTER", 0, -50) + premiumbg:Point("CENTER", SV.UIParent, "CENTER", 0, -50) premiumbg.tex = premiumbg:CreateTexture(nil, "ARTWORK") premiumbg.tex:FillInner(premiumbg) premiumbg.tex:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\COMICS-TYPE3-BG]]) premiumbg.tex:SetTexCoord(0,0.25,0,0.25) - SuperVillain.Animate:RandomSlide(premiumbg, false) + SV.Animate:RandomSlide(premiumbg, false) premiumbg:SetAlpha(0) premiumbg.anim[3]:SetScript("OnFinished", Comix_OnUpdate) --MOD @@ -213,11 +213,11 @@ local function LoadSuperVillainComix() toasty.tex = toasty:CreateTexture(nil, "ARTWORK") toasty.tex:FillInner(toasty) toasty.tex:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\TOASTY]]) - SuperVillain.Animate:Slide(toasty, 256, -256, true) + SV.Animate:Slide(toasty, 256, -256, true) toasty:SetAlpha(0) toasty.anim[4]:SetScript("OnFinished", Toasty_OnUpdate) Comix:ReadyState(true) - SuperVillain:ToggleComix() + SV:ToggleComix() end -SuperVillain.Registry:NewScript(LoadSuperVillainComix) \ No newline at end of file +Registry:NewScript(LoadSVComix) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/misc.lua b/Interface/AddOns/SVUI/scripts/misc.lua index 1b60ba9..29e7965 100644 --- a/Interface/AddOns/SVUI/scripts/misc.lua +++ b/Interface/AddOns/SVUI/scripts/misc.lua @@ -31,7 +31,7 @@ local cos, deg, rad, sin = math.cos, math.deg, math.rad, math.sin; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SV, L, Registry = unpack(select(2, ...)); local toonclass = select(2, UnitClass('player')) --[[ ########################################################## @@ -63,7 +63,7 @@ local function LoadStyledChatBubbles() end end) - if(SuperVillain.db.system.bubbles == true) then + if(SV.db.system.bubbles == true) then local ChatBubbleHandler = CreateFrame("Frame", nil, UIParent) local total = 0 local numKids = 0 @@ -98,7 +98,7 @@ local function LoadStyledChatBubbles() frame:SetFrameStrata("BACKGROUND") end if(frame.text) then - frame.text:SetFont(SuperVillain.Media.font.dialog, 10, "NONE") + frame.text:SetFont(SV.Media.font.dialog, 10, "NONE") frame.text:SetShadowColor(0,0,0,1) frame.text:SetShadowOffset(1,-1) end @@ -124,7 +124,7 @@ local function LoadStyledChatBubbles() end end -SuperVillain.Registry:NewScript(LoadStyledChatBubbles) +Registry:NewScript(LoadStyledChatBubbles) --[[ ########################################################## DRESSUP HELPERS by: Leatrix @@ -215,12 +215,12 @@ end local function LoadDressupHelper() --[[ PAPER DOLL ENHANCEMENT ]]-- - local tabard1 = SuperVillain:CreateButton(DressUpFrame, "Tabard", "BOTTOMLEFT", 26, 79, 80, 22, "") + local tabard1 = SV:CreateButton(DressUpFrame, "Tabard", "BOTTOMLEFT", 12, 12, 80, 22, "") tabard1:SetScript("OnClick", function() DressUpModel:UndressSlot(19) end) - local nude1 = SuperVillain:CreateButton(DressUpFrame, "Nude", "BOTTOMLEFT", 106, 79, 80, 22, "") + local nude1 = SV:CreateButton(DressUpFrame, "Nude", "BOTTOMLEFT", 104, 12, 80, 22, "") nude1:SetScript("OnClick", function() DressUpFrameResetButton:Click() for i = 1, 19 do @@ -230,15 +230,16 @@ local function LoadDressupHelper() local BtnStrata, BtnLevel = SideDressUpModelResetButton:GetFrameStrata(), SideDressUpModelResetButton:GetFrameLevel() + -- frame, label, anchor, x, y, width, height, tooltip - local tabard2 = SuperVillain:CreateButton(SideDressUpFrame, "Tabard", "BOTTOMLEFT", 14, 20, 60, 22, "") + local tabard2 = SV:CreateButton(SideDressUpFrame, "Tabard", "BOTTOMLEFT", 14, 20, 60, 22, "") tabard2:SetFrameStrata(BtnStrata); tabard2:SetFrameLevel(BtnLevel); tabard2:SetScript("OnClick", function() SideDressUpModel:UndressSlot(19) end) - local nude2 = SuperVillain:CreateButton(SideDressUpFrame, "Nude", "BOTTOMRIGHT", -18, 20, 60, 22, "") + local nude2 = SV:CreateButton(SideDressUpFrame, "Nude", "BOTTOMRIGHT", -18, 20, 60, 22, "") nude2:SetFrameStrata(BtnStrata); nude2:SetFrameLevel(BtnLevel); nude2:SetScript("OnClick", function() @@ -251,7 +252,7 @@ local function LoadDressupHelper() --[[ CLOAK AND HELMET TOGGLES ]]-- helmet = CreateFrame('CheckButton', nil, CharacterModelFrame, "OptionsCheckButtonTemplate") helmet:SetSize(24, 24) - helmet:Formula409() + helmet:RemoveTextures() helmet:SetCheckboxTemplate(true) helmet.text = helmet:CreateFontString(nil, 'OVERLAY', "GameFontNormal") helmet.text:SetPoint("LEFT", 24, 0) @@ -262,7 +263,7 @@ local function LoadDressupHelper() cloak = CreateFrame('CheckButton', nil, CharacterModelFrame, "OptionsCheckButtonTemplate") cloak:SetSize(24, 24) - cloak:Formula409() + cloak:RemoveTextures() cloak:SetCheckboxTemplate(true) cloak.text = cloak:CreateFontString(nil, 'OVERLAY', "GameFontNormal") cloak.text:SetPoint("LEFT", 24, 0) @@ -282,7 +283,7 @@ local function LoadDressupHelper() CharacterModelFrame:HookScript("OnShow", SetVanityPlacement) end -SuperVillain.Registry:NewScript(LoadDressupHelper) +Registry:NewScript(LoadDressupHelper) --[[ ########################################################## RAIDMARKERS @@ -354,8 +355,8 @@ end local function RaidMarkShowIcons() if not UnitExists("target") or UnitIsDead("target") then return end local x,y = GetCursorPosition() - local scale = SuperVillain.UIParent:GetEffectiveScale() - RaidMarkFrame:SetPoint("CENTER",SuperVillain.UIParent,"BOTTOMLEFT", (x / scale), (y / scale)) + local scale = SV.UIParent:GetEffectiveScale() + RaidMarkFrame:SetPoint("CENTER",SV.UIParent,"BOTTOMLEFT", (x / scale), (y / scale)) RaidMarkFrame:Show() end @@ -414,7 +415,7 @@ local Totems_OnEvent = function(self, event) end end -function SuperVillain:UpdateTotems() +function SV:UpdateTotems() local totemSize = self.db.system.totems.size; local totemSpace = self.db.system.totems.spacing; local totemGrowth = self.db.system.totems.showBy; @@ -470,10 +471,10 @@ local Totem_OnLeave = function() end local function CreateTotemBar() - if(not SuperVillain.db.system.totems.enable) then return; end - local xOffset = SuperVillain.db.SVDock.dockLeftWidth + 12 - TotemBar = CreateFrame("Frame", "SVUI_TotemBar", SuperVillain.UIParent) - TotemBar:SetPoint("BOTTOMLEFT", SuperVillain.UIParent, "BOTTOMLEFT", xOffset, 40) + if(not SV.db.system.totems.enable) then return; end + local xOffset = SV.db.SVDock.dockLeftWidth + 12 + TotemBar = CreateFrame("Frame", "SVUI_TotemBar", SV.UIParent) + TotemBar:SetPoint("BOTTOMLEFT", SV.UIParent, "BOTTOMLEFT", xOffset, 40) for i = 1, MAX_TOTEMS do local id = priorities[i] local totem = CreateFrame("Button", "TotemBarTotem"..id, TotemBar) @@ -487,7 +488,7 @@ local function CreateTotemBar() totem.CD = CreateFrame("Cooldown", "TotemBarTotem"..id.."Cooldown", totem, "CooldownFrameTemplate") totem.CD:SetReverse(true) totem.CD:FillInner() - SuperVillain:AddCD(totem.CD) + SV.Timers:AddCooldown(totem.CD) totem.Anchor = CreateFrame("Frame", nil, totem) totem.Anchor:SetAllPoints() @@ -527,7 +528,7 @@ local function CreateTotemBar() Totems:RegisterEvent("PLAYER_ENTERING_WORLD") Totems:SetScript("OnEvent", Totems_OnEvent) Totems_OnEvent() - SuperVillain:UpdateTotems() + SV:UpdateTotems() local frame_name; if toonclass == "DEATHKNIGHT" then frame_name = L["Ghoul Bar"] @@ -536,10 +537,10 @@ local function CreateTotemBar() else frame_name = L["Totem Bar"] end - SuperVillain:SetSVMovable(TotemBar, frame_name) + SV:SetSVMovable(TotemBar, frame_name) end -SuperVillain.Registry:NewScript(CreateTotemBar) +Registry:NewScript(CreateTotemBar) --[[ ########################################################## THREAT THERMOMETER @@ -567,7 +568,7 @@ local function GetThreatBarColor(unitWithHighestThreat) if not colors then return 15,15,15 end return colors.r*255, colors.g*255, colors.b*255 elseif react then - local reaction=oUF_SuperVillain['colors'].reaction[react] + local reaction=oUF_Villain['colors'].reaction[react] return reaction[1]*255, reaction[2]*255, reaction[3]*255 else return 15,15,15 @@ -598,7 +599,7 @@ local function ThreatBar_OnEvent(self, event) local highestThreat,unitWithHighestThreat = UMadBro(scaledPercent) if highestThreat > 0 and unitWithHighestThreat ~= nil then local r,g,b = GetThreatBarColor(unitWithHighestThreat) - if SuperVillain.ClassRole == 'T' then + if SV.ClassRole == 'T' then self:SetStatusBarColor(0,0.839,0) self:SetValue(highestThreat) else @@ -621,8 +622,8 @@ local function ThreatBar_OnEvent(self, event) end local function LoadThreatBar() - if(SuperVillain.db.system.threatbar == true) then - local ThreatBar = CreateFrame('StatusBar', 'SVUI_ThreatBar', SuperVillain.UIParent); + if(SV.db.system.threatbar == true) then + local ThreatBar = CreateFrame('StatusBar', 'SVUI_ThreatBar', SV.UIParent); ThreatBar:SetStatusBarTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Doodads\\THREAT-BAR") ThreatBar:SetSize(50,100) ThreatBar:SetFrameStrata('MEDIUM') @@ -639,49 +640,15 @@ local function LoadThreatBar() ThreatBar.overlay:SetTexture(BARFILE) ThreatBar.overlay:SetTexCoord(0.75,1,0,0.5) ThreatBar.text = ThreatBar:CreateFontString(nil,'OVERLAY') - ThreatBar.text:SetFont(SuperVillain.Media.font.numbers, 10, "OUTLINE") + ThreatBar.text:SetFont(SV.Media.font.numbers, 10, "OUTLINE") ThreatBar.text:SetPoint('TOP',ThreatBar,'BOTTOM',0,0) ThreatBar:RegisterEvent('PLAYER_TARGET_CHANGED'); ThreatBar:RegisterEvent('UNIT_THREAT_LIST_UPDATE') ThreatBar:RegisterEvent('GROUP_ROSTER_UPDATE') ThreatBar:RegisterEvent('UNIT_PET') ThreatBar:SetScript("OnEvent", ThreatBar_OnEvent) - SuperVillain:SetSVMovable(ThreatBar, "Threat Bar"); + SV:SetSVMovable(ThreatBar, "Threat Bar"); end end -SuperVillain.Registry:NewScript(LoadThreatBar); - --- local PVP_POI = { --- [401] = { --Alterac Valley (15) --- "Stormpike Aid Station", "Dun Baldar North Bunker", "Dun Baldar South Bunker", --- "Stormpike Graveyard", "Icewing Bunker", "Stonehearth Graveyard", --- "Stonehearth Bunker", "Snowfall Graveyard", "Iceblood Tower", --- "Iceblood Graveyard", "Tower Point", "Frostwolf Graveyard", --- "West Frostwolf Tower", "East Frostwolf Tower", "Frostwolf Relief Hut" --- }, --- [935] = { --Deepwind Gorge (2) --- "Horde Cart", "Alliance Cart" --- }, --- [482] = { --Eye of the Storm (1) --- "Flag" --- }, --- [860] = { --Silvershard Mines (1) --- "Cart" --- }, --- [512] = { --Strand of the Ancients (5) --- "Green Emerald", "Blue Sapphire", "Purple Amethyst", "Red Sun", "Yellow Moon" --- }, --- [540] = { --Isle of Conquest (5) --- "Quarry", "Hangar", "Workshop", "Docks", "Refinery" --- }, --- [856] = { --Temple of Kotmogu (4) --- "Red Orb", "Blue Orb", "Orange Orb", "Purple Orb" --- }, --- [626] = { --Twin Peaks (2) --- "Horde Flag", "Alliance Flag" --- }, --- [443] = { --Warsong Gulch (2) --- "Horde Flag", "Alliance Flag" --- }, --- } \ No newline at end of file +Registry:NewScript(LoadThreatBar); \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/mounts.lua b/Interface/AddOns/SVUI/scripts/mounts.lua index f5e625a..01b0ced 100644 --- a/Interface/AddOns/SVUI/scripts/mounts.lua +++ b/Interface/AddOns/SVUI/scripts/mounts.lua @@ -16,6 +16,7 @@ S U P E R - V I L L A I N - U I By: Munglunch # LOCALIZED LUA FUNCTIONS ########################################################## ]]-- +if(select(4, GetBuildInfo()) >= 60000) then return end; --[[ GLOBALS ]]-- local _G = _G; local unpack = _G.unpack; @@ -32,7 +33,7 @@ local twipe,band = table.wipe, bit.band; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SV, L, Registry = unpack(select(2, ...)); -- SVUI_Cache.Mounts.types -- SVUI_Cache.Mounts.names --[[ @@ -132,7 +133,7 @@ end local function Update_MountCheckButtons() if(not MountJournal or not MountJournal.cachedMounts) then return end local count = #MountJournal.cachedMounts - if(type(count) ~= "number") then return end; + if(type(count) ~= "number") then return end local scrollFrame = MountJournal.ListScrollFrame; local offset = HybridScrollFrame_GetOffset(scrollFrame); local buttons = scrollFrame.buttons; @@ -247,11 +248,14 @@ local function SetMountCheckButtons() ["SPECIAL"] = "" } } - end; + end + UpdateMountCache() + local scrollFrame = MountJournal.ListScrollFrame; local scrollBar = _G["MountJournalListScrollFrameScrollBar"] local buttons = scrollFrame.buttons; + for i = 1, #buttons do local button = buttons[i] local barWidth = button:GetWidth() @@ -262,14 +266,12 @@ local function SetMountCheckButtons() local buttonBar = CreateFrame("Frame", barName, button) buttonBar:SetPoint("BOTTOMLEFT", button, "BOTTOMLEFT", 0, 0) buttonBar:SetSize(barWidth, height + 8) - buttonBar:SetFrameStrata("HIGH") - buttonBar:SetFrameLevel(99) --[[ CREATE CHECKBOXES ]]-- - buttonBar["GROUND"] = CreateFrame("CheckButton", nil, buttonBar, "UICheckButtonTemplate") + buttonBar["GROUND"] = CreateFrame("CheckButton", ("%s_GROUND"):format(barName), buttonBar, "UICheckButtonTemplate") buttonBar["GROUND"]:SetSize(width,height) buttonBar["GROUND"]:SetPoint("BOTTOMLEFT", buttonBar, "BOTTOMLEFT", 6, 4) - buttonBar["GROUND"]:Formula409() + buttonBar["GROUND"]:RemoveTextures() buttonBar["GROUND"]:SetCheckboxTemplate() buttonBar["GROUND"]:SetPanelColor(0.2, 0.7, 0.1, 0.15) buttonBar["GROUND"]:GetCheckedTexture():SetVertexColor(0.2, 0.7, 0.1, 1) @@ -283,10 +285,10 @@ local function SetMountCheckButtons() buttonBar["GROUND"]:SetScript("OnEnter", CheckButton_OnEnter) buttonBar["GROUND"]:SetScript("OnLeave", CheckButton_OnLeave) - buttonBar["FLYING"] = CreateFrame("CheckButton", nil, buttonBar, "UICheckButtonTemplate") + buttonBar["FLYING"] = CreateFrame("CheckButton", ("%s_FLYING"):format(barName), buttonBar, "UICheckButtonTemplate") buttonBar["FLYING"]:SetSize(width,height) buttonBar["FLYING"]:SetPoint("BOTTOMLEFT", buttonBar["GROUND"], "BOTTOMRIGHT", 2, 0) - buttonBar["FLYING"]:Formula409() + buttonBar["FLYING"]:RemoveTextures() buttonBar["FLYING"]:SetCheckboxTemplate() buttonBar["FLYING"]:SetPanelColor(1, 1, 0.2, 0.15) buttonBar["FLYING"]:GetCheckedTexture():SetVertexColor(1, 1, 0.2, 1) @@ -300,10 +302,10 @@ local function SetMountCheckButtons() buttonBar["FLYING"]:SetScript("OnEnter", CheckButton_OnEnter) buttonBar["FLYING"]:SetScript("OnLeave", CheckButton_OnLeave) - buttonBar["SWIMMING"] = CreateFrame("CheckButton", nil, buttonBar, "UICheckButtonTemplate") + buttonBar["SWIMMING"] = CreateFrame("CheckButton", ("%s_SWIMMING"):format(barName), buttonBar, "UICheckButtonTemplate") buttonBar["SWIMMING"]:SetSize(width,height) buttonBar["SWIMMING"]:SetPoint("BOTTOMLEFT", buttonBar["FLYING"], "BOTTOMRIGHT", 2, 0) - buttonBar["SWIMMING"]:Formula409() + buttonBar["SWIMMING"]:RemoveTextures() buttonBar["SWIMMING"]:SetCheckboxTemplate() buttonBar["SWIMMING"]:SetPanelColor(0.2, 0.42, 0.76, 0.15) buttonBar["SWIMMING"]:GetCheckedTexture():SetVertexColor(0.2, 0.42, 0.76, 1) @@ -317,10 +319,10 @@ local function SetMountCheckButtons() buttonBar["SWIMMING"]:SetScript("OnEnter", CheckButton_OnEnter) buttonBar["SWIMMING"]:SetScript("OnLeave", CheckButton_OnLeave) - buttonBar["SPECIAL"] = CreateFrame("CheckButton", nil, buttonBar, "UICheckButtonTemplate") + buttonBar["SPECIAL"] = CreateFrame("CheckButton", ("%s_SPECIAL"):format(barName), buttonBar, "UICheckButtonTemplate") buttonBar["SPECIAL"]:SetSize(width,height) buttonBar["SPECIAL"]:SetPoint("BOTTOMLEFT", buttonBar["SWIMMING"], "BOTTOMRIGHT", 2, 0) - buttonBar["SPECIAL"]:Formula409() + buttonBar["SPECIAL"]:RemoveTextures() buttonBar["SPECIAL"]:SetCheckboxTemplate() buttonBar["SPECIAL"]:SetPanelColor(0.7, 0.1, 0.1, 0.15) buttonBar["SPECIAL"]:GetCheckedTexture():SetVertexColor(0.7, 0.1, 0.1, 1) @@ -343,6 +345,11 @@ local function SetMountCheckButtons() scrollFrame:HookScript("OnMouseWheel", Update_MountCheckButtons) scrollBar:HookScript("OnValueChanged", Update_MountCheckButtons) UpdateCurrentMountSelection() + + if(SV.___interface >= 60000) then + MountListener:RegisterEvent("MOUNT_JOURNAL_USABILITY_CHANGED") + end + MountListener:RegisterEvent("COMPANION_LEARNED") MountListener:RegisterEvent("COMPANION_UNLEARNED") MountListener:RegisterEvent("COMPANION_UPDATE") @@ -383,7 +390,7 @@ function SVUILetsRide() if(IsSwimming() and IbelieveIcantFly and not letsSeahorse) then letsSwim = true end - if(IsControlKeyDown() or IsShiftKeyDown()) then + if(IsModifierKeyDown()) then if(checkList["SPECIAL"]) then CallCompanion("MOUNT", checkList["SPECIAL"]) return @@ -404,7 +411,7 @@ function SVUILetsRide() return else if(checkList["GROUND"]) then - SuperVillain:AddonMessage("No flying mount selected! Using your ground mount.") + SV:AddonMessage("No flying mount selected! Using your ground mount.") CallCompanion("MOUNT", checkList["GROUND"]) return end @@ -419,7 +426,7 @@ function SVUILetsRide() CallCompanion("MOUNT", checkList["SWIMMING"]) return elseif(letsFly and checkList["FLYING"]) then - SuperVillain:AddonMessage("No swimming mount selected! Using your flying mount.") + SV:AddonMessage("No swimming mount selected! Using your flying mount.") CallCompanion("MOUNT", checkList["FLYING"]) return end @@ -437,4 +444,4 @@ end LOADER ########################################################## ]]-- -SuperVillain.Registry:NewScript(SetMountCheckButtons); \ No newline at end of file +Registry:NewScript(SetMountCheckButtons); \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/questwatch.lua b/Interface/AddOns/SVUI/scripts/questwatch.lua index e62a98c..a34e572 100644 --- a/Interface/AddOns/SVUI/scripts/questwatch.lua +++ b/Interface/AddOns/SVUI/scripts/questwatch.lua @@ -51,7 +51,7 @@ local tremove, tcopy, twipe, tsort, tconcat = table.remove, table.copy, table.wi GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SV, L, Registry = unpack(select(2, ...)); local QuestDocklet = CreateFrame("Frame", "SVQuestFrameEventListener", UIParent) --[[ ########################################################## @@ -70,17 +70,17 @@ PRE VARS/FUNCTIONS ]]-- local IsTrackingCompletedQuests = function() return band(WATCHFRAME_FILTER_TYPE, WATCHFRAME_FILTER_COMPLETED_QUESTS) == WATCHFRAME_FILTER_COMPLETED_QUESTS or false; -end; +end local IsTrackingRemoteQuests = function() return ( band(WATCHFRAME_FILTER_TYPE, WATCHFRAME_FILTER_REMOTE_ZONES) == WATCHFRAME_FILTER_REMOTE_ZONES ) or false; -end; +end local IsTrackingAchievements = function() return ( band(WATCHFRAME_FILTER_TYPE, WATCHFRAME_FILTER_ACHIEVEMENTS) == WATCHFRAME_FILTER_ACHIEVEMENTS ) or false; -end; +end local IsUsingFilters = function() if ( WATCHFRAME_FILTER_COMPLETED_QUESTS == nil ) then return false; end return true; -end; +end --[[ QUEST ITEM MACRO @@ -111,12 +111,12 @@ local function QWQuestItems() _G["WatchFrameItem"..i.."NormalTexture"]:SetAlpha(0) _G["WatchFrameItem"..i.."IconTexture"]:FillInner() _G["WatchFrameItem"..i.."IconTexture"]:SetTexCoord(0.1,0.9,0.1,0.9) - SuperVillain:AddCD(_G["WatchFrameItem"..i.."Cooldown"]) + SV.Timers:AddCooldown(_G["WatchFrameItem"..i.."Cooldown"]) button.styled = true end end end -end; +end local function QWCheckTimers() local lstTimers = GetQuestTimers(); @@ -129,7 +129,7 @@ local function QWCheckTimers() numTimers = 0; end return filterOK,numTimers; -end; +end local function QWCheckQuests() local numQuestWatches = GetNumQuestWatches(); @@ -197,7 +197,7 @@ local function QWCheckQuests() filterOK = true; end return filterOK, numQuestWatches or 0; -end; +end local function QWSetAllLevels() local i = 1 @@ -229,7 +229,7 @@ local function QWCheckAchievements() filterOK = true; end return filterOK, numAchievementWatches or 0; -end; +end local function QWSetWatchFrameTitle() local _, numQuests, numAchievements, numTimers @@ -239,20 +239,20 @@ local function QWSetWatchFrameTitle() local numTracked = numQuests + numAchievements + numTimers; if WatchFrameTitle then WatchFrameTitle:SetText(OBJECTIVES_TRACKER_LABEL.." ("..numTracked ..")") - end; -end; + end +end local function QWCheckAutoShow(self) - if not self then return end; + if not self then return end if self:IsShown() then if WatchFrameHeader then WatchFrameHeader:Show() - end; + end WatchFrameTitle:Show() WatchFrameCollapseExpandButton:Show() WatchFrameLines:Show() end -end; +end local function SetQuestDockEvents() WatchFrame:HookScript("OnEvent", QWQuestItems) @@ -261,35 +261,35 @@ local function SetQuestDockEvents() WATCHFRAME_MAXLINEWIDTH = WatchFrame:GetWidth(); if QuestDockletFrameList then WATCHFRAME_MAXLINEWIDTH = QuestDockletFrameList:GetWidth() - 62 - end; - end; + end + end WatchFrame.OnUpdate = function() WATCHFRAME_MAXLINEWIDTH = WatchFrame:GetWidth() if QuestDockletFrameList then WATCHFRAME_MAXLINEWIDTH = QuestDockletFrameList:GetWidth() - 62 - end; + end QWQuestItems(); --QWSetAllLevels() WatchFrame.ScrollListUpdate() - end; + end WatchFrame.OnShow = function() Collapsed = (WatchFrame.collapsed or false); if WatchFrameHeader == nil then WatchFrame.userCollapsed = true - end; + end UserCollapsed = (WatchFrame.userCollapsed or false); if Collapsed then WatchFrame_Collapse(WatchFrame) WatchFrame.userCollapsed=UserCollapsed else WatchFrame_Expand(WatchFrame) - end; + end WatchFrame.OnUpdate(); - end; + end WatchFrame.OnShow() hooksecurefunc("QuestLog_Update", WatchFrame.OnUpdate) -end; +end --[[ ########################################################## CORE FUNCTIONS @@ -303,14 +303,14 @@ local QuestDocklet_OnEvent = function(self, event) end end elseif event == "QUEST_AUTOCOMPLETE" then - if SuperDockWindowRight.FrameName and _G[SuperDockWindowRight.FrameName] and _G[SuperDockWindowRight.FrameName]:IsShown() then return end; + if SuperDockWindowRight.FrameName and _G[SuperDockWindowRight.FrameName] and _G[SuperDockWindowRight.FrameName]:IsShown() then return end local button = _G["QuestDockletFrame_ToolBarButton"] if not QuestDockletFrame:IsShown() then SuperDockWindowRight.FrameName = "QuestDockletFrame" if not SuperDockWindowRight:IsShown()then SuperDockWindowRight:Show() end - SuperVillain:CycleDocklets() + SV:CycleDocklets() QuestDockletFrame:Show() if button then button.IsOpen = true; @@ -322,7 +322,31 @@ end local function CreateQuestDocklet() SuperDockWindowRight = _G["SuperDockWindowRight"] - if(not SuperVillain.db.system.questWatch) then + if(SV.___interface >= 60000) then + + ObjectiveTrackerFrame:RemoveTextures(true) + + local frame = CreateFrame("Frame", "SVUI_QuestFrame", UIParent); + frame:SetSize(200, ObjectiveTrackerFrame:GetHeight()); + frame:SetPoint("TOPRIGHT", UIParent, "RIGHT", -200, 100); + ObjectiveTrackerFrame:ClearAllPoints() + ObjectiveTrackerFrame:SetClampedToScreen(false) + ObjectiveTrackerFrame:SetParent(SVUI_QuestFrame) + ObjectiveTrackerFrame:SetAllPoints(SVUI_QuestFrame) + ObjectiveTrackerFrame:SetFrameLevel(SVUI_QuestFrame:GetFrameLevel() + 1) + ObjectiveTrackerFrame.ClearAllPoints = SV.fubar; + ObjectiveTrackerFrame.SetPoint = SV.fubar; + ObjectiveTrackerFrame.SetAllPoints = SV.fubar; + + ObjectiveTrackerFrame.BlocksFrame:RemoveTextures(true) + ObjectiveTrackerFrame.BlocksFrame.QuestHeader:RemoveTextures(true) + ObjectiveTrackerFrame.BlocksFrame.AchievementHeader:RemoveTextures(true) + ObjectiveTrackerFrame.BlocksFrame.ScenarioHeader:RemoveTextures(true) + ObjectiveTrackerFrame.HeaderMenu:RemoveTextures(true) + ObjectiveTrackerFrame.BlockDropDown:RemoveTextures(true) + + SV:SetSVMovable(frame, "Quest Watch"); + elseif(not SV.db.system.questWatch) then local frame = CreateFrame("Frame", "SVUI_QuestFrame", UIParent); frame:SetSize(200, WatchFrame:GetHeight()); frame:SetPoint("RIGHT", UIParent, "RIGHT", -100, 0); @@ -331,19 +355,20 @@ local function CreateQuestDocklet() WatchFrame:SetParent(SVUI_QuestFrame) WatchFrame:SetAllPoints(SVUI_QuestFrame) WatchFrame:SetFrameLevel(SVUI_QuestFrame:GetFrameLevel() + 1) - WatchFrame.ClearAllPoints = SuperVillain.fubar; - WatchFrame.SetPoint = SuperVillain.fubar; - WatchFrame.SetAllPoints = SuperVillain.fubar; - WatchFrameLines.ClearAllPoints = SuperVillain.fubar; - WatchFrameLines.SetPoint = SuperVillain.fubar; - WatchFrameLines.SetAllPoints = SuperVillain.fubar; - SuperVillain:SetSVMovable(frame, "Quest Watch"); + WatchFrame.ClearAllPoints = SV.fubar; + WatchFrame.SetPoint = SV.fubar; + WatchFrame.SetAllPoints = SV.fubar; + WatchFrameLines.ClearAllPoints = SV.fubar; + WatchFrameLines.SetPoint = SV.fubar; + WatchFrameLines.SetAllPoints = SV.fubar; + + SV:SetSVMovable(frame, "Quest Watch"); else local bgTex = [[Interface\BUTTONS\WHITE8X8]] - local bdTex = SuperVillain.Media.bar.glow + local bdTex = SV.Media.bar.glow QuestDockletFrame = CreateFrame("Frame", "QuestDockletFrame", SuperDockWindowRight); QuestDockletFrame:SetFrameStrata("BACKGROUND"); - SuperVillain:RegisterDocklet("QuestDockletFrame", "Quest Watch", ICON_FILE, false, true) + SV:RegisterDocklet("QuestDockletFrame", "Quest Watch", ICON_FILE, false, true) QuestDockletFrameList = CreateFrame("ScrollFrame", nil, QuestDockletFrame); QuestDockletFrameList:SetPoint("TOPLEFT", QuestDockletFrame, -62, 0); @@ -369,10 +394,10 @@ local function CreateQuestDocklet() local value = (scroll - (20 * delta)); if value < -1 then value = 0 - end; + end if value > 420 then value = 420 - end; + end self:SetVerticalScroll(value) self.slider:SetValue(value) end) @@ -394,7 +419,7 @@ local function CreateQuestDocklet() else WATCHFRAME_MAXLINEWIDTH = (WatchFrame:GetWidth() - 100); WATCHFRAME_EXPANDEDWIDTH = (WatchFrame:GetWidth() - 100); - end; + end WatchFrame:SetWidth(WATCHFRAME_MAXLINEWIDTH) WatchFrameHeader:SetParent(QuestDockletFrame) @@ -418,21 +443,21 @@ local function CreateQuestDocklet() QuestDockletFrameSlider:ClearAllPoints() QuestDockletFrameSlider:SetPoint("TOPRIGHT", QuestDockletFrame, "TOPRIGHT", -3, 0) - WatchFrameLines:Formula409(true) + WatchFrameLines:RemoveTextures(true) WatchFrameLines:SetPoint("TOPLEFT", WatchFrame, "TOPLEFT", 87, 0) WatchFrameLines:SetPoint("BOTTOMLEFT", WatchFrame, "BOTTOMLEFT", 87, 0) WatchFrameLines:SetWidth(WATCHFRAME_MAXLINEWIDTH - 100) --[[Lets murder some internals to prevent overriding]]-- - WatchFrame.ClearAllPoints = SuperVillain.fubar; - WatchFrame.SetPoint = SuperVillain.fubar; - WatchFrame.SetAllPoints = SuperVillain.fubar; - WatchFrameLines.ClearAllPoints = SuperVillain.fubar; - WatchFrameLines.SetPoint = SuperVillain.fubar; - WatchFrameLines.SetAllPoints = SuperVillain.fubar; - WatchFrameLines.SetWidth = SuperVillain.fubar; - WatchFrameCollapseExpandButton.ClearAllPoints = SuperVillain.fubar; - WatchFrameCollapseExpandButton.SetPoint = SuperVillain.fubar; - WatchFrameCollapseExpandButton.SetAllPoints = SuperVillain.fubar; + WatchFrame.ClearAllPoints = SV.fubar; + WatchFrame.SetPoint = SV.fubar; + WatchFrame.SetAllPoints = SV.fubar; + WatchFrameLines.ClearAllPoints = SV.fubar; + WatchFrameLines.SetPoint = SV.fubar; + WatchFrameLines.SetAllPoints = SV.fubar; + WatchFrameLines.SetWidth = SV.fubar; + WatchFrameCollapseExpandButton.ClearAllPoints = SV.fubar; + WatchFrameCollapseExpandButton.SetPoint = SV.fubar; + WatchFrameCollapseExpandButton.SetAllPoints = SV.fubar; SetQuestDockEvents() @@ -440,6 +465,6 @@ local function CreateQuestDocklet() QuestDocklet:RegisterEvent("QUEST_AUTOCOMPLETE") QuestDocklet:SetScript("OnEvent", QuestDocklet_OnEvent) end -end; +end -SuperVillain.Registry:NewScript(CreateQuestDocklet) \ No newline at end of file +Registry:NewScript(CreateQuestDocklet) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/raid.lua b/Interface/AddOns/SVUI/scripts/raid.lua index 27e387c..64c4c5c 100644 --- a/Interface/AddOns/SVUI/scripts/raid.lua +++ b/Interface/AddOns/SVUI/scripts/raid.lua @@ -26,7 +26,7 @@ local pairs = _G.pairs; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SV, L, Registry = unpack(select(2, ...)); --[[ ########################################################## RAID UTILITY By: Elv @@ -61,7 +61,7 @@ local function CreateUtilButton(name, parent, template, width, height, point, re if text then local t = b:CreateFontString(nil,"OVERLAY") - t:SetFont(SuperVillain.Media.font.roboto, 14, "NONE") + t:SetFont(SV.Media.font.roboto, 14, "NONE") t:SetAllPoints(b) t:SetJustifyH("CENTER") t:SetText(text) @@ -110,7 +110,7 @@ RaidUtilFrame:SetScript("OnEvent", ToggleRaidUtil) local function LoadRaidUtility() --Create main frame - local RaidUtilityPanel = CreateFrame("Frame", "RaidUtilityPanel", SuperVillain.UIParent, "SecureHandlerClickTemplate") + local RaidUtilityPanel = CreateFrame("Frame", "RaidUtilityPanel", SV.UIParent, "SecureHandlerClickTemplate") RaidUtilityPanel:SetPanelTemplate('Transparent') RaidUtilityPanel:Width(120) RaidUtilityPanel:Height(PANEL_HEIGHT) @@ -118,10 +118,10 @@ local function LoadRaidUtility() RaidUtilityPanel:SetFrameLevel(3) RaidUtilityPanel.toggled = false RaidUtilityPanel:SetFrameStrata("HIGH") - SuperVillain:AddToDisplayAudit(RaidUtilityPanel) + SV:AddToDisplayAudit(RaidUtilityPanel) --Show Button - CreateUtilButton("RaidUtility_ShowButton", SuperVillain.UIParent, "UIMenuButtonStretchTemplate, SecureHandlerClickTemplate", SuperDockToolBarTop.openWidth, SuperDockToolBarTop:GetHeight(), "CENTER", SuperDockToolBarTop, "CENTER", 0, 0, RAID_CONTROL, nil) + CreateUtilButton("RaidUtility_ShowButton", SV.UIParent, "UIMenuButtonStretchTemplate, SecureHandlerClickTemplate", SuperDockToolBarTop.openWidth, SuperDockToolBarTop:GetHeight(), "CENTER", SuperDockToolBarTop, "CENTER", 0, 0, RAID_CONTROL, nil) RaidUtility_ShowButton:SetFrameRef("RaidUtilityPanel", RaidUtilityPanel) RaidUtility_ShowButton:SetAttribute("_onclick", [=[ local raidUtil = self:GetFrameRef("RaidUtilityPanel") @@ -159,19 +159,19 @@ local function LoadRaidUtility() RaidUtility_ShowButton:SetScript("OnDragStart", function(self) self:StartMoving() end) - SuperVillain:AddToDisplayAudit(RaidUtility_ShowButton) + SV:AddToDisplayAudit(RaidUtility_ShowButton) RaidUtility_ShowButton:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() local point = self:GetPoint() local xOffset = self:GetCenter() - local screenWidth = SuperVillain.UIParent:GetWidth() / 2 + local screenWidth = SV.UIParent:GetWidth() / 2 xOffset = xOffset - screenWidth self:ClearAllPoints() if find(point, "BOTTOM") then - self:SetPoint('BOTTOM', SuperVillain.UIParent, 'BOTTOM', xOffset, -1) + self:SetPoint('BOTTOM', SV.UIParent, 'BOTTOM', xOffset, -1) else - self:SetPoint('TOP', SuperVillain.UIParent, 'TOP', xOffset, 1) + self:SetPoint('TOP', SV.UIParent, 'TOP', xOffset, 1) end end) @@ -188,7 +188,7 @@ local function LoadRaidUtility() CreateUtilButton("DisbandRaidButton", RaidUtilityPanel, "UIMenuButtonStretchTemplate", buttonWidth, 18, "TOP", RaidUtilityPanel, "TOP", 0, -5, L['Disband Group'], nil) DisbandRaidButton:SetScript("OnMouseUp", function(self) if CheckRaidStatus() then - SuperVillain:StaticPopup_Show("DISBAND_RAID") + SV:StaticPopup_Show("DISBAND_RAID") end end) @@ -221,7 +221,7 @@ local function LoadRaidUtility() CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton:Height(18) CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton:SetWidth(buttonWidth) local markersText = CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton:CreateFontString(nil,"OVERLAY") - markersText:SetFont(SuperVillain.Media.font.roboto, 14, "NONE") + markersText:SetFont(SV.Media.font.roboto, 14, "NONE") markersText:SetAllPoints(CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton) markersText:SetJustifyH("CENTER") markersText:SetText("World Markers") @@ -250,7 +250,7 @@ local function LoadRaidUtility() for i, gName in pairs(buttons) do local button = _G[gName] if(button) then - button:Formula409() + button:RemoveTextures() button:SetFramedButtonTemplate() button:HookScript("OnEnter", ButtonEnter) button:HookScript("OnLeave", ButtonLeave) @@ -258,4 +258,4 @@ local function LoadRaidUtility() end end end -SuperVillain.Registry:NewScript(LoadRaidUtility); \ No newline at end of file +Registry:NewScript(LoadRaidUtility); \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/reactions.lua b/Interface/AddOns/SVUI/scripts/reactions.lua index 30d91e6..226352f 100644 --- a/Interface/AddOns/SVUI/scripts/reactions.lua +++ b/Interface/AddOns/SVUI/scripts/reactions.lua @@ -32,7 +32,7 @@ local format, gsub = string.format, string.gsub; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SV, L, Registry = unpack(select(2, ...)); --[[ ########################################################## LOCALS (from ShestakUI by:Shestak) @@ -124,50 +124,75 @@ local random = math.random local function rng() return random(1,6) end + +local REACTION_INTERRUPT, REACTION_WOOT, REACTION_LOOKY, REACTION_SHARE, REACTION_EMOTE, REACTION_CHAT = false, false, false, false, false, false; + local SAPPED_MESSAGE = { - "Oh Hell No... {rt8}SAPPED{rt8}", - "{rt8}SAPPED{rt8}", + "Oh Hell No ... {rt8}SAPPED{rt8}", + "{rt8}SAPPED{rt8} ...Someone's about to get slapped!", "Mother Fu... {rt8}SAPPED{rt8}", - "{rt8}SAPPED{rt8}", + "{rt8}SAPPED{rt8} ...How cute", "{rt8}SAPPED{rt8} ...Ain't Nobody Got Time For That!", - "{rt8}SAPPED{rt8}" + "Uh-Oh... {rt8}SAPPED{rt8}" } + +local ReactionEmotes = { + "SALUTE", + "THANK", + "DRINK" +} + +local function Thanks_Emote(sourceName) + if not REACTION_EMOTE then return end + local index = random(1,#ReactionEmotes) + DoEmote(ReactionEmotes[index], sourceName) +end + local ChatLogHandler = CreateFrame("Frame") local ChatLogHandler_OnEvent = function(self, event, ...) local _, subEvent, _, sourceGUID, sourceName, _, _, destGUID, destName, _, _, spellID, _, _, otherSpellID = ... if not sourceName then return end - if(SuperVillain.db.system.pvpinterrupt) then + if(REACTION_INTERRUPT) then if ((spellID == 6770) and (destName == toon) and (subEvent == "SPELL_AURA_APPLIED" or subEvent == "SPELL_AURA_REFRESH")) then local msg = SAPPED_MESSAGE[rng()] SendChatMessage(msg, "SAY") - DEFAULT_CHAT_FRAME:AddMessage("Sapped by: "..(sourceName or "(unknown)")) + SV:AddonMessage("Sapped by: "..sourceName) + DoEmote("CRACK", sourceName) elseif(subEvent == "SPELL_INTERRUPT" and sourceGUID == UnitGUID("player") and IsInGroup()) then SendChatMessage(INTERRUPTED.." "..destName..": "..GetSpellLink(otherSpellID), MsgTest()) end end - if(SuperVillain.db.system.woot) then + if(REACTION_WOOT) then for key, value in pairs(Reactions.Woot) do if spellID == key and value == true and destName == toon and sourceName ~= toon and (subEvent == "SPELL_AURA_APPLIED" or subEvent == "SPELL_CAST_SUCCESS") then - SendChatMessage(L["Thanks for "]..GetSpellLink(spellID)..", "..sourceName, "WHISPER", nil, sourceName) + Thanks_Emote(sourceName) + --SendChatMessage(L["Thanks for "]..GetSpellLink(spellID)..", "..sourceName, "WHISPER", nil, sourceName) print(GetSpellLink(spellID)..L[" received from "]..sourceName) end end end - if(SuperVillain.db.system.lookwhaticando) then + if(REACTION_LOOKY) then + local outbound; local spells = Reactions.LookWhatICanDo local _, _, difficultyID = GetInstanceInfo() + if(difficultyID ~= 0 and subEvent == "SPELL_CAST_SUCCESS") then if(not (sourceGUID == UnitGUID("player") and sourceName == toon)) then for i, spells in pairs(spells) do if(spellID == spells) then if(destName == nil) then - SendChatMessage(format(L["%s used a %s."], sourceName, GetSpellLink(spellID)), MsgTest()) + outbound = (L["%s used a %s."]):format(sourceName, GetSpellLink(spellID)) + else + outbound = (L["%s used a %s."]):format(sourceName, GetSpellLink(spellID).." -> "..destName) + end + if(REACTION_CHAT) then + SendChatMessage(outbound, MsgTest()) else - SendChatMessage(format(L["%s used a %s."], sourceName, GetSpellLink(spellID).." -> "..destName), MsgTest()) + print(outbound) end end end @@ -176,9 +201,14 @@ local ChatLogHandler_OnEvent = function(self, event, ...) for i, spells in pairs(spells) do if(spellID == spells) then if(destName == nil) then - SendChatMessage(format(L["%s used a %s."], sourceName, GetSpellLink(spellID)), MsgTest()) + outbound = (L["%s used a %s."]):format(sourceName, GetSpellLink(spellID)) + else + outbound = GetSpellLink(spellID).." -> "..destName + end + if(REACTION_CHAT) then + SendChatMessage(outbound, MsgTest()) else - SendChatMessage(GetSpellLink(spellID).." -> "..destName, MsgTest()) + print(outbound) end end end @@ -186,55 +216,72 @@ local ChatLogHandler_OnEvent = function(self, event, ...) end end - if(SuperVillain.db.system.sharingiscaring) then + if(REACTION_SHARE) then if not IsInGroup() or InCombatLockdown() or not subEvent or not spellID then return end if not UnitInRaid(sourceName) and not UnitInParty(sourceName) then return end local sourceName = format(sourceName:gsub("%-[^|]+", "")) + if(not sourceName) then return end + local thanks = false + local outbound if subEvent == "SPELL_CAST_SUCCESS" then -- Feasts if (spellID == 126492 or spellID == 126494) then - SendChatMessage(string.format(L["%s has prepared a %s - [%s]."], sourceName, GetSpellLink(spellID), SPELL_STAT1_NAME), MsgTest(true)) + outbound = (L["%s has prepared a %s - [%s]."]):format(sourceName, GetSpellLink(spellID), SPELL_STAT1_NAME) elseif (spellID == 126495 or spellID == 126496) then - SendChatMessage(string.format(L["%s has prepared a %s - [%s]."], sourceName, GetSpellLink(spellID), SPELL_STAT2_NAME), MsgTest(true)) + outbound = (L["%s has prepared a %s - [%s]."]):format(sourceName, GetSpellLink(spellID), SPELL_STAT2_NAME) elseif (spellID == 126501 or spellID == 126502) then - SendChatMessage(string.format(L["%s has prepared a %s - [%s]."], sourceName, GetSpellLink(spellID), SPELL_STAT3_NAME), MsgTest(true)) + outbound = (L["%s has prepared a %s - [%s]."]):format(sourceName, GetSpellLink(spellID), SPELL_STAT3_NAME) elseif (spellID == 126497 or spellID == 126498) then - SendChatMessage(string.format(L["%s has prepared a %s - [%s]."], sourceName, GetSpellLink(spellID), SPELL_STAT4_NAME), MsgTest(true)) + outbound = (L["%s has prepared a %s - [%s]."]):format(sourceName, GetSpellLink(spellID), SPELL_STAT4_NAME) elseif (spellID == 126499 or spellID == 126500) then - SendChatMessage(string.format(L["%s has prepared a %s - [%s]."], sourceName, GetSpellLink(spellID), SPELL_STAT5_NAME), MsgTest(true)) + outbound = (L["%s has prepared a %s - [%s]."]):format(sourceName, GetSpellLink(spellID), SPELL_STAT5_NAME) elseif (spellID == 104958 or spellID == 105193 or spellID == 126503 or spellID == 126504 or spellID == 145166 or spellID == 145169 or spellID == 145196) then - SendChatMessage(string.format(L["%s has prepared a %s."], sourceName, GetSpellLink(spellID)), MsgTest(true)) + outbound = (L["%s has prepared a %s - [%s]."]):format(sourceName, GetSpellLink(spellID)) -- Refreshment Table elseif spellID == 43987 then - SendChatMessage(string.format(L["%s has prepared a %s."], sourceName, GetSpellLink(spellID)), MsgTest(true)) + outbound = (L["%s has prepared a %s."]):format(sourceName, GetSpellLink(spellID)) -- Ritual of Summoning elseif spellID == 698 then - SendChatMessage(string.format(L["%s is casting %s. Click!"], sourceName, GetSpellLink(spellID)), MsgTest(true)) + outbound = (L["%s is casting %s. Click!"]):format(sourceName, GetSpellLink(spellID)) -- Piccolo of the Flaming Fire elseif spellID == 18400 then - SendChatMessage(string.format(L["%s used a %s."], sourceName, GetSpellLink(spellID)), MsgTest(true)) + outbound = (L["%s used a %s."]):format(sourceName, GetSpellLink(spellID)) end + if(outbound) then thanks = true end elseif subEvent == "SPELL_SUMMON" then -- Repair Bots if Reactions.Bots[spellID] then - SendChatMessage(string.format(L["%s has put down a %s."], sourceName, GetSpellLink(spellID)), MsgTest(true)) + outbound = (L["%s has put down a %s."]):format(sourceName, GetSpellLink(spellID)) + thanks = true end elseif subEvent == "SPELL_CREATE" then -- Ritual of Souls and MOLL-E if (spellID == 29893 or spellID == 54710) then - SendChatMessage(string.format(L["%s has put down a %s."], sourceName, GetSpellLink(spellID)), MsgTest(true)) + outbound = (L["%s has put down a %s."]):format(sourceName, GetSpellLink(spellID)) + thanks = true -- Toys elseif Reactions.Toys[spellID] then - SendChatMessage(string.format(L["%s has put down a %s."], sourceName, GetSpellLink(spellID)), MsgTest(true)) + outbound = (L["%s has put down a %s."]):format(sourceName, GetSpellLink(spellID)) -- Portals elseif Reactions.Portals[spellID] then - SendChatMessage(string.format(L["%s is casting %s."], sourceName, GetSpellLink(spellID)), MsgTest(true)) + outbound = (L["%s is casting %s."]):format(sourceName, GetSpellLink(spellID)) end elseif subEvent == "SPELL_AURA_APPLIED" then -- Turkey Feathers and Party G.R.E.N.A.D.E. if (spellID == 61781 or ((spellID == 51508 or spellID == 51510) and destName == toon)) then - SendChatMessage(string.format(L["%s used a %s."], sourceName, GetSpellLink(spellID)), MsgTest(true)) + outbound = (L["%s used a %s."]):format(sourceName, GetSpellLink(spellID)) + end + end + + if(outbound) then + if(REACTION_CHAT) then + SendChatMessage(outbound, MsgTest(true)) + else + print(outbound) + end + if(thanks and sourceName) then + Thanks_Emote(sourceName) end end end @@ -244,8 +291,15 @@ end CONFIG TOGGLE ########################################################## ]]-- -function SuperVillain:ToggleReactions() - local settings = SuperVillain.db.system +function SV:ToggleReactions() + local settings = self.db.system + + REACTION_INTERRUPT = settings.pvpinterrupt + REACTION_WOOT = settings.woot + REACTION_LOOKY = settings.lookwhaticando + REACTION_SHARE = settings.sharingiscaring + REACTION_EMOTE = settings.reactionEmote + REACTION_CHAT = settings.reactionChat if(settings.stupidhat) then StupidHatHandler:RegisterEvent("ZONE_CHANGED_NEW_AREA") @@ -255,7 +309,7 @@ function SuperVillain:ToggleReactions() StupidHatHandler:SetScript("OnEvent", nil) end - if(not settings.sharingiscaring) and (not settings.pvpinterrupt) and (not settings.woot) and (not settings.lookwhaticando) then + if(not REACTION_SHARE) and (not REACTION_INTERRUPT) and (not REACTION_WOOT) and (not REACTION_LOOKY) then ChatLogHandler:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED") ChatLogHandler:SetScript("OnEvent", nil) else @@ -269,7 +323,7 @@ LOADER ########################################################## ]]-- local function LoadReactions() - SuperVillain:ToggleReactions() + SV:ToggleReactions() end -SuperVillain.Registry:NewScript(LoadReactions) \ No newline at end of file +Registry:NewScript(LoadReactions) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/spellbind.lua b/Interface/AddOns/SVUI/scripts/spellbind.lua index 01f269b..ebd2163 100644 --- a/Interface/AddOns/SVUI/scripts/spellbind.lua +++ b/Interface/AddOns/SVUI/scripts/spellbind.lua @@ -25,44 +25,69 @@ local ipairs = _G.ipairs; local type = _G.type; local tinsert = _G.tinsert; local string = _G.string; ---[[ STRING METHODS ]]-- -local format, gsub = string.format, string.gsub; --[[ ########################################################## -GET ADDON DATA -########################################################## -]]-- -local SuperVillain, L = unpack(select(2, ...)); ---[[ -########################################################## -Simple click2cast spell binder(sBinder by Fernir) +Simple click2cast spell SpellBinder(sBinder by Fernir) ########################################################## ]]-- +ClickCastFrames = _G.ClickCastFrames or {} + +local UnitParseListing = { + "PlayerFrame", "PetFrame", + "TargetFrame", "TargetFrameToT", + "FocusFrame", "FocusFrameToT", + "Boss1TargetFrame", "Boss2TargetFrame", "Boss3TargetFrame", "Boss4TargetFrame", + "ArenaEnemyFrame1", "ArenaEnemyFrame2", "ArenaEnemyFrame3", "ArenaEnemyFrame4", "ArenaEnemyFrame5", + "PartyMemberFrame1", "PartyMemberFrame2", "PartyMemberFrame3", "PartyMemberFrame4", "PartyMemberFrame5", + "PartyMemberFrame1PetFrame", "PartyMemberFrame2PetFrame", "PartyMemberFrame3PetFrame", "PartyMemberFrame4PetFrame", "PartyMemberFrame5PetFrame", + "CompactPartyFrameMemberSelf", "CompactPartyFrameMemberSelfBuff1", "CompactPartyFrameMemberSelfBuff2", "CompactPartyFrameMemberSelfBuff3", + "CompactPartyFrameMemberSelfDebuff1", "CompactPartyFrameMemberSelfDebuff2", "CompactPartyFrameMemberSelfDebuff3", + "CompactPartyFrameMember1Buff1", "CompactPartyFrameMember1Buff2", "CompactPartyFrameMember1Buff3", + "CompactPartyFrameMember1Debuff1", "CompactPartyFrameMember1Debuff2", "CompactPartyFrameMember1Debuff3", + "CompactPartyFrameMember2Buff1", "CompactPartyFrameMember2Buff2", "CompactPartyFrameMember2Buff3", + "CompactPartyFrameMember2Debuff1", "CompactPartyFrameMember2Debuff2", "CompactPartyFrameMember2Debuff3", + "CompactPartyFrameMember3Buff1", "CompactPartyFrameMember3Buff2", "CompactPartyFrameMember3Buff3", + "CompactPartyFrameMember3Debuff1", "CompactPartyFrameMember3Debuff2", "CompactPartyFrameMember3Debuff3", + "CompactPartyFrameMember4Buff1", "CompactPartyFrameMember4Buff2", "CompactPartyFrameMember4Buff3", + "CompactPartyFrameMember4Debuff1", "CompactPartyFrameMember4Debuff2", "CompactPartyFrameMember4Debuff3", + "CompactPartyFrameMember5Buff1", "CompactPartyFrameMember5Buff2", "CompactPartyFrameMember5Buff3", + "CompactPartyFrameMember5Debuff1", "CompactPartyFrameMember5Debuff2", "CompactPartyFrameMember5Debuff3" +} + +for _, gName in pairs(UnitParseListing) do + local frame = _G[gName] + if(frame) then + ClickCastFrames[frame] = true + end +end + local DB = {}; DB.spells = DB.spells or {} DB.frames = DB.frames or {} DB.keys = DB.keys or {} -local binder = CreateFrame("Frame", "SVUI_SpellBinder", SpellBookFrame, "ButtonFrameTemplate") -binder:SetPoint("TOPLEFT", SpellBookFrame, "TOPRIGHT", 100, 0) -binder:SetSize(300, 400) -binder:Hide() - -binder.title = binder:CreateFontString(nil, "OVERLAY", "GameFontNormal") -binder.title:SetPoint("TOP", binder, "TOP", 0, -5) -binder.title:SetText("Click-Cast Bindings") - -binder.sbOpen = false -binder.spellbuttons = {} +local SpellBinder = CreateFrame("Frame", "SVUI_SpellBinder", SpellBookFrame, "ButtonFrameTemplate") +SpellBinder:SetPoint("TOPLEFT", SpellBookFrame, "TOPRIGHT", 100, 0) +SpellBinder:SetSize(300, 400) +SpellBinder:Hide() -binder.list = CreateFrame("ScrollFrame", "SVUI_SpellBinderSpellList", _G["SVUI_SpellBinderInset"], "UIPanelScrollFrameTemplate") -binder.list.child = CreateFrame("Frame", nil, binder.list) -binder.list:SetPoint("TOPLEFT", _G["SVUI_SpellBinderInset"], "TOPLEFT", 0, -5) -binder.list:SetPoint("BOTTOMRIGHT", _G["SVUI_SpellBinderInset"], "BOTTOMRIGHT", -30, 5) -binder.list:SetScrollChild(binder.list.child) +SpellBinder.title = SpellBinder:CreateFontString(nil, "OVERLAY", "GameFontNormal") +SpellBinder.title:SetPoint("TOP", SpellBinder, "TOP", 0, -5) +SpellBinder.title:SetText("Click-Cast Bindings") -binder.roster = {} +SpellBinder.sbOpen = false +SpellBinder.spellbuttons = {} +SpellBinder.list = CreateFrame("ScrollFrame", "SVUI_SpellBinderSpellList", _G["SVUI_SpellBinderInset"], "UIPanelScrollFrameTemplate") +SpellBinder.list.child = CreateFrame("Frame", nil, SpellBinder.list) +SpellBinder.list:SetPoint("TOPLEFT", _G["SVUI_SpellBinderInset"], "TOPLEFT", 0, -5) +SpellBinder.list:SetPoint("BOTTOMRIGHT", _G["SVUI_SpellBinderInset"], "BOTTOMRIGHT", -30, 5) +SpellBinder.list:SetScrollChild(SpellBinder.list.child) +--[[ +########################################################## +SCRIPT HANDLERS +########################################################## +]]-- local BoundSpell_OnEnter = function(self) self.delete:GetNormalTexture():SetVertexColor(1, 0, 0) self:SetBackdrop({bgFile = "Interface\\Buttons\\WHITE8x8"}) @@ -93,7 +118,7 @@ local SpellBindTab_OnLeave = function(self) end local SpellBindTab_OnShow = function(self) - if binder:IsVisible() then self:SetChecked(true) end + if SpellBinder:IsVisible() then self:SetChecked(true) end local num = GetNumSpellTabs() local lastTab = _G["SpellBookSkillLineTab"..num] @@ -105,35 +130,25 @@ local SpellBindTab_OnShow = function(self) end local SpellBindTab_OnClick = function(self) - if InCombatLockdown() then binder:Hide() return end - if binder:IsVisible() then - binder:Hide() - binder.sbOpen = false + if InCombatLockdown() then SpellBinder:Hide() return end + if SpellBinder:IsVisible() then + SpellBinder:Hide() + SpellBinder.sbOpen = false else - binder:Show() - binder.sbOpen = true + SpellBinder:Show() + SpellBinder.sbOpen = true end - binder:ToggleButtons() + SpellBinder:ToggleButtons() end local SpellBindClose_OnClick = function(self) - binder:Hide() - binder.sbOpen = false - binder:ToggleButtons() -end - -local _hook_SpellBookFrame_OnUpdate = function(self) - if binder.sbOpen then binder:ToggleButtons() end -end - -local _hook_SpellBookFrame_OnHide = function(self) - binder:Hide() - binder.sbOpen = false - binder:ToggleButtons() + SpellBinder:Hide() + SpellBinder.sbOpen = false + SpellBinder:ToggleButtons() end -local addSpell = function(self, button) - if binder.sbOpen then +local SpellBindMask_OnClick = function(self, button) + if SpellBinder.sbOpen then local slot = SpellBook_GetSpellBookSlot(self:GetParent()) local spellname, subtype = GetSpellBookItemName(slot, SpellBookFrame.bookType) local texture = GetSpellBookItemTexture(slot, SpellBookFrame.bookType) @@ -147,7 +162,7 @@ local addSpell = function(self, button) if IsAltKeyDown() then modifier = "Alt-"..modifier end if IsHarmfulSpell(slot, SpellBookFrame.bookType) then - button = format("%s%d", "harmbutton", SecureButton_GetButtonSuffix(button)) + button = ("%s%d"):format("harmbutton", SecureButton_GetButtonSuffix(button)) originalbutton = "|cffff2222(harm)|r "..originalbutton else button = SecureButton_GetButtonSuffix(button) @@ -156,19 +171,34 @@ local addSpell = function(self, button) for i, v in pairs(DB.spells) do if v.spell == spellname then return end end tinsert(DB.spells, {["id"] = slot, ["modifier"] = modifier, ["button"] = button, ["spell"] = spellname, ["rank"] = rank, ["texture"] = texture, ["origbutton"] = originalbutton,}) - binder:BuildSpells(false) + SpellBinder:BuildSpells(false) end end end +local SpellBindDelete_OnClick = function(self) + for j, k in ipairs(DB.spells) do + if k ~= spell then + k.checked = false + _G[j.."_cbs"]:SetBackdropColor(0, 0, 0, 0) + end + end + spell.checked = not spell.checked + SpellBinder:DeleteSpell() +end +--[[ +########################################################## +EVENT HANDLERS +########################################################## +]]-- local SpellBind_OnEvent = function(self, event, ...) if event == "PLAYER_LOGIN" then DB = SVUI_Cache["Bindings"] or {} DB.spells = DB.spells or {} DB.frames = DB.frames or {} DB.keys = DB.keys or {} - binder:BuildList() - binder:BuildSpells(true) + SpellBinder:BuildList() + SpellBinder:BuildSpells(true) for i = 1, SPELLS_PER_PAGE do local parent = _G["SpellButton"..i] @@ -176,7 +206,7 @@ local SpellBind_OnEvent = function(self, event, ...) button:SetID(parent:GetID()) button:RegisterForClicks("AnyDown") button:SetAllPoints(parent) - button:SetScript("OnClick", addSpell) + button:SetScript("OnClick", SpellBindMask_OnClick) button.shine = SpellBook_GetAutoCastShine() button.shine:Show() @@ -185,16 +215,20 @@ local SpellBind_OnEvent = function(self, event, ...) AutoCastShine_AutoCastStart(button.shine) button:Hide() - binder.spellbuttons[i] = button + SpellBinder.spellbuttons[i] = button end self:UnregisterEvent("PLAYER_LOGIN") elseif event == "PLAYER_ENTERING_WORLD" or event == "GROUP_ROSTER_UPDATE" or event == "ZONE_CHANGED" or event == "ZONE_CHANGED_NEW_AREA" then - binder:UpdateAll() + SpellBinder:UpdateAll() end end - -local function binder_BuildSpells(self, delete) +--[[ +########################################################## +METHODS +########################################################## +]]-- +function SpellBinder:BuildSpells(delete) local oldb local scroll = self.list.child scroll:SetPoint("TOPLEFT") @@ -241,16 +275,7 @@ local function binder_BuildSpells(self, delete) bf.delete:GetNormalTexture():SetVertexColor(0.8, 0, 0) bf.delete:SetPushedTexture("Interface\\BUTTONS\\UI-GroupLoot-Pass-Up") bf.delete:SetHighlightTexture("Interface\\BUTTONS\\UI-GroupLoot-Pass-Up") - bf.delete:SetScript("OnClick", function() - for j, k in ipairs(DB.spells) do - if k ~= spell then - k.checked = false - _G[j.."_cbs"]:SetBackdropColor(0, 0, 0, 0) - end - end - spell.checked = not spell.checked - binder:DeleteSpell() - end) + bf.delete:SetScript("OnClick", SpellBindDelete_OnClick) bf:SetScript("OnEnter", BoundSpell_OnEnter) bf:SetScript("OnLeave", BoundSpell_OnLeave) @@ -259,12 +284,11 @@ local function binder_BuildSpells(self, delete) bf.fs:SetText(spell.modifier..spell.origbutton) bf.fs:SetPoint("RIGHT", bf.delete, "LEFT", -4, 0) - for frame, j in pairs(self.roster) do + for frame,_ in pairs(ClickCastFrames) do if frame and DB.frames[frame] then if frame:CanChangeAttribute() or frame:CanChangeProtectedState() then if frame:GetAttribute(spell.modifier.."type"..spell.button) ~= "menu" then --frame:RegisterForClicks("AnyDown") - if spell.button:find("harmbutton") then frame:SetAttribute(spell.modifier..spell.button, spell.spell) frame:SetAttribute(spell.modifier.."type-"..spell.spell, "spell") @@ -291,37 +315,37 @@ local function binder_BuildSpells(self, delete) end end -local function binder_BuildList(self) - for frame, value in pairs(self.roster) do +function SpellBinder:BuildList() + for frame,_ in pairs(ClickCastFrames) do DB.frames[frame] = DB.frames[frame] or true end end -local function binder_ToggleButtons(self) +function SpellBinder:ToggleButtons() for i = 1, SPELLS_PER_PAGE do - if(binder.spellbuttons[i]) then - binder.spellbuttons[i]:Hide() - if binder.sbOpen and SpellBookFrame.bookType ~= BOOKTYPE_PROFESSION then - local slot = SpellBook_GetSpellBookSlot(binder.spellbuttons[i]:GetParent()) + if(SpellBinder.spellbuttons[i]) then + SpellBinder.spellbuttons[i]:Hide() + if SpellBinder.sbOpen and SpellBookFrame.bookType ~= BOOKTYPE_PROFESSION then + local slot = SpellBook_GetSpellBookSlot(SpellBinder.spellbuttons[i]:GetParent()) if slot then local spellname, subtype = GetSpellBookItemName(slot, SpellBookFrame.bookType) if spellname then - binder.spellbuttons[i]:Show() + SpellBinder.spellbuttons[i]:Show() end end end end end - binder:BuildList() - binder:BuildSpells(true) - if binder:IsVisible() then binder.tab:SetChecked(true) else binder.tab:SetChecked(false) end + SpellBinder:BuildList() + SpellBinder:BuildSpells(true) + if SpellBinder:IsVisible() then SpellBinder.tab:SetChecked(true) else SpellBinder.tab:SetChecked(false) end end -local function binder_DeleteSpell(self) +function SpellBinder:DeleteSpell() local count = table.getn(DB.spells) for i, spell in ipairs(DB.spells) do if spell.checked then - for frame, j in pairs(self.roster) do + for frame,_ in pairs(ClickCastFrames) do local f if frame and type(frame) == "table" then f = frame:GetName() end if f then @@ -345,7 +369,7 @@ local function binder_DeleteSpell(self) self:BuildSpells(true) end -local function binder_UpdateAll(self) +function SpellBinder:UpdateAll() if InCombatLockdown() then self:SheduleUpdate() return @@ -354,7 +378,7 @@ local function binder_UpdateAll(self) self:BuildSpells(true) end -local function binder_SheduleUpdate(self) +function SpellBinder:SheduleUpdate() self.updated = false if InCombatLockdown() then self:RegisterEvent("PLAYER_REGEN_ENABLED") @@ -365,70 +389,64 @@ local function binder_SheduleUpdate(self) end --[[ ########################################################## -LOADER +SET HOOKS ########################################################## ]]-- -local function enable(frame) - if type(frame) == "string" then - local frameName = frame - frame = _G[frameName] - end - - if frame then - binder.roster[frame] = true - end +local _hook_CreateFrame = function(self, name, parent, template) + if template and template:find("SecureUnitButtonTemplate") then ClickCastFrames[_G[name]] = true end end -local BindableFrames = SuperVillain.SVUnit.Roster +local _hook_CompactUnitFrame_SetUpFrame = function(self, ...) + ClickCastFrames[self] = true +end -for i, v in pairs(BindableFrames) do - if _G[v] then binder.roster[_G[v]] = true end +local _hook_SpellBookFrame_OnUpdate = function(self) + if SpellBinder.sbOpen then SpellBinder:ToggleButtons() end end - -binder.BuildSpells = binder_BuildSpells -binder.BuildList = binder_BuildList -binder.ToggleButtons = binder_ToggleButtons -binder.DeleteSpell = binder_DeleteSpell -binder.UpdateAll = binder_UpdateAll -binder.SheduleUpdate = binder_SheduleUpdate - -_G["SVUI_SpellBinderCloseButton"]:SetScript("OnClick", SpellBindClose_OnClick) -hooksecurefunc("SpellBookFrame_Update", _hook_SpellBookFrame_OnUpdate) -hooksecurefunc(SpellBookFrame, "Hide", _hook_SpellBookFrame_OnHide) -binder:Formula409() -_G["SVUI_SpellBinderInset"]:Formula409() - -binder:SetPanelTemplate("Action") -binder.Panel:SetPoint("TOPLEFT", -18, 0) -binder.Panel:SetPoint("BOTTOMRIGHT", 0, 0) - -binder.list:Formula409() -binder.list:SetPanelTemplate("Inset") - -binder.tab = CreateFrame("CheckButton", nil, _G["SpellBookSkillLineTab1"], "SpellBookSkillLineTabTemplate") -binder.tab:Formula409() -binder.tab:SetButtonTemplate() -binder.tab:SetNormalTexture("Interface\\ICONS\\Achievement_Guild_Doctorisin") -binder.tab:GetNormalTexture():ClearAllPoints() -binder.tab:GetNormalTexture():SetPoint("TOPLEFT", 2, -2) -binder.tab:GetNormalTexture():SetPoint("BOTTOMRIGHT", -2, 2) -binder.tab:GetNormalTexture():SetTexCoord(0.1, 0.9, 0.1, 0.9) -binder.tab:SetScript("OnShow", SpellBindTab_OnShow) -binder.tab:SetScript("OnClick", SpellBindTab_OnClick) -binder.tab:Show() - -binder:RegisterEvent("GROUP_ROSTER_UPDATE") -binder:RegisterEvent("PLAYER_ENTERING_WORLD") -binder:RegisterEvent("PLAYER_LOGIN") -binder:RegisterEvent("ZONE_CHANGED_NEW_AREA") -binder:RegisterEvent("ZONE_CHANGED") -binder:SetScript("OnEvent", SpellBind_OnEvent) - -local function LoadSpellBinder() - for i, v in pairs(SuperVillain.SVUnit.Roster) do - if _G[v] then binder.roster[_G[v]] = true end - end +local _hook_SpellBookFrame_OnHide = function(self) + SpellBinder:Hide() + SpellBinder.sbOpen = false + SpellBinder:ToggleButtons() end -SuperVillain.Registry:NewScript(LoadSpellBinder) \ No newline at end of file +hooksecurefunc("CreateFrame", _hook_CreateFrame) +hooksecurefunc("CompactUnitFrame_SetUpFrame", _hook_CompactUnitFrame_SetUpFrame) +hooksecurefunc("SpellBookFrame_Update", _hook_SpellBookFrame_OnUpdate) +hooksecurefunc(SpellBookFrame, "Hide", _hook_SpellBookFrame_OnHide) +--[[ +########################################################## +LOADER +########################################################## +]]-- +SVUI_SpellBinderCloseButton:SetScript("OnClick", SpellBindClose_OnClick) + +SpellBinder:RemoveTextures() + +SVUI_SpellBinderInset:RemoveTextures() + +SpellBinder:SetPanelTemplate("Action") +SpellBinder.Panel:SetPoint("TOPLEFT", -18, 0) +SpellBinder.Panel:SetPoint("BOTTOMRIGHT", 0, 0) + +SpellBinder.list:RemoveTextures() +SpellBinder.list:SetPanelTemplate("Inset") + +SpellBinder.tab = CreateFrame("CheckButton", nil, _G["SpellBookSkillLineTab1"], "SpellBookSkillLineTabTemplate") +SpellBinder.tab:RemoveTextures() +SpellBinder.tab:SetButtonTemplate() +SpellBinder.tab:SetNormalTexture("Interface\\ICONS\\Achievement_Guild_Doctorisin") +SpellBinder.tab:GetNormalTexture():ClearAllPoints() +SpellBinder.tab:GetNormalTexture():SetPoint("TOPLEFT", 2, -2) +SpellBinder.tab:GetNormalTexture():SetPoint("BOTTOMRIGHT", -2, 2) +SpellBinder.tab:GetNormalTexture():SetTexCoord(0.1, 0.9, 0.1, 0.9) +SpellBinder.tab:SetScript("OnShow", SpellBindTab_OnShow) +SpellBinder.tab:SetScript("OnClick", SpellBindTab_OnClick) +SpellBinder.tab:Show() + +SpellBinder:RegisterEvent("GROUP_ROSTER_UPDATE") +SpellBinder:RegisterEvent("PLAYER_ENTERING_WORLD") +SpellBinder:RegisterEvent("PLAYER_LOGIN") +SpellBinder:RegisterEvent("ZONE_CHANGED_NEW_AREA") +SpellBinder:RegisterEvent("ZONE_CHANGED") +SpellBinder:SetScript("OnEvent", SpellBind_OnEvent) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/alerts.lua b/Interface/AddOns/SVUI/system/alerts.lua index 9ef2faa..46740c1 100644 --- a/Interface/AddOns/SVUI/system/alerts.lua +++ b/Interface/AddOns/SVUI/system/alerts.lua @@ -41,7 +41,7 @@ local assert = enforce; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SV, L = unpack(select(2, ...)); --[[ ########################################################## LOCAL VARS @@ -49,49 +49,49 @@ LOCAL VARS ]]-- local BUFFER = {}; local function UpdateActionBarOptions() - if InCombatLockdown() or not SuperVillain.db.SVBar.IsLoaded then return end; - if (SuperVillain.db.SVBar.Bar2.enable ~= InterfaceOptionsActionBarsPanelBottomRight:GetChecked()) then + if InCombatLockdown() or not SV.db.SVBar.IsLoaded then return end + if (SV.db.SVBar.Bar2.enable ~= InterfaceOptionsActionBarsPanelBottomRight:GetChecked()) then InterfaceOptionsActionBarsPanelBottomRight:Click() - end; - if (SuperVillain.db.SVBar.Bar3.enable ~= InterfaceOptionsActionBarsPanelRightTwo:GetChecked()) then + end + if (SV.db.SVBar.Bar3.enable ~= InterfaceOptionsActionBarsPanelRightTwo:GetChecked()) then InterfaceOptionsActionBarsPanelRightTwo:Click() - end; - if (SuperVillain.db.SVBar.Bar4.enable ~= InterfaceOptionsActionBarsPanelRight:GetChecked()) then + end + if (SV.db.SVBar.Bar4.enable ~= InterfaceOptionsActionBarsPanelRight:GetChecked()) then InterfaceOptionsActionBarsPanelRight:Click() - end; - if (SuperVillain.db.SVBar.Bar5.enable ~= InterfaceOptionsActionBarsPanelBottomLeft:GetChecked()) then + end + if (SV.db.SVBar.Bar5.enable ~= InterfaceOptionsActionBarsPanelBottomLeft:GetChecked()) then InterfaceOptionsActionBarsPanelBottomLeft:Click() - end; - SuperVillain.SVBar:RefreshBar("Bar1") - SuperVillain.SVBar:RefreshBar("Bar6") -end; + end + SV.SVBar:RefreshBar("Bar1") + SV.SVBar:RefreshBar("Bar6") +end --[[ ########################################################## DEFINITIONS ########################################################## ]]-- -SuperVillain.SystemAlert = {}; +SV.SystemAlert = {}; -SuperVillain.ActiveAlerts = {}; +SV.ActiveAlerts = {}; -SuperVillain.SystemAlert["CLIENT_UPDATE_REQUEST"] = { +SV.SystemAlert["CLIENT_UPDATE_REQUEST"] = { text = L["Detected that your SVUI Config addon is out of date. Update as soon as possible."], button1 = OKAY, - OnAccept = SuperVillain.fubar, + OnAccept = SV.fubar, state1 = 1 }; -SuperVillain.SystemAlert["FAILED_UISCALE"] = { +SV.SystemAlert["FAILED_UISCALE"] = { text = L["You have changed your UIScale, however you still have the AutoScale option enabled in SVUI. Press accept if you would like to disable the Auto Scale option."], button1 = ACCEPT, button2 = CANCEL, - OnAccept = function() SuperVillain.db.system.autoScale = false; ReloadUI(); end, + OnAccept = function() SV.db.system.autoScale = false; ReloadUI(); end, OnCancel = function() ReloadUI() end, timeout = 0, whileDead = 1, hideOnEscape = false, } -SuperVillain.SystemAlert["TAINT_RL"] = { +SV.SystemAlert["TAINT_RL"] = { text = L["SVUI has lost it's damned mind! I need to reload your UI to fix it."], button1 = ACCEPT, button2 = CANCEL, @@ -100,7 +100,7 @@ SuperVillain.SystemAlert["TAINT_RL"] = { whileDead = 1, hideOnEscape = true }; -SuperVillain.SystemAlert["RL_CLIENT"] = { +SV.SystemAlert["RL_CLIENT"] = { text = L["A setting you have changed requires that you reload your User Interface."], button1 = ACCEPT, button2 = CANCEL, @@ -109,28 +109,28 @@ SuperVillain.SystemAlert["RL_CLIENT"] = { whileDead = 1, hideOnEscape = false }; -SuperVillain.SystemAlert["KEYBIND_MODE"] = { +SV.SystemAlert["KEYBIND_MODE"] = { text = L["Hover your mouse over any actionbutton or spellbook button to bind it. Press the escape key or right click to clear the current actionbutton's keybinding."], button1 = L["Save"], button2 = L["Discard"], - OnAccept = function()SuperVillain.SVBar:ToggleKeyBindingMode(true, true)end, - OnCancel = function()SuperVillain.SVBar:ToggleKeyBindingMode(true, false)end, + OnAccept = function()SV.SVBar:ToggleKeyBindingMode(true, true)end, + OnCancel = function()SV.SVBar:ToggleKeyBindingMode(true, false)end, timeout = 0, whileDead = 1, hideOnEscape = false }; -SuperVillain.SystemAlert["DELETE_GRAYS"] = { +SV.SystemAlert["DELETE_GRAYS"] = { text = L["Are you sure you want to delete all your gray items?"], button1 = YES, button2 = NO, - OnAccept = function()SuperVillain.SVBag:VendorGrays(true) end, - OnShow = function(a)MoneyFrame_Update(a.moneyFrame, SuperVillain.SystemAlert["DELETE_GRAYS"].Money)end, + OnAccept = function()SV.SVBag:VendorGrays(true) end, + OnShow = function(a)MoneyFrame_Update(a.moneyFrame, SV.SystemAlert["DELETE_GRAYS"].Money)end, timeout = 0, whileDead = 1, hideOnEscape = false, hasMoneyFrame = 1 }; -SuperVillain.SystemAlert["BUY_BANK_SLOT"] = { +SV.SystemAlert["BUY_BANK_SLOT"] = { text = CONFIRM_BUY_BANK_SLOT, button1 = YES, button2 = NO, @@ -140,87 +140,87 @@ SuperVillain.SystemAlert["BUY_BANK_SLOT"] = { timeout = 0, hideOnEscape = 1 }; -SuperVillain.SystemAlert["CANNOT_BUY_BANK_SLOT"] = { +SV.SystemAlert["CANNOT_BUY_BANK_SLOT"] = { text = L["Can't buy anymore slots!"], button1 = ACCEPT, timeout = 0, whileDead = 1 }; -SuperVillain.SystemAlert["NO_BANK_BAGS"] = { +SV.SystemAlert["NO_BANK_BAGS"] = { text = L["You must purchase a bank slot first!"], button1 = ACCEPT, timeout = 0, whileDead = 1 }; -SuperVillain.SystemAlert["DISBAND_RAID"] = { +SV.SystemAlert["DISBAND_RAID"] = { text = L["Are you sure you want to disband the group?"], button1 = ACCEPT, button2 = CANCEL, - OnAccept = function() SuperVillain.SVOverride:DisbandRaidGroup() end, + OnAccept = function() SV.SVOverride:DisbandRaidGroup() end, timeout = 0, whileDead = 1, }; -SuperVillain.SystemAlert["RESETMOVERS_CHECK"] = { +SV.SystemAlert["RESETMOVERS_CHECK"] = { text = L["Are you sure you want to reset every mover back to it's default position?"], button1 = ACCEPT, button2 = CANCEL, - OnAccept = function(a)SuperVillain:ResetUI(true)end, + OnAccept = function(a)SV:ResetUI(true)end, timeout = 0, whileDead = 1 }; -SuperVillain.SystemAlert["RESET_UI_CHECK"] = { +SV.SystemAlert["RESET_UI_CHECK"] = { text = L["I will attempt to preserve some of your basic settings but no promises. This will clean out everything else. Are you sure you want to reset everything?"], button1 = ACCEPT, button2 = CANCEL, - OnAccept = function(a)SuperVillain:ResetAllUI(true)end, + OnAccept = function(a)SV:ResetAllUI(true)end, timeout = 0, whileDead = 1 }; -SuperVillain.SystemAlert["CONFIRM_LOOT_DISTRIBUTION"] = { +SV.SystemAlert["CONFIRM_LOOT_DISTRIBUTION"] = { text = CONFIRM_LOOT_DISTRIBUTION, button1 = YES, button2 = NO, timeout = 0, hideOnEscape = 1 }; -SuperVillain.SystemAlert["RESET_PROFILE_PROMPT"] = { +SV.SystemAlert["RESET_PROFILE_PROMPT"] = { text = L["Are you sure you want to reset all the settings on this profile?"], button1 = YES, button2 = NO, timeout = 0, hideOnEscape = 1, OnAccept = function() - SuperVillain.db:Reset() + SV.db:Reset() end }; -SuperVillain.SystemAlert["COPY_PROFILE_PROMPT"] = { +SV.SystemAlert["COPY_PROFILE_PROMPT"] = { text = L["Are you sure you want to copy all settings from this profile?"], button1 = YES, button2 = NO, timeout = 0, hideOnEscape = 1, - OnAccept = SuperVillain.fubar + OnAccept = SV.fubar }; -SuperVillain.SystemAlert["BAR6_CONFIRMATION"] = { +SV.SystemAlert["BAR6_CONFIRMATION"] = { text = L["Enabling / Disabling Bar #6 will toggle a paging option from your main actionbar to prevent duplicating bars, are you sure you want to do this?"], button1 = YES, button2 = NO, OnAccept = function(a) - if SuperVillain.db.SVBar["BAR6"].enable ~= true then - SuperVillain.db.SVBar.Bar6.enable = true; + if SV.db.SVBar["BAR6"].enable ~= true then + SV.db.SVBar.Bar6.enable = true; UpdateActionBarOptions() else - SuperVillain.db.SVBar.Bar6.enable = false; + SV.db.SVBar.Bar6.enable = false; UpdateActionBarOptions() end end, - OnCancel = SuperVillain.fubar, + OnCancel = SV.fubar, timeout = 0, whileDead = 1, state1 = 1 }; -SuperVillain.SystemAlert["CONFIRM_LOSE_BINDING_CHANGES"] = { +SV.SystemAlert["CONFIRM_LOSE_BINDING_CHANGES"] = { text = CONFIRM_LOSE_BINDING_CHANGES, button1 = OKAY, button2 = CANCEL, @@ -232,7 +232,7 @@ SuperVillain.SystemAlert["CONFIRM_LOSE_BINDING_CHANGES"] = { LoadBindings(1) SaveBindings(1) end - SuperVillain.SVBar.bindingsChanged = nil + SV.SVBar.bindingsChanged = nil end, OnCancel = function(a) if SVUI_KeyBindPopupCheckButton:GetChecked()then @@ -245,10 +245,10 @@ SuperVillain.SystemAlert["CONFIRM_LOSE_BINDING_CHANGES"] = { whileDead = 1, state1 = 1 }; -SuperVillain.SystemAlert["INCOMPATIBLE_ADDON"] = { +SV.SystemAlert["INCOMPATIBLE_ADDON"] = { text = L["INCOMPATIBLE_ADDON"], - OnAccept = function(a)DisableAddOn(SuperVillain.SystemAlert["INCOMPATIBLE_ADDON"].addon)ReloadUI()end, - OnCancel = function(a)SuperVillain.db[lower(SuperVillain.SystemAlert["INCOMPATIBLE_ADDON"].package)].enable = false;ReloadUI()end, + OnAccept = function(a)DisableAddOn(SV.SystemAlert["INCOMPATIBLE_ADDON"].addon)ReloadUI()end, + OnCancel = function(a)SV.db[lower(SV.SystemAlert["INCOMPATIBLE_ADDON"].package)].enable = false;ReloadUI()end, timeout = 0, whileDead = 1, hideOnEscape = false @@ -262,7 +262,7 @@ local MAX_STATIC_POPUPS = 4 local SysPop_Event_Show = function(self) PlaySound("igMainMenuOpen"); - local dialog = SuperVillain.SystemAlert[self.which]; + local dialog = SV.SystemAlert[self.which]; local OnShow = dialog.OnShow; if ( OnShow ) then @@ -278,9 +278,9 @@ end local SysBox_Event_KeyEscape = function(self) local closed = nil; - for _, frame in pairs(SuperVillain.ActiveAlerts) do + for _, frame in pairs(SV.ActiveAlerts) do if( frame:IsShown() and frame.hideOnEscape ) then - local standardDialog = SuperVillain.SystemAlert[frame.which]; + local standardDialog = SV.SystemAlert[frame.which]; if ( standardDialog ) then local OnCancel = standardDialog.OnCancel; local noCancelOnEscape = standardDialog.noCancelOnEscape; @@ -289,7 +289,7 @@ local SysBox_Event_KeyEscape = function(self) end frame:Hide(); else - SuperVillain:StaticPopupSpecial_Hide(frame); + SV:StaticPopupSpecial_Hide(frame); end closed = 1; end @@ -303,7 +303,7 @@ local SysPop_Close_Unique = function(self) end local SysPop_Close_Table = function() - local displayedFrames = SuperVillain.ActiveAlerts; + local displayedFrames = SV.ActiveAlerts; local index = #displayedFrames; while ( ( index >= 1 ) and ( not displayedFrames[index]:IsShown() ) ) do tremove(displayedFrames, index); @@ -312,14 +312,14 @@ local SysPop_Close_Table = function() end local SysPop_Move = function(self) - if ( not tContains(SuperVillain.ActiveAlerts, self) ) then - local lastFrame = SuperVillain.ActiveAlerts[#SuperVillain.ActiveAlerts]; + if ( not tContains(SV.ActiveAlerts, self) ) then + local lastFrame = SV.ActiveAlerts[#SV.ActiveAlerts]; if ( lastFrame ) then self:SetPoint("TOP", lastFrame, "BOTTOM", 0, -4); else - self:SetPoint("TOP", SuperVillain.UIParent, "TOP", 0, -100); + self:SetPoint("TOP", SV.UIParent, "TOP", 0, -100); end - tinsert(SuperVillain.ActiveAlerts, self); + tinsert(SV.ActiveAlerts, self); end end @@ -331,7 +331,7 @@ local SysPop_Event_KeyDown = function(self, key) return; end - local dialog = SuperVillain.SystemAlert[self.which]; + local dialog = SV.SystemAlert[self.which]; if ( dialog ) then if ( key == "ENTER" and dialog.enterClicksFirstButton ) then local frameName = self:GetName(); @@ -358,7 +358,7 @@ local SysPop_Event_Click = function(self, index) return; end local which = self.which; - local info = SuperVillain.SystemAlert[which]; + local info = SV.SystemAlert[which]; if ( not info ) then return nil; end @@ -390,7 +390,7 @@ local SysPop_Event_Hide = function(self) SysPop_Close_Table(); - local dialog = SuperVillain.SystemAlert[self.which]; + local dialog = SV.SystemAlert[self.which]; local OnHide = dialog.OnHide; if ( OnHide ) then OnHide(self, self.data); @@ -406,9 +406,9 @@ local SysPop_Event_Update = function(self, elapsed) local which = self.which; local timeleft = self.timeleft - elapsed; if ( timeleft <= 0 ) then - if ( not SuperVillain.SystemAlert[which].timeoutInformationalOnly ) then + if ( not SV.SystemAlert[which].timeoutInformationalOnly ) then self.timeleft = 0; - local OnCancel = SuperVillain.SystemAlert[which].OnCancel; + local OnCancel = SV.SystemAlert[which].OnCancel; if ( OnCancel ) then OnCancel(self, self.data, "timeout"); end @@ -425,7 +425,7 @@ local SysPop_Event_Update = function(self, elapsed) if ( timeleft <= 0 ) then self.startDelay = nil; local text = _G[self:GetName().."Text"]; - text:SetFormattedText(SuperVillain.SystemAlert[which].text, text.text_arg1, text.text_arg2); + text:SetFormattedText(SV.SystemAlert[which].text, text.text_arg1, text.text_arg2); local button1 = _G[self:GetName().."Button1"]; button1:Enable(); StaticPopup_Resize(self, which); @@ -434,7 +434,7 @@ local SysPop_Event_Update = function(self, elapsed) self.startDelay = timeleft; end - local onUpdate = SuperVillain.SystemAlert[self.which].OnUpdate; + local onUpdate = SV.SystemAlert[self.which].OnUpdate; if ( onUpdate ) then onUpdate(self, elapsed); end @@ -452,7 +452,7 @@ local SysBox_Event_KeyEnter = function(self) dialog = parent:GetParent(); end if ( not self.autoCompleteParams or not AutoCompleteEditBox_OnEnterPressed(self) ) then - EditBoxOnEnterPressed = SuperVillain.SystemAlert[which].EditBoxOnEnterPressed; + EditBoxOnEnterPressed = SV.SystemAlert[which].EditBoxOnEnterPressed; if ( EditBoxOnEnterPressed ) then EditBoxOnEnterPressed(self, dialog.data); end @@ -460,7 +460,7 @@ local SysBox_Event_KeyEnter = function(self) end local SysBox_Event_KeyEscape = function(self) - local EditBoxOnEscapePressed = SuperVillain.SystemAlert[self:GetParent().which].EditBoxOnEscapePressed; + local EditBoxOnEscapePressed = SV.SystemAlert[self:GetParent().which].EditBoxOnEscapePressed; if ( EditBoxOnEscapePressed ) then EditBoxOnEscapePressed(self, self:GetParent().data); end @@ -468,7 +468,7 @@ end local SysBox_Event_Change = function(self, userInput) if ( not self.autoCompleteParams or not AutoCompleteEditBox_OnTextChanged(self, userInput) ) then - local EditBoxOnTextChanged = SuperVillain.SystemAlert[self:GetParent().which].EditBoxOnTextChanged; + local EditBoxOnTextChanged = SV.SystemAlert[self:GetParent().which].EditBoxOnTextChanged; if ( EditBoxOnTextChanged ) then EditBoxOnTextChanged(self, self:GetParent().data); end @@ -476,7 +476,7 @@ local SysBox_Event_Change = function(self, userInput) end local SysPop_Size = function(self, which) - local info = SuperVillain.SystemAlert[which]; + local info = SV.SystemAlert[which]; if ( not info ) then return nil; end @@ -526,7 +526,7 @@ local SysPop_Event_Listener = function(self) end local SysPop_Find = function(which, data) - local info = SuperVillain.SystemAlert[which]; + local info = SV.SystemAlert[which]; if ( not info ) then return nil; end @@ -543,12 +543,12 @@ end CORE FUNCTIONS ########################################################## ]]-- -function SuperVillain:StaticPopupSpecial_Hide(frame) +function SV:StaticPopupSpecial_Hide(frame) frame:Hide(); SysPop_Close_Table(); end -function SuperVillain:StaticPopup_HideExclusive() +function SV:StaticPopup_HideExclusive() for _, frame in pairs(self.ActiveAlerts) do if ( frame:IsShown() and frame.exclusive ) then local standardDialog = self.SystemAlert[frame.which]; @@ -566,7 +566,7 @@ function SuperVillain:StaticPopup_HideExclusive() end end -function SuperVillain:StaticPopupSpecial_Show(frame) +function SV:StaticPopupSpecial_Show(frame) if ( frame.exclusive ) then self:StaticPopup_HideExclusive(); end @@ -574,8 +574,8 @@ function SuperVillain:StaticPopupSpecial_Show(frame) frame:Show(); end -function SuperVillain:StaticPopup_Show(which, text_arg1, text_arg2, data) - local info = SuperVillain.SystemAlert[which]; +function SV:StaticPopup_Show(which, text_arg1, text_arg2, data) + local info = SV.SystemAlert[which]; if ( not info ) then return nil; end @@ -596,7 +596,7 @@ function SuperVillain:StaticPopup_Show(which, text_arg1, text_arg2, data) local frame = _G["SVUI_SystemAlert"..index]; if ( frame:IsShown() and (frame.which == info.cancels) ) then frame:Hide(); - local OnCancel = SuperVillain.SystemAlert[frame.which].OnCancel; + local OnCancel = SV.SystemAlert[frame.which].OnCancel; if ( OnCancel ) then OnCancel(frame, frame.data, "override"); end @@ -802,7 +802,7 @@ function SuperVillain:StaticPopup_Show(which, text_arg1, text_arg2, data) return dialog; end -function SuperVillain:StaticPopup_Hide(which, data) +function SV:StaticPopup_Hide(which, data) for index = 1, MAX_STATIC_POPUPS, 1 do local dialog = _G["SVUI_SystemAlert"..index]; if ( (dialog.which == which) and (not data or (data == dialog.data)) ) then @@ -838,8 +838,8 @@ local function SetConfigAlertAnim(f) f.trans:SetScript("OnFinished",f.trans[3]:GetScript("OnStop")) end -function SuperVillain:SavedPopup() - if not _G["SVUI_ConfigAlert"] then return end; +function SV:SavedPopup() + if not _G["SVUI_ConfigAlert"] then return end local alert = _G["SVUI_ConfigAlert"] local x,y = rng() if(alert:IsShown()) then @@ -861,7 +861,7 @@ local AlertButton_OnClick = function(self) SysPop_Event_Click(self:GetParent(), self:GetID()) end -function SuperVillain:LoadSystemAlerts() +function SV:LoadSystemAlerts() if not _G["SVUI_ConfigAlert"] then local configAlert = CreateFrame("Frame", "SVUI_ConfigAlert", UIParent) configAlert:SetFrameStrata("TOOLTIP") @@ -887,10 +887,10 @@ function SuperVillain:LoadSystemAlerts() fgtex:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\SAVED-FG") SetConfigAlertAnim(configAlert.bg, configAlert) SetConfigAlertAnim(configAlert.fg, configAlert) - SuperVillain.Animate:Orbit(configAlert.bg, 10, false, true) - end; + SV.Animate:Orbit(configAlert.bg, 10, false, true) + end for i = 1, 4 do - local alert = CreateFrame("Frame", "SVUI_SystemAlert"..i, SuperVillain.UIParent, "StaticPopupTemplate") + local alert = CreateFrame("Frame", "SVUI_SystemAlert"..i, SV.UIParent, "StaticPopupTemplate") alert:SetID(i) alert:SetScript("OnShow", SysPop_Event_Show) alert:SetScript("OnHide", SysPop_Event_Hide) @@ -908,11 +908,11 @@ function SuperVillain:LoadSystemAlerts() local button = _G["SVUI_SystemAlert"..i.."Button"..b]; button:SetScript("OnClick", AlertButton_OnClick) alert.buttons[b] = button - end; - _G["SVUI_SystemAlert"..i.."ItemFrameNameFrame"]:MUNG() - _G["SVUI_SystemAlert"..i.."ItemFrame"]:GetNormalTexture():MUNG() + end + _G["SVUI_SystemAlert"..i.."ItemFrameNameFrame"]:Die() + _G["SVUI_SystemAlert"..i.."ItemFrame"]:GetNormalTexture():Die() _G["SVUI_SystemAlert"..i.."ItemFrame"]:SetButtonTemplate() _G["SVUI_SystemAlert"..i.."ItemFrameIconTexture"]:SetTexCoord(0.1, 0.9, 0.1, 0.9) _G["SVUI_SystemAlert"..i.."ItemFrameIconTexture"]:FillInner() end -end; \ No newline at end of file +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/animate.lua b/Interface/AddOns/SVUI/system/animate.lua new file mode 100644 index 0000000..da06994 --- /dev/null +++ b/Interface/AddOns/SVUI/system/animate.lua @@ -0,0 +1,447 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV, L, Registry = unpack(select(2, ...)) +--[[ +########################################################## +LOCALS +########################################################## +]]-- +local FlickerAlpha = {0.2,0.15,0.1,0.15,0.2,0.15,0.1,0.15} +local Animate = {}; +--[[ +###################################################################### + /$$$$$$ /$$ /$$ /$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$$$/$$$$$$$$ + /$$__ $$| $$$ | $$|_ $$_/| $$$ /$$$ /$$__ $$|__ $$__/ $$_____/ +| $$ \ $$| $$$$| $$ | $$ | $$$$ /$$$$| $$ \ $$ | $$ | $$ +| $$$$$$$$| $$ $$ $$ | $$ | $$ $$/$$ $$| $$$$$$$$ | $$ | $$$$$ +| $$__ $$| $$ $$$$ | $$ | $$ $$$| $$| $$__ $$ | $$ | $$__/ +| $$ | $$| $$\ $$$ | $$ | $$\ $ | $$| $$ | $$ | $$ | $$ +| $$ | $$| $$ \ $$ /$$$$$$| $$ \/ | $$| $$ | $$ | $$ | $$$$$$$$ +|__/ |__/|__/ \__/|______/|__/ |__/|__/ |__/ |__/ |________/ +###################################################################### +]]-- +local Anim_OnShow = function(self) + if not self.anim:IsPlaying() then + self.anim:Play() + end +end + +local Anim_OnHide = function(self) + self.anim:Finish() +end + +local Anim_OnPlay = function(self) + local parent = self.parent + parent:SetAlpha(1) + if self.hideOnFinished and not parent:IsShown() then + parent:Show() + end +end + +local Anim_OnStop = function(self) + local parent = self.parent + if self.fadeOnFinished then + parent:SetAlpha(0) + else + parent:SetAlpha(1) + end + if self.hideOnFinished and parent:IsShown() then + parent:Hide() + end + if self.savedFrameLevel then + parent:SetScale(1) + parent:SetFrameLevel(self.savedFrameLevel) + end +end + +local Anim_OnFinished = function(self) + local parent = self.parent + local looped = self:GetLooping() + self:Stop() + if(looped and looped == "REPEAT" and parent:IsShown()) then + self:Play() + end +end + +local Sprite_OnUpdate = function(self) + local order = self:GetOrder() + local parent = self.parent + local left, right; + if(self.isFadeFrame) then + parent:SetAlpha(0) + return + end + left = (order - 1) * 0.25; + right = left + 0.25; + parent:SetTexCoord(left,right,0,1) + if parent.overlay then + parent.overlay:SetTexCoord(left,right,0,1) + parent.overlay:SetVertexColor(1,1,1,FlickerAlpha[order]) + end +end + +local SmallSprite_OnUpdate = function(self) + local order = self:GetOrder() + local parent = self.parent + local left, right; + if(self.isFadeFrame) then + parent:SetAlpha(0) + return + end + left = (order - 1) * 0.125; + right = left + 0.125; + parent:SetTexCoord(left,right,0,1) + if parent.overlay then + parent.overlay:SetTexCoord(left,right,0,1) + parent.overlay:SetVertexColor(1,1,1,FlickerAlpha[order]) + end +end + +local PulseIn_OnUpdate = function(self) + local parent = self.parent + local step = self:GetProgress() + if(parent.savedFrameLevel) then + parent:SetFrameLevel(128) + end + parent:SetScale(1 + (1.05 * step)) +end + +local PulseOut_OnUpdate = function(self) + local parent = self.parent + local step = self:GetProgress() + if(parent.savedFrameLevel) then + parent:SetFrameLevel(128) + end + parent:SetScale(1 + (1.05 * (1 - step))) +end + +local Slide_OnUpdate = function(self) + local parent = self.parent + local step = self:GetProgress() + parent:SetScale(1 + (1.05 * step)) +end + +local Slide_OnPlay = function(self) + local parent = self.parent + parent:SetScale(0.01) + parent:SetAlpha(1) +end + +local Slide_FadeStart = function(self) + local parent = self.parent + UIFrameFadeOut(parent, 0.3, 1, 0) +end + +local Slide_FadeStop = function(self) + self.parent:SetAlpha(0) +end + +--[[ HELPER FUNCTION ]]-- + +local function SetNewAnimation(frame, animType, subType) + local anim = frame:CreateAnimation(animType, subType) + anim.parent = frame.parent + return anim +end + +--[[ ANIMATION CLASS METHODS ]]-- + +function Animate:SetTemplate(frame, animType, hideOnFinished, speed, special, scriptToParent) + if not animType then return end + + frame.anim = frame:CreateAnimationGroup(animType) + frame.anim.parent = frame; + frame.anim.hideOnFinished = hideOnFinished + if animType ~= 'Flash' then + frame.anim:SetScript("OnPlay", Anim_OnPlay) + frame.anim:SetScript("OnFinished", Anim_OnFinished) + frame.anim:SetScript("OnStop", Anim_OnStop) + end + + if scriptToParent then + local frameParent = frame:GetParent(); + if(frameParent.SetScript) then + frameParent.anim = frame.anim; + frameParent:SetScript("OnShow", Anim_OnShow) + frameParent:SetScript("OnHide", Anim_OnHide) + end + elseif(frame.SetScript) then + frame:SetScript("OnShow", Anim_OnShow) + frame:SetScript("OnHide", Anim_OnHide) + end + + if animType == 'Flash'then + frame.anim.fadeOnFinished = true + if not speed then speed = 0.33 end + + frame.anim[1] = SetNewAnimation(frame.anim, "ALPHA", "FadeIn") + frame.anim[1]:SetChange(1) + frame.anim[1]:SetOrder(2) + frame.anim[1]:SetDuration(speed) + + frame.anim[2] = SetNewAnimation(frame.anim, "ALPHA","FadeOut") + frame.anim[2]:SetChange(-1) + frame.anim[2]:SetOrder(1) + frame.anim[2]:SetDuration(speed) + + if special then + frame.anim:SetLooping("REPEAT") + end + elseif animType == 'Orbit' then + frame.anim[1] = SetNewAnimation(frame.anim, "Rotation") + if special then + frame.anim[1]:SetDegrees(-360) + else + frame.anim[1]:SetDegrees(360) + end + frame.anim[1]:SetDuration(speed) + frame.anim:SetLooping("REPEAT") + frame.anim:Play() + elseif animType == 'Sprite' then + frame.anim[1] = SetNewAnimation(frame.anim, "Translation") + frame.anim[1]:SetOrder(1) + frame.anim[1]:SetDuration(speed) + frame.anim[1]:SetScript("OnUpdate", Sprite_OnUpdate) + + frame.anim[2] = SetNewAnimation(frame.anim, "Translation") + frame.anim[2]:SetOrder(2) + frame.anim[2]:SetDuration(speed) + frame.anim[2]:SetScript("OnUpdate", Sprite_OnUpdate) + + frame.anim[3] = SetNewAnimation(frame.anim, "Translation") + frame.anim[3]:SetOrder(3) + frame.anim[3]:SetDuration(speed) + frame.anim[3]:SetScript("OnUpdate", Sprite_OnUpdate) + + frame.anim[4] = SetNewAnimation(frame.anim, "Translation") + frame.anim[4]:SetOrder(4) + frame.anim[4]:SetDuration(speed) + frame.anim[4]:SetScript("OnUpdate", Sprite_OnUpdate) + + if special then + frame.anim[5] = SetNewAnimation(frame.anim, "Translation") + frame.anim[5]:SetOrder(5) + frame.anim[5]:SetDuration(special) + frame.anim[5].isFadeFrame = true; + frame.anim[5]:SetScript("OnUpdate", Sprite_OnUpdate) + end + + frame.anim:SetLooping("REPEAT") + elseif animType == 'SmallSprite' then + frame.anim[1] = SetNewAnimation(frame.anim, "Translation") + frame.anim[1]:SetOrder(1) + frame.anim[1]:SetDuration(speed) + frame.anim[1]:SetScript("OnUpdate", SmallSprite_OnUpdate) + + frame.anim[2] = SetNewAnimation(frame.anim, "Translation") + frame.anim[2]:SetOrder(2) + frame.anim[2]:SetDuration(speed) + frame.anim[2]:SetScript("OnUpdate", SmallSprite_OnUpdate) + + frame.anim[3] = SetNewAnimation(frame.anim, "Translation") + frame.anim[3]:SetOrder(3) + frame.anim[3]:SetDuration(speed) + frame.anim[3]:SetScript("OnUpdate", SmallSprite_OnUpdate) + + frame.anim[4] = SetNewAnimation(frame.anim, "Translation") + frame.anim[4]:SetOrder(4) + frame.anim[4]:SetDuration(speed) + frame.anim[4]:SetScript("OnUpdate", SmallSprite_OnUpdate) + + frame.anim[5] = SetNewAnimation(frame.anim, "Translation") + frame.anim[5]:SetOrder(5) + frame.anim[5]:SetDuration(speed) + frame.anim[5]:SetScript("OnUpdate", SmallSprite_OnUpdate) + + frame.anim[6] = SetNewAnimation(frame.anim, "Translation") + frame.anim[6]:SetOrder(6) + frame.anim[6]:SetDuration(speed) + frame.anim[6]:SetScript("OnUpdate", SmallSprite_OnUpdate) + + frame.anim[7] = SetNewAnimation(frame.anim, "Translation") + frame.anim[7]:SetOrder(7) + frame.anim[7]:SetDuration(speed) + frame.anim[7]:SetScript("OnUpdate", SmallSprite_OnUpdate) + + frame.anim[8] = SetNewAnimation(frame.anim, "Translation") + frame.anim[8]:SetOrder(8) + frame.anim[8]:SetDuration(speed) + frame.anim[8]:SetScript("OnUpdate", SmallSprite_OnUpdate) + + if special then + frame.anim[9] = SetNewAnimation(frame.anim, "Translation") + frame.anim[9]:SetOrder(9) + frame.anim[9]:SetDuration(special) + frame.anim[9].isFadeFrame = true; + frame.anim[9]:SetScript("OnUpdate", Sprite_OnUpdate) + end + + frame.anim:SetLooping("REPEAT") + elseif animType == 'Pulse' then + frame.anim.savedFrameLevel = frame:GetFrameLevel() + + frame.anim[1] = SetNewAnimation(frame.anim) + frame.anim[1]:SetDuration(0.2) + frame.anim[1]:SetEndDelay(0.1) + frame.anim[1]:SetOrder(1) + frame.anim[1]:SetScript("OnUpdate", PulseIn_OnUpdate) + + frame.anim[2] = SetNewAnimation(frame.anim) + frame.anim[2]:SetDuration(0.6) + frame.anim[2]:SetOrder(2) + frame.anim[2]:SetScript("OnUpdate", PulseOut_OnUpdate) + end +end + +--[[ ROTATE AND WOBBLE (kinda like twerking i guess...) ]]-- + +function Animate:Orbit(frame, speed, reversed, hideOnFinished) + if not frame then return end + if not speed then speed = 1 end + self:SetTemplate(frame, 'Orbit', hideOnFinished, speed, reversed) +end + +function Animate:Pulse(frame, hideOnFinished) + if not frame then return end + self:SetTemplate(frame, 'Pulse', hideOnFinished) +end + +--[[ ANIMATED SPRITES ]]-- + +function Animate:Sprite(frame, speed, fadeTime, scriptToParent) + if not frame then return end + speed = speed or 0.08; + self:SetTemplate(frame, 'Sprite', false, speed, fadeTime, scriptToParent) +end + +function Animate:SmallSprite(frame, speed, fadeTime, scriptToParent) + if not frame then return end + speed = speed or 0.08; + self:SetTemplate(frame, 'SmallSprite', false, speed, fadeTime, scriptToParent) +end + +function Animate:StopSprite(frame) + if not frame then return end + frame.anim:Finish() +end + +--[[ FLASHING ]]-- + +function Animate:Flash(frame, speed, looped) + if not frame.anim then + Animate:SetTemplate(frame, 'Flash', false, speed, looped) + end + if not frame.anim:IsPlaying() then + frame.anim:Play() + end +end + +function Animate:StopFlash(frame) + if not frame.anim then return end + frame.anim:Finish() + frame.anim:Stop() +end + +--[[ SLIDING ]]-- + +function Animate:Slide(frame, xDirection, yDirection, bounce) + if(not frame or (frame and frame.anim)) then return end + + frame.anim = frame:CreateAnimationGroup("Slide") + frame.anim.hideOnFinished = true; + frame.anim.parent = frame; + frame.anim:SetScript("OnPlay", Anim_OnPlay) + frame.anim:SetScript("OnFinished", Anim_OnFinished) + frame.anim:SetScript("OnStop", Anim_OnStop) + + frame.anim[1] = SetNewAnimation(frame.anim, "Translation") + frame.anim[1]:SetDuration(0) + frame.anim[1]:SetOrder(1) + + frame.anim[2] = SetNewAnimation(frame.anim, "Translation") + frame.anim[2]:SetDuration(0.3) + frame.anim[2]:SetOrder(2) + frame.anim[2]:SetSmoothing("OUT") + + if bounce then + frame.anim[3] = SetNewAnimation(frame.anim, "Translation") + frame.anim[3]:SetDuration(0.5) + frame.anim[3]:SetOrder(3) + + frame.anim[4] = SetNewAnimation(frame.anim, "Translation") + frame.anim[4]:SetDuration(0.3) + frame.anim[4]:SetOrder(4) + frame.anim[4]:SetSmoothing("IN") + frame.anim[4]:SetOffset(xDirection, yDirection) + end +end + +function Animate:RandomSlide(frame, raised) + if not frame then return end + if raised then + frame:SetFrameLevel(30) + else + frame:SetFrameLevel(20) + end + frame:SetPoint("CENTER", SV.UIParent, "CENTER", 0, -150) + + frame.anim = frame:CreateAnimationGroup("RandomSlide") + frame.anim.parent = frame; + frame.anim[1] = SetNewAnimation(frame.anim, "Translation") + frame.anim[1]:SetOrder(1) + frame.anim[1]:SetDuration(0.1) + frame.anim[1]:SetScript("OnUpdate", Slide_OnUpdate) + frame.anim[1]:SetScript("OnPlay", Slide_OnPlay) + + frame.anim[2] = SetNewAnimation(frame.anim, "Translation") + frame.anim[2]:SetOrder(2) + frame.anim[2]:SetDuration(1) + + frame.anim[3] = SetNewAnimation(frame.anim, "Translation") + frame.anim[3]:SetOrder(3) + frame.anim[3]:SetDuration(0.3) + frame.anim[3]:SetSmoothing("OUT") + frame.anim[3]:SetScript("OnPlay", Slide_FadeStart) + frame.anim[3]:SetScript("OnStop", Slide_FadeStop) + + frame.anim:SetScript("OnFinished", Slide_FadeStop) +end + +function Animate:SlideIn(frame) + if not frame.anim then return end + frame:Show() + frame.anim:Play() +end + +function Animate:SlideOut(frame) + if not frame.anim then return end + frame.anim:Finish() + frame.anim:Stop() +end + +SV.Animate = Animate; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/cartography.lua b/Interface/AddOns/SVUI/system/cartography.lua deleted file mode 100644 index 631f8d4..0000000 --- a/Interface/AddOns/SVUI/system/cartography.lua +++ /dev/null @@ -1,491 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -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 ipairs = _G.ipairs; -local type = _G.type; -local tinsert = _G.tinsert; -local math = _G.math; -local bit = _G.bit; ---[[ 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 ---[[ BINARY METHODS ]]-- -local band = bit.band; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SuperVillain, L = unpack(select(2, ...)) ---[[ -########################################################## -MEASURING UTILITY FUNCTIONS (from Astrolabe by: Esamynn) -########################################################## -]]-- -local radian90 = (3.141592653589793 / 2) * -1; -local GetDistance, GetTarget, GetFromPlayer - -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 - -function SuperVillain:PositionFromPlayer(unit, noMapLocation) - local distance, angle = GetFromPlayer(unit, noMapLocation) - return distance, angle -end - -function SuperVillain:Triangulate(unit1, unit2, doNotCheckMap) - local allowed, plot1, plot2, plot3, plot4 = GetTarget(unit1, doNotCheckMap) - if not allowed then return end - local allowed, plot5, plot6, plot7, plot8 = GetTarget(unit2, doNotCheckMap) - if not allowed then return end - local distance, angle = GetDistance(plot1, plot2, plot3, plot4, plot5, plot6, plot7, plot8) - return distance, angle -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/common.lua b/Interface/AddOns/SVUI/system/common.lua index 927c4a5..0aa22a4 100644 --- a/Interface/AddOns/SVUI/system/common.lua +++ b/Interface/AddOns/SVUI/system/common.lua @@ -42,7 +42,7 @@ local tremove, tcopy, twipe, tsort, tconcat, tdump = table.remove, table.copy, t GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)) +local SV, L, Registry = unpack(select(2, ...)) --[[ ########################################################## LOCAL VARS @@ -55,6 +55,7 @@ local NewFrame = CreateFrame; local NewHook = hooksecurefunc; local STANDARD_TEXT_FONT = _G.STANDARD_TEXT_FONT local SCREEN_MOD = 1; + local function GetUsableScreen() local rez = GetCVar("gxResolution") local height = rez:match("%d+x(%d+)") @@ -69,11 +70,11 @@ end UI SCALING ########################################################## ]]-- --- function SuperVillain:UIScale(event) +-- function SV:ScreenCalibration(event) -- return -- end -function SuperVillain:UIScale(event) +function SV:ScreenCalibration(event) local scale, evalwidth local gxWidth, gxHeight, gxMod = GetUsableScreen() @@ -82,7 +83,7 @@ function SuperVillain:UIScale(event) gxHeight = SVUI_Cache.screenheight; gxWidth = SVUI_Cache.screenwidth end - end; + end if self.db.system.autoScale then scale = max(0.64, min(1.15, gxMod)) @@ -158,9 +159,13 @@ function SuperVillain:UIScale(event) self:StaticPopup_Show('FAILED_UISCALE') elseif(event == 'UI_SCALE_CHANGED' and change > 1) then self:StaticPopup_Show('RL_CLIENT') - end; + end self.UIParent:UnregisterEvent('PLAYER_LOGIN') + + self.EffectiveScale = self.UIParent:GetEffectiveScale() + self.ActualHeight = self.UIParent:GetHeight() + self.ActualWidth = self.UIParent:GetWidth() end end --[[ @@ -173,7 +178,7 @@ do local function scaled(value) if(not SCREEN_MOD) then - SuperVillain:UIScale() + SV:ScreenCalibration() end return SCREEN_MOD * floor(value / SCREEN_MOD + .5); end @@ -234,38 +239,42 @@ end APPENDED DESTROY METHODS ########################################################## ]]-- --- MUNG ( Modify - Until - No - Good ) -local MUNGFRAME = NewFrame("Frame", nil) -MUNGFRAME:Hide() +local _purgatory = NewFrame("Frame", nil) +_purgatory:Hide() -local function MUNG(self) +local function Die(self) if self.UnregisterAllEvents then self:UnregisterAllEvents() - self:SetParent(MUNGFRAME) + self:SetParent(_purgatory) else self:Hide() - self.Show = SuperVillain.fubar + self.Show = SV.fubar end -end +end -local function Formula409(self, option) +local function RemoveTextures(self, option) + local region, layer, texture for i = 1, self:GetNumRegions()do - local target = select(i, self:GetRegions()) - if(target and (target:GetObjectType() == "Texture")) then - if(option and (type(option) == "boolean")) then - if target.UnregisterAllEvents then - target:UnregisterAllEvents() - target:SetParent(MUNGFRAME) - else - target.Show = target.Hide - end - target:Hide() - elseif(target:GetDrawLayer() == option) then - target:SetTexture(0,0,0,0) - elseif(option and (type(option) == "string") and (target:GetTexture() ~= option)) then - target:SetTexture(0,0,0,0) + region = select(i, self:GetRegions()) + if(region and (region:GetObjectType() == "Texture")) then + + layer = region:GetDrawLayer() + texture = region:GetTexture() + + if(option) then + if(type(option) == "boolean") then + if region.UnregisterAllEvents then + region:UnregisterAllEvents() + region:SetParent(_purgatory) + else + region.Show = region.Hide + end + region:Hide() + elseif(type(option) == "string" and ((layer == option) or (texture ~= option))) then + region:SetTexture(0,0,0,0) + end else - target:SetTexture(0,0,0,0) + region:SetTexture(0,0,0,0) end end end @@ -276,7 +285,7 @@ APPENDED FONT TEMPLATING METHODS ########################################################## ]]-- local function SetFontTemplate(self, font, fontSize, fontStyle, fontJustifyH, fontJustifyV, noUpdate) - local STANDARDFONTSIZE = SuperVillain.db.media.fonts.size + local STANDARDFONTSIZE = SV.db.media.fonts.size font = font or STANDARD_TEXT_FONT fontSize = fontSize or STANDARDFONTSIZE; fontJustifyH = fontJustifyH or "CENTER"; @@ -306,7 +315,7 @@ FONT UPDATE CALLBACK ########################################################## ]]-- local function FontTemplateUpdates() - local STANDARDFONTSIZE = SuperVillain.db.media.fonts.size; + local STANDARDFONTSIZE = SV.db.media.fonts.size; for i=1, #FontUpdateFrames do local frame = FontUpdateFrames[i] if frame then @@ -318,11 +327,11 @@ local function FontTemplateUpdates() end end -function SuperVillain:UpdateFontTemplates() +function SV:UpdateFontTemplates() FontTemplateUpdates() end -SuperVillain.Registry:SetCallback(FontTemplateUpdates) +Registry:NewCallback(FontTemplateUpdates) --[[ ########################################################## APPENDED TEMPLATING METHODS @@ -559,6 +568,52 @@ local _templates = { shadow = false, noupdate = false, }, + ["ModelComic"] = { + backdrop = { + bgFile = [[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC-MODEL]], + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeSize = 3, + insets = + { + left = 0, + right = 0, + top = 0, + bottom = 0, + }, + }, + color = "special", + gradient = "class", + texture = [[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC-MODEL]], + texupdate = false, + padding = 3, + shadow = false, + noupdate = true, + }, + ["Paper"] = { + backdrop = { + bgFile = [[Interface\AddOns\SVUI\assets\artwork\Template\Background\PAPER]], + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeSize = 2, + insets = + { + left = 1, + right = 1, + top = 1, + bottom = 1, + }, + }, + color = "white", + gradient = "white", + texture = [[Interface\AddOns\SVUI\assets\artwork\Template\Background\PAPER]], + texupdate = false, + padding = 2, + shadow = false, + noupdate = true, + }, ["Container"] = { backdrop = { bgFile = [[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN3]], @@ -652,7 +707,31 @@ local _templates = { shadow = true, noupdate = false, extended = [[ACTION]], - }, + }, + ["Blackout"] = { + backdrop = { + bgFile = [[Interface\BUTTONS\WHITE8X8]], + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeSize = 2, + insets = + { + left = 1, + right = 1, + top = 1, + bottom = 1, + }, + }, + color = "transparent", + gradient = false, + texture = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]], + texupdate = false, + padding = 2, + forcedOffset = 2, + shadow = true, + noupdate = true, + }, ["UnitLarge"] = { backdrop = false, color = "special", @@ -686,7 +765,7 @@ local HookPanelBorderColor = function(self,r,g,b,a) self[3]:SetTexture(r,g,b,a) self[4]:SetTexture(r,g,b,a) if self[5]then - self[5]:SetBackdropBorderColor(r,g,b,0.5) + self[5]:SetBackdropBorderColor(r,g,b,0.7) end end end @@ -708,7 +787,7 @@ local HookVertexColor = function(self,...) end local HookCustomBackdrop = function(self) - local newBgFile = SuperVillain.Media.bg[self._bdtex] + local newBgFile = SV.Media.bg[self._bdtex] local bd = { bgFile = newBgFile, edgeFile = [[Interface\BUTTONS\WHITE8X8]], @@ -724,14 +803,21 @@ local HookCustomBackdrop = function(self) }, } self:SetBackdrop(bd) -end +end + +local HookFrameLevel = function(self, level) + local adjustment = level - 1; + if(adjustment < 0) then adjustment = 0 end + self.Panel:SetFrameLevel(adjustment) +end --[[ ########################################################## TEMPLATE HELPERS ########################################################## ]]-- local function CreatePanelTemplate(frame, templateName, underlay, noupdate, padding, xOffset, yOffset) - if(not templateName or not _templates[templateName]) then templateName = 'Default' end + if(not templateName or not _templates[templateName]) then templateName = frame._template or 'Default' end + local settings = _templates[templateName] local colorName = settings.color local gradientName = settings.gradient @@ -739,59 +825,82 @@ local function CreatePanelTemplate(frame, templateName, underlay, noupdate, padd local hasShadow = settings.shadow local bd = settings.backdrop local bypass = noupdate or settings.noupdate - local bgColor = SuperVillain.Media.color[colorName] or {0.18,0.18,0.18,1} + local bgColor = SV.Media.color[colorName] or {0.18,0.18,0.18,1} local borderColor = {0,0,0,1} local initLevel = 0; + local needsHooks = false; padding = padding or settings.padding or 1 - xOffset = xOffset or 1 - yOffset = yOffset or 1 + xOffset = settings.forcedOffset or xOffset or 1 + yOffset = settings.forcedOffset or yOffset or 1 frame._template = templateName; frame._color = colorName; frame._gradient = gradientName; frame._texture = false; - frame._noupdate = bypass; - - local panel = NewFrame('Frame', nil, frame) - panel:Point('TOPLEFT', frame, 'TOPLEFT', (xOffset * -1), yOffset) - panel:Point('BOTTOMRIGHT', frame, 'BOTTOMRIGHT', xOffset, (yOffset * -1)) - - if(padding > 0 and type(t) == 'table') then - panel[1] = panel:CreateTexture(nil,"BORDER") - panel[1]:SetTexture(0,0,0) - panel[1]:SetPoint("TOPLEFT") - panel[1]:SetPoint("BOTTOMLEFT") - panel[1]:SetWidth(padding) - panel[2] = panel:CreateTexture(nil,"BORDER") - panel[2]:SetTexture(0,0,0) - panel[2]:SetPoint("TOPRIGHT") - panel[2]:SetPoint("BOTTOMRIGHT") - panel[2]:SetWidth(padding) - panel[3] = panel:CreateTexture(nil,"BORDER") - panel[3]:SetTexture(0,0,0) - panel[3]:SetPoint("TOPLEFT") - panel[3]:SetPoint("TOPRIGHT") - panel[3]:SetHeight(padding) - panel[4] = panel:CreateTexture(nil,"BORDER") - panel[4]:SetTexture(0,0,0) - panel[4]:SetPoint("BOTTOMLEFT") - panel[4]:SetPoint("BOTTOMRIGHT") - panel[4]:SetHeight(padding) + frame._noupdate = bypass; + + if(not frame.Panel) then + needsHooks = true + + local panel = NewFrame('Frame', nil, frame) + panel:Point('TOPLEFT', frame, 'TOPLEFT', (xOffset * -1), yOffset) + panel:Point('BOTTOMRIGHT', frame, 'BOTTOMRIGHT', xOffset, (yOffset * -1)) + + if(padding > 0 and type(t) == 'table') then + panel[1] = panel:CreateTexture(nil,"BORDER") + panel[1]:SetTexture(0,0,0) + panel[1]:SetPoint("TOPLEFT") + panel[1]:SetPoint("BOTTOMLEFT") + panel[1]:SetWidth(padding) + panel[2] = panel:CreateTexture(nil,"BORDER") + panel[2]:SetTexture(0,0,0) + panel[2]:SetPoint("TOPRIGHT") + panel[2]:SetPoint("BOTTOMRIGHT") + panel[2]:SetWidth(padding) + panel[3] = panel:CreateTexture(nil,"BORDER") + panel[3]:SetTexture(0,0,0) + panel[3]:SetPoint("TOPLEFT") + panel[3]:SetPoint("TOPRIGHT") + panel[3]:SetHeight(padding) + panel[4] = panel:CreateTexture(nil,"BORDER") + panel[4]:SetTexture(0,0,0) + panel[4]:SetPoint("BOTTOMLEFT") + panel[4]:SetPoint("BOTTOMRIGHT") + panel[4]:SetHeight(padding) + end + + local level = frame:GetFrameLevel() + if(level == 0 and not InCombatLockdown()) then + frame:SetFrameLevel(1) + level = 1 + end + + local adjustment = level - 1; + if(adjustment < 0) then adjustment = 0 end + + panel:SetFrameLevel(adjustment) + + NewHook(frame, "SetFrameLevel", HookFrameLevel) + + frame.Panel = panel end if(hasShadow) then - if(underlay) then - panel[5] = NewFrame('Frame', nil, panel) - panel[5]:Point('TOPLEFT', panel, 'TOPLEFT', -3, 3) - panel[5]:Point('BOTTOMRIGHT', panel, 'BOTTOMRIGHT', 3, -3) - else - panel[5] = NewFrame('Frame', nil, frame) - panel[5]:Point('TOPLEFT', frame, 'TOPLEFT', -3, 3) - panel[5]:Point('BOTTOMRIGHT', frame, 'BOTTOMRIGHT', 3, -3) + if(not frame.Panel[5]) then + if(underlay) then + frame.Panel[5] = NewFrame('Frame', nil, frame.Panel) + frame.Panel[5]:Point('TOPLEFT', frame.Panel, 'TOPLEFT', -3, 3) + frame.Panel[5]:Point('BOTTOMRIGHT', frame.Panel, 'BOTTOMRIGHT', 3, -3) + else + frame.Panel[5] = NewFrame('Frame', nil, frame) + frame.Panel[5]:Point('TOPLEFT', frame, 'TOPLEFT', -3, 3) + frame.Panel[5]:Point('BOTTOMRIGHT', frame, 'BOTTOMRIGHT', 3, -3) + end end - panel[5]:SetBackdrop({ + + frame.Panel[5]:SetBackdrop({ edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], edgeSize = 3, insets = { @@ -801,16 +910,18 @@ local function CreatePanelTemplate(frame, templateName, underlay, noupdate, padd bottom = 0 } }); - panel[5]:SetBackdropBorderColor(0,0,0,0.5) - local level = panel[5]:GetFrameLevel() - 1 + + frame.Panel[5]:SetBackdropBorderColor(0,0,0,0.5) + + local level = frame.Panel[5]:GetFrameLevel() - 1 + if(level >= 0) then - panel[5]:SetFrameLevel(level) + frame.Panel[5]:SetFrameLevel(level) else - panel[5]:SetFrameLevel(0) + frame.Panel[5]:SetFrameLevel(0) end end - frame.Panel = panel if(bd) then initLevel = 1; @@ -823,7 +934,8 @@ local function CreatePanelTemplate(frame, templateName, underlay, noupdate, padd frame:SetBackdropColor(bgColor[1],bgColor[2],bgColor[3],bgColor[4] or 1) frame:SetBackdropBorderColor(0,0,0,1) end - if(templateName ~= 'Transparent') then + + if(needsHooks and templateName ~= 'Transparent') then NewHook(frame.Panel, "SetBackdropBorderColor", HookPanelBorderColor) NewHook(frame, "SetBackdropBorderColor", HookBackdropBorderColor) if(underlay) then @@ -839,23 +951,24 @@ local function CreatePanelTemplate(frame, templateName, underlay, noupdate, padd end if(texFile) then - local xyOffset = padding + 1; - if(underlay) then - frame._skin = frame.Panel:CreateTexture(nil,"BACKGROUND",nil,initLevel) - frame._skin:Point('TOPLEFT', frame.Panel, 'TOPLEFT', xyOffset, (xyOffset * -1)) - frame._skin:Point('BOTTOMRIGHT', frame.Panel, 'BOTTOMRIGHT', (xyOffset * -1), xyOffset) - else - frame._skin = frame:CreateTexture(nil,"BACKGROUND",nil,initLevel) - frame._skin:Point('TOPLEFT', frame, 'TOPLEFT', xyOffset, (xyOffset * -1)) - frame._skin:Point('BOTTOMRIGHT', frame, 'BOTTOMRIGHT', (xyOffset * -1), xyOffset) + if(not frame._skin) then + if(underlay) then + frame._skin = frame.Panel:CreateTexture(nil,"BACKGROUND",nil,initLevel) + frame._skin:SetAllPoints(frame.Panel) + else + frame._skin = frame:CreateTexture(nil,"BACKGROUND",nil,initLevel) + frame._skin:SetAllPoints(frame) + end end frame._skin:SetTexture(texFile) - if(gradientName and SuperVillain.Media.gradient[gradientName]) then - frame._skin:SetGradient(unpack(SuperVillain.Media.gradient[gradientName])) + + if(gradientName and SV.Media.gradient[gradientName]) then + frame._skin:SetGradient(unpack(SV.Media.gradient[gradientName])) else frame._skin:SetVertexColor(bgColor[1], bgColor[2], bgColor[3], bgColor[4] or 1) end + frame._skin:SetNonBlocking(true) if((not bypass) and settings.texupdate) then @@ -874,43 +987,49 @@ local function CreatePanelTemplate(frame, templateName, underlay, noupdate, padd if(not underlay) then initLevel = 0 end + local name = settings.extended - local topLeft = frame.Panel:CreateTexture(nil, "BACKGROUND", nil, initLevel) - topLeft:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\Extended\]] .. name .. [[_TOPLEFT]]) - topLeft:SetPoint("TOPLEFT", frame.Panel, "TOPLEFT", 0, 0) - topLeft:SetPoint("TOPRIGHT", frame.Panel, "TOP", 0, 0) - topLeft:SetPoint("BOTTOMLEFT", frame.Panel, "LEFT", 0, 0) - topLeft:SetVertexColor(0.05, 0.05, 0.05, 0.5) - topLeft:SetNonBlocking(true) - - local topRight = frame.Panel:CreateTexture(nil, "BACKGROUND", nil, initLevel) - topRight:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\Extended\]] .. name .. [[_TOPRIGHT]]) - topRight:SetPoint("TOPRIGHT", frame.Panel, "TOPRIGHT", 0, 0) - topRight:SetPoint("TOPLEFT", frame.Panel, "TOP", 0, 0) - topRight:SetPoint("BOTTOMRIGHT", frame.Panel, "RIGHT", 0, 0) - topRight:SetVertexColor(0.05, 0.05, 0.05, 0.5) - topRight:SetNonBlocking(true) - - local bottomRight = frame.Panel:CreateTexture(nil, "BACKGROUND", nil, initLevel) - bottomRight:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\Extended\]] .. name .. [[_BOTTOMRIGHT]]) - bottomRight:SetPoint("BOTTOMRIGHT", frame.Panel, "BOTTOMRIGHT", 0, 0) - bottomRight:SetPoint("BOTTOMLEFT", frame.Panel, "BOTTOM", 0, 0) - bottomRight:SetPoint("TOPRIGHT", frame.Panel, "RIGHT", 0, 0) - bottomRight:SetVertexColor(0.1, 0.1, 0.1, 0.5) - bottomRight:SetNonBlocking(true) - - local bottomLeft = frame.Panel:CreateTexture(nil, "BACKGROUND", nil, initLevel) - bottomLeft:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\Extended\]] .. name .. [[_BOTTOMLEFT]]) - bottomLeft:SetPoint("BOTTOMLEFT", frame.Panel, "BOTTOMLEFT", 0, 0) - bottomLeft:SetPoint("BOTTOMRIGHT", frame.Panel, "BOTTOM", 0, 0) - bottomLeft:SetPoint("TOPLEFT", frame.Panel, "LEFT", 0, 0) - bottomLeft:SetVertexColor(0.1, 0.1, 0.1, 0.5) - bottomLeft:SetNonBlocking(true) - end - local level = frame:GetFrameLevel() - frame:SetFrameLevel(level + 1) - frame.Panel:SetFrameLevel(level) + if(not frame._extended) then + frame._extended = {} + + frame._extended[1] = frame.Panel:CreateTexture(nil, "BACKGROUND", nil, initLevel) + frame._extended[1]:SetPoint("TOPLEFT", frame.Panel, "TOPLEFT", 0, 0) + frame._extended[1]:SetPoint("TOPRIGHT", frame.Panel, "TOP", 0, 0) + frame._extended[1]:SetPoint("BOTTOMLEFT", frame.Panel, "LEFT", 0, 0) + + frame._extended[2] = frame.Panel:CreateTexture(nil, "BACKGROUND", nil, initLevel) + frame._extended[2]:SetPoint("TOPRIGHT", frame.Panel, "TOPRIGHT", 0, 0) + frame._extended[2]:SetPoint("TOPLEFT", frame.Panel, "TOP", 0, 0) + frame._extended[2]:SetPoint("BOTTOMRIGHT", frame.Panel, "RIGHT", 0, 0) + + frame._extended[3] = frame.Panel:CreateTexture(nil, "BACKGROUND", nil, initLevel) + frame._extended[3]:SetPoint("BOTTOMRIGHT", frame.Panel, "BOTTOMRIGHT", 0, 0) + frame._extended[3]:SetPoint("BOTTOMLEFT", frame.Panel, "BOTTOM", 0, 0) + frame._extended[3]:SetPoint("TOPRIGHT", frame.Panel, "RIGHT", 0, 0) + + frame._extended[4] = frame.Panel:CreateTexture(nil, "BACKGROUND", nil, initLevel) + frame._extended[4]:SetPoint("BOTTOMLEFT", frame.Panel, "BOTTOMLEFT", 0, 0) + frame._extended[4]:SetPoint("BOTTOMRIGHT", frame.Panel, "BOTTOM", 0, 0) + frame._extended[4]:SetPoint("TOPLEFT", frame.Panel, "LEFT", 0, 0) + end + + frame._extended[1]:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\Extended\]] .. name .. [[_TOPLEFT]]) + frame._extended[1]:SetVertexColor(0.05, 0.05, 0.05, 0.5) + frame._extended[1]:SetNonBlocking(true) + + frame._extended[2]:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\Extended\]] .. name .. [[_TOPRIGHT]]) + frame._extended[2]:SetVertexColor(0.05, 0.05, 0.05, 0.5) + frame._extended[2]:SetNonBlocking(true) + + frame._extended[3]:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\Extended\]] .. name .. [[_BOTTOMRIGHT]]) + frame._extended[3]:SetVertexColor(0.1, 0.1, 0.1, 0.5) + frame._extended[3]:SetNonBlocking(true) + + frame._extended[4]:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\Extended\]] .. name .. [[_BOTTOMLEFT]]) + frame._extended[4]:SetVertexColor(0.1, 0.1, 0.1, 0.5) + frame._extended[4]:SetNonBlocking(true) + end end local function HasCooldown(n) @@ -919,7 +1038,6 @@ local function HasCooldown(n) end local function CreateButtonPanel(frame, noChecked, brightChecked) - if(frame.hasPanel) then return end if(frame.Left) then frame.Left:SetAlpha(0) @@ -945,44 +1063,50 @@ local function CreateButtonPanel(frame, noChecked, brightChecked) frame:SetCheckedTexture("") end - if(frame.SetHighlightTexture and not frame.hover) then - local hover = frame:CreateTexture(nil, "OVERLAY") - local color = SuperVillain.Media.color.highlight - hover:SetTexture(color[1], color[2], color[3], 0.5) - hover:FillInner(frame.Panel) - frame.hover = hover; - frame:SetHighlightTexture(hover) + if(frame.SetHighlightTexture) then + if(not frame.hover) then + local hover = frame:CreateTexture(nil, "OVERLAY") + hover:FillInner(frame.Panel) + frame.hover = hover; + end + local color = SV.Media.color.highlight + frame.hover:SetTexture(color[1], color[2], color[3], 0.5) + frame:SetHighlightTexture(frame.hover) end - if(frame.SetPushedTexture and not frame.pushed) then - local pushed = frame:CreateTexture(nil, "OVERLAY") - pushed:SetTexture(0.1, 0.8, 0.1, 0.3) - pushed:FillInner(frame.Panel) - frame.pushed = pushed; - frame:SetPushedTexture(pushed) + if(frame.SetPushedTexture) then + if(not frame.pushed) then + local pushed = frame:CreateTexture(nil, "OVERLAY") + pushed:FillInner(frame.Panel) + frame.pushed = pushed; + end + frame.pushed:SetTexture(0.1, 0.8, 0.1, 0.3) + frame:SetPushedTexture(frame.pushed) end - if(not noChecked and frame.SetCheckedTexture) then - local checked = frame:CreateTexture(nil, "OVERLAY") + if(not noChecked and frame.SetCheckedTexture) then + if(not frame.checked) then + local checked = frame:CreateTexture(nil, "OVERLAY") + checked:FillInner(frame.Panel) + frame.checked = checked + end + if(not brightChecked) then - checked:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - checked:SetVertexColor(0, 0.5, 0, 0.2) + frame.checked:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) + frame.checked:SetVertexColor(0, 0.5, 0, 0.2) else - checked:SetTexture(SuperVillain.Media.bar.gloss) - checked:SetVertexColor(0, 1, 0, 1) + frame.checked:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\GLOSS]]) + frame.checked:SetVertexColor(0, 1, 0, 1) end - checked:FillInner(frame.Panel) - frame.checked = checked; - frame:SetCheckedTexture(checked) - end + + frame:SetCheckedTexture(frame.checked) + end local cd = HasCooldown(frame:GetName()) if cd then cd:ClearAllPoints() cd:SetAllPoints() - end - - frame.hasPanel = true + end end --[[ ########################################################## @@ -990,24 +1114,21 @@ 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 needsHooks = false; + + if(hasShadow) then + if(not self.Panel) then + needsHooks = true - local currentLevel = self:GetFrameLevel() - if(currentLevel == 0) then - currentLevel = 1 - end + self.Panel = CreateFrame("Frame", nil, self) + self.Panel:SetPoint("TOPLEFT", self, "TOPLEFT", -2, 2) + self.Panel:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 2, -2) + end - self.Panel = CreateFrame("Frame", nil, frame) - self.Panel:SetPoint("TOPLEFT", frame, "TOPLEFT", topX, topY) - self.Panel:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", bottomX, bottomY) - self.Panel:SetFrameLevel(currentLevel - 1) - if(hasShadow) then self.Panel:SetBackdrop({ - bgFile = [[Interface\BUTTONS\WHITE8X8]], + bgFile = [[Interface\BUTTONS\WHITE8X8]], tile = false, - tileSize = 0, + tileSize = 0, edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], edgeSize = 3, insets = @@ -1018,7 +1139,17 @@ local function SetBasicPanel(self, topX, topY, bottomX, bottomY, hasShadow) bottom = 0, }, }) + self.Panel:SetBackdropColor(0,0,0,0) + self.Panel:SetBackdropBorderColor(0,0,0) else + if(not self.Panel) then + needsHooks = true + + self.Panel = CreateFrame("Frame", nil, self) + self.Panel:SetPoint("TOPLEFT", self, "TOPLEFT", topX, topY) + self.Panel:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", bottomX, bottomY) + end + self.Panel:SetBackdrop({ bgFile = [[Interface\BUTTONS\WHITE8X8]], tile = false, @@ -1033,20 +1164,30 @@ local function SetBasicPanel(self, topX, topY, bottomX, bottomY, hasShadow) bottom = 1, }, }) + self.Panel:SetBackdropColor(0,0,0,0.65) + self.Panel:SetBackdropBorderColor(0,0,0) end - self.Panel:SetBackdropColor(0,0,0,0.65) - self.Panel:SetBackdropBorderColor(0,0,0) + if(needsHooks) then + local level = self:GetFrameLevel() + if(level == 0 and not InCombatLockdown()) then + self:SetFrameLevel(1) + level = 1 + end + + local adjustment = level - 1; + if(adjustment < 0) then adjustment = 0 end - NewHook(frame, "SetBackdrop", HookBackdrop) - NewHook(frame, "SetBackdropColor", HookBackdropColor) - NewHook(frame, "SetBackdropBorderColor", HookBackdropBorderColor) + self.Panel:SetFrameLevel(adjustment) + + NewHook(self, "SetFrameLevel", HookFrameLevel) + NewHook(self, "SetBackdrop", HookBackdrop) + NewHook(self, "SetBackdropColor", HookBackdropColor) + NewHook(self, "SetBackdropBorderColor", HookBackdropBorderColor) + end end local function SetPanelTemplate(self, templateName, noupdate, overridePadding, xOffset, yOffset) - if(self.Panel) then return; end - if(not templateName or not _templates[templateName]) then return SetBasicPanel(self) end - local padding = false if(overridePadding and type(overridePadding) == "number") then padding = overridePadding @@ -1054,15 +1195,13 @@ local function SetPanelTemplate(self, templateName, noupdate, overridePadding, x CreatePanelTemplate(self, templateName, true, noupdate, padding, xOffset, yOffset) - if(not self._noupdate) then + if(not self._noupdate and not self.__registered) then TemplateUpdateFrames[self] = true + self.__registered = true end end local function SetFixedPanelTemplate(self, templateName, noupdate, overridePadding, xOffset, yOffset) - if(self.Panel) then return; end - if(not templateName or not _templates[templateName]) then return SetBasicPanel(self) end - local padding = false if(overridePadding and type(overridePadding) == "number") then padding = overridePadding @@ -1070,8 +1209,9 @@ local function SetFixedPanelTemplate(self, templateName, noupdate, overridePaddi CreatePanelTemplate(self, templateName, false, noupdate, padding, xOffset, yOffset) - if(not self._noupdate) then + if(not self._noupdate and not self.__registered) then TemplateUpdateFrames[self] = true + self.__registered = true end end @@ -1082,32 +1222,32 @@ local function SetPanelColor(self, ...) if(type(arg1) == "string") then if(arg1 == "VERTICAL" or arg1 == "HORIZONTAL") then self._skin:SetGradient(...) - elseif(SuperVillain.Media.gradient[arg1]) then - if self.BorderPanel then - local d,r,g,b,r2,g2,b2 = unpack(SuperVillain.Media.gradient[arg1]) + elseif(SV.Media.gradient[arg1]) then + if self.__border then + local d,r,g,b,r2,g2,b2 = unpack(SV.Media.gradient[arg1]) --self._skin:SetGradient(d,r,g,b,r2,g2,b2) - self.BorderPanel[1]:SetTexture(r2,g2,b2) - self.BorderPanel[2]:SetTexture(r2,g2,b2) - self.BorderPanel[3]:SetTexture(r2,g2,b2) - self.BorderPanel[4]:SetTexture(r2,g2,b2) + self.__border[1]:SetTexture(r2,g2,b2) + self.__border[2]:SetTexture(r2,g2,b2) + self.__border[3]:SetTexture(r2,g2,b2) + self.__border[4]:SetTexture(r2,g2,b2) else - self._skin:SetGradient(unpack(SuperVillain.Media.gradient[arg1])) - if(SuperVillain.Media.color[arg1]) then - local t = SuperVillain.Media.color[arg1] + self._skin:SetGradient(unpack(SV.Media.gradient[arg1])) + if(SV.Media.color[arg1]) then + local t = SV.Media.color[arg1] local r,g,b,a = t[1], t[2], t[3], t[4] or 1; self:SetBackdropColor(r,g,b,a) end end end end - elseif(type(arg1) == "string" and SuperVillain.Media.color[arg1]) then - local t = SuperVillain.Media.color[arg1] + elseif(type(arg1) == "string" and SV.Media.color[arg1]) then + local t = SV.Media.color[arg1] local r,g,b,a = t[1], t[2], t[3], t[4] or 1; - if self.BorderPanel then - self.BorderPanel[1]:SetTexture(r,g,b) - self.BorderPanel[2]:SetTexture(r,g,b) - self.BorderPanel[3]:SetTexture(r,g,b) - self.BorderPanel[4]:SetTexture(r,g,b) + if self.__border then + self.__border[1]:SetTexture(r,g,b) + self.__border[2]:SetTexture(r,g,b) + self.__border[3]:SetTexture(r,g,b) + self.__border[4]:SetTexture(r,g,b) else self:SetBackdropColor(r,g,b) end @@ -1120,15 +1260,22 @@ end APPENDED BUTTON TEMPLATING METHODS ########################################################## ]]-- -local function SetButtonTemplate(self, invisible) - if self.styled then return end +local function SetButtonTemplate(self, invisible, overridePadding, xOffset, yOffset, keepNormal) + if(not self) then return end + + local padding = 1 + if(overridePadding and type(overridePadding) == "number") then + padding = overridePadding + end + xOffset = xOffset or -1 + yOffset = yOffset or -1 if(invisible) then - CreatePanelTemplate(self, "Transparent", false, true, 1) + CreatePanelTemplate(self, "Transparent", false, true, padding, xOffset, yOffset) self:SetBackdropColor(0,0,0,0) self:SetBackdropBorderColor(0,0,0,0) else - CreatePanelTemplate(self, "Button", false, true, 1) + CreatePanelTemplate(self, "Button", false, true, padding, xOffset, yOffset) end if(self.Left) then @@ -1143,7 +1290,7 @@ local function SetButtonTemplate(self, invisible) self.Right:SetAlpha(0) end - if(self.SetNormalTexture) then + if(self.SetNormalTexture and not keepNormal) then self:SetNormalTexture("") end @@ -1151,49 +1298,67 @@ local function SetButtonTemplate(self, invisible) self:SetDisabledTexture("") end - if(self.SetHighlightTexture and not self.hover) then - local hover = self:CreateTexture(nil, "HIGHLIGHT") - local color = SuperVillain.Media.color.highlight - hover:SetTexture(color[1], color[2], color[3], 0.5) - FillInner(hover, self.Panel) - self.hover = hover; - self:SetHighlightTexture(hover) + if(self.SetHighlightTexture) then + if(not self.hover) then + local hover = self:CreateTexture(nil, "HIGHLIGHT") + FillInner(hover, self.Panel) + self.hover = hover; + end + + local color = SV.Media.color.highlight + self.hover:SetTexture(color[1], color[2], color[3], 0.5) + + self:SetHighlightTexture(self.hover) end - if(self.SetPushedTexture and not self.pushed) then - local pushed = self:CreateTexture(nil, "OVERLAY") - pushed:SetTexture(0.1, 0.8, 0.1, 0.3) - FillInner(pushed, self.Panel) - self.pushed = pushed; - self:SetPushedTexture(pushed) + if(self.SetPushedTexture) then + if(not self.pushed) then + local pushed = self:CreateTexture(nil, "OVERLAY") + FillInner(pushed, self.Panel) + self.pushed = pushed; + end + + self.pushed:SetTexture(0.1, 0.8, 0.1, 0.3) + + self:SetPushedTexture(self.pushed) end - if(self.SetCheckedTexture and not self.checked) then - local checked = self:CreateTexture(nil, "OVERLAY") - checked:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - checked:SetVertexColor(0, 0.5, 0, 0.2) - FillInner(checked, self.Panel) - self.checked = checked; - self:SetCheckedTexture(checked) + if(self.SetCheckedTexture) then + if(not self.checked) then + local checked = self:CreateTexture(nil, "OVERLAY") + FillInner(checked, self.Panel) + self.checked = checked; + end + + self.checked:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) + self.checked:SetVertexColor(0, 0.5, 0, 0.2) + + self:SetCheckedTexture(self.checked) end - self.styled = true + local cd = HasCooldown(self:GetName()) + if cd then + cd:ClearAllPoints() + cd:SetAllPoints() + end end local function SetSlotTemplate(self, underlay, padding, x, y, noChecked) - if self.styled then return end + if(not self) then return end + padding = padding or 1 CreatePanelTemplate(self, "Slot", underlay, true, padding, x, y) - CreateButtonPanel(self, noChecked) - self.styled = true + CreateButtonPanel(self, true) end local function SetCheckboxTemplate(self, underlay, x, y) - if self.styled then return end + if(not self or (self and self.__hooked)) then return end + if(underlay) then x = x or -7 y = y or -7 end + CreatePanelTemplate(self, "Slot", underlay, true, 1, x, y) CreateButtonPanel(self, false, true) @@ -1204,42 +1369,50 @@ local function SetCheckboxTemplate(self, underlay, x, y) end self:SetBackdropBorderColor(r,g,b) end) - - self.styled = true + self.__hooked = true end local function SetEditboxTemplate(self, x, y) - if self.styled then return end - - if self.TopLeftTex then MUNG(self.TopLeftTex) end - if self.TopRightTex then MUNG(self.TopRightTex) end - if self.TopTex then MUNG(self.TopTex) end - if self.BottomLeftTex then MUNG(self.BottomLeftTex) end - if self.BottomRightTex then MUNG(self.BottomRightTex) end - if self.BottomTex then MUNG(self.BottomTex) end - if self.LeftTex then MUNG(self.LeftTex) end - if self.RightTex then MUNG(self.RightTex) end - if self.MiddleTex then MUNG(self.MiddleTex) end + if(not self or (self and self.Panel)) then return end + + if self.TopLeftTex then Die(self.TopLeftTex) end + if self.TopRightTex then Die(self.TopRightTex) end + if self.TopTex then Die(self.TopTex) end + if self.BottomLeftTex then Die(self.BottomLeftTex) end + if self.BottomRightTex then Die(self.BottomRightTex) end + if self.BottomTex then Die(self.BottomTex) end + if self.LeftTex then Die(self.LeftTex) end + if self.RightTex then Die(self.RightTex) end + if self.MiddleTex then Die(self.MiddleTex) end CreatePanelTemplate(self, "Inset", true, true, 1, x, y) local globalName = self:GetName(); if globalName then - if _G[globalName.."Left"] then MUNG(_G[globalName.."Left"]) end - if _G[globalName.."Middle"] then MUNG(_G[globalName.."Middle"]) end - if _G[globalName.."Right"] then MUNG(_G[globalName.."Right"]) end - if _G[globalName.."Mid"] then MUNG(_G[globalName.."Mid"]) end - if globalName:find("Silver") or globalName:find("Copper") then - self.Panel:SetPoint("BOTTOMRIGHT", -12, -2) + if _G[globalName.."Left"] then Die(_G[globalName.."Left"]) end + if _G[globalName.."Middle"] then Die(_G[globalName.."Middle"]) end + if _G[globalName.."Right"] then Die(_G[globalName.."Right"]) end + if _G[globalName.."Mid"] then Die(_G[globalName.."Mid"]) end + + if globalName:find("Silver") or globalName:find("Copper") or globalName:find("Gold") then + self.Panel:SetPoint("TOPLEFT", -3, 1) + if globalName:find("Silver") or globalName:find("Copper") then + self.Panel:SetPoint("BOTTOMRIGHT", -12, -2) + else + self.Panel:SetPoint("BOTTOMRIGHT", -2, -2) + end end end - self.styled = true end -local function SetFramedButtonTemplate(self, template) - if self.styled then return end - template = template or "FramedBottom" - CreatePanelTemplate(self, template, false, false, 1) +local function SetFramedButtonTemplate(self, template, borderSize) + if(not self or (self and self.Panel)) then return end + + borderSize = borderSize or 2 + + template = template or self._template or "FramedBottom" + + CreatePanelTemplate(self, template, false, false, 0, -borderSize, -borderSize) if(self.Left) then self.Left:SetAlpha(0) @@ -1261,61 +1434,78 @@ local function SetFramedButtonTemplate(self, template) self:SetDisabledTexture("") end - local border = NewFrame('Frame',nil,self) - border:Point('TOPLEFT', self, 'TOPLEFT', -2, 2) - border:Point('BOTTOMRIGHT', self, 'BOTTOMRIGHT', 2, -2) - local t = SuperVillain.Media.color.default - local r,g,b = t[1], t[2], t[3] - border[1] = border:CreateTexture(nil,"BORDER") - border[1]:SetTexture(r,g,b) - border[1]:SetPoint("TOPLEFT") - border[1]:SetPoint("BOTTOMLEFT") - border[1]:SetWidth(3) - border[2] = border:CreateTexture(nil,"BORDER") - border[2]:SetTexture(r,g,b) - border[2]:SetPoint("TOPRIGHT") - border[2]:SetPoint("BOTTOMRIGHT") - border[2]:SetWidth(3) - border[3] = border:CreateTexture(nil,"BORDER") - border[3]:SetTexture(r,g,b) - border[3]:SetPoint("TOPLEFT") - border[3]:SetPoint("TOPRIGHT") - border[3]:SetHeight(3) - border[4] = border:CreateTexture(nil,"BORDER") - border[4]:SetTexture(r,g,b) - border[4]:SetPoint("BOTTOMLEFT") - border[4]:SetPoint("BOTTOMRIGHT") - border[4]:SetHeight(3) - - border[5] = NewFrame('Frame',nil,border) - border[5]:Point('TOPLEFT',border,'TOPLEFT',-2,2) - border[5]:Point('BOTTOMRIGHT',border,'BOTTOMRIGHT',2,-2) - border[5]:SetBackdrop({ - edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], - edgeSize = 3, - insets = { - left = 2, - right = 2, - top = 2, - bottom = 2 - } - }) - border[5]:SetBackdropBorderColor(0,0,0,0.6) + if(not self.__border) then + local t = SV.Media.color.default + local r,g,b = t[1], t[2], t[3] + + local border = {} + + border[1] = self:CreateTexture(nil,"BORDER") + border[1]:SetTexture(r,g,b) + border[1]:SetPoint("TOPLEFT", -1, 1) + border[1]:SetPoint("BOTTOMLEFT", -1, -1) + border[1]:SetWidth(borderSize) + + local leftoutline = self:CreateTexture(nil,"BORDER") + leftoutline:SetTexture(0,0,0) + leftoutline:SetPoint("TOPLEFT", -2, 2) + leftoutline:SetPoint("BOTTOMLEFT", -2, -2) + leftoutline:SetWidth(1) + + border[2] = self:CreateTexture(nil,"BORDER") + border[2]:SetTexture(r,g,b) + border[2]:SetPoint("TOPRIGHT", 1, 1) + border[2]:SetPoint("BOTTOMRIGHT", 1, -1) + border[2]:SetWidth(borderSize) + + local rightoutline = self:CreateTexture(nil,"BORDER") + rightoutline:SetTexture(0,0,0) + rightoutline:SetPoint("TOPRIGHT", 2, 2) + rightoutline:SetPoint("BOTTOMRIGHT", 2, -2) + rightoutline:SetWidth(1) + + border[3] = self:CreateTexture(nil,"BORDER") + border[3]:SetTexture(r,g,b) + border[3]:SetPoint("TOPLEFT", -1, 1) + border[3]:SetPoint("TOPRIGHT", 1, 1) + border[3]:SetHeight(borderSize) + + local topoutline = self:CreateTexture(nil,"BORDER") + topoutline:SetTexture(0,0,0) + topoutline:SetPoint("TOPLEFT", -2, 2) + topoutline:SetPoint("TOPRIGHT", 2, 2) + topoutline:SetHeight(1) + + border[4] = self:CreateTexture(nil,"BORDER") + border[4]:SetTexture(r,g,b) + border[4]:SetPoint("BOTTOMLEFT", -1, -1) + border[4]:SetPoint("BOTTOMRIGHT", 1, -1) + border[4]:SetHeight(borderSize) + + local bottomoutline = self:CreateTexture(nil,"BORDER") + bottomoutline:SetTexture(0,0,0) + bottomoutline:SetPoint("BOTTOMLEFT", -2, -2) + bottomoutline:SetPoint("BOTTOMRIGHT", 2, -2) + bottomoutline:SetHeight(1) + + self.__border = border + end if(not self.hover) then - local hover = border:CreateTexture(nil, "HIGHLIGHT") - local color = SuperVillain.Media.color.highlight - hover:SetTexture(color[1], color[2], color[3], 0.5) - hover:SetAllPoints(border) - self.hover = hover; - if(self.SetHighlightTexture) then - self:SetHighlightTexture(hover) - end - end + self.hover = self:CreateTexture(nil, "HIGHLIGHT") + end - self.BorderPanel = border - self.styled = true - TemplateUpdateFrames[self] = true + local color = SV.Media.color.highlight + self.hover:SetTexture(color[1], color[2], color[3], 0.5) + self.hover:SetAllPoints() + if(self.SetHighlightTexture) then + self:SetHighlightTexture(self.hover) + end + + if(not self.__registered) then + TemplateUpdateFrames[self] = true + self.__registered = true + end end --[[ ########################################################## @@ -1325,7 +1515,7 @@ TEMPLATE UPDATE CALLBACK local function FrameTemplateUpdates() for frame in pairs(TemplateUpdateFrames) do if(frame) then - local p = SuperVillain.Media.color[frame._color]; + local p = SV.Media.color[frame._color]; if(frame.BackdropNeedsUpdate) then if(frame.UpdateBackdrop) then frame:UpdateBackdrop() @@ -1336,13 +1526,13 @@ local function FrameTemplateUpdates() frame:SetBackdropBorderColor(0,0,0,1) end if(frame.TextureNeedsUpdate and frame._texture) then - local tex = SuperVillain.Media.bg[frame._texture] + local tex = SV.Media.bg[frame._texture] if(tex) then frame._skin:SetTexture(tex) end if(not frame.NoColorUpdate) then - if(frame._gradient and SuperVillain.Media.gradient[frame._gradient]) then - local g = SuperVillain.Media.gradient[frame._gradient] + if(frame._gradient and SV.Media.gradient[frame._gradient]) then + local g = SV.Media.gradient[frame._gradient] frame._skin:SetGradient(g[1], g[2], g[3], g[4], g[5], g[6], g[7]) elseif(p) then frame._skin:SetVertexColor(p[1], p[2], p[3], p[4] or 1) @@ -1352,7 +1542,8 @@ local function FrameTemplateUpdates() end end end -SuperVillain.Registry:SetCallback(FrameTemplateUpdates) + +Registry:NewCallback(FrameTemplateUpdates) --[[ ########################################################## ENUMERATION @@ -1366,8 +1557,8 @@ local function AppendMethods(OBJECT) if not OBJECT.Point then META.Point = PointScaled end if not OBJECT.WrapOuter then META.WrapOuter = WrapOuter end 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.Die then META.Die = Die end + if not OBJECT.RemoveTextures then META.RemoveTextures = RemoveTextures 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 diff --git a/Interface/AddOns/SVUI/system/database.lua b/Interface/AddOns/SVUI/system/database.lua index 6fc573e..3040dc7 100644 --- a/Interface/AddOns/SVUI/system/database.lua +++ b/Interface/AddOns/SVUI/system/database.lua @@ -34,137 +34,12 @@ local tremove, tcopy, twipe, tsort, tconcat, tdump = table.remove, table.copy, t GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -SuperVillain.Shared = LibStub("LibSharedMedia-3.0") +local SV, L, Registry = unpack(select(2, ...)); local realm = GetRealmName() local name = UnitName("player") local pkey = ("%s - %s"):format(name, realm) local databaseListener = CreateFrame("Frame", nil) -local CONFIGS = SuperVillain.Configs ---[[ -########################################################## -DEFINE SHARED MEDIA -########################################################## -]]-- -SuperVillain.Shared:Register("background","SVUI Backdrop 1",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN1]]) -SuperVillain.Shared:Register("background","SVUI Backdrop 2",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN2]]) -SuperVillain.Shared:Register("background","SVUI Backdrop 3",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN3]]) -SuperVillain.Shared:Register("background","SVUI Backdrop 4",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN4]]) -SuperVillain.Shared:Register("background","SVUI Backdrop 5",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN5]]) -SuperVillain.Shared:Register("background","SVUI Comic 1",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC1]]) -SuperVillain.Shared:Register("background","SVUI Comic 2",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC2]]) -SuperVillain.Shared:Register("background","SVUI Comic 3",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC3]]) -SuperVillain.Shared:Register("background","SVUI Comic 4",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC4]]) -SuperVillain.Shared:Register("background","SVUI Comic 5",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC5]]) -SuperVillain.Shared:Register("background","SVUI Comic 6",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC6]]) -SuperVillain.Shared:Register("background","SVUI Unit BG 1",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-BG1]]) -SuperVillain.Shared:Register("background","SVUI Unit BG 2",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-BG2]]) -SuperVillain.Shared:Register("background","SVUI Unit BG 3",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-BG3]]) -SuperVillain.Shared:Register("background","SVUI Unit BG 4",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-BG4]]) -SuperVillain.Shared:Register("background","SVUI Small BG 1",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG1]]) -SuperVillain.Shared:Register("background","SVUI Small BG 2",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG2]]) -SuperVillain.Shared:Register("background","SVUI Small BG 3",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG3]]) -SuperVillain.Shared:Register("background","SVUI Small BG 4",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG4]]) -SuperVillain.Shared:Register("statusbar","SVUI BasicBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) -SuperVillain.Shared:Register("statusbar","SVUI MultiColorBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\GRADIENT]]) -SuperVillain.Shared:Register("statusbar","SVUI SmoothBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\SMOOTH]]) -SuperVillain.Shared:Register("statusbar","SVUI PlainBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\FLAT]]) -SuperVillain.Shared:Register("statusbar","SVUI FancyBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\TEXTURED]]) -SuperVillain.Shared:Register("statusbar","SVUI GlossBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\GLOSS]]) -SuperVillain.Shared:Register("statusbar","SVUI GlowBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\GLOWING]]) -SuperVillain.Shared:Register("statusbar","SVUI LazerBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\LAZER]]) -SuperVillain.Shared:Register("sound", "Whisper Alert", [[Interface\AddOns\SVUI\assets\sounds\whisper.mp3]]) -SuperVillain.Shared:Register("sound", "Toasty", [[Interface\AddOns\SVUI\assets\sounds\toasty.mp3]]) -SuperVillain.Shared:Register("font","SVUI Default Font",[[Interface\AddOns\SVUI\assets\fonts\Default.ttf]]) -SuperVillain.Shared:Register("font","SVUI System Font",[[Interface\AddOns\SVUI\assets\fonts\System.ttf]]) -SuperVillain.Shared:Register("font","SVUI Dialog Font",[[Interface\AddOns\SVUI\assets\fonts\Dialog.ttf]]) -SuperVillain.Shared:Register("font","SVUI Narrator Font",[[Interface\AddOns\SVUI\assets\fonts\Narrative.ttf]]) -SuperVillain.Shared:Register("font","SVUI Number Font",[[Interface\AddOns\SVUI\assets\fonts\Numbers.ttf]]) -SuperVillain.Shared:Register("font","SVUI Combat Font",[[Interface\AddOns\SVUI\assets\fonts\Combat.ttf]]) -SuperVillain.Shared:Register("font","SVUI Action Font",[[Interface\AddOns\SVUI\assets\fonts\Action.ttf]]) -SuperVillain.Shared:Register("font","SVUI Name Font",[[Interface\AddOns\SVUI\assets\fonts\Names.ttf]]) -SuperVillain.Shared:Register("font","SVUI Alert Font",[[Interface\AddOns\SVUI\assets\fonts\Alert.ttf]]) -SuperVillain.Shared:Register("font","SVUI Pixel Font",[[Interface\AddOns\SVUI\assets\fonts\Pixel.ttf]],SuperVillain.Shared.LOCALE_BIT_ruRU+SuperVillain.Shared.LOCALE_BIT_western) -SuperVillain.Shared:Register("font","Roboto",[[Interface\AddOns\SVUI\assets\fonts\Roboto.ttf]],SuperVillain.Shared.LOCALE_BIT_ruRU+SuperVillain.Shared.LOCALE_BIT_western) ---[[ -########################################################## -POPULATE MEDIA TABLE -########################################################## -]]-- -do - local myclass = select(2,UnitClass("player")) - local cColor1 = SVUI_CLASS_COLORS[myclass] - local cColor2 = RAID_CLASS_COLORS[myclass] - local r1,g1,b1 = cColor1.r,cColor1.g,cColor1.b - local r2,g2,b2 = cColor2.r*.25, cColor2.g*.25, cColor2.b*.25 - local ir1,ig1,ib1 = (1 - r1), (1 - g1), (1 - b1) - local ir2,ig2,ib2 = (1 - cColor2.r)*.25, (1 - cColor2.g)*.25, (1 - cColor2.b)*.25 - local Shared = SuperVillain.Shared - - SuperVillain.Media["color"] = { - ["default"] = {0.2, 0.2, 0.2, 1}, - ["special"] = {.37, .32, .29, 1}, - ["unique"] = {0.32, 0.258, 0.21, 1}, - ["class"] = {r1, g1, b1, 1}, - ["bizzaro"] = {ir1, ig1, ib1, 1}, - ["dark"] = {0, 0, 0, 1}, - ["light"] = {0.95, 0.95, 0.95, 1}, - ["highlight"] = {0.1, 0.8, 0.8, 1}, - ["green"] = {0.25, 0.9, 0.08, 1}, - ["red"] = {0.9, 0.08, 0.08, 1}, - ["yellow"] = {1, 1, 0, 1}, - ["transparent"] = {0, 0, 0, 0.5}, - } - - SuperVillain.Media["font"] = { - ["default"] = Shared:Fetch("font", "SVUI Default Font"), - ["system"] = Shared:Fetch("font", "SVUI System Font"), - ["combat"] = Shared:Fetch("font", "SVUI Combat Font"), - ["dialog"] = Shared:Fetch("font", "SVUI Dialog Font"), - ["narrator"] = Shared:Fetch("font", "SVUI Narrator Font"), - ["action"] = Shared:Fetch("font", "SVUI Action Font"), - ["names"] = Shared:Fetch("font", "SVUI Name Font"), - ["alert"] = Shared:Fetch("font", "SVUI Alert Font"), - ["numbers"] = Shared:Fetch("font", "SVUI Number Font"), - ["pixel"] = Shared:Fetch("font", "SVUI Pixel Font"), - ["roboto"] = Shared:Fetch("font", "Roboto") - } - - SuperVillain.Media["bar"] = { - ["default"] = Shared:Fetch("statusbar", "SVUI BasicBar"), - ["gradient"] = Shared:Fetch("statusbar", "SVUI MultiColorBar"), - ["smooth"] = Shared:Fetch("statusbar", "SVUI SmoothBar"), - ["flat"] = Shared:Fetch("statusbar", "SVUI PlainBar"), - ["textured"] = Shared:Fetch("statusbar", "SVUI FancyBar"), - ["gloss"] = Shared:Fetch("statusbar", "SVUI GlossBar"), - ["glow"] = Shared:Fetch("statusbar", "SVUI GlowBar"), - ["lazer"] = Shared:Fetch("statusbar", "SVUI LazerBar"), - } - - SuperVillain.Media["bg"] = { - ["pattern"] = Shared:Fetch("background", "SVUI Backdrop 1"), - ["comic"] = Shared:Fetch("background", "SVUI Comic 1"), - ["unitlarge"] = Shared:Fetch("background", "SVUI Unit BG 3"), - ["unitsmall"] = Shared:Fetch("background", "SVUI Small BG 3") - } - - SuperVillain.Media["gradient"] = { - ["default"] = {"VERTICAL", 0.08, 0.08, 0.08, 0.22, 0.22, 0.22}, - ["special"] = {"VERTICAL", 0.33, 0.25, 0.13, 0.47, 0.39, 0.27}, - ["class"] = {"VERTICAL", r2, g2, b2, r1, g1, b1}, - ["bizzaro"] = {"VERTICAL", ir2, ig2, ib2, ir1, ig1, ib1}, - ["dark"] = {"VERTICAL", 0.02, 0.02, 0.02, 0.22, 0.22, 0.22}, - ["darkest"] = {"VERTICAL", 0.15, 0.15, 0.15, 0, 0, 0}, - ["darkest2"] = {"VERTICAL", 0, 0, 0, 0.12, 0.12, 0.12}, - ["light"] = {"VERTICAL", 0.65, 0.65, 0.65, 0.95, 0.95, 0.95}, - ["highlight"] = {"VERTICAL", 0.1, 0.8, 0.8, 0.2, 0.5, 1}, - ["green"] = {"VERTICAL", 0.08, 0.5, 0, 0.25, 0.9, 0.08}, - ["red"] = {"VERTICAL", 0.5, 0, 0, 0.9, 0.08, 0.08}, - ["yellow"] = {"VERTICAL", 1, 0.3, 0, 1, 1, 0}, - ["inverse"] = {"VERTICAL", 0.25, 0.25, 0.25, 0.12, 0.12, 0.12}, - ["icon"] = {"VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1} - } -end +local CONFIGS = SV.Configs --[[ ########################################################## DB BUILD HELPERS @@ -173,7 +48,7 @@ DB BUILD HELPERS local function SpellName(id) local name, _, _, _, _, _, _, _, _ = GetSpellInfo(id) if not name then - SuperVillain:Debugger('|cffFF9900SVUI:|r Spell not found: (#ID) '..id) + SV:Debugger('|cffFF9900SVUI:|r Spell not found: (#ID) '..id) name = "Voodoo Doll"; end return name @@ -185,7 +60,7 @@ DB PROFILE ]]-- CONFIGS["copyKey"] = pkey CONFIGS["profileKey"] = pkey -CONFIGS["framelocations"] = {} +CONFIGS["framelocations"] = {} CONFIGS["system"] = { ["cooldown"] = true, ["autoScale"] = true, @@ -201,7 +76,9 @@ CONFIGS["system"] = { ["questWatch"] = true, ["woot"] = true, ["pvpinterrupt"] = true, - ["lookwhaticando"] = false, + ["lookwhaticando"] = false, + ["reactionChat"] = false, + ["reactionEmote"] = false, ["sharingiscaring"] = false, ["arenadrink"] = true, ["stupidhat"] = true, @@ -838,7 +715,7 @@ local function safename(id) if type(id) == "string" then n = id else - SuperVillain:Debugger('|cffFF9900SVUI:|r Spell not found: (#ID) '..id) + SV:Debugger('|cffFF9900SVUI:|r Spell not found: (#ID) '..id) n = "Voodoo Doll"; end end @@ -863,7 +740,7 @@ for k, x in pairs(FilterIDs) do CONFIGS.filter[k] = src end -CONFIGS.filter.BuffWatch = CLASS_WATCH_INDEX[SuperVillain.class] or {} +CONFIGS.filter.BuffWatch = CLASS_WATCH_INDEX[SV.class] or {} CONFIGS.filter.PetBuffWatch = PET_WATCH --[[ ########################################################## @@ -955,7 +832,7 @@ end local function importprofile(t, key) local sv = rawget(t, "profile") local dv = rawget(t, "defaults") - local globals = SuperVillain.Global + local globals = SV.Global local src = globals.profiles[key] if(not src) then return end for k,v in pairs(sv) do @@ -967,15 +844,15 @@ local function importprofile(t, key) end local function importprompt(t, key) - SuperVillain.SystemAlert["COPY_PROFILE_PROMPT"].text = L["Are you sure you want to copy the profile '" .. key .. "'?"] - SuperVillain.SystemAlert["COPY_PROFILE_PROMPT"].OnAccept = function() importprofile(t, key) end - SuperVillain:StaticPopup_Show("COPY_PROFILE_PROMPT") + SV.SystemAlert["COPY_PROFILE_PROMPT"].text = L["Are you sure you want to copy the profile '" .. key .. "'?"] + SV.SystemAlert["COPY_PROFILE_PROMPT"].OnAccept = function() importprofile(t, key) end + SV:StaticPopup_Show("COPY_PROFILE_PROMPT") end local function exportprofile(t, key) local sv = rawget(t, "profile") local dv = rawget(t, "defaults") - local globals = SuperVillain.Global + local globals = SV.Global if(not globals.profiles[key]) then globals.profiles[key] = {} end local saved = globals.profiles[key] tablecopy(saved, sv) @@ -983,11 +860,11 @@ local function exportprofile(t, key) removedefaults(saved[k], dv[k]) end globals.profileKeys[key] = key - SuperVillain:SavedPopup() + SV:SavedPopup() end local function removeprofile(t, key) - local globals = SuperVillain.Global + local globals = SV.Global if(globals.profiles[key]) then globals.profiles[key] = nil end if(globals.profileKeys[key]) then globals.profileKeys[key] = nil end collectgarbage("collect") @@ -1014,9 +891,9 @@ local function initializedata(t) end local function SanitizeDatabase() - if(not SuperVillain.db) then return end - local db = SuperVillain.db - local src = SuperVillain.Configs + if(not SV.db) then return end + local db = SV.db + local src = SV.Configs for k,v in pairs(db) do if(src[k]) then removedefaults(db[k], src[k]) @@ -1028,7 +905,7 @@ local DataBase_OnEvent = function(self, event) if event == "PLAYER_LOGOUT" then SanitizeDatabase() elseif(event == "ACTIVE_TALENT_GROUP_CHANGED") then - SuperVillain:UpdateDatabase() + SV:UpdateDatabase() end end @@ -1058,7 +935,7 @@ local METAPROFILE = function(sv) db.profile = sv.STORED[key] db.protected = sv.SAFEDATA - db.defaults = CONFIGS + db.defaults = SV.Configs db.Init = initializedata db.Append = insertdata db.Reset = resetprofile @@ -1073,15 +950,15 @@ local METAPROFILE = function(sv) return db end -function SuperVillain:AppendDefaults(newIndex, newData) +function SV:AppendDefaults(newIndex, newData) self.Configs[newIndex] = newData end -function SuperVillain:GetProfiles() +function SV:GetProfiles() return self.Global.profileKeys or {} end -function SuperVillain:CheckProfiles() +function SV:CheckProfiles() local hasProfile = false local list = self.Global.profileKeys or {} for key,_ in pairs(list) do @@ -1090,17 +967,21 @@ function SuperVillain:CheckProfiles() return hasProfile end -function SuperVillain:UpdateDatabase() +function SV:UpdateDatabase(partial) local sv = _G["SVUI_Profile"] twipe(self.db) self.db = METAPROFILE(sv) self.db:Init() self.db.profileKey = pkey - SuperVillain.Registry:UpdateAll() + + --print("Update db") + if(not partial) then + Registry:UpdateAll() + end end -function SuperVillain:ToggleSpecSwap(value) +function SV:ToggleSpecSwap(value) if(value) then databaseListener:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") self:UpdateDatabase() @@ -1109,33 +990,7 @@ function SuperVillain:ToggleSpecSwap(value) end end -function SuperVillain:HexColor(arg1,arg2,arg3) - local r,g,b; - if arg1 and type(arg1) == "string" then - local t - if(self.Media or self.db.media) then - t = self.Media.color[arg1] or self.db.media.unitframes[arg1] - else - t = self.Configs.media.colors[arg1] or self.Configs.media.unitframes[arg1] - end - if t then - r,g,b = t[1],t[2],t[3] - else - r,g,b = 0,0,0 - end - else - r = type(arg1) == "number" and arg1 or 0; - g = type(arg2) == "number" and arg2 or 0; - b = type(arg3) == "number" and arg3 or 0; - end - r = (r < 0 or r > 1) and 0 or (r * 255) - g = (g < 0 or g > 1) and 0 or (g * 255) - b = (b < 0 or b > 1) and 0 or (b * 255) - local hexString = ("%02x%02x%02x"):format(r,g,b) - return hexString -end - -function SuperVillain:TableSplice(targetTable, mergeTable) +function SV:TableSplice(targetTable, mergeTable) if type(targetTable) ~= "table" then targetTable = {} end if type(mergeTable) == 'table' then @@ -1149,7 +1004,7 @@ function SuperVillain:TableSplice(targetTable, mergeTable) return targetTable end -function SuperVillain:SetDatabaseObjects(init) +function SV:SetDatabaseObjects(init) if(init) then self.db = tcopy(self.Configs, true) else @@ -1163,6 +1018,7 @@ function SuperVillain:SetDatabaseObjects(init) twipe(self.db) + --print("Init db") self.db = METAPROFILE(sv) self.db:Init() self.db.profileKey = pkey diff --git a/Interface/AddOns/SVUI/system/installer.lua b/Interface/AddOns/SVUI/system/installer.lua deleted file mode 100644 index 6ca8edd..0000000 --- a/Interface/AddOns/SVUI/system/installer.lua +++ /dev/null @@ -1,1275 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -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 type = _G.type; -local string = _G.string; -local table = _G.table; -local format = string.format; -local tcopy = table.copy; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SuperVillain, L = unpack(select(2, ...)); ---[[ -########################################################## -LOCAL VARS -########################################################## -]]-- -local CURRENT_PAGE, MAX_PAGE, XOFF = 0, 9, (GetScreenWidth() * 0.025) -local okToResetMOVE = false -local mungs = false; -local user_music_vol; -local musicIsPlaying; ---[[ -########################################################## -LOCAL FUNCTIONS -########################################################## -]]-- -local function SetInstallButton(button) - if(not button) then return end - button.Left:SetAlpha(0) - button.Middle:SetAlpha(0) - button.Right:SetAlpha(0) - button:SetNormalTexture("") - button:SetPushedTexture("") - button:SetPushedTexture("") - button:SetDisabledTexture("") - button:Formula409() - button:SetFrameLevel(button:GetFrameLevel() + 1) -end - -local function forceCVars() - SetCVar("alternateResourceText",1) - SetCVar("statusTextDisplay","BOTH") - SetCVar("ShowClassColorInNameplate",1) - SetCVar("screenshotQuality",10) - SetCVar("chatMouseScroll",1) - SetCVar("chatStyle","classic") - SetCVar("WholeChatWindowClickable",0) - SetCVar("ConversationMode","inline") - SetCVar("showTutorials",0) - SetCVar("UberTooltips",1) - SetCVar("threatWarning",3) - SetCVar('alwaysShowActionBars',1) - SetCVar('lockActionBars',1) - SetCVar('SpamFilter',0) - InterfaceOptionsActionBarsPanelPickupActionKeyDropDown:SetValue('SHIFT') - InterfaceOptionsActionBarsPanelPickupActionKeyDropDown:RefreshValue() -end - -local function ShowLayout(show40) - if(show40 and _G["SVUI_Raid40"].forceShow == true) then return end - if(not show40 and _G["SVUI_Raid40"].forceShow ~= true) then return end - SuperVillain.SVUnit:UpdateGroupConfig(_G["SVUI_Raid40"], show40) -end - -local function BarShuffle() - local bar2 = SuperVillain.db.SVBar.Bar2.enable; - local base = 30; - local bS = SuperVillain.db.SVBar.Bar1.buttonspacing; - local tH = SuperVillain.db.SVBar.Bar1.buttonsize + (base - bS); - local b2h = bar2 and tH or base; - local sph = (400 - b2h); - if not SuperVillain.db.framelocations then SuperVillain.db.framelocations = {} end - SuperVillain.db.framelocations.SVUI_SpecialAbility_MOVE = "BOTTOMSVUIParentBOTTOM0"..sph; - SuperVillain.db.framelocations.SVUI_ActionBar2_MOVE = "BOTTOMSVUI_ActionBar1TOP0"..(-bS); - SuperVillain.db.framelocations.SVUI_ActionBar3_MOVE = "BOTTOMLEFTSVUI_ActionBar1BOTTOMRIGHT40"; - SuperVillain.db.framelocations.SVUI_ActionBar5_MOVE = "BOTTOMRIGHTSVUI_ActionBar1BOTTOMLEFT-40"; - if bar2 then - SuperVillain.db.framelocations.SVUI_PetActionBar_MOVE = "BOTTOMLEFTSVUI_ActionBar2TOPLEFT04" - SuperVillain.db.framelocations.SVUI_StanceBar_MOVE = "BOTTOMRIGHTSVUI_ActionBar2TOPRIGHT04"; - else - SuperVillain.db.framelocations.SVUI_PetActionBar_MOVE = "BOTTOMLEFTSVUI_ActionBar1TOPLEFT04" - SuperVillain.db.framelocations.SVUI_StanceBar_MOVE = "BOTTOMRIGHTSVUI_ActionBar1TOPRIGHT04"; - end -end - -local function UFMoveBottomQuadrant(toggle) - if not SuperVillain.db.framelocations then SuperVillain.db.framelocations = {} end - if not toggle then - SuperVillain.db.framelocations.SVUI_Player_MOVE = "BOTTOMSVUIParentBOTTOM-278182" - SuperVillain.db.framelocations.SVUI_PlayerCastbar_MOVE = "BOTTOMSVUIParentBOTTOM-278122" - SuperVillain.db.framelocations.SVUI_Target_MOVE = "BOTTOMSVUIParentBOTTOM278182" - SuperVillain.db.framelocations.SVUI_TargetCastbar_MOVE = "BOTTOMSVUIParentBOTTOM278122" - SuperVillain.db.framelocations.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM0182" - SuperVillain.db.framelocations.SVUI_TargetTarget_MOVE = "BOTTOMSVUIParentBOTTOM0225" - SuperVillain.db.framelocations.SVUI_Focus_MOVE = "BOTTOMSVUIParentBOTTOM310432" - SuperVillain.db.framelocations.SVUI_ThreatBar_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-495182" - elseif toggle == "shift" then - SuperVillain.db.framelocations.SVUI_Player_MOVE = "BOTTOMSVUIParentBOTTOM-278210" - SuperVillain.db.framelocations.SVUI_PlayerCastbar_MOVE = "BOTTOMSVUIParentBOTTOM-278150" - SuperVillain.db.framelocations.SVUI_Target_MOVE = "BOTTOMSVUIParentBOTTOM278210" - SuperVillain.db.framelocations.SVUI_TargetCastbar_MOVE = "BOTTOMSVUIParentBOTTOM278150" - SuperVillain.db.framelocations.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM0210" - SuperVillain.db.framelocations.SVUI_TargetTarget_MOVE = "BOTTOMSVUIParentBOTTOM0253" - SuperVillain.db.framelocations.SVUI_Focus_MOVE = "BOTTOMSVUIParentBOTTOM310432" - SuperVillain.db.framelocations.SVUI_ThreatBar_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-495210" - else - local c = 136; - local d = 135; - local e = 80; - SuperVillain.db.framelocations.SVUI_Player_MOVE = "BOTTOMSVUIParentBOTTOM"..-c..""..d; - SuperVillain.db.framelocations.SVUI_PlayerCastbar_MOVE = "BOTTOMSVUIParentBOTTOM"..-c..""..(d-60); - SuperVillain.db.framelocations.SVUI_Target_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..d; - SuperVillain.db.framelocations.SVUI_TargetCastbar_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..(d-60); - SuperVillain.db.framelocations.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM"..-c..""..e; - SuperVillain.db.framelocations.SVUI_TargetTarget_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..e; - SuperVillain.db.framelocations.SVUI_Focus_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..(d + 150); - SuperVillain.db.framelocations.SVUI_ThreatBar_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-495"..d; - end -end - -local function UFMoveLeftQuadrant(toggle) - if not SuperVillain.db.framelocations then SuperVillain.db.framelocations = {} end - if not toggle then - SuperVillain.db.framelocations.SVUI_Assist_MOVE = "TOPLEFTSVUIParentTOPLEFT"..XOFF.."-250" - SuperVillain.db.framelocations.SVUI_Tank_MOVE = "TOPLEFTSVUIParentTOPLEFT"..XOFF.."-175" - SuperVillain.db.framelocations.SVUI_Raidpet_MOVE = "TOPLEFTSVUIParentTOPLEFT"..XOFF.."-325" - SuperVillain.db.framelocations.SVUI_Party_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" - SuperVillain.db.framelocations.SVUI_Raid10_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" - SuperVillain.db.framelocations.SVUI_Raid25_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" - SuperVillain.db.framelocations.SVUI_Raid40_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" - else - SuperVillain.db.framelocations.SVUI_Assist_MOVE = "TOPLEFTSVUIParentTOPLEFT4-250" - SuperVillain.db.framelocations.SVUI_Tank_MOVE = "TOPLEFTSVUIParentTOPLEFT4-175" - SuperVillain.db.framelocations.SVUI_Raidpet_MOVE = "TOPLEFTSVUIParentTOPLEFT4-325" - SuperVillain.db.framelocations.SVUI_Party_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" - SuperVillain.db.framelocations.SVUI_Raid40_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" - SuperVillain.db.framelocations.SVUI_Raid10_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" - SuperVillain.db.framelocations.SVUI_Raid25_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" - end -end - -local function UFMoveTopQuadrant(toggle) - if not SuperVillain.db.framelocations then SuperVillain.db.framelocations = {} end - if not toggle then - SuperVillain.db.framelocations.GM_MOVE = "TOPLEFTSVUIParentTOPLEFT250-25" - SuperVillain.db.framelocations.SVUI_LootFrame_MOVE = "BOTTOMSVUIParentBOTTOM0350" - SuperVillain.db.framelocations.SVUI_AltPowerBar_MOVE = "TOPSVUIParentTOP0-40" - SuperVillain.db.framelocations.LoC_MOVE = "BOTTOMSVUIParentBOTTOM0350" - SuperVillain.db.framelocations.BNET_MOVE = "TOPRIGHTSVUIParentTOPRIGHT-4-250" - else - SuperVillain.db.framelocations.GM_MOVE = "TOPLEFTSVUIParentTOPLEFT344-25" - SuperVillain.db.framelocations.SVUI_LootFrame_MOVE = "BOTTOMSVUIParentBOTTOM0254" - SuperVillain.db.framelocations.SVUI_AltPowerBar_MOVE = "TOPSVUIParentTOP0-39" - SuperVillain.db.framelocations.LoC_MOVE = "BOTTOMSVUIParentBOTTOM0443" - SuperVillain.db.framelocations.BNET_MOVE = "TOPRIGHTSVUIParentTOPRIGHT-4-248" - end -end - -local function UFMoveRightQuadrant(toggle) - if not SuperVillain.db.framelocations then SuperVillain.db.framelocations = {} end - local dH = SuperVillain.db.SVDock.dockRightHeight + 60 - if not toggle or toggle == "high" then - SuperVillain.db.framelocations.SVUI_BossHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" - SuperVillain.db.framelocations.SVUI_ArenaHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" - SuperVillain.db.framelocations.Tooltip_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-284"..dH; - else - SuperVillain.db.framelocations.SVUI_BossHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" - SuperVillain.db.framelocations.SVUI_ArenaHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" - SuperVillain.db.framelocations.Tooltip_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-284"..dH; - end -end - -local function initChat(mungs) - forceCVars() - FCF_ResetChatWindows() - FCF_SetLocked(ChatFrame1, 1) - FCF_DockFrame(ChatFrame2) - FCF_SetLocked(ChatFrame2, 1) - FCF_OpenNewWindow(LOOT) - FCF_DockFrame(ChatFrame3) - FCF_SetLocked(ChatFrame3, 1) - for i = 1, NUM_CHAT_WINDOWS do - local chat = _G["ChatFrame"..i] - local chatID = chat:GetID() - if i == 1 then - chat:ClearAllPoints() - chat:Point("BOTTOMLEFT", LeftSuperDock, "BOTTOMLEFT", 5, 5) - chat:Point("TOPRIGHT", LeftSuperDock, "TOPRIGHT", -5, -10) - end - FCF_SavePositionAndDimensions(chat) - FCF_StopDragging(chat) - FCF_SetChatWindowFontSize(nil, chat, 12) - if i == 1 then - FCF_SetWindowName(chat, GENERAL) - elseif i == 2 then - FCF_SetWindowName(chat, GUILD_EVENT_LOG) - elseif i == 3 then - FCF_SetWindowName(chat, LOOT) - end - end - ChatFrame_RemoveAllMessageGroups(ChatFrame1) - ChatFrame_AddMessageGroup(ChatFrame1, "SAY") - ChatFrame_AddMessageGroup(ChatFrame1, "EMOTE") - ChatFrame_AddMessageGroup(ChatFrame1, "YELL") - ChatFrame_AddMessageGroup(ChatFrame1, "GUILD") - ChatFrame_AddMessageGroup(ChatFrame1, "OFFICER") - ChatFrame_AddMessageGroup(ChatFrame1, "GUILD_ACHIEVEMENT") - ChatFrame_AddMessageGroup(ChatFrame1, "WHISPER") - ChatFrame_AddMessageGroup(ChatFrame1, "MONSTER_SAY") - ChatFrame_AddMessageGroup(ChatFrame1, "MONSTER_EMOTE") - ChatFrame_AddMessageGroup(ChatFrame1, "MONSTER_YELL") - ChatFrame_AddMessageGroup(ChatFrame1, "MONSTER_BOSS_EMOTE") - ChatFrame_AddMessageGroup(ChatFrame1, "PARTY") - ChatFrame_AddMessageGroup(ChatFrame1, "PARTY_LEADER") - ChatFrame_AddMessageGroup(ChatFrame1, "RAID") - ChatFrame_AddMessageGroup(ChatFrame1, "RAID_LEADER") - ChatFrame_AddMessageGroup(ChatFrame1, "RAID_WARNING") - ChatFrame_AddMessageGroup(ChatFrame1, "INSTANCE_CHAT") - ChatFrame_AddMessageGroup(ChatFrame1, "INSTANCE_CHAT_LEADER") - ChatFrame_AddMessageGroup(ChatFrame1, "BATTLEGROUND") - ChatFrame_AddMessageGroup(ChatFrame1, "BATTLEGROUND_LEADER") - ChatFrame_AddMessageGroup(ChatFrame1, "BG_HORDE") - ChatFrame_AddMessageGroup(ChatFrame1, "BG_ALLIANCE") - ChatFrame_AddMessageGroup(ChatFrame1, "BG_NEUTRAL") - ChatFrame_AddMessageGroup(ChatFrame1, "SYSTEM") - ChatFrame_AddMessageGroup(ChatFrame1, "ERRORS") - ChatFrame_AddMessageGroup(ChatFrame1, "AFK") - ChatFrame_AddMessageGroup(ChatFrame1, "DND") - ChatFrame_AddMessageGroup(ChatFrame1, "IGNORED") - ChatFrame_AddMessageGroup(ChatFrame1, "ACHIEVEMENT") - ChatFrame_AddMessageGroup(ChatFrame1, "BN_WHISPER") - ChatFrame_AddMessageGroup(ChatFrame1, "BN_CONVERSATION") - ChatFrame_AddMessageGroup(ChatFrame1, "BN_INLINE_TOAST_ALERT") - ChatFrame_AddMessageGroup(ChatFrame1, "COMBAT_FACTION_CHANGE") - ChatFrame_AddMessageGroup(ChatFrame1, "SKILL") - ChatFrame_AddMessageGroup(ChatFrame1, "LOOT") - ChatFrame_AddMessageGroup(ChatFrame1, "MONEY") - ChatFrame_AddMessageGroup(ChatFrame1, "COMBAT_XP_GAIN") - ChatFrame_AddMessageGroup(ChatFrame1, "COMBAT_HONOR_GAIN") - ChatFrame_AddMessageGroup(ChatFrame1, "COMBAT_GUILD_XP_GAIN") - - ChatFrame_RemoveAllMessageGroups(ChatFrame3) - ChatFrame_AddMessageGroup(ChatFrame3, "COMBAT_FACTION_CHANGE") - ChatFrame_AddMessageGroup(ChatFrame3, "SKILL") - ChatFrame_AddMessageGroup(ChatFrame3, "LOOT") - ChatFrame_AddMessageGroup(ChatFrame3, "MONEY") - ChatFrame_AddMessageGroup(ChatFrame3, "COMBAT_XP_GAIN") - ChatFrame_AddMessageGroup(ChatFrame3, "COMBAT_HONOR_GAIN") - ChatFrame_AddMessageGroup(ChatFrame3, "COMBAT_GUILD_XP_GAIN") - - ChatFrame_AddChannel(ChatFrame1, GENERAL) - - ToggleChatColorNamesByClassGroup(true, "SAY") - ToggleChatColorNamesByClassGroup(true, "EMOTE") - ToggleChatColorNamesByClassGroup(true, "YELL") - ToggleChatColorNamesByClassGroup(true, "GUILD") - ToggleChatColorNamesByClassGroup(true, "OFFICER") - ToggleChatColorNamesByClassGroup(true, "GUILD_ACHIEVEMENT") - ToggleChatColorNamesByClassGroup(true, "ACHIEVEMENT") - ToggleChatColorNamesByClassGroup(true, "WHISPER") - ToggleChatColorNamesByClassGroup(true, "PARTY") - ToggleChatColorNamesByClassGroup(true, "PARTY_LEADER") - ToggleChatColorNamesByClassGroup(true, "RAID") - ToggleChatColorNamesByClassGroup(true, "RAID_LEADER") - ToggleChatColorNamesByClassGroup(true, "RAID_WARNING") - ToggleChatColorNamesByClassGroup(true, "BATTLEGROUND") - ToggleChatColorNamesByClassGroup(true, "BATTLEGROUND_LEADER") - ToggleChatColorNamesByClassGroup(true, "INSTANCE_CHAT") - ToggleChatColorNamesByClassGroup(true, "INSTANCE_CHAT_LEADER") - ToggleChatColorNamesByClassGroup(true, "CHANNEL1") - ToggleChatColorNamesByClassGroup(true, "CHANNEL2") - ToggleChatColorNamesByClassGroup(true, "CHANNEL3") - ToggleChatColorNamesByClassGroup(true, "CHANNEL4") - ToggleChatColorNamesByClassGroup(true, "CHANNEL5") - ToggleChatColorNamesByClassGroup(true, "CHANNEL6") - ToggleChatColorNamesByClassGroup(true, "CHANNEL7") - ToggleChatColorNamesByClassGroup(true, "CHANNEL8") - ToggleChatColorNamesByClassGroup(true, "CHANNEL9") - ToggleChatColorNamesByClassGroup(true, "CHANNEL10") - ToggleChatColorNamesByClassGroup(true, "CHANNEL11") - - ChangeChatColor("CHANNEL1", 195 / 255, 230 / 255, 232 / 255) - ChangeChatColor("CHANNEL2", 232 / 255, 158 / 255, 121 / 255) - ChangeChatColor("CHANNEL3", 232 / 255, 228 / 255, 121 / 255) - - if not mungs then - if SuperVillain.Chat then - SuperVillain.Chat:ReLoad(true) - if SVUI_Cache["Dock"].RightSuperDockFaded == true then RightSuperDockToggleButton:Click()end - if SVUI_Cache["Dock"].LeftSuperDockFaded == true then LeftSuperDockToggleButton:Click()end - end - SuperVillain:SavedPopup() - end -end ---[[ -########################################################## -GLOBAL/MODULE FUNCTIONS -########################################################## -]]-- -function SuperVillain:SetUserScreen(rez, preserve) - if not preserve then - if okToResetMOVE then - self:ResetMovables("") - okToResetMOVE = false; - end - self.db:SetDefault("SVUnit") - end - - if not SuperVillain.db.framelocations then SuperVillain.db.framelocations = {} end - if rez == "low" then - if not preserve then - self.db.SVDock.dockLeftWidth = 350; - self.db.SVDock.dockLeftHeight = 180; - self.db.SVDock.dockRightWidth = 350; - self.db.SVDock.dockRightHeight = 180; - self.db.SVAura.wrapAfter = 10 - self.db.SVUnit.fontSize = 10; - self.db.SVUnit.player.width = 200; - self.db.SVUnit.player.castbar.width = 200; - self.db.SVUnit.player.classbar.fill = "fill" - self.db.SVUnit.player.health.tags = "[health:color][health:current]" - self.db.SVUnit.target.width = 200; - self.db.SVUnit.target.castbar.width = 200; - self.db.SVUnit.target.health.tags = "[health:color][health:current]" - self.db.SVUnit.pet.power.enable = false; - self.db.SVUnit.pet.width = 200; - self.db.SVUnit.pet.height = 26; - self.db.SVUnit.targettarget.debuffs.enable = false; - self.db.SVUnit.targettarget.power.enable = false; - self.db.SVUnit.targettarget.width = 200; - self.db.SVUnit.targettarget.height = 26; - self.db.SVUnit.boss.width = 200; - self.db.SVUnit.boss.castbar.width = 200; - self.db.SVUnit.arena.width = 200; - self.db.SVUnit.arena.castbar.width = 200 - end - if not mungs then - UFMoveBottomQuadrant(true) - UFMoveLeftQuadrant(true) - UFMoveTopQuadrant(true) - UFMoveRightQuadrant(true) - end - self.ghettoMonitor = true - else - self.db:SetDefault("SVDock") - self.db:SetDefault("SVAura") - if not mungs then - UFMoveBottomQuadrant() - UFMoveLeftQuadrant() - UFMoveTopQuadrant() - UFMoveRightQuadrant() - end - self.ghettoMonitor = nil - end - - if(not preserve and not mungs) then - BarShuffle() - self:SetSVMovablesPositions() - self.Registry:Update('SVDock') - self.Registry:Update('SVAura') - self.Registry:Update('SVBar') - self.Registry:Update('SVUnit') - SuperVillain:SavedPopup() - end -end - -function SuperVillain:SetColorTheme(style, preserve) - style = style or "default"; - - if not preserve then - self.db:SetDefault("media") - end - - local presets = self:LoadPresetData("media", style) - self.db.LAYOUT.mediastyle = style; - - if(style == "default") then - self.db.SVUnit.healthclass = true; - else - self.db.SVUnit.healthclass = false; - end - - if(not mungs) then - self:MediaUpdate() - self.Registry:Update('SVStats') - self.Registry:Update('SVUnit') - if(not preserve) then - SuperVillain:SavedPopup() - end - end -end - -function SuperVillain:SetUnitframeLayout(style, preserve) - style = style or "default"; - - if not SuperVillain.db.framelocations then SuperVillain.db.framelocations = {} end - - if not preserve then - self.db:SetDefault("SVUnit") - self.db:SetDefault("SVStats") - if okToResetMOVE then - self:ResetMovables('') - okToResetMOVE = false - end - end - - local presets = self:LoadPresetData("units", style) - self.db.LAYOUT.unitstyle = style - - if(self.db.LAYOUT.mediastyle == "default") then - self.db.SVUnit.healthclass = true; - end - - if(not mungs) then - if(not preserve) then - if self.db.LAYOUT.barstyle and (self.db.LAYOUT.barstyle == "twosmall" or self.db.LAYOUT.barstyle == "twobig") then - UFMoveBottomQuadrant("shift") - else - UFMoveBottomQuadrant() - end - self:SetSVMovablesPositions() - end - self.Registry:Update('SVStats') - self.Registry:Update('SVUnit') - if(not preserve) then - SuperVillain:SavedPopup() - end - end -end - -function SuperVillain:SetGroupframeLayout(style, preserve) - style = style or "default"; - - local presets = self:LoadPresetData("layouts", style) - self.db.LAYOUT.groupstyle = style - - if(not mungs) then - self.Registry:Update('SVUnit') - if(not preserve) then - SuperVillain:SavedPopup() - end - end -end - -function SuperVillain:SetupBarLayout(style, preserve) - style = style or "default"; - - if not SuperVillain.db.framelocations then SuperVillain.db.framelocations={} end - if not preserve then - self.db:SetDefault("SVBar") - if okToResetMOVE then - self:ResetMovables('') - okToResetMOVE=false - end - end - - local presets = self:LoadPresetData("bars", style) - self.db.LAYOUT.barstyle = style; - - if(not mungs) then - if(not preserve) then - if(style == 'twosmall' or style == 'twobig') then - UFMoveBottomQuadrant("shift") - else - UFMoveBottomQuadrant() - end - end - if(not preserve) then - BarShuffle() - self:SetSVMovablesPositions() - end - self.Registry:Update('SVStats') - self.Registry:Update('SVBar') - if(not preserve) then - SuperVillain:SavedPopup() - end - end -end - -function SuperVillain:SetupAuralayout(style, preserve) - style = style or "default"; - local presets = self:LoadPresetData("auras", style) - self.db.LAYOUT.aurastyle = style; - - if(not mungs) then - self.Registry:Update('SVStats') - self.Registry:Update('SVAura') - self.Registry:Update('SVUnit') - if(not preserve) then - SuperVillain:SavedPopup() - end - end -end - -local function PlayThemeSong() - if(not musicIsPlaying) then - SetCVar("Sound_MusicVolume", 100) - SetCVar("Sound_EnableMusic", 1) - StopMusic() - PlayMusic([[Interface\AddOns\SVUI\assets\sounds\SuperVillain.mp3]]) - musicIsPlaying = true - end -end - -local function InstallComplete() - SVUI_Profile.SAFEDATA.install_version = SuperVillain.___ver; - StopMusic() - SetCVar("Sound_MusicVolume",user_music_vol) - okToResetMOVE = false; - ReloadUI() -end - -local function InstallMungsChoice() - mungs = true; - okToResetMOVE = false; - initChat(true); - SuperVillain:SetUserScreen('high'); - SuperVillain:SetColorTheme(); - SuperVillain.db.LAYOUT.unitstyle = nil; - SuperVillain:SetUnitframeLayout(); - SuperVillain.db.LAYOUT.groupstyle = nil; - SuperVillain.db.LAYOUT.barstyle = nil; - SuperVillain:SetupBarLayout(); - SuperVillain:SetupAuralayout(); - SVUI_Profile.SAFEDATA.install_version = SuperVillain.___ver; - StopMusic() - SetCVar("Sound_MusicVolume",user_music_vol) - ReloadUI() -end - -local function ResetAll() - SVUI_InstallNextButton:Disable() - SVUI_InstallPrevButton:Disable() - SVUI_InstallOption01Button:Hide() - SVUI_InstallOption01Button:SetScript("OnClick",nil) - SVUI_InstallOption01Button:SetText("") - SVUI_InstallOption02Button:Hide() - SVUI_InstallOption02Button:SetScript("OnClick",nil) - SVUI_InstallOption02Button:SetText("") - SVUI_InstallOption03Button:Hide() - SVUI_InstallOption03Button:SetScript("OnClick",nil) - SVUI_InstallOption03Button:SetText("") - SVUI_InstallOption1Button:Hide() - SVUI_InstallOption1Button:SetScript("OnClick",nil) - SVUI_InstallOption1Button:SetText("") - SVUI_InstallOption2Button:Hide() - SVUI_InstallOption2Button:SetScript('OnClick',nil) - SVUI_InstallOption2Button:SetText('') - SVUI_InstallOption3Button:Hide() - SVUI_InstallOption3Button:SetScript('OnClick',nil) - SVUI_InstallOption3Button:SetText('') - SVUI_InstallOption4Button:Hide() - SVUI_InstallOption4Button:SetScript('OnClick',nil) - SVUI_InstallOption4Button:SetText('') - SVUI_SetupHolder.SubTitle:SetText("") - SVUI_SetupHolder.Desc1:SetText("") - SVUI_SetupHolder.Desc2:SetText("") - SVUI_SetupHolder.Desc3:SetText("") - SVUI_SetupHolder:Size(550,400) -end - -local function SetPage(newPage) - CURRENT_PAGE = newPage; - ResetAll() - InstallStatus.text:SetText(CURRENT_PAGE.." / "..MAX_PAGE) - local setupFrame = SVUI_SetupHolder; - if newPage ~= MAX_PAGE then - SVUI_InstallNextButton:Enable() - SVUI_InstallNextButton:Show() - end - if newPage ~= 1 then - SVUI_InstallPrevButton:Enable() - SVUI_InstallPrevButton:Show() - end - --[[ - more useful globalstrings - - CUSTOM - SETTINGS - DEFAULT - DEFAULTS - USE - UIOPTIONS_MENU - LFGWIZARD_TITLE - CONTINUE - ]]-- - ShowLayout() - if newPage == 1 then - local hasOldConfig = SVUI_Profile.SAFEDATA.install_version - SVUI_InstallPrevButton:Disable() - SVUI_InstallPrevButton:Hide() - okToResetMOVE = true - setupFrame.SubTitle:SetText(format(L["This is Supervillain UI version %s!"], SuperVillain.___ver)) - setupFrame.Desc1:SetText(L["Before I can turn you loose, persuing whatever villainy you feel will advance your professional career... I need to ask some questions and turn a few screws first."]) - setupFrame.Desc2:SetText(L["At any time you can get to the config options by typing the command / sv. For quick changes to frame, bar or color sets, call your henchman by clicking the button on the bottom right of your screen. (Its the one with his stupid face on it)"]) - setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) - SVUI_InstallOption01Button:Show() - SVUI_InstallOption01Button:SetScript("OnClick", InstallMungsChoice) - SVUI_InstallOption01Button:SetText(USE.."\n"..DEFAULT.."\n"..SETTINGS) - - SVUI_InstallOption02Button:Show() - SVUI_InstallOption02Button:SetScript("OnClick", InstallComplete) - SVUI_InstallOption02Button:SetText("PRETEND YOU\nDID THIS\nALREADY") - - if(hasOldConfig) then - SVUI_InstallOption03Button:Show() - SVUI_InstallOption03Button:SetScript("OnClick", InstallComplete) - SVUI_InstallOption03Button:SetText("Keep\nSaved\n"..SETTINGS) - end - - elseif newPage == 2 then - setupFrame.SubTitle:SetText(CHAT) - setupFrame.Desc1:SetText(L["Whether you want to or not, you will be needing a communicator so other villains can either update you on their doings-of-evil or inform you about the MANY abilities of Chuck Norris"]) - setupFrame.Desc2:SetText(L["The chat windows function the same as standard chat windows, you can right click the tabs and drag them, rename them, slap them around, you know... whatever. Clickity-click to setup your chat windows."]) - setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) - SVUI_InstallOption1Button:Show() - SVUI_InstallOption1Button:SetScript("OnClick", function() - initChat(false) - end) - SVUI_InstallOption1Button:SetText(CHAT_DEFAULTS) - - elseif newPage == 3 then - local rez = GetCVar("gxResolution") - setupFrame.SubTitle:SetText(RESOLUTION) - setupFrame.Desc1:SetText(format(L["Your current resolution is %s, this is considered a %s resolution."], rez, (SuperVillain.ghettoMonitor and LOW or HIGH))) - if SuperVillain.ghettoMonitor then - setupFrame.Desc2:SetText(L["This resolution requires that you change some settings to get everything to fit on your screen."].." "..L["Click the button below to resize your chat frames, unitframes, and reposition your actionbars."].." "..L["You may need to further alter these settings depending how low your resolution is."]) - setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) - else - setupFrame.Desc2:SetText(L["This resolution doesn't require that you change settings for the UI to fit on your screen."].." "..L["Click the button below to resize your chat frames, unitframes, and reposition your actionbars."].." "..L["This is completely optional."]) - setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) - end - SVUI_InstallOption1Button:Show() - SVUI_InstallOption1Button:SetScript("OnClick", function() - SuperVillain:SetUserScreen("high") - SVUI_SetupHolder.Desc1:SetText(L["|cffFF9F00"..HIGH.." "..RESOLUTION.."!|r"]) - SVUI_SetupHolder.Desc2:SetText(L["So what you think your better than me with your big monitor? HUH?!?!"]) - SVUI_SetupHolder.Desc3:SetText(L["Dont forget whos in charge here! But enjoy the incredible detail."]) - end) - SVUI_InstallOption1Button:SetText(HIGH) - SVUI_InstallOption2Button:Show() - SVUI_InstallOption2Button:SetScript("OnClick", function() - SuperVillain:SetUserScreen("low") - SVUI_SetupHolder.Desc1:SetText(L["|cffFF9F00"..LOW.." "..RESOLUTION.."|r"]) - SVUI_SetupHolder.Desc2:SetText(L["Why are you playing this on what I would assume is a calculator display?"]) - SVUI_SetupHolder.Desc3:SetText(L["Enjoy the ONE incredible pixel that fits on this screen."]) - end) - SVUI_InstallOption2Button:SetText(LOW) - - elseif newPage == 4 then - setupFrame.SubTitle:SetText(COLOR.." "..SETTINGS) - setupFrame.Desc1:SetText(L["Choose a theme layout you wish to use for your initial setup."]) - setupFrame.Desc2:SetText(L["You can always change fonts and colors of any element of Supervillain UI from the in-game configuration."]) - setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) - SVUI_InstallOption1Button:Show() - SVUI_InstallOption1Button:SetScript("OnClick", function() - SuperVillain:SetColorTheme("kaboom") - SVUI_SetupHolder.Desc1:SetText(L["|cffFF9F00KABOOOOM!|r"]) - SVUI_SetupHolder.Desc2:SetText(L["This theme tells the world that you are a villain who can put on a show"]..CONTINUED) - SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["or better yet, you ARE the show!"]) - end) - SVUI_InstallOption1Button:SetText(L["Kaboom!"]) - SVUI_InstallOption2Button:Show() - SVUI_InstallOption2Button:SetScript("OnClick", function() - SuperVillain:SetColorTheme("dark") - SVUI_SetupHolder.Desc1:SetText(L["|cffAF30FFThe Darkest Night|r"]) - SVUI_SetupHolder.Desc2:SetText(L["This theme indicates that you have no interest in wasting time"]..CONTINUED) - SVUI_SetupHolder.Desc3:SetText(CONTINUED..L[" the dying begins NOW!"]) - end) - SVUI_InstallOption2Button:SetText(L["Darkness"]) - SVUI_InstallOption3Button:Show() - SVUI_InstallOption3Button:SetScript("OnClick", function() - SuperVillain:SetColorTheme("classy") - SVUI_SetupHolder.Desc1:SetText(L["|cffFFFF00"..CLASS_COLORS.."|r"]) - SVUI_SetupHolder.Desc2:SetText(L["This theme is for villains who take pride in their class"]..CONTINUED) - SVUI_SetupHolder.Desc3:SetText(CONTINUED..L[" villains know how to reprezent!"]) - end) - SVUI_InstallOption3Button:SetText(L["Class" .. "\n" .. "Colors"]) - SVUI_InstallOption4Button:Show() - SVUI_InstallOption4Button:SetScript("OnClick", function() - SuperVillain:SetColorTheme() - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFPlain and Simple|r"]) - SVUI_SetupHolder.Desc2:SetText(L["This theme is for any villain who sticks to their traditions"]..CONTINUED) - SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["you don't need fancyness to kick some ass!"]) - end) - SVUI_InstallOption4Button:SetText(L["Vintage"]) - - elseif newPage == 5 then - ShowLayout(true) - setupFrame.SubTitle:SetText(UNITFRAME_LABEL.." "..SETTINGS) - setupFrame.Desc1:SetText(L["You can now choose what primary unitframe style you wish to use."]) - setupFrame.Desc2:SetText(L["This will change the layout of your unitframes (ie.. Player, Target, Pet, Party, Raid ...etc)."]) - setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) - SVUI_InstallOption1Button:Show() - SVUI_InstallOption1Button:SetScript("OnClick", function() - SuperVillain.db.LAYOUT.unitstyle = nil; - SuperVillain:SetUnitframeLayout("super") - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFLets Do This|r"]) - SVUI_SetupHolder.Desc2:SetText(L["This layout is anything but minimal! Using this is like being at a rock concert"]..CONTINUED) - SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["then annihilating the crowd with frickin lazer beams!"]) - end) - SVUI_InstallOption1Button:SetText(L["Super"]) - SVUI_InstallOption2Button:Show() - SVUI_InstallOption2Button:SetScript("OnClick", function() - SuperVillain.db.LAYOUT.unitstyle = nil; - SuperVillain:SetUnitframeLayout("simple") - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFSimply Simple|r"]) - SVUI_SetupHolder.Desc2:SetText(L["This layout is for the villain who just wants to get things done!"]..CONTINUED) - SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["but he still wants to see your face before he hits you!"]) - end) - SVUI_InstallOption2Button:SetText(L["Simple"]) - SVUI_InstallOption3Button:Show() - SVUI_InstallOption3Button:SetScript("OnClick", function() - SuperVillain.db.LAYOUT.unitstyle = nil; - SuperVillain:SetUnitframeLayout("compact") - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFEl Compacto|r"]) - SVUI_SetupHolder.Desc2:SetText(L["Just the necessities so you can see more of the world around you"]..CONTINUED) - SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["you dont need no fanciness getting in the way of world domination do you?"]) - end) - SVUI_InstallOption3Button:SetText(L["Compact"]) - - elseif newPage == 6 then - ShowLayout(true) - setupFrame.SubTitle:SetText("Group Layout") - setupFrame.Desc1:SetText(L["You can now choose what group layout you prefer."]) - setupFrame.Desc2:SetText(L["This will adjust various settings on group units, attempting to make certain roles more usable"]) - setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) - - SVUI_InstallOption1Button:Show() - SVUI_InstallOption1Button:SetScript("OnClick", function() - SuperVillain.db.LAYOUT.groupstyle = "default"; - SuperVillain:SetGroupframeLayout("default") - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFStandard|r"]) - SVUI_SetupHolder.Desc2:SetText(L["You are good to go with the default layout"]..CONTINUED) - SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["frames schmames, lets kill some stuff!"]) - end) - SVUI_InstallOption1Button:SetText(L["Standard"]) - - SVUI_InstallOption2Button:Show() - SVUI_InstallOption2Button:SetScript("OnClick", function() - SuperVillain.db.LAYOUT.groupstyle = nil; - SuperVillain:SetGroupframeLayout("healer") - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFMEDIC!!|r"]) - SVUI_SetupHolder.Desc2:SetText(L["You are pretty helpful.. for a VILLAIN!"]..CONTINUED) - SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["Hey, even a super villain gets his ass kicked once in awhile. We need the likes of you!"]) - end) - SVUI_InstallOption2Button:SetText(L["Healer"]) - - SVUI_InstallOption3Button:Show() - SVUI_InstallOption3Button:SetScript("OnClick", function() - SuperVillain.db.LAYOUT.groupstyle = nil; - SuperVillain:SetGroupframeLayout("dps") - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFDeath Dealer|r"]) - SVUI_SetupHolder.Desc2:SetText(L["You are the kings of our craft. Handing out pain like its halloween candy."]..CONTINUED) - SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["I will move and squeeze group frames out of your way so you have more room for BOOM!"]) - end) - SVUI_InstallOption3Button:SetText(L["DPS"]) - - SVUI_InstallOption4Button:Show() - SVUI_InstallOption4Button:SetScript("OnClick", function() - SuperVillain.db.LAYOUT.groupstyle = nil; - SuperVillain:SetGroupframeLayout("grid") - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFCubed|r"]) - SVUI_SetupHolder.Desc2:SetText(L["You are cold and calculated, your frames should reflect as much."]..CONTINUED) - SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["I'm gonna make these frames so precise that you can cut your finger on them!"]) - end) - SVUI_InstallOption4Button:SetText(L["Grid"]) - - elseif newPage == 7 then - setupFrame.SubTitle:SetText(ACTIONBAR_LABEL.." "..SETTINGS) - setupFrame.Desc1:SetText(L["Choose a layout for your action bars."]) - setupFrame.Desc2:SetText(L["Sometimes you need big buttons, sometimes you don't. Your choice here."]) - setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) - SVUI_InstallOption1Button:Show() - SVUI_InstallOption1Button:SetScript("OnClick", function() - SuperVillain.db.LAYOUT.barstyle = nil; - SuperVillain:SetupBarLayout("default") - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFLean And Clean|r"]) - SVUI_SetupHolder.Desc2:SetText(L["Lets keep it slim and deadly, not unlike a ninja sword."]) - SVUI_SetupHolder.Desc3:SetText(L["You dont ever even look at your bar hardly, so pick this one!"]) - end) - SVUI_InstallOption1Button:SetText(L["Small" .. "\n" .. "Row"]) - SVUI_InstallOption2Button:Show() - SVUI_InstallOption2Button:SetScript("OnClick", function() - SuperVillain.db.LAYOUT.barstyle = nil; - SuperVillain:SetupBarLayout("twosmall") - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFMore For Less|r"]) - SVUI_SetupHolder.Desc2:SetText(L["Granted, you dont REALLY need the buttons due to your hotkey-leetness, you just like watching cooldowns!"]) - SVUI_SetupHolder.Desc3:SetText(L["Sure thing cowboy, your secret is safe with me!"]) - end) - SVUI_InstallOption2Button:SetText(L["2 Small" .. "\n" .. "Rows"]) - SVUI_InstallOption3Button:Show() - SVUI_InstallOption3Button:SetScript("OnClick", function() - SuperVillain.db.LAYOUT.barstyle = nil; - SuperVillain:SetupBarLayout("onebig") - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFWhat Big Buttons You Have|r"]) - SVUI_SetupHolder.Desc2:SetText(L["The better to PEW-PEW you with my dear!"]) - SVUI_SetupHolder.Desc3:SetText(L["When you have little time for mouse accuracy, choose this set!"]) - end) - SVUI_InstallOption3Button:SetText(L["Big" .. "\n" .. "Row"]) - SVUI_InstallOption4Button:Show() - SVUI_InstallOption4Button:SetScript("OnClick", function() - SuperVillain.db.LAYOUT.barstyle = nil; - SuperVillain:SetupBarLayout("twobig") - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFThe Double Down|r"]) - SVUI_SetupHolder.Desc2:SetText(L["Lets be honest for a moment. Who doesnt like a huge pair in their face?"]) - SVUI_SetupHolder.Desc3:SetText(L["Double your bars then double their size for maximum button goodness!"]) - end) - SVUI_InstallOption4Button:SetText(L["2 Big" .. "\n" .. "Rows"]) - - elseif newPage == 8 then - setupFrame.SubTitle:SetText(AURAS.." "..SETTINGS) - setupFrame.Desc1:SetText(L["Select an aura layout. \"Icons\" will display only icons and aurabars won't be used. \"Bars\" will display only aurabars and icons won't be used (duh). \"The Works!\" does just what it says.... icons, bars and awesomeness."]) - setupFrame.Desc2:SetText(L["If you have an aura that you don't want to display simply hold down shift and right click the icon for it to suffer a painful death."]) - setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) - - SVUI_InstallOption1Button:Show() - SVUI_InstallOption1Button:SetScript("OnClick", function() - SuperVillain:SetupAuralayout() - end) - SVUI_InstallOption1Button:SetText(L["Vintage"]) - - SVUI_InstallOption2Button:Show() - SVUI_InstallOption2Button:SetScript("OnClick", function() - SuperVillain:SetupAuralayout("icons") - end) - SVUI_InstallOption2Button:SetText(L["Icons"]) - - SVUI_InstallOption3Button:Show() - SVUI_InstallOption3Button:SetScript("OnClick", function() - SuperVillain:SetupAuralayout("bars") - end) - SVUI_InstallOption3Button:SetText(L["Bars"]) - - SVUI_InstallOption4Button:Show() - SVUI_InstallOption4Button:SetScript("OnClick", function() - SuperVillain:SetupAuralayout("theworks") - end) - SVUI_InstallOption4Button:SetText(L["The" .. "\n" .. "Works!"]) - - elseif newPage == 9 then - SVUI_InstallNextButton:Disable() - SVUI_InstallNextButton:Hide() - setupFrame.SubTitle:SetText(BASIC_OPTIONS_TOOLTIP..CONTINUED..AUCTION_TIME_LEFT0) - setupFrame.Desc1:SetText(L["Thats it! All done! Now we just need to hand these choices off to the henchmen so they can get you ready to (..insert evil tasks here..)!"]) - setupFrame.Desc2:SetText(L["Click the button below to reload and get on your way! Good luck villain!"]) - SVUI_InstallOption1Button:Show() - SVUI_InstallOption1Button:SetScript("OnClick", InstallComplete) - SVUI_InstallOption1Button:SetText(L["THE_BUTTON_BELOW"]) - SVUI_SetupHolder:Size(550, 350) - end -end - -local function NextPage() - if CURRENT_PAGE ~= MAX_PAGE then - CURRENT_PAGE = CURRENT_PAGE + 1; - SetPage(CURRENT_PAGE) - end -end - -local function PreviousPage() - if CURRENT_PAGE ~= 1 then - CURRENT_PAGE = CURRENT_PAGE - 1; - SetPage(CURRENT_PAGE) - end -end - -local function ResetGlobalVariables() - for k,v in pairs(SVUI_Cache) do - SVUI_Cache[k] = nil - end -end - -function SuperVillain:ResetInstallation() - mungs = true; - okToResetMOVE = false; - initChat(true); - SuperVillain.db:Reset() - SuperVillain:SetUserScreen(); - - if SuperVillain.db.LAYOUT.mediastyle then - SuperVillain:SetColorTheme(SuperVillain.db.LAYOUT.mediastyle) - else - SuperVillain.db.LAYOUT.mediastyle = nil; - SuperVillain:SetColorTheme() - end - - if SuperVillain.db.LAYOUT.unitstyle then - SuperVillain:SetUnitframeLayout(SuperVillain.db.LAYOUT.unitstyle) - else - SuperVillain.db.LAYOUT.unitstyle = nil; - SuperVillain:SetUnitframeLayout() - end - - if SuperVillain.db.LAYOUT.barstyle then - SuperVillain:SetupBarLayout(SuperVillain.db.LAYOUT.barstyle) - else - SuperVillain.db.LAYOUT.barstyle = nil; - SuperVillain:SetupBarLayout() - end - - if SuperVillain.db.LAYOUT.aurastyle then - SuperVillain:SetupAuralayout(SuperVillain.db.LAYOUT.aurastyle) - else - SuperVillain.db.LAYOUT.aurastyle = nil; - SuperVillain:SetupAuralayout() - end - - SVUI_Profile.SAFEDATA.install_version = SuperVillain.___ver; - ResetGlobalVariables() - ReloadUI() -end - -function SuperVillain:Install(autoLoaded) - if(not user_music_vol) then - user_music_vol = GetCVar("Sound_MusicVolume") - end - - -- frame - if not SVUI_SetupHolder then - local frame = CreateFrame("Button", "SVUI_SetupHolder", UIParent) - frame.SetPage = SetPage; - frame:Size(550, 400) - frame:SetPanelTemplate("Action") - frame:SetPoint("CENTER") - frame:SetFrameStrata("TOOLTIP") - frame.Title = frame:CreateFontString(nil, "OVERLAY") - frame.Title:SetFont(SuperVillain.Media.font.narrator, 22, "OUTLINE") - frame.Title:Point("TOP", 0, -5) - frame.Title:SetText(L["Supervillain UI Installation"]) - - frame.Next = CreateFrame("Button", "SVUI_InstallNextButton", frame, "UIPanelButtonTemplate") - frame.Next:Formula409() - frame.Next:Size(110, 25) - frame.Next:Point("BOTTOMRIGHT", 50, 5) - SetInstallButton(frame.Next) - frame.Next.texture = frame.Next:CreateTexture(nil, "BORDER") - frame.Next.texture:Size(110, 75) - frame.Next.texture:Point("RIGHT") - frame.Next.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION-ARROW") - frame.Next.texture:SetVertexColor(1, 0.5, 0) - frame.Next.text = frame.Next:CreateFontString(nil, "OVERLAY") - frame.Next.text:SetFont(SuperVillain.Media.font.action, 18, "OUTLINE") - frame.Next.text:SetPoint("CENTER") - frame.Next.text:SetText(CONTINUE) - frame.Next:Disable() - frame.Next:SetScript("OnClick", NextPage) - frame.Next:SetScript("OnEnter", function(this) - this.texture:SetVertexColor(1, 1, 0) - end) - frame.Next:SetScript("OnLeave", function(this) - this.texture:SetVertexColor(1, 0.5, 0) - end) - - frame.Prev = CreateFrame("Button", "SVUI_InstallPrevButton", frame, "UIPanelButtonTemplate") - frame.Prev:Formula409() - frame.Prev:Size(110, 25) - frame.Prev:Point("BOTTOMLEFT", -50, 5) - SetInstallButton(frame.Prev) - frame.Prev.texture = frame.Prev:CreateTexture(nil, "BORDER") - frame.Prev.texture:Size(110, 75) - frame.Prev.texture:Point("LEFT") - frame.Prev.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION-ARROW") - frame.Prev.texture:SetTexCoord(1, 0, 1, 1, 0, 0, 0, 1) - frame.Prev.texture:SetVertexColor(1, 0.5, 0) - frame.Prev.text = frame.Prev:CreateFontString(nil, "OVERLAY") - frame.Prev.text:SetFont(SuperVillain.Media.font.action, 18, "OUTLINE") - frame.Prev.text:SetPoint("CENTER") - frame.Prev.text:SetText(PREVIOUS) - frame.Prev:Disable() - frame.Prev:SetScript("OnClick", PreviousPage) - frame.Prev:SetScript("OnEnter", function(this) - this.texture:SetVertexColor(1, 1, 0) - end) - frame.Prev:SetScript("OnLeave", function(this) - this.texture:SetVertexColor(1, 0.5, 0) - end) - frame.Status = CreateFrame("Frame", "InstallStatus", frame) - frame.Status:SetFrameLevel(frame.Status:GetFrameLevel() + 2) - frame.Status:Size(150, 30) - frame.Status:Point("BOTTOM", frame, "TOP", 0, 2) - frame.Status.text = frame.Status:CreateFontString(nil, "OVERLAY") - frame.Status.text:SetFont(SuperVillain.Media.font.numbers, 22, "OUTLINE") - frame.Status.text:SetPoint("CENTER") - frame.Status.text:SetText(CURRENT_PAGE.." / "..MAX_PAGE) - - frame.Option01 = CreateFrame("Button", "SVUI_InstallOption01Button", frame, "UIPanelButtonTemplate") - frame.Option01:Formula409() - frame.Option01:Size(160, 30) - frame.Option01:Point("BOTTOM", 0, 15) - frame.Option01:SetText("") - SetInstallButton(frame.Option01) - frame.Option01.texture = frame.Option01:CreateTexture(nil, "BORDER") - frame.Option01.texture:Size(160, 160) - frame.Option01.texture:Point("CENTER", frame.Option01, "BOTTOM", 0, -15) - frame.Option01.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") - frame.Option01.texture:SetGradient("VERTICAL", 0, 0.3, 0, 0, 0.7, 0) - frame.Option01:SetScript("OnEnter", function(this) - this.texture:SetVertexColor(0.5, 1, 0.4) - end) - frame.Option01:SetScript("OnLeave", function(this) - this.texture:SetGradient("VERTICAL", 0, 0.3, 0, 0, 0.7, 0) - end) - hooksecurefunc(frame.Option01, "SetWidth", function(g, h) - g.texture:Size(h, h) - g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) - end) - frame.Option01:SetFrameLevel(frame.Option01:GetFrameLevel() + 10) - frame.Option01:Hide() - - frame.Option02 = CreateFrame("Button", "SVUI_InstallOption02Button", frame, "UIPanelButtonTemplate") - frame.Option02:Formula409() - frame.Option02:Size(130, 30) - frame.Option02:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) - frame.Option02:SetText("") - SetInstallButton(frame.Option02) - frame.Option02.texture = frame.Option02:CreateTexture(nil, "BORDER") - frame.Option02.texture:Size(130, 110) - frame.Option02.texture:Point("CENTER", frame.Option02, "BOTTOM", 0, -15) - frame.Option02.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") - frame.Option02.texture:SetGradient("VERTICAL", 0.3, 0, 0, 0.7, 0, 0) - frame.Option02:SetScript("OnEnter", function(this) - this.texture:SetVertexColor(0.5, 1, 0.4) - end) - frame.Option02:SetScript("OnLeave", function(this) - this.texture:SetGradient("VERTICAL", 0.3, 0, 0, 0.7, 0, 0) - end) - hooksecurefunc(frame.Option02, "SetWidth", function(g, h) - g.texture:Size(h, h) - g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) - end) - frame.Option02:SetScript("OnShow", function() - frame.Option01:SetWidth(130) - frame.Option01:ClearAllPoints() - frame.Option01:Point("BOTTOMRIGHT", frame, "BOTTOM", -4, 15) - end) - frame.Option02:SetScript("OnHide", function() - frame.Option01:SetWidth(160) - frame.Option01:ClearAllPoints() - frame.Option01:Point("BOTTOM", 0, 15) - end) - frame.Option02:SetFrameLevel(frame.Option01:GetFrameLevel() + 10) - frame.Option02:Hide() - - frame.Option03 = CreateFrame("Button", "SVUI_InstallOption03Button", frame, "UIPanelButtonTemplate") - frame.Option03:Formula409() - frame.Option03:Size(130, 30) - frame.Option03:Point("BOTTOM", frame, "BOTTOM", 0, 15) - frame.Option03:SetText("") - SetInstallButton(frame.Option03) - frame.Option03.texture = frame.Option03:CreateTexture(nil, "BORDER") - frame.Option03.texture:Size(130, 110) - frame.Option03.texture:Point("CENTER", frame.Option03, "BOTTOM", 0, -15) - frame.Option03.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") - frame.Option03.texture:SetGradient("VERTICAL", 0, 0.1, 0.3, 0, 0.5, 0.7) - frame.Option03:SetScript("OnEnter", function(this) - this.texture:SetVertexColor(0.2, 0.5, 1) - end) - frame.Option03:SetScript("OnLeave", function(this) - this.texture:SetGradient("VERTICAL", 0, 0.1, 0.3, 0, 0.5, 0.7) - end) - hooksecurefunc(frame.Option03, "SetWidth", function(g, h) - g.texture:Size(h, h) - g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) - end) - frame.Option03:SetScript("OnShow", function(self) - self:SetWidth(130) - frame.Option01:SetWidth(130) - frame.Option01:ClearAllPoints() - frame.Option01:Point("RIGHT", self, "LEFT", -8, 0) - frame.Option02:SetWidth(130) - frame.Option02:ClearAllPoints() - frame.Option02:Point("LEFT", self, "RIGHT", 8, 0) - end) - frame.Option03:SetScript("OnHide", function() - frame.Option01:SetWidth(160) - frame.Option01:ClearAllPoints() - frame.Option01:Point("BOTTOM", 0, 15) - frame.Option02:ClearAllPoints() - frame.Option02:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) - end) - frame.Option03:SetFrameLevel(frame.Option01:GetFrameLevel() + 10) - frame.Option03:Hide() - - frame.Option1 = CreateFrame("Button", "SVUI_InstallOption1Button", frame, "UIPanelButtonTemplate") - frame.Option1:Formula409() - frame.Option1:Size(160, 30) - frame.Option1:Point("BOTTOM", 0, 15) - frame.Option1:SetText("") - SetInstallButton(frame.Option1) - frame.Option1.texture = frame.Option1:CreateTexture(nil, "BORDER") - frame.Option1.texture:Size(160, 160) - frame.Option1.texture:Point("CENTER", frame.Option1, "BOTTOM", 0, -15) - frame.Option1.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") - frame.Option1.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) - frame.Option1:SetScript("OnEnter", function(this) - this.texture:SetVertexColor(0.5, 1, 0.4) - end) - frame.Option1:SetScript("OnLeave", function(this) - this.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) - end) - hooksecurefunc(frame.Option1, "SetWidth", function(g, h) - g.texture:Size(h, h) - g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) - end) - frame.Option1:SetFrameLevel(frame.Option1:GetFrameLevel() + 10) - frame.Option1:Hide() - - frame.Option2 = CreateFrame("Button", "SVUI_InstallOption2Button", frame, "UIPanelButtonTemplate") - frame.Option2:Formula409() - frame.Option2:Size(120, 30) - frame.Option2:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) - frame.Option2:SetText("") - SetInstallButton(frame.Option2) - frame.Option2.texture = frame.Option2:CreateTexture(nil, "BORDER") - frame.Option2.texture:Size(120, 110) - frame.Option2.texture:Point("CENTER", frame.Option2, "BOTTOM", 0, -15) - frame.Option2.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") - frame.Option2.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) - frame.Option2:SetScript("OnEnter", function(this) - this.texture:SetVertexColor(0.5, 1, 0.4) - end) - frame.Option2:SetScript("OnLeave", function(this) - this.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) - end) - hooksecurefunc(frame.Option2, "SetWidth", function(g, h) - g.texture:Size(h, h) - g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) - end) - frame.Option2:SetScript("OnShow", function() - frame.Option1:SetWidth(120) - frame.Option1:ClearAllPoints() - frame.Option1:Point("BOTTOMRIGHT", frame, "BOTTOM", -4, 15) - end) - frame.Option2:SetScript("OnHide", function() - frame.Option1:SetWidth(160) - frame.Option1:ClearAllPoints() - frame.Option1:Point("BOTTOM", 0, 15) - end) - frame.Option2:SetFrameLevel(frame.Option1:GetFrameLevel() + 10) - frame.Option2:Hide() - - frame.Option3 = CreateFrame("Button", "SVUI_InstallOption3Button", frame, "UIPanelButtonTemplate") - frame.Option3:Formula409() - frame.Option3:Size(110, 30) - frame.Option3:Point("LEFT", frame.Option2, "RIGHT", 4, 0) - frame.Option3:SetText("") - SetInstallButton(frame.Option3) - frame.Option3.texture = frame.Option3:CreateTexture(nil, "BORDER") - frame.Option3.texture:Size(110, 100) - frame.Option3.texture:Point("CENTER", frame.Option3, "BOTTOM", 0, -9) - frame.Option3.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") - frame.Option3.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) - frame.Option3:SetScript("OnEnter", function(this) - this.texture:SetVertexColor(0.5, 1, 0.4) - end) - frame.Option3:SetScript("OnLeave", function(this) - this.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) - end) - frame.Option3:SetScript("OnShow", function() - frame.Option1:SetWidth(110) - frame.Option1:ClearAllPoints() - frame.Option1:Point("RIGHT", frame.Option2, "LEFT", -4, 0) - frame.Option2:SetWidth(110) - frame.Option2:ClearAllPoints() - frame.Option2:Point("BOTTOM", frame, "BOTTOM", 0, 15) - end) - frame.Option3:SetScript("OnHide", function() - frame.Option1:SetWidth(160) - frame.Option1:ClearAllPoints() - frame.Option1:Point("BOTTOM", 0, 15) - frame.Option2:SetWidth(120) - frame.Option2:ClearAllPoints() - frame.Option2:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) - end) - frame.Option3:SetFrameLevel(frame.Option1:GetFrameLevel() + 10) - frame.Option3:Hide() - - frame.Option4 = CreateFrame("Button", "SVUI_InstallOption4Button", frame, "UIPanelButtonTemplate") - frame.Option4:Formula409() - frame.Option4:Size(110, 30) - frame.Option4:Point("LEFT", frame.Option3, "RIGHT", 4, 0) - frame.Option4:SetText("") - SetInstallButton(frame.Option4) - frame.Option4.texture = frame.Option4:CreateTexture(nil, "BORDER") - frame.Option4.texture:Size(110, 100) - frame.Option4.texture:Point("CENTER", frame.Option4, "BOTTOM", 0, -9) - frame.Option4.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") - frame.Option4.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) - frame.Option4:SetScript("OnEnter", function(this) - this.texture:SetVertexColor(0.5, 1, 0.4) - end) - frame.Option4:SetScript("OnLeave", function(this) - this.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) - end) - frame.Option4:SetScript("OnShow", function() - frame.Option1:Width(110) - frame.Option2:Width(110) - frame.Option1:ClearAllPoints() - frame.Option1:Point("RIGHT", frame.Option2, "LEFT", -4, 0) - frame.Option2:ClearAllPoints() - frame.Option2:Point("BOTTOMRIGHT", frame, "BOTTOM", -4, 15) - end) - frame.Option4:SetScript("OnHide", function() - frame.Option1:SetWidth(160) - frame.Option1:ClearAllPoints() - frame.Option1:Point("BOTTOM", 0, 15) - frame.Option2:SetWidth(120) - frame.Option2:ClearAllPoints() - frame.Option2:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) - end) - - frame.Option4:SetFrameLevel(frame.Option1:GetFrameLevel() + 10) - frame.Option4:Hide() - - frame.SubTitle = frame:CreateFontString(nil, "OVERLAY") - frame.SubTitle:SetFont(SuperVillain.Media.font.roboto, 16, "OUTLINE") - frame.SubTitle:Point("TOP", 0, -40) - frame.Desc1 = frame:CreateFontString(nil, "OVERLAY") - frame.Desc1:SetFont(SuperVillain.Media.font.roboto, 14, "OUTLINE") - frame.Desc1:Point("TOPLEFT", 20, -75) - frame.Desc1:Width(frame:GetWidth()-40) - frame.Desc2 = frame:CreateFontString(nil, "OVERLAY") - frame.Desc2:SetFont(SuperVillain.Media.font.roboto, 14, "OUTLINE") - frame.Desc2:Point("TOPLEFT", 20, -125) - frame.Desc2:Width(frame:GetWidth()-40) - frame.Desc3 = frame:CreateFontString(nil, "OVERLAY") - frame.Desc3:SetFont(SuperVillain.Media.font.roboto, 14, "OUTLINE") - frame.Desc3:Point("TOPLEFT", 20, -175) - frame.Desc3:Width(frame:GetWidth()-40) - local closeButton = CreateFrame("Button", "SVUI_InstallCloseButton", frame, "UIPanelCloseButton") - closeButton:SetPoint("TOPRIGHT", frame, "TOPRIGHT") - closeButton:SetScript("OnClick", function()frame:Hide()end) - frame.tutorialImage = frame:CreateTexture("InstallTutorialImage", "OVERLAY") - frame.tutorialImage:Size(256, 128) - frame.tutorialImage:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\SPLASH") - frame.tutorialImage:Point("BOTTOM", 0, 70) - end - - SVUI_SetupHolder:SetScript("OnHide", function() - StopMusic() - SetCVar("Sound_MusicVolume", user_music_vol) - musicIsPlaying = nil - end) - - SVUI_SetupHolder:Show() - NextPage() - if(not autoLoaded) then - PlayThemeSong() - else - SuperVillain:ExecuteTimer(PlayThemeSong, 5) - end -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/load.lua b/Interface/AddOns/SVUI/system/load.lua new file mode 100644 index 0000000..ddb55fb --- /dev/null +++ b/Interface/AddOns/SVUI/system/load.lua @@ -0,0 +1,327 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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 tonumber = _G.tonumber; +local tinsert = _G.tinsert; +local string = _G.string; +local table = _G.table; +--[[ STRING METHODS ]]-- +local format, match = string.format, string.match; +--[[ TABLE METHODS ]]-- +local tcopy = table.copy; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV, L, Registry = unpack(select(2, ...)) +--[[ +########################################################## +LOCALS +########################################################## +]]-- +local NewHook = hooksecurefunc; +--[[ +########################################################## +SYSTEM UPDATES +########################################################## +]]-- +local playerClass = select(2,UnitClass("player")); + +local function DeleteOldSavedVars() + --[[ BEGIN DEPRECATED ]]-- + if SVUI_DATA then SVUI_DATA = nil end + if SVUI_SAFE_DATA then SVUI_SAFE_DATA = nil end + if SVUI_TRACKER then SVUI_TRACKER = nil end + if SVUI_ENEMIES then SVUI_ENEMIES = nil end + if SVUI_JOURNAL then SVUI_JOURNAL = nil end + if SVUI_CHARACTER_LOG then SVUI_CHARACTER_LOG = nil end + if SVUI_MOVED_FRAMES then SVUI_MOVED_FRAMES = nil end + if SVUI_SystemData then SVUI_SystemData = nil end + if SVUI_ProfileData then SVUI_ProfileData = nil end + if SVUI_Filters then SVUI_Filters = nil end + if SVUI_AuraFilters then SVUI_AuraFilters = nil end + if SVUI_AuraWatch then SVUI_AuraWatch = nil end + if SVUI_Cache["Mentalo"]["Blizzard"] then SVUI_Cache["Mentalo"]["Blizzard"] = nil end + if SVUI_Cache["Mentalo"]["UI"] then SVUI_Cache["Mentalo"]["UI"] = nil end + if(SVUI_Profile.SAFEDATA.install_complete) then SVUI_Profile.SAFEDATA.install_complete = nil end + --[[ END DEPRECATED ]]-- +end + +function SV:VersionCheck() + local minimumVersion = 4.06; + local installedVersion = SVUI_Profile.SAFEDATA.install_version + if(installedVersion) then + if(type(installedVersion) == "string") then + installedVersion = tonumber(SVUI_Profile.SAFEDATA.install_version) + end + if(type(installedVersion) == "number" and installedVersion < minimumVersion) then + DeleteOldSavedVars() + self.Setup:Install(true) + end + else + DeleteOldSavedVars() + self.Setup:Install(true) + end +end + +function SV:RefreshEverything(bypass) + self:RefreshAllSystemMedia(); + + SV.UIParent:Hide(); + + self:SetSVMovablesPositions(); + Registry:Update('SVUnit'); + Registry:UpdateAll(); + + SV.UIParent:Show(); + + if not bypass then + self:VersionCheck() + end +end +--[[ +########################################################## +SVUI LOAD PROCESS +########################################################## +]]-- +local function PrepareStorage() + if(not SVUI_Profile) then return end + SVUI_Profile.STORED = {} + local old = SVUI_Profile.SAFEDATA + local media = old.mediastyle or "" + local bars = old.barstyle or "" + local units = old.unitstyle or "" + local groups = old.groupstyle or "" + local auras = old.aurastyle or "" + local spec = GetSpecialization() or 1 + SVUI_Profile.STORED[1] = tcopy(SVUI_Profile, true) + SVUI_Profile.STORED[1].LAYOUT = { + mediastyle = media, + barstyle = bars, + unitstyle = units, + groupstyle = groups, + aurastyle = auras + } + SVUI_Profile.SAFEDATA.mediastyle = nil + SVUI_Profile.SAFEDATA.barstyle = nil + SVUI_Profile.SAFEDATA.unitstyle = nil + SVUI_Profile.SAFEDATA.groupstyle = nil + SVUI_Profile.SAFEDATA.aurastyle = nil + SVUI_Profile.SAFEDATA.dualSpecEnabled = false +end + +function SV:Load() + self.Timers:ClearAllTimers() + + local rez = GetCVar("gxResolution"); + local gxHeight = tonumber(match(rez,"%d+x(%d+)")); + local gxWidth = tonumber(match(rez,"(%d+)x%d+")); + + if not SVUI_Global then SVUI_Global = {} end + if not SVUI_Global["profiles"] then SVUI_Global["profiles"] = {} end + if SVUI_Global["gold"] then SVUI_Global["gold"] = nil end + if SVUI_Global["profileKeys"] then SVUI_Global["profileKeys"] = nil end + + if not SVUI_Profile then SVUI_Profile = {} end + if not SVUI_Profile.SAFEDATA then SVUI_Profile.SAFEDATA = {dualSpecEnabled = false} end + if not SVUI_Profile.STORED then PrepareStorage() end + + if not SVUI_Profile.STORED[2] then + SVUI_Profile.STORED[2] = {} + SVUI_Profile.STORED[2].LAYOUT = SVUI_Profile.STORED[1].LAYOUT + end + + if not SVUI_Profile.STORED[3] then + SVUI_Profile.STORED[3] = {} + SVUI_Profile.STORED[3].LAYOUT = SVUI_Profile.STORED[1].LAYOUT + end + + if playerClass == "DRUID" and not SVUI_Profile.STORED[4] then + SVUI_Profile.STORED[4] = {} + SVUI_Profile.STORED[4].LAYOUT = SVUI_Profile.STORED[1].LAYOUT + end + + for k,v in pairs(SVUI_Profile) do + if(k ~= "STORED" and k ~= "SAFEDATA") then + SVUI_Profile[k] = nil + end + end + + if not SVUI_Cache then SVUI_Cache = {} end + if not SVUI_Cache["Dock"] then SVUI_Cache["Dock"] = {} end + if not SVUI_Cache["Mentalo"] then SVUI_Cache["Mentalo"] = {} end + if not SVUI_Cache["Bindings"] then SVUI_Cache["Bindings"] = {} end + if(not SVUI_Cache["screenheight"] or (SVUI_Cache["screenheight"] and type(SVUI_Cache["screenheight"]) ~= "number")) then + SVUI_Cache["screenheight"] = gxHeight + end + if(not SVUI_Cache["screenwidth"] or (SVUI_Cache["screenwidth"] and type(SVUI_Cache["screenwidth"]) ~= "number")) then + SVUI_Cache["screenwidth"] = gxWidth + end + + self:SetDatabaseObjects(true) + Registry:FindAddons() + + self:ScreenCalibration(); + self:RefreshSystemFonts(); + self:LoadSystemAlerts(); + + self.UIParent:RegisterEvent('PLAYER_REGEN_DISABLED'); + self.AddonLoaded = true +end + +function SV:Launch() + self:SetDatabaseObjects(); + self:ScreenCalibration("PLAYER_LOGIN"); + Registry:LoadRegisteredAddons(); + self:UpdateDatabase(true); + Registry:LoadPackages(); + self:DefinePlayerRole(); + self:LoadMovables(); + self:SetSVMovablesPositions(); + + self:VersionCheck() + + self:RefreshAllSystemMedia(); + + NewHook("StaticPopup_Show", self.StaticPopup_Show) + + self.UIParent:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED"); + self.UIParent:RegisterEvent("PLAYER_TALENT_UPDATE"); + self.UIParent:RegisterEvent("CHARACTER_POINTS_CHANGED"); + self.UIParent:RegisterEvent("UNIT_INVENTORY_CHANGED"); + self.UIParent:RegisterEvent("UPDATE_BONUS_ACTIONBAR"); + self.UIParent:RegisterEvent("UI_SCALE_CHANGED"); + self.UIParent:RegisterEvent("PLAYER_ENTERING_WORLD"); + self.UIParent:RegisterEvent("PET_BATTLE_CLOSE"); + self.UIParent:RegisterEvent("PET_BATTLE_OPENING_START"); + self.UIParent:RegisterEvent("ADDON_ACTION_BLOCKED"); + self.UIParent:RegisterEvent("ADDON_ACTION_FORBIDDEN"); + self.UIParent:RegisterEvent("SPELLS_CHANGED"); + + Registry:Update("SVMap"); + Registry:Update("SVUnit", true); + collectgarbage("collect") + + _G["SVUI_Mentalo"]:SetFixedPanelTemplate("Component") + _G["SVUI_Mentalo"]:SetPanelColor("yellow") + _G["SVUI_MentaloPrecision"]:SetPanelTemplate("Transparent") + + if self.db.system.loginmessage then + local logMsg = (L["LOGIN_MSG"]):format("|cffFFFF1A", "|cffAA78FF", self.___version) + self:AddonMessage(logMsg); + end + + self.AddonLaunched = true +end +--[[ +########################################################## +EVENT HANDLERS +########################################################## +]]-- +local PlayerClass = select(2,UnitClass("player")); +local droodSpell1, droodSpell2 = GetSpellInfo(110309), GetSpellInfo(4987); + +local SVUISystem_OnEvent = function(self, event, arg, ...) + if(event == "ADDON_LOADED" and arg == "SVUI") then + if(not SV.AddonLoaded) then + SV:Load() + self:UnregisterEvent("ADDON_LOADED") + end + end + if(event == "PLAYER_LOGIN") then + if(not SV.AddonLaunched and IsLoggedIn()) then + SV:Launch() + self:UnregisterEvent("PLAYER_LOGIN") + end + end + if(event == "ACTIVE_TALENT_GROUP_CHANGED" or event == "PLAYER_TALENT_UPDATE" or event == "CHARACTER_POINTS_CHANGED" or event == "UNIT_INVENTORY_CHANGED" or event == "UPDATE_BONUS_ACTIONBAR") then + SV:DefinePlayerRole() + elseif(event == "UI_SCALE_CHANGED") then + SV:ScreenCalibration("UI_SCALE_CHANGED") + elseif(event == "PLAYER_ENTERING_WORLD") then + if(not SV.RoleIsSet) then + SV:DefinePlayerRole() + end + if(not SV.MediaInitialized) then + SV:RefreshAllSystemMedia() + end + local _,instanceType = IsInInstance() + if(instanceType == "pvp") then + SV.BGTimer = SV.Timers:ExecuteLoop(RequestBattlefieldScoreData, 5) + elseif(SV.BGTimer) then + SV.Timers:RemoveLoop(SV.BGTimer) + SV.BGTimer = nil + end + elseif(event == "SPELLS_CHANGED") then + if (PlayerClass ~= "DRUID") then + self:UnregisterEvent("SPELLS_CHANGED") + return + end + if GetSpellInfo(droodSpell1) == droodSpell2 then + SV.Dispellable["Disease"] = true + elseif(SV.Dispellable["Disease"]) then + SV.Dispellable["Disease"] = nil + end + elseif(event == "PET_BATTLE_CLOSE") then + SV:PushDisplayAudit() + elseif(event == "PET_BATTLE_OPENING_START") then + SV:FlushDisplayAudit() + elseif(event == "ADDON_ACTION_BLOCKED" or event == "ADDON_ACTION_FORBIDDEN") then + SV:TaintHandler(arg, ...) + elseif(event == "PLAYER_REGEN_DISABLED") then + local forceClosed = false; + if IsAddOnLoaded("SVUI_ConfigOMatic") then + local aceConfig=LibStub("AceConfigDialog-3.0") + if aceConfig.OpenFrames["SVUI"] then + self:RegisterEvent('PLAYER_REGEN_ENABLED') + aceConfig:Close("SVUI") + forceClosed = true + end + end + if SV.MentaloFrames then + for frame,_ in pairs(SV.MentaloFrames) do + if _G[frame] and _G[frame]:IsShown() then + forceClosed = true; + _G[frame]:Hide() + end + end + end + if(HenchmenFrameModel and HenchmenFrame and HenchmenFrame:IsShown()) then + HenchmenFrame:Hide() + HenchmenFrameBG:Hide() + forceClosed = true; + end + if forceClosed == true then + SV:AddonMessage(ERR_NOT_IN_COMBAT) + end + elseif(event == "PLAYER_REGEN_ENABLED") then + SV:ToggleConfig() + self:UnregisterEvent('PLAYER_REGEN_ENABLED') + end +end + +SV.UIParent:RegisterEvent("ADDON_LOADED") +SV.UIParent:RegisterEvent("PLAYER_LOGIN") +SV.UIParent:SetScript("OnEvent", SVUISystem_OnEvent) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/media.lua b/Interface/AddOns/SVUI/system/media.lua new file mode 100644 index 0000000..8e7cdcd --- /dev/null +++ b/Interface/AddOns/SVUI/system/media.lua @@ -0,0 +1,435 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local select = _G.select; +local pairs = _G.pairs; +local ipairs = _G.ipairs; +local type = _G.type; +local string = _G.string; +local math = _G.math; +local table = _G.table; +local GetTime = _G.GetTime; +--[[ STRING METHODS ]]-- +local format = string.format; +--[[ MATH METHODS ]]-- +local floor, modf = math.floor, math.modf; +--[[ TABLE METHODS ]]-- +local twipe, tsort = table.wipe, table.sort; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV, L, Registry = unpack(select(2, ...)) +--[[ +########################################################## +LOCALIZED GLOBALS +########################################################## +]]-- +local STANDARD_TEXT_FONT = _G.STANDARD_TEXT_FONT +local UNIT_NAME_FONT = _G.UNIT_NAME_FONT +local DAMAGE_TEXT_FONT = _G.DAMAGE_TEXT_FONT +local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS +local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS +--[[ +########################################################## +PRE VARS/FUNCTIONS +########################################################## +]]-- +local function SetFont(fontObject, font, fontSize, fontOutline, fontAlpha, color, shadowColor, offsetX, offsetY) + if not font then return end + fontObject:SetFont(font,fontSize,fontOutline); + if fontAlpha then + fontObject:SetAlpha(fontAlpha) + end + if color and type(color) == "table" then + fontObject:SetTextColor(unpack(color)) + end + if shadowColor and type(shadowColor) == "table" then + fontObject:SetShadowColor(unpack(shadowColor)) + end + if offsetX and offsetY then + fontObject:SetShadowOffset(offsetX,offsetY) + end +end +--[[ +########################################################## +DEFINE SHARED MEDIA +########################################################## +]]-- +SV.Shared = LibStub("LibSharedMedia-3.0") + +SV.Shared:Register("background","SVUI Backdrop 1",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN1]]) +SV.Shared:Register("background","SVUI Backdrop 2",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN2]]) +SV.Shared:Register("background","SVUI Backdrop 3",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN3]]) +SV.Shared:Register("background","SVUI Backdrop 4",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN4]]) +SV.Shared:Register("background","SVUI Backdrop 5",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN5]]) +SV.Shared:Register("background","SVUI Comic 1",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC1]]) +SV.Shared:Register("background","SVUI Comic 2",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC2]]) +SV.Shared:Register("background","SVUI Comic 3",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC3]]) +SV.Shared:Register("background","SVUI Comic 4",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC4]]) +SV.Shared:Register("background","SVUI Comic 5",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC5]]) +SV.Shared:Register("background","SVUI Comic 6",[[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC6]]) +SV.Shared:Register("background","SVUI Unit BG 1",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-BG1]]) +SV.Shared:Register("background","SVUI Unit BG 2",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-BG2]]) +SV.Shared:Register("background","SVUI Unit BG 3",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-BG3]]) +SV.Shared:Register("background","SVUI Unit BG 4",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-BG4]]) +SV.Shared:Register("background","SVUI Small BG 1",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG1]]) +SV.Shared:Register("background","SVUI Small BG 2",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG2]]) +SV.Shared:Register("background","SVUI Small BG 3",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG3]]) +SV.Shared:Register("background","SVUI Small BG 4",[[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG4]]) +SV.Shared:Register("statusbar","SVUI BasicBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) +SV.Shared:Register("statusbar","SVUI MultiColorBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\GRADIENT]]) +SV.Shared:Register("statusbar","SVUI SmoothBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\SMOOTH]]) +SV.Shared:Register("statusbar","SVUI PlainBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\FLAT]]) +SV.Shared:Register("statusbar","SVUI FancyBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\TEXTURED]]) +SV.Shared:Register("statusbar","SVUI GlossBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\GLOSS]]) +SV.Shared:Register("statusbar","SVUI GlowBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\GLOWING]]) +SV.Shared:Register("statusbar","SVUI LazerBar",[[Interface\AddOns\SVUI\assets\artwork\Bars\LAZER]]) +SV.Shared:Register("sound", "Whisper Alert", [[Interface\AddOns\SVUI\assets\sounds\whisper.mp3]]) +SV.Shared:Register("sound", "Toasty", [[Interface\AddOns\SVUI\assets\sounds\toasty.mp3]]) +SV.Shared:Register("font","SVUI Default Font",[[Interface\AddOns\SVUI\assets\fonts\Default.ttf]]) +SV.Shared:Register("font","SVUI System Font",[[Interface\AddOns\SVUI\assets\fonts\System.ttf]]) +SV.Shared:Register("font","SVUI Dialog Font",[[Interface\AddOns\SVUI\assets\fonts\Dialog.ttf]]) +SV.Shared:Register("font","SVUI Narrator Font",[[Interface\AddOns\SVUI\assets\fonts\Narrative.ttf]]) +SV.Shared:Register("font","SVUI Number Font",[[Interface\AddOns\SVUI\assets\fonts\Numbers.ttf]]) +SV.Shared:Register("font","SVUI Combat Font",[[Interface\AddOns\SVUI\assets\fonts\Combat.ttf]]) +SV.Shared:Register("font","SVUI Action Font",[[Interface\AddOns\SVUI\assets\fonts\Action.ttf]]) +SV.Shared:Register("font","SVUI Name Font",[[Interface\AddOns\SVUI\assets\fonts\Names.ttf]]) +SV.Shared:Register("font","SVUI Alert Font",[[Interface\AddOns\SVUI\assets\fonts\Alert.ttf]]) +SV.Shared:Register("font","SVUI Pixel Font",[[Interface\AddOns\SVUI\assets\fonts\Pixel.ttf]],SV.Shared.LOCALE_BIT_ruRU+SV.Shared.LOCALE_BIT_western) +SV.Shared:Register("font","Roboto",[[Interface\AddOns\SVUI\assets\fonts\Roboto.ttf]],SV.Shared.LOCALE_BIT_ruRU+SV.Shared.LOCALE_BIT_western) +--[[ +########################################################## +POPULATE MEDIA TABLE +########################################################## +]]-- +do + local myclass = select(2,UnitClass("player")) + local cColor1 = SVUI_CLASS_COLORS[myclass] + local cColor2 = RAID_CLASS_COLORS[myclass] + local r1,g1,b1 = cColor1.r,cColor1.g,cColor1.b + local r2,g2,b2 = cColor2.r*.25, cColor2.g*.25, cColor2.b*.25 + local ir1,ig1,ib1 = (1 - r1), (1 - g1), (1 - b1) + local ir2,ig2,ib2 = (1 - cColor2.r)*.25, (1 - cColor2.g)*.25, (1 - cColor2.b)*.25 + local Shared = SV.Shared + + SV.Media["color"] = { + ["default"] = {0.2, 0.2, 0.2, 1}, + ["special"] = {.37, .32, .29, 1}, + ["unique"] = {0.32, 0.258, 0.21, 1}, + ["class"] = {r1, g1, b1, 1}, + ["bizzaro"] = {ir1, ig1, ib1, 1}, + ["dark"] = {0, 0, 0, 1}, + ["light"] = {0.95, 0.95, 0.95, 1}, + ["highlight"] = {0.1, 0.8, 0.8, 1}, + ["green"] = {0.25, 0.9, 0.08, 1}, + ["red"] = {0.9, 0.08, 0.08, 1}, + ["yellow"] = {1, 1, 0, 1}, + ["transparent"] = {0, 0, 0, 0.5}, + ["white"] = {1, 1, 1, 1}, + } + + SV.Media["font"] = { + ["default"] = Shared:Fetch("font", "SVUI Default Font"), + ["system"] = Shared:Fetch("font", "SVUI System Font"), + ["combat"] = Shared:Fetch("font", "SVUI Combat Font"), + ["dialog"] = Shared:Fetch("font", "SVUI Dialog Font"), + ["narrator"] = Shared:Fetch("font", "SVUI Narrator Font"), + ["action"] = Shared:Fetch("font", "SVUI Action Font"), + ["names"] = Shared:Fetch("font", "SVUI Name Font"), + ["alert"] = Shared:Fetch("font", "SVUI Alert Font"), + ["numbers"] = Shared:Fetch("font", "SVUI Number Font"), + ["pixel"] = Shared:Fetch("font", "SVUI Pixel Font"), + ["roboto"] = Shared:Fetch("font", "Roboto") + } + + SV.Media["bar"] = { + ["default"] = Shared:Fetch("statusbar", "SVUI BasicBar"), + ["gradient"] = Shared:Fetch("statusbar", "SVUI MultiColorBar"), + ["smooth"] = Shared:Fetch("statusbar", "SVUI SmoothBar"), + ["flat"] = Shared:Fetch("statusbar", "SVUI PlainBar"), + ["textured"] = Shared:Fetch("statusbar", "SVUI FancyBar"), + ["gloss"] = Shared:Fetch("statusbar", "SVUI GlossBar"), + ["glow"] = Shared:Fetch("statusbar", "SVUI GlowBar"), + ["lazer"] = Shared:Fetch("statusbar", "SVUI LazerBar"), + } + + SV.Media["bg"] = { + ["pattern"] = Shared:Fetch("background", "SVUI Backdrop 1"), + ["comic"] = Shared:Fetch("background", "SVUI Comic 1"), + ["unitlarge"] = Shared:Fetch("background", "SVUI Unit BG 3"), + ["unitsmall"] = Shared:Fetch("background", "SVUI Small BG 3") + } + + SV.Media["gradient"] = { + ["default"] = {"VERTICAL", 0.08, 0.08, 0.08, 0.22, 0.22, 0.22}, + ["special"] = {"VERTICAL", 0.33, 0.25, 0.13, 0.47, 0.39, 0.27}, + ["class"] = {"VERTICAL", r2, g2, b2, r1, g1, b1}, + ["bizzaro"] = {"VERTICAL", ir2, ig2, ib2, ir1, ig1, ib1}, + ["dark"] = {"VERTICAL", 0.02, 0.02, 0.02, 0.22, 0.22, 0.22}, + ["darkest"] = {"VERTICAL", 0.15, 0.15, 0.15, 0, 0, 0}, + ["darkest2"] = {"VERTICAL", 0, 0, 0, 0.12, 0.12, 0.12}, + ["light"] = {"VERTICAL", 0.65, 0.65, 0.65, 0.95, 0.95, 0.95}, + ["highlight"] = {"VERTICAL", 0.1, 0.8, 0.8, 0.2, 0.5, 1}, + ["green"] = {"VERTICAL", 0.08, 0.5, 0, 0.25, 0.9, 0.08}, + ["red"] = {"VERTICAL", 0.5, 0, 0, 0.9, 0.08, 0.08}, + ["yellow"] = {"VERTICAL", 1, 0.3, 0, 1, 1, 0}, + ["inverse"] = {"VERTICAL", 0.25, 0.25, 0.25, 0.12, 0.12, 0.12}, + ["icon"] = {"VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1}, + ["white"] = {"VERTICAL", 0.75, 0.75, 0.75, 1, 1, 1}, + } +end +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +function SV:ColorGradient(perc, ...) + if perc >= 1 then + return select(select('#', ...) - 2, ...) + elseif perc <= 0 then + return ... + end + local num = select('#', ...) / 3 + local segment, relperc = modf(perc*(num-1)) + local r1, g1, b1, r2, g2, b2 = select((segment*3)+1, ...) + return r1 + (r2-r1)*relperc, g1 + (g2-g1)*relperc, b1 + (b2-b1)*relperc +end + +function SV:HexColor(arg1,arg2,arg3) + local r,g,b; + if arg1 and type(arg1) == "string" then + local t + if(self.Media or self.db.media) then + t = self.Media.color[arg1] or self.db.media.unitframes[arg1] + else + t = self.Configs.media.colors[arg1] or self.Configs.media.unitframes[arg1] + end + if t then + r,g,b = t[1],t[2],t[3] + else + r,g,b = 0,0,0 + end + else + r = type(arg1) == "number" and arg1 or 0; + g = type(arg2) == "number" and arg2 or 0; + b = type(arg3) == "number" and arg3 or 0; + end + r = (r < 0 or r > 1) and 0 or (r * 255) + g = (g < 0 or g > 1) and 0 or (g * 255) + b = (b < 0 or b > 1) and 0 or (b * 255) + local hexString = ("%02x%02x%02x"):format(r,g,b) + return hexString +end + +function SV:MediaUpdate() + self.Media.color.default = self.db.media.colors.default + self.Media.color.special = self.db.media.colors.special + self.Media.bg.pattern = self.Shared:Fetch("background", self.db.media.textures.pattern) + self.Media.bg.comic = self.Shared:Fetch("background", self.db.media.textures.comic) + self.Media.bg.unitlarge = self.Shared:Fetch("background", self.db.media.textures.unitlarge) + self.Media.bg.unitsmall = self.Shared:Fetch("background", self.db.media.textures.unitsmall) + + local cColor1 = self.Media.color.special + local cColor2 = self.Media.color.default + local r1,g1,b1 = cColor1[1], cColor1[2], cColor1[3] + local r2,g2,b2 = cColor2[1], cColor2[2], cColor2[3] + + self.Media.gradient.special = {"VERTICAL",r1,g1,b1,r2,g2,b2} + + Registry:RunCallbacks() +end + +function SV:RefreshSystemFonts() + local fontsize = self.db.media.fonts.size + local unicodesize = self.db.media.fonts.unicodeSize + + local NUMBER_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.number); + local GIANT_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.giant); + STANDARD_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.default); + UNIT_NAME_FONT = self.Shared:Fetch("font", self.db.media.fonts.name); + DAMAGE_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.combat); + NAMEPLATE_FONT = STANDARD_TEXT_FONT + CHAT_FONT_HEIGHTS = {8,9,10,11,12,13,14,15,16,17,18,19,20} + UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT = fontsize + + -- SetFont(GameFont_Gigantic, GIANT_TEXT_FONT, fontsize*3, "THICKOUTLINE", 32) + -- SetFont(SystemFont_Shadow_Huge1, GIANT_TEXT_FONT, fontsize*1.8, "OUTLINE") + -- SetFont(SystemFont_OutlineThick_Huge2, GIANT_TEXT_FONT, fontsize*1.8, "THICKOUTLINE") + + SetFont(QuestFont_Large, UNIT_NAME_FONT, fontsize+4) + SetFont(ZoneTextString, UNIT_NAME_FONT, fontsize*4.2, "OUTLINE") + SetFont(SubZoneTextString, UNIT_NAME_FONT, fontsize*3.2, "OUTLINE") + SetFont(PVPInfoTextString, UNIT_NAME_FONT, fontsize*1.9, "OUTLINE") + SetFont(PVPArenaTextString, UNIT_NAME_FONT, fontsize*1.9, "OUTLINE") + SetFont(SystemFont_Shadow_Outline_Huge2, UNIT_NAME_FONT, fontsize*1.8, "OUTLINE") + + SetFont(NumberFont_OutlineThick_Mono_Small, NUMBER_TEXT_FONT, fontsize, "OUTLINE") + SetFont(NumberFont_Outline_Huge, NUMBER_TEXT_FONT, fontsize*2, "THICKOUTLINE", 28) + SetFont(NumberFont_Outline_Large, NUMBER_TEXT_FONT, fontsize+4, "OUTLINE") + SetFont(NumberFont_Outline_Med, NUMBER_TEXT_FONT, fontsize+2, "OUTLINE") + SetFont(NumberFontNormal, NUMBER_TEXT_FONT, fontsize, "OUTLINE") + + SetFont(GameFontHighlight, STANDARD_TEXT_FONT, fontsize) + SetFont(GameFontWhite, STANDARD_TEXT_FONT, fontsize, 'OUTLINE', 1, {1,1,1}) + SetFont(GameFontWhiteSmall, STANDARD_TEXT_FONT, fontsize, 'NONE', 1, {1,1,1}) + SetFont(GameFontBlack, STANDARD_TEXT_FONT, fontsize, 'NONE', 1, {0,0,0}) + SetFont(GameFontBlackSmall, STANDARD_TEXT_FONT, fontsize, 'NONE', 1, {0,0,0}) + SetFont(GameFontNormal, STANDARD_TEXT_FONT, fontsize) + SetFont(QuestFont, STANDARD_TEXT_FONT, fontsize) + SetFont(SystemFont_Large, STANDARD_TEXT_FONT, fontsize+2) + SetFont(GameFontNormalMed3, STANDARD_TEXT_FONT, fontsize+1) + SetFont(SystemFont_Med1, STANDARD_TEXT_FONT, fontsize) + SetFont(SystemFont_Med3, STANDARD_TEXT_FONT, fontsize) + SetFont(SystemFont_Outline_Small, STANDARD_TEXT_FONT, fontsize, "OUTLINE") + SetFont(SystemFont_Shadow_Large, STANDARD_TEXT_FONT, fontsize+2) + SetFont(SystemFont_Shadow_Med1, STANDARD_TEXT_FONT, fontsize) + SetFont(SystemFont_Shadow_Med3, STANDARD_TEXT_FONT, fontsize) + SetFont(SystemFont_Shadow_Small, STANDARD_TEXT_FONT, fontsize) + SetFont(SystemFont_Small, STANDARD_TEXT_FONT, fontsize) + SetFont(FriendsFont_Normal, STANDARD_TEXT_FONT, fontsize) + SetFont(FriendsFont_Small, STANDARD_TEXT_FONT, fontsize-2) + SetFont(FriendsFont_Large, STANDARD_TEXT_FONT, fontsize) + SetFont(FriendsFont_UserText, STANDARD_TEXT_FONT, fontsize) + + SetFont(GameFont_Gigantic, GIANT_TEXT_FONT, 200, "THICKOUTLINE", 32) + SetFont(SystemFont_Shadow_Huge1, GIANT_TEXT_FONT, 200, "OUTLINE") + SetFont(SystemFont_OutlineThick_Huge2, GIANT_TEXT_FONT, 200, "THICKOUTLINE") + + SetFont(SystemFont_Shadow_Huge3, DAMAGE_TEXT_FONT, 200, "THICKOUTLINE") + SetFont(CombatTextFont, DAMAGE_TEXT_FONT, 200, "THICKOUTLINE") + + local UNICODE_FONT = self.Media.font.roboto; + + SetFont(GameTooltipHeader, UNICODE_FONT, unicodesize+2) + SetFont(Tooltip_Med, UNICODE_FONT, unicodesize) + SetFont(Tooltip_Small, UNICODE_FONT, unicodesize) + SetFont(GameFontNormalSmall, UNICODE_FONT, unicodesize) + SetFont(GameFontHighlightSmall, UNICODE_FONT, unicodesize) + SetFont(NumberFont_Shadow_Med, UNICODE_FONT, unicodesize) + SetFont(NumberFont_Shadow_Small, UNICODE_FONT, unicodesize) + SetFont(SystemFont_Tiny, UNICODE_FONT, unicodesize) + + self:UpdateFontTemplates() +end + +function SV:RefreshAllSystemMedia() + local fontsize = self.db.media.fonts.size + local unicodesize = self.db.media.fonts.unicodeSize + + local NUMBER_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.number); + local GIANT_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.giant); + STANDARD_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.default); + UNIT_NAME_FONT = self.Shared:Fetch("font", self.db.media.fonts.name); + DAMAGE_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.combat); + NAMEPLATE_FONT = STANDARD_TEXT_FONT + CHAT_FONT_HEIGHTS = {8,9,10,11,12,13,14,15,16,17,18,19,20} + UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT = fontsize + + -- SetFont(GameFont_Gigantic, GIANT_TEXT_FONT, fontsize*3, "THICKOUTLINE", 32) + -- SetFont(SystemFont_Shadow_Huge1, GIANT_TEXT_FONT, fontsize*1.8, "OUTLINE") + -- SetFont(SystemFont_OutlineThick_Huge2, GIANT_TEXT_FONT, fontsize*1.8, "THICKOUTLINE") + + SetFont(QuestFont_Large, UNIT_NAME_FONT, fontsize+4) + SetFont(ZoneTextString, UNIT_NAME_FONT, fontsize*4.2, "OUTLINE") + SetFont(SubZoneTextString, UNIT_NAME_FONT, fontsize*3.2, "OUTLINE") + SetFont(PVPInfoTextString, UNIT_NAME_FONT, fontsize*1.9, "OUTLINE") + SetFont(PVPArenaTextString, UNIT_NAME_FONT, fontsize*1.9, "OUTLINE") + SetFont(SystemFont_Shadow_Outline_Huge2, UNIT_NAME_FONT, fontsize*1.8, "OUTLINE") + + SetFont(NumberFont_OutlineThick_Mono_Small, NUMBER_TEXT_FONT, fontsize, "OUTLINE") + SetFont(NumberFont_Outline_Huge, NUMBER_TEXT_FONT, fontsize*2, "THICKOUTLINE", 28) + SetFont(NumberFont_Outline_Large, NUMBER_TEXT_FONT, fontsize+4, "OUTLINE") + SetFont(NumberFont_Outline_Med, NUMBER_TEXT_FONT, fontsize+2, "OUTLINE") + SetFont(NumberFontNormal, NUMBER_TEXT_FONT, fontsize, "OUTLINE") + + SetFont(GameFontHighlight, STANDARD_TEXT_FONT, fontsize) + SetFont(GameFontWhite, STANDARD_TEXT_FONT, fontsize, 'OUTLINE', 1, {1,1,1}) + SetFont(GameFontWhiteSmall, STANDARD_TEXT_FONT, fontsize, 'NONE', 1, {1,1,1}) + SetFont(GameFontBlack, STANDARD_TEXT_FONT, fontsize, 'NONE', 1, {0,0,0}) + SetFont(GameFontBlackSmall, STANDARD_TEXT_FONT, fontsize, 'NONE', 1, {0,0,0}) + SetFont(GameFontNormal, STANDARD_TEXT_FONT, fontsize) + SetFont(QuestFont, STANDARD_TEXT_FONT, fontsize) + SetFont(SystemFont_Large, STANDARD_TEXT_FONT, fontsize+2) + SetFont(GameFontNormalMed3, STANDARD_TEXT_FONT, fontsize+1) + SetFont(SystemFont_Med1, STANDARD_TEXT_FONT, fontsize) + SetFont(SystemFont_Med3, STANDARD_TEXT_FONT, fontsize) + SetFont(SystemFont_Outline_Small, STANDARD_TEXT_FONT, fontsize, "OUTLINE") + SetFont(SystemFont_Shadow_Large, STANDARD_TEXT_FONT, fontsize+2) + SetFont(SystemFont_Shadow_Med1, STANDARD_TEXT_FONT, fontsize) + SetFont(SystemFont_Shadow_Med3, STANDARD_TEXT_FONT, fontsize) + SetFont(SystemFont_Shadow_Small, STANDARD_TEXT_FONT, fontsize) + SetFont(SystemFont_Small, STANDARD_TEXT_FONT, fontsize) + SetFont(FriendsFont_Normal, STANDARD_TEXT_FONT, fontsize) + SetFont(FriendsFont_Small, STANDARD_TEXT_FONT, fontsize-2) + SetFont(FriendsFont_Large, STANDARD_TEXT_FONT, fontsize) + SetFont(FriendsFont_UserText, STANDARD_TEXT_FONT, fontsize) + + SetFont(GameFont_Gigantic, GIANT_TEXT_FONT, 200, "THICKOUTLINE", 32) + SetFont(SystemFont_Shadow_Huge1, GIANT_TEXT_FONT, 200, "OUTLINE") + SetFont(SystemFont_OutlineThick_Huge2, GIANT_TEXT_FONT, 200, "THICKOUTLINE") + + SetFont(SystemFont_Shadow_Huge3, DAMAGE_TEXT_FONT, 200, "THICKOUTLINE") + SetFont(CombatTextFont, DAMAGE_TEXT_FONT, 200, "THICKOUTLINE") + + local UNICODE_FONT = self.Media.font.roboto; + + SetFont(GameTooltipHeader, UNICODE_FONT, unicodesize+2) + SetFont(Tooltip_Med, UNICODE_FONT, unicodesize) + SetFont(Tooltip_Small, UNICODE_FONT, unicodesize) + SetFont(GameFontNormalSmall, UNICODE_FONT, unicodesize) + SetFont(GameFontHighlightSmall, UNICODE_FONT, unicodesize) + SetFont(NumberFont_Shadow_Med, UNICODE_FONT, unicodesize) + SetFont(NumberFont_Shadow_Small, UNICODE_FONT, unicodesize) + SetFont(SystemFont_Tiny, UNICODE_FONT, unicodesize) + + self:MediaUpdate() + self.MediaInitialized = true +end +--[[ +########################################################## +INIT SOME COMBAT FONTS +########################################################## +]]-- +do + local fontFile = "Interface\\AddOns\\SVUI\\assets\\fonts\\Combat.ttf" + + DAMAGE_TEXT_FONT = fontFile + NUM_COMBAT_TEXT_LINES = 20; + COMBAT_TEXT_SCROLLSPEED = 1.0; + COMBAT_TEXT_FADEOUT_TIME = 1.0; + COMBAT_TEXT_HEIGHT = 18; + COMBAT_TEXT_CRIT_MAXHEIGHT = 2.0; + COMBAT_TEXT_CRIT_MINHEIGHT = 1.2; + COMBAT_TEXT_CRIT_SCALE_TIME = 0.7; + COMBAT_TEXT_CRIT_SHRINKTIME = 0.2; + COMBAT_TEXT_TO_ANIMATE = {}; + COMBAT_TEXT_STAGGER_RANGE = 20; + COMBAT_TEXT_SPACING = 7; + COMBAT_TEXT_MAX_OFFSET = 130; + COMBAT_TEXT_LOW_HEALTH_THRESHOLD = 0.2; + COMBAT_TEXT_LOW_MANA_THRESHOLD = 0.2; + COMBAT_TEXT_LOCATIONS = {}; + + local fName, fHeight, fFlags = CombatTextFont:GetFont() + + CombatTextFont:SetFont(fontFile, 24, fFlags) +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/mentalo.lua b/Interface/AddOns/SVUI/system/mentalo.lua index e5c4575..dafd813 100644 --- a/Interface/AddOns/SVUI/system/mentalo.lua +++ b/Interface/AddOns/SVUI/system/mentalo.lua @@ -33,8 +33,8 @@ local parsefloat = math.parsefloat; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); -SuperVillain.MentaloFrames = {} +local SV, L = unpack(select(2, ...)); +SV.MentaloFrames = {} local Sticky = {}; Sticky.scripts = Sticky.scripts or {} Sticky.rangeX = 15 @@ -230,7 +230,7 @@ local DraggableFrames = { -- local MentaloUIFrames = { -- "ArcheologyDigsiteProgressBar", -- }; -local theHand = CreateFrame("Frame", "SVUI_HandOfMentalo", SuperVillain.UIParent) +local theHand = CreateFrame("Frame", "SVUI_HandOfMentalo", SV.UIParent) theHand:SetFrameStrata("DIALOG") theHand:SetFrameLevel(99) theHand:SetClampedToScreen(true) @@ -242,7 +242,7 @@ theHand.bg:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-HAN 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) +SV.Animate:Orbit(theHand.energy, 10) theHand.flash = theHand.energy.anim; theHand.energy:Hide() theHand.elapsedTime = 0; @@ -296,8 +296,8 @@ local TheHand_OnUpdate = function(self, elapsed) if self.elapsedTime > 0.1 then self.elapsedTime = 0 local x, y = GetCursorPosition() - local scale = SuperVillain.UIParent:GetEffectiveScale() - self:SetPoint("CENTER", SuperVillain.UIParent, "BOTTOMLEFT", (x / scale) + 50, (y / scale) + 50) + local scale = SV.UIParent:GetEffectiveScale() + self:SetPoint("CENTER", SV.UIParent, "BOTTOMLEFT", (x / scale) + 50, (y / scale) + 50) end end @@ -377,7 +377,7 @@ local function MakeMovable(frame) end local function GrabUsableRegions(frame) - local parent = frame or SuperVillain.UIParent + local parent = frame or SV.UIParent local right = parent:GetRight() local top = parent:GetTop() local center = parent:GetCenter() @@ -410,9 +410,9 @@ end local function SetSVMovable(frame, moveName, title, raised, snap, dragStopFunc) if(not frame) then return end - if SuperVillain.MentaloFrames[moveName].Created then return end + if SV.MentaloFrames[moveName].Created then return end if raised == nil then raised = true end - local movable = CreateFrame("Button", moveName, SuperVillain.UIParent) + local movable = CreateFrame("Button", moveName, SV.UIParent) movable:SetFrameLevel(frame:GetFrameLevel() + 1) movable:SetClampedToScreen(true) movable:SetWidth(frame:GetWidth()) @@ -423,21 +423,21 @@ local function SetSVMovable(frame, moveName, title, raised, snap, dragStopFunc) movable.postdrag = dragStopFunc; movable.overlay = raised; movable.snapOffset = snap or -2; - SuperVillain.MentaloFrames[moveName].Avatar = movable; - SuperVillain["Snap"][#SuperVillain["Snap"] + 1] = movable; + SV.MentaloFrames[moveName].Avatar = movable; + SV["Snap"][#SV["Snap"] + 1] = movable; if raised == true then movable:SetFrameStrata("DIALOG") else movable:SetFrameStrata("BACKGROUND") end local anchor1, anchorParent, anchor2, xPos, yPos = split("\031", FindLoc(frame)) - if SuperVillain.db.framelocations and SuperVillain.db.framelocations[moveName] then - if type(SuperVillain.db.framelocations[moveName]) == "table"then - movable:SetPoint(SuperVillain.db.framelocations[moveName]["p"], SuperVillain.UIParent, SuperVillain.db.framelocations[moveName]["p2"], SuperVillain.db.framelocations[moveName]["p3"], SuperVillain.db.framelocations[moveName]["p4"]) - SuperVillain.db.framelocations[moveName] = FindLoc(movable) + if SV.db.framelocations and SV.db.framelocations[moveName] then + if type(SV.db.framelocations[moveName]) == "table"then + movable:SetPoint(SV.db.framelocations[moveName]["p"], SV.UIParent, SV.db.framelocations[moveName]["p2"], SV.db.framelocations[moveName]["p3"], SV.db.framelocations[moveName]["p4"]) + SV.db.framelocations[moveName] = FindLoc(movable) movable:ClearAllPoints() end - anchor1, anchorParent, anchor2, xPos, yPos = split("\031", SuperVillain.db.framelocations[moveName]) + anchor1, anchorParent, anchor2, xPos, yPos = split("\031", SV.db.framelocations[moveName]) movable:SetPoint(anchor1, anchorParent, anchor2, xPos, yPos) else movable:SetPoint(anchor1, anchorParent, anchor2, xPos, yPos) @@ -446,9 +446,9 @@ local function SetSVMovable(frame, moveName, title, raised, snap, dragStopFunc) movable:SetAlpha(0.4) movable:RegisterForDrag("LeftButton", "RightButton") movable:SetScript("OnDragStart", function(this) - if InCombatLockdown()then SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT)return end - if SuperVillain.db["system"].stickyFrames then - Sticky:StartMoving(this, SuperVillain["Snap"], movable.snapOffset, movable.snapOffset, movable.snapOffset, movable.snapOffset) + if InCombatLockdown()then SV:AddonMessage(ERR_NOT_IN_COMBAT)return end + if SV.db["system"].stickyFrames then + Sticky:StartMoving(this, SV["Snap"], movable.snapOffset, movable.snapOffset, movable.snapOffset, movable.snapOffset) else this:StartMoving() end @@ -457,11 +457,11 @@ local function SetSVMovable(frame, moveName, title, raised, snap, dragStopFunc) EnableTheHand() userHolding = true end) - movable:SetScript("OnMouseUp", SuperVillain.MovableFocused) + movable:SetScript("OnMouseUp", SV.MovableFocused) movable:SetScript("OnDragStop", function(this) - if InCombatLockdown()then SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT)return end + if InCombatLockdown()then SV:AddonMessage(ERR_NOT_IN_COMBAT)return end userHolding = false; - if SuperVillain.db["system"].stickyFrames then + if SV.db["system"].stickyFrames then Sticky:StopMoving(this) else this:StopMovingOrSizing() @@ -490,10 +490,10 @@ local function SetSVMovable(frame, moveName, title, raised, snap, dragStopFunc) this.parent:Point(this.positionOverride, this, this.positionOverride) end this:ClearAllPoints() - this:Point(newAnchor, SuperVillain.UIParent, newAnchor, cX, cY) - SuperVillain:SaveMovableLoc(moveName) + this:Point(newAnchor, SV.UIParent, newAnchor, cX, cY) + SV:SaveMovableLoc(moveName) if SVUI_MentaloPrecision then - SuperVillain:MentaloFocusUpdate(this) + SV:MentaloFocusUpdate(this) end UpdateFrameTarget = nil; _G["SVUI_MentaloEventHandler"]:Hide() @@ -514,7 +514,7 @@ local function SetSVMovable(frame, moveName, title, raised, snap, dragStopFunc) u:SetJustifyH("CENTER") u:SetPoint("CENTER") u:SetText(title or moveName) - u:SetTextColor(unpack(SuperVillain.Media.color.highlight)) + u:SetTextColor(unpack(SV.Media.color.highlight)) movable:SetFontString(u) movable.text = u; @@ -529,14 +529,14 @@ local function SetSVMovable(frame, moveName, title, raised, snap, dragStopFunc) theHand:Show() if CurrentFrameTarget ~= this then SVUI_MentaloPrecision:Hide() - SuperVillain.MovableFocused(this) + SV.MovableFocused(this) end end) movable:SetScript("OnMouseDown", function(this, arg) if arg == "RightButton"then userHolding = false; SVUI_MentaloPrecision:Show() - if SuperVillain.db["system"].stickyFrames then + if SV.db["system"].stickyFrames then Sticky:StopMoving(this) else this:StopMovingOrSizing() @@ -546,11 +546,11 @@ local function SetSVMovable(frame, moveName, title, raised, snap, dragStopFunc) movable:SetScript("OnLeave", function(this) if userHolding then return end this:SetAlpha(0.4) - this.text:SetTextColor(unpack(SuperVillain.Media.color.highlight)) + this.text:SetTextColor(unpack(SV.Media.color.highlight)) SVUI_Mentalo.Avatar:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-OFF]]) theHand:Hide() end) - movable:SetScript("OnShow", function(this)this:SetBackdropBorderColor(unpack(SuperVillain.Media.color.highlight))end) + movable:SetScript("OnShow", function(this)this:SetBackdropBorderColor(unpack(SV.Media.color.highlight))end) movable:SetMovable(true) movable:Hide() if dragStopFunc ~= nil and type(dragStopFunc) == "function"then @@ -560,78 +560,78 @@ local function SetSVMovable(frame, moveName, title, raised, snap, dragStopFunc) this:UnregisterAllEvents() end) end - SuperVillain.MentaloFrames[moveName].Created = true + SV.MentaloFrames[moveName].Created = true end --[[ ########################################################## GLOBAL/MODULE FUNCTIONS ########################################################## ]]-- -function SuperVillain:MentaloForced(frame) +function SV:MentaloForced(frame) if _G[frame] and _G[frame]:GetScript("OnDragStop") then _G[frame]:GetScript("OnDragStop")(_G[frame]) end end -function SuperVillain:TestMovableMoved(frame) - if SuperVillain.db.framelocations and SuperVillain.db.framelocations[frame] then +function SV:TestMovableMoved(frame) + if SV.db.framelocations and SV.db.framelocations[frame] then return true else return false end end -function SuperVillain:SaveMovableLoc(frame) +function SV:SaveMovableLoc(frame) if not _G[frame] then return end - if not SuperVillain.db.framelocations then - SuperVillain.db.framelocations = {} + if not SV.db.framelocations then + SV.db.framelocations = {} end - SuperVillain.db.framelocations[frame] = FindLoc(_G[frame]) + SV.db.framelocations[frame] = FindLoc(_G[frame]) end -function SuperVillain:SetSnapOffset(frame, snapOffset) - if not _G[frame] or not SuperVillain.MentaloFrames[frame] then return end - SuperVillain.MentaloFrames[frame].Avatar.snapOffset = snapOffset or -2; - SuperVillain.MentaloFrames[frame]["snapoffset"] = snapOffset or -2 +function SV:SetSnapOffset(frame, snapOffset) + if not _G[frame] or not SV.MentaloFrames[frame] then return end + SV.MentaloFrames[frame].Avatar.snapOffset = snapOffset or -2; + SV.MentaloFrames[frame]["snapoffset"] = snapOffset or -2 end -function SuperVillain:SaveMovableOrigin(frame) +function SV:SaveMovableOrigin(frame) if not _G[frame] then return end - SuperVillain.MentaloFrames[frame]["point"] = FindLoc(_G[frame]) - SuperVillain.MentaloFrames[frame]["postdrag"](_G[frame], Pinpoint(_G[frame])) + SV.MentaloFrames[frame]["point"] = FindLoc(_G[frame]) + SV.MentaloFrames[frame]["postdrag"](_G[frame], Pinpoint(_G[frame])) end -function SuperVillain:SetSVMovable(frame, title, raised, snapOffset, dragStopFunc, movableGroup, overrideName) +function SV:SetSVMovable(frame, title, raised, snapOffset, dragStopFunc, movableGroup, overrideName) if(not frame or (not overrideName and not frame:GetName())) then return end local frameName = overrideName or frame:GetName() local moveName = ("%s_MOVE"):format(frameName) if not movableGroup then movableGroup = "ALL, GENERAL" end - if SuperVillain.MentaloFrames[moveName] == nil then - SuperVillain.MentaloFrames[moveName] = {} - SuperVillain.MentaloFrames[moveName]["parent"] = frame; - SuperVillain.MentaloFrames[moveName]["text"] = title; - SuperVillain.MentaloFrames[moveName]["overlay"] = raised; - SuperVillain.MentaloFrames[moveName]["postdrag"] = dragStopFunc; - SuperVillain.MentaloFrames[moveName]["snapoffset"] = snapOffset; - SuperVillain.MentaloFrames[moveName]["point"] = FindLoc(frame) - SuperVillain.MentaloFrames[moveName]["type"] = {} + if SV.MentaloFrames[moveName] == nil then + SV.MentaloFrames[moveName] = {} + SV.MentaloFrames[moveName]["parent"] = frame; + SV.MentaloFrames[moveName]["text"] = title; + SV.MentaloFrames[moveName]["overlay"] = raised; + SV.MentaloFrames[moveName]["postdrag"] = dragStopFunc; + SV.MentaloFrames[moveName]["snapoffset"] = snapOffset; + SV.MentaloFrames[moveName]["point"] = FindLoc(frame) + SV.MentaloFrames[moveName]["type"] = {} local group = {split(", ", movableGroup)} for i = 1, #group do local this = group[i] - SuperVillain.MentaloFrames[moveName]["type"][this] = true + SV.MentaloFrames[moveName]["type"][this] = true end end SetSVMovable(frame, moveName, title, raised, snapOffset, dragStopFunc) end -function SuperVillain:ToggleMovables(enabled, configType) - for frameName, _ in pairs(SuperVillain.MentaloFrames)do +function SV:ToggleMovables(enabled, configType) + for frameName, _ in pairs(SV.MentaloFrames)do if(_G[frameName]) then local movable = _G[frameName] if(not enabled) then movable:Hide() else - if SuperVillain.MentaloFrames[frameName]["type"][configType]then + if SV.MentaloFrames[frameName]["type"][configType]then movable:Show() else movable:Hide() @@ -641,38 +641,38 @@ function SuperVillain:ToggleMovables(enabled, configType) end end -function SuperVillain:ResetMovables(request) +function SV:ResetMovables(request) if request == "" or request == nil then - for name, _ in pairs(SuperVillain.MentaloFrames)do + for name, _ in pairs(SV.MentaloFrames)do local frame = _G[name]; - if SuperVillain.MentaloFrames[name]["point"] then - local u, v, w, x, y = split("\031", SuperVillain.MentaloFrames[name]["point"]) + if SV.MentaloFrames[name]["point"] then + local u, v, w, x, y = split("\031", SV.MentaloFrames[name]["point"]) frame:ClearAllPoints() frame:SetPoint(u, v, w, x, y) - for arg, func in pairs(SuperVillain.MentaloFrames[name])do + for arg, func in pairs(SV.MentaloFrames[name])do if arg == "postdrag" and type(func) == "function" then func(frame, Pinpoint(frame)) end end end end - SuperVillain.db:SetDefault("framelocations") + SV.db:SetDefault("framelocations") else - for name, _ in pairs(SuperVillain.MentaloFrames)do - if SuperVillain.MentaloFrames[name]["point"] then - for arg1, arg2 in pairs(SuperVillain.MentaloFrames[name])do + for name, _ in pairs(SV.MentaloFrames)do + if SV.MentaloFrames[name]["point"] then + for arg1, arg2 in pairs(SV.MentaloFrames[name])do local mover; if arg1 == "text" then if request == arg2 then local frame = _G[name] - local u, v, w, x, y = split("\031", SuperVillain.MentaloFrames[name]["point"]) + local u, v, w, x, y = split("\031", SV.MentaloFrames[name]["point"]) frame:ClearAllPoints() frame:SetPoint(u, v, w, x, y) - if SuperVillain.db.framelocations then - SuperVillain.db.framelocations[name] = nil + if SV.db.framelocations then + SV.db.framelocations[name] = nil end - if (SuperVillain.MentaloFrames[name]["postdrag"] ~= nil and type(SuperVillain.MentaloFrames[name]["postdrag"]) == "function")then - SuperVillain.MentaloFrames[name]["postdrag"](frame, Pinpoint(frame)) + if (SV.MentaloFrames[name]["postdrag"] ~= nil and type(SV.MentaloFrames[name]["postdrag"]) == "function")then + SV.MentaloFrames[name]["postdrag"](frame, Pinpoint(frame)) end end end @@ -682,17 +682,17 @@ function SuperVillain:ResetMovables(request) end end -function SuperVillain:SetSVMovablesPositions() - for name, _ in pairs(SuperVillain.MentaloFrames)do +function SV:SetSVMovablesPositions() + for name, _ in pairs(SV.MentaloFrames)do local frame = _G[name]; local anchor1, parent, anchor2, x, y; if frame then - if (SuperVillain.db.framelocations and SuperVillain.db.framelocations[name] and type(SuperVillain.db.framelocations[name]) == "string") then - anchor1, parent, anchor2, x, y = split("\031", SuperVillain.db.framelocations[name]) + if (SV.db.framelocations and SV.db.framelocations[name] and type(SV.db.framelocations[name]) == "string") then + anchor1, parent, anchor2, x, y = split("\031", SV.db.framelocations[name]) frame:ClearAllPoints() frame:SetPoint(anchor1, parent, anchor2, x, y) - elseif SuperVillain.MentaloFrames[name]["point"] then - anchor1, parent, anchor2, x, y = split("\031", SuperVillain.MentaloFrames[name]["point"]) + elseif SV.MentaloFrames[name]["point"] then + anchor1, parent, anchor2, x, y = split("\031", SV.MentaloFrames[name]["point"]) frame:ClearAllPoints() frame:SetPoint(anchor1, parent, anchor2, x, y) end @@ -700,7 +700,7 @@ function SuperVillain:SetSVMovablesPositions() end end -function SuperVillain:LoadMovables() +function SV:LoadMovables() for name, _ in pairs(self.MentaloFrames)do local parent, text, overlay, snapoffset, postdrag; for key, value in pairs(self.MentaloFrames[name])do @@ -721,7 +721,7 @@ function SuperVillain:LoadMovables() end end -function SuperVillain:UseMentalo(isConfigMode, configType) +function SV:UseMentalo(isConfigMode, configType) if(InCombatLockdown()) then return end local enabled = false; if(isConfigMode ~= nil and isConfigMode ~= "") then @@ -754,7 +754,7 @@ function SuperVillain:UseMentalo(isConfigMode, configType) self:ToggleMovables(enabled, configType) end -function SuperVillain:MentaloFocus() +function SV:MentaloFocus() local frame = CurrentFrameTarget; local s, t, u = GrabUsableRegions() local v, w = frame:GetCenter() @@ -767,11 +767,11 @@ function SuperVillain:MentaloFocus() v = tonumber(SVUI_MentaloPrecisionSetX.CurrentValue) w = tonumber(SVUI_MentaloPrecisionSetY.CurrentValue) frame:ClearAllPoints() - frame:Point(x, SuperVillain.UIParent, x, v, w) - SuperVillain:SaveMovableLoc(frame.name) + frame:Point(x, SV.UIParent, x, v, w) + SV:SaveMovableLoc(frame.name) end -function SuperVillain:MentaloFocusUpdate(frame) +function SV:MentaloFocusUpdate(frame) local s, t, u = GrabUsableRegions() local v, w = frame:GetCenter() local y = (s / 3); @@ -788,16 +788,16 @@ function SuperVillain:MentaloFocusUpdate(frame) SVUI_MentaloPrecision.Title:SetText(frame.textString) end -function SuperVillain:MovableFocused() +function SV:MovableFocused() CurrentFrameTarget = self; - SuperVillain:MentaloFocusUpdate(self) + SV:MentaloFocusUpdate(self) end -function SuperVillain:SetMentaloAlphas() - hooksecurefunc(SuperVillain, "SetSVMovable", function(_, frame) +function SV:SetMentaloAlphas() + hooksecurefunc(SV, "SetSVMovable", function(_, frame) frame.Avatar:SetAlpha(0.5) end) - ghost(SuperVillain.MentaloFrames, 0.5) + ghost(SV.MentaloFrames, 0.5) end --[[ ########################################################## @@ -805,6 +805,8 @@ XML FRAME SCRIPT HANDLERS ########################################################## ]]-- function SVUI_MoveEventHandler_OnEvent() + if not SVUI_Cache then SVUI_Cache = {} end + if not SVUI_Cache["Mentalo"] then SVUI_Cache["Mentalo"] = {} end for _, frame in pairs(DraggableFrames)do if _G[frame] then if SVUI_Cache["Mentalo"][frame] == nil then @@ -847,7 +849,7 @@ function SVUI_MentaloEventHandler_Update(self) end SVUI_MentaloPrecision:ClearAllPoints() SVUI_MentaloPrecision:SetPoint(anchor1, frame, anchor2, 0, 0) - SuperVillain:MentaloFocusUpdate(frame) + SV:MentaloFocusUpdate(frame) end function SVUI_Mentalo_OnLoad() @@ -859,12 +861,12 @@ end function SVUI_Mentalo_OnEvent() if _G["SVUI_Mentalo"]:IsShown() then _G["SVUI_Mentalo"]:Hide() - SuperVillain:UseMentalo(true) + SV:UseMentalo(true) end end function SVUI_MentaloLockButton_OnClick() - SuperVillain:UseMentalo(true) + SV:UseMentalo(true) if IsAddOnLoaded("SVUI_ConfigOMatic")then LibStub("AceConfigDialog-3.0"):Open("SVUI") end @@ -872,7 +874,7 @@ end function SVUI_MentaloPrecisionResetButton_OnClick() local name = CurrentFrameTarget.name - SuperVillain:ResetMovables(name) + SV:ResetMovables(name) end function SVUI_MentaloPrecisionInput_EscapePressed(self) @@ -884,7 +886,7 @@ function SVUI_MentaloPrecisionInput_EnterPressed(self) local txt = tonumber(self:GetText()) if(txt) then self.CurrentValue = txt; - SuperVillain:MentaloFocus() + SV:MentaloFocus() end self:SetText(parsefloat(self.CurrentValue)) EditBox_ClearFocus(self) diff --git a/Interface/AddOns/SVUI/system/mentalo.xml b/Interface/AddOns/SVUI/system/mentalo.xml index 7598d26..57c4409 100644 --- a/Interface/AddOns/SVUI/system/mentalo.xml +++ b/Interface/AddOns/SVUI/system/mentalo.xml @@ -1,4 +1,6 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Script file="mentalo.lua"/> + <Frame name="SVUI_MoveEventHandler" hidden="true"> <Scripts> <OnLoad> diff --git a/Interface/AddOns/SVUI/system/presets.lua b/Interface/AddOns/SVUI/system/presets.lua deleted file mode 100644 index ab30e35..0000000 --- a/Interface/AddOns/SVUI/system/presets.lua +++ /dev/null @@ -1,1146 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -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; ---[[ -########################################################## -LOCALIZED GLOBALS -########################################################## -]]-- -local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS -local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SuperVillain, L = unpack(select(2, ...)); -local scc = SVUI_CLASS_COLORS[SuperVillain.class]; -local rcc = RAID_CLASS_COLORS[SuperVillain.class]; -local r2 = .1 + (rcc.r * .1) -local g2 = .1 + (rcc.g * .1) -local b2 = .1 + (rcc.b * .1) ---[[ -########################################################## -LAYOUT PRESETS -########################################################## -]]-- -local presets = { - ["media"] = { - ["link"] = "media", - ["default"] = { - ["colors"] = { - ["special"] = {.37, .32, .29, 1}, - }, - ["textures"] = { - ["pattern"] = "SVUI Backdrop 1", - ["comic"] = "SVUI Comic 1", - ["unitlarge"] = "SVUI Unit BG 1", - ["unitsmall"] = "SVUI Small BG 1", - }, - ["unitframes"] = { - ["buff_bars"] = {.91, .91, .31, 1}, - ["health"] = {.1, .6, .02, 1}, - ["casting"] = {.91, .91, .31, 1}, - ["spark"] = {1, .72, 0, 1}, - }, - }, - ["kaboom"] = { - ["colors"] = { - ["special"] = {.28, .31, .32, 1}, - }, - ["textures"] = { - ["pattern"] = "SVUI Backdrop 2", - ["comic"] = "SVUI Comic 2", - ["unitlarge"] = "SVUI Unit BG 2", - ["unitsmall"] = "SVUI Small BG 2", - }, - ["unitframes"] = { - ["buff_bars"] = {.51, .79, 0, 1}, - ["health"] = {.16, .86, .22, 1}, - ["casting"] = {.91, .91, 0, 1}, - ["spark"] = {1, .72, 0, 1}, - }, - }, - ["classy"] = { - ["colors"] = { - ["special"] = {r2, g2, b2, 1}, - }, - ["textures"] = { - ["pattern"] = "SVUI Backdrop 3", - ["comic"] = "SVUI Comic 3", - ["unitlarge"] = "SVUI Unit BG 3", - ["unitsmall"] = "SVUI Small BG 3", - }, - ["unitframes"] = { - ["buff_bars"] = {scc.r, scc.g, scc.b, 1}, - ["health"] = {.16, .86, .22, 1}, - ["casting"] = {.91, .91, 0, 1}, - ["spark"] = {1, .72, 0, 1}, - }, - }, - ["dark"] = { - ["colors"] = { - ["special"] = {.25, .26, .27, 1}, - }, - ["textures"] = { - ["pattern"] = "SVUI Backdrop 4", - ["comic"] = "SVUI Comic 4", - ["unitlarge"] = "SVUI Unit BG 4", - ["unitsmall"] = "SVUI Small BG 4", - }, - ["unitframes"] = { - ["buff_bars"] = {.45, .55, .15, 1}, - ["health"] = {.06, .06, .06, 1}, - ["casting"] = {.8, .8, 0, 1}, - ["spark"] = {1, .72, 0, 1}, - }, - }, - }, - ["auras"] = { - ["link"] = "SVUnit", - ["default"] = { - ["player"] = { - ["buffs"] = { - enable = false, - attachTo = "DEBUFFS", - anchorPoint = 'TOPLEFT', - verticalGrowth = 'UP', - horizontalGrowth = 'RIGHT', - }, - ["debuffs"] = { - enable = false, - attachTo = "FRAME", - anchorPoint = 'TOPLEFT', - verticalGrowth = 'UP', - horizontalGrowth = 'RIGHT', - }, - ["aurabar"] = { - enable = false - } - }, - ["target"] = { - ["smartAuraDisplay"] = "DISABLED", - ["buffs"] = { - enable = true, - attachTo = "FRAME", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["debuffs"] = { - enable = true, - attachTo = "BUFFS", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["aurabar"] = { - enable = false - } - }, - ["focus"] = { - ["smartAuraDisplay"] = "DISABLED", - ["buffs"] = { - enable = false, - attachTo = "FRAME", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["debuffs"] = { - enable = true, - attachTo = "FRAME", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["aurabar"] = { - enable = false - } - } - }, - ["icons"] = { - ["player"] = { - ["buffs"] = { - enable = true, - attachTo = "FRAME", - anchorPoint = 'TOPLEFT', - verticalGrowth = 'UP', - horizontalGrowth = 'RIGHT', - }, - ["debuffs"] = { - enable = true, - attachTo = "BUFFS", - anchorPoint = 'TOPLEFT', - verticalGrowth = 'UP', - horizontalGrowth = 'RIGHT', - }, - ["aurabar"] = { - enable = false - } - }, - ["target"] = { - ["smartAuraDisplay"] = "DISABLED", - ["buffs"] = { - enable = true, - attachTo = "FRAME", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["debuffs"] = { - enable = true, - attachTo = "BUFFS", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["aurabar"] = { - enable = false - } - }, - ["focus"] = { - ["smartAuraDisplay"] = "DISABLED", - ["buffs"] = { - enable = false, - attachTo = "FRAME", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["debuffs"] = { - enable = true, - attachTo = "FRAME", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["aurabar"] = { - enable = false - } - } - }, - ["bars"] = { - ["player"] = { - ["buffs"] = { - enable = false, - attachTo = "FRAME" - }, - ["debuffs"] = { - enable = false, - attachTo = "FRAME" - }, - ["aurabar"] = { - enable = true, - attachTo = "FRAME" - } - }, - ["target"] = { - ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", - ["buffs"] = { - enable = false, - attachTo = "FRAME" - }, - ["debuffs"] = { - enable = false, - attachTo = "FRAME" - }, - ["aurabar"] = { - enable = true, - attachTo = "FRAME" - } - }, - ["focus"] = { - ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", - ["buffs"] = { - enable = false, - attachTo = "FRAME" - }, - ["debuffs"] = { - enable = false, - attachTo = "FRAME" - }, - ["aurabar"] = { - enable = true, - attachTo = "FRAME" - } - } - }, - ["theworks"] = { - ["player"] = { - ["buffs"] = { - enable = true, - attachTo = "FRAME", - anchorPoint = 'TOPLEFT', - verticalGrowth = 'UP', - horizontalGrowth = 'RIGHT', - }, - ["debuffs"] = { - enable = true, - attachTo = "BUFFS", - anchorPoint = 'TOPLEFT', - verticalGrowth = 'UP', - horizontalGrowth = 'RIGHT', - }, - ["aurabar"] = { - enable = true, - attachTo = "DEBUFFS" - } - }, - ["target"] = { - ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", - ["buffs"] = { - enable = true, - attachTo = "FRAME", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["debuffs"] = { - enable = true, - attachTo = "BUFFS", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["aurabar"] = { - enable = true, - attachTo = "DEBUFFS" - } - }, - ["focus"] = { - ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", - ["buffs"] = { - enable = true, - attachTo = "FRAME", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["debuffs"] = { - enable = true, - attachTo = "BUFFS", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["aurabar"] = { - enable = true, - attachTo = "DEBUFFS" - } - } - }, - }, - ["bars"] = { - ["link"] = "SVBar", - ["default"] = { - ["Bar1"] = { - buttonsize = 32 - }, - ["Bar2"] = { - enable = false - }, - ["Bar3"] = { - buttons = 6, - buttonspacing = 2, - buttonsPerRow = 6, - buttonsize = 32 - }, - ["Bar5"] = { - buttons = 6, - buttonspacing = 2, - buttonsPerRow = 6, - buttonsize = 32 - } - }, - ["onebig"] = { - ["Bar1"] = { - buttonsize = 40 - }, - ["Bar2"] = { - enable = false - }, - ["Bar3"] = { - buttons = 6, - buttonspacing = 2, - buttonsPerRow = 6, - buttonsize = 40 - }, - ["Bar5"] = { - buttons = 6, - buttonspacing = 2, - buttonsPerRow = 6, - buttonsize = 40 - } - }, - ["twosmall"] = { - ["Bar1"] = { - buttonsize = 32 - }, - ["Bar2"] = { - enable = true, - buttonsize = 32 - }, - ["Bar3"] = { - buttons = 12, - buttonspacing = 2, - buttonsPerRow = 6, - buttonsize = 32 - }, - ["Bar5"] = { - buttons = 12, - buttonspacing = 2, - buttonsPerRow = 6, - buttonsize = 32 - } - }, - ["twobig"] = { - ["Bar1"] = { - buttonsize = 40 - }, - ["Bar2"] = { - enable = true, - buttonsize = 40 - }, - ["Bar3"] = { - buttons = 12, - buttonspacing = 2, - buttonsPerRow = 6, - buttonsize = 40 - }, - ["Bar5"] = { - buttons = 12, - buttonspacing = 2, - buttonsPerRow = 6, - buttonsize = 40 - } - }, - }, - ["units"] = { - ["link"] = "SVUnit", - ["default"] = { - ["player"] = { - width = 215, - height = 60, - portrait = { - enable = true, - overlay = true, - style = "3D", - } - }, - ["target"] = { - width = 215, - height = 60, - portrait = { - enable = true, - overlay = true, - style = "3D", - } - }, - ["pet"] = { - width = 130, - height = 30, - portrait = { - enable = true, - overlay = true, - style = "3D", - }, - name = { - position = "CENTER" - }, - }, - ["targettarget"] = { - width = 130, - height = 30, - portrait = { - enable = true, - overlay = true, - style = "3D", - }, - name = { - position = "CENTER" - }, - }, - ["boss"] = { - width = 200, - height = 45, - portrait = { - enable = true, - overlay = true, - style = "3D", - } - }, - ["party"] = { - width = 75, - height = 60, - wrapXOffset = 9, - wrapYOffset = 13, - portrait = { - enable = true, - overlay = true, - style = "3D", - }, - name = { - position = "INNERTOPLEFT" - }, - }, - ["raid10"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid25"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid40"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - }, - ["super"] = { - ["player"] = { - width = 215, - height = 60, - portrait = { - enable = true, - overlay = true, - style = "3D", - } - }, - ["target"] = { - width = 215, - height = 60, - portrait = { - enable = true, - overlay = true, - style = "3D", - } - }, - ["pet"] = { - width = 150, - height = 30, - portrait = { - enable = true, - overlay = true, - style = "3D", - }, - name = { - position = "CENTER" - }, - }, - ["targettarget"] = { - width = 150, - height = 30, - portrait = { - enable = true, - overlay = true, - style = "3D", - }, - name = { - position = "CENTER" - }, - }, - ["boss"] = { - width = 200, - height = 45, - portrait = { - enable = true, - overlay = true, - style = "3D", - } - }, - ["party"] = { - width = 75, - height = 60, - wrapXOffset = 9, - wrapYOffset = 13, - portrait = { - enable = true, - overlay = true, - style = "3D", - }, - name = { - position = "INNERTOPLEFT" - }, - }, - ["raid10"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid25"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid40"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - }, - ["simple"] = { - ["player"] = { - width = 215, - height = 60, - portrait = { - enable = true, - overlay = false, - style = "2D", - width = 60, - } - }, - ["target"] = { - width = 215, - height = 60, - portrait = { - enable = true, - overlay = false, - style = "2D", - width = 60, - } - }, - ["pet"] = { - width = 150, - height = 30, - portrait = { - enable = true, - overlay = false, - style = "2D", - width = 30, - }, - name = { - position = "INNERLEFT" - }, - }, - ["targettarget"] = { - width = 150, - height = 30, - portrait = { - enable = true, - overlay = false, - style = "2D", - width = 30, - }, - name = { - position = "INNERLEFT" - }, - }, - ["boss"] = { - width = 200, - height = 45, - portrait = { - enable = true, - overlay = false, - style = "2D", - width = 45, - } - }, - ["party"] = { - width = 100, - height = 35, - wrapXOffset = 9, - wrapYOffset = 13, - portrait = { - enable = true, - overlay = false, - style = "2D", - width = 35, - }, - name = { - position = "INNERRIGHT" - }, - }, - ["raid10"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid25"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid40"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - }, - ["compact"] = { - ["player"] = { - width = 215, - height = 50, - portrait = { - enable = false - } - }, - ["target"] = { - width = 215, - height = 50, - portrait = { - enable = false - } - }, - ["pet"] = { - width = 130, - height = 30, - portrait = { - enable = false - }, - name = { - position = "CENTER" - }, - }, - ["targettarget"] = { - width = 130, - height = 30, - portrait = { - enable = false - }, - name = { - position = "CENTER" - }, - }, - ["boss"] = { - width = 200, - height = 45, - portrait = { - enable = false - } - }, - ["party"] = { - width = 70, - height = 30, - wrapXOffset = 9, - wrapYOffset = 13, - portrait = { - enable = false - }, - name = { - position = "INNERTOPLEFT" - }, - }, - ["raid10"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid25"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid40"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - }, - }, - ["layouts"] = { - ["link"] = "SVUnit", - ["default"] = { - ["grid"] = { - ["enable"] = false, - }, - ["party"] = { - width = 75, - height = 60, - wrapXOffset = 9, - wrapYOffset = 13, - portrait = { - enable = true, - overlay = true, - style = "3D", - }, - icons = { - roleIcon = { - ["attachTo"] = "INNERBOTTOMRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - }, - name = { - ["font"] = "SVUI Default Font", - ["fontOutline"] = "OUTLINE", - ["position"] = "INNERTOPLEFT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - }, - ["raid10"] = { - width = 50, - height = 30, - gRowCol = 1, - wrapXOffset = 9, - wrapYOffset = 13, - showBy = "RIGHT_DOWN", - ["power"] = { - ["enable"] = false, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 1, - }, - }, - ["name"] = { - ["font"] = "SVUI Default Font", - ["position"] = "INNERTOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - ["raid25"] = { - width = 50, - height = 30, - gRowCol = 1, - wrapXOffset = 9, - wrapYOffset = 13, - showBy = "RIGHT_DOWN", - ["power"] = { - ["enable"] = false, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 1, - }, - }, - ["name"] = { - ["font"] = "SVUI Default Font", - ["position"] = "INNERTOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - ["raid40"] = { - width = 50, - height = 30, - gRowCol = 1, - wrapXOffset = 9, - wrapYOffset = 13, - showBy = "RIGHT_DOWN", - ["power"] = { - ["enable"] = false, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 1, - }, - }, - ["name"] = { - ["font"] = "SVUI Default Font", - ["position"] = "INNERTOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - }, - ["healer"] = { - ["grid"] = { - ["enable"] = false, - }, - ["party"] = { - width = 75, - height = 60, - wrapXOffset = 9, - wrapYOffset = 13, - portrait = { - enable = true, - overlay = true, - style = "3D", - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERBOTTOMRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - }, - ["name"] = { - ["font"] = "SVUI Default Font", - ["fontOutline"] = "OUTLINE", - ["position"] = "INNERTOPLEFT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - }, - ["raid10"] = { - width = 50, - height = 30, - ["showBy"] = "DOWN_RIGHT", - ["gRowCol"] = 1, - ["wrapXOffset"] = 4, - ["wrapYOffset"] = 4, - ["power"] = { - ["enable"] = true, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - ["name"] = { - ["font"] = "SVUI Default Font", - ["position"] = "INNERTOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - ["raid25"] = { - width = 50, - height = 30, - ["showBy"] = "DOWN_RIGHT", - ["gRowCol"] = 1, - ["wrapXOffset"] = 4, - ["wrapYOffset"] = 4, - ["power"] = { - ["enable"] = true, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - ["name"] = { - ["font"] = "SVUI Default Font", - ["position"] = "INNERTOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - ["raid40"] = { - width = 50, - height = 30, - ["showBy"] = "DOWN_RIGHT", - ["gRowCol"] = 1, - ["wrapXOffset"] = 4, - ["wrapYOffset"] = 4, - ["power"] = { - ["enable"] = true, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - ["name"] = { - ["font"] = "SVUI Default Font", - ["position"] = "INNERTOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - }, - ["dps"] = { - ["grid"] = { - ["enable"] = false, - }, - ["party"] = { - width = 115, - height = 25, - wrapXOffset = 9, - wrapYOffset = 13, - ["power"] = { - ["enable"] = false, - }, - portrait = { - enable = false, - overlay = false, - style = "2D", - width = 35, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "LEFT", - ["xOffset"] = -2, - ["yOffset"] = 0, - }, - }, - ["name"] = { - ["font"] = "Roboto", - ["fontOutline"] = "NONE", - ["position"] = "CENTER", - ["xOffset"] = 0, - ["yOffset"] = 1, - }, - }, - ["raid10"] = { - ["showBy"] = "UP_RIGHT", - ["gRowCol"] = 2, - ["wrapXOffset"] = 4, - ["wrapYOffset"] = 4, - ["power"] = { - ["enable"] = false, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERLEFT", - ["xOffset"] = 10, - ["yOffset"] = 1, - }, - }, - ["name"] = { - ["font"] = "Roboto", - ["position"] = "CENTER", - ["xOffset"] = 0, - ["yOffset"] = 1, - }, - ["width"] = 80, - ["height"] = 20, - }, - ["raid25"] = { - ["showBy"] = "UP_RIGHT", - ["gRowCol"] = 3, - ["wrapXOffset"] = 4, - ["wrapYOffset"] = 4, - ["power"] = { - ["enable"] = false, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERLEFT", - ["xOffset"] = 10, - ["yOffset"] = 1, - }, - }, - ["name"] = { - ["font"] = "Roboto", - ["position"] = "CENTER", - ["xOffset"] = 0, - ["yOffset"] = 1, - }, - ["width"] = 80, - ["height"] = 20, - }, - ["raid40"] = { - ["showBy"] = "UP_RIGHT", - ["gRowCol"] = 4, - ["wrapXOffset"] = 4, - ["wrapYOffset"] = 4, - ["power"] = { - ["enable"] = false, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERLEFT", - ["xOffset"] = 10, - ["yOffset"] = 1, - }, - }, - ["name"] = { - ["font"] = "Roboto", - ["position"] = "CENTER", - ["xOffset"] = 0, - ["yOffset"] = 1, - }, - ["width"] = 80, - ["height"] = 20, - }, - }, - ["grid"] = { - ["grid"] = { - ["enable"] = true, - ["size"] = 34, - ["shownames"] = true, - }, - ["party"] = { - ["gridAllowed"] = true, - ["wrapXOffset"] = 1, - ["wrapYOffset"] = 1, - }, - ["raid10"] = { - ["gridAllowed"] = true, - ["wrapXOffset"] = 1, - ["wrapYOffset"] = 1, - ["gRowCol"] = 1, - ["showBy"] = "RIGHT_DOWN", - }, - ["raid25"] = { - ["gridAllowed"] = true, - ["wrapXOffset"] = 1, - ["wrapYOffset"] = 1, - ["gRowCol"] = 1, - ["showBy"] = "RIGHT_DOWN", - }, - ["raid40"] = { - ["gridAllowed"] = true, - ["wrapXOffset"] = 1, - ["wrapYOffset"] = 1, - ["gRowCol"] = 1, - ["showBy"] = "RIGHT_DOWN", - }, - }, - } -}; - -local function CopyLayout(saved, preset) - if(type(preset) == 'table') then - for key,val in pairs(preset) do - if(not saved[key]) then saved[key] = {} end - if(type(val) == "table") then - CopyLayout(saved[key], val) - elseif(saved[key]) then - saved[key] = val - end - end - else - saved = preset - end -end - -function SuperVillain:LoadPresetData(category, theme) - if(presets[category] and presets[category]["link"]) then - theme = theme or "default" - local saved = presets[category]["link"] - local preset = presets[category][theme] - CopyLayout(SuperVillain.db[saved], preset) - end -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/setup.lua b/Interface/AddOns/SVUI/system/setup.lua new file mode 100644 index 0000000..e2a66a5 --- /dev/null +++ b/Interface/AddOns/SVUI/system/setup.lua @@ -0,0 +1,2405 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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 type = _G.type; +local string = _G.string; +local table = _G.table; +local format = string.format; +local tcopy = table.copy; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV, L, Registry = unpack(select(2, ...)); +--[[ +########################################################## +LOCAL VARS +########################################################## +]]-- +local CURRENT_PAGE, MAX_PAGE, XOFF = 0, 9, (GetScreenWidth() * 0.025) +local okToResetMOVE = false +local mungs = false; +local user_music_vol; +local musicIsPlaying; + +local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS +local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS +local scc = SVUI_CLASS_COLORS[SV.class]; +local rcc = RAID_CLASS_COLORS[SV.class]; +local r2 = .1 + (rcc.r * .1) +local g2 = .1 + (rcc.g * .1) +local b2 = .1 + (rcc.b * .1) +--[[ +########################################################## +SETUP CLASS OBJECT +########################################################## +]]-- +local Setup = {}; +--[[ +########################################################## +LAYOUT PRESETS +########################################################## +]]-- +local PRESET_DATA; + +local function LoadAllPresets() + PRESET_DATA = {} + + PRESET_DATA["media"] = { + ["link"] = "media", + ["default"] = { + ["colors"] = { + ["special"] = {.37, .32, .29, 1}, + }, + ["textures"] = { + ["pattern"] = "SVUI Backdrop 1", + ["comic"] = "SVUI Comic 1", + ["unitlarge"] = "SVUI Unit BG 1", + ["unitsmall"] = "SVUI Small BG 1", + }, + ["unitframes"] = { + ["buff_bars"] = {.91, .91, .31, 1}, + ["health"] = {.1, .6, .02, 1}, + ["casting"] = {.91, .91, .31, 1}, + ["spark"] = {1, .72, 0, 1}, + }, + }, + ["kaboom"] = { + ["colors"] = { + ["special"] = {.28, .31, .32, 1}, + }, + ["textures"] = { + ["pattern"] = "SVUI Backdrop 2", + ["comic"] = "SVUI Comic 2", + ["unitlarge"] = "SVUI Unit BG 2", + ["unitsmall"] = "SVUI Small BG 2", + }, + ["unitframes"] = { + ["buff_bars"] = {.51, .79, 0, 1}, + ["health"] = {.16, .86, .22, 1}, + ["casting"] = {.91, .91, 0, 1}, + ["spark"] = {1, .72, 0, 1}, + }, + }, + ["classy"] = { + ["colors"] = { + ["special"] = {r2, g2, b2, 1}, + }, + ["textures"] = { + ["pattern"] = "SVUI Backdrop 3", + ["comic"] = "SVUI Comic 3", + ["unitlarge"] = "SVUI Unit BG 3", + ["unitsmall"] = "SVUI Small BG 3", + }, + ["unitframes"] = { + ["buff_bars"] = {scc.r, scc.g, scc.b, 1}, + ["health"] = {.16, .86, .22, 1}, + ["casting"] = {.91, .91, 0, 1}, + ["spark"] = {1, .72, 0, 1}, + }, + }, + ["dark"] = { + ["colors"] = { + ["special"] = {.25, .26, .27, 1}, + }, + ["textures"] = { + ["pattern"] = "SVUI Backdrop 4", + ["comic"] = "SVUI Comic 4", + ["unitlarge"] = "SVUI Unit BG 4", + ["unitsmall"] = "SVUI Small BG 4", + }, + ["unitframes"] = { + ["buff_bars"] = {.45, .55, .15, 1}, + ["health"] = {.06, .06, .06, 1}, + ["casting"] = {.8, .8, 0, 1}, + ["spark"] = {1, .72, 0, 1}, + }, + }, + } + PRESET_DATA["auras"] = { + ["link"] = "SVUnit", + ["default"] = { + ["player"] = { + ["buffs"] = { + enable = false, + attachTo = "DEBUFFS", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["debuffs"] = { + enable = false, + attachTo = "FRAME", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["aurabar"] = { + enable = false + } + }, + ["target"] = { + ["smartAuraDisplay"] = "DISABLED", + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = false + } + }, + ["focus"] = { + ["smartAuraDisplay"] = "DISABLED", + ["buffs"] = { + enable = false, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = false + } + } + }, + ["icons"] = { + ["player"] = { + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["aurabar"] = { + enable = false + } + }, + ["target"] = { + ["smartAuraDisplay"] = "DISABLED", + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = false + } + }, + ["focus"] = { + ["smartAuraDisplay"] = "DISABLED", + ["buffs"] = { + enable = false, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = false + } + } + }, + ["bars"] = { + ["player"] = { + ["buffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["debuffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["aurabar"] = { + enable = true, + attachTo = "FRAME" + } + }, + ["target"] = { + ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", + ["buffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["debuffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["aurabar"] = { + enable = true, + attachTo = "FRAME" + } + }, + ["focus"] = { + ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", + ["buffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["debuffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["aurabar"] = { + enable = true, + attachTo = "FRAME" + } + } + }, + ["theworks"] = { + ["player"] = { + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["aurabar"] = { + enable = true, + attachTo = "DEBUFFS" + } + }, + ["target"] = { + ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = true, + attachTo = "DEBUFFS" + } + }, + ["focus"] = { + ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = true, + attachTo = "DEBUFFS" + } + } + }, + } + PRESET_DATA["bars"] = { + ["link"] = "SVBar", + ["default"] = { + ["Bar1"] = { + buttonsize = 32 + }, + ["Bar2"] = { + enable = false + }, + ["Bar3"] = { + buttons = 6, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 32 + }, + ["Bar5"] = { + buttons = 6, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 32 + } + }, + ["onebig"] = { + ["Bar1"] = { + buttonsize = 40 + }, + ["Bar2"] = { + enable = false + }, + ["Bar3"] = { + buttons = 6, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 40 + }, + ["Bar5"] = { + buttons = 6, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 40 + } + }, + ["twosmall"] = { + ["Bar1"] = { + buttonsize = 32 + }, + ["Bar2"] = { + enable = true, + buttonsize = 32 + }, + ["Bar3"] = { + buttons = 12, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 32 + }, + ["Bar5"] = { + buttons = 12, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 32 + } + }, + ["twobig"] = { + ["Bar1"] = { + buttonsize = 40 + }, + ["Bar2"] = { + enable = true, + buttonsize = 40 + }, + ["Bar3"] = { + buttons = 12, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 40 + }, + ["Bar5"] = { + buttons = 12, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 40 + } + }, + } + PRESET_DATA["units"] = { + ["link"] = "SVUnit", + ["default"] = { + ["player"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["target"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["pet"] = { + width = 130, + height = 30, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "CENTER" + }, + }, + ["targettarget"] = { + width = 130, + height = 30, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "CENTER" + }, + }, + ["boss"] = { + width = 200, + height = 45, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["party"] = { + width = 75, + height = 60, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "INNERTOPLEFT" + }, + }, + ["raid10"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid25"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid40"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + }, + ["super"] = { + ["player"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["target"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["pet"] = { + width = 150, + height = 30, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "CENTER" + }, + }, + ["targettarget"] = { + width = 150, + height = 30, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "CENTER" + }, + }, + ["boss"] = { + width = 200, + height = 45, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["party"] = { + width = 75, + height = 60, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "INNERTOPLEFT" + }, + }, + ["raid10"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid25"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid40"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + }, + ["simple"] = { + ["player"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 60, + } + }, + ["target"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 60, + } + }, + ["pet"] = { + width = 150, + height = 30, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 30, + }, + name = { + position = "INNERLEFT" + }, + }, + ["targettarget"] = { + width = 150, + height = 30, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 30, + }, + name = { + position = "INNERLEFT" + }, + }, + ["boss"] = { + width = 200, + height = 45, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 45, + } + }, + ["party"] = { + width = 100, + height = 35, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 35, + }, + name = { + position = "INNERRIGHT" + }, + }, + ["raid10"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid25"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid40"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + }, + ["compact"] = { + ["player"] = { + width = 215, + height = 50, + portrait = { + enable = false + } + }, + ["target"] = { + width = 215, + height = 50, + portrait = { + enable = false + } + }, + ["pet"] = { + width = 130, + height = 30, + portrait = { + enable = false + }, + name = { + position = "CENTER" + }, + }, + ["targettarget"] = { + width = 130, + height = 30, + portrait = { + enable = false + }, + name = { + position = "CENTER" + }, + }, + ["boss"] = { + width = 200, + height = 45, + portrait = { + enable = false + } + }, + ["party"] = { + width = 70, + height = 30, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = false + }, + name = { + position = "INNERTOPLEFT" + }, + }, + ["raid10"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid25"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid40"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + }, + } + PRESET_DATA["layouts"] = { + ["link"] = "SVUnit", + ["default"] = { + ["grid"] = { + ["enable"] = false, + }, + ["party"] = { + width = 75, + height = 60, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + icons = { + roleIcon = { + ["attachTo"] = "INNERBOTTOMRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + name = { + ["font"] = "SVUI Default Font", + ["fontOutline"] = "OUTLINE", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + ["raid10"] = { + width = 50, + height = 30, + gRowCol = 1, + wrapXOffset = 9, + wrapYOffset = 13, + showBy = "RIGHT_DOWN", + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid25"] = { + width = 50, + height = 30, + gRowCol = 1, + wrapXOffset = 9, + wrapYOffset = 13, + showBy = "RIGHT_DOWN", + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid40"] = { + width = 50, + height = 30, + gRowCol = 1, + wrapXOffset = 9, + wrapYOffset = 13, + showBy = "RIGHT_DOWN", + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + }, + ["healer"] = { + ["grid"] = { + ["enable"] = false, + }, + ["party"] = { + width = 75, + height = 60, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["fontOutline"] = "OUTLINE", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + ["raid10"] = { + width = 50, + height = 30, + ["showBy"] = "DOWN_RIGHT", + ["gRowCol"] = 1, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = true, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid25"] = { + width = 50, + height = 30, + ["showBy"] = "DOWN_RIGHT", + ["gRowCol"] = 1, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = true, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid40"] = { + width = 50, + height = 30, + ["showBy"] = "DOWN_RIGHT", + ["gRowCol"] = 1, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = true, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + }, + ["dps"] = { + ["grid"] = { + ["enable"] = false, + }, + ["party"] = { + width = 115, + height = 25, + wrapXOffset = 9, + wrapYOffset = 13, + ["power"] = { + ["enable"] = false, + }, + portrait = { + enable = false, + overlay = false, + style = "2D", + width = 35, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "LEFT", + ["xOffset"] = -2, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["fontOutline"] = "NONE", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + }, + ["raid10"] = { + ["showBy"] = "UP_RIGHT", + ["gRowCol"] = 2, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 10, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + ["width"] = 80, + ["height"] = 20, + }, + ["raid25"] = { + ["showBy"] = "UP_RIGHT", + ["gRowCol"] = 3, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 10, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + ["width"] = 80, + ["height"] = 20, + }, + ["raid40"] = { + ["showBy"] = "UP_RIGHT", + ["gRowCol"] = 4, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 10, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + ["width"] = 80, + ["height"] = 20, + }, + }, + ["grid"] = { + ["grid"] = { + ["enable"] = true, + ["size"] = 34, + ["shownames"] = true, + }, + ["party"] = { + ["gridAllowed"] = true, + ["wrapXOffset"] = 1, + ["wrapYOffset"] = 1, + }, + ["raid10"] = { + ["gridAllowed"] = true, + ["wrapXOffset"] = 1, + ["wrapYOffset"] = 1, + ["gRowCol"] = 1, + ["showBy"] = "RIGHT_DOWN", + }, + ["raid25"] = { + ["gridAllowed"] = true, + ["wrapXOffset"] = 1, + ["wrapYOffset"] = 1, + ["gRowCol"] = 1, + ["showBy"] = "RIGHT_DOWN", + }, + ["raid40"] = { + ["gridAllowed"] = true, + ["wrapXOffset"] = 1, + ["wrapYOffset"] = 1, + ["gRowCol"] = 1, + ["showBy"] = "RIGHT_DOWN", + }, + }, + } +end + +local function _copyPresets(saved, preset) + if(type(preset) == 'table') then + for key,val in pairs(preset) do + if(not saved[key]) then saved[key] = {} end + if(type(val) == "table") then + _copyPresets(saved[key], val) + elseif(saved[key]) then + saved[key] = val + end + end + else + saved = preset + end +end +--[[ +########################################################## +LOCAL FUNCTIONS +########################################################## +]]-- +local function SetInstallButton(button) + if(not button) then return end + button.Left:SetAlpha(0) + button.Middle:SetAlpha(0) + button.Right:SetAlpha(0) + button:SetNormalTexture("") + button:SetPushedTexture("") + button:SetPushedTexture("") + button:SetDisabledTexture("") + button:RemoveTextures() + button:SetFrameLevel(button:GetFrameLevel() + 1) +end + +local function forceCVars() + SetCVar("alternateResourceText",1) + SetCVar("statusTextDisplay","BOTH") + SetCVar("ShowClassColorInNameplate",1) + SetCVar("screenshotQuality",10) + SetCVar("chatMouseScroll",1) + SetCVar("chatStyle","classic") + SetCVar("WholeChatWindowClickable",0) + SetCVar("ConversationMode","inline") + SetCVar("showTutorials",0) + SetCVar("UberTooltips",1) + SetCVar("threatWarning",3) + SetCVar('alwaysShowActionBars',1) + SetCVar('lockActionBars',1) + SetCVar('SpamFilter',0) + InterfaceOptionsActionBarsPanelPickupActionKeyDropDown:SetValue('SHIFT') + InterfaceOptionsActionBarsPanelPickupActionKeyDropDown:RefreshValue() +end + +local function ShowLayout(show40) + if(not _G["SVUI_Raid40"] or (show40 and _G["SVUI_Raid40"].forceShow == true)) then return end + if(not show40 and _G["SVUI_Raid40"].forceShow ~= true) then return end + SV.SVUnit:UpdateGroupConfig(_G["SVUI_Raid40"], show40) +end + +local function BarShuffle() + local bar2 = SV.db.SVBar.Bar2.enable; + local base = 30; + local bS = SV.db.SVBar.Bar1.buttonspacing; + local tH = SV.db.SVBar.Bar1.buttonsize + (base - bS); + local b2h = bar2 and tH or base; + local sph = (400 - b2h); + if not SV.db.framelocations then SV.db.framelocations = {} end + SV.db.framelocations.SVUI_SpecialAbility_MOVE = "BOTTOMSVUIParentBOTTOM0"..sph; + SV.db.framelocations.SVUI_ActionBar2_MOVE = "BOTTOMSVUI_ActionBar1TOP0"..(-bS); + SV.db.framelocations.SVUI_ActionBar3_MOVE = "BOTTOMLEFTSVUI_ActionBar1BOTTOMRIGHT40"; + SV.db.framelocations.SVUI_ActionBar5_MOVE = "BOTTOMRIGHTSVUI_ActionBar1BOTTOMLEFT-40"; + if bar2 then + SV.db.framelocations.SVUI_PetActionBar_MOVE = "BOTTOMLEFTSVUI_ActionBar2TOPLEFT04" + SV.db.framelocations.SVUI_StanceBar_MOVE = "BOTTOMRIGHTSVUI_ActionBar2TOPRIGHT04"; + else + SV.db.framelocations.SVUI_PetActionBar_MOVE = "BOTTOMLEFTSVUI_ActionBar1TOPLEFT04" + SV.db.framelocations.SVUI_StanceBar_MOVE = "BOTTOMRIGHTSVUI_ActionBar1TOPRIGHT04"; + end +end + +local function UFMoveBottomQuadrant(toggle) + if not SV.db.framelocations then SV.db.framelocations = {} end + if not toggle then + SV.db.framelocations.SVUI_Player_MOVE = "BOTTOMSVUIParentBOTTOM-278182" + SV.db.framelocations.SVUI_PlayerCastbar_MOVE = "BOTTOMSVUIParentBOTTOM-278122" + SV.db.framelocations.SVUI_Target_MOVE = "BOTTOMSVUIParentBOTTOM278182" + SV.db.framelocations.SVUI_TargetCastbar_MOVE = "BOTTOMSVUIParentBOTTOM278122" + SV.db.framelocations.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM0181" + SV.db.framelocations.SVUI_TargetTarget_MOVE = "BOTTOMSVUIParentBOTTOM0214" + SV.db.framelocations.SVUI_Focus_MOVE = "BOTTOMSVUIParentBOTTOM310432" + SV.db.framelocations.SVUI_ThreatBar_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-495182" + elseif toggle == "shift" then + SV.db.framelocations.SVUI_Player_MOVE = "BOTTOMSVUIParentBOTTOM-278210" + SV.db.framelocations.SVUI_PlayerCastbar_MOVE = "BOTTOMSVUIParentBOTTOM-278150" + SV.db.framelocations.SVUI_Target_MOVE = "BOTTOMSVUIParentBOTTOM278210" + SV.db.framelocations.SVUI_TargetCastbar_MOVE = "BOTTOMSVUIParentBOTTOM278150" + SV.db.framelocations.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM0209" + SV.db.framelocations.SVUI_TargetTarget_MOVE = "BOTTOMSVUIParentBOTTOM0242" + SV.db.framelocations.SVUI_Focus_MOVE = "BOTTOMSVUIParentBOTTOM310432" + SV.db.framelocations.SVUI_ThreatBar_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-495210" + else + local c = 136; + local d = 135; + local e = 80; + SV.db.framelocations.SVUI_Player_MOVE = "BOTTOMSVUIParentBOTTOM"..-c..""..d; + SV.db.framelocations.SVUI_PlayerCastbar_MOVE = "BOTTOMSVUIParentBOTTOM"..-c..""..(d-60); + SV.db.framelocations.SVUI_Target_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..d; + SV.db.framelocations.SVUI_TargetCastbar_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..(d-60); + SV.db.framelocations.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM"..-c..""..e; + SV.db.framelocations.SVUI_TargetTarget_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..e; + SV.db.framelocations.SVUI_Focus_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..(d + 150); + SV.db.framelocations.SVUI_ThreatBar_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-495"..d; + end +end + +local function UFMoveLeftQuadrant(toggle) + if not SV.db.framelocations then SV.db.framelocations = {} end + if not toggle then + SV.db.framelocations.SVUI_Assist_MOVE = "TOPLEFTSVUIParentTOPLEFT"..XOFF.."-250" + SV.db.framelocations.SVUI_Tank_MOVE = "TOPLEFTSVUIParentTOPLEFT"..XOFF.."-175" + SV.db.framelocations.SVUI_Raidpet_MOVE = "TOPLEFTSVUIParentTOPLEFT"..XOFF.."-325" + SV.db.framelocations.SVUI_Party_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" + SV.db.framelocations.SVUI_Raid10_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" + SV.db.framelocations.SVUI_Raid25_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" + SV.db.framelocations.SVUI_Raid40_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" + else + SV.db.framelocations.SVUI_Assist_MOVE = "TOPLEFTSVUIParentTOPLEFT4-250" + SV.db.framelocations.SVUI_Tank_MOVE = "TOPLEFTSVUIParentTOPLEFT4-175" + SV.db.framelocations.SVUI_Raidpet_MOVE = "TOPLEFTSVUIParentTOPLEFT4-325" + SV.db.framelocations.SVUI_Party_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" + SV.db.framelocations.SVUI_Raid40_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" + SV.db.framelocations.SVUI_Raid10_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" + SV.db.framelocations.SVUI_Raid25_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" + end +end + +local function UFMoveTopQuadrant(toggle) + if not SV.db.framelocations then SV.db.framelocations = {} end + if not toggle then + SV.db.framelocations.GM_MOVE = "TOPLEFTSVUIParentTOPLEFT250-25" + SV.db.framelocations.SVUI_LootFrame_MOVE = "BOTTOMSVUIParentBOTTOM0350" + SV.db.framelocations.SVUI_AltPowerBar_MOVE = "TOPSVUIParentTOP0-40" + SV.db.framelocations.LoC_MOVE = "BOTTOMSVUIParentBOTTOM0350" + SV.db.framelocations.BNET_MOVE = "TOPRIGHTSVUIParentTOPRIGHT-4-250" + else + SV.db.framelocations.GM_MOVE = "TOPLEFTSVUIParentTOPLEFT344-25" + SV.db.framelocations.SVUI_LootFrame_MOVE = "BOTTOMSVUIParentBOTTOM0254" + SV.db.framelocations.SVUI_AltPowerBar_MOVE = "TOPSVUIParentTOP0-39" + SV.db.framelocations.LoC_MOVE = "BOTTOMSVUIParentBOTTOM0443" + SV.db.framelocations.BNET_MOVE = "TOPRIGHTSVUIParentTOPRIGHT-4-248" + end +end + +local function UFMoveRightQuadrant(toggle) + if not SV.db.framelocations then SV.db.framelocations = {} end + local dH = SV.db.SVDock.dockRightHeight + 60 + if not toggle or toggle == "high" then + SV.db.framelocations.SVUI_BossHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" + SV.db.framelocations.SVUI_ArenaHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" + SV.db.framelocations.Tooltip_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-284"..dH; + else + SV.db.framelocations.SVUI_BossHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" + SV.db.framelocations.SVUI_ArenaHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" + SV.db.framelocations.Tooltip_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-284"..dH; + end +end + +local function InitializeChatFrames(mungs) + forceCVars() + FCF_ResetChatWindows() + FCF_SetLocked(ChatFrame1, 1) + FCF_DockFrame(ChatFrame2) + FCF_SetLocked(ChatFrame2, 1) + FCF_OpenNewWindow(LOOT) + FCF_DockFrame(ChatFrame3) + FCF_SetLocked(ChatFrame3, 1) + for i = 1, NUM_CHAT_WINDOWS do + local chat = _G["ChatFrame"..i] + local chatID = chat:GetID() + if i == 1 then + chat:ClearAllPoints() + chat:Point("BOTTOMLEFT", LeftSuperDock, "BOTTOMLEFT", 5, 5) + chat:Point("TOPRIGHT", LeftSuperDock, "TOPRIGHT", -5, -10) + end + FCF_SavePositionAndDimensions(chat) + FCF_StopDragging(chat) + FCF_SetChatWindowFontSize(nil, chat, 12) + if i == 1 then + FCF_SetWindowName(chat, GENERAL) + elseif i == 2 then + FCF_SetWindowName(chat, GUILD_EVENT_LOG) + elseif i == 3 then + FCF_SetWindowName(chat, LOOT) + end + end + ChatFrame_RemoveAllMessageGroups(ChatFrame1) + ChatFrame_AddMessageGroup(ChatFrame1, "SAY") + ChatFrame_AddMessageGroup(ChatFrame1, "EMOTE") + ChatFrame_AddMessageGroup(ChatFrame1, "YELL") + ChatFrame_AddMessageGroup(ChatFrame1, "GUILD") + ChatFrame_AddMessageGroup(ChatFrame1, "OFFICER") + ChatFrame_AddMessageGroup(ChatFrame1, "GUILD_ACHIEVEMENT") + ChatFrame_AddMessageGroup(ChatFrame1, "WHISPER") + ChatFrame_AddMessageGroup(ChatFrame1, "MONSTER_SAY") + ChatFrame_AddMessageGroup(ChatFrame1, "MONSTER_EMOTE") + ChatFrame_AddMessageGroup(ChatFrame1, "MONSTER_YELL") + ChatFrame_AddMessageGroup(ChatFrame1, "MONSTER_BOSS_EMOTE") + ChatFrame_AddMessageGroup(ChatFrame1, "PARTY") + ChatFrame_AddMessageGroup(ChatFrame1, "PARTY_LEADER") + ChatFrame_AddMessageGroup(ChatFrame1, "RAID") + ChatFrame_AddMessageGroup(ChatFrame1, "RAID_LEADER") + ChatFrame_AddMessageGroup(ChatFrame1, "RAID_WARNING") + ChatFrame_AddMessageGroup(ChatFrame1, "INSTANCE_CHAT") + ChatFrame_AddMessageGroup(ChatFrame1, "INSTANCE_CHAT_LEADER") + ChatFrame_AddMessageGroup(ChatFrame1, "BATTLEGROUND") + ChatFrame_AddMessageGroup(ChatFrame1, "BATTLEGROUND_LEADER") + ChatFrame_AddMessageGroup(ChatFrame1, "BG_HORDE") + ChatFrame_AddMessageGroup(ChatFrame1, "BG_ALLIANCE") + ChatFrame_AddMessageGroup(ChatFrame1, "BG_NEUTRAL") + ChatFrame_AddMessageGroup(ChatFrame1, "SYSTEM") + ChatFrame_AddMessageGroup(ChatFrame1, "ERRORS") + ChatFrame_AddMessageGroup(ChatFrame1, "AFK") + ChatFrame_AddMessageGroup(ChatFrame1, "DND") + ChatFrame_AddMessageGroup(ChatFrame1, "IGNORED") + ChatFrame_AddMessageGroup(ChatFrame1, "ACHIEVEMENT") + ChatFrame_AddMessageGroup(ChatFrame1, "BN_WHISPER") + ChatFrame_AddMessageGroup(ChatFrame1, "BN_CONVERSATION") + ChatFrame_AddMessageGroup(ChatFrame1, "BN_INLINE_TOAST_ALERT") + ChatFrame_AddMessageGroup(ChatFrame1, "COMBAT_FACTION_CHANGE") + ChatFrame_AddMessageGroup(ChatFrame1, "SKILL") + ChatFrame_AddMessageGroup(ChatFrame1, "LOOT") + ChatFrame_AddMessageGroup(ChatFrame1, "MONEY") + ChatFrame_AddMessageGroup(ChatFrame1, "COMBAT_XP_GAIN") + ChatFrame_AddMessageGroup(ChatFrame1, "COMBAT_HONOR_GAIN") + ChatFrame_AddMessageGroup(ChatFrame1, "COMBAT_GUILD_XP_GAIN") + + ChatFrame_RemoveAllMessageGroups(ChatFrame3) + ChatFrame_AddMessageGroup(ChatFrame3, "COMBAT_FACTION_CHANGE") + ChatFrame_AddMessageGroup(ChatFrame3, "SKILL") + ChatFrame_AddMessageGroup(ChatFrame3, "LOOT") + ChatFrame_AddMessageGroup(ChatFrame3, "MONEY") + ChatFrame_AddMessageGroup(ChatFrame3, "COMBAT_XP_GAIN") + ChatFrame_AddMessageGroup(ChatFrame3, "COMBAT_HONOR_GAIN") + ChatFrame_AddMessageGroup(ChatFrame3, "COMBAT_GUILD_XP_GAIN") + + ChatFrame_AddChannel(ChatFrame1, GENERAL) + + ToggleChatColorNamesByClassGroup(true, "SAY") + ToggleChatColorNamesByClassGroup(true, "EMOTE") + ToggleChatColorNamesByClassGroup(true, "YELL") + ToggleChatColorNamesByClassGroup(true, "GUILD") + ToggleChatColorNamesByClassGroup(true, "OFFICER") + ToggleChatColorNamesByClassGroup(true, "GUILD_ACHIEVEMENT") + ToggleChatColorNamesByClassGroup(true, "ACHIEVEMENT") + ToggleChatColorNamesByClassGroup(true, "WHISPER") + ToggleChatColorNamesByClassGroup(true, "PARTY") + ToggleChatColorNamesByClassGroup(true, "PARTY_LEADER") + ToggleChatColorNamesByClassGroup(true, "RAID") + ToggleChatColorNamesByClassGroup(true, "RAID_LEADER") + ToggleChatColorNamesByClassGroup(true, "RAID_WARNING") + ToggleChatColorNamesByClassGroup(true, "BATTLEGROUND") + ToggleChatColorNamesByClassGroup(true, "BATTLEGROUND_LEADER") + ToggleChatColorNamesByClassGroup(true, "INSTANCE_CHAT") + ToggleChatColorNamesByClassGroup(true, "INSTANCE_CHAT_LEADER") + ToggleChatColorNamesByClassGroup(true, "CHANNEL1") + ToggleChatColorNamesByClassGroup(true, "CHANNEL2") + ToggleChatColorNamesByClassGroup(true, "CHANNEL3") + ToggleChatColorNamesByClassGroup(true, "CHANNEL4") + ToggleChatColorNamesByClassGroup(true, "CHANNEL5") + ToggleChatColorNamesByClassGroup(true, "CHANNEL6") + ToggleChatColorNamesByClassGroup(true, "CHANNEL7") + ToggleChatColorNamesByClassGroup(true, "CHANNEL8") + ToggleChatColorNamesByClassGroup(true, "CHANNEL9") + ToggleChatColorNamesByClassGroup(true, "CHANNEL10") + ToggleChatColorNamesByClassGroup(true, "CHANNEL11") + + ChangeChatColor("CHANNEL1", 195 / 255, 230 / 255, 232 / 255) + ChangeChatColor("CHANNEL2", 232 / 255, 158 / 255, 121 / 255) + ChangeChatColor("CHANNEL3", 232 / 255, 228 / 255, 121 / 255) + + if not mungs then + if SV.Chat then + SV.Chat:ReLoad(true) + if SVUI_Cache["Dock"].RightSuperDockFaded == true then RightSuperDockToggleButton:Click()end + if SVUI_Cache["Dock"].LeftSuperDockFaded == true then LeftSuperDockToggleButton:Click()end + end + SV:SavedPopup() + end +end + +local function SetUserScreen(rez, preserve) + if not preserve then + if okToResetMOVE then + SV:ResetMovables("") + okToResetMOVE = false; + end + SV.db:SetDefault("SVUnit") + end + + if not SV.db.framelocations then SV.db.framelocations = {} end + if rez == "low" then + if not preserve then + SV.db.SVDock.dockLeftWidth = 350; + SV.db.SVDock.dockLeftHeight = 180; + SV.db.SVDock.dockRightWidth = 350; + SV.db.SVDock.dockRightHeight = 180; + SV.db.SVAura.wrapAfter = 10 + SV.db.SVUnit.fontSize = 10; + SV.db.SVUnit.player.width = 200; + SV.db.SVUnit.player.castbar.width = 200; + SV.db.SVUnit.player.classbar.fill = "fill" + SV.db.SVUnit.player.health.tags = "[health:color][health:current]" + SV.db.SVUnit.target.width = 200; + SV.db.SVUnit.target.castbar.width = 200; + SV.db.SVUnit.target.health.tags = "[health:color][health:current]" + SV.db.SVUnit.pet.power.enable = false; + SV.db.SVUnit.pet.width = 200; + SV.db.SVUnit.pet.height = 26; + SV.db.SVUnit.targettarget.debuffs.enable = false; + SV.db.SVUnit.targettarget.power.enable = false; + SV.db.SVUnit.targettarget.width = 200; + SV.db.SVUnit.targettarget.height = 26; + SV.db.SVUnit.boss.width = 200; + SV.db.SVUnit.boss.castbar.width = 200; + SV.db.SVUnit.arena.width = 200; + SV.db.SVUnit.arena.castbar.width = 200 + end + if not mungs then + UFMoveBottomQuadrant(true) + UFMoveLeftQuadrant(true) + UFMoveTopQuadrant(true) + UFMoveRightQuadrant(true) + end + SV.ghettoMonitor = true + else + SV.db:SetDefault("SVDock") + SV.db:SetDefault("SVAura") + if not mungs then + UFMoveBottomQuadrant() + UFMoveLeftQuadrant() + UFMoveTopQuadrant() + UFMoveRightQuadrant() + end + SV.ghettoMonitor = nil + end + + if(not preserve and not mungs) then + BarShuffle() + SV:SetSVMovablesPositions() + Registry:Update('SVDock') + Registry:Update('SVAura') + Registry:Update('SVBar') + Registry:Update('SVUnit') + SV:SavedPopup() + end +end +--[[ +########################################################## +GLOBAL/MODULE FUNCTIONS +########################################################## +]]-- +local function LoadPresetData(category, theme) + if(not PRESET_DATA) then LoadAllPresets() end + if(PRESET_DATA and PRESET_DATA[category] and PRESET_DATA[category]["link"]) then + theme = theme or "default" + local saved = PRESET_DATA[category]["link"] + local preset = PRESET_DATA[category][theme] + _copyPresets(SV.db[saved], preset) + end +end + +local function SetColorTheme(style, preserve) + style = style or "default"; + + if not preserve then + SV.db:SetDefault("media") + end + + local presets = LoadPresetData("media", style) + SV.db.LAYOUT.mediastyle = style; + + if(style == "default") then + SV.db.SVUnit.healthclass = true; + else + SV.db.SVUnit.healthclass = false; + end + + if(not mungs) then + SV:MediaUpdate() + Registry:Update('SVStats') + Registry:Update('SVUnit') + if(not preserve) then + SV:SavedPopup() + end + end +end + +local function SetUnitframeLayout(style, preserve) + style = style or "default"; + + if not SV.db.framelocations then SV.db.framelocations = {} end + + if not preserve then + SV.db:SetDefault("SVUnit") + SV.db:SetDefault("SVStats") + if okToResetMOVE then + SV:ResetMovables('') + okToResetMOVE = false + end + end + + local presets = LoadPresetData("units", style) + SV.db.LAYOUT.unitstyle = style + + if(SV.db.LAYOUT.mediastyle == "default") then + SV.db.SVUnit.healthclass = true; + end + + if(not mungs) then + if(not preserve) then + if SV.db.LAYOUT.barstyle and (SV.db.LAYOUT.barstyle == "twosmall" or SV.db.LAYOUT.barstyle == "twobig") then + UFMoveBottomQuadrant("shift") + else + UFMoveBottomQuadrant() + end + SV:SetSVMovablesPositions() + end + Registry:Update('SVStats') + Registry:Update('SVUnit') + if(not preserve) then + SV:SavedPopup() + end + end +end + +local function SetGroupframeLayout(style, preserve) + style = style or "default"; + + local presets = LoadPresetData("layouts", style) + SV.db.LAYOUT.groupstyle = style + + if(not mungs) then + Registry:Update('SVUnit') + if(not preserve) then + SV:SavedPopup() + end + end +end + +local function SetupBarLayout(style, preserve) + style = style or "default"; + + if not SV.db.framelocations then SV.db.framelocations={} end + if not preserve then + SV.db:SetDefault("SVBar") + if okToResetMOVE then + SV:ResetMovables('') + okToResetMOVE=false + end + end + + local presets = LoadPresetData("bars", style) + SV.db.LAYOUT.barstyle = style; + + if(not mungs) then + if(not preserve) then + if(style == 'twosmall' or style == 'twobig') then + UFMoveBottomQuadrant("shift") + else + UFMoveBottomQuadrant() + end + end + if(not preserve) then + BarShuffle() + SV:SetSVMovablesPositions() + end + Registry:Update('SVStats') + Registry:Update('SVBar') + if(not preserve) then + SV:SavedPopup() + end + end +end + +local function SetupAuralayout(style, preserve) + style = style or "default"; + local presets = LoadPresetData("auras", style) + SV.db.LAYOUT.aurastyle = style; + + if(not mungs) then + Registry:Update('SVStats') + Registry:Update('SVAura') + Registry:Update('SVUnit') + if(not preserve) then + SV:SavedPopup() + end + end +end + +local function PlayThemeSong() + if(not musicIsPlaying) then + SetCVar("Sound_MusicVolume", 100) + SetCVar("Sound_EnableMusic", 1) + StopMusic() + PlayMusic([[Interface\AddOns\SVUI\assets\sounds\SuperVillain.mp3]]) + musicIsPlaying = true + end +end + +local function InstallComplete() + SVUI_Profile.SAFEDATA.install_version = SV.___version; + StopMusic() + SetCVar("Sound_MusicVolume",user_music_vol) + okToResetMOVE = false; + ReloadUI() +end + +local function InstallMungsChoice() + mungs = true; + okToResetMOVE = false; + InitializeChatFrames(true); + SetUserScreen('high'); + SV:SetColorTheme(); + SV.db.LAYOUT.unitstyle = nil; + SV:SetUnitframeLayout(); + SV.db.LAYOUT.groupstyle = nil; + SV.db.LAYOUT.barstyle = nil; + SV:SetupBarLayout(); + SV:SetupAuralayout(); + SVUI_Profile.SAFEDATA.install_version = SV.___version; + StopMusic() + SetCVar("Sound_MusicVolume",user_music_vol) + ReloadUI() +end + +local function ResetAll() + SVUI_InstallNextButton:Disable() + SVUI_InstallPrevButton:Disable() + SVUI_InstallOption01Button:Hide() + SVUI_InstallOption01Button:SetScript("OnClick",nil) + SVUI_InstallOption01Button:SetText("") + SVUI_InstallOption02Button:Hide() + SVUI_InstallOption02Button:SetScript("OnClick",nil) + SVUI_InstallOption02Button:SetText("") + SVUI_InstallOption03Button:Hide() + SVUI_InstallOption03Button:SetScript("OnClick",nil) + SVUI_InstallOption03Button:SetText("") + SVUI_InstallOption1Button:Hide() + SVUI_InstallOption1Button:SetScript("OnClick",nil) + SVUI_InstallOption1Button:SetText("") + SVUI_InstallOption2Button:Hide() + SVUI_InstallOption2Button:SetScript('OnClick',nil) + SVUI_InstallOption2Button:SetText('') + SVUI_InstallOption3Button:Hide() + SVUI_InstallOption3Button:SetScript('OnClick',nil) + SVUI_InstallOption3Button:SetText('') + SVUI_InstallOption4Button:Hide() + SVUI_InstallOption4Button:SetScript('OnClick',nil) + SVUI_InstallOption4Button:SetText('') + SVUI_SetupHolder.SubTitle:SetText("") + SVUI_SetupHolder.Desc1:SetText("") + SVUI_SetupHolder.Desc2:SetText("") + SVUI_SetupHolder.Desc3:SetText("") + SVUI_SetupHolder:Size(550,400) +end + +local function SetPage(newPage) + CURRENT_PAGE = newPage; + ResetAll() + InstallStatus.text:SetText(CURRENT_PAGE.." / "..MAX_PAGE) + local setupFrame = SVUI_SetupHolder; + if newPage ~= MAX_PAGE then + SVUI_InstallNextButton:Enable() + SVUI_InstallNextButton:Show() + end + if newPage ~= 1 then + SVUI_InstallPrevButton:Enable() + SVUI_InstallPrevButton:Show() + end + --[[ + more useful globalstrings + + CUSTOM + SETTINGS + DEFAULT + DEFAULTS + USE + UIOPTIONS_MENU + LFGWIZARD_TITLE + CONTINUE + ]]-- + ShowLayout() + if newPage == 1 then + local hasOldConfig = SVUI_Profile.SAFEDATA.install_version + SVUI_InstallPrevButton:Disable() + SVUI_InstallPrevButton:Hide() + okToResetMOVE = true + setupFrame.SubTitle:SetText(format(L["This is Supervillain UI version %s!"], SV.___version)) + setupFrame.Desc1:SetText(L["Before I can turn you loose, persuing whatever villainy you feel will advance your professional career... I need to ask some questions and turn a few screws first."]) + setupFrame.Desc2:SetText(L["At any time you can get to the config options by typing the command / sv. For quick changes to frame, bar or color sets, call your henchman by clicking the button on the bottom right of your screen. (Its the one with his stupid face on it)"]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + SVUI_InstallOption01Button:Show() + SVUI_InstallOption01Button:SetScript("OnClick", InstallMungsChoice) + SVUI_InstallOption01Button:SetText(USE.."\n"..DEFAULT.."\n"..SETTINGS) + + SVUI_InstallOption02Button:Show() + SVUI_InstallOption02Button:SetScript("OnClick", InstallComplete) + SVUI_InstallOption02Button:SetText("PRETEND YOU\nDID THIS\nALREADY") + + if(hasOldConfig) then + SVUI_InstallOption03Button:Show() + SVUI_InstallOption03Button:SetScript("OnClick", InstallComplete) + SVUI_InstallOption03Button:SetText("Keep\nSaved\n"..SETTINGS) + end + + elseif newPage == 2 then + setupFrame.SubTitle:SetText(CHAT) + setupFrame.Desc1:SetText(L["Whether you want to or not, you will be needing a communicator so other villains can either update you on their doings-of-evil or inform you about the MANY abilities of Chuck Norris"]) + setupFrame.Desc2:SetText(L["The chat windows function the same as standard chat windows, you can right click the tabs and drag them, rename them, slap them around, you know... whatever. Clickity-click to setup your chat windows."]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", function() + InitializeChatFrames(false) + end) + SVUI_InstallOption1Button:SetText(CHAT_DEFAULTS) + + elseif newPage == 3 then + local rez = GetCVar("gxResolution") + setupFrame.SubTitle:SetText(RESOLUTION) + setupFrame.Desc1:SetText(format(L["Your current resolution is %s, this is considered a %s resolution."], rez, (SV.ghettoMonitor and LOW or HIGH))) + if SV.ghettoMonitor then + setupFrame.Desc2:SetText(L["This resolution requires that you change some settings to get everything to fit on your screen."].." "..L["Click the button below to resize your chat frames, unitframes, and reposition your actionbars."].." "..L["You may need to further alter these settings depending how low your resolution is."]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + else + setupFrame.Desc2:SetText(L["This resolution doesn't require that you change settings for the UI to fit on your screen."].." "..L["Click the button below to resize your chat frames, unitframes, and reposition your actionbars."].." "..L["This is completely optional."]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + end + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", function() + SetUserScreen("high") + SVUI_SetupHolder.Desc1:SetText(L["|cffFF9F00"..HIGH.." "..RESOLUTION.."!|r"]) + SVUI_SetupHolder.Desc2:SetText(L["So what you think your better than me with your big monitor? HUH?!?!"]) + SVUI_SetupHolder.Desc3:SetText(L["Dont forget whos in charge here! But enjoy the incredible detail."]) + end) + SVUI_InstallOption1Button:SetText(HIGH) + SVUI_InstallOption2Button:Show() + SVUI_InstallOption2Button:SetScript("OnClick", function() + SetUserScreen("low") + SVUI_SetupHolder.Desc1:SetText(L["|cffFF9F00"..LOW.." "..RESOLUTION.."|r"]) + SVUI_SetupHolder.Desc2:SetText(L["Why are you playing this on what I would assume is a calculator display?"]) + SVUI_SetupHolder.Desc3:SetText(L["Enjoy the ONE incredible pixel that fits on this screen."]) + end) + SVUI_InstallOption2Button:SetText(LOW) + + elseif newPage == 4 then + setupFrame.SubTitle:SetText(COLOR.." "..SETTINGS) + setupFrame.Desc1:SetText(L["Choose a theme layout you wish to use for your initial setup."]) + setupFrame.Desc2:SetText(L["You can always change fonts and colors of any element of Supervillain UI from the in-game configuration."]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", function() + SetColorTheme("kaboom") + SVUI_SetupHolder.Desc1:SetText(L["|cffFF9F00KABOOOOM!|r"]) + SVUI_SetupHolder.Desc2:SetText(L["This theme tells the world that you are a villain who can put on a show"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["or better yet, you ARE the show!"]) + end) + SVUI_InstallOption1Button:SetText(L["Kaboom!"]) + SVUI_InstallOption2Button:Show() + SVUI_InstallOption2Button:SetScript("OnClick", function() + SetColorTheme("dark") + SVUI_SetupHolder.Desc1:SetText(L["|cffAF30FFThe Darkest Night|r"]) + SVUI_SetupHolder.Desc2:SetText(L["This theme indicates that you have no interest in wasting time"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L[" the dying begins NOW!"]) + end) + SVUI_InstallOption2Button:SetText(L["Darkness"]) + SVUI_InstallOption3Button:Show() + SVUI_InstallOption3Button:SetScript("OnClick", function() + SetColorTheme("classy") + SVUI_SetupHolder.Desc1:SetText(L["|cffFFFF00"..CLASS_COLORS.."|r"]) + SVUI_SetupHolder.Desc2:SetText(L["This theme is for villains who take pride in their class"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L[" villains know how to reprezent!"]) + end) + SVUI_InstallOption3Button:SetText(L["Class" .. "\n" .. "Colors"]) + SVUI_InstallOption4Button:Show() + SVUI_InstallOption4Button:SetScript("OnClick", function() + SetColorTheme() + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFPlain and Simple|r"]) + SVUI_SetupHolder.Desc2:SetText(L["This theme is for any villain who sticks to their traditions"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["you don't need fancyness to kick some ass!"]) + end) + SVUI_InstallOption4Button:SetText(L["Vintage"]) + + elseif newPage == 5 then + ShowLayout(true) + setupFrame.SubTitle:SetText(UNITFRAME_LABEL.." "..SETTINGS) + setupFrame.Desc1:SetText(L["You can now choose what primary unitframe style you wish to use."]) + setupFrame.Desc2:SetText(L["This will change the layout of your unitframes (ie.. Player, Target, Pet, Party, Raid ...etc)."]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", function() + SV.db.LAYOUT.unitstyle = nil; + SetUnitframeLayout("super") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFLets Do This|r"]) + SVUI_SetupHolder.Desc2:SetText(L["This layout is anything but minimal! Using this is like being at a rock concert"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["then annihilating the crowd with frickin lazer beams!"]) + end) + SVUI_InstallOption1Button:SetText(L["Super"]) + SVUI_InstallOption2Button:Show() + SVUI_InstallOption2Button:SetScript("OnClick", function() + SV.db.LAYOUT.unitstyle = nil; + SetUnitframeLayout("simple") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFSimply Simple|r"]) + SVUI_SetupHolder.Desc2:SetText(L["This layout is for the villain who just wants to get things done!"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["but he still wants to see your face before he hits you!"]) + end) + SVUI_InstallOption2Button:SetText(L["Simple"]) + SVUI_InstallOption3Button:Show() + SVUI_InstallOption3Button:SetScript("OnClick", function() + SV.db.LAYOUT.unitstyle = nil; + SetUnitframeLayout("compact") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFEl Compacto|r"]) + SVUI_SetupHolder.Desc2:SetText(L["Just the necessities so you can see more of the world around you"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["you dont need no fanciness getting in the way of world domination do you?"]) + end) + SVUI_InstallOption3Button:SetText(L["Compact"]) + + elseif newPage == 6 then + ShowLayout(true) + setupFrame.SubTitle:SetText("Group Layout") + setupFrame.Desc1:SetText(L["You can now choose what group layout you prefer."]) + setupFrame.Desc2:SetText(L["This will adjust various settings on group units, attempting to make certain roles more usable"]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", function() + SV.db.LAYOUT.groupstyle = "default"; + SetGroupframeLayout("default") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFStandard|r"]) + SVUI_SetupHolder.Desc2:SetText(L["You are good to go with the default layout"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["frames schmames, lets kill some stuff!"]) + end) + SVUI_InstallOption1Button:SetText(L["Standard"]) + + SVUI_InstallOption2Button:Show() + SVUI_InstallOption2Button:SetScript("OnClick", function() + SV.db.LAYOUT.groupstyle = nil; + SetGroupframeLayout("healer") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFMEDIC!!|r"]) + SVUI_SetupHolder.Desc2:SetText(L["You are pretty helpful.. for a VILLAIN!"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["Hey, even a super villain gets his ass kicked once in awhile. We need the likes of you!"]) + end) + SVUI_InstallOption2Button:SetText(L["Healer"]) + + SVUI_InstallOption3Button:Show() + SVUI_InstallOption3Button:SetScript("OnClick", function() + SV.db.LAYOUT.groupstyle = nil; + SetGroupframeLayout("dps") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFDeath Dealer|r"]) + SVUI_SetupHolder.Desc2:SetText(L["You are the kings of our craft. Handing out pain like its halloween candy."]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["I will move and squeeze group frames out of your way so you have more room for BOOM!"]) + end) + SVUI_InstallOption3Button:SetText(L["DPS"]) + + SVUI_InstallOption4Button:Show() + SVUI_InstallOption4Button:SetScript("OnClick", function() + SV.db.LAYOUT.groupstyle = nil; + SetGroupframeLayout("grid") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFCubed|r"]) + SVUI_SetupHolder.Desc2:SetText(L["You are cold and calculated, your frames should reflect as much."]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["I'm gonna make these frames so precise that you can cut your finger on them!"]) + end) + SVUI_InstallOption4Button:SetText(L["Grid"]) + + elseif newPage == 7 then + setupFrame.SubTitle:SetText(ACTIONBAR_LABEL.." "..SETTINGS) + setupFrame.Desc1:SetText(L["Choose a layout for your action bars."]) + setupFrame.Desc2:SetText(L["Sometimes you need big buttons, sometimes you don't. Your choice here."]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", function() + SV.db.LAYOUT.barstyle = nil; + SetupBarLayout("default") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFLean And Clean|r"]) + SVUI_SetupHolder.Desc2:SetText(L["Lets keep it slim and deadly, not unlike a ninja sword."]) + SVUI_SetupHolder.Desc3:SetText(L["You dont ever even look at your bar hardly, so pick this one!"]) + end) + SVUI_InstallOption1Button:SetText(L["Small" .. "\n" .. "Row"]) + SVUI_InstallOption2Button:Show() + SVUI_InstallOption2Button:SetScript("OnClick", function() + SV.db.LAYOUT.barstyle = nil; + SetupBarLayout("twosmall") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFMore For Less|r"]) + SVUI_SetupHolder.Desc2:SetText(L["Granted, you dont REALLY need the buttons due to your hotkey-leetness, you just like watching cooldowns!"]) + SVUI_SetupHolder.Desc3:SetText(L["Sure thing cowboy, your secret is safe with me!"]) + end) + SVUI_InstallOption2Button:SetText(L["2 Small" .. "\n" .. "Rows"]) + SVUI_InstallOption3Button:Show() + SVUI_InstallOption3Button:SetScript("OnClick", function() + SV.db.LAYOUT.barstyle = nil; + SetupBarLayout("onebig") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFWhat Big Buttons You Have|r"]) + SVUI_SetupHolder.Desc2:SetText(L["The better to PEW-PEW you with my dear!"]) + SVUI_SetupHolder.Desc3:SetText(L["When you have little time for mouse accuracy, choose this set!"]) + end) + SVUI_InstallOption3Button:SetText(L["Big" .. "\n" .. "Row"]) + SVUI_InstallOption4Button:Show() + SVUI_InstallOption4Button:SetScript("OnClick", function() + SV.db.LAYOUT.barstyle = nil; + SetupBarLayout("twobig") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFThe Double Down|r"]) + SVUI_SetupHolder.Desc2:SetText(L["Lets be honest for a moment. Who doesnt like a huge pair in their face?"]) + SVUI_SetupHolder.Desc3:SetText(L["Double your bars then double their size for maximum button goodness!"]) + end) + SVUI_InstallOption4Button:SetText(L["2 Big" .. "\n" .. "Rows"]) + + elseif newPage == 8 then + setupFrame.SubTitle:SetText(AURAS.." "..SETTINGS) + setupFrame.Desc1:SetText(L["Select an aura layout. \"Icons\" will display only icons and aurabars won't be used. \"Bars\" will display only aurabars and icons won't be used (duh). \"The Works!\" does just what it says.... icons, bars and awesomeness."]) + setupFrame.Desc2:SetText(L["If you have an aura that you don't want to display simply hold down shift and right click the icon for it to suffer a painful death."]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", function() + SetupAuralayout() + end) + SVUI_InstallOption1Button:SetText(L["Vintage"]) + + SVUI_InstallOption2Button:Show() + SVUI_InstallOption2Button:SetScript("OnClick", function() + SetupAuralayout("icons") + end) + SVUI_InstallOption2Button:SetText(L["Icons"]) + + SVUI_InstallOption3Button:Show() + SVUI_InstallOption3Button:SetScript("OnClick", function() + SetupAuralayout("bars") + end) + SVUI_InstallOption3Button:SetText(L["Bars"]) + + SVUI_InstallOption4Button:Show() + SVUI_InstallOption4Button:SetScript("OnClick", function() + SetupAuralayout("theworks") + end) + SVUI_InstallOption4Button:SetText(L["The" .. "\n" .. "Works!"]) + + elseif newPage == 9 then + SVUI_InstallNextButton:Disable() + SVUI_InstallNextButton:Hide() + setupFrame.SubTitle:SetText(BASIC_OPTIONS_TOOLTIP..CONTINUED..AUCTION_TIME_LEFT0) + setupFrame.Desc1:SetText(L["Thats it! All done! Now we just need to hand these choices off to the henchmen so they can get you ready to (..insert evil tasks here..)!"]) + setupFrame.Desc2:SetText(L["Click the button below to reload and get on your way! Good luck villain!"]) + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", InstallComplete) + SVUI_InstallOption1Button:SetText(L["THE_BUTTON_BELOW"]) + SVUI_SetupHolder:Size(550, 350) + end +end + +local function NextPage() + if CURRENT_PAGE ~= MAX_PAGE then + CURRENT_PAGE = CURRENT_PAGE + 1; + SetPage(CURRENT_PAGE) + end +end + +local function PreviousPage() + if CURRENT_PAGE ~= 1 then + CURRENT_PAGE = CURRENT_PAGE - 1; + SetPage(CURRENT_PAGE) + end +end + +local function ResetGlobalVariables() + for k,v in pairs(SVUI_Cache) do + SVUI_Cache[k] = nil + end +end + +local function Reset() + mungs = true; + okToResetMOVE = false; + InitializeChatFrames(true); + SV.db:Reset() + SetUserScreen(); + + if SV.db.LAYOUT.mediastyle then + SV:SetColorTheme(SV.db.LAYOUT.mediastyle) + else + SV.db.LAYOUT.mediastyle = nil; + SV:SetColorTheme() + end + + if SV.db.LAYOUT.unitstyle then + SV:SetUnitframeLayout(SV.db.LAYOUT.unitstyle) + else + SV.db.LAYOUT.unitstyle = nil; + SV:SetUnitframeLayout() + end + + if SV.db.LAYOUT.barstyle then + SV:SetupBarLayout(SV.db.LAYOUT.barstyle) + else + SV.db.LAYOUT.barstyle = nil; + SV:SetupBarLayout() + end + + if SV.db.LAYOUT.aurastyle then + SV:SetupAuralayout(SV.db.LAYOUT.aurastyle) + else + SV.db.LAYOUT.aurastyle = nil; + SV:SetupAuralayout() + end + + SVUI_Profile.SAFEDATA.install_version = SV.___version; + ResetGlobalVariables() + ReloadUI() +end + +function Setup:Install(autoLoaded) + if(not user_music_vol) then + user_music_vol = GetCVar("Sound_MusicVolume") + end + + -- frame + if not SVUI_SetupHolder then + local frame = CreateFrame("Button", "SVUI_SetupHolder", UIParent) + frame.SetPage = SetPage; + frame:Size(550, 400) + frame:SetPanelTemplate("Action") + frame:SetPoint("CENTER") + frame:SetFrameStrata("TOOLTIP") + frame.Title = frame:CreateFontString(nil, "OVERLAY") + frame.Title:SetFont(SV.Media.font.narrator, 22, "OUTLINE") + frame.Title:Point("TOP", 0, -5) + frame.Title:SetText(L["Supervillain UI Installation"]) + + frame.Next = CreateFrame("Button", "SVUI_InstallNextButton", frame, "UIPanelButtonTemplate") + frame.Next:RemoveTextures() + frame.Next:Size(110, 25) + frame.Next:Point("BOTTOMRIGHT", 50, 5) + SetInstallButton(frame.Next) + frame.Next.texture = frame.Next:CreateTexture(nil, "BORDER") + frame.Next.texture:Size(110, 75) + frame.Next.texture:Point("RIGHT") + frame.Next.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION-ARROW") + frame.Next.texture:SetVertexColor(1, 0.5, 0) + frame.Next.text = frame.Next:CreateFontString(nil, "OVERLAY") + frame.Next.text:SetFont(SV.Media.font.action, 18, "OUTLINE") + frame.Next.text:SetPoint("CENTER") + frame.Next.text:SetText(CONTINUE) + frame.Next:Disable() + frame.Next:SetScript("OnClick", NextPage) + frame.Next:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(1, 1, 0) + end) + frame.Next:SetScript("OnLeave", function(this) + this.texture:SetVertexColor(1, 0.5, 0) + end) + + frame.Prev = CreateFrame("Button", "SVUI_InstallPrevButton", frame, "UIPanelButtonTemplate") + frame.Prev:RemoveTextures() + frame.Prev:Size(110, 25) + frame.Prev:Point("BOTTOMLEFT", -50, 5) + SetInstallButton(frame.Prev) + frame.Prev.texture = frame.Prev:CreateTexture(nil, "BORDER") + frame.Prev.texture:Size(110, 75) + frame.Prev.texture:Point("LEFT") + frame.Prev.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION-ARROW") + frame.Prev.texture:SetTexCoord(1, 0, 1, 1, 0, 0, 0, 1) + frame.Prev.texture:SetVertexColor(1, 0.5, 0) + frame.Prev.text = frame.Prev:CreateFontString(nil, "OVERLAY") + frame.Prev.text:SetFont(SV.Media.font.action, 18, "OUTLINE") + frame.Prev.text:SetPoint("CENTER") + frame.Prev.text:SetText(PREVIOUS) + frame.Prev:Disable() + frame.Prev:SetScript("OnClick", PreviousPage) + frame.Prev:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(1, 1, 0) + end) + frame.Prev:SetScript("OnLeave", function(this) + this.texture:SetVertexColor(1, 0.5, 0) + end) + frame.Status = CreateFrame("Frame", "InstallStatus", frame) + frame.Status:SetFrameLevel(frame.Status:GetFrameLevel() + 2) + frame.Status:Size(150, 30) + frame.Status:Point("BOTTOM", frame, "TOP", 0, 2) + frame.Status.text = frame.Status:CreateFontString(nil, "OVERLAY") + frame.Status.text:SetFont(SV.Media.font.numbers, 22, "OUTLINE") + frame.Status.text:SetPoint("CENTER") + frame.Status.text:SetText(CURRENT_PAGE.." / "..MAX_PAGE) + + frame.Option01 = CreateFrame("Button", "SVUI_InstallOption01Button", frame, "UIPanelButtonTemplate") + frame.Option01:RemoveTextures() + frame.Option01:Size(160, 30) + frame.Option01:Point("BOTTOM", 0, 15) + frame.Option01:SetText("") + SetInstallButton(frame.Option01) + frame.Option01.texture = frame.Option01:CreateTexture(nil, "BORDER") + frame.Option01.texture:Size(160, 160) + frame.Option01.texture:Point("CENTER", frame.Option01, "BOTTOM", 0, -15) + frame.Option01.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") + frame.Option01.texture:SetGradient("VERTICAL", 0, 0.3, 0, 0, 0.7, 0) + frame.Option01:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(0.5, 1, 0.4) + end) + frame.Option01:SetScript("OnLeave", function(this) + this.texture:SetGradient("VERTICAL", 0, 0.3, 0, 0, 0.7, 0) + end) + hooksecurefunc(frame.Option01, "SetWidth", function(g, h) + g.texture:Size(h, h) + g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) + end) + frame.Option01:SetFrameLevel(frame.Option01:GetFrameLevel() + 10) + frame.Option01:Hide() + + frame.Option02 = CreateFrame("Button", "SVUI_InstallOption02Button", frame, "UIPanelButtonTemplate") + frame.Option02:RemoveTextures() + frame.Option02:Size(130, 30) + frame.Option02:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) + frame.Option02:SetText("") + SetInstallButton(frame.Option02) + frame.Option02.texture = frame.Option02:CreateTexture(nil, "BORDER") + frame.Option02.texture:Size(130, 110) + frame.Option02.texture:Point("CENTER", frame.Option02, "BOTTOM", 0, -15) + frame.Option02.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") + frame.Option02.texture:SetGradient("VERTICAL", 0.3, 0, 0, 0.7, 0, 0) + frame.Option02:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(0.5, 1, 0.4) + end) + frame.Option02:SetScript("OnLeave", function(this) + this.texture:SetGradient("VERTICAL", 0.3, 0, 0, 0.7, 0, 0) + end) + hooksecurefunc(frame.Option02, "SetWidth", function(g, h) + g.texture:Size(h, h) + g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) + end) + frame.Option02:SetScript("OnShow", function() + frame.Option01:SetWidth(130) + frame.Option01:ClearAllPoints() + frame.Option01:Point("BOTTOMRIGHT", frame, "BOTTOM", -4, 15) + end) + frame.Option02:SetScript("OnHide", function() + frame.Option01:SetWidth(160) + frame.Option01:ClearAllPoints() + frame.Option01:Point("BOTTOM", 0, 15) + end) + frame.Option02:SetFrameLevel(frame.Option01:GetFrameLevel() + 10) + frame.Option02:Hide() + + frame.Option03 = CreateFrame("Button", "SVUI_InstallOption03Button", frame, "UIPanelButtonTemplate") + frame.Option03:RemoveTextures() + frame.Option03:Size(130, 30) + frame.Option03:Point("BOTTOM", frame, "BOTTOM", 0, 15) + frame.Option03:SetText("") + SetInstallButton(frame.Option03) + frame.Option03.texture = frame.Option03:CreateTexture(nil, "BORDER") + frame.Option03.texture:Size(130, 110) + frame.Option03.texture:Point("CENTER", frame.Option03, "BOTTOM", 0, -15) + frame.Option03.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") + frame.Option03.texture:SetGradient("VERTICAL", 0, 0.1, 0.3, 0, 0.5, 0.7) + frame.Option03:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(0.2, 0.5, 1) + end) + frame.Option03:SetScript("OnLeave", function(this) + this.texture:SetGradient("VERTICAL", 0, 0.1, 0.3, 0, 0.5, 0.7) + end) + hooksecurefunc(frame.Option03, "SetWidth", function(g, h) + g.texture:Size(h, h) + g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) + end) + frame.Option03:SetScript("OnShow", function(self) + self:SetWidth(130) + frame.Option01:SetWidth(130) + frame.Option01:ClearAllPoints() + frame.Option01:Point("RIGHT", self, "LEFT", -8, 0) + frame.Option02:SetWidth(130) + frame.Option02:ClearAllPoints() + frame.Option02:Point("LEFT", self, "RIGHT", 8, 0) + end) + frame.Option03:SetScript("OnHide", function() + frame.Option01:SetWidth(160) + frame.Option01:ClearAllPoints() + frame.Option01:Point("BOTTOM", 0, 15) + frame.Option02:ClearAllPoints() + frame.Option02:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) + end) + frame.Option03:SetFrameLevel(frame.Option01:GetFrameLevel() + 10) + frame.Option03:Hide() + + frame.Option1 = CreateFrame("Button", "SVUI_InstallOption1Button", frame, "UIPanelButtonTemplate") + frame.Option1:RemoveTextures() + frame.Option1:Size(160, 30) + frame.Option1:Point("BOTTOM", 0, 15) + frame.Option1:SetText("") + SetInstallButton(frame.Option1) + frame.Option1.texture = frame.Option1:CreateTexture(nil, "BORDER") + frame.Option1.texture:Size(160, 160) + frame.Option1.texture:Point("CENTER", frame.Option1, "BOTTOM", 0, -15) + frame.Option1.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") + frame.Option1.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + frame.Option1:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(0.5, 1, 0.4) + end) + frame.Option1:SetScript("OnLeave", function(this) + this.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + end) + hooksecurefunc(frame.Option1, "SetWidth", function(g, h) + g.texture:Size(h, h) + g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) + end) + frame.Option1:SetFrameLevel(frame.Option1:GetFrameLevel() + 10) + frame.Option1:Hide() + + frame.Option2 = CreateFrame("Button", "SVUI_InstallOption2Button", frame, "UIPanelButtonTemplate") + frame.Option2:RemoveTextures() + frame.Option2:Size(120, 30) + frame.Option2:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) + frame.Option2:SetText("") + SetInstallButton(frame.Option2) + frame.Option2.texture = frame.Option2:CreateTexture(nil, "BORDER") + frame.Option2.texture:Size(120, 110) + frame.Option2.texture:Point("CENTER", frame.Option2, "BOTTOM", 0, -15) + frame.Option2.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") + frame.Option2.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + frame.Option2:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(0.5, 1, 0.4) + end) + frame.Option2:SetScript("OnLeave", function(this) + this.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + end) + hooksecurefunc(frame.Option2, "SetWidth", function(g, h) + g.texture:Size(h, h) + g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) + end) + frame.Option2:SetScript("OnShow", function() + frame.Option1:SetWidth(120) + frame.Option1:ClearAllPoints() + frame.Option1:Point("BOTTOMRIGHT", frame, "BOTTOM", -4, 15) + end) + frame.Option2:SetScript("OnHide", function() + frame.Option1:SetWidth(160) + frame.Option1:ClearAllPoints() + frame.Option1:Point("BOTTOM", 0, 15) + end) + frame.Option2:SetFrameLevel(frame.Option1:GetFrameLevel() + 10) + frame.Option2:Hide() + + frame.Option3 = CreateFrame("Button", "SVUI_InstallOption3Button", frame, "UIPanelButtonTemplate") + frame.Option3:RemoveTextures() + frame.Option3:Size(110, 30) + frame.Option3:Point("LEFT", frame.Option2, "RIGHT", 4, 0) + frame.Option3:SetText("") + SetInstallButton(frame.Option3) + frame.Option3.texture = frame.Option3:CreateTexture(nil, "BORDER") + frame.Option3.texture:Size(110, 100) + frame.Option3.texture:Point("CENTER", frame.Option3, "BOTTOM", 0, -9) + frame.Option3.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") + frame.Option3.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + frame.Option3:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(0.5, 1, 0.4) + end) + frame.Option3:SetScript("OnLeave", function(this) + this.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + end) + frame.Option3:SetScript("OnShow", function() + frame.Option1:SetWidth(110) + frame.Option1:ClearAllPoints() + frame.Option1:Point("RIGHT", frame.Option2, "LEFT", -4, 0) + frame.Option2:SetWidth(110) + frame.Option2:ClearAllPoints() + frame.Option2:Point("BOTTOM", frame, "BOTTOM", 0, 15) + end) + frame.Option3:SetScript("OnHide", function() + frame.Option1:SetWidth(160) + frame.Option1:ClearAllPoints() + frame.Option1:Point("BOTTOM", 0, 15) + frame.Option2:SetWidth(120) + frame.Option2:ClearAllPoints() + frame.Option2:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) + end) + frame.Option3:SetFrameLevel(frame.Option1:GetFrameLevel() + 10) + frame.Option3:Hide() + + frame.Option4 = CreateFrame("Button", "SVUI_InstallOption4Button", frame, "UIPanelButtonTemplate") + frame.Option4:RemoveTextures() + frame.Option4:Size(110, 30) + frame.Option4:Point("LEFT", frame.Option3, "RIGHT", 4, 0) + frame.Option4:SetText("") + SetInstallButton(frame.Option4) + frame.Option4.texture = frame.Option4:CreateTexture(nil, "BORDER") + frame.Option4.texture:Size(110, 100) + frame.Option4.texture:Point("CENTER", frame.Option4, "BOTTOM", 0, -9) + frame.Option4.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") + frame.Option4.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + frame.Option4:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(0.5, 1, 0.4) + end) + frame.Option4:SetScript("OnLeave", function(this) + this.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + end) + frame.Option4:SetScript("OnShow", function() + frame.Option1:Width(110) + frame.Option2:Width(110) + frame.Option1:ClearAllPoints() + frame.Option1:Point("RIGHT", frame.Option2, "LEFT", -4, 0) + frame.Option2:ClearAllPoints() + frame.Option2:Point("BOTTOMRIGHT", frame, "BOTTOM", -4, 15) + end) + frame.Option4:SetScript("OnHide", function() + frame.Option1:SetWidth(160) + frame.Option1:ClearAllPoints() + frame.Option1:Point("BOTTOM", 0, 15) + frame.Option2:SetWidth(120) + frame.Option2:ClearAllPoints() + frame.Option2:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) + end) + + frame.Option4:SetFrameLevel(frame.Option1:GetFrameLevel() + 10) + frame.Option4:Hide() + + frame.SubTitle = frame:CreateFontString(nil, "OVERLAY") + frame.SubTitle:SetFont(SV.Media.font.roboto, 16, "OUTLINE") + frame.SubTitle:Point("TOP", 0, -40) + frame.Desc1 = frame:CreateFontString(nil, "OVERLAY") + frame.Desc1:SetFont(SV.Media.font.roboto, 14, "OUTLINE") + frame.Desc1:Point("TOPLEFT", 20, -75) + frame.Desc1:Width(frame:GetWidth()-40) + frame.Desc2 = frame:CreateFontString(nil, "OVERLAY") + frame.Desc2:SetFont(SV.Media.font.roboto, 14, "OUTLINE") + frame.Desc2:Point("TOPLEFT", 20, -125) + frame.Desc2:Width(frame:GetWidth()-40) + frame.Desc3 = frame:CreateFontString(nil, "OVERLAY") + frame.Desc3:SetFont(SV.Media.font.roboto, 14, "OUTLINE") + frame.Desc3:Point("TOPLEFT", 20, -175) + frame.Desc3:Width(frame:GetWidth()-40) + local closeButton = CreateFrame("Button", "SVUI_InstallCloseButton", frame, "UIPanelCloseButton") + closeButton:SetPoint("TOPRIGHT", frame, "TOPRIGHT") + closeButton:SetScript("OnClick", function()frame:Hide()end) + frame.tutorialImage = frame:CreateTexture("InstallTutorialImage", "OVERLAY") + frame.tutorialImage:Size(256, 128) + frame.tutorialImage:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\SPLASH") + frame.tutorialImage:Point("BOTTOM", 0, 70) + end + + SVUI_SetupHolder:SetScript("OnHide", function() + StopMusic() + SetCVar("Sound_MusicVolume", user_music_vol) + musicIsPlaying = nil + end) + + SVUI_SetupHolder:Show() + NextPage() + if(not autoLoaded) then + PlayThemeSong() + else + SV.Timers:ExecuteTimer(PlayThemeSong, 5) + end +end + +SV.Setup = Setup +SV.Setup.SetColorTheme = SetColorTheme +SV.Setup.SetUnitframeLayout = SetUnitframeLayout +SV.Setup.SetupBarLayout = SetupBarLayout +SV.Setup.SetupAuralayout = SetupAuralayout \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/slash.lua b/Interface/AddOns/SVUI/system/slash.lua index a2c8a99..1822cef 100644 --- a/Interface/AddOns/SVUI/system/slash.lua +++ b/Interface/AddOns/SVUI/system/slash.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(select(2, ...)); +local SV, L = unpack(select(2, ...)); --[[ ########################################################## LOCAL VARS @@ -45,27 +45,27 @@ local function SVUIMasterCommand(msg) if msg then msg = lower(trim(msg)) if (msg == "install") then - SuperVillain:Install() + SV.Setup:Install() elseif (msg == "move" or msg == "mentalo") then - SuperVillain:UseMentalo() - elseif (msg == "kb" or msg == "bind") and SuperVillain.db.SVBar.enable then - SuperVillain.SVBar:ToggleKeyBindingMode() + SV:UseMentalo() + elseif (msg == "kb" or msg == "bind") and SV.db.SVBar.enable then + SV.SVBar:ToggleKeyBindingMode() elseif (msg == "reset" or msg == "resetui") then - SuperVillain:ResetAllUI() + SV:ResetAllUI() elseif (msg == "bg" or msg == "pvp") then - local MOD = SuperVillain.SVStats + local MOD = SV.SVStats MOD.ForceHideBGStats = nil; MOD:Generate() - SuperVillain:AddonMessage(L['Battleground statistics will now show again if you are inside a battleground.']) + SV:AddonMessage(L['Battleground statistics will now show again if you are inside a battleground.']) elseif (msg == "toasty" or msg == "kombat") then - SuperVillain:ToastyKombat() + SV:ToastyKombat() elseif (msg == "lol") then PlaySoundFile("Sound\\Character\\Human\\HumanVocalFemale\\HumanFemalePissed04.wav") else - SuperVillain:ToggleConfig() + SV:ToggleConfig() end else - SuperVillain:ToggleConfig() + SV:ToggleConfig() end end diff --git a/Interface/AddOns/SVUI/system/system.lua b/Interface/AddOns/SVUI/system/system.lua deleted file mode 100644 index fafe031..0000000 --- a/Interface/AddOns/SVUI/system/system.lua +++ /dev/null @@ -1,909 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -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 ipairs = _G.ipairs; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local tostring = _G.tostring; -local tonumber = _G.tonumber; -local tinsert = _G.tinsert; -local string = _G.string; -local math = _G.math; -local bit = _G.bit; -local table = _G.table; ---[[ STRING METHODS ]]-- -local lower, upper = string.lower, string.upper; -local find, format, len, split = string.find, string.format, string.len, string.split; -local match, sub, join = string.match, string.sub, string.join; -local gmatch, gsub = string.gmatch, string.gsub; ---[[ 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 parsefloat, huge, random = math.parsefloat, math.huge, math.random; -- Uncommon ---[[ BINARY METHODS ]]-- -local band, bor = bit.band, bit.bor; ---[[ 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(select(2, ...)) ---[[ -########################################################## -LOCALS -########################################################## -]]-- -local toonClass = select(2,UnitClass("player")); -local rez = GetCVar("gxResolution"); -local gxHeight = tonumber(match(rez,"%d+x(%d+)")); -local gxWidth = tonumber(match(rez,"(%d+)x%d+")); -local NewHook = hooksecurefunc; -local version = GetAddOnMetadata(..., "Version"); ---[[ -########################################################## -DISPEL MECHANICS -########################################################## -]]-- -local droodSpell1, droodSpell2 = GetSpellInfo(110309), GetSpellInfo(4987); -local RefClassRoles; -local RefMagicSpec; --- canBeTank, canBeHealer, canBeDPS = UnitGetAvailableRoles("unit") -do - if(toonClass == "PRIEST") then - RefClassRoles = {"C", "C", "C"} - SuperVillain.Dispellable = {["Magic"] = true, ["Disease"] = true} - elseif(toonClass == "WARLOCK") then - RefClassRoles = {"C", "C", "C"} - elseif(toonClass == "WARRIOR") then - RefClassRoles = {"M", "M", "T"} - elseif(toonClass == "HUNTER") then - RefClassRoles = {"M", "M", "M"} - elseif(toonClass == "ROGUE") then - RefClassRoles = {"M", "M", "M"} - elseif(toonClass == "MAGE") then - RefClassRoles = {"C", "C", "C"} - SuperVillain.Dispellable = {["Curse"] = true} - elseif(toonClass == "DEATHKNIGHT") then - RefClassRoles = {"T", "M", "M"} - elseif(toonClass == "DRUID") then - RefMagicSpec = 4 - RefClassRoles = {"C", "M", "T", "C"} - SuperVillain.Dispellable = {["Curse"] = true, ["Poison"] = true} - elseif(toonClass == "SHAMAN") then - RefMagicSpec = 3 - RefClassRoles = {"C", "M", "C"} - SuperVillain.Dispellable = {["Curse"] = true} - elseif(toonClass == "MONK") then - RefMagicSpec = 2 - RefClassRoles = {"T", "C", "M"} - SuperVillain.Dispellable = {["Disease"] = true, ["Poison"] = true} - elseif(toonClass == "PALADIN") then - RefMagicSpec = 1 - RefClassRoles = {"C", "T", "M"} - SuperVillain.Dispellable = {["Poison"] = true, ["Disease"] = true} - end -end - -local function GetTalentInfo(arg) - if type(arg) == "number" then - return arg == GetActiveSpecGroup(); - else - return false; - end -end - -function SuperVillain:DefinePlayerRole() - local spec = GetSpecialization() - local role; - if spec then - if(self.CurrentSpec == spec) then return end - role = RefClassRoles[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 - role = "M" - end - end - self.CurrentSpec = spec - else - local intellect = select(2, UnitStat("player", 4)) - local agility = select(2, UnitStat("player", 2)) - local baseAP, posAP, negAP = UnitAttackPower("player") - local totalAP = baseAP + posAP + negAP; - if totalAP > intellect or agility > intellect then - role = "M" - else - role = "C" - end - end - if self.ClassRole ~= role and self.RoleChangedCallback then - self.ClassRole = role; - self.RoleChangedCallback() - end - if RefMagicSpec then - if(GetTalentInfo(RefMagicSpec)) then - self.Dispellable["Magic"] = true - elseif(self.Dispellable["Magic"]) then - self.Dispellable["Magic"] = nil - end - end - self.RoleIsSet = true -end ---[[ -########################################################## -SYSTEM FUNCTIONS -########################################################## -]]-- -function SuperVillain:StaticPopup_Show(arg) - if arg == "ADDON_ACTION_FORBIDDEN" then - StaticPopup_Hide(arg) - end -end - -function SuperVillain:ResetAllUI(confirmed) - if InCombatLockdown()then - SendAddonMessage(ERR_NOT_IN_COMBAT) - return - end - if(not confirmed) then - self:StaticPopup_Show('RESET_UI_CHECK') - return - end - self:ResetInstallation() -end - -function SuperVillain:ResetUI(confirmed) - if InCombatLockdown()then - SendAddonMessage(ERR_NOT_IN_COMBAT) - return - end - if(not confirmed) then - self:StaticPopup_Show('RESETMOVERS_CHECK') - return - end - self:ResetMovables() -end - -function SuperVillain:ToggleConfig() - if InCombatLockdown() then - SendAddonMessage(ERR_NOT_IN_COMBAT) - self.UIParent:RegisterEvent('PLAYER_REGEN_ENABLED') - return - end - if not IsAddOnLoaded("SVUI_ConfigOMatic") then - local _,_,_,_,_,state = GetAddOnInfo("SVUI_ConfigOMatic") - if state ~= "MISSING" and state ~= "DISABLED" then - LoadAddOn("SVUI_ConfigOMatic") - local config_version = GetAddOnMetadata("SVUI_ConfigOMatic", "Version") - if(tonumber(config_version) < 4) then - self:StaticPopup_Show("CLIENT_UPDATE_REQUEST") - end - else - self:AddonMessage("|cffff0000Error -- Addon 'SVUI_ConfigOMatic' not found or is disabled.|r") - return - end - end - local aceConfig = LibStub("AceConfigDialog-3.0") - local switch = not aceConfig.OpenFrames["SVUI"] and "Open" or "Close" - aceConfig[switch](aceConfig, "SVUI") - GameTooltip:Hide() -end - ---/script SVUI[1]:TaintHandler("SVUI", "Script", "Function") -function SuperVillain:TaintHandler(taint, sourceName, sourceFunc) - if GetCVarBool('scriptErrors') ~= 1 then return end - local errorString = ("Error Captured: %s->%s->{%s}"):format(taint, sourceName or "Unknown", sourceFunc or "Unknown") - SuperVillain:AddonMessage(errorString) - SuperVillain:StaticPopup_Show("TAINT_RL") -end ---[[ -########################################################## -ANIMATION CLASS -########################################################## -]]-- -local FlickerAlpha = {0.2,0.15,0.1,0.15,0.2,0.15,0.1,0.15} -local Animate = {}; ---[[ HANDLERS ]]-- - -local Anim_OnShow = function(self) - if not self.anim:IsPlaying() then - self.anim:Play() - end -end - -local Anim_OnHide = function(self) - self.anim:Finish() -end - -local Anim_OnPlay = function(self) - local parent = self.parent - parent:SetAlpha(1) - if self.hideOnFinished and not parent:IsShown() then - parent:Show() - end -end - -local Anim_OnStop = function(self) - local parent = self.parent - if self.fadeOnFinished then - parent:SetAlpha(0) - else - parent:SetAlpha(1) - end - if self.hideOnFinished and parent:IsShown() then - parent:Hide() - end - if self.savedFrameLevel then - parent:SetScale(1) - parent:SetFrameLevel(self.savedFrameLevel) - end -end - -local Anim_OnFinished = function(self) - local parent = self.parent - local looped = self:GetLooping() - self:Stop() - if(looped and looped == "REPEAT" and parent:IsShown()) then - self:Play() - end -end - -local Sprite_OnUpdate = function(self) - local order = self:GetOrder() - local parent = self.parent - local left, right; - if(self.isFadeFrame) then - parent:SetAlpha(0) - return - end - left = (order - 1) * 0.25; - right = left + 0.25; - parent:SetTexCoord(left,right,0,1) - if parent.overlay then - parent.overlay:SetTexCoord(left,right,0,1) - parent.overlay:SetVertexColor(1,1,1,FlickerAlpha[order]) - end -end - -local SmallSprite_OnUpdate = function(self) - local order = self:GetOrder() - local parent = self.parent - local left, right; - if(self.isFadeFrame) then - parent:SetAlpha(0) - return - end - left = (order - 1) * 0.125; - right = left + 0.125; - parent:SetTexCoord(left,right,0,1) - if parent.overlay then - parent.overlay:SetTexCoord(left,right,0,1) - parent.overlay:SetVertexColor(1,1,1,FlickerAlpha[order]) - end -end - -local PulseIn_OnUpdate = function(self) - local parent = self.parent - local step = self:GetProgress() - if(parent.savedFrameLevel) then - parent:SetFrameLevel(128) - end - parent:SetScale(1 + (1.05 * step)) -end - -local PulseOut_OnUpdate = function(self) - local parent = self.parent - local step = self:GetProgress() - if(parent.savedFrameLevel) then - parent:SetFrameLevel(128) - end - parent:SetScale(1 + (1.05 * (1 - step))) -end - -local Slide_OnUpdate = function(self) - local parent = self.parent - local step = self:GetProgress() - parent:SetScale(1 + (1.05 * step)) -end - -local Slide_OnPlay = function(self) - local parent = self.parent - parent:SetScale(0.01) - parent:SetAlpha(1) -end - -local Slide_FadeStart = function(self) - local parent = self.parent - UIFrameFadeOut(parent, 0.3, 1, 0) -end - -local Slide_FadeStop = function(self) - self.parent:SetAlpha(0) -end - ---[[ HELPER FUNCTION ]]-- - -local function SetNewAnimation(frame, animType, subType) - local anim = frame:CreateAnimation(animType, subType) - anim.parent = frame.parent - return anim -end - ---[[ ANIMATION CLASS METHODS ]]-- - -function Animate:SetTemplate(frame, animType, hideOnFinished, speed, special, scriptToParent) - if not animType then return end - - frame.anim = frame:CreateAnimationGroup(animType) - frame.anim.parent = frame; - frame.anim.hideOnFinished = hideOnFinished - if animType ~= 'Flash' then - frame.anim:SetScript("OnPlay", Anim_OnPlay) - frame.anim:SetScript("OnFinished", Anim_OnFinished) - frame.anim:SetScript("OnStop", Anim_OnStop) - end - - if scriptToParent then - local frameParent = frame:GetParent(); - if(frameParent.SetScript) then - frameParent.anim = frame.anim; - frameParent:SetScript("OnShow", Anim_OnShow) - frameParent:SetScript("OnHide", Anim_OnHide) - end - elseif(frame.SetScript) then - frame:SetScript("OnShow", Anim_OnShow) - frame:SetScript("OnHide", Anim_OnHide) - end - - if animType == 'Flash'then - frame.anim.fadeOnFinished = true - if not speed then speed = 0.33 end - - frame.anim[1] = SetNewAnimation(frame.anim, "ALPHA", "FadeIn") - frame.anim[1]:SetChange(1) - frame.anim[1]:SetOrder(2) - frame.anim[1]:SetDuration(speed) - - frame.anim[2] = SetNewAnimation(frame.anim, "ALPHA","FadeOut") - frame.anim[2]:SetChange(-1) - frame.anim[2]:SetOrder(1) - frame.anim[2]:SetDuration(speed) - - if special then - frame.anim:SetLooping("REPEAT") - end - elseif animType == 'Orbit' then - frame.anim[1] = SetNewAnimation(frame.anim, "Rotation") - if special then - frame.anim[1]:SetDegrees(-360) - else - frame.anim[1]:SetDegrees(360) - end - frame.anim[1]:SetDuration(speed) - frame.anim:SetLooping("REPEAT") - frame.anim:Play() - elseif animType == 'Sprite' then - frame.anim[1] = SetNewAnimation(frame.anim, "Translation") - frame.anim[1]:SetOrder(1) - frame.anim[1]:SetDuration(speed) - frame.anim[1]:SetScript("OnUpdate", Sprite_OnUpdate) - - frame.anim[2] = SetNewAnimation(frame.anim, "Translation") - frame.anim[2]:SetOrder(2) - frame.anim[2]:SetDuration(speed) - frame.anim[2]:SetScript("OnUpdate", Sprite_OnUpdate) - - frame.anim[3] = SetNewAnimation(frame.anim, "Translation") - frame.anim[3]:SetOrder(3) - frame.anim[3]:SetDuration(speed) - frame.anim[3]:SetScript("OnUpdate", Sprite_OnUpdate) - - frame.anim[4] = SetNewAnimation(frame.anim, "Translation") - frame.anim[4]:SetOrder(4) - frame.anim[4]:SetDuration(speed) - frame.anim[4]:SetScript("OnUpdate", Sprite_OnUpdate) - - if special then - frame.anim[5] = SetNewAnimation(frame.anim, "Translation") - frame.anim[5]:SetOrder(5) - frame.anim[5]:SetDuration(special) - frame.anim[5].isFadeFrame = true; - frame.anim[5]:SetScript("OnUpdate", Sprite_OnUpdate) - end - - frame.anim:SetLooping("REPEAT") - elseif animType == 'SmallSprite' then - frame.anim[1] = SetNewAnimation(frame.anim, "Translation") - frame.anim[1]:SetOrder(1) - frame.anim[1]:SetDuration(speed) - frame.anim[1]:SetScript("OnUpdate", SmallSprite_OnUpdate) - - frame.anim[2] = SetNewAnimation(frame.anim, "Translation") - frame.anim[2]:SetOrder(2) - frame.anim[2]:SetDuration(speed) - frame.anim[2]:SetScript("OnUpdate", SmallSprite_OnUpdate) - - frame.anim[3] = SetNewAnimation(frame.anim, "Translation") - frame.anim[3]:SetOrder(3) - frame.anim[3]:SetDuration(speed) - frame.anim[3]:SetScript("OnUpdate", SmallSprite_OnUpdate) - - frame.anim[4] = SetNewAnimation(frame.anim, "Translation") - frame.anim[4]:SetOrder(4) - frame.anim[4]:SetDuration(speed) - frame.anim[4]:SetScript("OnUpdate", SmallSprite_OnUpdate) - - frame.anim[5] = SetNewAnimation(frame.anim, "Translation") - frame.anim[5]:SetOrder(5) - frame.anim[5]:SetDuration(speed) - frame.anim[5]:SetScript("OnUpdate", SmallSprite_OnUpdate) - - frame.anim[6] = SetNewAnimation(frame.anim, "Translation") - frame.anim[6]:SetOrder(6) - frame.anim[6]:SetDuration(speed) - frame.anim[6]:SetScript("OnUpdate", SmallSprite_OnUpdate) - - frame.anim[7] = SetNewAnimation(frame.anim, "Translation") - frame.anim[7]:SetOrder(7) - frame.anim[7]:SetDuration(speed) - frame.anim[7]:SetScript("OnUpdate", SmallSprite_OnUpdate) - - frame.anim[8] = SetNewAnimation(frame.anim, "Translation") - frame.anim[8]:SetOrder(8) - frame.anim[8]:SetDuration(speed) - frame.anim[8]:SetScript("OnUpdate", SmallSprite_OnUpdate) - - if special then - frame.anim[9] = SetNewAnimation(frame.anim, "Translation") - frame.anim[9]:SetOrder(9) - frame.anim[9]:SetDuration(special) - frame.anim[9].isFadeFrame = true; - frame.anim[9]:SetScript("OnUpdate", Sprite_OnUpdate) - end - - frame.anim:SetLooping("REPEAT") - elseif animType == 'Pulse' then - frame.anim.savedFrameLevel = frame:GetFrameLevel() - - frame.anim[1] = SetNewAnimation(frame.anim) - frame.anim[1]:SetDuration(0.2) - frame.anim[1]:SetEndDelay(0.1) - frame.anim[1]:SetOrder(1) - frame.anim[1]:SetScript("OnUpdate", PulseIn_OnUpdate) - - frame.anim[2] = SetNewAnimation(frame.anim) - frame.anim[2]:SetDuration(0.6) - frame.anim[2]:SetOrder(2) - frame.anim[2]:SetScript("OnUpdate", PulseOut_OnUpdate) - end -end - ---[[ ROTATE AND WOBBLE (kinda like twerking i guess...) ]]-- - -function Animate:Orbit(frame, speed, reversed, hideOnFinished) - if not frame then return end - if not speed then speed = 1 end - self:SetTemplate(frame, 'Orbit', hideOnFinished, speed, reversed) -end - -function Animate:Pulse(frame, hideOnFinished) - if not frame then return end - self:SetTemplate(frame, 'Pulse', hideOnFinished) -end - ---[[ ANIMATED SPRITES ]]-- - -function Animate:Sprite(frame, speed, fadeTime, scriptToParent) - if not frame then return end - speed = speed or 0.08; - self:SetTemplate(frame, 'Sprite', false, speed, fadeTime, scriptToParent) -end - -function Animate:SmallSprite(frame, speed, fadeTime, scriptToParent) - if not frame then return end - speed = speed or 0.08; - self:SetTemplate(frame, 'SmallSprite', false, speed, fadeTime, scriptToParent) -end - -function Animate:StopSprite(frame) - if not frame then return end - frame.anim:Finish() -end - ---[[ FLASHING ]]-- - -function Animate:Flash(frame, speed, looped) - if not frame.anim then - Animate:SetTemplate(frame, 'Flash', false, speed, looped) - end - if not frame.anim:IsPlaying() then - frame.anim:Play() - end -end - -function Animate:StopFlash(frame) - if not frame.anim then return end - frame.anim:Finish() - frame.anim:Stop() -end - ---[[ SLIDING ]]-- - -function Animate:Slide(frame, xDirection, yDirection, bounce) - if(not frame or (frame and frame.anim)) then return end - - frame.anim = frame:CreateAnimationGroup("Slide") - frame.anim.hideOnFinished = true; - frame.anim.parent = frame; - frame.anim:SetScript("OnPlay", Anim_OnPlay) - frame.anim:SetScript("OnFinished", Anim_OnFinished) - frame.anim:SetScript("OnStop", Anim_OnStop) - - frame.anim[1] = SetNewAnimation(frame.anim, "Translation") - frame.anim[1]:SetDuration(0) - frame.anim[1]:SetOrder(1) - - frame.anim[2] = SetNewAnimation(frame.anim, "Translation") - frame.anim[2]:SetDuration(0.3) - frame.anim[2]:SetOrder(2) - frame.anim[2]:SetSmoothing("OUT") - - if bounce then - frame.anim[3] = SetNewAnimation(frame.anim, "Translation") - frame.anim[3]:SetDuration(0.5) - frame.anim[3]:SetOrder(3) - - frame.anim[4] = SetNewAnimation(frame.anim, "Translation") - frame.anim[4]:SetDuration(0.3) - frame.anim[4]:SetOrder(4) - frame.anim[4]:SetSmoothing("IN") - frame.anim[4]:SetOffset(xDirection, yDirection) - end -end - -function Animate:RandomSlide(frame, raised) - if not frame then return end - if raised then - frame:SetFrameLevel(30) - else - frame:SetFrameLevel(20) - end - frame:SetPoint("CENTER", SuperVillain.UIParent, "CENTER", 0, -150) - - frame.anim = frame:CreateAnimationGroup("RandomSlide") - frame.anim.parent = frame; - frame.anim[1] = SetNewAnimation(frame.anim, "Translation") - frame.anim[1]:SetOrder(1) - frame.anim[1]:SetDuration(0.1) - frame.anim[1]:SetScript("OnUpdate", Slide_OnUpdate) - frame.anim[1]:SetScript("OnPlay", Slide_OnPlay) - - frame.anim[2] = SetNewAnimation(frame.anim, "Translation") - frame.anim[2]:SetOrder(2) - frame.anim[2]:SetDuration(1) - - frame.anim[3] = SetNewAnimation(frame.anim, "Translation") - frame.anim[3]:SetOrder(3) - frame.anim[3]:SetDuration(0.3) - frame.anim[3]:SetSmoothing("OUT") - frame.anim[3]:SetScript("OnPlay", Slide_FadeStart) - frame.anim[3]:SetScript("OnStop", Slide_FadeStop) - - frame.anim:SetScript("OnFinished", Slide_FadeStop) -end - -function Animate:SlideIn(frame) - if not frame.anim then return end - frame:Show() - frame.anim:Play() -end - -function Animate:SlideOut(frame) - if not frame.anim then return end - frame.anim:Finish() - frame.anim:Stop() -end - -SuperVillain.Animate = Animate; ---[[ -########################################################## -SYSTEM UPDATES -########################################################## -]]-- -local function DeleteOldSavedVars() - --[[ BEGIN DEPRECATED ]]-- - if SVUI_DATA then SVUI_DATA = nil end - if SVUI_SAFE_DATA then SVUI_SAFE_DATA = nil end - if SVUI_TRACKER then SVUI_TRACKER = nil end - if SVUI_ENEMIES then SVUI_ENEMIES = nil end - if SVUI_JOURNAL then SVUI_JOURNAL = nil end - if SVUI_CHARACTER_LOG then SVUI_CHARACTER_LOG = nil end - if SVUI_MOVED_FRAMES then SVUI_MOVED_FRAMES = nil end - if SVUI_SystemData then SVUI_SystemData = nil end - if SVUI_ProfileData then SVUI_ProfileData = nil end - if SVUI_Filters then SVUI_Filters = nil end - if SVUI_AuraFilters then SVUI_AuraFilters = nil end - if SVUI_AuraWatch then SVUI_AuraWatch = nil end - if SVUI_Cache["Mentalo"]["Blizzard"] then SVUI_Cache["Mentalo"]["Blizzard"] = nil end - if SVUI_Cache["Mentalo"]["UI"] then SVUI_Cache["Mentalo"]["UI"] = nil end - if(SVUI_Profile.SAFEDATA.install_complete) then SVUI_Profile.SAFEDATA.install_complete = nil end - --[[ END DEPRECATED ]]-- -end - -function SuperVillain:VersionCheck() - local minimumVersion = 4.06; - local installedVersion = SVUI_Profile.SAFEDATA.install_version - if(installedVersion) then - if(type(installedVersion) == "string") then - installedVersion = tonumber(SVUI_Profile.SAFEDATA.install_version) - end - if(type(installedVersion) == "number" and installedVersion < minimumVersion) then - DeleteOldSavedVars() - self:Install(true) - end - else - DeleteOldSavedVars() - self:Install(true) - end -end - -function SuperVillain:RefreshEverything(bypass) - self:RefreshAllSystemMedia(); - - SuperVillain.UIParent:Hide(); - - self:SetSVMovablesPositions(); - self.Registry:Update('SVUnit'); - self.Registry:UpdateAll(); - - SuperVillain.UIParent:Show(); - - if not bypass then - self:VersionCheck() - end -end ---[[ -########################################################## -SVUI LOAD PROCESS -########################################################## -]]-- -local function PrepareStorage() - if(not SVUI_Profile) then return end - SVUI_Profile.STORED = {} - local old = SVUI_Profile.SAFEDATA - local media = old.mediastyle or "" - local bars = old.barstyle or "" - local units = old.unitstyle or "" - local groups = old.groupstyle or "" - local auras = old.aurastyle or "" - local spec = GetSpecialization() or 1 - SVUI_Profile.STORED[1] = tcopy(SVUI_Profile, true) - SVUI_Profile.STORED[1].LAYOUT = { - mediastyle = media, - barstyle = bars, - unitstyle = units, - groupstyle = groups, - aurastyle = auras - } - SVUI_Profile.SAFEDATA.mediastyle = nil - SVUI_Profile.SAFEDATA.barstyle = nil - SVUI_Profile.SAFEDATA.unitstyle = nil - SVUI_Profile.SAFEDATA.groupstyle = nil - SVUI_Profile.SAFEDATA.aurastyle = nil - SVUI_Profile.SAFEDATA.dualSpecEnabled = false -end - -function SuperVillain:Load() - self:ClearAllTimers() - - if not SVUI_Global then SVUI_Global = {} end - if not SVUI_Global["profiles"] then SVUI_Global["profiles"] = {} end - if SVUI_Global["gold"] then SVUI_Global["gold"] = nil end - if SVUI_Global["profileKeys"] then SVUI_Global["profileKeys"] = nil end - - if not SVUI_Profile then SVUI_Profile = {} end - if not SVUI_Profile.SAFEDATA then SVUI_Profile.SAFEDATA = {dualSpecEnabled = false} end - if not SVUI_Profile.STORED then PrepareStorage() end - if not SVUI_Profile.STORED[2] then - SVUI_Profile.STORED[2] = {} - SVUI_Profile.STORED[2].LAYOUT = SVUI_Profile.STORED[1].LAYOUT - end - if not SVUI_Profile.STORED[3] then - SVUI_Profile.STORED[3] = {} - SVUI_Profile.STORED[3].LAYOUT = SVUI_Profile.STORED[1].LAYOUT - end - for k,v in pairs(SVUI_Profile) do - if(k ~= "STORED" and k ~= "SAFEDATA") then - SVUI_Profile[k] = nil - end - end - - if not SVUI_Cache then SVUI_Cache = {} end - if not SVUI_Cache["Dock"] then SVUI_Cache["Dock"] = {} end - if not SVUI_Cache["Mentalo"] then SVUI_Cache["Mentalo"] = {} end - if not SVUI_Cache["Bindings"] then SVUI_Cache["Bindings"] = {} end - if(not SVUI_Cache["screenheight"] or (SVUI_Cache["screenheight"] and type(SVUI_Cache["screenheight"]) ~= "number")) then - SVUI_Cache["screenheight"] = gxHeight - end - if(not SVUI_Cache["screenwidth"] or (SVUI_Cache["screenwidth"] and type(SVUI_Cache["screenwidth"]) ~= "number")) then - SVUI_Cache["screenwidth"] = gxWidth - end - - self:SetDatabaseObjects(true) - - self:UIScale(); - self:RefreshSystemFonts(); - self:LoadSystemAlerts(); - - self.UIParent:RegisterEvent('PLAYER_REGEN_DISABLED'); - self.AddonLoaded = true -end - -function SuperVillain:Launch() - self:SetDatabaseObjects() - self:UIScale("PLAYER_LOGIN"); - self.Registry:LoadPackages(); - self:DefinePlayerRole(); - self:LoadMovables(); - self:SetSVMovablesPositions(); - - self:VersionCheck() - - self:RefreshAllSystemMedia(); - - NewHook("StaticPopup_Show", self.StaticPopup_Show) - - self.UIParent:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED"); - self.UIParent:RegisterEvent("PLAYER_TALENT_UPDATE"); - self.UIParent:RegisterEvent("CHARACTER_POINTS_CHANGED"); - self.UIParent:RegisterEvent("UNIT_INVENTORY_CHANGED"); - self.UIParent:RegisterEvent("UPDATE_BONUS_ACTIONBAR"); - self.UIParent:RegisterEvent("UI_SCALE_CHANGED"); - self.UIParent:RegisterEvent("PLAYER_ENTERING_WORLD"); - self.UIParent:RegisterEvent("PET_BATTLE_CLOSE"); - self.UIParent:RegisterEvent("PET_BATTLE_OPENING_START"); - self.UIParent:RegisterEvent("ADDON_ACTION_BLOCKED"); - self.UIParent:RegisterEvent("ADDON_ACTION_FORBIDDEN"); - self.UIParent:RegisterEvent("SPELLS_CHANGED"); - - self.Registry:Update("SVMap"); - self.Registry:Update("SVUnit", true); - collectgarbage("collect") - - _G["SVUI_Mentalo"]:SetFixedPanelTemplate("Component") - _G["SVUI_Mentalo"]:SetPanelColor("yellow") - _G["SVUI_MentaloPrecision"]:SetPanelTemplate("Transparent") - - if self.db.system.loginmessage then - local logMsg = (L["LOGIN_MSG"]):format("|cffFFFF1A", "|cffAA78FF", self.___ver) - self:AddonMessage(logMsg); - end - - self.AddonLaunched = true -end ---[[ -########################################################## -EVENT HANDLERS -########################################################## -]]-- -local SVUISystem_OnEvent = function(self, event, arg, ...) - if(event == "ADDON_LOADED" and arg == "SVUI") then - if(not SuperVillain.AddonLoaded) then - SuperVillain:Load() - self:UnregisterEvent("ADDON_LOADED") - end - end - if(event == "PLAYER_LOGIN") then - if(not SuperVillain.AddonLaunched and IsLoggedIn()) then - SuperVillain:Launch() - self:UnregisterEvent("PLAYER_LOGIN") - end - end - if(event == "ACTIVE_TALENT_GROUP_CHANGED" or event == "PLAYER_TALENT_UPDATE" or event == "CHARACTER_POINTS_CHANGED" or event == "UNIT_INVENTORY_CHANGED" or event == "UPDATE_BONUS_ACTIONBAR") then - SuperVillain:DefinePlayerRole() - elseif(event == "UI_SCALE_CHANGED") then - SuperVillain:UIScale("UI_SCALE_CHANGED") - elseif(event == "PLAYER_ENTERING_WORLD") then - if(not SuperVillain.RoleIsSet) then - SuperVillain:DefinePlayerRole() - end - if(not SuperVillain.MediaInitialized) then - SuperVillain:RefreshAllSystemMedia() - end - local a,b = IsInInstance() - if(b == "pvp") then - SuperVillain.BGTimer = SuperVillain:ExecuteLoop(RequestBattlefieldScoreData, 5) - elseif(SuperVillain.BGTimer) then - SuperVillain:RemoveLoop(SuperVillain.BGTimer) - SuperVillain.BGTimer = nil - end - elseif(event == "SPELLS_CHANGED") then - if (toonClass ~= "DRUID") then - self:UnregisterEvent("SPELLS_CHANGED") - return - end - if GetSpellInfo(droodSpell1) == droodSpell2 then - SuperVillain.Dispellable["Disease"] = true - elseif(SuperVillain.Dispellable["Disease"]) then - SuperVillain.Dispellable["Disease"] = nil - end - elseif(event == "PET_BATTLE_CLOSE") then - SuperVillain:PushDisplayAudit() - elseif(event == "PET_BATTLE_OPENING_START") then - SuperVillain:FlushDisplayAudit() - elseif(event == "ADDON_ACTION_BLOCKED" or event == "ADDON_ACTION_FORBIDDEN") then - SuperVillain:TaintHandler(arg, ...) - elseif(event == "PLAYER_REGEN_DISABLED") then - local forceClosed = false; - if IsAddOnLoaded("SVUI_ConfigOMatic") then - local aceConfig=LibStub("AceConfigDialog-3.0") - if aceConfig.OpenFrames["SVUI"] then - self:RegisterEvent('PLAYER_REGEN_ENABLED') - aceConfig:Close("SVUI") - forceClosed = true - end - end - if SuperVillain.MentaloFrames then - for frame,_ in pairs(SuperVillain.MentaloFrames) do - if _G[frame] and _G[frame]:IsShown() then - forceClosed = true; - _G[frame]:Hide() - end - end - end - if(HenchmenFrameModel and HenchmenFrame and HenchmenFrame:IsShown()) then - HenchmenFrame:Hide() - HenchmenFrameBG:Hide() - forceClosed = true; - end - if forceClosed == true then - SendAddonMessage(ERR_NOT_IN_COMBAT) - end - elseif(event == "PLAYER_REGEN_ENABLED") then - SuperVillain:ToggleConfig() - self:UnregisterEvent('PLAYER_REGEN_ENABLED') - end -end - -SuperVillain.UIParent:RegisterEvent("ADDON_LOADED") -SuperVillain.UIParent:RegisterEvent("PLAYER_LOGIN") -SuperVillain.UIParent:SetScript("OnEvent", SVUISystem_OnEvent) ---[[ -########################################################## -THE CLEANING LADY -########################################################## -]]-- --- local LemonPledge = 0; --- local Consuela = CreateFrame("Frame", nil) --- Consuela:RegisterAllEvents() --- Consuela:SetScript("OnEvent", function(self, event) --- LemonPledge = LemonPledge + 1 --- if (InCombatLockdown() and LemonPledge > 25000) or (not InCombatLockdown() and LemonPledge > 10000) then --- collectgarbage("collect") --- LemonPledge = 0; --- end --- end) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/timers.lua b/Interface/AddOns/SVUI/system/timers.lua index 4636bd1..7d164c2 100644 --- a/Interface/AddOns/SVUI/system/timers.lua +++ b/Interface/AddOns/SVUI/system/timers.lua @@ -36,7 +36,7 @@ local tremove = table.remove; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SV, L = unpack(select(2, ...)); --[[ ########################################################## LOCAL VARS @@ -45,81 +45,82 @@ LOCAL VARS local TIMERFONT = [[Interface\AddOns\SVUI\assets\fonts\Numbers.ttf]]; --[[ ########################################################## -GLOBAL TIMEOUT QUEUE +TIMERS ########################################################## ExecuteTimer: Create a timer that runs once and CANNOT be stopped ExecuteLoop: Create a timer that loops continuously and CAN be removed ]]-- -SuperVillain.TimerCount = 0; -local ExeTimerQueue = {}; -local ExeTimerManager = CreateFrame("Frame"); +local Timers = CreateFrame("Frame"); +Timers.TimerCount = 0; +Timers.Queue = {}; local ExeTimerManager_OnUpdate = function(self, elapsed) - if(SuperVillain.TimerCount > 0) then - for id,_ in pairs(ExeTimerQueue) do - local callback = ExeTimerQueue[id] + if(self.TimerCount > 0) then + for id,_ in pairs(self.Queue) do + local callback = self.Queue[id] if(callback.f) then if callback.t > elapsed then local newTime = callback.t - elapsed - ExeTimerQueue[id].t = newTime + self.Queue[id].t = newTime else callback.f() if(callback.x) then - ExeTimerQueue[id].t = callback.x + self.Queue[id].t = callback.x else - ExeTimerQueue[id] = nil - SuperVillain.TimerCount = SuperVillain.TimerCount - 1; + self.Queue[id] = nil + self.TimerCount = self.TimerCount - 1; end end end end end end -ExeTimerManager:SetScript("OnUpdate", ExeTimerManager_OnUpdate) -function SuperVillain:ExecuteTimer(timeOutFunction, duration, idCheck) +function Timers:ExecuteTimer(timeOutFunction, duration, idCheck) if(type(duration) == "number" and type(timeOutFunction) == "function") then - if(idCheck and ExeTimerQueue[idCheck]) then - ExeTimerQueue[idCheck].t = duration + if(idCheck and self.Queue[idCheck]) then + self.Queue[idCheck].t = duration return idCheck else self.TimerCount = self.TimerCount + 1 local id = "LOOP" .. self.TimerCount; - ExeTimerQueue[id] = {t = duration, f = timeOutFunction} + self.Queue[id] = {t = duration, f = timeOutFunction} return id end end return false end -function SuperVillain:ExecuteLoop(timeOutFunction, duration, idCheck) +function Timers:ExecuteLoop(timeOutFunction, duration, idCheck) if(type(duration) == "number" and type(timeOutFunction) == "function") then - if(idCheck and ExeTimerQueue[idCheck]) then - ExeTimerQueue[idCheck].x = duration - ExeTimerQueue[idCheck].t = duration + if(idCheck and self.Queue[idCheck]) then + self.Queue[idCheck].x = duration + self.Queue[idCheck].t = duration return idCheck else self.TimerCount = self.TimerCount + 1 local id = "LOOP" .. self.TimerCount; - ExeTimerQueue[id] = {x = duration, t = duration, f = timeOutFunction} + self.Queue[id] = {x = duration, t = duration, f = timeOutFunction} return id end end return false end -function SuperVillain:RemoveLoop(id) - if(ExeTimerQueue[id]) then - ExeTimerQueue[id] = nil +function Timers:RemoveLoop(id) + if(self.Queue[id]) then + self.Queue[id] = nil self.TimerCount = self.TimerCount - 1; end end -function SuperVillain:ClearAllTimers() - ExeTimerManager:SetScript("OnUpdate", nil) - ExeTimerQueue = {} - ExeTimerManager:SetScript("OnUpdate", ExeTimerManager_OnUpdate) +function Timers:ClearAllTimers() + self:SetScript("OnUpdate", nil) + self.Queue = {} + self:SetScript("OnUpdate", ExeTimerManager_OnUpdate) end + +Timers:SetScript("OnUpdate", ExeTimerManager_OnUpdate) --[[ ########################################################## TIMER FUNCTIONS @@ -246,7 +247,10 @@ local Cooldown_OnLoad = function(self, start, duration, elapsed) end end -function SuperVillain:AddCD(cooldown) - if not SuperVillain.db.system.cooldown then return end - hooksecurefunc(cooldown, "SetCooldown", Cooldown_OnLoad) -end \ No newline at end of file +function Timers:AddCooldown(origin) + if(origin.HookedCooldown or not SV.db.system.cooldown) then return end + hooksecurefunc(origin, "SetCooldown", Cooldown_OnLoad) + origin.HookedCooldown = true +end + +SV.Timers = Timers; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/updates.lua b/Interface/AddOns/SVUI/system/updates.lua deleted file mode 100644 index 5430c99..0000000 --- a/Interface/AddOns/SVUI/system/updates.lua +++ /dev/null @@ -1,269 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local select = _G.select; -local pairs = _G.pairs; -local ipairs = _G.ipairs; -local type = _G.type; -local string = _G.string; -local math = _G.math; -local table = _G.table; -local GetTime = _G.GetTime; ---[[ STRING METHODS ]]-- -local format = string.format; ---[[ MATH METHODS ]]-- -local floor = math.floor; -- Basic ---[[ TABLE METHODS ]]-- -local twipe, tsort = table.wipe, table.sort; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SuperVillain, L = unpack(select(2, ...)) ---[[ -########################################################## -LOCALIZED GLOBALS -########################################################## -]]-- -local STANDARD_TEXT_FONT = _G.STANDARD_TEXT_FONT -local UNIT_NAME_FONT = _G.UNIT_NAME_FONT -local DAMAGE_TEXT_FONT = _G.DAMAGE_TEXT_FONT -local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS -local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS ---[[ -########################################################## -PRE VARS/FUNCTIONS -########################################################## -]]-- -local function SetFont(fontObject, font, fontSize, fontOutline, fontAlpha, color, shadowColor, offsetX, offsetY) - if not font then return end; - fontObject:SetFont(font,fontSize,fontOutline); - if fontAlpha then - fontObject:SetAlpha(fontAlpha) - end; - if color and type(color) == "table" then - fontObject:SetTextColor(unpack(color)) - end; - if shadowColor and type(shadowColor) == "table" then - fontObject:SetShadowColor(unpack(shadowColor)) - end; - if offsetX and offsetY then - fontObject:SetShadowOffset(offsetX,offsetY) - end; -end; ---[[ -########################################################## -CORE FUNCTIONS -########################################################## -]]-- -function SuperVillain:MediaUpdate() - self.Media.color.default = self.db.media.colors.default - self.Media.color.special = self.db.media.colors.special - self.Media.bg.pattern = self.Shared:Fetch("background", self.db.media.textures.pattern) - self.Media.bg.comic = self.Shared:Fetch("background", self.db.media.textures.comic) - self.Media.bg.unitlarge = self.Shared:Fetch("background", self.db.media.textures.unitlarge) - self.Media.bg.unitsmall = self.Shared:Fetch("background", self.db.media.textures.unitsmall) - - local cColor1 = self.Media.color.special - local cColor2 = self.Media.color.default - local r1,g1,b1 = cColor1[1], cColor1[2], cColor1[3] - local r2,g2,b2 = cColor2[1], cColor2[2], cColor2[3] - - self.Media.gradient.special = {"VERTICAL",r1,g1,b1,r2,g2,b2} - - self.Registry:RunCallbacks() -end - -function SuperVillain:RefreshSystemFonts() - local fontsize = self.db.media.fonts.size - local unicodesize = self.db.media.fonts.unicodeSize - - local NUMBER_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.number); - local GIANT_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.giant); - STANDARD_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.default); - UNIT_NAME_FONT = self.Shared:Fetch("font", self.db.media.fonts.name); - DAMAGE_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.combat); - NAMEPLATE_FONT = STANDARD_TEXT_FONT - CHAT_FONT_HEIGHTS = {8,9,10,11,12,13,14,15,16,17,18,19,20} - UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT = fontsize - - -- SetFont(GameFont_Gigantic, GIANT_TEXT_FONT, fontsize*3, "THICKOUTLINE", 32) - -- SetFont(SystemFont_Shadow_Huge1, GIANT_TEXT_FONT, fontsize*1.8, "OUTLINE") - -- SetFont(SystemFont_OutlineThick_Huge2, GIANT_TEXT_FONT, fontsize*1.8, "THICKOUTLINE") - - SetFont(QuestFont_Large, UNIT_NAME_FONT, fontsize+4) - SetFont(ZoneTextString, UNIT_NAME_FONT, fontsize*4.2, "OUTLINE") - SetFont(SubZoneTextString, UNIT_NAME_FONT, fontsize*3.2, "OUTLINE") - SetFont(PVPInfoTextString, UNIT_NAME_FONT, fontsize*1.9, "OUTLINE") - SetFont(PVPArenaTextString, UNIT_NAME_FONT, fontsize*1.9, "OUTLINE") - SetFont(SystemFont_Shadow_Outline_Huge2, UNIT_NAME_FONT, fontsize*1.8, "OUTLINE") - - SetFont(NumberFont_OutlineThick_Mono_Small, NUMBER_TEXT_FONT, fontsize, "OUTLINE") - SetFont(NumberFont_Outline_Huge, NUMBER_TEXT_FONT, fontsize*2, "THICKOUTLINE", 28) - SetFont(NumberFont_Outline_Large, NUMBER_TEXT_FONT, fontsize+4, "OUTLINE") - SetFont(NumberFont_Outline_Med, NUMBER_TEXT_FONT, fontsize+2, "OUTLINE") - SetFont(NumberFontNormal, NUMBER_TEXT_FONT, fontsize, "OUTLINE") - - SetFont(GameFontHighlight, STANDARD_TEXT_FONT, fontsize) - SetFont(GameFontWhite, STANDARD_TEXT_FONT, fontsize, 'OUTLINE', 1, {1,1,1}) - SetFont(GameFontWhiteSmall, STANDARD_TEXT_FONT, fontsize, 'NONE', 1, {1,1,1}) - SetFont(GameFontBlack, STANDARD_TEXT_FONT, fontsize, 'NONE', 1, {0,0,0}) - SetFont(GameFontBlackSmall, STANDARD_TEXT_FONT, fontsize, 'NONE', 1, {0,0,0}) - SetFont(GameFontNormal, STANDARD_TEXT_FONT, fontsize) - SetFont(QuestFont, STANDARD_TEXT_FONT, fontsize) - SetFont(SystemFont_Large, STANDARD_TEXT_FONT, fontsize+2) - SetFont(GameFontNormalMed3, STANDARD_TEXT_FONT, fontsize+1) - SetFont(SystemFont_Med1, STANDARD_TEXT_FONT, fontsize) - SetFont(SystemFont_Med3, STANDARD_TEXT_FONT, fontsize) - SetFont(SystemFont_Outline_Small, STANDARD_TEXT_FONT, fontsize, "OUTLINE") - SetFont(SystemFont_Shadow_Large, STANDARD_TEXT_FONT, fontsize+2) - SetFont(SystemFont_Shadow_Med1, STANDARD_TEXT_FONT, fontsize) - SetFont(SystemFont_Shadow_Med3, STANDARD_TEXT_FONT, fontsize) - SetFont(SystemFont_Shadow_Small, STANDARD_TEXT_FONT, fontsize) - SetFont(SystemFont_Small, STANDARD_TEXT_FONT, fontsize) - SetFont(FriendsFont_Normal, STANDARD_TEXT_FONT, fontsize) - SetFont(FriendsFont_Small, STANDARD_TEXT_FONT, fontsize-2) - SetFont(FriendsFont_Large, STANDARD_TEXT_FONT, fontsize) - SetFont(FriendsFont_UserText, STANDARD_TEXT_FONT, fontsize) - - SetFont(GameFont_Gigantic, GIANT_TEXT_FONT, 200, "THICKOUTLINE", 32) - SetFont(SystemFont_Shadow_Huge1, GIANT_TEXT_FONT, 200, "OUTLINE") - SetFont(SystemFont_OutlineThick_Huge2, GIANT_TEXT_FONT, 200, "THICKOUTLINE") - - SetFont(SystemFont_Shadow_Huge3, DAMAGE_TEXT_FONT, 200, "THICKOUTLINE") - SetFont(CombatTextFont, DAMAGE_TEXT_FONT, 200, "THICKOUTLINE") - - local UNICODE_FONT = self.Media.font.roboto; - - SetFont(GameTooltipHeader, UNICODE_FONT, unicodesize+2) - SetFont(Tooltip_Med, UNICODE_FONT, unicodesize) - SetFont(Tooltip_Small, UNICODE_FONT, unicodesize) - SetFont(GameFontNormalSmall, UNICODE_FONT, unicodesize) - SetFont(GameFontHighlightSmall, UNICODE_FONT, unicodesize) - SetFont(NumberFont_Shadow_Med, UNICODE_FONT, unicodesize) - SetFont(NumberFont_Shadow_Small, UNICODE_FONT, unicodesize) - SetFont(SystemFont_Tiny, UNICODE_FONT, unicodesize) - - self:UpdateFontTemplates() -end; - -function SuperVillain:RefreshAllSystemMedia() - local fontsize = self.db.media.fonts.size - local unicodesize = self.db.media.fonts.unicodeSize - - local NUMBER_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.number); - local GIANT_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.giant); - STANDARD_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.default); - UNIT_NAME_FONT = self.Shared:Fetch("font", self.db.media.fonts.name); - DAMAGE_TEXT_FONT = self.Shared:Fetch("font", self.db.media.fonts.combat); - NAMEPLATE_FONT = STANDARD_TEXT_FONT - CHAT_FONT_HEIGHTS = {8,9,10,11,12,13,14,15,16,17,18,19,20} - UIDROPDOWNMENU_DEFAULT_TEXT_HEIGHT = fontsize - - -- SetFont(GameFont_Gigantic, GIANT_TEXT_FONT, fontsize*3, "THICKOUTLINE", 32) - -- SetFont(SystemFont_Shadow_Huge1, GIANT_TEXT_FONT, fontsize*1.8, "OUTLINE") - -- SetFont(SystemFont_OutlineThick_Huge2, GIANT_TEXT_FONT, fontsize*1.8, "THICKOUTLINE") - - SetFont(QuestFont_Large, UNIT_NAME_FONT, fontsize+4) - SetFont(ZoneTextString, UNIT_NAME_FONT, fontsize*4.2, "OUTLINE") - SetFont(SubZoneTextString, UNIT_NAME_FONT, fontsize*3.2, "OUTLINE") - SetFont(PVPInfoTextString, UNIT_NAME_FONT, fontsize*1.9, "OUTLINE") - SetFont(PVPArenaTextString, UNIT_NAME_FONT, fontsize*1.9, "OUTLINE") - SetFont(SystemFont_Shadow_Outline_Huge2, UNIT_NAME_FONT, fontsize*1.8, "OUTLINE") - - SetFont(NumberFont_OutlineThick_Mono_Small, NUMBER_TEXT_FONT, fontsize, "OUTLINE") - SetFont(NumberFont_Outline_Huge, NUMBER_TEXT_FONT, fontsize*2, "THICKOUTLINE", 28) - SetFont(NumberFont_Outline_Large, NUMBER_TEXT_FONT, fontsize+4, "OUTLINE") - SetFont(NumberFont_Outline_Med, NUMBER_TEXT_FONT, fontsize+2, "OUTLINE") - SetFont(NumberFontNormal, NUMBER_TEXT_FONT, fontsize, "OUTLINE") - - SetFont(GameFontHighlight, STANDARD_TEXT_FONT, fontsize) - SetFont(GameFontWhite, STANDARD_TEXT_FONT, fontsize, 'OUTLINE', 1, {1,1,1}) - SetFont(GameFontWhiteSmall, STANDARD_TEXT_FONT, fontsize, 'NONE', 1, {1,1,1}) - SetFont(GameFontBlack, STANDARD_TEXT_FONT, fontsize, 'NONE', 1, {0,0,0}) - SetFont(GameFontBlackSmall, STANDARD_TEXT_FONT, fontsize, 'NONE', 1, {0,0,0}) - SetFont(GameFontNormal, STANDARD_TEXT_FONT, fontsize) - SetFont(QuestFont, STANDARD_TEXT_FONT, fontsize) - SetFont(SystemFont_Large, STANDARD_TEXT_FONT, fontsize+2) - SetFont(GameFontNormalMed3, STANDARD_TEXT_FONT, fontsize+1) - SetFont(SystemFont_Med1, STANDARD_TEXT_FONT, fontsize) - SetFont(SystemFont_Med3, STANDARD_TEXT_FONT, fontsize) - SetFont(SystemFont_Outline_Small, STANDARD_TEXT_FONT, fontsize, "OUTLINE") - SetFont(SystemFont_Shadow_Large, STANDARD_TEXT_FONT, fontsize+2) - SetFont(SystemFont_Shadow_Med1, STANDARD_TEXT_FONT, fontsize) - SetFont(SystemFont_Shadow_Med3, STANDARD_TEXT_FONT, fontsize) - SetFont(SystemFont_Shadow_Small, STANDARD_TEXT_FONT, fontsize) - SetFont(SystemFont_Small, STANDARD_TEXT_FONT, fontsize) - SetFont(FriendsFont_Normal, STANDARD_TEXT_FONT, fontsize) - SetFont(FriendsFont_Small, STANDARD_TEXT_FONT, fontsize-2) - SetFont(FriendsFont_Large, STANDARD_TEXT_FONT, fontsize) - SetFont(FriendsFont_UserText, STANDARD_TEXT_FONT, fontsize) - - SetFont(GameFont_Gigantic, GIANT_TEXT_FONT, 200, "THICKOUTLINE", 32) - SetFont(SystemFont_Shadow_Huge1, GIANT_TEXT_FONT, 200, "OUTLINE") - SetFont(SystemFont_OutlineThick_Huge2, GIANT_TEXT_FONT, 200, "THICKOUTLINE") - - SetFont(SystemFont_Shadow_Huge3, DAMAGE_TEXT_FONT, 200, "THICKOUTLINE") - SetFont(CombatTextFont, DAMAGE_TEXT_FONT, 200, "THICKOUTLINE") - - local UNICODE_FONT = self.Media.font.roboto; - - SetFont(GameTooltipHeader, UNICODE_FONT, unicodesize+2) - SetFont(Tooltip_Med, UNICODE_FONT, unicodesize) - SetFont(Tooltip_Small, UNICODE_FONT, unicodesize) - SetFont(GameFontNormalSmall, UNICODE_FONT, unicodesize) - SetFont(GameFontHighlightSmall, UNICODE_FONT, unicodesize) - SetFont(NumberFont_Shadow_Med, UNICODE_FONT, unicodesize) - SetFont(NumberFont_Shadow_Small, UNICODE_FONT, unicodesize) - SetFont(SystemFont_Tiny, UNICODE_FONT, unicodesize) - - self:MediaUpdate() - self.MediaInitialized = true -end ---[[ -########################################################## -INIT SOME COMBAT FONTS -########################################################## -]]-- -do - local fontFile = "Interface\\AddOns\\SVUI\\assets\\fonts\\Combat.ttf" - - DAMAGE_TEXT_FONT = fontFile - NUM_COMBAT_TEXT_LINES = 20; - COMBAT_TEXT_SCROLLSPEED = 1.0; - COMBAT_TEXT_FADEOUT_TIME = 1.0; - COMBAT_TEXT_HEIGHT = 18; - COMBAT_TEXT_CRIT_MAXHEIGHT = 2.0; - COMBAT_TEXT_CRIT_MINHEIGHT = 1.2; - COMBAT_TEXT_CRIT_SCALE_TIME = 0.7; - COMBAT_TEXT_CRIT_SHRINKTIME = 0.2; - COMBAT_TEXT_TO_ANIMATE = {}; - COMBAT_TEXT_STAGGER_RANGE = 20; - COMBAT_TEXT_SPACING = 7; - COMBAT_TEXT_MAX_OFFSET = 130; - COMBAT_TEXT_LOW_HEALTH_THRESHOLD = 0.2; - COMBAT_TEXT_LOW_MANA_THRESHOLD = 0.2; - COMBAT_TEXT_LOCATIONS = {}; - - local fName, fHeight, fFlags = CombatTextFont:GetFont() - - CombatTextFont:SetFont(fontFile, 24, fFlags) -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/utilities.lua b/Interface/AddOns/SVUI/system/utilities.lua index 3570031..1a28bff 100644 --- a/Interface/AddOns/SVUI/system/utilities.lua +++ b/Interface/AddOns/SVUI/system/utilities.lua @@ -37,29 +37,124 @@ local iLevelFilter = ITEM_LEVEL:gsub( "%%d", "(%%d+)" ) GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)) +local SV, L = unpack(select(2, ...)) --[[ ########################################################## MISC UTILITY FUNCTIONS ########################################################## ]]-- -function SuperVillain:ColorGradient(perc, ...) - if perc >= 1 then - return select(select('#', ...) - 2, ...) - elseif perc <= 0 then - return ... + +--[[ +########################################################## +DISPEL MECHANICS +########################################################## +]]-- +local RefClassRoles, RefUnitRoles; +local RefMagicSpec; +local PlayerClass = select(2,UnitClass("player")); + +if(PlayerClass == "PRIEST") then + RefClassRoles = {"C", "C", "C"} + RefUnitRoles = {"HEALER", "HEALER", "DAMAGER"} + SV.Dispellable = {["Magic"] = true, ["Disease"] = true} +elseif(PlayerClass == "WARLOCK") then + RefClassRoles = {"C", "C", "C"} + RefUnitRoles = {"DAMAGER", "DAMAGER", "DAMAGER"} +elseif(PlayerClass == "WARRIOR") then + RefClassRoles = {"M", "M", "T"} + RefUnitRoles = {"DAMAGER", "DAMAGER", "TANK"} +elseif(PlayerClass == "HUNTER") then + RefClassRoles = {"M", "M", "M"} + RefUnitRoles = {"DAMAGER", "DAMAGER", "DAMAGER"} +elseif(PlayerClass == "ROGUE") then + RefClassRoles = {"M", "M", "M"} + RefUnitRoles = {"DAMAGER", "DAMAGER", "DAMAGER"} +elseif(PlayerClass == "MAGE") then + RefClassRoles = {"C", "C", "C"} + RefUnitRoles = {"DAMAGER", "DAMAGER", "DAMAGER"} + SV.Dispellable = {["Curse"] = true} +elseif(PlayerClass == "DEATHKNIGHT") then + RefClassRoles = {"T", "M", "M"} + RefUnitRoles = {"TANK", "DAMAGER", "DAMAGER"} +elseif(PlayerClass == "DRUID") then + RefMagicSpec = 4 + RefClassRoles = {"C", "M", "T", "C"} + RefUnitRoles = {"DAMAGER", "DAMAGER", "TANK", "HEALER"} + SV.Dispellable = {["Curse"] = true, ["Poison"] = true} +elseif(PlayerClass == "SHAMAN") then + RefMagicSpec = 3 + RefClassRoles = {"C", "M", "C"} + RefUnitRoles = {"DAMAGER", "DAMAGER", "HEALER"} + SV.Dispellable = {["Curse"] = true} +elseif(PlayerClass == "MONK") then + RefMagicSpec = 2 + RefClassRoles = {"T", "C", "M"} + RefUnitRoles = {"TANK", "HEALER", "DAMAGER"} + SV.Dispellable = {["Disease"] = true, ["Poison"] = true} +elseif(PlayerClass == "PALADIN") then + RefMagicSpec = 1 + RefClassRoles = {"C", "T", "M"} + RefUnitRoles = {"HEALER", "TANK", "DAMAGER"} + SV.Dispellable = {["Poison"] = true, ["Disease"] = true} +end + +local function GetTalentInfo(arg) + if type(arg) == "number" then + return arg == GetActiveSpecGroup(); + else + return false; + end +end + +function SV:DefinePlayerRole() + local spec = GetSpecialization() + 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 + role = "M" + end + end + self.CurrentSpec = spec + self.RoleIsSet = true + else + local intellect = select(2, UnitStat("player", 4)) + local agility = select(2, UnitStat("player", 2)) + local baseAP, posAP, negAP = UnitAttackPower("player") + local totalAP = baseAP + posAP + negAP; + if totalAP > intellect or agility > intellect then + role = "M" + else + role = "C" + end end - local num = select('#', ...) / 3 - local segment, relperc = modf(perc*(num-1)) - local r1, g1, b1, r2, g2, b2 = select((segment*3)+1, ...) - return r1 + (r2-r1)*relperc, g1 + (g2-g1)*relperc, b1 + (b2-b1)*relperc -end; + if self.UnitRole ~= unitRole then + self.UnitRole = unitRole + end + if self.ClassRole ~= role then + self.ClassRole = role; + if self.RoleChangedCallback then + self.RoleChangedCallback() + end + end + if RefMagicSpec then + if(GetTalentInfo(RefMagicSpec)) then + self.Dispellable["Magic"] = true + elseif(self.Dispellable["Magic"]) then + self.Dispellable["Magic"] = nil + end + end +end --[[ ########################################################## POSITIONING UTILITY FUNCTIONS ########################################################## ]]-- -SuperVillain.PointIndexes = { +SV.PointIndexes = { ["TOP"] = "TOP", ["BOTTOM"] = "BOTTOM", ["LEFT"] = "LEFT", @@ -132,7 +227,7 @@ do return "CENTER" end}) - function SuperVillain:ReversePoint(frame, point, target, x, y) + function SV:ReversePoint(frame, point, target, x, y) if((not frame) or (not point)) then return; end local anchor = _inverted[point]; local relative = _translated[point]; @@ -143,7 +238,26 @@ do --[[ auto-set specific properties to save on logic ]]-- frame.initialAnchor = anchor; end -end; +end + +function SV:AnchorToCursor(frame) + local x, y = GetCursorPosition() + local vHold = self.yScreenArea + local scale = self.EffectiveScale + local initialAnchor = "CENTER" + local mod = 0 + + if(y > (vHold * 2)) then + initialAnchor = "TOPLEFT" + mod = -12 + elseif(y < vHold) then + initialAnchor = "BOTTOMLEFT" + mod = 12 + end + + frame:ClearAllPoints() + frame:SetPoint(initialAnchor, SV.UIParent, "BOTTOMLEFT", (x / scale), (y / scale) + mod) +end --[[ ########################################################## ITEM UTILITY FUNCTIONS @@ -201,7 +315,7 @@ do local function _getHeirloomLevel(unit, itemID) if(not itemID) then return; end local baseLevel = UnitLevel(unit) - if baseLevel > 85 then baseLevel = 85 end; + if baseLevel > 85 then baseLevel = 85 end if baseLevel > 80 then for i=1, #_heirlooms do if(_heirlooms[i] == itemID) then @@ -266,7 +380,7 @@ do return iLevel end - function SuperVillain:ParseGearSlots(unit, inspecting, firstCallback, secondCallback) + function SV:ParseGearSlots(unit, inspecting, firstCallback, secondCallback) local category = (inspecting) and "Inspect" or "Character"; local averageLevel,totalSlots,upgradeAdjust,globalName = 0,0,0; for slotName,flags in pairs(_slots) do @@ -288,13 +402,13 @@ do secondCallback(globalName, slotId) end end - end; + end if(averageLevel < 1 or totalSlots < 15) then return - end; + end return floor(averageLevel / totalSlots) end -end; +end --[[ ########################################################## CHAT LOG PARSING FUNCTIONS (from LibDeformat by:ckknight) @@ -369,7 +483,7 @@ do end) end if highest_index == 0 then - cache[pattern] = SuperVillain.fubar + cache[pattern] = SV.fubar else local t = {} t[#t+1] = [=[ @@ -422,7 +536,7 @@ do return cache[pattern] end - function SuperVillain:DeFormat(text, pattern) + function SV:DeFormat(text, pattern) if type(text) ~= "string" then error(("Error: DeFormat text argument %s (%s)."):format(type(text), text), 2) elseif type(pattern) ~= "string" then @@ -444,7 +558,7 @@ local Button_OnEnter = function(self, ...) GameTooltip:Show() end -function SuperVillain:CreateButton(frame, label, anchor, x, y, width, height, tooltip) +function SV:CreateButton(frame, label, anchor, x, y, width, height, tooltip) local button = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate") button:SetWidth(width) button:SetHeight(height) diff --git a/Interface/AddOns/SVUI/system/visibility.lua b/Interface/AddOns/SVUI/system/visibility.lua index 1ee44d0..02fb146 100644 --- a/Interface/AddOns/SVUI/system/visibility.lua +++ b/Interface/AddOns/SVUI/system/visibility.lua @@ -26,7 +26,7 @@ local pairs = _G.pairs; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SV, L = unpack(select(2, ...)); --[[ ########################################################## LOCALS @@ -40,34 +40,34 @@ local SecureFadeFrames = {}; FRAME VISIBILITY MANAGEMENT ########################################################## ]]-- -function SuperVillain:AddToDisplayAudit(frame) +function SV:AddToDisplayAudit(frame) if frame.IsVisible and frame:GetName() then self.DisplayAudit[frame:GetName()] = true end -end; +end -function SuperVillain:FlushDisplayAudit() - if InCombatLockdown() then return end; +function SV:FlushDisplayAudit() + if InCombatLockdown() then return end for frame,_ in pairs(self.DisplayAudit)do if _G[frame] then - _G[frame]:SetParent(SuperVillain.Cloaked) + _G[frame]:SetParent(SV.Cloaked) end - end; + end DisplayEventHandler:RegisterEvent("PLAYER_REGEN_DISABLED") -end; +end -function SuperVillain:PushDisplayAudit() - if InCombatLockdown() then return end; +function SV:PushDisplayAudit() + if InCombatLockdown() then return end for frame,_ in pairs(self.DisplayAudit)do if _G[frame] then _G[frame]:SetParent(UIParent) end - end; + end DisplayEventHandler:UnregisterEvent("PLAYER_REGEN_DISABLED") -end; +end local DisplayAudit_OnEvent = function(self, event, arg, ...) - SuperVillain:PushDisplayAudit() + SV:PushDisplayAudit() end DisplayEventHandler:SetScript("OnEvent", DisplayAudit_OnEvent) @@ -87,26 +87,32 @@ local function SecureFadeRemoveFrame(frame) SafeFrameRemoval(SecureFadeFrames, frame); end -function SuperVillain:SecureFade_OnUpdate(value) +local SecureFade_OnUpdate = function(self, elasped) local i = 1; local this, safeFadeState; - while SecureFadeFrames[i] do + + while SecureFadeFrames[i] do this = SecureFadeFrames[i] + safeFadeState = this._secureFade; - safeFadeState.fadeTimer = (safeFadeState.fadeTimer or 0) + value; - safeFadeState.fadeTimer = safeFadeState.fadeTimer + value; + safeFadeState.fadeTimer = (safeFadeState.fadeTimer or 0) + elasped; + safeFadeState.fadeTimer = safeFadeState.fadeTimer + elasped; if safeFadeState.fadeTimer < safeFadeState.timeToFade then - if safeFadeState.mode == "IN" then - this:SetAlpha(safeFadeState.fadeTimer / safeFadeState.timeToFade * safeFadeState.endAlpha - safeFadeState.startAlpha + safeFadeState.startAlpha) - elseif safeFadeState.mode == "OUT" then - this:SetAlpha((safeFadeState.timeToFade - safeFadeState.fadeTimer) / safeFadeState.timeToFade * safeFadeState.startAlpha - safeFadeState.endAlpha + safeFadeState.endAlpha) + + if(safeFadeState.mode == "IN") then + this:SetAlpha((safeFadeState.fadeTimer / safeFadeState.timeToFade) * (safeFadeState.endAlpha - safeFadeState.startAlpha) + safeFadeState.startAlpha) + elseif(safeFadeState.mode == "OUT") then + this:SetAlpha(((safeFadeState.timeToFade - safeFadeState.fadeTimer) / safeFadeState.timeToFade) * (safeFadeState.startAlpha - safeFadeState.endAlpha) + safeFadeState.endAlpha) end + else this:SetAlpha(safeFadeState.endAlpha) SecureFadeRemoveFrame(this) + if not this:IsProtected() and safeFadeState.hideOnFinished and this:IsShown() then this:Hide() end + if (safeFadeState.finishedFunc) then safeFadeState.finishedFunc(safeFadeState.finishedArg1, safeFadeState.finishedArg2, safeFadeState.finishedArg3, safeFadeState.finishedArg4) safeFadeState.finishedFunc = nil @@ -117,14 +123,13 @@ function SuperVillain:SecureFade_OnUpdate(value) if #SecureFadeFrames == 0 then SecureFadeManager:SetScript("OnUpdate", nil) end -end; +end -function SuperVillain:SecureFade(this, safeFadeState) - if not this then return end; - local safeFadeState = this._secureFade +local function HandleFading(this, safeFadeState) + if not this then return end if not safeFadeState.mode then safeFadeState.mode = "IN" - end; + end if safeFadeState.mode == "IN" then if not this:IsProtected() and not this:IsShown() then this:Show() end @@ -141,48 +146,50 @@ function SuperVillain:SecureFade(this, safeFadeState) if not safeFadeState.endAlpha then safeFadeState.endAlpha = 0 end - end; + end this:SetAlpha(safeFadeState.startAlpha) - + this._secureFade = safeFadeState local i=1; while SecureFadeFrames[i] do - if SecureFadeFrames[i]==this then + if SecureFadeFrames[i] == this then return - end; + end i = i + 1; - end; + end SecureFadeFrames[#SecureFadeFrames + 1] = this; - SecureFadeManager:SetScript("OnUpdate", SuperVillain.SecureFade_OnUpdate) -end; + SecureFadeManager:SetScript("OnUpdate", SecureFade_OnUpdate) +end -function SuperVillain:SecureFadeIn(this, duration, startAlpha, endAlpha) - if(not this._secureFade) then - this._secureFade = {} - end - this._secureFade.mode = "IN" - this._secureFade.timeToFade = duration; - this._secureFade.startAlpha = startAlpha or 0; - this._secureFade.endAlpha = endAlpha or 1; - this._secureFade.hideOnFinished = false; - this._secureFade.finishedFunc = nil - SuperVillain:SecureFade(this) -end; - -function SuperVillain:SecureFadeOut(this, duration, startAlpha, endAlpha, hideOnFinished) - if(not this._secureFade) then - this._secureFade = {} - end - this._secureFade.mode = "OUT" - this._secureFade.timeToFade = duration; - this._secureFade.startAlpha = startAlpha or 1; - this._secureFade.endAlpha = endAlpha or 0; - this._secureFade.hideOnFinished = hideOnFinished; - this._secureFade.finishedFunc = nil - SuperVillain:SecureFade(this) -end; - -function SuperVillain:SecureFadeRemoval(this) +function SV:SecureFadeIn(this, duration, startAlpha, endAlpha) + local safeFadeState = {} + safeFadeState.mode = "IN" + safeFadeState.timeToFade = duration; + safeFadeState.startAlpha = startAlpha or 0; + safeFadeState.endAlpha = endAlpha or 1; + safeFadeState.hideOnFinished = false; + safeFadeState.finishedFunc = nil + + this._secureFade = safeFadeState + + HandleFading(this, safeFadeState) +end + +function SV:SecureFadeOut(this, duration, startAlpha, endAlpha, hideOnFinished) + local safeFadeState = {} + safeFadeState.mode = "OUT" + safeFadeState.timeToFade = duration; + safeFadeState.startAlpha = startAlpha or 1; + safeFadeState.endAlpha = endAlpha or 0; + safeFadeState.hideOnFinished = hideOnFinished; + safeFadeState.finishedFunc = nil + + this._secureFade = safeFadeState + + HandleFading(this, safeFadeState) +end + +function SV:SecureFadeRemoval(this) local i = 1; while SecureFadeFrames[i] do if this == SecureFadeFrames[i] then @@ -192,4 +199,4 @@ function SuperVillain:SecureFadeRemoval(this) i = i + 1; end end -end; \ No newline at end of file +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua index 911f9fa..691e25d 100644 --- a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua +++ b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua @@ -48,13 +48,12 @@ GET ADDON DATA ########################################################## ]]-- local SVUIAddOnName, PLUGIN = ...; -local SuperVillain, L = unpack(SVUI); -local CONFIGS = SuperVillain.Configs +local SV, L, Registry = unpack(SVUI); +local CONFIGS = SV.Configs local NewHook = hooksecurefunc; -local SVUIAddonEventHandler = CreateFrame("Frame", nil) -local version = GetAddOnMetadata(..., "Version"); -PLUGIN = SuperVillain:Prototype(SVUIAddOnName, version) +PLUGIN = SV:Prototype(SVUIAddOnName) +local SCHEMA = PLUGIN.___schema; _G["WhisperVillain"] = PLUGIN; --[[ @@ -65,18 +64,16 @@ 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]] +local DEFAULT_GRADIENT = {"VERTICAL", 0.08, 0.08, 0.08, 0.22, 0.22, 0.22} +local GREEN_GRADIENT = {"VERTICAL", 0.08, 0.5, 0, 0.25, 0.9, 0.08} +local YELLOW_GRADIENT = {"VERTICAL", 1, 0.3, 0, 1, 1, 0} --[[ ########################################################## DIALOG TABLES @@ -437,47 +434,10 @@ LOCAL FUNCTIONS ########################################################## ]]-- local function ServiceMessage(msg) - local msgFrom = SuperVillain.db.SVAnswer.prefix == true and "Minion Answering Service" or ""; + local msgFrom = SV.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 +460,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 +701,147 @@ 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 = GREEN_GRADIENT + 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(YELLOW_GRADIENT)) + self.Docklet.stateColor = YELLOW_GRADIENT + else + self.Docklet:SetPanelColor("green") + self.Docklet.icon:SetGradient(unpack(GREEN_GRADIENT)) + self.Docklet.stateColor = GREEN_GRADIENT + end + else + self.Docklet:SetPanelColor("default") + self.Docklet.stateColor = DEFAULT_GRADIENT + 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(event, 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(event, 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(event, inbound_message, sender, _, _, _, _, _, _, _, _, _, _, presenceID) + if(not presenceID) then return end 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 +849,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,137 +873,73 @@ 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 --[[ ########################################################## LOAD AND CONSTRUCT ########################################################## ]]-- -local function LoadOptions() - SuperVillain.Options.args.plugins.args.pluginOptions.args.SVAnswer = { - type = "group", - name = L["Answering Service"], - childGroups = "tree", - args = { - enable = { - 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 - }, - 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 - }, - 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 - }, - } - } -end - -local AnsweringOnClick = function() - if HenchmenOperator:IsShown() then - HenchmenOperator:Hide() - else - HenchmenOperator:Show() - end -end - -local function LoadAnsweringService() - if(not SuperVillain.db.SVAnswer.enable) then return end - - PLUGIN.db = SuperVillain.db.SVAnswer +function PLUGIN:Load() + if(not SV.db[SCHEMA].enable) then return end - 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.db = SV.db[SCHEMA] + + 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, 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 = {"VERTICAL", 0.33, 0.25, 0.13, 0.47, 0.39, 0.27} + docklet.TText = L["Show / Hide Phone Lines"] + docklet:RegisterForClicks("AnyUp") + + SV.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, 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 +954,41 @@ 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 SV.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) + SV:AddonMessage(strMsg) + + local option = { + order = 2, + type = "toggle", + name = "Auto Answer", + get = function(a) return SV.db[SCHEMA].autoAnswer end, + set = function(a,b) SV.db[SCHEMA].autoAnswer = b end + }; + self:AddOption("autoAnswer", option) + + option = { + order = 3, + type = "toggle", + name = "Prefix Messages", + get = function(a) return SV.db[SCHEMA].prefix end, + set = function(a,b) SV.db[SCHEMA].prefix = b end + }; + self:AddOption("prefix", option) end -CONFIGS["SVAnswer"] = { - ["enable"] = false, +CONFIGS[SCHEMA] = { + ["enable"] = true, ["autoAnswer"] = false, ["prefix"] = true } -SuperVillain.Registry:NewScript(LoadAnsweringService) -SuperVillain.Registry:NewPlugin(PLUGIN, "SVAnswer", LoadOptions) \ No newline at end of file +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 749204f..e797e5b 100644 --- a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.toc +++ b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.toc @@ -1,8 +1,11 @@ ## Interface: 60000 ## Author: Munglunch -## Version: 5.02 +## Version: 4.4 ## Title: |cffFF9900SVUI |r|cffFFEF00Answering Service|r -## Notes: Supervillain UI [|cff9911FFAutomatic Whispers|r]. +## Notes: Supervillain UI [|cff9911FFAutomatic Whispers|r] ## RequiredDeps: SVUI +## LoadOnDemand: 1 +## X-SVUI-Header: Answering Service +## X-SVUI-Schema: SVAnswer SVUI_AnsweringService.lua diff --git a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua index 1d150b5..59084a7 100644 --- a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua +++ b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua @@ -47,13 +47,12 @@ GET ADDON DATA ########################################################## ]]-- local SVUIAddOnName, PLUGIN = ...; -local SuperVillain, L = unpack(SVUI); -local CONFIGS = SuperVillain.Configs +local SV, L, Registry = unpack(SVUI); +local CONFIGS = SV.Configs local NewHook = hooksecurefunc; -local SVUIAddonEventHandler = CreateFrame("Frame", nil) -local version = GetAddOnMetadata(..., "Version") -PLUGIN = SuperVillain:Prototype(SVUIAddOnName, version) +PLUGIN = SV:Prototype(SVUIAddOnName) +local SCHEMA = PLUGIN.___schema; _G["WarVillain"] = PLUGIN; --[[ @@ -61,7 +60,7 @@ _G["WarVillain"] = PLUGIN; GLOBAL SLASH FUNCTIONS ########################################################## ]]-- -BINDING_HEADER_SVUIAOW = "SuperVillain UI: Art of War"; +BINDING_HEADER_SVUIAOW = "Supervillain UI: Art of War"; function SVUISayIncoming() local subzoneText = GetSubZoneText() @@ -77,7 +76,112 @@ LOCAL FUNCTIONS local function HeadsUpAlarm(...) if not CombatText_AddMessage then return end CombatText_AddMessage(...) -end +end +--[[ +########################################################## +MUNGLUNCH's FAVORITE EMOTE GENERATOR +########################################################## +]]-- +local SpecialEmotes = { + "ROFL", + "CACKLE", + "GIGGLE", + "GRIN", + "SMIRK", + "MOON", + "LICK", + "YAWN", + "FLEX", + "TICKLE", + "TAUNT", + "SHOO", + "PRAY", + "SPIT", + "MOCK", + "GLOAT", + "PITY", + "VIOLIN", + "BYE", +} + +local LowHealthPlayerEmotes = { + "ROFL", + "CACKLE", + "GIGGLE", + "GRIN", + "SMIRK", + "MOON", + "LICK", + "YAWN", + "BITE", + "NOSEPICK" +} + +local LowHealthTargetEmotes = { + "ROFL", + "CACKLE", + "FLEX", + "TICKLE", + "TAUNT", + "SHOO", + "PRAY", + "SPIT", + "MOCK", + "GLOAT", + "PITY", + "VIOLIN", + "BYE", +} + +local KOSEmotes = { + "THREATEN", + "CRACK", + "POINT", + "GRIN", + "SMIRK", + "TAUNT", + "CHICKEN" +} + +local StealthEmotes = { + "CURIOUS", + "EYE", + "GASP", + "GAZE", + "MOCK", + "NOSEPICK", + "PEER", + "POINT", + "READY", + "STARE", + "TAP", +} + + +function SVUIEmote() + local index = random(1,#SpecialEmotes) + DoEmote(SpecialEmotes[index]) +end + +local function LowHealth_PlayerEmote() + local index = random(1,#LowHealthPlayerEmotes) + DoEmote(LowHealthPlayerEmotes[index]) +end + +local function LowHealth_TargetEmote() + local index = random(1,#LowHealthTargetEmotes) + DoEmote(LowHealthTargetEmotes[index]) +end + +local function KOS_Emote() + local index = random(1,#KOSEmotes) + DoEmote(KOSEmotes[index]) +end + +local function Stealth_Emote(name) + local index = random(1,#StealthEmotes) + DoEmote(StealthEmotes[index], name) +end --[[ ########################################################## CORE FUNCTIONS @@ -88,7 +192,7 @@ local EnemyCache, AlertedCache = {},{} local playerGUID = UnitGUID('player') local playerFaction = UnitFactionGroup("player") local classColor = RAID_CLASS_COLORS -local classColors = SVUI_CLASS_COLORS[SuperVillain.class] +local classColors = SVUI_CLASS_COLORS[SV.class] local classR, classG, classB = classColors.r, classColors.g, classColors.b local classA = 0.35 local fallbackColor = {r=1,g=1,b=1} @@ -119,6 +223,40 @@ local PVP_NODES = { }, } +-- local PVP_POI = { +-- [401] = { --Alterac Valley (15) +-- "Stormpike Aid Station", "Dun Baldar North Bunker", "Dun Baldar South Bunker", +-- "Stormpike Graveyard", "Icewing Bunker", "Stonehearth Graveyard", +-- "Stonehearth Bunker", "Snowfall Graveyard", "Iceblood Tower", +-- "Iceblood Graveyard", "Tower Point", "Frostwolf Graveyard", +-- "West Frostwolf Tower", "East Frostwolf Tower", "Frostwolf Relief Hut" +-- }, +-- [935] = { --Deepwind Gorge (2) +-- "Horde Cart", "Alliance Cart" +-- }, +-- [482] = { --Eye of the Storm (1) +-- "Flag" +-- }, +-- [860] = { --Silvershard Mines (1) +-- "Cart" +-- }, +-- [512] = { --Strand of the Ancients (5) +-- "Green Emerald", "Blue Sapphire", "Purple Amethyst", "Red Sun", "Yellow Moon" +-- }, +-- [540] = { --Isle of Conquest (5) +-- "Quarry", "Hangar", "Workshop", "Docks", "Refinery" +-- }, +-- [856] = { --Temple of Kotmogu (4) +-- "Red Orb", "Blue Orb", "Orange Orb", "Purple Orb" +-- }, +-- [626] = { --Twin Peaks (2) +-- "Horde Flag", "Alliance Flag" +-- }, +-- [443] = { --Warsong Gulch (2) +-- "Horde Flag", "Alliance Flag" +-- }, +-- } + local Safe_OnEnter = function(self) if InCombatLockdown() then return end local zone = self.name @@ -242,9 +380,11 @@ local function EnemyAlarm(name, class, colors, kos) end end -local function StealthAlarm(name) - local msg = ("%s Detected!"):format(name); +local function StealthAlarm(spell, name) + local msg = ("%s Detected!"):format(spell); HeadsUpAlarm(msg, CombatText_StandardScroll, 1, 0.5, 0); + print(("%s has %sed nearby!"):format(name, spell)) + --Stealth_Emote(name) end function PLUGIN:UpdateSummary() @@ -371,7 +511,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 +529,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() @@ -399,7 +539,7 @@ end function PLUGIN:UpdateZoneStatus() local zoneText = GetRealZoneText() or GetZoneText() if(not zoneText or zoneText == "") then - SuperVillain:ExecuteTimer(PLUGIN.UpdateZoneStatus, 5) + SV.Timers:ExecuteTimer(PLUGIN.UpdateZoneStatus, 5) return end if(zoneText ~= ACTIVE_ZONE) then @@ -465,11 +605,12 @@ local function GetSourceType(guid) subStr = guid:sub(3, 5) binStr = ("0x%s"):format(subStr) bitVal = tonumber(binStr) + if(not bitVal) then return end srcType = band(bitVal, 0x00F) return srcType end -function PLUGIN:CombatLogScanner(timestamp, event, _, srcGUID, srcName, srcFlags, sourceRaidFlags, dstGUID, dstName, dstFlags, destRaidFlags, _, spellName) +function PLUGIN:COMBAT_LOG_EVENT_UNFILTERED(event, 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 @@ -480,7 +621,7 @@ function PLUGIN:CombatLogScanner(timestamp, event, _, srcGUID, srcName, srcFlags local srcType = GetSourceType(srcGUID) 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) + StealthAlarm(spellName, srcName) end if(dstGUID == playerGUID) then PLUGIN.HitBy = srcGUID @@ -506,56 +647,39 @@ 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") + --KOS_Emote() + 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() @@ -577,7 +701,7 @@ local function MakeLogWindow() output:SetClampedToScreen(false) output:SetFrameStrata("MEDIUM") output:SetAllPoints(frame) - output:SetFont(SuperVillain.Media.font.system, 11, "OUTLINE") + output:SetFont(SV.Media.font.system, 11, "OUTLINE") output:SetJustifyH("CENTER") output:SetJustifyV("MIDDLE") output:SetShadowColor(0, 0, 0, 0) @@ -600,16 +724,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() @@ -626,7 +740,7 @@ local function MakeCommWindow() local fbText = fallback:CreateFontString(nil, "OVERLAY") fbText:SetAllPoints(fallback) - fbText:SetFont(SuperVillain.Media.font.roboto, 12, "NONE") + fbText:SetFont(SV.Media.font.roboto, 12, "NONE") fbText:SetText("Nothing To Broadcast Right Now") frame.Unavailable = fallback @@ -680,7 +794,7 @@ local function MakeCommWindow() poi.Help = help poi.Text = poi:CreateFontString(nil,"OVERLAY") - poi.Text:SetFont(SuperVillain.Media.font.roboto, 12, "NONE") + poi.Text:SetFont(SV.Media.font.roboto, 12, "NONE") poi.Text:SetPoint("TOPLEFT", poi, "TOPLEFT", 2, 0) poi.Text:SetPoint("BOTTOMRIGHT", help, "BOTTOMLEFT", -2, 0) poi.Text:SetJustifyH("CENTER") @@ -705,7 +819,7 @@ local function MakeUtilityWindow() local fbText = frame:CreateFontString(nil, "OVERLAY") fbText:SetAllPoints(frame) - fbText:SetFont(SuperVillain.Media.font.roboto, 12, "NONE") + fbText:SetFont(SV.Media.font.roboto, 12, "NONE") fbText:SetText("Utilities Coming Soon....") PLUGIN.TOOL = frame @@ -730,26 +844,26 @@ local function MakeInfoWindow() leftColumn:Size(DATA_WIDTH, DATA_HEIGHT) leftColumn:Point("LEFT", frame, "LEFT", 0, 0) leftColumn.lockedOpen = true - SuperVillain.SVStats:NewAnchor(leftColumn, 3, "ANCHOR_CURSOR", nil, "Transparent", true) + SV.SVStats:NewAnchor(leftColumn, 3, "ANCHOR_CURSOR", nil, "Transparent", true) leftColumn:SetFrameLevel(0) local rightColumn = CreateFrame("Frame", "SVUI_ArtOfWarInfoRight", frame) rightColumn:Size(DATA_WIDTH, DATA_HEIGHT) rightColumn:Point("LEFT", leftColumn, "RIGHT", 2, 0) rightColumn.lockedOpen = true - SuperVillain.SVStats:NewAnchor(rightColumn, 3, "ANCHOR_CURSOR", nil, "Transparent", true) + SV.SVStats:NewAnchor(rightColumn, 3, "ANCHOR_CURSOR", nil, "Transparent", true) rightColumn:SetFrameLevel(0) PLUGIN.INFO = frame _G["SVUI_ArtOfWarTool4"].Window = PLUGIN.INFO - SuperVillain.SVStats.BGPanels = { + SV.SVStats.BGPanels = { ["SVUI_ArtOfWarInfoLeft"] = {top = "Honor", middle = "Kills", bottom = "Assists"}, ["SVUI_ArtOfWarInfoRight"] = {top = "Damage", middle = "Healing", bottom = "Deaths"} } - SuperVillain.SVStats:Generate() + SV.SVStats:Generate() PLUGIN.INFO:Hide() end @@ -769,13 +883,13 @@ end local ArtOfWarAlert_OnLeave = function(self) GameTooltip:Hide() - if InCombatLockdown() then return end; + if InCombatLockdown() then return end self:SetBackdropColor(0.25, 0.52, 0.1) end local ArtOfWarAlert_OnHide = function() if InCombatLockdown() then - SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); + SV:AddonMessage(ERR_NOT_IN_COMBAT); return; end SuperDockAlertRight:Deactivate() @@ -783,22 +897,22 @@ end local ArtOfWarAlert_OnShow = function(self) if InCombatLockdown() then - SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); + SV:AddonMessage(ERR_NOT_IN_COMBAT); self:Hide() return; end - SuperVillain:SecureFadeIn(self, 0.3, 0, 1) + SV:SecureFadeIn(self, 0.3, 0, 1) SuperDockAlertRight:Activate(self) end local ArtOfWarAlert_OnMouseDown = function(self) -- DO STUFF - SuperVillain:SecureFadeOut(self, 0.5, 1, 0, true) + SV:SecureFadeOut(self, 0.5, 1, 0, true) end local ArtOfWarTool_OnEnter = function(self) if InCombatLockdown() then return; end - self.icon:SetGradient(unpack(SuperVillain.Media.gradient.yellow)) + self.icon:SetGradient(unpack(SV.Media.gradient.yellow)) GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) GameTooltip:ClearLines() GameTooltip:AddLine(self.TText, 1, 1, 1) @@ -812,21 +926,21 @@ local ArtOfWarTool_OnLeave = function(self) end local ArtOfWarTool_OnMouseDown = function(self) - SuperVillain:SecureFadeOut(PLUGIN.LOG, 0.5, 1, 0, true) - SuperVillain:SecureFadeOut(PLUGIN.COMM, 0.5, 1, 0, true) - SuperVillain:SecureFadeOut(PLUGIN.TOOL, 0.5, 1, 0, true) - SuperVillain:SecureFadeOut(PLUGIN.INFO, 0.5, 1, 0, true) - SuperVillain:SecureFadeIn(self.Window, 0.3, 0, 1) + SV:SecureFadeOut(PLUGIN.LOG, 0.5, 1, 0, true) + SV:SecureFadeOut(PLUGIN.COMM, 0.5, 1, 0, true) + SV:SecureFadeOut(PLUGIN.TOOL, 0.5, 1, 0, true) + SV:SecureFadeOut(PLUGIN.INFO, 0.5, 1, 0, true) + SV:SecureFadeIn(self.Window, 0.3, 0, 1) PLUGIN.Title:Clear(); PLUGIN.Title:AddMessage(self.TTitle, 1, 1, 0); end local Scanner_OnMouseDown = function(self) - SuperVillain:SecureFadeOut(PLUGIN.LOG, 0.5, 1, 0, true) - SuperVillain:SecureFadeOut(PLUGIN.COMM, 0.5, 1, 0, true) - SuperVillain:SecureFadeOut(PLUGIN.TOOL, 0.5, 1, 0, true) - SuperVillain:SecureFadeOut(PLUGIN.INFO, 0.5, 1, 0, true) - SuperVillain:SecureFadeIn(self.Window, 0.3, 0, 1) + SV:SecureFadeOut(PLUGIN.LOG, 0.5, 1, 0, true) + SV:SecureFadeOut(PLUGIN.COMM, 0.5, 1, 0, true) + SV:SecureFadeOut(PLUGIN.TOOL, 0.5, 1, 0, true) + SV:SecureFadeOut(PLUGIN.INFO, 0.5, 1, 0, true) + SV:SecureFadeIn(self.Window, 0.3, 0, 1) PLUGIN:PopulateScans() end @@ -870,39 +984,22 @@ end BUILD FUNCTION ########################################################## ]]-- -local function LoadOptions() - SuperVillain.Options.args.plugins.args.pluginOptions.args.SVAOW = { - type = "group", - name = L["Art of War"], - childGroups = "tree", - args = { - enable = { - 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 - } - } - } -end - -local function LoadWarVillain() - if(not SuperVillain.db.SVAOW.enable) then return end +function PLUGIN:Load() + if(not SV.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 = SV.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") @@ -979,7 +1076,7 @@ local function LoadWarVillain() title:SetFrameStrata("MEDIUM") title:SetPoint("TOPLEFT", toolBar, "TOPRIGHT",0,0) title:SetPoint("BOTTOMRIGHT", holder, "TOPRIGHT",0,-16) - title:SetFontTemplate(SuperVillain.Media.font.names, 16, "OUTLINE", "CENTER", "MIDDLE") + title:SetFontTemplate(SV.Media.font.names, 16, "OUTLINE", "CENTER", "MIDDLE") title:SetMaxLines(1) title:EnableMouseWheel(false) title:SetFading(false) @@ -991,7 +1088,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) @@ -1002,7 +1099,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) @@ -1010,13 +1107,13 @@ local function LoadWarVillain() summary:SetFrameStrata("MEDIUM") summary:SetPoint("TOPLEFT", title, "BOTTOMLEFT",0,0) summary:SetPoint("BOTTOMRIGHT", title, "BOTTOMRIGHT",0,-14) - summary:SetFontTemplate(SuperVillain.Media.font.system, 12, "OUTLINE", "CENTER", "MIDDLE") + summary:SetFontTemplate(SV.Media.font.system, 12, "OUTLINE", "CENTER", "MIDDLE") summary:SetMaxLines(1) summary:EnableMouse(false) 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) @@ -1029,27 +1126,40 @@ local function LoadWarVillain() MakeUtilityWindow() MakeInfoWindow() - SuperVillain:RegisterDocklet("SVUI_ArtOfWarDock", "Art of War", ICON_FILE) + SV:RegisterDocklet("SVUI_ArtOfWarDock", "Art of War", ICON_FILE) 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) -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") ---/tar Munglunch + 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") + + --SVUI_Player.Health.LowAlertFunc = LowHealth_PlayerEmote + --SVUI_Target.Health.LowAlertFunc = LowHealth_TargetEmote +end -CONFIGS["SVAOW"] = { +CONFIGS[SCHEMA] = { ["enable"] = true } -SuperVillain.Registry:NewScript(LoadWarVillain) -SuperVillain.Registry:NewPlugin(PLUGIN, "SVAOW", LoadOptions) \ No newline at end of file +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 424124f..201a470 100644 --- a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.toc +++ b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.toc @@ -1,10 +1,13 @@ ## Interface: 60000 ## Author: Munglunch -## Version: 5.02 +## Version: 4.4 ## Title: |cffFF9900SVUI |r|cffFFEF00Art of War|r ## Notes: Supervillain UI [|cff9911FFPvP Tools|r]. ## SavedVariables: SVAOW_Data ## SavedVariablesPerCharacter: SVAOW_Cache ## RequiredDeps: SVUI +## LoadOnDemand: 1 +## X-SVUI-Header: Art of War +## X-SVUI-Schema: SVAOW SVUI_ArtOfWar.lua diff --git a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua index 489450d..8a9b8a0 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua @@ -29,110 +29,110 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local Ace3Config = LibStub("AceConfig-3.0"); local Ace3ConfigDialog = LibStub("AceConfigDialog-3.0"); -Ace3Config:RegisterOptionsTable("SVUI", SuperVillain.Options); +Ace3Config:RegisterOptionsTable("SVUI", SV.Options); Ace3ConfigDialog:SetDefaultSize("SVUI", 890, 651); local AceGUI = LibStub("AceGUI-3.0", true); local posOpts = {TOPLEFT='TOPLEFT',LEFT='LEFT',BOTTOMLEFT='BOTTOMLEFT',RIGHT='RIGHT',TOPRIGHT='TOPRIGHT',BOTTOMRIGHT='BOTTOMRIGHT',CENTER='CENTER',TOP='TOP',BOTTOM='BOTTOM'}; -local GEAR = SuperVillain.SVGear; -local BAG = SuperVillain.SVBag; -local OVR = SuperVillain.SVOverride; -local sortingFunction = function(arg1, arg2) return arg1 < arg2 end; +local GEAR = SV.SVGear; +local BAG = SV.SVBag; +local OVR = SV.SVOverride; +local sortingFunction = function(arg1, arg2) return arg1 < arg2 end local function CommonFontSizeUpdate() - local STANDARDFONTSIZE = SuperVillain.db.media.fonts.size; + local STANDARDFONTSIZE = SV.db.media.fonts.size; local smallfont = STANDARDFONTSIZE - 2; local largefont = STANDARDFONTSIZE + 2; - SuperVillain.db.SVAura.fontSize = STANDARDFONTSIZE; - SuperVillain.db.SVStats.fontSize = STANDARDFONTSIZE; - SuperVillain.db.SVUnit.fontSize = STANDARDFONTSIZE; - SuperVillain.db.SVUnit.auraFontSize = smallfont; + SV.db.SVAura.fontSize = STANDARDFONTSIZE; + SV.db.SVStats.fontSize = STANDARDFONTSIZE; + SV.db.SVUnit.fontSize = STANDARDFONTSIZE; + SV.db.SVUnit.auraFontSize = smallfont; - SuperVillain.db.SVBar.fontSize = smallfont; - SuperVillain.db.SVPlate.fontSize = smallfont; + SV.db.SVBar.fontSize = smallfont; + SV.db.SVPlate.fontSize = smallfont; - SuperVillain.db.SVLaborer.fontSize = largefont; + SV.db.SVLaborer.fontSize = largefont; - SuperVillain.db.SVUnit.player.health.fontSize = largefont; - SuperVillain.db.SVUnit.player.power.fontSize = largefont; - SuperVillain.db.SVUnit.player.name.fontSize = largefont; - SuperVillain.db.SVUnit.player.aurabar.fontSize = STANDARDFONTSIZE; + SV.db.SVUnit.player.health.fontSize = largefont; + SV.db.SVUnit.player.power.fontSize = largefont; + SV.db.SVUnit.player.name.fontSize = largefont; + SV.db.SVUnit.player.aurabar.fontSize = STANDARDFONTSIZE; - SuperVillain.db.SVUnit.target.health.fontSize = largefont; - SuperVillain.db.SVUnit.target.power.fontSize = largefont; - SuperVillain.db.SVUnit.target.name.fontSize = largefont; - SuperVillain.db.SVUnit.target.aurabar.fontSize = STANDARDFONTSIZE; + SV.db.SVUnit.target.health.fontSize = largefont; + SV.db.SVUnit.target.power.fontSize = largefont; + SV.db.SVUnit.target.name.fontSize = largefont; + SV.db.SVUnit.target.aurabar.fontSize = STANDARDFONTSIZE; - SuperVillain.db.SVUnit.focus.health.fontSize = largefont; - SuperVillain.db.SVUnit.focus.power.fontSize = largefont; - SuperVillain.db.SVUnit.focus.name.fontSize = largefont; - SuperVillain.db.SVUnit.focus.aurabar.fontSize = STANDARDFONTSIZE; + SV.db.SVUnit.focus.health.fontSize = largefont; + SV.db.SVUnit.focus.power.fontSize = largefont; + SV.db.SVUnit.focus.name.fontSize = largefont; + SV.db.SVUnit.focus.aurabar.fontSize = STANDARDFONTSIZE; - SuperVillain.db.SVUnit.targettarget.health.fontSize = largefont; - SuperVillain.db.SVUnit.targettarget.power.fontSize = largefont; - SuperVillain.db.SVUnit.targettarget.name.fontSize = largefont; + SV.db.SVUnit.targettarget.health.fontSize = largefont; + SV.db.SVUnit.targettarget.power.fontSize = largefont; + SV.db.SVUnit.targettarget.name.fontSize = largefont; - SuperVillain.db.SVUnit.focustarget.health.fontSize = largefont; - SuperVillain.db.SVUnit.focustarget.power.fontSize = largefont; - SuperVillain.db.SVUnit.focustarget.name.fontSize = largefont; + SV.db.SVUnit.focustarget.health.fontSize = largefont; + SV.db.SVUnit.focustarget.power.fontSize = largefont; + SV.db.SVUnit.focustarget.name.fontSize = largefont; - SuperVillain.db.SVUnit.pet.health.fontSize = largefont; - SuperVillain.db.SVUnit.pet.power.fontSize = largefont; - SuperVillain.db.SVUnit.pet.name.fontSize = largefont; + SV.db.SVUnit.pet.health.fontSize = largefont; + SV.db.SVUnit.pet.power.fontSize = largefont; + SV.db.SVUnit.pet.name.fontSize = largefont; - SuperVillain.db.SVUnit.pettarget.health.fontSize = largefont; - SuperVillain.db.SVUnit.pettarget.power.fontSize = largefont; - SuperVillain.db.SVUnit.pettarget.name.fontSize = largefont; + SV.db.SVUnit.pettarget.health.fontSize = largefont; + SV.db.SVUnit.pettarget.power.fontSize = largefont; + SV.db.SVUnit.pettarget.name.fontSize = largefont; - SuperVillain.db.SVUnit.party.health.fontSize = largefont; - SuperVillain.db.SVUnit.party.power.fontSize = largefont; - SuperVillain.db.SVUnit.party.name.fontSize = largefont; + SV.db.SVUnit.party.health.fontSize = largefont; + SV.db.SVUnit.party.power.fontSize = largefont; + SV.db.SVUnit.party.name.fontSize = largefont; - SuperVillain.db.SVUnit.boss.health.fontSize = largefont; - SuperVillain.db.SVUnit.boss.power.fontSize = largefont; - SuperVillain.db.SVUnit.boss.name.fontSize = largefont; + SV.db.SVUnit.boss.health.fontSize = largefont; + SV.db.SVUnit.boss.power.fontSize = largefont; + SV.db.SVUnit.boss.name.fontSize = largefont; - SuperVillain.db.SVUnit.arena.health.fontSize = largefont; - SuperVillain.db.SVUnit.arena.power.fontSize = largefont; - SuperVillain.db.SVUnit.arena.name.fontSize = largefont; + SV.db.SVUnit.arena.health.fontSize = largefont; + SV.db.SVUnit.arena.power.fontSize = largefont; + SV.db.SVUnit.arena.name.fontSize = largefont; - SuperVillain.db.SVUnit.raid10.health.fontSize = largefont; - SuperVillain.db.SVUnit.raid10.power.fontSize = largefont; - SuperVillain.db.SVUnit.raid10.name.fontSize = largefont; + SV.db.SVUnit.raid10.health.fontSize = largefont; + SV.db.SVUnit.raid10.power.fontSize = largefont; + SV.db.SVUnit.raid10.name.fontSize = largefont; - SuperVillain.db.SVUnit.raid25.health.fontSize = largefont; - SuperVillain.db.SVUnit.raid25.power.fontSize = largefont; - SuperVillain.db.SVUnit.raid25.name.fontSize = largefont; + SV.db.SVUnit.raid25.health.fontSize = largefont; + SV.db.SVUnit.raid25.power.fontSize = largefont; + SV.db.SVUnit.raid25.name.fontSize = largefont; - SuperVillain.db.SVUnit.raid40.health.fontSize = largefont; - SuperVillain.db.SVUnit.raid40.power.fontSize = largefont; - SuperVillain.db.SVUnit.raid40.name.fontSize = largefont; + SV.db.SVUnit.raid40.health.fontSize = largefont; + SV.db.SVUnit.raid40.power.fontSize = largefont; + SV.db.SVUnit.raid40.name.fontSize = largefont; - SuperVillain.db.SVUnit.tank.health.fontSize = largefont; - SuperVillain.db.SVUnit.assist.health.fontSize = largefont; + SV.db.SVUnit.tank.health.fontSize = largefont; + SV.db.SVUnit.assist.health.fontSize = largefont; - SuperVillain:RefreshSystemFonts() -end; + SV:RefreshSystemFonts() +end --[[ ########################################################## SET PACKAGE OPTIONS ########################################################## ]]-- -SuperVillain.Options.args.SVUI_Header = { +SV.Options.args.SVUI_Header = { order = 1, type = "header", - name = "You are using |cffff9900Super Villain UI|r - "..L["Version"]..format(": |cff99ff33%s|r", SuperVillain.___ver), + name = "You are using |cffff9900Super Villain UI|r - "..L["Version"]..format(": |cff99ff33%s|r", SV.___version), width = "full" } -SuperVillain.Options.args.primary = { +SV.Options.args.primary = { type = "group", order = 1, name = L["Main"], - get = function(j)return SuperVillain.db.system[j[#j]]end, - set = function(j, value)SuperVillain.db.system[j[#j]] = value end, + get = function(j)return SV.db.system[j[#j]]end, + set = function(j, value)SV.db.system[j[#j]] = value end, args = { introGroup1 = { order = 1, @@ -161,7 +161,7 @@ SuperVillain.Options.args.primary = { type = "execute", name = L["Install"], desc = L["Run the installation process."], - func = function() SuperVillain:Install()SuperVillain:ToggleConfig() end + func = function() SV.Setup:Install() SV:ToggleConfig() end }, ToggleAnchors = { order = 4, @@ -169,7 +169,7 @@ SuperVillain.Options.args.primary = { type = "execute", name = L["Move Frames"], desc = L["Unlock various elements of the UI to be repositioned."], - func = function() SuperVillain:UseMentalo() end + func = function() SV:UseMentalo() end }, ResetAllMovers = { order = 5, @@ -177,7 +177,7 @@ SuperVillain.Options.args.primary = { type = "execute", name = L["Reset Anchors"], desc = L["Reset all frames to their original positions."], - func = function() SuperVillain:ResetUI() end + func = function() SV:ResetUI() end }, toggleKeybind = { order = 6, @@ -185,11 +185,11 @@ SuperVillain.Options.args.primary = { type = "execute", name = L["Keybind Mode"], func = function() - SuperVillain.SVBar:ToggleKeyBindingMode() - SuperVillain:ToggleConfig() + SV.SVBar:ToggleKeyBindingMode() + SV:ToggleConfig() GameTooltip:Hide() end, - disabled = function() return not SuperVillain.db.SVBar.enable end + disabled = function() return not SV.db.SVBar.enable end } }, }, @@ -204,13 +204,13 @@ SuperVillain.Options.args.primary = { } }; -SuperVillain.Options.args.common = { +SV.Options.args.common = { type = "group", order = 2, name = L["General"], childGroups = "tab", - get = function(j)return SuperVillain.db.system[j[#j]]end, - set = function(j, value)SuperVillain.db.system[j[#j]] = value end, + get = function(j)return SV.db.system[j[#j]]end, + set = function(j, value)SV.db.system[j[#j]] = value end, args = { commonGroup = { order = 1, @@ -234,31 +234,31 @@ SuperVillain.Options.args.common = { name = L["Auto Scale"], desc = L["Automatically scale the User Interface based on your screen resolution"], type = "toggle", - get = function(j)return SuperVillain.db.system.autoScale end, - set = function(j,value)SuperVillain.db.system.autoScale = value;SuperVillain:StaticPopup_Show("RL_CLIENT")end + get = function(j)return SV.db.system.autoScale end, + set = function(j,value)SV.db.system.autoScale = value;SV:StaticPopup_Show("RL_CLIENT")end }, multiMonitor = { order = 2, name = L["Multi Monitor"], desc = L["Adjust UI dimensions to accomodate for multiple monitor setups"], type = "toggle", - get = function(j)return SuperVillain.db.system.multiMonitor end, - set = function(j,value)SuperVillain.db.system.multiMonitor = value;SuperVillain:StaticPopup_Show("RL_CLIENT")end + get = function(j)return SV.db.system.multiMonitor end, + set = function(j,value)SV.db.system.multiMonitor = value;SV:StaticPopup_Show("RL_CLIENT")end }, hideErrorFrame = { order = 3, name = L["Hide Error Text"], desc = L["Hides the red error text at the top of the screen while in combat."], type = "toggle", - get = function(j)return SuperVillain.db.system.hideErrorFrame end, - set = function(j,value)SuperVillain.db.system.hideErrorFrame = value;SuperVillain:StaticPopup_Show("RL_CLIENT")end + get = function(j)return SV.db.system.hideErrorFrame end, + set = function(j,value)SV.db.system.hideErrorFrame = value;SV:StaticPopup_Show("RL_CLIENT")end }, LoginMessage = { order = 4, type = 'toggle', name = L['Login Message'], - get = function(j)return SuperVillain.db.system.loginmessage end, - set = function(j,value)SuperVillain.db.system.loginmessage = value end + get = function(j)return SV.db.system.loginmessage end, + set = function(j,value)SV.db.system.loginmessage = value end }, } }, @@ -273,16 +273,16 @@ SuperVillain.Options.args.common = { type = "toggle", name = L['Loot Frame'], desc = L['Enable/Disable the loot frame.'], - get = function()return SuperVillain.db.SVOverride.loot end, - set = function(j,value)SuperVillain.db.SVOverride.loot = value;SuperVillain:StaticPopup_Show("RL_CLIENT")end + get = function()return SV.db.SVOverride.loot end, + set = function(j,value)SV.db.SVOverride.loot = value;SV:StaticPopup_Show("RL_CLIENT")end }, lootRoll = { order = 2, type = "toggle", name = L['Loot Roll'], desc = L['Enable/Disable the loot roll frame.'], - get = function()return SuperVillain.db.SVOverride.lootRoll end, - set = function(j,value)SuperVillain.db.SVOverride.lootRoll = value;SuperVillain:StaticPopup_Show("RL_CLIENT")end + get = function()return SV.db.SVOverride.lootRoll end, + set = function(j,value)SV.db.SVOverride.lootRoll = value;SV:StaticPopup_Show("RL_CLIENT")end }, lootRollWidth = { order = 3, @@ -292,7 +292,7 @@ SuperVillain.Options.args.common = { min = 100, max = 328, step = 1, - get = function()return SuperVillain.db.SVOverride.lootRollWidth end, + get = function()return SV.db.SVOverride.lootRollWidth end, set = function(a,b)OVR:ChangeDBVar(b,a[#a]); end, }, lootRollHeight = { @@ -303,7 +303,7 @@ SuperVillain.Options.args.common = { min = 14, max = 58, step = 1, - get = function()return SuperVillain.db.SVOverride.lootRollHeight end, + get = function()return SV.db.SVOverride.lootRollHeight end, set = function(a,b)OVR:ChangeDBVar(b,a[#a]); end, }, } @@ -318,56 +318,72 @@ SuperVillain.Options.args.common = { order = 1, type = 'toggle', name = L["Enable Comic Popups"], - get = function(j)return SuperVillain.db.system.comix end, - set = function(j,value)SuperVillain.db.system.comix = value;SuperVillain:ToggleComix()end + get = function(j)return SV.db.system.comix end, + set = function(j,value)SV.db.system.comix = value;SV:ToggleComix()end }, bigComix = { order = 1, type = 'toggle', name = L["Include Large Comics"], - disabled = function() return not SuperVillain.db.system.comix end, - get = function(j) return SuperVillain.db.system.bigComix end, - set = function(j,value) SuperVillain.db.system.bigComix = value end + disabled = function() return not SV.db.system.comix end, + get = function(j) return SV.db.system.bigComix end, + set = function(j,value) SV.db.system.bigComix = value end }, bubbles = { order = 2, type = "toggle", name = L['Chat Bubbles Style'], desc = L['Style the blizzard chat bubbles.'], - get = function(j)return SuperVillain.db.system.bubbles end, - set = function(j,value)SuperVillain.db.system.bubbles = value;SuperVillain:StaticPopup_Show("RL_CLIENT")end + get = function(j)return SV.db.system.bubbles end, + set = function(j,value)SV.db.system.bubbles = value;SV:StaticPopup_Show("RL_CLIENT")end }, woot = { order = 3, type = 'toggle', name = L["Say Thanks"], desc = L["Thank someone when they cast specific spells on you. Typically resurrections"], - get = function(j)return SuperVillain.db.system.woot end, - set = function(j,value)SuperVillain.db.system.woot = value;SuperVillain:ToggleReactions()end + get = function(j)return SV.db.system.woot end, + set = function(j,value)SV.db.system.woot = value;SV:ToggleReactions()end }, pvpinterrupt = { order = 4, type = 'toggle', name = L["Report PVP Actions"], desc = L["Announce your interrupts, as well as when you have been sapped!"], - get = function(j)return SuperVillain.db.system.pvpinterrupt end, - set = function(j,value)SuperVillain.db.system.pvpinterrupt = value;SuperVillain:ToggleReactions()end + get = function(j)return SV.db.system.pvpinterrupt end, + set = function(j,value)SV.db.system.pvpinterrupt = value;SV:ToggleReactions()end }, lookwhaticando = { order = 5, type = 'toggle', name = L["Report Spells"], desc = L["Announce various helpful spells cast by players in your party/raid"], - get = function(j)return SuperVillain.db.system.lookwhaticando end, - set = function(j,value)SuperVillain.db.system.lookwhaticando = value;SuperVillain:ToggleReactions()end + get = function(j)return SV.db.system.lookwhaticando end, + set = function(j,value)SV.db.system.lookwhaticando = value;SV:ToggleReactions()end }, sharingiscaring = { order = 6, type = 'toggle', name = L["Report Shareables"], desc = L["Announce when someone in your party/raid has laid a feast or repair bot"], - get = function(j)return SuperVillain.db.system.sharingiscaring end, - set = function(j,value)SuperVillain.db.system.sharingiscaring = value;SuperVillain:ToggleReactions()end + get = function(j)return SV.db.system.sharingiscaring end, + set = function(j,value)SV.db.system.sharingiscaring = value;SV:ToggleReactions()end + }, + reactionChat = { + order = 7, + type = 'toggle', + name = L["Report in Chat"], + desc = L["Announcements will be sent to group chat channels"], + get = function(j)return SV.db.system.reactionChat end, + set = function(j,value)SV.db.system.reactionChat = value;SV:ToggleReactions()end + }, + reactionEmote = { + order = 8, + type = 'toggle', + name = L["Auto Emotes"], + desc = L["Some announcements are accompanied by player emotes."], + get = function(j)return SV.db.system.reactionEmote end, + set = function(j,value)SV.db.system.reactionEmote = value;SV:ToggleReactions()end }, } }, @@ -381,19 +397,19 @@ SuperVillain.Options.args.common = { order = 1, type = "toggle", name = L['Threat Thermometer'], - get = function(j)return SuperVillain.db.system.threatbar end, - set = function(j, value)SuperVillain.db.system.threatbar = value;SuperVillain:StaticPopup_Show("RL_CLIENT")end + get = function(j)return SV.db.system.threatbar end, + set = function(j, value)SV.db.system.threatbar = value;SV:StaticPopup_Show("RL_CLIENT")end }, totems = { order = 2, type = "toggle", name = L["Totems"], get = function(j) - return SuperVillain.db.system.totems.enable + return SV.db.system.totems.enable end, set = function(j, value) - SuperVillain.db.system.totems.enable = value; - SuperVillain:StaticPopup_Show("RL_CLIENT") + SV.db.system.totems.enable = value; + SV:StaticPopup_Show("RL_CLIENT") end }, cooldownText = { @@ -401,8 +417,8 @@ SuperVillain.Options.args.common = { order = 3, name = L['Cooldown Text'], desc = L["Display cooldown text on anything with the cooldown spiral."], - get = function(j)return SuperVillain.db.system.cooldown end, - set = function(j,value)SuperVillain.db.system.cooldown = value;SuperVillain:StaticPopup_Show("RL_CLIENT")end + get = function(j)return SV.db.system.cooldown end, + set = function(j,value)SV.db.system.cooldown = value;SV:StaticPopup_Show("RL_CLIENT")end }, size = { order = 4, @@ -413,10 +429,10 @@ SuperVillain.Options.args.common = { max = 60, step = 1, get = function(j) - return SuperVillain.db.system.totems[j[#j]] + return SV.db.system.totems[j[#j]] end, set = function(j, value) - SuperVillain.db.system.totems[j[#j]] = value + SV.db.system.totems[j[#j]] = value end }, spacing = { @@ -428,10 +444,10 @@ SuperVillain.Options.args.common = { max = 10, step = 1, get = function(j) - return SuperVillain.db.system.totems[j[#j]] + return SV.db.system.totems[j[#j]] end, set = function(j, value) - SuperVillain.db.system.totems[j[#j]] = value + SV.db.system.totems[j[#j]] = value end }, sortDirection = { @@ -443,10 +459,10 @@ SuperVillain.Options.args.common = { ['DESCENDING'] = L['Descending'] }, get = function(j) - return SuperVillain.db.system.totems[j[#j]] + return SV.db.system.totems[j[#j]] end, set = function(j, value) - SuperVillain.db.system.totems[j[#j]] = value + SV.db.system.totems[j[#j]] = value end }, showBy = { @@ -458,10 +474,10 @@ SuperVillain.Options.args.common = { ['HORIZONTAL'] = L['Horizontal'] }, get = function(j) - return SuperVillain.db.system.totems[j[#j]] + return SV.db.system.totems[j[#j]] end, set = function(j, value) - SuperVillain.db.system.totems[j[#j]] = value + SV.db.system.totems[j[#j]] = value end } } @@ -472,8 +488,8 @@ SuperVillain.Options.args.common = { order = 2, type = "group", name = L["Media"], - get = function(j)return SuperVillain.db.system[j[#j]]end, - set = function(j, value)SuperVillain.db.system[j[#j]] = value end, + get = function(j)return SV.db.system[j[#j]]end, + set = function(j, value)SV.db.system[j[#j]] = value end, args = { texture = { order = 1, @@ -481,11 +497,11 @@ SuperVillain.Options.args.common = { name = L["Textures"], guiInline = true, get = function(key) - return SuperVillain.db.media.textures[key[#key]] + return SV.db.media.textures[key[#key]] end, set = function(key, value) - SuperVillain.db.media.textures[key[#key]] = {"background", value} - SuperVillain:RefreshEverything(true) + SV.db.media.textures[key[#key]] = {"background", value} + SV:RefreshEverything(true) end, args = { pattern = { @@ -519,7 +535,7 @@ SuperVillain.Options.args.common = { min = 6, max = 22, step = 1, - set = function(j,value)SuperVillain.db.media.fonts[j[#j]] = value;CommonFontSizeUpdate()end + set = function(j,value)SV.db.media.fonts[j[#j]] = value;CommonFontSizeUpdate()end }, unicodeSize = { order = 2, @@ -530,7 +546,7 @@ SuperVillain.Options.args.common = { min = 6, max = 22, step = 1, - set = function(j,value)SuperVillain.db.media.fonts[j[#j]] = value;CommonFontSizeUpdate()end + set = function(j,value)SV.db.media.fonts[j[#j]] = value;CommonFontSizeUpdate()end }, fontSpacer1 = { order = 3, @@ -551,8 +567,8 @@ SuperVillain.Options.args.common = { name = L["Default Font"], desc = L["Set/Override the global UI font. |cff00FF00NOTE:|r |cff00FF99This WILL NOT affect configurable fonts.|r"], values = AceGUIWidgetLSMlists.font, - get = function(j)return SuperVillain.db.media.fonts[j[#j]]end, - set = function(j,value)SuperVillain.db.media.fonts[j[#j]] = value;SuperVillain:RefreshSystemFonts()end + get = function(j)return SV.db.media.fonts[j[#j]]end, + set = function(j,value)SV.db.media.fonts[j[#j]] = value;SV:RefreshSystemFonts()end }, name = { type = "select", @@ -561,8 +577,8 @@ SuperVillain.Options.args.common = { name = L["Unit Name Font"], desc = L["Set/Override the global name font. |cff00FF00NOTE:|r |cff00FF99This WILL NOT affect styled nameplates or unitframes.|r"], values = AceGUIWidgetLSMlists.font, - get = function(j)return SuperVillain.db.media.fonts[j[#j]]end, - set = function(j,value)SuperVillain.db.media.fonts[j[#j]] = value;SuperVillain:RefreshSystemFonts()end + get = function(j)return SV.db.media.fonts[j[#j]]end, + set = function(j,value)SV.db.media.fonts[j[#j]] = value;SV:RefreshSystemFonts()end }, combat = { type = "select", @@ -571,8 +587,8 @@ SuperVillain.Options.args.common = { name = L["CombatText Font"], desc = L["Set/Override the font that combat text will use. |cffFF0000NOTE:|r |cffFF9900This requires a game restart or re-log for this change to take effect.|r"], values = AceGUIWidgetLSMlists.font, - get = function(j)return SuperVillain.db.media.fonts[j[#j]]end, - set = function(j,value)SuperVillain.db.media.fonts[j[#j]] = value;SuperVillain:RefreshSystemFonts()SuperVillain:StaticPopup_Show("RL_CLIENT")end + get = function(j)return SV.db.media.fonts[j[#j]]end, + set = function(j,value)SV.db.media.fonts[j[#j]] = value;SV:RefreshSystemFonts()SV:StaticPopup_Show("RL_CLIENT")end }, number = { type = "select", @@ -581,8 +597,8 @@ SuperVillain.Options.args.common = { name = L["Numbers Font"], desc = L["Set/Override the global font used for numbers. |cff00FF00NOTE:|r |cff00FF99This WILL NOT affect all numbers.|r"], values = AceGUIWidgetLSMlists.font, - get = function(j)return SuperVillain.db.media.fonts[j[#j]]end, - set = function(j,value)SuperVillain.db.media.fonts[j[#j]] = value;SuperVillain:RefreshSystemFonts()end + get = function(j)return SV.db.media.fonts[j[#j]]end, + set = function(j,value)SV.db.media.fonts[j[#j]] = value;SV:RefreshSystemFonts()end }, } }, @@ -599,12 +615,12 @@ SuperVillain.Options.args.common = { desc = L["Main color used by most UI elements. (ex: Backdrop Color)"], hasAlpha = true, get = function(key) - local color = SuperVillain.db.media.colors.default + local color = SV.db.media.colors.default return color[1],color[2],color[3],color[4] end, set = function(key, rValue, gValue, bValue, aValue) - SuperVillain.db.media.colors.default = {rValue, gValue, bValue, aValue} - SuperVillain:MediaUpdate() + SV.db.media.colors.default = {rValue, gValue, bValue, aValue} + SV:MediaUpdate() end, }, special = { @@ -614,12 +630,12 @@ SuperVillain.Options.args.common = { desc = L["Color used in various frame accents. (ex: Dressing Room Backdrop Color)"], hasAlpha = true, get = function(key) - local color = SuperVillain.db.media.colors.special + local color = SV.db.media.colors.special return color[1],color[2],color[3],color[4] end, set = function(key, rValue, gValue, bValue, aValue) - SuperVillain.db.media.colors.special = {rValue, gValue, bValue, aValue} - SuperVillain:MediaUpdate() + SV.db.media.colors.special = {rValue, gValue, bValue, aValue} + SV:MediaUpdate() end, }, resetbutton = { @@ -627,9 +643,9 @@ SuperVillain.Options.args.common = { order = 3, name = L["Restore Defaults"], func = function() - SuperVillain.db.media.colors.default = {0.15, 0.15, 0.15, 1}; - SuperVillain.db.media.colors.special = {0.4, 0.32, 0.2, 1}; - SuperVillain:MediaUpdate() + SV.db.media.colors.default = {0.15, 0.15, 0.15, 1}; + SV.db.media.colors.special = {0.4, 0.32, 0.2, 1}; + SV:MediaUpdate() end } } @@ -640,8 +656,8 @@ SuperVillain.Options.args.common = { order = 3, type = 'group', name = L['Gear Managment'], - get = function(a)return SuperVillain.db.SVGear[a[#a]]end, - set = function(a,b)SuperVillain.db.SVGear[a[#a]]=b;GEAR:ReLoad()end, + get = function(a)return SV.db.SVGear[a[#a]]end, + set = function(a,b)SV.db.SVGear[a[#a]]=b;GEAR:ReLoad()end, args={ intro={ order = 1, @@ -666,21 +682,21 @@ SuperVillain.Options.args.common = { order=1, name=L["Enable"], desc=L['Enable/Disable the specialization switch.'], - get=function(e)return SuperVillain.db.SVGear.specialization.enable end, - set=function(e,value) SuperVillain.db.SVGear.specialization.enable = value end + get=function(e)return SV.db.SVGear.specialization.enable end, + set=function(e,value) SV.db.SVGear.specialization.enable = value end }, primary={ type="select", order=2, name=L["Primary Talent"], desc=L["Choose the equipment set to use for your primary specialization."], - disabled=function()return not SuperVillain.db.SVGear.specialization.enable end, + disabled=function()return not SV.db.SVGear.specialization.enable end, values=function() local h={["none"]=L["No Change"]} for i=1,GetNumEquipmentSets()do local name=GetEquipmentSetInfo(i) if name then h[name]=name end - end; + end tsort(h,sortingFunction) return h end @@ -690,13 +706,13 @@ SuperVillain.Options.args.common = { order=3, name=L["Secondary Talent"], desc=L["Choose the equipment set to use for your secondary specialization."], - disabled=function()return not SuperVillain.db.SVGear.specialization.enable end, + disabled=function()return not SV.db.SVGear.specialization.enable end, values=function() local h={["none"]=L["No Change"]} for i=1,GetNumEquipmentSets()do local name,l,l,l,l,l,l,l,l=GetEquipmentSetInfo(i) if name then h[name]=name end - end; + end tsort(h,sortingFunction) return h end @@ -716,21 +732,21 @@ SuperVillain.Options.args.common = { order = 1, name = L["Enable"], desc = L["Enable/Disable the battleground switch."], - get = function(e)return SuperVillain.db.SVGear.battleground.enable end, - set = function(e,value)SuperVillain.db.SVGear.battleground.enable = value end + get = function(e)return SV.db.SVGear.battleground.enable end, + set = function(e,value)SV.db.SVGear.battleground.enable = value end }, equipmentset = { type = "select", order = 2, name = L["Equipment Set"], desc = L["Choose the equipment set to use when you enter a battleground or arena."], - disabled = function()return not SuperVillain.db.SVGear.battleground.enable end, + disabled = function()return not SV.db.SVGear.battleground.enable end, values = function() local h = {["none"] = L["No Change"]} for i = 1,GetNumEquipmentSets()do local name = GetEquipmentSetInfo(i) if name then h[name] = name end - end; + end tsort(h,sortingFunction) return h end @@ -747,8 +763,8 @@ SuperVillain.Options.args.common = { name = DURABILITY, guiInline = true, order = 5, - get = function(e)return SuperVillain.db.SVGear.durability[e[#e]]end, - set = function(e,value)SuperVillain.db.SVGear.durability[e[#e]] = value;GEAR:ReLoad()end, + get = function(e)return SV.db.SVGear.durability[e[#e]]end, + set = function(e,value)SV.db.SVGear.durability[e[#e]] = value;GEAR:ReLoad()end, args = { enable = { type = "toggle", @@ -761,7 +777,7 @@ SuperVillain.Options.args.common = { order = 2, name = L["Damaged Only"], desc = L["Only show durability information for items that are damaged."], - disabled = function()return not SuperVillain.db.SVGear.durability.enable end + disabled = function()return not SV.db.SVGear.durability.enable end } } }, @@ -775,8 +791,8 @@ SuperVillain.Options.args.common = { name = STAT_AVERAGE_ITEM_LEVEL, guiInline = true, order = 7, - get = function(e)return SuperVillain.db.SVGear.itemlevel[e[#e]]end, - set = function(e,value)SuperVillain.db.SVGear.itemlevel[e[#e]] = value;GEAR:ReLoad()end, + get = function(e)return SV.db.SVGear.itemlevel[e[#e]]end, + set = function(e,value)SV.db.SVGear.itemlevel[e[#e]] = value;GEAR:ReLoad()end, args = { enable = { type = "toggle", @@ -791,9 +807,9 @@ SuperVillain.Options.args.common = { name = L["Miscellaneous"], guiInline = true, order = 8, - get = function(e)return SuperVillain.db.SVGear.misc[e[#e]]end, - set = function(e,value)SuperVillain.db.SVGear.misc[e[#e]] = value end, - disabled = function()return not SuperVillain.db.SVBag.enable end, + get = function(e)return SV.db.SVGear.misc[e[#e]]end, + set = function(e,value)SV.db.SVGear.misc[e[#e]] = value end, + disabled = function()return not SV.db.SVBag.enable end, args = { setoverlay = { type = "toggle", @@ -801,7 +817,7 @@ SuperVillain.Options.args.common = { name = L["Equipment Set Overlay"], desc = L["Show the associated equipment sets for the items in your bags (or bank)."], set = function(e,value) - SuperVillain.db.SVGear.misc[e[#e]] = value; + SV.db.SVGear.misc[e[#e]] = value; BAG:ToggleEquipmentOverlay() end } @@ -818,7 +834,7 @@ local q, r, dnt = "", "", ""; local s = "\n"; local p = "\n"..format("|cff4f4f4f%s|r", "---------------------------------------------"); local t = {"Munglunch", "Elv", "Tukz", "Azilroka", "Sortokk", "AlleyKat", "Quokka", "Haleth", "P3lim", "Haste", "Totalpackage", "Kryso", "Thepilli"}; -local u = {"Wowinterface Community", "Doonga - (The man who keeps me busy)", "Judicate", "Cazart506", "Movster", "MuffinMonster", "Joelsoul", "Trendkill09", "Luamar", "Zharooz", "Lyn3x5", "Madh4tt3r", "Xarioth", "Sinnisterr", "Melonmaniac", "Hojowameeat", "Xandeca", "Bkan", "Daigan - (My current 2nd in command)", "AtomicKiller", "Meljen", "Moondoggy", "Stormblade", "Schreibstift", "Anj", "Risien", "Penguinsane"}; +local u = {"Wowinterface Community", "Doonga - (The man who keeps me busy)", "Judicate", "Cazart506", "Movster", "MuffinMonster", "Joelsoul", "Trendkill09", "Luamar", "Zharooz", "Lyn3x5", "Madh4tt3r", "Xarioth", "Sinnisterr", "Melonmaniac", "Hojowameeat", "Xandeca", "Bkan", "Daigan - (My current 2nd in command)", "AtomicKiller", "Meljen", "Moondoggy", "Stormblade", "Schreibstift", "Anj", "Risien", "Penguinsane", "Cromax", "Nitro_Turtle", "Shinzou", "Autolykus", "Taotao"}; local v = {"Movster", "Cazart506", "FaolanKing", "Doonga", "Other Silent Partners.. (Let me know if I have forgotten you)"}; local credit_header = format("|cffff9900%s|r", "SUPERVILLAIN CREDITS:")..p; local credit_sub = format("|cffff9900%s|r", "CREATED BY:").." Munglunch"..p; @@ -832,19 +848,19 @@ local music = format("|cff00ccff%s|r", 'Theme Song By: Fingathing [taken from th tsort(t, function(o,n) return o < n end) for _, x in pairs(t) do q = q..s..x -end; +end tsort(u, function(o,n) return o < n end) for _, y in pairs(u) do r = r..s..y -end; +end tsort(u, function(o,n) return o < n end) for _, z in pairs(v) do dnt = dnt..s..z -end; +end local creditsString = credit_header..'\n'..credit_sub..'\n'..credit_sub2..'\n'..special_thanks..'\n\n'..coding..q..'\n\n'..testing..r..'\n\n'..doners..dnt..'\n\n'..music..'\n\n'; -SuperVillain.Options.args.credits = { +SV.Options.args.credits = { type = "group", name = L["Credits"], order = -1, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc index b75cd33..1402902 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc +++ b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc @@ -1,6 +1,6 @@ ## Interface: 60000 ## Author: Munglunch -## Version: 5.02 +## Version: 4.4 ## Title: |cffFF9900SVUI |r|cffFFEF00Config O Matic|r ## Notes: Supervillain UI [|cff9911FFConfig Options|r] ## RequiredDeps: SVUI diff --git a/Interface/AddOns/SVUI_ConfigOMatic/language/generic.lua b/Interface/AddOns/SVUI_ConfigOMatic/language/generic.lua index 11b5564..91a6a22 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/language/generic.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/language/generic.lua @@ -16,7 +16,7 @@ S U P E R - V I L L A I N - U I By: Munglunch # GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local gameLocale = GetLocale() if gameLocale == "enUS" then L["AURAS_DESC"] = "Configure the aura icons that appear near the minimap." diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/art.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/art.lua index 43fbae5..903afb3 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/art.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/art.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); -SuperVillain.Options.args.SVStyle={ +local SV, L = unpack(SVUI); +SV.Options.args.SVStyle={ type = "group", name = L["UI Styling"], childGroups = "tree", @@ -44,23 +44,23 @@ SuperVillain.Options.args.SVStyle={ 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 SV.db.SVStyle.blizzard.enable end, + set = function(a,b)SV.db.SVStyle.blizzard.enable = b;SV: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 SV.db.SVStyle.addons.enable end, + set = function(a,b)SV.db.SVStyle.addons.enable = b;SV: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 SV.db.SVStyle.blizzard[a[#a]]end, + set = function(a,b)SV.db.SVStyle.blizzard[a[#a]] = b;SV:StaticPopup_Show("RL_CLIENT")end, + disabled = function()return not SV.db.SVStyle.blizzard.enable end, guiInline = true, args = { bmah = { diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/aura.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/aura.lua index 58c757c..27443d2 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/aura.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/aura.lua @@ -29,9 +29,9 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); -local MOD = SuperVillain.SVAura; -local MAP = SuperVillain.SVMap; +local SV, L = unpack(SVUI); +local MOD = SV.SVAura; +local MAP = SV.SVMap; --[[ ########################################################## SET PACKAGE OPTIONS @@ -155,15 +155,15 @@ local auraOptionsTemplate = { }, } -SuperVillain.Options.args.SVAura = { +SV.Options.args.SVAura = { type = "group", name = BUFFOPTIONS_LABEL, childGroups = "tab", - get = function(a)return SuperVillain.db.SVAura[a[#a]]end, + get = function(a)return SV.db.SVAura[a[#a]]end, set = function(a,b) MOD:ChangeDBVar(b,a[#a]); - MOD:UpdateAuraHeader(SVUI_PlayerBuffs) - MOD:UpdateAuraHeader(SVUI_PlayerDebuffs) + MOD:UpdateAuraHeader(SVUI_PlayerBuffs, "buffs") + MOD:UpdateAuraHeader(SVUI_PlayerDebuffs, "debuffs") end, args = { intro = { @@ -175,15 +175,15 @@ SuperVillain.Options.args.SVAura = { order = 2, type = "toggle", name = L["Enable"], - get = function(a)return SuperVillain.db.SVAura.enable end, - set = function(a,b)SuperVillain.db.SVAura.enable = b;SuperVillain:StaticPopup_Show("RL_CLIENT")end + get = function(a)return SV.db.SVAura.enable end, + set = function(a,b)SV.db.SVAura.enable = b;SV:StaticPopup_Show("RL_CLIENT")end }, disableBlizzard = { order = 3, type = "toggle", name = L["Disabled Blizzard"], - get = function(a)return SuperVillain.db.SVAura.disableBlizzard end, - set = function(a,b)SuperVillain.db.SVAura.disableBlizzard = b;SuperVillain:StaticPopup_Show("RL_CLIENT")end + get = function(a)return SV.db.SVAura.disableBlizzard end, + set = function(a,b)SV.db.SVAura.disableBlizzard = b;SV:StaticPopup_Show("RL_CLIENT")end }, auraGroups = { order = 4, @@ -270,22 +270,22 @@ SuperVillain.Options.args.SVAura = { order = 20, type = "group", name = L["Hyper Buffs"], - get = function(b)return SuperVillain.db.SVAura.hyperBuffs[b[#b]]end, - set = function(a,b)MOD:ChangeDBVar(b,a[#a],"hyperBuffs");MOD:ToggleConsolidatedBuffs();MAP:ReLoad();MOD:UpdateAuraHeader(SVUI_PlayerBuffs)end, + get = function(b)return SV.db.SVAura.hyperBuffs[b[#b]]end, + set = function(a,b)MOD:ChangeDBVar(b,a[#a],"hyperBuffs");MOD:ToggleConsolidatedBuffs();MAP:ReLoad();MOD:UpdateAuraHeader(SVUI_PlayerBuffs, "buffs")end, args = { enable = { order = 1, type = "toggle", name = L["Enable"], desc = L["Display the consolidated buffs bar."], - disabled = function()return not SuperVillain.db.SVMap.enable end, + disabled = function()return not SV.db.SVMap.enable end, }, filter = { order = 2, name = L["Filter Hyper"], desc = L["Only show consolidated icons on the consolidated bar that your class/spec is interested in. This is useful for raid leading."], type = "toggle", - disabled = function()return not SuperVillain.db.SVAura.hyperBuffs.enable end, + disabled = function()return not SV.db.SVAura.hyperBuffs.enable end, } } }, @@ -293,16 +293,16 @@ SuperVillain.Options.args.SVAura = { order = 30, type = "group", name = L["Buffs"], - get = function(b)return SuperVillain.db.SVAura.buffs[b[#b]]end, - set = function(a,b)MOD:ChangeDBVar(b,a[#a],"buffs");MOD:UpdateAuraHeader(SVUI_PlayerBuffs)end, + get = function(b)return SV.db.SVAura.buffs[b[#b]]end, + set = function(a,b)MOD:ChangeDBVar(b,a[#a],"buffs");MOD:UpdateAuraHeader(SVUI_PlayerBuffs, "buffs")end, args = auraOptionsTemplate }, debuffs = { order = 40, type = "group", name = L["Debuffs"], - get = function(b)return SuperVillain.db.SVAura.debuffs[b[#b]]end, - set = function(a,b)MOD:ChangeDBVar(b,a[#a],"debuffs");MOD:UpdateAuraHeader(SVUI_PlayerDebuffs)end, + get = function(b)return SV.db.SVAura.debuffs[b[#b]]end, + set = function(a,b)MOD:ChangeDBVar(b,a[#a],"debuffs");MOD:UpdateAuraHeader(SVUI_PlayerDebuffs, "debuffs")end, args = auraOptionsTemplate } } diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/bag.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/bag.lua index 8743824..a87eb28 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/bag.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/bag.lua @@ -29,9 +29,9 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); -local MOD = SuperVillain.SVBag +local MOD = SV.SVBag local pointList = { ["TOPLEFT"] = "TOPLEFT", @@ -40,11 +40,11 @@ local pointList = { ["BOTTOMRIGHT"] = "BOTTOMRIGHT", } -SuperVillain.Options.args.SVBag = { +SV.Options.args.SVBag = { type = 'group', name = L['Bags'], childGroups = "tab", - get = function(a)return SuperVillain.db.SVBag[a[#a]]end, + get = function(a)return SV.db.SVBag[a[#a]]end, set = function(a,b)MOD:ChangeDBVar(b,a[#a]) end, args = { intro = { @@ -57,8 +57,8 @@ SuperVillain.Options.args.SVBag = { type = "toggle", name = L["Enable"], desc = L["Enable/Disable the all-in-one bag."], - get = function(a)return SuperVillain.db.SVBag.enable end, - set = function(a,b)SuperVillain.db.SVBag.enable = b;SuperVillain:StaticPopup_Show("RL_CLIENT")end + get = function(a)return SV.db.SVBag.enable end, + set = function(a,b)SV.db.SVBag.enable = b;SV:StaticPopup_Show("RL_CLIENT")end }, bagGroups={ order = 3, @@ -71,7 +71,7 @@ SuperVillain.Options.args.SVBag = { type = "group", guiInline = true, name = L["General"], - disabled = function()return not SuperVillain.db.SVBag.enable end, + disabled = function()return not SV.db.SVBag.enable end, args = { bagSize = { order = 1, @@ -108,7 +108,7 @@ SuperVillain.Options.args.SVBag = { max = 700, step = 1, set = function(a,b)MOD:ChangeDBVar(b,a[#a])MOD:Layout()end, - disabled = function()return SuperVillain.db.SVBag.alignToChat end + disabled = function()return SV.db.SVBag.alignToChat end }, bankWidth = { order = 5, @@ -119,7 +119,7 @@ SuperVillain.Options.args.SVBag = { max = 700, step = 1, set = function(a,b)MOD:ChangeDBVar(b,a[#a])MOD:Layout(true)end, - disabled = function()return SuperVillain.db.SVBag.alignToChat end + disabled = function()return SV.db.SVBag.alignToChat end }, currencyFormat = { order = 6, @@ -137,7 +137,7 @@ SuperVillain.Options.args.SVBag = { type = "toggle", name = L["Profession Tools"], desc = L["Enable/Disable Prospecting, Disenchanting and Milling buttons on the bag frame."], - set = function(a,b)MOD:ChangeDBVar(b,a[#a])SuperVillain:StaticPopup_Show("RL_CLIENT")end + set = function(a,b)MOD:ChangeDBVar(b,a[#a])SV:StaticPopup_Show("RL_CLIENT")end }, ignoreItems = { order = 100, @@ -146,7 +146,7 @@ SuperVillain.Options.args.SVBag = { type = "input", width = "full", multiline = true, - set = function(a,b)SuperVillain.db.SVBag[a[#a]] = b end + set = function(a,b) SV.db.SVBag[a[#a]] = b end } } }, @@ -155,7 +155,7 @@ SuperVillain.Options.args.SVBag = { type = "group", guiInline = true, name = L["Bag/Bank Positioning"], - disabled = function()return not SuperVillain.db.SVBag.enable end, + disabled = function()return not SV.db.SVBag.enable end, args = { alignToChat = { order = 1, @@ -169,9 +169,9 @@ SuperVillain.Options.args.SVBag = { type = "group", name = L["Bag Position"], guiInline = true, - get = function(key) return SuperVillain.db.SVBag.bags[key[#key]] end, + get = function(key) return SV.db.SVBag.bags[key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], "bags"); MOD:ModifyBags() end, - disabled = function() return not SuperVillain.db.SVBag.enable end, + disabled = function() return not SV.db.SVBag.enable end, args = { point = { order = 1, @@ -204,9 +204,9 @@ SuperVillain.Options.args.SVBag = { type = "group", name = L["Bank Position"], guiInline = true, - get = function(key) return SuperVillain.db.SVBag.bank[key[#key]] end, + get = function(key) return SV.db.SVBag.bank[key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], "bank"); MOD:ModifyBags() end, - disabled = function() return not SuperVillain.db.SVBag.enable end, + disabled = function() return not SV.db.SVBag.enable end, args = { point = { order = 1, @@ -237,21 +237,21 @@ SuperVillain.Options.args.SVBag = { } }, - bagBar={ - order=4, - type="group", - name=L["Bag-Bar"], + bagBar = { + order = 4, + type = "group", + name = L["Bag-Bar"], guiInline = true, - get=function(a)return SuperVillain.db.SVBag.bagBar[a[#a]]end, - set=function(a,b)SuperVillain.db.SVBag.bagBar[a[#a]]=b;MOD:ModifyBagBar()end, + get = function(key) return SV.db.SVBag.bagBar[key[#key]] end, + set = function(key, value) MOD:ChangeDBVar(value, key[#key], "bagBar"); MOD:ModifyBagBar() end, args={ enable = { order = 1, type = "toggle", name = L["Enable"], desc = L["Enable/Disable the Bag-Bar."], - get = function(a)return SuperVillain.db.SVBag.bagBar end, - set = function(a,b)SuperVillain.db.SVBag.bagBar = b;SuperVillain:StaticPopup_Show("RL_CLIENT")end + get = function() return SV.db.SVBag.bagBar.enable end, + set = function(key, value) MOD:ChangeDBVar(value, key[#key], "bagBar"); SV:StaticPopup_Show("RL_CLIENT")end }, mouseover = { order = 2, @@ -259,8 +259,14 @@ SuperVillain.Options.args.SVBag = { desc = L["Hidden unless you mouse over the frame."], type = "toggle" }, - size = { + showBackdrop = { order = 3, + name = L["Backdrop"], + desc = L["Show/Hide bag bar backdrop"], + type = "toggle" + }, + size = { + order = 4, type = "range", name = L["Button Size"], desc = L["Set the size of your bag buttons."], @@ -269,7 +275,7 @@ SuperVillain.Options.args.SVBag = { step = 1 }, spacing = { - order = 4, + order = 5, type = "range", name = L["Button Spacing"], desc = L["The spacing between buttons."], @@ -278,7 +284,7 @@ SuperVillain.Options.args.SVBag = { step = 1 }, sortDirection = { - order = 5, + order = 6, type = "select", name = L["Sort Direction"], desc = L["The direction that the bag frames will grow from the anchor."], @@ -288,7 +294,7 @@ SuperVillain.Options.args.SVBag = { } }, showBy = { - order = 6, + order = 7, type = "select", name = L["Bar Direction"], desc = L["The direction that the bag frames be (Horizontal or Vertical)."], diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/bar.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/bar.lua index d52fb62..9c29dd3 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/bar.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/bar.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); -local MOD = SuperVillain.SVBar; +local SV, L = unpack(SVUI); +local MOD = SV.SVBar; --[[ ########################################################## SET PACKAGE OPTIONS @@ -47,9 +47,9 @@ local function BarConfigLoader() type = "group", order = (d + 10), guiInline = false, - disabled = function()return not SuperVillain.db.SVBar.enable end, + disabled = function()return not SV.db.SVBar.enable end, get = function(key) - return SuperVillain.db.SVBar["Bar"..d][key[#key]] + return SV.db.SVBar["Bar"..d][key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], "Bar"..d); @@ -65,14 +65,14 @@ local function BarConfigLoader() order = 2, name = L["Background"], type = "toggle", - disabled = function()return not SuperVillain.db.SVBar["Bar"..d].enable end, + disabled = function()return not SV.db.SVBar["Bar"..d].enable end, }, mouseover = { order = 3, name = L["Mouse Over"], desc = L["The frame is not shown unless you mouse over the frame."], type = "toggle", - disabled = function()return not SuperVillain.db.SVBar["Bar"..d].enable end, + disabled = function()return not SV.db.SVBar["Bar"..d].enable end, }, restorePosition = { order = 4, @@ -80,18 +80,18 @@ local function BarConfigLoader() name = L["Restore Bar"], desc = L["Restore the actionbars default settings"], func = function() - SuperVillain.db:SetDefault("SVBar", "Bar"..d) - SuperVillain:ResetMovables("Bar "..d) + SV.db:SetDefault("SVBar", "Bar"..d) + SV:ResetMovables("Bar "..d) MOD:RefreshBar("Bar"..d) end, - disabled = function()return not SuperVillain.db.SVBar["Bar"..d].enable end, + disabled = function()return not SV.db.SVBar["Bar"..d].enable end, }, adjustGroup = { name = L["Bar Adjustments"], type = "group", order = 5, guiInline = true, - disabled = function()return not SuperVillain.db.SVBar["Bar"..d].enable end, + disabled = function()return not SV.db.SVBar["Bar"..d].enable end, args = { point = { order = 1, @@ -152,16 +152,16 @@ local function BarConfigLoader() type = "group", order = 6, guiInline = true, - disabled = function()return not SuperVillain.db.SVBar["Bar"..d].enable end, + disabled = function()return not SV.db.SVBar["Bar"..d].enable end, args = { useCustomPaging = { order = 1, type = "toggle", name = L["Enable"], desc = L["Allow the use of custom paging for this bar"], - get = function()return SuperVillain.db.SVBar["Bar"..d].useCustomPaging end, + get = function()return SV.db.SVBar["Bar"..d].useCustomPaging end, set = function(e, f) - SuperVillain.db.SVBar["Bar"..d].useCustomPaging = f; + SV.db.SVBar["Bar"..d].useCustomPaging = f; MOD.db["Bar"..d].useCustomPaging = f; MOD:UpdateBarPagingDefaults(); MOD:RefreshBar("Bar"..d) @@ -173,7 +173,7 @@ local function BarConfigLoader() name = L["Restore Defaults"], desc = L["Restore default paging attributes for this bar"], func = function() - SuperVillain.db:SetDefault("SVBar", "Bar"..d, "customPaging") + SV.db:SetDefault("SVBar", "Bar"..d, "customPaging") MOD:UpdateBarPagingDefaults(); MOD:RefreshBar("Bar"..d) end @@ -184,23 +184,23 @@ local function BarConfigLoader() width = "full", name = L["Paging"], desc = L["|cffFF0000ADVANCED:|r Set the paging attributes for this bar"], - get = function(e)return SuperVillain.db.SVBar["Bar"..d].customPaging[SuperVillain.class] end, + get = function(e)return SV.db.SVBar["Bar"..d].customPaging[SV.class] end, set = function(e, f) - SuperVillain.db.SVBar["Bar"..d].customPaging[SuperVillain.class] = f; - MOD.db["Bar"..d].customPaging[SuperVillain.class] = f; + SV.db.SVBar["Bar"..d].customPaging[SV.class] = f; + MOD.db["Bar"..d].customPaging[SV.class] = f; MOD:UpdateBarPagingDefaults(); MOD:RefreshBar("Bar"..d) end, - disabled = function()return not SuperVillain.db.SVBar["Bar"..d].useCustomPaging end, + disabled = function()return not SV.db.SVBar["Bar"..d].useCustomPaging end, }, useCustomVisibility = { order = 4, type = "toggle", name = L["Enable"], desc = L["Allow the use of custom paging for this bar"], - get = function()return SuperVillain.db.SVBar["Bar"..d].useCustomVisibility end, + get = function()return SV.db.SVBar["Bar"..d].useCustomVisibility end, set = function(e, f) - SuperVillain.db.SVBar["Bar"..d].useCustomVisibility = f; + SV.db.SVBar["Bar"..d].useCustomVisibility = f; MOD.db["Bar"..d].useCustomVisibility = f; MOD:UpdateBarPagingDefaults(); MOD:RefreshBar("Bar"..d) @@ -212,7 +212,7 @@ local function BarConfigLoader() name = L["Restore Defaults"], desc = L["Restore default visibility attributes for this bar"], func = function() - SuperVillain.db:SetDefault("SVBar", "Bar"..d, "customVisibility") + SV.db:SetDefault("SVBar", "Bar"..d, "customVisibility") MOD:UpdateBarPagingDefaults(); MOD:RefreshBar("Bar"..d) end @@ -223,21 +223,21 @@ local function BarConfigLoader() width = "full", name = L["Visibility"], desc = L["|cffFF0000ADVANCED:|r Set the visibility attributes for this bar"], - get = function(e)return SuperVillain.db.SVBar["Bar"..d].customVisibility end, + get = function(e)return SV.db.SVBar["Bar"..d].customVisibility end, set = function(e, f) - SuperVillain.db.SVBar["Bar"..d].customVisibility = f; + SV.db.SVBar["Bar"..d].customVisibility = f; MOD.db["Bar"..d].customVisibility = f; MOD:UpdateBarPagingDefaults(); MOD:RefreshBar("Bar"..d) end, - disabled = function()return not SuperVillain.db.SVBar["Bar"..d].useCustomVisibility end, + disabled = function()return not SV.db.SVBar["Bar"..d].useCustomVisibility end, }, } } } } - end; + end bar_configs["Micro"] = { order = d, @@ -245,9 +245,9 @@ local function BarConfigLoader() type = "group", order = 100, guiInline = false, - disabled = function()return not SuperVillain.db.SVBar.enable end, + disabled = function()return not SV.db.SVBar.enable end, get = function(key) - return SuperVillain.db.SVBar["Micro"][key[#key]] + return SV.db.SVBar["Micro"][key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], "Micro"); @@ -263,7 +263,7 @@ local function BarConfigLoader() order = 2, name = L["Mouse Over"], desc = L["The frame is not shown unless you mouse over the frame."], - disabled = function()return not SuperVillain.db.SVBar["Micro"].enable end, + disabled = function()return not SV.db.SVBar["Micro"].enable end, type = "toggle" }, buttonsize = { @@ -274,7 +274,7 @@ local function BarConfigLoader() min = 15, max = 60, step = 1, - disabled = function()return not SuperVillain.db.SVBar["Micro"].enable end, + disabled = function()return not SV.db.SVBar["Micro"].enable end, }, buttonspacing = { order = 4, @@ -284,7 +284,7 @@ local function BarConfigLoader() min = 1, max = 10, step = 1, - disabled = function()return not SuperVillain.db.SVBar["Micro"].enable end, + disabled = function()return not SV.db.SVBar["Micro"].enable end, }, } }; @@ -295,8 +295,8 @@ local function BarConfigLoader() type = "group", order = 200, guiInline = false, - disabled = function()return not SuperVillain.db.SVBar.enable end, - get = function(e)return SuperVillain.db.SVBar["Pet"][e[#e]]end, + disabled = function()return not SV.db.SVBar.enable end, + get = function(e)return SV.db.SVBar["Pet"][e[#e]]end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], "Pet"); MOD:RefreshBar("Pet") @@ -311,14 +311,14 @@ local function BarConfigLoader() order = 2, name = L["Background"], type = "toggle", - disabled = function()return not SuperVillain.db.SVBar["Pet"].enable end, + disabled = function()return not SV.db.SVBar["Pet"].enable end, }, mouseover = { order = 3, name = L["Mouse Over"], desc = L["The frame is not shown unless you mouse over the frame."], type = "toggle", - disabled = function()return not SuperVillain.db.SVBar["Pet"].enable end, + disabled = function()return not SV.db.SVBar["Pet"].enable end, }, restorePosition = { order = 4, @@ -326,18 +326,18 @@ local function BarConfigLoader() name = L["Restore Bar"], desc = L["Restore the actionbars default settings"], func = function() - SuperVillain.db:SetDefault("SVBar", "Pet") - SuperVillain:ResetMovables("Pet Bar") + SV.db:SetDefault("SVBar", "Pet") + SV:ResetMovables("Pet Bar") MOD:RefreshBar("Pet") end, - disabled = function()return not SuperVillain.db.SVBar["Pet"].enable end, + disabled = function()return not SV.db.SVBar["Pet"].enable end, }, adjustGroup = { name = L["Bar Adjustments"], type = "group", order = 5, guiInline = true, - disabled = function()return not SuperVillain.db.SVBar["Pet"].enable end, + disabled = function()return not SV.db.SVBar["Pet"].enable end, args = { point = { order = 1, @@ -372,7 +372,7 @@ local function BarConfigLoader() min = 15, max = 60, step = 1, - disabled = function()return not SuperVillain.db.SVBar.enable end + disabled = function()return not SV.db.SVBar.enable end }, buttonspacing = { order = 5, @@ -382,7 +382,7 @@ local function BarConfigLoader() min = 1, max = 10, step = 1, - disabled = function()return not SuperVillain.db.SVBar.enable end + disabled = function()return not SV.db.SVBar.enable end }, alpha = { order = 6, @@ -406,9 +406,9 @@ local function BarConfigLoader() type = "toggle", name = L["Enable"], desc = L["Allow the use of custom paging for this bar"], - get = function()return SuperVillain.db.SVBar["Pet"].useCustomVisibility end, + get = function()return SV.db.SVBar["Pet"].useCustomVisibility end, set = function(e,f) - SuperVillain.db.SVBar["Pet"].useCustomVisibility = f; + SV.db.SVBar["Pet"].useCustomVisibility = f; MOD.db["Pet"].useCustomVisibility = f; MOD:RefreshBar("Pet") end @@ -419,7 +419,7 @@ local function BarConfigLoader() name = L["Restore Defaults"], desc = L["Restore default visibility attributes for this bar"], func = function() - SuperVillain.db:SetDefault("SVBar", "Pet", "customVisibility") + SV.db:SetDefault("SVBar", "Pet", "customVisibility") MOD:RefreshBar("Pet") end }, @@ -429,13 +429,13 @@ local function BarConfigLoader() width = "full", name = L["Visibility"], desc = L["|cffFF0000ADVANCED:|r Set the visibility attributes for this bar"], - get = function(e)return SuperVillain.db.SVBar["Pet"].customVisibility end, + get = function(e)return SV.db.SVBar["Pet"].customVisibility end, set = function(e,f) - SuperVillain.db.SVBar["Pet"].customVisibility = f; + SV.db.SVBar["Pet"].customVisibility = f; MOD.db["Pet"].customVisibility = f; MOD:RefreshBar("Pet") end, - disabled = function()return not SuperVillain.db.SVBar["Pet"].useCustomVisibility end, + disabled = function()return not SV.db.SVBar["Pet"].useCustomVisibility end, }, } } @@ -448,8 +448,8 @@ local function BarConfigLoader() type = "group", order = 300, guiInline = false, - disabled = function()return not SuperVillain.db.SVBar.enable end, - get = function(e)return SuperVillain.db.SVBar["Stance"][e[#e]]end, + disabled = function()return not SV.db.SVBar.enable end, + get = function(e)return SV.db.SVBar["Stance"][e[#e]]end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], "Stance"); MOD:RefreshBar("Stance") @@ -464,14 +464,14 @@ local function BarConfigLoader() order = 2, name = L["Background"], type = "toggle", - disabled = function()return not SuperVillain.db.SVBar["Stance"].enable end, + disabled = function()return not SV.db.SVBar["Stance"].enable end, }, mouseover = { order = 3, name = L["Mouse Over"], desc = L["The frame is not shown unless you mouse over the frame."], type = "toggle", - disabled = function()return not SuperVillain.db.SVBar["Stance"].enable end, + disabled = function()return not SV.db.SVBar["Stance"].enable end, }, restorePosition = { order = 4, @@ -479,18 +479,18 @@ local function BarConfigLoader() name = L["Restore Bar"], desc = L["Restore the actionbars default settings"], func = function() - SuperVillain.db:SetDefault("SVBar","Stance") - SuperVillain:ResetMovables("Stance Bar") + SV.db:SetDefault("SVBar","Stance") + SV:ResetMovables("Stance Bar") MOD:RefreshBar("Stance") end, - disabled = function()return not SuperVillain.db.SVBar["Stance"].enable end, + disabled = function()return not SV.db.SVBar["Stance"].enable end, }, adjustGroup = { name = L["Bar Adjustments"], type = "group", order = 5, guiInline = true, - disabled = function()return not SuperVillain.db.SVBar["Stance"].enable end, + disabled = function()return not SV.db.SVBar["Stance"].enable end, args = { point = { order = 1, @@ -551,7 +551,7 @@ local function BarConfigLoader() type = "group", order = 6, guiInline = true, - disabled = function()return not SuperVillain.db.SVBar["Stance"].enable end, + disabled = function()return not SV.db.SVBar["Stance"].enable end, args = { style = { order = 1, @@ -578,9 +578,9 @@ local function BarConfigLoader() type = "toggle", name = L["Enable"], desc = L["Allow the use of custom paging for this bar"], - get = function()return SuperVillain.db.SVBar["Stance"].useCustomVisibility end, + get = function()return SV.db.SVBar["Stance"].useCustomVisibility end, set = function(e,f) - SuperVillain.db.SVBar["Stance"].useCustomVisibility = f; + SV.db.SVBar["Stance"].useCustomVisibility = f; MOD.db["Stance"].useCustomVisibility = f; MOD:RefreshBar("Stance") end @@ -591,7 +591,7 @@ local function BarConfigLoader() name = L["Restore Defaults"], desc = L["Restore default visibility attributes for this bar"], func = function() - SuperVillain.db:SetDefault("SVBar", "Stance", "customVisibility") + SV.db:SetDefault("SVBar", "Stance", "customVisibility") MOD:RefreshBar("Stance") end }, @@ -601,26 +601,26 @@ local function BarConfigLoader() width = "full", name = L["Visibility"], desc = L["|cffFF0000ADVANCED:|r Set the visibility attributes for this bar"], - get = function(e)return SuperVillain.db.SVBar["Stance"].customVisibility end, + get = function(e)return SV.db.SVBar["Stance"].customVisibility end, set = function(e,f) - SuperVillain.db.SVBar["Stance"].customVisibility = f; + SV.db.SVBar["Stance"].customVisibility = f; MOD.db["Stance"].customVisibility = f; MOD:RefreshBar("Stance") end, - disabled = function()return not SuperVillain.db.SVBar["Stance"].useCustomVisibility end, + disabled = function()return not SV.db.SVBar["Stance"].useCustomVisibility end, }, } } } } -end; +end -SuperVillain.Options.args.SVBar = { +SV.Options.args.SVBar = { type = "group", name = L["ActionBars"], childGroups = "tab", get = function(key) - return SuperVillain.db.SVBar[key[#key]] + return SV.db.SVBar[key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key]); @@ -631,15 +631,15 @@ SuperVillain.Options.args.SVBar = { order = 1, type = "toggle", name = L["Enable"], - get = function(e)return SuperVillain.db.SVBar[e[#e]]end, - set = function(e, f)SuperVillain.db.SVBar[e[#e]] = f;SuperVillain:StaticPopup_Show("RL_CLIENT")end + get = function(e)return SV.db.SVBar[e[#e]]end, + set = function(e, f)SV.db.SVBar[e[#e]] = f;SV:StaticPopup_Show("RL_CLIENT")end }, barGroup = { order = 2, type = "group", name = L["Bar Options"], childGroups = "tree", - disabled = function()return not SuperVillain.db.SVBar.enable end, + disabled = function()return not SV.db.SVBar.enable end, args = { commonGroup = { order = 1, @@ -689,11 +689,11 @@ SuperVillain.Options.args.SVBar = { desc = L["Color of the actionbutton when out of range."], hasAlpha = true, get = function(key) - local color = SuperVillain.db.SVBar[key[#key]] + local color = SV.db.SVBar[key[#key]] return color[1], color[2], color[3], color[4] end, set = function(key, rValue, gValue, bValue, aValue) - SuperVillain.db.SVBar[key[#key]] = {rValue, gValue, bValue, aValue} + SV.db.SVBar[key[#key]] = {rValue, gValue, bValue, aValue} MOD:RefreshActionBars() end, }, @@ -704,11 +704,11 @@ SuperVillain.Options.args.SVBar = { desc = L["Color of the actionbutton when out of power (Mana, Rage, Focus, Holy Power)."], hasAlpha = true, get = function(key) - local color = SuperVillain.db.SVBar[key[#key]] + local color = SV.db.SVBar[key[#key]] return color[1], color[2], color[3], color[4] end, set = function(key, rValue, gValue, bValue, aValue) - SuperVillain.db.SVBar[key[#key]] = {rValue, gValue, bValue, aValue} + SV.db.SVBar[key[#key]] = {rValue, gValue, bValue, aValue} MOD:RefreshActionBars() end, }, @@ -723,7 +723,7 @@ SuperVillain.Options.args.SVBar = { fontGroup = { order = 2, type = "group", - disabled = function()return not SuperVillain.db.SVBar.enable end, + disabled = function()return not SV.db.SVBar.enable end, name = L["Fonts"], args = { font = { @@ -801,5 +801,5 @@ SuperVillain.Options.args.SVBar = { } } } -bar_configs = SuperVillain.Options.args.SVBar.args.barGroup.args +bar_configs = SV.Options.args.SVBar.args.barGroup.args BarConfigLoader(); \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/chat.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/chat.lua index 0e8134f..39d718e 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/chat.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/chat.lua @@ -29,17 +29,17 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); -local MOD = SuperVillain.SVChat; +local SV, L = unpack(SVUI); +local MOD = SV.SVChat; --[[ ########################################################## SET PACKAGE OPTIONS ########################################################## ]]-- -SuperVillain.Options.args.SVChat={ +SV.Options.args.SVChat={ type = "group", name = L["Chat"], - get = function(a)return SuperVillain.db.SVChat[a[#a]]end, + get = function(a)return SV.db.SVChat[a[#a]]end, set = function(a,b)MOD:ChangeDBVar(b,a[#a]); end, args = { intro = { @@ -51,8 +51,8 @@ SuperVillain.Options.args.SVChat={ order = 2, type = "toggle", name = L["Enable"], - get = function(a)return SuperVillain.db.SVChat.enable end, - set = function(a,b)SuperVillain.db.SVChat.enable = b;SuperVillain:StaticPopup_Show("RL_CLIENT")end + get = function(a)return SV.db.SVChat.enable end, + set = function(a,b)SV.db.SVChat.enable = b;SV:StaticPopup_Show("RL_CLIENT")end }, common = { order = 3, @@ -90,7 +90,7 @@ SuperVillain.Options.args.SVChat={ order = 5, type = "toggle", name = L["Custom Tab Style"], - set = function(a,b) MOD:ChangeDBVar(b,a[#a]);SuperVillain:StaticPopup_Show("RL_CLIENT") end, + set = function(a,b) MOD:ChangeDBVar(b,a[#a]);SV:StaticPopup_Show("RL_CLIENT") end, }, timeStampFormat = { order = 6, @@ -112,7 +112,7 @@ SuperVillain.Options.args.SVChat={ type = "select", dialogControl = "LSM30_Sound", name = L["Whisper Alert"], - disabled = function()return not SuperVillain.db.SVChat.psst end, + disabled = function()return not SV.db.SVChat.psst end, values = AceGUIWidgetLSMlists.sound, set = function(a,b) MOD:ChangeDBVar(b,a[#a]) end }, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/dock.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/dock.lua index b994f81..17c7d67 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/dock.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/dock.lua @@ -29,24 +29,24 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); -local MOD = SuperVillain.SVDock -local CHAT = SuperVillain.SVChat -local BAG = SuperVillain.SVBag +local SV, L = unpack(SVUI); +local MOD = SV.SVDock +local CHAT = SV.SVChat +local BAG = SV.SVBag -SuperVillain.Options.args.SVDock = { +SV.Options.args.SVDock = { type = "group", name = L["Docks"], args = {} } -SuperVillain.Options.args.SVDock.args["intro"] = { +SV.Options.args.SVDock.args["intro"] = { order = 1, type = "description", name = "Configure the various frame docks around the screen" }; -SuperVillain.Options.args.SVDock.args["common"] = { +SV.Options.args.SVDock.args["common"] = { order = 2, type = "group", name = "General", @@ -57,7 +57,7 @@ SuperVillain.Options.args.SVDock.args["common"] = { type = 'toggle', name = L['Bottom Panel'], desc = L['Display a border across the bottom of the screen.'], - get = function(j)return SuperVillain.db.SVDock.bottomPanel end, + get = function(j)return SV.db.SVDock.bottomPanel end, set = function(key,value)MOD:ChangeDBVar(value,key[#key]);MOD:BottomPanelVisibility()end }, topPanel = { @@ -65,7 +65,7 @@ SuperVillain.Options.args.SVDock.args["common"] = { type = 'toggle', name = L['Top Panel'], desc = L['Display a border across the top of the screen.'], - get = function(j)return SuperVillain.db.SVDock.topPanel end, + get = function(j)return SV.db.SVDock.topPanel end, set = function(key,value)MOD:ChangeDBVar(value,key[#key]);MOD:TopPanelVisibility()end }, leftDockBackdrop = { @@ -73,7 +73,7 @@ SuperVillain.Options.args.SVDock.args["common"] = { type = 'toggle', name = L['Left Dock Backdrop'], desc = L['Display a backdrop behind the left-side dock.'], - get = function(j)return SuperVillain.db.SVDock.leftDockBackdrop end, + get = function(j)return SV.db.SVDock.leftDockBackdrop end, set = function(key,value) MOD:ChangeDBVar(value,key[#key]); MOD:UpdateDockBackdrops() @@ -82,7 +82,7 @@ SuperVillain.Options.args.SVDock.args["common"] = { } }; -SuperVillain.Options.args.SVDock.args["leftDockGroup"] = { +SV.Options.args.SVDock.args["leftDockGroup"] = { order = 3, type = "group", name = L["Left Dock"], @@ -97,7 +97,7 @@ SuperVillain.Options.args.SVDock.args["leftDockGroup"] = { max = 600, step = 1, width = "full", - get = function()return SuperVillain.db.SVDock.dockLeftHeight;end, + get = function()return SV.db.SVDock.dockLeftHeight;end, set = function(key,value) MOD:ChangeDBVar(value,key[#key]); MOD:UpdateSuperDock(true) @@ -113,7 +113,7 @@ SuperVillain.Options.args.SVDock.args["leftDockGroup"] = { max = 700, step = 1, width = "full", - get = function()return SuperVillain.db.SVDock.dockLeftWidth;end, + get = function()return SV.db.SVDock.dockLeftWidth;end, set = function(key,value) MOD:ChangeDBVar(value,key[#key]); MOD:UpdateSuperDock(true) @@ -129,7 +129,7 @@ SuperVillain.Options.args.SVDock.args["leftDockGroup"] = { max = 1200, step = 1, width = "full", - get = function()return SuperVillain.db.SVDock.dockStatWidth end, + get = function()return SV.db.SVDock.dockStatWidth end, set = function(key,value) MOD:ChangeDBVar(value,key[#key]); MOD:UpdateSuperDock(true) @@ -147,7 +147,7 @@ local acceptableDocklets = { }; local function GetLiveDockletsA() - local test = SuperVillain.db.SVDock.docklets.DockletExtra; + local test = SV.db.SVDock.docklets.DockletExtra; local t = {["None"] = L["None"]}; for n,l in pairs(acceptableDocklets) do if IsAddOnLoaded(n) or IsAddOnLoaded(l) then @@ -155,7 +155,7 @@ local function GetLiveDockletsA() for index,window in pairs(Skada:GetWindows()) do local key = window.db.name t["Skada"..key] = (key=="Skada") and "Skada - Main" or "Skada - "..key; - end; + end elseif (test ~= n and test ~= l) then t[n] = l; end @@ -165,7 +165,7 @@ local function GetLiveDockletsA() end local function GetLiveDockletsB() - local test = SuperVillain.db.SVDock.docklets.DockletMain; + local test = SV.db.SVDock.docklets.DockletMain; local t = {["None"] = L["None"]}; for n,l in pairs(acceptableDocklets) do if IsAddOnLoaded(n) or IsAddOnLoaded(l) then @@ -173,7 +173,7 @@ local function GetLiveDockletsB() for index,window in pairs(Skada:GetWindows()) do local key = window.db.name t["Skada"..key] = (key=="Skada") and "Skada - Main" or "Skada - "..key; - end; + end elseif (test ~= n and test ~= l) then t[n] = l; end @@ -182,7 +182,7 @@ local function GetLiveDockletsB() return t; end -SuperVillain.Options.args.SVDock.args["rightDockGroup"] = { +SV.Options.args.SVDock.args["rightDockGroup"] = { order = 4, type = "group", name = L["Right Dock"], @@ -196,7 +196,7 @@ SuperVillain.Options.args.SVDock.args["rightDockGroup"] = { min = 150, max = 600, step = 1, - get = function()return SuperVillain.db.SVDock.dockRightHeight;end, + get = function()return SV.db.SVDock.dockRightHeight;end, set = function(key,value) MOD:ChangeDBVar(value,key[#key]); MOD:UpdateSuperDock(true) @@ -211,7 +211,7 @@ SuperVillain.Options.args.SVDock.args["rightDockGroup"] = { min = 150, max = 700, step = 1, - get = function()return SuperVillain.db.SVDock.dockRightWidth;end, + get = function()return SV.db.SVDock.dockRightWidth;end, set = function(key,value) MOD:ChangeDBVar(value,key[#key]); MOD:UpdateSuperDock(true) @@ -225,7 +225,7 @@ SuperVillain.Options.args.SVDock.args["rightDockGroup"] = { type = 'toggle', name = L['Right Dock Backdrop'], desc = L['Display a backdrop behind the right-side dock.'], - get = function(j)return SuperVillain.db.SVDock.rightDockBackdrop end, + get = function(j)return SV.db.SVDock.rightDockBackdrop end, set = function(key,value) MOD:ChangeDBVar(value,key[#key]); MOD:UpdateDockBackdrops() @@ -240,8 +240,8 @@ SuperVillain.Options.args.SVDock.args["rightDockGroup"] = { order = 1, type = "toggle", name = L["Enable"], - get = function()return SuperVillain.db.system.questWatch end, - set = function(j, value) SuperVillain.db.system.questWatch = value; SuperVillain:StaticPopup_Show("RL_CLIENT") end + get = function()return SV.db.system.questWatch end, + set = function(j, value) SV.db.system.questWatch = value; SV:StaticPopup_Show("RL_CLIENT") end } } }, @@ -263,33 +263,33 @@ SuperVillain.Options.args.SVDock.args["rightDockGroup"] = { name = "Primary Docklet", desc = "Select an addon to occupy the primary docklet window", values = function()return GetLiveDockletsA()end, - get = function()return SuperVillain.db.SVDock.docklets.DockletMain end, - set = function(a,value)SuperVillain.db.SVDock.docklets.DockletMain = value;SuperVillain:ReloadDocklets()end, + get = function()return SV.db.SVDock.docklets.DockletMain end, + set = function(a,value)SV.db.SVDock.docklets.DockletMain = value;SV:ReloadDocklets()end, }, DockletCombatFade = { type = "toggle", order = 2, name = "Out of Combat (Hide)", - get = function()return SuperVillain.db.SVDock.docklets.DockletCombatFade end, - set = function(a,value)SuperVillain.db.SVDock.docklets.DockletCombatFade = value;end + get = function()return SV.db.SVDock.docklets.DockletCombatFade end, + set = function(a,value)SV.db.SVDock.docklets.DockletCombatFade = value;end }, enableExtra = { type = "toggle", order = 3, name = "Split Docklet", desc = "Split the primary docklet window for 2 addons.", - get = function()return SuperVillain.db.SVDock.docklets.enableExtra end, - set = function(a,value)SuperVillain.db.SVDock.docklets.enableExtra = value;SuperVillain:ReloadDocklets()end, + get = function()return SV.db.SVDock.docklets.enableExtra end, + set = function(a,value)SV.db.SVDock.docklets.enableExtra = value;SV:ReloadDocklets()end, }, DockletExtra = { type = "select", order = 4, name = "Secondary Docklet", desc = "Select another addon", - disabled = function()return (not SuperVillain.db.SVDock.docklets.enableExtra or SuperVillain.db.SVDock.docklets.DockletMain == "None") end, + disabled = function()return (not SV.db.SVDock.docklets.enableExtra or SV.db.SVDock.docklets.DockletMain == "None") end, values = function()return GetLiveDockletsB()end, - get = function()return SuperVillain.db.SVDock.docklets.DockletExtra end, - set = function(a,value)SuperVillain.db.SVDock.docklets.DockletExtra = value;SuperVillain:ReloadDocklets()end, + get = function()return SV.db.SVDock.docklets.DockletExtra end, + set = function(a,value)SV.db.SVDock.docklets.DockletExtra = value;SV:ReloadDocklets()end, } } } diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/dynamic.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/dynamic.lua index 8356e06..9de9d75 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/dynamic.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/dynamic.lua @@ -29,11 +29,11 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); -local queue = SuperVillain.DynamicOptions; +local SV, L = unpack(SVUI); +local queue = SV.DynamicOptions; do for key,options in pairs(queue) do - SuperVillain.Options.args[key].args[options.key] = options.data + SV.Options.args[key].args[options.key] = options.data end -end; \ No newline at end of file +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/filter.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/filter.lua index 5bc38eb..ad1a140 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/filter.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/filter.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); -local MOD = SuperVillain.SVUnit +local SV, L = unpack(SVUI); +local MOD = SV.SVUnit if(not MOD) then return end local _, ns = ...; local selectedSpell,filterType,filters; @@ -49,7 +49,7 @@ local nameMapping = { local function generateFilterOptions() if filterType == 'AuraBar Colors' then - SuperVillain.Options.args.filters.args.filterGroup = { + SV.Options.args.filters.args.filterGroup = { type = "group", name = filterType, guiInline = true, @@ -63,8 +63,8 @@ local function generateFilterOptions() guiInline = true, get = function(e)return""end, set = function(e, arg) - if not SuperVillain.db.media.unitframes.spellcolor[arg] then - SuperVillain.db.media.unitframes.spellcolor[arg] = false + if not SV.db.media.unitframes.spellcolor[arg] then + SV.db.media.unitframes.spellcolor[arg] = false end generateFilterOptions() MOD:SetUnitFrame("player") @@ -80,11 +80,11 @@ local function generateFilterOptions() guiInline = true, get = function(e)return""end, set = function(e, arg) - if SuperVillain.db.media.unitframes.spellcolor[arg]then - SuperVillain.db.media.unitframes.spellcolor[arg] = false; - SuperVillain:AddonMessage(L["You may not remove a spell from a default filter that is not customly added. Setting spell to false instead."]) + if SV.db.media.unitframes.spellcolor[arg]then + SV.db.media.unitframes.spellcolor[arg] = false; + SV:AddonMessage(L["You may not remove a spell from a default filter that is not customly added. Setting spell to false instead."]) else - SuperVillain.db.media.unitframes.spellcolor[arg] = nil + SV.db.media.unitframes.spellcolor[arg] = nil end selectedSpell = nil; generateFilterOptions() @@ -106,7 +106,7 @@ local function generateFilterOptions() values = function() local filters = {} filters[""] = NONE; - for g in pairs(SuperVillain.db.media.unitframes.spellcolor)do + for g in pairs(SV.db.media.unitframes.spellcolor)do filters[g] = g end return filters @@ -115,12 +115,12 @@ local function generateFilterOptions() } } - if not selectedSpell or SuperVillain.db.media.unitframes.spellcolor[selectedSpell] == nil then - SuperVillain.Options.args.filters.args.spellGroup = nil; + if not selectedSpell or SV.db.media.unitframes.spellcolor[selectedSpell] == nil then + SV.Options.args.filters.args.spellGroup = nil; return end - SuperVillain.Options.args.filters.args.spellGroup = { + SV.Options.args.filters.args.spellGroup = { type = "group", name = selectedSpell, order = 15, @@ -131,7 +131,7 @@ local function generateFilterOptions() type = "color", order = 1, get = function(e) - local abColor = SuperVillain.db.media.unitframes.spellcolor[selectedSpell] + local abColor = SV.db.media.unitframes.spellcolor[selectedSpell] if type(abColor) == "boolean"then return 0, 0, 0, 1 else @@ -139,11 +139,11 @@ local function generateFilterOptions() end end, set = function(e, r, g, b) - if type(SuperVillain.db.media.unitframes.spellcolor[selectedSpell]) ~= "table"then - SuperVillain.db.media.unitframes.spellcolor[selectedSpell] = {} + if type(SV.db.media.unitframes.spellcolor[selectedSpell]) ~= "table"then + SV.db.media.unitframes.spellcolor[selectedSpell] = {} end local abColor = {r, g, b} - SuperVillain.db.media.unitframes.spellcolor[selectedSpell] = abColor + SV.db.media.unitframes.spellcolor[selectedSpell] = abColor MOD:SetUnitFrame("player") MOD:SetUnitFrame("target") MOD:SetUnitFrame("focus") @@ -154,7 +154,7 @@ local function generateFilterOptions() order = 2, name = L["Restore Defaults"], func = function(e, arg) - SuperVillain.db.media.unitframes.spellcolor[selectedSpell] = false; + SV.db.media.unitframes.spellcolor[selectedSpell] = false; MOD:SetUnitFrame("player") MOD:SetUnitFrame("target") MOD:SetUnitFrame("focus") @@ -167,14 +167,14 @@ local function generateFilterOptions() local watchedBuffs = {} - if not SuperVillain.db.filter.PetBuffWatch then - SuperVillain.db.filter.PetBuffWatch = {} + if not SV.db.filter.PetBuffWatch then + SV.db.filter.PetBuffWatch = {} end - for o,f in pairs(SuperVillain.db.filter.PetBuffWatch)do + for o,f in pairs(SV.db.filter.PetBuffWatch)do tinsert(watchedBuffs,f) end - SuperVillain.Options.args.filters.args.filterGroup = { + SV.Options.args.filters.args.filterGroup = { type = "group", name = filterType, guiInline = true, @@ -189,11 +189,11 @@ local function generateFilterOptions() get = function(e)return""end, set = function(e, arg) if not tonumber(arg) then - SuperVillain:AddonMessage(L["Value must be a number"]) + SV:AddonMessage(L["Value must be a number"]) elseif not GetSpellInfo(arg)then - SuperVillain:AddonMessage(L["Not valid spell id"]) + SV:AddonMessage(L["Not valid spell id"]) else - tinsert(SuperVillain.db.filter.PetBuffWatch, {["enable"] = true, ["id"] = tonumber(arg), ["point"] = "TOPRIGHT", ["color"] = {["r"] = 1, ["g"] = 0, ["b"] = 0}, ["anyUnit"] = true}) + tinsert(SV.db.filter.PetBuffWatch, {["enable"] = true, ["id"] = tonumber(arg), ["point"] = "TOPRIGHT", ["color"] = {["r"] = 1, ["g"] = 0, ["b"] = 0}, ["anyUnit"] = true}) generateFilterOptions() MOD:SetUnitFrame("pet") selectedSpell = nil @@ -208,23 +208,23 @@ local function generateFilterOptions() get = function(e)return""end, set = function(e, arg) if not tonumber(arg)then - SuperVillain:AddonMessage(L["Value must be a number"]) + SV:AddonMessage(L["Value must be a number"]) elseif not GetSpellInfo(arg)then - SuperVillain:AddonMessage(L["Not valid spell id"]) + SV:AddonMessage(L["Not valid spell id"]) else local p; - for q, r in pairs(SuperVillain.db.filter.PetBuffWatch)do + for q, r in pairs(SV.db.filter.PetBuffWatch)do if r["id"] == tonumber(arg)then p = r; - if SuperVillain.db.filter.PetBuffWatch[q]then - SuperVillain.db.filter.PetBuffWatch[q].enable = false; + if SV.db.filter.PetBuffWatch[q]then + SV.db.filter.PetBuffWatch[q].enable = false; else - SuperVillain.db.filter.PetBuffWatch[q] = nil + SV.db.filter.PetBuffWatch[q] = nil end end end if p == nil then - SuperVillain:AddonMessage(L["Spell not found in list."]) + SV:AddonMessage(L["Spell not found in list."]) else generateFilterOptions() end @@ -241,7 +241,7 @@ local function generateFilterOptions() values = function() local v = {} watchedBuffs = {} - for o, f in pairs(SuperVillain.db.filter.PetBuffWatch)do + for o, f in pairs(SV.db.filter.PetBuffWatch)do tinsert(watchedBuffs, f) end for o, l in pairs(watchedBuffs)do @@ -260,7 +260,7 @@ local function generateFilterOptions() local registeredSpell; - for t,l in pairs(SuperVillain.db.filter.PetBuffWatch)do + for t,l in pairs(SV.db.filter.PetBuffWatch)do if l.id == selectedSpell then registeredSpell = t end @@ -268,12 +268,12 @@ local function generateFilterOptions() if selectedSpell and registeredSpell then local currentSpell = GetSpellInfo(selectedSpell) - SuperVillain.Options.args.filters.args.filterGroup.args[currentSpell] = { + SV.Options.args.filters.args.filterGroup.args[currentSpell] = { name = currentSpell.." ("..selectedSpell..")", type = "group", - get = function(e)return SuperVillain.db.filter.PetBuffWatch[registeredSpell][e[#e]] end, + get = function(e)return SV.db.filter.PetBuffWatch[registeredSpell][e[#e]] end, set = function(e, arg) - SuperVillain.db.filter.PetBuffWatch[registeredSpell][e[#e]] = arg; + SV.db.filter.PetBuffWatch[registeredSpell][e[#e]] = arg; MOD:SetUnitFrame("pet") end, order = -10, @@ -311,11 +311,11 @@ local function generateFilterOptions() type = "color", order = 4, get = function(e) - local abColor = SuperVillain.db.filter.PetBuffWatch[registeredSpell][e[#e]] + local abColor = SV.db.filter.PetBuffWatch[registeredSpell][e[#e]] return abColor.r, abColor.g, abColor.b, abColor.a end, set = function(e, i, j, k) - local abColor = SuperVillain.db.filter.PetBuffWatch[registeredSpell][e[#e]] + local abColor = SV.db.filter.PetBuffWatch[registeredSpell][e[#e]] abColor.r, abColor.g, abColor.b = i, j, k; MOD:SetUnitFrame("pet") end @@ -330,7 +330,7 @@ local function generateFilterOptions() type = "color", order = 6, get = function(e) - local abColor = SuperVillain.db.filter.PetBuffWatch[registeredSpell][e[#e]] + local abColor = SV.db.filter.PetBuffWatch[registeredSpell][e[#e]] if abColor then return abColor.r,abColor.g,abColor.b,abColor.a else @@ -338,7 +338,7 @@ local function generateFilterOptions() end end, set = function(e,i,j,k) - local abColor = SuperVillain.db.filter.PetBuffWatch[registeredSpell][e[#e]] + local abColor = SV.db.filter.PetBuffWatch[registeredSpell][e[#e]] abColor.r,abColor.g,abColor.b = i,j,k; MOD:SetUnitFrame("pet") end @@ -361,7 +361,7 @@ local function generateFilterOptions() name = L["Show When Not Active"], order = 8, type = "toggle", - disabled = function()return SuperVillain.db.filter.PetBuffWatch[registeredSpell].style == "text"end + disabled = function()return SV.db.filter.PetBuffWatch[registeredSpell].style == "text"end } } } @@ -373,14 +373,14 @@ local function generateFilterOptions() local watchedBuffs={} - if not SuperVillain.db.filter.BuffWatch then - SuperVillain.db.filter.BuffWatch = {} + if not SV.db.filter.BuffWatch then + SV.db.filter.BuffWatch = {} end - for o,f in pairs(SuperVillain.db.filter.BuffWatch) do + for o,f in pairs(SV.db.filter.BuffWatch) do tinsert(watchedBuffs,f) end - SuperVillain.Options.args.filters.args.filterGroup = { + SV.Options.args.filters.args.filterGroup = { type = "group", name = filterType, guiInline = true, @@ -395,11 +395,11 @@ local function generateFilterOptions() get = function(e)return""end, set = function(e, arg) if not tonumber(arg)then - SuperVillain:AddonMessage(L["Value must be a number"]) + SV:AddonMessage(L["Value must be a number"]) elseif not GetSpellInfo(arg)then - SuperVillain:AddonMessage(L["Not valid spell id"]) + SV:AddonMessage(L["Not valid spell id"]) else - tinsert(SuperVillain.db.filter.BuffWatch, {["enable"] = true, ["id"] = tonumber(arg), ["point"] = "TOPRIGHT", ["color"] = {["r"] = 1, ["g"] = 0, ["b"] = 0}, ["anyUnit"] = false}) + tinsert(SV.db.filter.BuffWatch, {["enable"] = true, ["id"] = tonumber(arg), ["point"] = "TOPRIGHT", ["color"] = {["r"] = 1, ["g"] = 0, ["b"] = 0}, ["anyUnit"] = false}) generateFilterOptions() for t = 10, 40, 15 do MOD:UpdateGroupAuraWatch("raid"..t) @@ -418,23 +418,23 @@ local function generateFilterOptions() get = function(e)return""end, set = function(e, arg) if not tonumber(arg)then - SuperVillain:AddonMessage(L["Value must be a number"]) + SV:AddonMessage(L["Value must be a number"]) elseif not GetSpellInfo(arg)then - SuperVillain:AddonMessage(L["Not valid spell id"]) + SV:AddonMessage(L["Not valid spell id"]) else local p; - for q, r in pairs(SuperVillain.db.filter.BuffWatch)do + for q, r in pairs(SV.db.filter.BuffWatch)do if r["id"] == tonumber(arg)then p = r; - if SuperVillain.db.filter.BuffWatch[q]then - SuperVillain.db.filter.BuffWatch[q].enable = false; + if SV.db.filter.BuffWatch[q]then + SV.db.filter.BuffWatch[q].enable = false; else - SuperVillain.db.filter.BuffWatch[q] = nil + SV.db.filter.BuffWatch[q] = nil end end end if p == nil then - SuperVillain:AddonMessage(L["Spell not found in list."]) + SV:AddonMessage(L["Spell not found in list."]) else generateFilterOptions() end @@ -455,7 +455,7 @@ local function generateFilterOptions() values = function() local v = {} watchedBuffs = {} - for o, f in pairs(SuperVillain.db.filter.BuffWatch)do + for o, f in pairs(SV.db.filter.BuffWatch)do tinsert(watchedBuffs, f) end for o, l in pairs(watchedBuffs)do @@ -472,15 +472,15 @@ local function generateFilterOptions() } } local registeredSpell; - for t,l in pairs(SuperVillain.db.filter.BuffWatch)do if l.id==selectedSpell then registeredSpell=t end end + for t,l in pairs(SV.db.filter.BuffWatch)do if l.id==selectedSpell then registeredSpell=t end end if selectedSpell and registeredSpell then local currentSpell=GetSpellInfo(selectedSpell) - SuperVillain.Options.args.filters.args.filterGroup.args[currentSpell] = { + SV.Options.args.filters.args.filterGroup.args[currentSpell] = { name = currentSpell.." ("..selectedSpell..")", type = "group", - get = function(e)return SuperVillain.db.filter.BuffWatch[registeredSpell][e[#e]]end, + get = function(e)return SV.db.filter.BuffWatch[registeredSpell][e[#e]]end, set = function(e, arg) - SuperVillain.db.filter.BuffWatch[registeredSpell][e[#e]] = arg; + SV.db.filter.BuffWatch[registeredSpell][e[#e]] = arg; for t = 10, 40, 15 do MOD:UpdateGroupAuraWatch("raid"..t) end @@ -513,11 +513,11 @@ local function generateFilterOptions() type = "color", order = 4, get = function(e) - local abColor = SuperVillain.db.filter.BuffWatch[registeredSpell][e[#e]] + local abColor = SV.db.filter.BuffWatch[registeredSpell][e[#e]] return abColor.r, abColor.g, abColor.b, abColor.a end, set = function(e, i, j, k) - local abColor = SuperVillain.db.filter.BuffWatch[registeredSpell][e[#e]] + local abColor = SV.db.filter.BuffWatch[registeredSpell][e[#e]] abColor.r, abColor.g, abColor.b = i, j, k; for t = 10, 40, 15 do MOD:UpdateGroupAuraWatch("raid"..t) @@ -536,7 +536,7 @@ local function generateFilterOptions() type = "color", order = 6, get = function(e) - local abColor = SuperVillain.db.filter.BuffWatch[registeredSpell][e[#e]] + local abColor = SV.db.filter.BuffWatch[registeredSpell][e[#e]] if abColor then return abColor.r, abColor.g, abColor.b, abColor.a else @@ -544,8 +544,8 @@ local function generateFilterOptions() end end, set = function(e, i, j, k) - SuperVillain.db.filter.BuffWatch[registeredSpell][e[#e]] = SuperVillain.db.filter.BuffWatch[registeredSpell][e[#e]] or {} - local abColor = SuperVillain.db.filter.BuffWatch[registeredSpell][e[#e]] + SV.db.filter.BuffWatch[registeredSpell][e[#e]] = SV.db.filter.BuffWatch[registeredSpell][e[#e]] or {} + local abColor = SV.db.filter.BuffWatch[registeredSpell][e[#e]] abColor.r, abColor.g, abColor.b = i, j, k; for t = 10, 40, 15 do MOD:UpdateGroupAuraWatch("raid"..t) @@ -572,19 +572,19 @@ local function generateFilterOptions() name = L["Show When Not Active"], order = 8, type = "toggle", - disabled = function()return SuperVillain.db.filter.BuffWatch[registeredSpell].style == "text" end + disabled = function()return SV.db.filter.BuffWatch[registeredSpell].style == "text" end } } } end watchedBuffs=nil else - if not filterType or not SuperVillain.db.filter[filterType]then - SuperVillain.Options.args.filters.args.filterGroup = nil; - SuperVillain.Options.args.filters.args.spellGroup = nil; + if not filterType or not SV.db.filter[filterType]then + SV.Options.args.filters.args.filterGroup = nil; + SV.Options.args.filters.args.spellGroup = nil; return end - SuperVillain.Options.args.filters.args.filterGroup = { + SV.Options.args.filters.args.filterGroup = { type = "group", name = filterType, guiInline = true, @@ -597,8 +597,8 @@ local function generateFilterOptions() type = "input", get = function(e)return""end, set = function(e, arg) - if not SuperVillain.db.filter[filterType][arg]then - SuperVillain.db.filter[filterType][arg] = { + if not SV.db.filter[filterType][arg]then + SV.db.filter[filterType][arg] = { ["enable"] = true, ["priority"] = 0 } @@ -614,15 +614,15 @@ local function generateFilterOptions() type = "input", get = function(e)return""end, set = function(e, arg) - if SuperVillain.db.filter[filterType] then - if SuperVillain.db.filter[filterType][arg] then - SuperVillain.db.filter[filterType][arg].enable = false; - SuperVillain:AddonMessage(L["You may not remove a spell from a default filter that is not customly added. Setting spell to false instead."]) + if SV.db.filter[filterType] then + if SV.db.filter[filterType][arg] then + SV.db.filter[filterType][arg].enable = false; + SV:AddonMessage(L["You may not remove a spell from a default filter that is not customly added. Setting spell to false instead."]) else - SuperVillain.db.filter[filterType][arg] = nil + SV.db.filter[filterType][arg] = nil end else - SuperVillain.db.filter[filterType][arg] = nil + SV.db.filter[filterType][arg] = nil end generateFilterOptions() MOD:RefreshUnitFrames() @@ -640,7 +640,7 @@ local function generateFilterOptions() end, values = function() local filters = {} - local list = SuperVillain.db.filter[filterType] + local list = SV.db.filter[filterType] filters[""] = NONE; for g in pairs(list)do filters[g] = g @@ -651,12 +651,12 @@ local function generateFilterOptions() } } - if not selectedSpell or not SuperVillain.db.filter[filterType][selectedSpell] then - SuperVillain.Options.args.filters.args.spellGroup = nil; + if not selectedSpell or not SV.db.filter[filterType][selectedSpell] then + SV.Options.args.filters.args.spellGroup = nil; return end - SuperVillain.Options.args.filters.args.spellGroup = { + SV.Options.args.filters.args.spellGroup = { type = "group", name = selectedSpell, order = 15, @@ -669,11 +669,11 @@ local function generateFilterOptions() if selectedFolder or not selectedSpell then return false else - return SuperVillain.db.filter[filterType][selectedSpell].enable + return SV.db.filter[filterType][selectedSpell].enable end end, set = function(e, arg) - SuperVillain.db.filter[filterType][selectedSpell].enable = arg; + SV.db.filter[filterType][selectedSpell].enable = arg; generateFilterOptions() MOD:RefreshUnitFrames() end @@ -685,11 +685,11 @@ local function generateFilterOptions() if selectedFolder or not selectedSpell then return 0 else - return SuperVillain.db.filter[filterType][selectedSpell].priority + return SV.db.filter[filterType][selectedSpell].priority end end, set = function(e, arg) - SuperVillain.db.filter[filterType][selectedSpell].priority = arg; + SV.db.filter[filterType][selectedSpell].priority = arg; generateFilterOptions() MOD:RefreshUnitFrames() end, @@ -704,7 +704,7 @@ local function generateFilterOptions() MOD:RefreshUnitFrames() collectgarbage("collect") end -SuperVillain.Options.args.filters = { +SV.Options.args.filters = { type = "group", name = L["Filters"], order = -10, @@ -716,8 +716,8 @@ SuperVillain.Options.args.filters = { type = "input", get = function(e)return""end, set = function(e, arg) - SuperVillain.db.filter[arg] = {} - SuperVillain.db.filter[arg]["spells"] = {} + SV.db.filter[arg] = {} + SV.db.filter[arg]["spells"] = {} end }, deleteFilter = { @@ -727,19 +727,19 @@ SuperVillain.Options.args.filters = { desc = L["Delete a created filter, you cannot delete pre-existing filters, only custom ones."], get = function(e)return""end, set = function(e, arg) - if SuperVillain.db.filter[arg] then - SuperVillain:AddonMessage(L["You can't remove a pre-existing filter."]) + if SV.db.filter[arg] then + SV:AddonMessage(L["You can't remove a pre-existing filter."]) else - SuperVillain.db.filter[arg] = nil; + SV.db.filter[arg] = nil; filterType = nil; selectedSpell = nil; - SuperVillain.Options.args.filters.args.filterGroup = nil + SV.Options.args.filters.args.filterGroup = nil end end, values = function() filters = {} filters[""] = NONE; - for g in pairs(SuperVillain.db.filter) do + for g in pairs(SV.db.filter) do filters[g] = nameMapping[g] or g end return filters @@ -762,7 +762,7 @@ SuperVillain.Options.args.filters = { values = function() filters = {} filters[""] = NONE; - for g in pairs(SuperVillain.db.filter) do + for g in pairs(SV.db.filter) do filters[g] = nameMapping[g] or g end filters["AuraBar Colors"] = "AuraBar Colors" diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/henchmen.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/henchmen.lua index e2e5e16..1615bd8 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/henchmen.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/henchmen.lua @@ -29,17 +29,17 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); -local MOD = SuperVillain.SVHenchmen; +local SV, L = unpack(SVUI); +local MOD = SV.SVHenchmen; --[[ ########################################################## SET PACKAGE OPTIONS ########################################################## ]]-- -SuperVillain.Options.args.SVHenchmen={ +SV.Options.args.SVHenchmen={ type = "group", name = L["Henchmen"], - get = function(a)return SuperVillain.db.SVHenchmen[a[#a]]end, + get = function(a)return SV.db.SVHenchmen[a[#a]]end, set = function(a,b)MOD:ChangeDBVar(b,a[#a]); end, args = { intro = { @@ -64,57 +64,57 @@ SuperVillain.Options.args.SVHenchmen={ order = 1, type = 'toggle', name = L["Enable Mail Helper"], - get = function(j)return SuperVillain.db.SVHenchmen.mailOpener end, - set = function(j,value)SuperVillain.db.SVHenchmen.mailOpener = value;MOD:ToggleMailMinions()end + get = function(j)return SV.db.SVHenchmen.mailOpener end, + set = function(j,value)SV.db.SVHenchmen.mailOpener = value;MOD:ToggleMailMinions()end }, autoAcceptInvite = { order = 2, name = L['Accept Invites'], desc = L['Automatically accept invites from guild/friends.'], type = 'toggle', - get = function(j)return SuperVillain.db.SVHenchmen.autoAcceptInvite end, - set = function(j,value)SuperVillain.db.SVHenchmen.autoAcceptInvite = value end + get = function(j)return SV.db.SVHenchmen.autoAcceptInvite end, + set = function(j,value)SV.db.SVHenchmen.autoAcceptInvite = value end }, vendorGrays = { order = 3, name = L['Vendor Grays'], desc = L['Automatically vendor gray items when visiting a vendor.'], type = 'toggle', - get = function(j)return SuperVillain.db.SVHenchmen.vendorGrays end, - set = function(j,value)SuperVillain.db.SVHenchmen.vendorGrays = value end + get = function(j)return SV.db.SVHenchmen.vendorGrays end, + set = function(j,value)SV.db.SVHenchmen.vendorGrays = value end }, autoRoll = { order = 4, name = L['Auto Greed/DE'], desc = L['Automatically select greed or disenchant (when available) on green quality items. This will only work if you are the max level.'], type = 'toggle', - get = function(j)return SuperVillain.db.SVHenchmen.autoRoll end, - set = function(j,value)SuperVillain.db.SVHenchmen.autoRoll = value end, - disabled = function()return not SuperVillain.db.SVOverride.lootRoll end + get = function(j)return SV.db.SVHenchmen.autoRoll end, + set = function(j,value)SV.db.SVHenchmen.autoRoll = value end, + disabled = function()return not SV.db.SVOverride.lootRoll end }, pvpautorelease = { order = 5, type = "toggle", name = L['PvP Autorelease'], desc = L['Automatically release body when killed inside a battleground.'], - get = function(j)return SuperVillain.db.SVHenchmen.pvpautorelease end, - set = function(j,value)SuperVillain.db.SVHenchmen.pvpautorelease = value;SuperVillain:StaticPopup_Show("RL_CLIENT")end + get = function(j)return SV.db.SVHenchmen.pvpautorelease end, + set = function(j,value)SV.db.SVHenchmen.pvpautorelease = value;SV:StaticPopup_Show("RL_CLIENT")end }, autorepchange = { order = 6, type = "toggle", name = L['Track Reputation'], desc = L['Automatically change your watched faction on the reputation bar to the faction you got reputation points for.'], - get = function(j)return SuperVillain.db.SVHenchmen.autorepchange end, - set = function(j,value)SuperVillain.db.SVHenchmen.autorepchange = value end + get = function(j)return SV.db.SVHenchmen.autorepchange end, + set = function(j,value)SV.db.SVHenchmen.autorepchange = value end }, skipcinematics = { order = 7, type = "toggle", name = L['Skip Cinematics'], desc = L['Automatically skip any cinematic sequences.'], - get = function(j)return SuperVillain.db.SVHenchmen.skipcinematics end, - set = function(j,value)SuperVillain.db.SVHenchmen.skipcinematics = value;SuperVillain:StaticPopup_Show("RL_CLIENT") end + get = function(j)return SV.db.SVHenchmen.skipcinematics end, + set = function(j,value)SV.db.SVHenchmen.skipcinematics = value;SV:StaticPopup_Show("RL_CLIENT") end }, autoRepair = { order = 8, @@ -126,8 +126,8 @@ SuperVillain.Options.args.SVHenchmen={ ['GUILD'] = GUILD, ['PLAYER'] = PLAYER }, - get = function(j)return SuperVillain.db.SVHenchmen.autoRepair end, - set = function(j,value)SuperVillain.db.SVHenchmen.autoRepair = value end + get = function(j)return SV.db.SVHenchmen.autoRepair end, + set = function(j,value)SV.db.SVHenchmen.autoRepair = value end }, } }, @@ -143,39 +143,39 @@ SuperVillain.Options.args.SVHenchmen={ type = "toggle", name = L['Accept Quests'], desc = L['Automatically accepts quests as they are presented to you.'], - get = function(j)return SuperVillain.db.SVHenchmen.autoquestaccept end, - set = function(j,value) SuperVillain.db.SVHenchmen.autoquestaccept = value end + get = function(j)return SV.db.SVHenchmen.autoquestaccept end, + set = function(j,value) SV.db.SVHenchmen.autoquestaccept = value end }, autoquestcomplete = { order = 2, type = "toggle", name = L['Complete Quests'], desc = L['Automatically complete quests when possible.'], - get = function(j)return SuperVillain.db.SVHenchmen.autoquestcomplete end, - set = function(j,value)SuperVillain.db.SVHenchmen.autoquestcomplete = value end + get = function(j)return SV.db.SVHenchmen.autoquestcomplete end, + set = function(j,value)SV.db.SVHenchmen.autoquestcomplete = value end }, autoquestreward = { order = 3, type = "toggle", name = L['Select Quest Reward'], desc = L['Automatically select the quest reward with the highest vendor sell value.'], - get = function(j)return SuperVillain.db.SVHenchmen.autoquestreward end, - set = function(j,value)SuperVillain.db.SVHenchmen.autoquestreward = value end + get = function(j)return SV.db.SVHenchmen.autoquestreward end, + set = function(j,value)SV.db.SVHenchmen.autoquestreward = value end }, autodailyquests = { order = 4, type = "toggle", name = L['Only Automate Dailies'], desc = L['Force the auto accept functions to only respond to daily quests. NOTE: This does not apply to daily heroics for some reason.'], - get = function(j)return SuperVillain.db.SVHenchmen.autodailyquests end, - set = function(j,value)SuperVillain.db.SVHenchmen.autodailyquests = value end + get = function(j)return SV.db.SVHenchmen.autodailyquests end, + set = function(j,value)SV.db.SVHenchmen.autodailyquests = value end }, autopvpquests = { order = 5, type = "toggle", name = L['Accept PVP Quests'], - get = function(j)return SuperVillain.db.SVHenchmen.autopvpquests end, - set = function(j,value)SuperVillain.db.SVHenchmen.autopvpquests = value end + get = function(j)return SV.db.SVHenchmen.autopvpquests end, + set = function(j,value)SV.db.SVHenchmen.autopvpquests = value end }, } }, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/map.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/map.lua index 525891d..68238b3 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/map.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/map.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); -local MOD = SuperVillain.SVMap +local SV, L = unpack(SVUI); +local MOD = SV.SVMap --[[ ########################################################## LOCAL VARS @@ -51,11 +51,11 @@ local colorSelect = { OPTIONS TABLE ########################################################## ]]-- -SuperVillain.Options.args.SVMap = { +SV.Options.args.SVMap = { type = 'group', childGroups = "tree", name = L['Minimap'], - get = function(a)return SuperVillain.db.SVMap[a[#a]]end, + get = function(a)return SV.db.SVMap[a[#a]]end, set = function(a,b)MOD:ChangeDBVar(b,a[#a]);MOD:ReLoad()end, args={ intro={ @@ -68,8 +68,8 @@ SuperVillain.Options.args.SVMap = { order = 2, name = L['Enable'], desc = L['Enable/Disable the Custom Minimap.'], - get = function(a)return SuperVillain.db.SVMap.enable end, - set = function(a,b)SuperVillain.db.SVMap.enable=b; SuperVillain:StaticPopup_Show("RL_CLIENT") end + get = function(a)return SV.db.SVMap.enable end, + set = function(a,b)SV.db.SVMap.enable=b; SV:StaticPopup_Show("RL_CLIENT") end }, common = { order = 3, @@ -77,7 +77,7 @@ SuperVillain.Options.args.SVMap = { name = MINIMAP_LABEL, desc = L['General display settings'], guiInline = true, - disabled = function()return not SuperVillain.db.SVMap.enable end, + disabled = function()return not SV.db.SVMap.enable end, args = { size = { order = 1, @@ -127,7 +127,7 @@ SuperVillain.Options.args.SVMap = { name = "Labels and Info", desc = L['Configure various minimap texts'], guiInline = true, - disabled = function()return not SuperVillain.db.SVMap.enable end, + disabled = function()return not SV.db.SVMap.enable end, args = { locationText = { order = 1, @@ -156,16 +156,16 @@ SuperVillain.Options.args.SVMap = { order = 7, type = "group", name = "Minimap Buttons", - get = function(j)return SuperVillain.db.SVMap.minimapbar[j[#j]]end, + get = function(j)return SV.db.SVMap.minimapbar[j[#j]]end, guiInline = true, - disabled = function()return not SuperVillain.db.SVMap.enable end, + disabled = function()return not SV.db.SVMap.enable end, args = { enable = { order = 1, type = 'toggle', name = L['Buttons Styled'], desc = L['Style the minimap buttons.'], - set = function(a,b)MOD:ChangeDBVar(b,a[#a],"minimapbar")SuperVillain:StaticPopup_Show("RL_CLIENT")end, + set = function(a,b)MOD:ChangeDBVar(b,a[#a],"minimapbar")SV:StaticPopup_Show("RL_CLIENT")end, }, mouseover = { order = 2, @@ -180,7 +180,7 @@ SuperVillain.Options.args.SVMap = { name = L['Button Bar Layout'], desc = L['Change settings for how the minimap buttons are styled.'], set = function(a,b)MOD:ChangeDBVar(b,a[#a],"minimapbar")MOD:UpdateMinimapButtonSettings()end, - disabled = function()return not SuperVillain.db.SVMap.minimapbar.enable end, + disabled = function()return not SV.db.SVMap.minimapbar.enable end, values = { ['NOANCHOR'] = L['No Anchor Bar'], ['HORIZONTAL'] = L['Horizontal Anchor Bar'], @@ -197,7 +197,7 @@ SuperVillain.Options.args.SVMap = { step = 1, width = "full", set = function(a,b)MOD:ChangeDBVar(b,a[#a],"minimapbar")MOD:UpdateMinimapButtonSettings()end, - disabled = function()return not SuperVillain.db.SVMap.minimapbar.enable or SuperVillain.db.SVMap.minimapbar.styleType == 'NOANCHOR'end + disabled = function()return not SV.db.SVMap.minimapbar.enable or SV.db.SVMap.minimapbar.styleType == 'NOANCHOR'end }, } }, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/mode.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/mode.lua index cb228c8..4880bb8 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/mode.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/mode.lua @@ -29,12 +29,12 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); -local MOD = SuperVillain.SVLaborer -SuperVillain.Options.args.SVLaborer = { +local SV, L = unpack(SVUI); +local MOD = SV.SVLaborer +SV.Options.args.SVLaborer = { type = 'group', name = L['Laborer'], - get = function(key)return SuperVillain.db.SVLaborer[key[#key]]end, + get = function(key)return SV.db.SVLaborer[key[#key]]end, set = function(key, value)MOD:ChangeDBVar(value, key[#key]) end, args = { intro = { @@ -47,8 +47,8 @@ SuperVillain.Options.args.SVLaborer = { 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 SV.db.SVLaborer[key[#key]]end, + set = function(key, value)SV.db.SVLaborer.enable = value;SV:StaticPopup_Show("RL_CLIENT")end }, fontSize = { order = 3, @@ -71,7 +71,7 @@ SuperVillain.Options.args.SVLaborer = { 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 SV.db.SVLaborer.fishing[key[#key]]end, set = function(key, value)MOD:ChangeDBVar(value, key[#key], "fishing")end } } @@ -87,7 +87,7 @@ SuperVillain.Options.args.SVLaborer = { 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 SV.db.SVLaborer.cooking[key[#key]]end, set = function(key, value)MOD:ChangeDBVar(value, key[#key], "cooking")end } } @@ -97,8 +97,8 @@ SuperVillain.Options.args.SVLaborer = { 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 SV.db.SVLaborer.farming[key[#key]]end, + set = function(key, value)SV.db.SVLaborer.farming[key[#key]] = value end, args = { buttonsize = { type = 'range', diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/plate.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/plate.lua index 0c1cc23..ea753c7 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/plate.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/plate.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); -local MOD = SuperVillain.SVPlate; +local SV, L = unpack(SVUI); +local MOD = SV.SVPlate; local _, ns = ...; --[[ ########################################################## @@ -56,18 +56,18 @@ local positionTable = { local activeFilter,filters; local function UpdateFilterGroupOptions() - if not activeFilter or not SuperVillain.db['SVPlate']['filter'][activeFilter] then - SuperVillain.Options.args.SVPlate.args.filters.args.filterGroup=nil; + if not activeFilter or not SV.db['SVPlate']['filter'][activeFilter] then + SV.Options.args.SVPlate.args.filters.args.filterGroup=nil; return - end; - SuperVillain.Options.args.SVPlate.args.filters.args.filterGroup = { + end + SV.Options.args.SVPlate.args.filters.args.filterGroup = { type = "group", name = activeFilter, guiInline = true, order = -10, - get = function(d)return SuperVillain.db["SVPlate"]["filter"][activeFilter][d[#d]] end, + get = function(d)return SV.db["SVPlate"]["filter"][activeFilter][d[#d]] end, set = function(d,e) - SuperVillain.db["SVPlate"]["filter"][activeFilter][d[#d]] = e; + SV.db["SVPlate"]["filter"][activeFilter][d[#d]] = e; MOD:PlateIteration("AssertFiltering") MOD:UpdateAllPlates() UpdateFilterGroupOptions() @@ -96,14 +96,14 @@ local function UpdateFilterGroupOptions() order = 4, name = L["Color"], get = function(key) - local color = SuperVillain.db["SVPlate"]["filter"][activeFilter][key[#key]] + local color = SV.db["SVPlate"]["filter"][activeFilter][key[#key]] if color then return color[1],color[2],color[3],color[4] end end, set = function(key,r,g,b) - SuperVillain.db["SVPlate"]["filter"][activeFilter][key[#key]] = {} - local color = SuperVillain.db["SVPlate"]["filter"][activeFilter][key[#key]] + SV.db["SVPlate"]["filter"][activeFilter][key[#key]] = {} + local color = SV.db["SVPlate"]["filter"][activeFilter][key[#key]] if color then color = {r,g,b}; UpdateFilterGroupOptions() @@ -122,9 +122,9 @@ local function UpdateFilterGroupOptions() } } } -end; +end -SuperVillain.Options.args.SVPlate={ +SV.Options.args.SVPlate={ type="group", name=L["NamePlates"], childGroups="tab", @@ -138,16 +138,16 @@ SuperVillain.Options.args.SVPlate={ intro={order=1,type="description",name=L["NAMEPLATE_DESC"]}, enable={ order=2,type="toggle",name=L["Enable"], - get=function(d)return SuperVillain.db.SVPlate[d[#d]]end, - set=function(d,e)SuperVillain.db.SVPlate[d[#d]]=e;SuperVillain:StaticPopup_Show("RL_CLIENT")end, + get=function(d)return SV.db.SVPlate[d[#d]]end, + set=function(d,e)SV.db.SVPlate[d[#d]]=e;SV:StaticPopup_Show("RL_CLIENT")end, }, common = { order = 1, type = "group", name = L["General"], - get = function(d)return SuperVillain.db.SVPlate[d[#d]]end, + get = function(d)return SV.db.SVPlate[d[#d]]end, set = function(d,e)MOD:ChangeDBVar(e,d[#d]);MOD:UpdateAllPlates() end, - disabled = function()return not SuperVillain.db.SVPlate.enable end, + disabled = function()return not SV.db.SVPlate.enable end, args = { combatHide = { type = "toggle", @@ -230,7 +230,7 @@ SuperVillain.Options.args.SVPlate={ name = L["Reaction Coloring"], guiInline = true, get = function(key) - local color = SuperVillain.db.SVPlate.reactions[key[#key]] + local color = SV.db.SVPlate.reactions[key[#key]] if color then return color[1],color[2],color[3],color[4] end @@ -279,8 +279,8 @@ SuperVillain.Options.args.SVPlate={ type = "group", order = 2, name = L["Health Bar"], - disabled = function()return not SuperVillain.db.SVPlate.enable end, - get = function(d)return SuperVillain.db.SVPlate.healthBar[d[#d]]end, + disabled = function()return not SV.db.SVPlate.enable end, + get = function(d)return SV.db.SVPlate.healthBar[d[#d]]end, set = function(d,e)MOD:ChangeDBVar(e,d[#d],"healthBar");MOD:UpdateAllPlates()end, args = { width = { @@ -318,7 +318,7 @@ SuperVillain.Options.args.SVPlate={ type = "group", name = L["Fonts"], guiInline = true, - get = function(d)return SuperVillain.db.SVPlate.healthBar.text[d[#d]]end, + get = function(d)return SV.db.SVPlate.healthBar.text[d[#d]]end, set = function(d,e)MOD:ChangeDBVar(e,d[#d],"healthBar","text");MOD:UpdateAllPlates()end, args = { enable = { @@ -379,8 +379,8 @@ SuperVillain.Options.args.SVPlate={ type = "group", order = 3, name = L["Cast Bar"], - disabled = function()return not SuperVillain.db.SVPlate.enable end, - get = function(d)return SuperVillain.db.SVPlate.castBar[d[#d]]end, + disabled = function()return not SV.db.SVPlate.enable end, + get = function(d)return SV.db.SVPlate.castBar[d[#d]]end, set = function(d,e)MOD:ChangeDBVar(e,d[#d],"castBar");MOD:UpdateAllPlates()end, args = { height = { @@ -398,7 +398,7 @@ SuperVillain.Options.args.SVPlate={ name = L["Colors"], guiInline = true, get = function(key) - local color = SuperVillain.db.SVPlate.castBar[key[#key]] + local color = SV.db.SVPlate.castBar[key[#key]] if color then return color[1],color[2],color[3],color[4] end @@ -429,7 +429,7 @@ SuperVillain.Options.args.SVPlate={ type = "group", order = 4, name = L["Target Indicator"], - get = function(d)return SuperVillain.db.SVPlate.pointer[d[#d]]end, + get = function(d)return SV.db.SVPlate.pointer[d[#d]]end, set = function(d,e)MOD:ChangeDBVar(e,d[#d],"pointer");WorldFrame.elapsed = 3;MOD:UpdateAllPlates()end, args = { enable = { @@ -453,9 +453,9 @@ SuperVillain.Options.args.SVPlate={ type = "color", name = L["Color"], order = 3, - disabled = function()return SuperVillain.db.SVPlate.pointer.colorMatchHealthBar end, + disabled = function()return SV.db.SVPlate.pointer.colorMatchHealthBar end, get = function(key) - local color = SuperVillain.db.SVPlate.pointer[key[#key]] + local color = SV.db.SVPlate.pointer[key[#key]] if color then return color[1],color[2],color[3],color[4] end @@ -472,7 +472,7 @@ SuperVillain.Options.args.SVPlate={ type = "group", order = 5, name = L["Raid Icon"], - get = function(d)return SuperVillain.db.SVPlate.raidHealIcon[d[#d]]end, + get = function(d)return SV.db.SVPlate.raidHealIcon[d[#d]]end, set = function(d,e)MOD:ChangeDBVar(e,d[#d],"raidHealIcon")MOD:UpdateAllPlates()end, args = { attachTo = { @@ -512,7 +512,7 @@ SuperVillain.Options.args.SVPlate={ type = "group", order = 4, name = L["Auras"], - get = function(d)return SuperVillain.db.SVPlate.auras[d[#d]]end, + get = function(d)return SV.db.SVPlate.auras[d[#d]]end, set = function(d,e)MOD:ChangeDBVar(e,d[#d],"auras")MOD:UpdateAllPlates()end, args = { numAuras = { @@ -527,14 +527,14 @@ SuperVillain.Options.args.SVPlate={ type = "select", order = 2, name = L["Additional Filter"], - values = function()filters = {}filters[""] = NONE;for j in pairs(SuperVillain.db.filter)do filters[j] = j end;return filters end + values = function()filters = {}filters[""] = NONE;for j in pairs(SV.db.filter)do filters[j] = j end return filters end }, configureButton = { order = 4, name = L["Configure Selected Filter"], type = "execute", width = "full", - func = function()ns:SetToFilterConfig(SuperVillain.db.SVPlate.auras.additionalFilter)end + func = function()ns:SetToFilterConfig(SV.db.SVPlate.auras.additionalFilter)end }, fontGroup = { order = 100, @@ -577,7 +577,7 @@ SuperVillain.Options.args.SVPlate={ type = "group", order = 6, name = L["Threat"], - get = function(d)return SuperVillain.db.SVPlate.threat[d[#d]]end, + get = function(d)return SV.db.SVPlate.threat[d[#d]]end, set = function(d,e)MOD:ChangeDBVar(e,d[#d],"threat")MOD:UpdateAllPlates()end, args = { enable = { @@ -617,7 +617,7 @@ SuperVillain.Options.args.SVPlate={ name = L["Colors"], guiInline = true, get = function(key) - local color = SuperVillain.db.SVPlate.threat[key[#key]] + local color = SV.db.SVPlate.threat[key[#key]] if color then return color[1],color[2],color[3],color[4] end @@ -660,7 +660,7 @@ SuperVillain.Options.args.SVPlate={ type = "group", order = 200, name = L["Filters"], - disabled = function()return not SuperVillain.db.SVPlate.enable end, + disabled = function()return not SV.db.SVPlate.enable end, args = { addname = { type = "input", @@ -668,11 +668,11 @@ SuperVillain.Options.args.SVPlate={ name = L["Add Name"], get = function(d)return""end, set = function(d,e) - if SuperVillain.db["SVPlate"]["filter"][e]then - SuperVillain:AddonMessage(L["Filter already exists!"]) + if SV.db["SVPlate"]["filter"][e]then + SV:AddonMessage(L["Filter already exists!"]) return - end; - SuperVillain.db["SVPlate"]["filter"][e] = { + end + SV.db["SVPlate"]["filter"][e] = { ["enable"] = true, ["hide"] = false, ["customColor"] = false, @@ -694,12 +694,12 @@ SuperVillain.Options.args.SVPlate={ get = function(d)return""end, set = function(d,e) if G["SVPlate"]["filter"][e]then - SuperVillain.db["SVPlate"]["filter"][e].enable = false; - SuperVillain:AddonMessage(L["You can't remove a default name from the filter,disabling the name."]) + SV.db["SVPlate"]["filter"][e].enable = false; + SV:AddonMessage(L["You can't remove a default name from the filter,disabling the name."]) else - SuperVillain.db["SVPlate"]["filter"][e] = nil; - SuperVillain.Options.args.SVPlate.args.filters.args.filterGroup = nil - end; + SV.db["SVPlate"]["filter"][e] = nil; + SV.Options.args.SVPlate.args.filters.args.filterGroup = nil + end UpdateFilterGroupOptions() MOD:UpdateAllPlates() end @@ -712,10 +712,10 @@ SuperVillain.Options.args.SVPlate={ set = function(d,e)activeFilter = e;UpdateFilterGroupOptions()end, values = function() filters = {} - if(SuperVillain.db["SVPlate"]["filter"]) then - for j in pairs(SuperVillain.db["SVPlate"]["filter"])do + if(SV.db["SVPlate"]["filter"]) then + for j in pairs(SV.db["SVPlate"]["filter"])do filters[j] = j - end; + end end return filters end diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/profiles.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/profiles.lua index 402b0fc..2ea9052 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/profiles.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/profiles.lua @@ -29,9 +29,9 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); -SuperVillain.Options.args.profiles = { +SV.Options.args.profiles = { order = 9999, type = "group", name = L["profiles"], @@ -58,8 +58,8 @@ SuperVillain.Options.args.profiles = { order = 4, type = "execute", name = SAVE, - desc = function() return SAVE .. " " .. L["current"] .. " " .. NORMAL_FONT_COLOR_CODE .. SuperVillain.db.profileKey .. FONT_COLOR_CODE_CLOSE end, - func = function() SuperVillain.db:Export(SuperVillain.db.profileKey) end, + desc = function() return SAVE .. " " .. L["current"] .. " " .. NORMAL_FONT_COLOR_CODE .. SV.db.profileKey .. FONT_COLOR_CODE_CLOSE end, + func = function() SV.db:Export(SV.db.profileKey) end, }, export = { name = L["export"], @@ -67,7 +67,7 @@ SuperVillain.Options.args.profiles = { type = "input", order = 5, get = false, - set = function(key, value) SuperVillain.db:Export(value) end, + set = function(key, value) SV.db:Export(value) end, }, import = { name = L["import"], @@ -75,9 +75,9 @@ SuperVillain.Options.args.profiles = { type = "select", order = 6, get = function() return " SELECT ONE" end, - set = function(key, value) SuperVillain.db:Import(value) end, - disabled = function() local t = SuperVillain:CheckProfiles() return (not t) end, - values = SuperVillain:GetProfiles(), + set = function(key, value) SV.db:Import(value) end, + disabled = function() local t = SV:CheckProfiles() return (not t) end, + values = SV:GetProfiles(), }, spacer2 = { order = 7, @@ -96,9 +96,9 @@ SuperVillain.Options.args.profiles = { name = L["delete"], desc = L["delete_sub"], get = function() return " SELECT ONE" end, - set = function(key, value) SuperVillain.db:Remove(value) end, - values = SuperVillain:GetProfiles(), - disabled = function() local t = SuperVillain:CheckProfiles() return (not t) end, + set = function(key, value) SV.db:Remove(value) end, + values = SV:GetProfiles(), + disabled = function() local t = SV:CheckProfiles() return (not t) end, confirm = true, confirmText = L["delete_confirm"], }, @@ -116,9 +116,9 @@ SuperVillain.Options.args.profiles = { reset = { order = 12, type = "execute", - name = function() return L["reset"] .. " " .. NORMAL_FONT_COLOR_CODE .. SuperVillain.db.profileKey .. FONT_COLOR_CODE_CLOSE end, + name = function() return L["reset"] .. " " .. NORMAL_FONT_COLOR_CODE .. SV.db.profileKey .. FONT_COLOR_CODE_CLOSE end, desc = L["reset_sub"], - func = function() SuperVillain:StaticPopup_Show("RESET_PROFILE_PROMPT") end, + func = function() SV:StaticPopup_Show("RESET_PROFILE_PROMPT") end, width = "full", }, spacer4 = { @@ -131,8 +131,8 @@ SuperVillain.Options.args.profiles = { order = 14, type = "toggle", name = "Dual-Spec Switching", - get = function() return SuperVillain.db.protected.dualSpecEnabled end, - set = function(key, value) SuperVillain.db.protected.dualSpecEnabled = value; SuperVillain:ToggleSpecSwap(value) end, + get = function() return SV.db.protected.dualSpecEnabled end, + set = function(key, value) SV.db.protected.dualSpecEnabled = value; SV:ToggleSpecSwap(value) end, }, } } \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/stat.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/stat.lua index ca127f9..fa05f8d 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/stat.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/stat.lua @@ -28,18 +28,18 @@ local upper = string.upper; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); -local MOD = SuperVillain.SVStats; +local SV, L = unpack(SVUI); +local MOD = SV.SVStats; --[[ ########################################################## SET PACKAGE OPTIONS ########################################################## ]]-- -SuperVillain.Options.args.SVStats = { +SV.Options.args.SVStats = { type = "group", name = L["Statistics"], childGroups = "tab", - get = function(key) return SuperVillain.db.SVStats[key[#key]] end, + get = function(key) return SV.db.SVStats[key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key]); MOD:Generate() end, args = { intro = { @@ -70,7 +70,7 @@ SuperVillain.Options.args.SVStats = { name = "Show Backgrounds", desc = L["Display statistic background textures"], type = "toggle", - set = function(key, value) MOD:ChangeDBVar(value, key[#key]); SuperVillain:StaticPopup_Show("RL_CLIENT") end, + set = function(key, value) MOD:ChangeDBVar(value, key[#key]); SV:StaticPopup_Show("RL_CLIENT") end, }, shortGold = { order = 6, @@ -126,8 +126,8 @@ SuperVillain.Options.args.SVStats = { do local orderIncrement = 0; local statValues = MOD.StatListing - local configTable = SuperVillain.db.SVStats.panels; - local optionTable = SuperVillain.Options.args.SVStats.args.panels.args; + local configTable = SV.db.SVStats.panels; + local optionTable = SV.Options.args.SVStats.args.panels.args; for panelName, panelPositions in pairs(configTable)do orderIncrement = orderIncrement + 1; @@ -148,7 +148,7 @@ do type = 'select', name = L[position] or upper(position), values = statValues, - get = function(key) return SuperVillain.db.SVStats.panels[panelName][key[#key]] end, + get = function(key) return SV.db.SVStats.panels[panelName][key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], "panels", panelName); MOD:Generate() end } end diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/tip.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/tip.lua index 2bd6b2f..9b8c6b1 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/tip.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/tip.lua @@ -29,20 +29,20 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); -local MOD = SuperVillain.SVTip; +local SV, L = unpack(SVUI); +local MOD = SV.SVTip; local LSM = LibStub("LibSharedMedia-3.0"); --[[ ########################################################## SET PACKAGE OPTIONS ########################################################## ]]-- -SuperVillain.Options.args.SVTip = { +SV.Options.args.SVTip = { type = "group", name = L["Tooltip"], childGroups = "tab", - get = function(a)return SuperVillain.db.SVTip[a[#a]] end, - set = function(a, b)SuperVillain.db.SVTip[a[#a]] = b end, + get = function(a)return SV.db.SVTip[a[#a]] end, + set = function(a, b)SV.db.SVTip[a[#a]] = b end, args = { commonGroup = { order = 1, @@ -59,14 +59,14 @@ SuperVillain.Options.args.SVTip = { order = 2, type = "toggle", name = L["Enable"], - get = function(a)return SuperVillain.db.SVTip[a[#a]]end, - set = function(a, b)SuperVillain.db.SVTip[a[#a]] = b;SuperVillain:StaticPopup_Show("RL_CLIENT") end + get = function(a)return SV.db.SVTip[a[#a]]end, + set = function(a, b)SV.db.SVTip[a[#a]] = b;SV:StaticPopup_Show("RL_CLIENT") end }, common = { order = 3, type = "group", name = L["General"], - disabled = function() return not SuperVillain.db.SVTip.enable end, + disabled = function() return not SV.db.SVTip.enable end, args = { cursorAnchor = { order = 1, @@ -103,8 +103,8 @@ SuperVillain.Options.args.SVTip = { type = "toggle", name = L["Spell/Item IDs"], desc = L["Display the spell or item ID when mousing over a spell or item tooltip."], - get = function(a)return SuperVillain.db.SVTip.spellID end, - set = function(a, b)SuperVillain.db.SVTip.spellID = b;SuperVillain:StaticPopup_Show("RL_CLIENT") end, + get = function(a)return SV.db.SVTip.spellID end, + set = function(a, b)SV.db.SVTip.spellID = b;SV:StaticPopup_Show("RL_CLIENT") end, } } @@ -113,8 +113,8 @@ SuperVillain.Options.args.SVTip = { order=100, type="group", name=L["Visibility"], - get=function(a)return SuperVillain.db.SVTip.visibility[a[#a]]end, - set=function(a,b)SuperVillain.db.SVTip.visibility[a[#a]]=b end, + get=function(a)return SV.db.SVTip.visibility[a[#a]]end, + set=function(a,b)SV.db.SVTip.visibility[a[#a]]=b end, args={ combat={order=1,type='toggle',name=COMBAT,desc=L["Hide tooltip while in combat."]}, unitFrames={order=2,type='select',name=L['Unitframes'],desc=L["Don't display the tooltip when mousing over a unitframe."],values={['ALL']=L['Always Hide'],['NONE']=L['Never Hide'],['SHIFT']=SHIFT_KEY,['ALT']=ALT_KEY,['CTRL']=CTRL_KEY}} @@ -124,8 +124,8 @@ SuperVillain.Options.args.SVTip = { order=200, type="group", name=L["Health Bar"], - get=function(a)return SuperVillain.db.SVTip.healthBar[a[#a]]end, - set=function(a,b)SuperVillain.db.SVTip.healthBar[a[#a]]=b end, + get=function(a)return SV.db.SVTip.healthBar[a[#a]]end, + set=function(a,b)SV.db.SVTip.healthBar[a[#a]]=b end, args={ height = { order = 1, @@ -135,7 +135,7 @@ SuperVillain.Options.args.SVTip = { max = 15, step = 1, width = "full", - set = function(a,b)SuperVillain.db.SVTip.healthBar.height = b;GameTooltipStatusBar:Height(b)end + set = function(a,b)SV.db.SVTip.healthBar.height = b;GameTooltipStatusBar:Height(b)end }, fontGroup = { order = 2, @@ -147,7 +147,7 @@ SuperVillain.Options.args.SVTip = { order = 1, type = "toggle", name = L["Text"], - set = function(a,b)SuperVillain.db.SVTip.healthBar.text = b;if b then GameTooltipStatusBar.text:Show()else GameTooltipStatusBar.text:Hide()end end + set = function(a,b)SV.db.SVTip.healthBar.text = b;if b then GameTooltipStatusBar.text:Show()else GameTooltipStatusBar.text:Hide()end end }, font = { type = "select", @@ -156,7 +156,7 @@ SuperVillain.Options.args.SVTip = { width = "full", name = L["Font"], values = AceGUIWidgetLSMlists.font, - set = function(a,b)SuperVillain.db.SVTip.healthBar.font = b;GameTooltipStatusBar.text:SetFontTemplate(LSM:Fetch("font",SuperVillain.db.SVTip.healthBar.font), SuperVillain.db.SVTip.healthBar.fontSize,"OUTLINE")end + set = function(a,b)SV.db.SVTip.healthBar.font = b;GameTooltipStatusBar.text:SetFontTemplate(LSM:Fetch("font",SV.db.SVTip.healthBar.font), SV.db.SVTip.healthBar.fontSize,"OUTLINE")end }, fontSize = { order = 3, @@ -166,7 +166,7 @@ SuperVillain.Options.args.SVTip = { max = 22, step = 1, width = "full", - set = function(a,b)SuperVillain.db.SVTip.healthBar.fontSize = b;GameTooltipStatusBar.text:SetFontTemplate(LSM:Fetch("font",SuperVillain.db.SVTip.healthBar.font),SuperVillain.db.SVTip.healthBar.fontSize,"OUTLINE")end + set = function(a,b)SV.db.SVTip.healthBar.fontSize = b;GameTooltipStatusBar.text:SetFontTemplate(LSM:Fetch("font",SV.db.SVTip.healthBar.font),SV.db.SVTip.healthBar.fontSize,"OUTLINE")end } } } diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/_load.xml b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/_load.xml index 6c99aea..e835fb5 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/_load.xml +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/_load.xml @@ -7,4 +7,5 @@ <Script file='party.lua'/> <Script file='raid.lua'/> <Script file='other.lua'/> + <Script file='grid.lua'/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua index 008d80d..0507060 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua @@ -31,9 +31,9 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(SVUI); +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ...; local ACD = LibStub("AceConfigDialog-3.0"); --[[ @@ -49,6 +49,7 @@ local textStringFormats = { ["percent"] = "Percent", ["curpercent"] = "Current - Percent", ["curmax"] = "Current - Maximum", + ["curmax-percent"] = "Current - Maximum | %", } --[[ ########################################################## @@ -61,7 +62,7 @@ function ns:SetCastbarConfigGroup(updateFunction, unitName, count) type = "group", name = L["Castbar"], get = function(key) - return SuperVillain.db.SVUnit[unitName]["castbar"][key[#key]] + return SV.db.SVUnit[unitName]["castbar"][key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName, "castbar") @@ -151,7 +152,7 @@ function ns:SetCastbarConfigGroup(updateFunction, unitName, count) name = L["Match Frame Width"], desc = "Set the castbar width to match its unitframe.", func = function() - SuperVillain.db.SVUnit[unitName]["castbar"]["width"] = SuperVillain.db.SVUnit[unitName]["width"] + SV.db.SVUnit[unitName]["castbar"]["width"] = SV.db.SVUnit[unitName]["width"] updateFunction(MOD, unitName, count) end }, @@ -191,28 +192,28 @@ function ns:SetCastbarConfigGroup(updateFunction, unitName, count) name = L["Custom Bar Color"], type = "color", get = function(key) - local color = SuperVillain.db.SVUnit[unitName]["castbar"]["castingColor"] + local color = SV.db.SVUnit[unitName]["castbar"]["castingColor"] return color[1], color[2], color[3], color[4] end, set = function(key, rValue, gValue, bValue) - SuperVillain.db.SVUnit[unitName]["castbar"]["castingColor"] = {rValue, gValue, bValue} + SV.db.SVUnit[unitName]["castbar"]["castingColor"] = {rValue, gValue, bValue} MOD:RefreshUnitFrames() end, - disabled = function() return not SuperVillain.db.SVUnit[unitName]["castbar"].useCustomColor end + disabled = function() return not SV.db.SVUnit[unitName]["castbar"].useCustomColor end }, sparkColor = { order = 3, name = L["Custom Spark Color"], type = "color", get = function(key) - local color = SuperVillain.db.SVUnit[unitName]["castbar"]["sparkColor"] + local color = SV.db.SVUnit[unitName]["castbar"]["sparkColor"] return color[1], color[2], color[3], color[4] end, set = function(key, rValue, gValue, bValue) - SuperVillain.db.SVUnit[unitName]["castbar"]["sparkColor"] = {rValue, gValue, bValue} + SV.db.SVUnit[unitName]["castbar"]["sparkColor"] = {rValue, gValue, bValue} MOD:RefreshUnitFrames() end, - disabled = function() return not SuperVillain.db.SVUnit[unitName]["castbar"].useCustomColor end + disabled = function() return not SV.db.SVUnit[unitName]["castbar"].useCustomColor end }, } }, @@ -245,9 +246,9 @@ function ns:SetCastbarConfigGroup(updateFunction, unitName, count) name = L["Display Target"], desc = L["Display the target of your current cast."] } - end; + end return configTable -end; +end function ns:SetAuraConfigGroup(custom, auraType, unused, updateFunction, unitName, count) local configTable = { @@ -255,7 +256,7 @@ function ns:SetAuraConfigGroup(custom, auraType, unused, updateFunction, unitNam type = "group", name = auraType == "buffs" and L["Buffs"] or L["Debuffs"], get = function(key) - return SuperVillain.db.SVUnit[unitName][auraType][key[#key]] + return SV.db.SVUnit[unitName][auraType][key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName, auraType) @@ -288,7 +289,7 @@ function ns:SetAuraConfigGroup(custom, auraType, unused, updateFunction, unitNam args = { xOffset = {order = 1, type = "range", name = L["xOffset"], width = "full", min = -60, max = 60, step = 1}, yOffset = {order = 2, type = "range", name = L["yOffset"], width = "full", min = -60, max = 60, step = 1}, - anchorPoint = {type = "select", order = 3, name = L["Anchor Point"], desc = L["What point to anchor to the frame you set to attach to."], values = SuperVillain.PointIndexes}, + anchorPoint = {type = "select", order = 3, name = L["Anchor Point"], desc = L["What point to anchor to the frame you set to attach to."], values = SV.PointIndexes}, } }, filters = {name = L["Filters"], guiInline = true, type = "group", order = 500, args = {}} @@ -298,7 +299,7 @@ function ns:SetAuraConfigGroup(custom, auraType, unused, updateFunction, unitNam configTable.args.positionGroup.args.attachTo = {type = "select", order = 7, name = L["Attach To"], desc = L["What to attach the buff anchor frame to."], values = {["FRAME"] = L["Frame"], ["DEBUFFS"] = L["Debuffs"]}} else configTable.args.positionGroup.args.attachTo = {type = "select", order = 7, name = L["Attach To"], desc = L["What to attach the buff anchor frame to."], values = {["FRAME"] = L["Frame"], ["BUFFS"] = L["Buffs"]}} - end; + end if custom then configTable.args.filters.args.filterPlayer = {order = 10, type = "toggle", name = L["Only Show Your Auras"], desc = L["Don't display auras that are not yours."]} configTable.args.filters.args.filterBlocked = {order = 11, type = "toggle", name = L["Force Blocked List"], desc = L["Don't display any auras found on the Blocked filter."]} @@ -307,7 +308,7 @@ function ns:SetAuraConfigGroup(custom, auraType, unused, updateFunction, unitNam configTable.args.filters.args.filterDispellable = {order = 13, type = "toggle", name = L["Block Non-Dispellable Auras"], desc = L["Don't display auras that cannot be purged or dispelled by your class."]} if auraType == "buffs"then configTable.args.filters.args.filterRaid = {order = 14, type = "toggle", name = L["Block Raid Buffs"], desc = L["Don't display raid buffs."]} - end; + end configTable.args.filters.args.useFilter = { order = 15, name = L["Additional Filter"], @@ -316,9 +317,9 @@ function ns:SetAuraConfigGroup(custom, auraType, unused, updateFunction, unitNam values = function() filterList = {} filterList[""] = NONE; - for n in pairs(SuperVillain.db.filter)do + for n in pairs(SV.db.filter)do filterList[n] = n - end; + end return filterList end } @@ -335,9 +336,9 @@ function ns:SetAuraConfigGroup(custom, auraType, unused, updateFunction, unitNam type = "toggle", name = L["Friendly"], desc = L["If the unit is friendly to you."].." "..L["Don't display auras that are not yours."], - get = function(l)return SuperVillain.db.SVUnit[unitName][auraType].filterPlayer.friendly end, + get = function(l)return SV.db.SVUnit[unitName][auraType].filterPlayer.friendly end, set = function(l, m) - SuperVillain.db.SVUnit[unitName][auraType].filterPlayer.friendly = m; + SV.db.SVUnit[unitName][auraType].filterPlayer.friendly = m; updateFunction(MOD, unitName, count) end }, @@ -346,9 +347,9 @@ function ns:SetAuraConfigGroup(custom, auraType, unused, updateFunction, unitNam type = "toggle", name = L["Enemy"], desc = L["If the unit is an enemy to you."].." "..L["Don't display auras that are not yours."], - get = function(l)return SuperVillain.db.SVUnit[unitName][auraType].filterPlayer.enemy end, + get = function(l)return SV.db.SVUnit[unitName][auraType].filterPlayer.enemy end, set = function(l, m) - SuperVillain.db.SVUnit[unitName][auraType].filterPlayer.enemy = m; + SV.db.SVUnit[unitName][auraType].filterPlayer.enemy = m; updateFunction(MOD, unitName, count) end } @@ -365,16 +366,16 @@ function ns:SetAuraConfigGroup(custom, auraType, unused, updateFunction, unitNam type = "toggle", name = L["Friendly"], desc = L["If the unit is friendly to you."].." "..L["Don't display any auras found on the Blocked filter."], - get = function(l)return SuperVillain.db.SVUnit[unitName][auraType].filterBlocked.friendly end, - set = function(l, m)SuperVillain.db.SVUnit[unitName][auraType].filterBlocked.friendly = m;updateFunction(MOD, unitName, count)end + get = function(l)return SV.db.SVUnit[unitName][auraType].filterBlocked.friendly end, + set = function(l, m)SV.db.SVUnit[unitName][auraType].filterBlocked.friendly = m;updateFunction(MOD, unitName, count)end }, enemy = { order = 3, type = "toggle", name = L["Enemy"], desc = L["If the unit is an enemy to you."].." "..L["Don't display any auras found on the Blocked filter."], - get = function(l)return SuperVillain.db.SVUnit[unitName][auraType].filterBlocked.enemy end, - set = function(l, m)SuperVillain.db.SVUnit[unitName][auraType].filterBlocked.enemy = m;updateFunction(MOD, unitName, count)end + get = function(l)return SV.db.SVUnit[unitName][auraType].filterBlocked.enemy end, + set = function(l, m)SV.db.SVUnit[unitName][auraType].filterBlocked.enemy = m;updateFunction(MOD, unitName, count)end } } } @@ -389,16 +390,16 @@ function ns:SetAuraConfigGroup(custom, auraType, unused, updateFunction, unitNam type = "toggle", name = L["Friendly"], desc = L["If the unit is friendly to you."].." "..L["If no other filter options are being used then it will block anything not on the Allowed filter."], - get = function(l)return SuperVillain.db.SVUnit[unitName][auraType].filterAllowed.friendly end, - set = function(l, m)SuperVillain.db.SVUnit[unitName][auraType].filterAllowed.friendly = m;updateFunction(MOD, unitName, count)end + get = function(l)return SV.db.SVUnit[unitName][auraType].filterAllowed.friendly end, + set = function(l, m)SV.db.SVUnit[unitName][auraType].filterAllowed.friendly = m;updateFunction(MOD, unitName, count)end }, enemy = { order = 3, type = "toggle", name = L["Enemy"], desc = L["If the unit is an enemy to you."].." "..L["If no other filter options are being used then it will block anything not on the Allowed filter."], - get = function(l)return SuperVillain.db.SVUnit[unitName][auraType].filterAllowed.enemy end, - set = function(l, m)SuperVillain.db.SVUnit[unitName][auraType].filterAllowed.enemy = m;updateFunction(MOD, unitName, count)end + get = function(l)return SV.db.SVUnit[unitName][auraType].filterAllowed.enemy end, + set = function(l, m)SV.db.SVUnit[unitName][auraType].filterAllowed.enemy = m;updateFunction(MOD, unitName, count)end } } } @@ -413,16 +414,16 @@ function ns:SetAuraConfigGroup(custom, auraType, unused, updateFunction, unitNam type = "toggle", name = L["Friendly"], desc = L["If the unit is friendly to you."].." "..L["Don't display auras that have no duration."], - get = function(l)return SuperVillain.db.SVUnit[unitName][auraType].filterInfinite.friendly end, - set = function(l, m)SuperVillain.db.SVUnit[unitName][auraType].filterInfinite.friendly = m;updateFunction(MOD, unitName, count)end + get = function(l)return SV.db.SVUnit[unitName][auraType].filterInfinite.friendly end, + set = function(l, m)SV.db.SVUnit[unitName][auraType].filterInfinite.friendly = m;updateFunction(MOD, unitName, count)end }, enemy = { order = 3, type = "toggle", name = L["Enemy"], desc = L["If the unit is an enemy to you."].." "..L["Don't display auras that have no duration."], - get = function(l)return SuperVillain.db.SVUnit[unitName][auraType].filterInfinite.enemy end, - set = function(l, m)SuperVillain.db.SVUnit[unitName][auraType].filterInfinite.enemy = m;updateFunction(MOD, unitName, count)end + get = function(l)return SV.db.SVUnit[unitName][auraType].filterInfinite.enemy end, + set = function(l, m)SV.db.SVUnit[unitName][auraType].filterInfinite.enemy = m;updateFunction(MOD, unitName, count)end } } } @@ -437,16 +438,16 @@ function ns:SetAuraConfigGroup(custom, auraType, unused, updateFunction, unitNam type = "toggle", name = L["Friendly"], desc = L["If the unit is friendly to you."].." "..L["Don't display auras that cannot be purged or dispelled by your class."], - get = function(l)return SuperVillain.db.SVUnit[unitName][auraType].filterDispellable.friendly end, - set = function(l, m)SuperVillain.db.SVUnit[unitName][auraType].filterDispellable.friendly = m;updateFunction(MOD, unitName, count)end + get = function(l)return SV.db.SVUnit[unitName][auraType].filterDispellable.friendly end, + set = function(l, m)SV.db.SVUnit[unitName][auraType].filterDispellable.friendly = m;updateFunction(MOD, unitName, count)end }, enemy = { order = 3, type = "toggle", name = L["Enemy"], desc = L["If the unit is an enemy to you."].." "..L["Don't display auras that cannot be purged or dispelled by your class."], - get = function(l)return SuperVillain.db.SVUnit[unitName][auraType].filterDispellable.enemy end, - set = function(l, m)SuperVillain.db.SVUnit[unitName][auraType].filterDispellable.enemy = m;updateFunction(MOD, unitName, count)end + get = function(l)return SV.db.SVUnit[unitName][auraType].filterDispellable.enemy end, + set = function(l, m)SV.db.SVUnit[unitName][auraType].filterDispellable.enemy = m;updateFunction(MOD, unitName, count)end } } } @@ -462,19 +463,19 @@ function ns:SetAuraConfigGroup(custom, auraType, unused, updateFunction, unitNam type = "toggle", name = L["Friendly"], desc = L["If the unit is friendly to you."].." "..L["Don't display raid (consolidated) buffs."], - get = function(l)return SuperVillain.db.SVUnit[unitName][auraType].filterRaid.friendly end, - set = function(l, m)SuperVillain.db.SVUnit[unitName][auraType].filterRaid.friendly = m;updateFunction(MOD, unitName, count)end + get = function(l)return SV.db.SVUnit[unitName][auraType].filterRaid.friendly end, + set = function(l, m)SV.db.SVUnit[unitName][auraType].filterRaid.friendly = m;updateFunction(MOD, unitName, count)end }, enemy = { order = 3, type = "toggle", name = L["Enemy"], desc = L["If the unit is an enemy to you."].." "..L["Don't display raid (consolidated) buffs."], - get = function(l)return SuperVillain.db.SVUnit[unitName][auraType].filterRaid.enemy end, - set = function(l, m)SuperVillain.db.SVUnit[unitName][auraType].filterRaid.enemy = m;updateFunction(MOD, unitName, count)end + get = function(l)return SV.db.SVUnit[unitName][auraType].filterRaid.enemy end, + set = function(l, m)SV.db.SVUnit[unitName][auraType].filterRaid.enemy = m;updateFunction(MOD, unitName, count)end } } } - end; + end configTable.args.filters.args.useFilter = { order = 15, name = L["Additional Filter"], @@ -483,15 +484,15 @@ function ns:SetAuraConfigGroup(custom, auraType, unused, updateFunction, unitNam values = function() filterList = {} filterList[""] = NONE; - for n in pairs(SuperVillain.db.filter)do + for n in pairs(SV.db.filter)do filterList[n] = n - end; + end return filterList end } - end; + end return configTable -end; +end function ns:SetMiscConfigGroup(partyRaid, updateFunction, unitName, count) local miscGroup = { @@ -501,11 +502,11 @@ function ns:SetMiscConfigGroup(partyRaid, updateFunction, unitName, count) set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName, "formatting"); local tag = "" - local pc = SuperVillain.db.SVUnit[unitName]["formatting"].threat and "[threat]" or ""; + local pc = SV.db.SVUnit[unitName]["formatting"].threat and "[threat]" or ""; tag = tag .. pc; - local ap = SuperVillain.db.SVUnit[unitName]["formatting"].absorbs and "[absorbs]" or ""; + local ap = SV.db.SVUnit[unitName]["formatting"].absorbs and "[absorbs]" or ""; tag = tag .. ap; - local cp = SuperVillain.db.SVUnit[unitName]["formatting"].incoming and "[incoming]" or ""; + local cp = SV.db.SVUnit[unitName]["formatting"].incoming and "[incoming]" or ""; tag = tag .. cp; MOD:ChangeDBVar(tag, "tags", unitName, "misc"); @@ -516,19 +517,19 @@ function ns:SetMiscConfigGroup(partyRaid, updateFunction, unitName, count) order = 1, name = L["Show Incoming Heals"], type = "toggle", - get = function() return SuperVillain.db.SVUnit[unitName]["formatting"].incoming end, + get = function() return SV.db.SVUnit[unitName]["formatting"].incoming end, }, absorbs = { order = 2, name = L["Show Absorbs"], type = "toggle", - get = function() return SuperVillain.db.SVUnit[unitName]["formatting"].absorbs end, + get = function() return SV.db.SVUnit[unitName]["formatting"].absorbs end, }, threat = { order = 3, name = L["Show Threat"], type = "toggle", - get = function() return SuperVillain.db.SVUnit[unitName]["formatting"].threat end, + get = function() return SV.db.SVUnit[unitName]["formatting"].threat end, }, xOffset = { order = 4, @@ -539,7 +540,7 @@ function ns:SetMiscConfigGroup(partyRaid, updateFunction, unitName, count) min = -300, max = 300, step = 1, - get = function() return SuperVillain.db.SVUnit[unitName]["formatting"].xOffset end, + get = function() return SV.db.SVUnit[unitName]["formatting"].xOffset end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName, "formatting"); end, }, yOffset = { @@ -551,13 +552,13 @@ function ns:SetMiscConfigGroup(partyRaid, updateFunction, unitName, count) min = -300, max = 300, step = 1, - get = function() return SuperVillain.db.SVUnit[unitName]["formatting"].yOffset end, + get = function() return SV.db.SVUnit[unitName]["formatting"].yOffset end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName, "formatting"); end, }, } } return miscGroup -end; +end function ns:SetHealthConfigGroup(partyRaid, updateFunction, unitName, count) local healthOptions = { @@ -565,7 +566,7 @@ function ns:SetHealthConfigGroup(partyRaid, updateFunction, unitName, count) type = "group", name = L["Health"], get = function(key) - return SuperVillain.db.SVUnit[unitName]["health"][key[#key]] + return SV.db.SVUnit[unitName]["health"][key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName, "health"); @@ -579,7 +580,7 @@ function ns:SetHealthConfigGroup(partyRaid, updateFunction, unitName, count) name = L["Base Settings"], args = { reversed = {type = "toggle", order = 1, name = L["Reverse Fill"], desc = L["Invert this bars fill direction"]}, - position = {type = "select", order = 2, name = L["Text Position"], desc = L["Set the anchor for this bars value text"], values = SuperVillain.PointIndexes}, + position = {type = "select", order = 2, name = L["Text Position"], desc = L["Set the anchor for this bars value text"], values = SV.PointIndexes}, configureButton = { order = 4, width = "full", @@ -599,10 +600,10 @@ function ns:SetHealthConfigGroup(partyRaid, updateFunction, unitName, count) set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName, "formatting"); local tag = "" - local pc = SuperVillain.db.SVUnit[unitName]["formatting"].health_colored and "[health:color]" or ""; + local pc = SV.db.SVUnit[unitName]["formatting"].health_colored and "[health:color]" or ""; tag = tag .. pc; - local pt = SuperVillain.db.SVUnit[unitName]["formatting"].health_type; + local pt = SV.db.SVUnit[unitName]["formatting"].health_type; if(pt and pt ~= "none") then tag = tag .. "[health:" .. pt .. "]" end @@ -615,14 +616,14 @@ function ns:SetHealthConfigGroup(partyRaid, updateFunction, unitName, count) order = 1, name = L["Colored"], type = "toggle", - get = function() return SuperVillain.db.SVUnit[unitName]["formatting"].health_colored end, + get = function() return SV.db.SVUnit[unitName]["formatting"].health_colored end, desc = L["Use various name coloring methods"] }, health_type = { order = 3, name = L["Text Format"], type = "select", - get = function() return SuperVillain.db.SVUnit[unitName]["formatting"].health_type end, + get = function() return SV.db.SVUnit[unitName]["formatting"].health_type end, desc = L["TEXT_FORMAT_DESC"], values = textStringFormats, } @@ -644,9 +645,9 @@ function ns:SetHealthConfigGroup(partyRaid, updateFunction, unitName, count) desc = L["Direction the health bar moves when gaining/losing health."], values = {["HORIZONTAL"] = L["Horizontal"], ["VERTICAL"] = L["Vertical"]} } - end; + end return healthOptions -end; +end function ns:SetPowerConfigGroup(playerTarget, updateFunction, unitName, count) local powerOptions = { @@ -654,7 +655,7 @@ function ns:SetPowerConfigGroup(playerTarget, updateFunction, unitName, count) type = "group", name = L["Power"], get = function(key) - return SuperVillain.db.SVUnit[unitName]["power"][key[#key]] + return SV.db.SVUnit[unitName]["power"][key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName, "power"); @@ -668,7 +669,7 @@ function ns:SetPowerConfigGroup(playerTarget, updateFunction, unitName, count) guiInline = true, name = L["Base Settings"], args = { - position = {type = "select", order = 3, name = L["Text Position"], desc = L["Set the anchor for this bars value text"], values = SuperVillain.PointIndexes}, + position = {type = "select", order = 3, name = L["Text Position"], desc = L["Set the anchor for this bars value text"], values = SV.PointIndexes}, configureButton = { order = 4, name = L["Coloring"], @@ -697,14 +698,14 @@ function ns:SetPowerConfigGroup(playerTarget, updateFunction, unitName, count) set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName, "formatting"); local tag = "" - local cp = SuperVillain.db.SVUnit[unitName]["formatting"].power_class and "[classpower]" or ""; + local cp = SV.db.SVUnit[unitName]["formatting"].power_class and "[classpower]" or ""; tag = tag .. cp; - local ap = SuperVillain.db.SVUnit[unitName]["formatting"].power_alt and "[altpower]" or ""; + local ap = SV.db.SVUnit[unitName]["formatting"].power_alt and "[altpower]" or ""; tag = tag .. ap; - local pc = SuperVillain.db.SVUnit[unitName]["formatting"].power_colored and "[power:color]" or ""; + local pc = SV.db.SVUnit[unitName]["formatting"].power_colored and "[power:color]" or ""; tag = tag .. pc; - local pt = SuperVillain.db.SVUnit[unitName]["formatting"].power_type; + local pt = SV.db.SVUnit[unitName]["formatting"].power_type; if(pt and pt ~= "none") then tag = tag .. "[power:" .. pt .. "]" end @@ -717,26 +718,26 @@ function ns:SetPowerConfigGroup(playerTarget, updateFunction, unitName, count) order = 1, name = L["Colored"], type = "toggle", - get = function() return SuperVillain.db.SVUnit[unitName]["formatting"].power_colored end, + get = function() return SV.db.SVUnit[unitName]["formatting"].power_colored end, desc = L["Use various name coloring methods"] }, power_class = { order = 1, name = L["Show Class Power"], type = "toggle", - get = function() return SuperVillain.db.SVUnit[unitName]["formatting"].power_class end, + get = function() return SV.db.SVUnit[unitName]["formatting"].power_class end, }, power_alt = { order = 1, name = L["Show Alt Power"], type = "toggle", - get = function() return SuperVillain.db.SVUnit[unitName]["formatting"].power_alt end, + get = function() return SV.db.SVUnit[unitName]["formatting"].power_alt end, }, power_type = { order = 3, name = L["Text Format"], type = "select", - get = function() return SuperVillain.db.SVUnit[unitName]["formatting"].power_type end, + get = function() return SV.db.SVUnit[unitName]["formatting"].power_type end, desc = L["TEXT_FORMAT_DESC"], values = textStringFormats, } @@ -751,7 +752,7 @@ function ns:SetPowerConfigGroup(playerTarget, updateFunction, unitName, count) order = 2, name = L["Attach Text to Power"], get = function(key) - return SuperVillain.db.SVUnit[unitName]["power"].attachTextToPower + return SV.db.SVUnit[unitName]["power"].attachTextToPower end, set = function(key, value) MOD:ChangeDBVar(value, "attachTextToPower", unitName, "power"); @@ -761,7 +762,7 @@ function ns:SetPowerConfigGroup(playerTarget, updateFunction, unitName, count) end return powerOptions -end; +end function ns:SetNameConfigGroup(updateFunction, unitName, count) local k = { @@ -769,7 +770,7 @@ function ns:SetNameConfigGroup(updateFunction, unitName, count) type = "group", name = L["Name"], get = function(key) - return SuperVillain.db.SVUnit[unitName]["name"][key[#key]] + return SV.db.SVUnit[unitName]["name"][key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName, "name"); @@ -787,7 +788,7 @@ function ns:SetNameConfigGroup(updateFunction, unitName, count) order = 3, name = L["Text Position"], desc = L["Set the anchor for this units name text"], - values = SuperVillain.PointIndexes + values = SV.PointIndexes }, xOffset = { order = 6, @@ -856,11 +857,11 @@ function ns:SetNameConfigGroup(updateFunction, unitName, count) set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName, "formatting"); local tag = "" - tag = SuperVillain.db.SVUnit[unitName]["formatting"].name_colored and "[name:color]" or ""; + tag = SV.db.SVUnit[unitName]["formatting"].name_colored and "[name:color]" or ""; - local length = SuperVillain.db.SVUnit[unitName]["formatting"].name_length; + local length = SV.db.SVUnit[unitName]["formatting"].name_length; tag = tag .. "[name:" .. length .. "]" - local lvl = SuperVillain.db.SVUnit[unitName]["formatting"].smartlevel and "[smartlevel]" or ""; + local lvl = SV.db.SVUnit[unitName]["formatting"].smartlevel and "[smartlevel]" or ""; tag = tag .. lvl MOD:ChangeDBVar(tag, "tags", unitName, "name"); @@ -871,14 +872,14 @@ function ns:SetNameConfigGroup(updateFunction, unitName, count) order = 1, name = L["Colored"], type = "toggle", - get = function() return SuperVillain.db.SVUnit[unitName]["formatting"].name_colored end, + get = function() return SV.db.SVUnit[unitName]["formatting"].name_colored end, desc = L["Use various name coloring methods"] }, smartlevel = { order = 2, name = L["Unit Level"], type = "toggle", - get = function() return SuperVillain.db.SVUnit[unitName]["formatting"].smartlevel end, + get = function() return SV.db.SVUnit[unitName]["formatting"].smartlevel end, desc = L["Display the units level"] }, name_length = { @@ -887,7 +888,7 @@ function ns:SetNameConfigGroup(updateFunction, unitName, count) desc = L["TEXT_FORMAT_DESC"], type = "range", width = "full", - get = function() return SuperVillain.db.SVUnit[unitName]["formatting"].name_length end, + get = function() return SV.db.SVUnit[unitName]["formatting"].name_length end, min = 1, max = 30, step = 1 @@ -897,10 +898,10 @@ function ns:SetNameConfigGroup(updateFunction, unitName, count) } } return k -end; +end local function getAvailablePortraitConfig(unit) - local db = SuperVillain.db.SVUnit[unit].portrait; + local db = SV.db.SVUnit[unit].portrait; if db.overlay then return {["3D"] = L["3D"]} else @@ -914,7 +915,7 @@ function ns:SetPortraitConfigGroup(updateFunction, unitName, count) type = "group", name = L["Portrait"], get = function(key) - return SuperVillain.db.SVUnit[unitName]["portrait"][key[#key]] + return SV.db.SVUnit[unitName]["portrait"][key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName, "portrait") @@ -944,7 +945,7 @@ function ns:SetPortraitConfigGroup(updateFunction, unitName, count) type = "toggle", name = L["Overlay"], desc = L["Overlay the healthbar"], - disabled = function() return SuperVillain.db.SVUnit[unitName]["portrait"].style == "2D" end + disabled = function() return SV.db.SVUnit[unitName]["portrait"].style == "2D" end }, width = { order = 3, @@ -954,7 +955,7 @@ function ns:SetPortraitConfigGroup(updateFunction, unitName, count) min = 15, max = 150, step = 1, - disabled = function() return SuperVillain.db.SVUnit[unitName]["portrait"].overlay == true end + disabled = function() return SV.db.SVUnit[unitName]["portrait"].overlay == true end } } }, @@ -963,7 +964,7 @@ function ns:SetPortraitConfigGroup(updateFunction, unitName, count) type = "group", guiInline = true, name = L["3D Settings"], - disabled = function() return SuperVillain.db.SVUnit[unitName]["portrait"].style == "2D" end, + disabled = function() return SV.db.SVUnit[unitName]["portrait"].style == "2D" end, args = { rotation = { order = 1, @@ -987,17 +988,17 @@ function ns:SetPortraitConfigGroup(updateFunction, unitName, count) } } return k -end; +end function ns:SetIconConfigGroup(updateFunction, unitName, count) - local iconGroup = SuperVillain.db.SVUnit[unitName]["icons"] + local iconGroup = SV.db.SVUnit[unitName]["icons"] local grouporder = 1 local k = { order = 5000, type = "group", name = L["Icons"], get = function(key) - return SuperVillain.db.SVUnit[unitName]["icons"][key[#key]] + return SV.db.SVUnit[unitName]["icons"][key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName, "icons") @@ -1013,7 +1014,7 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) guiInline = true, name = L["Raid Marker"], get = function(key) - return SuperVillain.db.SVUnit[unitName]["icons"]["raidicon"][key[#key]] + return SV.db.SVUnit[unitName]["icons"]["raidicon"][key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName, "icons", "raidicon") @@ -1021,7 +1022,7 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, - attachTo = {type = "select", order = 2, name = L["Position"], values = SuperVillain.PointIndexes}, + attachTo = {type = "select", order = 2, name = L["Position"], values = SV.PointIndexes}, size = {type = "range", name = L["Size"], width = "full", order = 3, min = 8, max = 60, step = 1}, xOffset = {order = 4, type = "range", name = L["xOffset"], width = "full", min = -300, max = 300, step = 1}, yOffset = {order = 5, type = "range", name = L["yOffset"], width = "full", min = -300, max = 300, step = 1} @@ -1037,7 +1038,7 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) guiInline = true, name = L["Combat"], get = function(key) - return SuperVillain.db.SVUnit[unitName]["icons"]["combatIcon"][key[#key]] + return SV.db.SVUnit[unitName]["icons"]["combatIcon"][key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName, "icons", "combatIcon") @@ -1045,7 +1046,7 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, - attachTo = {type = "select", order = 2, name = L["Position"], values = SuperVillain.PointIndexes}, + attachTo = {type = "select", order = 2, name = L["Position"], values = SV.PointIndexes}, size = {type = "range", name = L["Size"], width = "full", order = 3, min = 8, max = 60, step = 1}, xOffset = {order = 4, type = "range", name = L["xOffset"], width = "full", min = -300, max = 300, step = 1}, yOffset = {order = 5, type = "range", name = L["yOffset"], width = "full", min = -300, max = 300, step = 1} @@ -1061,7 +1062,7 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) guiInline = true, name = L["Resting"], get = function(key) - return SuperVillain.db.SVUnit[unitName]["icons"]["restIcon"][key[#key]] + return SV.db.SVUnit[unitName]["icons"]["restIcon"][key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName, "icons", "restIcon") @@ -1069,7 +1070,7 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, - attachTo = {type = "select", order = 2, name = L["Position"], values = SuperVillain.PointIndexes}, + attachTo = {type = "select", order = 2, name = L["Position"], values = SV.PointIndexes}, size = {type = "range", name = L["Size"], width = "full", order = 3, min = 8, max = 60, step = 1}, xOffset = {order = 4, type = "range", name = L["xOffset"], width = "full", min = -300, max = 300, step = 1}, yOffset = {order = 5, type = "range", name = L["yOffset"], width = "full", min = -300, max = 300, step = 1} @@ -1085,7 +1086,7 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) guiInline = true, name = L["Class"], get = function(key) - return SuperVillain.db.SVUnit[unitName]["icons"]["classicon"][key[#key]] + return SV.db.SVUnit[unitName]["icons"]["classicon"][key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName, "icons", "classicon") @@ -1093,7 +1094,7 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, - attachTo = {type = "select", order = 2, name = L["Position"], values = SuperVillain.PointIndexes}, + attachTo = {type = "select", order = 2, name = L["Position"], values = SV.PointIndexes}, size = {type = "range", name = L["Size"], width = "full", order = 3, min = 8, max = 60, step = 1}, xOffset = {order = 4, type = "range", name = L["xOffset"], width = "full", min = -300, max = 300, step = 1}, yOffset = {order = 5, type = "range", name = L["yOffset"], width = "full", min = -300, max = 300, step = 1} @@ -1109,7 +1110,7 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) guiInline = true, name = L["Elite / Rare"], get = function(key) - return SuperVillain.db.SVUnit[unitName]["icons"]["eliteicon"][key[#key]] + return SV.db.SVUnit[unitName]["icons"]["eliteicon"][key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName, "icons", "eliteicon") @@ -1117,7 +1118,7 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, - attachTo = {type = "select", order = 2, name = L["Position"], values = SuperVillain.PointIndexes}, + attachTo = {type = "select", order = 2, name = L["Position"], values = SV.PointIndexes}, size = {type = "range", name = L["Size"], width = "full", order = 3, min = 8, max = 60, step = 1}, xOffset = {order = 4, type = "range", name = L["xOffset"], width = "full", min = -300, max = 300, step = 1}, yOffset = {order = 5, type = "range", name = L["yOffset"], width = "full", min = -300, max = 300, step = 1} @@ -1133,7 +1134,7 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) guiInline = true, name = L["Role"], get = function(key) - return SuperVillain.db.SVUnit[unitName]["icons"]["roleIcon"][key[#key]] + return SV.db.SVUnit[unitName]["icons"]["roleIcon"][key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName, "icons", "roleIcon") @@ -1141,7 +1142,7 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, - attachTo = {type = "select", order = 2, name = L["Position"], values = SuperVillain.PointIndexes}, + attachTo = {type = "select", order = 2, name = L["Position"], values = SV.PointIndexes}, size = {type = "range", name = L["Size"], width = "full", order = 3, min = 8, max = 60, step = 1}, xOffset = {order = 4, type = "range", name = L["xOffset"], width = "full", min = -300, max = 300, step = 1}, yOffset = {order = 5, type = "range", name = L["yOffset"], width = "full", min = -300, max = 300, step = 1} @@ -1157,7 +1158,7 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) guiInline = true, name = L["Leader / MasterLooter"], get = function(key) - return SuperVillain.db.SVUnit[unitName]["icons"]["raidRoleIcons"][key[#key]] + return SV.db.SVUnit[unitName]["icons"]["raidRoleIcons"][key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName, "icons", "raidRoleIcons") @@ -1165,7 +1166,7 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, - attachTo = {type = "select", order = 2, name = L["Position"], values = SuperVillain.PointIndexes}, + attachTo = {type = "select", order = 2, name = L["Position"], values = SV.PointIndexes}, size = {type = "range", name = L["Size"], width = "full", order = 3, min = 8, max = 60, step = 1}, xOffset = {order = 4, type = "range", name = L["xOffset"], width = "full", min = -300, max = 300, step = 1}, yOffset = {order = 5, type = "range", name = L["yOffset"], width = "full", min = -300, max = 300, step = 1} @@ -1175,7 +1176,7 @@ function ns:SetIconConfigGroup(updateFunction, unitName, count) end return k -end; +end function ns:SetAurabarConfigGroup(custom, updateFunction, unitName) local k = { @@ -1183,7 +1184,7 @@ function ns:SetAurabarConfigGroup(custom, updateFunction, unitName) type = "group", name = L["Aura Bars"], get = function(key) - return SuperVillain.db.SVUnit[unitName]["aurabar"][key[#key]] + return SV.db.SVUnit[unitName]["aurabar"][key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key], unitName, "aurabar") @@ -1310,9 +1311,9 @@ function ns:SetAurabarConfigGroup(custom, updateFunction, unitName) values = function() filterList = {} filterList[""] = NONE; - for n in pairs(SuperVillain.db.filter)do + for n in pairs(SV.db.filter)do filterList[n] = n - end; + end return filterList end } @@ -1326,15 +1327,15 @@ function ns:SetAurabarConfigGroup(custom, updateFunction, unitName) order = 2, type = "toggle", name = L["Friendly"], desc = L["If the unit is friendly to you."].." "..L["Don't display auras that are not yours."], - get = function(l)return SuperVillain.db.SVUnit[unitName]["aurabar"].filterPlayer.friendly end, - set = function(l, m)SuperVillain.db.SVUnit[unitName]["aurabar"].filterPlayer.friendly = m;updateFunction(MOD, unitName)end + get = function(l)return SV.db.SVUnit[unitName]["aurabar"].filterPlayer.friendly end, + set = function(l, m)SV.db.SVUnit[unitName]["aurabar"].filterPlayer.friendly = m;updateFunction(MOD, unitName)end }, enemy = { order = 3, type = "toggle", name = L["Enemy"], desc = L["If the unit is an enemy to you."].." "..L["Don't display auras that are not yours."], - get = function(l)return SuperVillain.db.SVUnit[unitName]["aurabar"].filterPlayer.enemy end, - set = function(l, m)SuperVillain.db.SVUnit[unitName]["aurabar"].filterPlayer.enemy = m;updateFunction(MOD, unitName)end + get = function(l)return SV.db.SVUnit[unitName]["aurabar"].filterPlayer.enemy end, + set = function(l, m)SV.db.SVUnit[unitName]["aurabar"].filterPlayer.enemy = m;updateFunction(MOD, unitName)end } } } @@ -1347,15 +1348,15 @@ function ns:SetAurabarConfigGroup(custom, updateFunction, unitName) order = 2, type = "toggle", name = L["Friendly"], desc = L["If the unit is friendly to you."].." "..L["Don't display any auras found on the Blocked filter."], - get = function(l)return SuperVillain.db.SVUnit[unitName]["aurabar"].filterBlocked.friendly end, - set = function(l, m)SuperVillain.db.SVUnit[unitName]["aurabar"].filterBlocked.friendly = m;updateFunction(MOD, unitName)end + get = function(l)return SV.db.SVUnit[unitName]["aurabar"].filterBlocked.friendly end, + set = function(l, m)SV.db.SVUnit[unitName]["aurabar"].filterBlocked.friendly = m;updateFunction(MOD, unitName)end }, enemy = { order = 3, type = "toggle", name = L["Enemy"], desc = L["If the unit is an enemy to you."].." "..L["Don't display any auras found on the Blocked filter."], - get = function(l)return SuperVillain.db.SVUnit[unitName]["aurabar"].filterBlocked.enemy end, - set = function(l, m)SuperVillain.db.SVUnit[unitName]["aurabar"].filterBlocked.enemy = m;updateFunction(MOD, unitName)end + get = function(l)return SV.db.SVUnit[unitName]["aurabar"].filterBlocked.enemy end, + set = function(l, m)SV.db.SVUnit[unitName]["aurabar"].filterBlocked.enemy = m;updateFunction(MOD, unitName)end } } } @@ -1368,15 +1369,15 @@ function ns:SetAurabarConfigGroup(custom, updateFunction, unitName) order = 2, type = "toggle", name = L["Friendly"], desc = L["If the unit is friendly to you."].." "..L["If no other filter options are being used then it will block anything not on the Allowed filter, otherwise it will simply add auras on the whitelist in addition to any other filter settings."], - get = function(l)return SuperVillain.db.SVUnit[unitName]["aurabar"].filterAllowed.friendly end, - set = function(l, m)SuperVillain.db.SVUnit[unitName]["aurabar"].filterAllowed.friendly = m;updateFunction(MOD, unitName)end + get = function(l)return SV.db.SVUnit[unitName]["aurabar"].filterAllowed.friendly end, + set = function(l, m)SV.db.SVUnit[unitName]["aurabar"].filterAllowed.friendly = m;updateFunction(MOD, unitName)end }, enemy = { order = 3, type = "toggle", name = L["Enemy"], desc = L["If the unit is an enemy to you."].." "..L["If no other filter options are being used then it will block anything not on the Allowed filter, otherwise it will simply add auras on the whitelist in addition to any other filter settings."], - get = function(l)return SuperVillain.db.SVUnit[unitName]["aurabar"].filterAllowed.enemy end, - set = function(l, m)SuperVillain.db.SVUnit[unitName]["aurabar"].filterAllowed.enemy = m;updateFunction(MOD, unitName)end + get = function(l)return SV.db.SVUnit[unitName]["aurabar"].filterAllowed.enemy end, + set = function(l, m)SV.db.SVUnit[unitName]["aurabar"].filterAllowed.enemy = m;updateFunction(MOD, unitName)end } } } @@ -1389,15 +1390,15 @@ function ns:SetAurabarConfigGroup(custom, updateFunction, unitName) order = 2, type = "toggle", name = L["Friendly"], desc = L["If the unit is friendly to you."].." "..L["Don't display auras that have no duration."], - get = function(l)return SuperVillain.db.SVUnit[unitName]["aurabar"].filterInfinite.friendly end, - set = function(l, m)SuperVillain.db.SVUnit[unitName]["aurabar"].filterInfinite.friendly = m;updateFunction(MOD, unitName)end + get = function(l)return SV.db.SVUnit[unitName]["aurabar"].filterInfinite.friendly end, + set = function(l, m)SV.db.SVUnit[unitName]["aurabar"].filterInfinite.friendly = m;updateFunction(MOD, unitName)end }, enemy = { order = 3, type = "toggle", name = L["Enemy"], desc = L["If the unit is an enemy to you."].." "..L["Don't display auras that have no duration."], - get = function(l)return SuperVillain.db.SVUnit[unitName]["aurabar"].filterInfinite.enemy end, - set = function(l, m)SuperVillain.db.SVUnit[unitName]["aurabar"].filterInfinite.enemy = m;updateFunction(MOD, unitName)end + get = function(l)return SV.db.SVUnit[unitName]["aurabar"].filterInfinite.enemy end, + set = function(l, m)SV.db.SVUnit[unitName]["aurabar"].filterInfinite.enemy = m;updateFunction(MOD, unitName)end } } } @@ -1410,13 +1411,13 @@ function ns:SetAurabarConfigGroup(custom, updateFunction, unitName) order = 2, type = "toggle", name = L["Friendly"], desc = L["If the unit is friendly to you."].." "..L["Don't display auras that cannot be purged or dispelled by your class."], - get = function(l)return SuperVillain.db.SVUnit[unitName]["aurabar"].filterDispellable.friendly end, - set = function(l, m)SuperVillain.db.SVUnit[unitName]["aurabar"].filterDispellable.friendly = m;updateFunction(MOD, unitName)end}, enemy = { + get = function(l)return SV.db.SVUnit[unitName]["aurabar"].filterDispellable.friendly end, + set = function(l, m)SV.db.SVUnit[unitName]["aurabar"].filterDispellable.friendly = m;updateFunction(MOD, unitName)end}, enemy = { order = 3, type = "toggle", name = L["Enemy"], desc = L["If the unit is an enemy to you."].." "..L["Don't display auras that cannot be purged or dispelled by your class."], - get = function(l)return SuperVillain.db.SVUnit[unitName]["aurabar"].filterDispellable.enemy end, - set = function(l, m)SuperVillain.db.SVUnit[unitName]["aurabar"].filterDispellable.enemy = m;updateFunction(MOD, unitName)end} + get = function(l)return SV.db.SVUnit[unitName]["aurabar"].filterDispellable.enemy end, + set = function(l, m)SV.db.SVUnit[unitName]["aurabar"].filterDispellable.enemy = m;updateFunction(MOD, unitName)end} } } k.args.filterGroup.args.filters.args.filterRaid = { @@ -1428,13 +1429,13 @@ function ns:SetAurabarConfigGroup(custom, updateFunction, unitName) order = 2, type = "toggle", name = L["Friendly"], desc = L["If the unit is friendly to you."].." "..L["Don't display raid buffs such as Blessing of Kings or Mark of the Wild."], - get = function(l)return SuperVillain.db.SVUnit[unitName]["aurabar"].filterRaid.friendly end, - set = function(l, m)SuperVillain.db.SVUnit[unitName]["aurabar"].filterRaid.friendly = m;updateFunction(MOD, unitName)end}, enemy = { + get = function(l)return SV.db.SVUnit[unitName]["aurabar"].filterRaid.friendly end, + set = function(l, m)SV.db.SVUnit[unitName]["aurabar"].filterRaid.friendly = m;updateFunction(MOD, unitName)end}, enemy = { order = 3, type = "toggle", name = L["Enemy"], desc = L["If the unit is an enemy to you."].." "..L["Don't display raid buffs such as Blessing of Kings or Mark of the Wild."], - get = function(l)return SuperVillain.db.SVUnit[unitName]["aurabar"].filterRaid.enemy end, - set = function(l, m)SuperVillain.db.SVUnit[unitName]["aurabar"].filterRaid.enemy = m;updateFunction(MOD, unitName)end} + get = function(l)return SV.db.SVUnit[unitName]["aurabar"].filterRaid.enemy end, + set = function(l, m)SV.db.SVUnit[unitName]["aurabar"].filterRaid.enemy = m;updateFunction(MOD, unitName)end} } } k.args.filterGroup.args.filters.args.useFilter = { @@ -1445,22 +1446,22 @@ function ns:SetAurabarConfigGroup(custom, updateFunction, unitName) values = function() filterList = {} filterList[""] = NONE; - for n in pairs(SuperVillain.db.filter)do + for n in pairs(SV.db.filter)do filterList[n] = n - end; + end return filterList end } - end; + end return k -end; +end -SuperVillain.Options.args.SVUnit = { +SV.Options.args.SVUnit = { type = "group", name = L["UnitFrames"], childGroups = "tree", get = function(key) - return SuperVillain.db.SVUnit[key[#key]] + return SV.db.SVUnit[key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key]); @@ -1472,10 +1473,10 @@ SuperVillain.Options.args.SVUnit = { type = "toggle", name = L["Enable"], get = function(l) - return SuperVillain.db.SVUnit.enable end, + return SV.db.SVUnit.enable end, set = function(l, m) - SuperVillain.db.SVUnit.enable = m; - SuperVillain:StaticPopup_Show("RL_CLIENT") + SV.db.SVUnit.enable = m; + SV:StaticPopup_Show("RL_CLIENT") end }, common = { @@ -1484,7 +1485,7 @@ SuperVillain.Options.args.SVUnit = { name = L["General"], guiInline = true, disabled = function() - return not SuperVillain.db.SVUnit.enable + return not SV.db.SVUnit.enable end, args = { commonGroup = { @@ -1499,11 +1500,11 @@ SuperVillain.Options.args.SVUnit = { desc = L["Disables the blizzard party/raid frames."], type = "toggle", get = function(key) - return SuperVillain.db.SVUnit.disableBlizzard + return SV.db.SVUnit.disableBlizzard end, set = function(key, value) MOD:ChangeDBVar(value, "disableBlizzard"); - SuperVillain:StaticPopup_Show("RL_CLIENT") + SV:StaticPopup_Show("RL_CLIENT") end }, fastClickTarget = { @@ -1544,70 +1545,18 @@ SuperVillain.Options.args.SVUnit = { end }, } - }, - gridGroup = { - order = 2, - type = "group", - guiInline = true, - name = L["Grid Mode"], - args = { - enable = { - order = 1, - name = L["Enable Grid Mode"], - desc = L["Converts party, party pet, raid, raid pet, tank and assist frames into symmetrical squares. Ideal for healers."], - type = "toggle", - get = function(key) - return SuperVillain.db.SVUnit.grid.enable - end, - set = function(key, value) - MOD:ChangeDBVar(value, "enable", "grid"); - MOD:RefreshUnitFrames(); - end - }, - shownames = { - order = 2, - name = L["Show Grid Names"], - desc = L["Grid frames will show name texts."], - type = "toggle", - get = function(key) - return SuperVillain.db.SVUnit.grid.shownames - end, - set = function(key, value) - if(SuperVillain.db.SVUnit.grid.size < 30) then MOD:ChangeDBVar(30, "size", "grid"); end - MOD:ChangeDBVar(value, "shownames", "grid"); - MOD:RefreshUnitFrames(); - end - }, - size = { - order = 3, - name = L["Grid Size"], - desc = L["The universal size of grid squares."], - type = "range", - min = 10, - max = 70, - step = 1, - width = "full", - get = function(key) - return SuperVillain.db.SVUnit.grid.size - end, - set = function(key, value) - MOD:ChangeDBVar(value, "size", "grid"); - MOD:RefreshUnitFrames(); - end - }, - } }, backgroundGroup = { - order = 3, + order = 2, type = "group", guiInline = true, name = "Unit Backgrounds (3D Portraits Only)", get = function(key) - return SuperVillain.db.media.textures[key[#key]] + return SV.db.media.textures[key[#key]] end, set = function(key, value) - SuperVillain.db.media.textures[key[#key]] = {"background", value} - SuperVillain:RefreshEverything(true) + SV.db.media.textures[key[#key]] = {"background", value} + SV:RefreshEverything(true) end, args = { unitlarge = { @@ -1627,12 +1576,12 @@ SuperVillain.Options.args.SVUnit = { } }, barGroup = { - order = 4, + order = 3, type = "group", guiInline = true, name = L["Bars"], get = function(key) - return SuperVillain.db.SVUnit[key[#key]] + return SV.db.SVUnit[key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key]); @@ -1664,7 +1613,7 @@ SuperVillain.Options.args.SVUnit = { } }, fontGroup = { - order = 5, + order = 4, type = "group", guiInline = true, name = L["Fonts"], @@ -1740,7 +1689,7 @@ SuperVillain.Options.args.SVUnit = { } }, allColorsGroup = { - order = 6, + order = 5, type = "group", guiInline = true, name = L["Colors"], @@ -1756,7 +1705,7 @@ SuperVillain.Options.args.SVUnit = { name = L["Class Health"], desc = L["Color health by classcolor or reaction."], get = function(key) - return SuperVillain.db.SVUnit[key[#key]] + return SV.db.SVUnit[key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key]); @@ -1769,7 +1718,7 @@ SuperVillain.Options.args.SVUnit = { name = L["Health By Value"], desc = L["Color health by amount remaining."], get = function(key) - return SuperVillain.db.SVUnit[key[#key]] + return SV.db.SVUnit[key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key]); @@ -1782,7 +1731,7 @@ SuperVillain.Options.args.SVUnit = { name = L["Class Backdrop"], desc = L["Color the health backdrop by class or reaction."], get = function(key) - return SuperVillain.db.SVUnit[key[#key]] + return SV.db.SVUnit[key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key]); @@ -1795,7 +1744,7 @@ SuperVillain.Options.args.SVUnit = { name = L["Overlay Health Color"], desc = L["Force custom health color when using portrait overlays."], get = function(key) - return SuperVillain.db.SVUnit[key[#key]] + return SV.db.SVUnit[key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key]); @@ -1808,7 +1757,7 @@ SuperVillain.Options.args.SVUnit = { name = L["Overlay Animations"], desc = L["Toggle health animations on portrait overlays."], get = function(key) - return SuperVillain.db.SVUnit[key[#key]] + return SV.db.SVUnit[key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key]); @@ -1820,11 +1769,11 @@ SuperVillain.Options.args.SVUnit = { type = "color", name = L["Health"], get = function(key) - local color = SuperVillain.db.media.unitframes.health + local color = SV.db.media.unitframes.health return color[1],color[2],color[3] end, set = function(key, rValue, gValue, bValue) - SuperVillain.db.media.unitframes.health = {rValue, gValue, bValue} + SV.db.media.unitframes.health = {rValue, gValue, bValue} MOD:RefreshAllUnitMedia() end, }, @@ -1833,11 +1782,11 @@ SuperVillain.Options.args.SVUnit = { type = "color", name = L["Tapped"], get = function(key) - local color = SuperVillain.db.media.unitframes.tapped + local color = SV.db.media.unitframes.tapped return color[1],color[2],color[3] end, set = function(key, rValue, gValue, bValue) - SuperVillain.db.media.unitframes.tapped = {rValue, gValue, bValue} + SV.db.media.unitframes.tapped = {rValue, gValue, bValue} MOD:RefreshAllUnitMedia() end, }, @@ -1846,11 +1795,11 @@ SuperVillain.Options.args.SVUnit = { type = "color", name = L["Disconnected"], get = function(key) - local color = SuperVillain.db.media.unitframes.disconnected + local color = SV.db.media.unitframes.disconnected return color[1],color[2],color[3] end, set = function(key, rValue, gValue, bValue) - SuperVillain.db.media.unitframes.disconnected = {rValue, gValue, bValue} + SV.db.media.unitframes.disconnected = {rValue, gValue, bValue} MOD:RefreshAllUnitMedia() end, } @@ -1868,7 +1817,7 @@ SuperVillain.Options.args.SVUnit = { name = L["Class Power"], desc = L["Color power by classcolor or reaction."], get = function(key) - return SuperVillain.db.SVUnit[key[#key]] + return SV.db.SVUnit[key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key]); @@ -1880,11 +1829,11 @@ SuperVillain.Options.args.SVUnit = { name = MANA, type = "color", get = function(key) - local color = SuperVillain.db.media.unitframes.power["MANA"] + local color = SV.db.media.unitframes.power["MANA"] return color[1],color[2],color[3] end, set = function(key, rValue, gValue, bValue) - SuperVillain.db.media.unitframes.power["MANA"] = {rValue, gValue, bValue} + SV.db.media.unitframes.power["MANA"] = {rValue, gValue, bValue} MOD:RefreshAllUnitMedia() end, }, @@ -1893,11 +1842,11 @@ SuperVillain.Options.args.SVUnit = { name = RAGE, type = "color", get = function(key) - local color = SuperVillain.db.media.unitframes.power["RAGE"] + local color = SV.db.media.unitframes.power["RAGE"] return color[1],color[2],color[3] end, set = function(key, rValue, gValue, bValue) - SuperVillain.db.media.unitframes.power["RAGE"] = {rValue, gValue, bValue} + SV.db.media.unitframes.power["RAGE"] = {rValue, gValue, bValue} MOD:RefreshAllUnitMedia() end, }, @@ -1906,11 +1855,11 @@ SuperVillain.Options.args.SVUnit = { name = FOCUS, type = "color", get = function(key) - local color = SuperVillain.db.media.unitframes.power["FOCUS"] + local color = SV.db.media.unitframes.power["FOCUS"] return color[1],color[2],color[3] end, set = function(key, rValue, gValue, bValue) - SuperVillain.db.media.unitframes.power["FOCUS"] = {rValue, gValue, bValue} + SV.db.media.unitframes.power["FOCUS"] = {rValue, gValue, bValue} MOD:RefreshAllUnitMedia() end, }, @@ -1919,11 +1868,11 @@ SuperVillain.Options.args.SVUnit = { name = ENERGY, type = "color", get = function(key) - local color = SuperVillain.db.media.unitframes.power["ENERGY"] + local color = SV.db.media.unitframes.power["ENERGY"] return color[1],color[2],color[3] end, set = function(key, rValue, gValue, bValue) - SuperVillain.db.media.unitframes.power["ENERGY"] = {rValue, gValue, bValue} + SV.db.media.unitframes.power["ENERGY"] = {rValue, gValue, bValue} MOD:RefreshAllUnitMedia() end, }, @@ -1932,11 +1881,11 @@ SuperVillain.Options.args.SVUnit = { name = RUNIC_POWER, type = "color", get = function(key) - local color = SuperVillain.db.media.unitframes.power["RUNIC_POWER"] + local color = SV.db.media.unitframes.power["RUNIC_POWER"] return color[1],color[2],color[3] end, set = function(key, rValue, gValue, bValue) - SuperVillain.db.media.unitframes.power["RUNIC_POWER"] = {rValue, gValue, bValue} + SV.db.media.unitframes.power["RUNIC_POWER"] = {rValue, gValue, bValue} MOD:RefreshAllUnitMedia() end, } @@ -1954,7 +1903,7 @@ SuperVillain.Options.args.SVUnit = { name = L["Class Castbars"], desc = L["Color castbars by the class or reaction type of the unit."], get = function(key) - return SuperVillain.db.SVUnit[key[#key]] + return SV.db.SVUnit[key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key]); @@ -1966,11 +1915,11 @@ SuperVillain.Options.args.SVUnit = { name = L["Interruptable"], type = "color", get = function(key) - local color = SuperVillain.db.media.unitframes.casting + local color = SV.db.media.unitframes.casting return color[1],color[2],color[3] end, set = function(key, rValue, gValue, bValue) - SuperVillain.db.media.unitframes.casting = {rValue, gValue, bValue} + SV.db.media.unitframes.casting = {rValue, gValue, bValue} MOD:RefreshAllUnitMedia() end, }, @@ -1979,11 +1928,11 @@ SuperVillain.Options.args.SVUnit = { name = "Spark Color", type = "color", get = function(key) - local color = SuperVillain.db.media.unitframes.spark + local color = SV.db.media.unitframes.spark return color[1],color[2],color[3] end, set = function(key, rValue, gValue, bValue) - SuperVillain.db.media.unitframes.spark = {rValue, gValue, bValue} + SV.db.media.unitframes.spark = {rValue, gValue, bValue} MOD:RefreshAllUnitMedia() end, }, @@ -1992,11 +1941,11 @@ SuperVillain.Options.args.SVUnit = { name = L["Non-Interruptable"], type = "color", get = function(key) - local color = SuperVillain.db.media.unitframes.interrupt + local color = SV.db.media.unitframes.interrupt return color[1],color[2],color[3] end, set = function(key, rValue, gValue, bValue) - SuperVillain.db.media.unitframes.interrupt = {rValue, gValue, bValue} + SV.db.media.unitframes.interrupt = {rValue, gValue, bValue} MOD:RefreshAllUnitMedia() end, } @@ -2014,7 +1963,7 @@ SuperVillain.Options.args.SVUnit = { desc = L["Color aurabar debuffs by type."], type = "toggle", get = function(key) - return SuperVillain.db.SVUnit[key[#key]] + return SV.db.SVUnit[key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key]); @@ -2027,7 +1976,7 @@ SuperVillain.Options.args.SVUnit = { desc = L["Color all buffs that reduce incoming damage."], type = "toggle", get = function(key) - return SuperVillain.db.SVUnit[key[#key]] + return SV.db.SVUnit[key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key]); @@ -2039,11 +1988,11 @@ SuperVillain.Options.args.SVUnit = { name = L["Buffs"], type = "color", get = function(key) - local color = SuperVillain.db.media.unitframes.buff_bars + local color = SV.db.media.unitframes.buff_bars return color[1],color[2],color[3] end, set = function(key, rValue, gValue, bValue) - SuperVillain.db.media.unitframes.buff_bars = {rValue, gValue, bValue} + SV.db.media.unitframes.buff_bars = {rValue, gValue, bValue} MOD:RefreshAllUnitMedia() end, }, @@ -2052,11 +2001,11 @@ SuperVillain.Options.args.SVUnit = { name = L["Debuffs"], type = "color", get = function(key) - local color = SuperVillain.db.media.unitframes.debuff_bars + local color = SV.db.media.unitframes.debuff_bars return color[1],color[2],color[3] end, set = function(key, rValue, gValue, bValue) - SuperVillain.db.media.unitframes.debuff_bars = {rValue, gValue, bValue} + SV.db.media.unitframes.debuff_bars = {rValue, gValue, bValue} MOD:RefreshAllUnitMedia() end, }, @@ -2065,11 +2014,11 @@ SuperVillain.Options.args.SVUnit = { name = L["Shield Buffs Color"], type = "color", get = function(key) - local color = SuperVillain.db.media.unitframes.shield_bars + local color = SV.db.media.unitframes.shield_bars return color[1],color[2],color[3] end, set = function(key, rValue, gValue, bValue) - SuperVillain.db.media.unitframes.shield_bars = {rValue, gValue, bValue} + SV.db.media.unitframes.shield_bars = {rValue, gValue, bValue} MOD:RefreshAllUnitMedia() end, } @@ -2086,11 +2035,11 @@ SuperVillain.Options.args.SVUnit = { type = "color", hasAlpha = true, get = function(key) - local color = SuperVillain.db.media.unitframes.predict["personal"] + local color = SV.db.media.unitframes.predict["personal"] return color[1],color[2],color[3] end, set = function(key, rValue, gValue, bValue) - SuperVillain.db.media.unitframes.predict["personal"] = {rValue, gValue, bValue} + SV.db.media.unitframes.predict["personal"] = {rValue, gValue, bValue} MOD:RefreshUnitFrames() end, }, @@ -2100,11 +2049,11 @@ SuperVillain.Options.args.SVUnit = { type = "color", hasAlpha = true, get = function(key) - local color = SuperVillain.db.media.unitframes.predict["others"] + local color = SV.db.media.unitframes.predict["others"] return color[1],color[2],color[3] end, set = function(key, rValue, gValue, bValue) - SuperVillain.db.media.unitframes.predict["others"] = {rValue, gValue, bValue} + SV.db.media.unitframes.predict["others"] = {rValue, gValue, bValue} MOD:RefreshUnitFrames() end, }, @@ -2114,11 +2063,11 @@ SuperVillain.Options.args.SVUnit = { type = "color", hasAlpha = true, get = function(key) - local color = SuperVillain.db.media.unitframes.predict["absorbs"] + local color = SV.db.media.unitframes.predict["absorbs"] return color[1],color[2],color[3] end, set = function(key, rValue, gValue, bValue) - SuperVillain.db.media.unitframes.predict["absorbs"] = {rValue, gValue, bValue} + SV.db.media.unitframes.predict["absorbs"] = {rValue, gValue, bValue} MOD:RefreshUnitFrames() end, } diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/focus.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/focus.lua index 6a19e6c..0cdf607 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/focus.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/focus.lua @@ -29,25 +29,25 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(SVUI); +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ... --[[ ################################################################################################## ################################################################################################## ################################################################################################## ]] -SuperVillain.Options.args.SVUnit.args.focus = { +SV.Options.args.SVUnit.args.focus = { name = L["Focus Frame"], type = "group", order = 9, childGroups = "tab", - get = function(l)return SuperVillain.db.SVUnit["focus"][l[#l]]end, + get = function(l)return SV.db.SVUnit["focus"][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "focus");MOD:SetUnitFrame("focus")end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, - resetSettings = {type = "execute", order = 2, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("focus");SuperVillain:ResetMovables("Focus Frame")end}, + resetSettings = {type = "execute", order = 2, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("focus");SV:ResetMovables("Focus Frame")end}, tabGroups = { order = 3, type = "group", @@ -69,7 +69,7 @@ SuperVillain.Options.args.SVUnit.args.focus = { order = 1, type = "execute", name = L["Show Auras"], - func = function()local U = SVUI_Focus;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end;MOD:SetUnitFrame("focus")end + func = function()local U = SVUI_Focus;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("focus")end }, smartAuraDisplay = { type = "select", @@ -95,8 +95,8 @@ SuperVillain.Options.args.SVUnit.args.focus = { order = 5, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], - get = function(l)return SuperVillain.db.SVUnit["focus"]["power"].hideonnpc end, - set = function(l, m)SuperVillain.db.SVUnit["focus"]["power"].hideonnpc = m;MOD:SetUnitFrame("focus")end + get = function(l)return SV.db.SVUnit["focus"]["power"].hideonnpc end, + set = function(l, m)SV.db.SVUnit["focus"]["power"].hideonnpc = m;MOD:SetUnitFrame("focus")end }, threatEnabled = { type = "toggle", @@ -151,16 +151,16 @@ SuperVillain.Options.args.SVUnit.args.focus = { ################################################################################################## ################################################################################################## ]] -SuperVillain.Options.args.SVUnit.args.focustarget = { +SV.Options.args.SVUnit.args.focustarget = { name = L["FocusTarget Frame"], type = "group", order = 10, childGroups = "tab", - get = function(l)return SuperVillain.db.SVUnit["focustarget"][l[#l]]end, + get = function(l)return SV.db.SVUnit["focustarget"][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "focustarget");MOD:SetUnitFrame("focustarget")end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, - resetSettings = {type = "execute", order = 2, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("focustarget")SuperVillain:ResetMovables("FocusTarget Frame")end}, + resetSettings = {type = "execute", order = 2, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("focustarget")SV:ResetMovables("FocusTarget Frame")end}, tabGroups = { order = 3, type = "group", @@ -178,14 +178,14 @@ SuperVillain.Options.args.SVUnit.args.focustarget = { guiInline = true, name = L["Base Settings"], args = { - showAuras = {order = 1, type = "execute", name = L["Show Auras"], func = function()local U = SVUI_FocusTarget;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end;MOD:SetUnitFrame("focustarget")end}, + showAuras = {order = 1, type = "execute", name = L["Show Auras"], func = function()local U = SVUI_FocusTarget;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("focustarget")end}, spacer1 = { order = 2, type = "description", name = "", }, rangeCheck = {order = 3, name = L["Range Check"], desc = L["Check if you are in range to cast spells on this specific unit."], type = "toggle"}, - hideonnpc = {type = "toggle", order = 4, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], get = function(l)return SuperVillain.db.SVUnit["focustarget"]["power"].hideonnpc end, set = function(l, m)SuperVillain.db.SVUnit["focustarget"]["power"].hideonnpc = m;MOD:SetUnitFrame("focustarget")end}, + hideonnpc = {type = "toggle", order = 4, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], get = function(l)return SV.db.SVUnit["focustarget"]["power"].hideonnpc end, set = function(l, m)SV.db.SVUnit["focustarget"]["power"].hideonnpc = m;MOD:SetUnitFrame("focustarget")end}, threatEnabled = {type = "toggle", order = 5, name = L["Show Threat"]} } }, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/grid.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/grid.lua new file mode 100644 index 0000000..0205fcd --- /dev/null +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/grid.lua @@ -0,0 +1,172 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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 pairs = _G.pairs; +local tinsert = _G.tinsert; +local table = _G.table; +--[[ TABLE METHODS ]]-- +local tsort = table.sort; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV, L = unpack(SVUI); +local MOD = SV.SVUnit +if(not MOD) then return end +local _, ns = ... +--[[ +################################################################################################## +################################################################################################## +################################################################################################## +]] +SV.Options.args.SVUnit.args.grid = { + name = L["Grid Frames"], + type = "group", + order = 1200, + childGroups = "tab", + args = { + configureToggle = { + order = 1, + type = "execute", + name = L["Display Frames"], + func = function()MOD:UpdateGroupConfig(_G["SVUI_Raid40"], _G["SVUI_Raid40"].forceShow ~= true or nil)end, + }, + gridCommon = { + order = 2, + type = "group", + guiInline = true, + name = L["General Settings"], + get = function(key) + return SV.db.SVUnit.grid[key[#key]] + end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key] , "grid"); + MOD:RefreshUnitFrames(); + end, + args = { + enable = { + order = 1, + name = L["Enable Grid Mode"], + desc = L["Converts party, party pet, raid, raid pet, tank and assist frames into symmetrical squares. Ideal for healers."], + type = "toggle" + }, + shownames = { + order = 2, + name = L["Show Grid Names"], + desc = L["Grid frames will show name texts."], + type = "toggle", + set = function(key, value) + if(SV.db.SVUnit.grid.size < 30) then MOD:ChangeDBVar(30, "size", "grid"); end + MOD:ChangeDBVar(value, "shownames", "grid"); + MOD:RefreshUnitFrames(); + end + }, + size = { + order = 3, + name = L["Grid Size"], + desc = L["The universal size of grid squares."], + type = "range", + min = 10, + max = 70, + step = 1, + width = "full" + }, + } + }, + gridAllowed = { + order = 3, + type = "group", + guiInline = true, + name = L["Allowed Frames"], + get = function(key) + return SV.db.SVUnit.grid[key[#key]] + end, + set = function(key, value) + MOD:ChangeDBVar(value, key[#key] , "grid"); + MOD:RefreshUnitFrames(); + end, + args = { + party = { + type = 'toggle', + order = 1, + name = L['Party Grid'], + desc = L['If grid-mode is enabled, these units will be changed.'], + get = function(key) return SV.db.SVUnit.party.gridAllowed end, + set = function(key, value) SV.db.SVUnit.party.gridAllowed = value; MOD:SetGroupFrame("party") end, + }, + partypets = { + type = 'toggle', + order = 2, + name = L['Party Pets Grid'], + desc = L['If grid-mode is enabled, these units will be changed.'], + get = function(key) return SV.db.SVUnit.party.petsGroup.gridAllowed end, + set = function(key, value) SV.db.SVUnit.party.petsGroup.gridAllowed = value; MOD:SetGroupFrame("party") end, + }, + partytargets = { + type = 'toggle', + order = 3, + name = L['Party Targets Grid'], + desc = L['If grid-mode is enabled, these units will be changed.'], + get = function(key) return SV.db.SVUnit.party.targetsGroup.gridAllowed end, + set = function(key, value) SV.db.SVUnit.party.targetsGroup.gridAllowed = value; MOD:SetGroupFrame("party") end, + }, + raid10 = { + type = 'toggle', + order = 4, + name = L['Raid 10 Grid'], + desc = L['If grid-mode is enabled, these units will be changed.'], + get = function(key) return SV.db.SVUnit.raid10.gridAllowed end, + set = function(key, value) SV.db.SVUnit.raid10.gridAllowed = value; MOD:SetGroupFrame("raid10") end, + }, + raid25 = { + type = 'toggle', + order = 5, + name = L['Raid 25 Grid'], + desc = L['If grid-mode is enabled, these units will be changed.'], + get = function(key) return SV.db.SVUnit.raid25.gridAllowed end, + set = function(key, value) SV.db.SVUnit.raid25.gridAllowed = value; MOD:SetGroupFrame("raid25") end, + }, + raid40 = { + type = 'toggle', + order = 6, + name = L['Raid 40 Grid'], + desc = L['If grid-mode is enabled, these units will be changed.'], + get = function(key) return SV.db.SVUnit.raid40.gridAllowed end, + set = function(key, value) SV.db.SVUnit.raid40.gridAllowed = value; MOD:SetGroupFrame("raid40") end, + }, + raidpet = { + type = 'toggle', + order = 4, + name = L['Raid Pet Grid'], + desc = L['If grid-mode is enabled, these units will be changed.'], + get = function(key) return SV.db.SVUnit.raidpet.gridAllowed end, + set = function(key, value) SV.db.SVUnit.raidpet.gridAllowed = value; MOD:SetGroupFrame("raidpet") end, + }, + } + }, + } +} +--[[ +################################################################################################## +################################################################################################## +################################################################################################## +]] \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/other.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/other.lua index a96f670..bfc19d9 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/other.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/other.lua @@ -29,26 +29,26 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(SVUI); +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ... --[[ ################################################################################################## ################################################################################################## ################################################################################################## ]] -SuperVillain.Options.args.SVUnit.args.boss = { +SV.Options.args.SVUnit.args.boss = { name = L["Boss Frames"], type = "group", order = 1000, childGroups = "tab", - get = function(l)return SuperVillain.db.SVUnit["boss"][l[#l]]end, + get = function(l)return SV.db.SVUnit["boss"][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "boss");MOD:SetEnemyFrames("boss", MAX_BOSS_FRAMES)end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, displayFrames = {type = "execute", order = 2, name = L["Display Frames"], desc = L["Force the frames to show, they will act as if they are the player frame."], func = function()MOD:SwapElement("boss", 4)end}, - resetSettings = {type = "execute", order = 3, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("boss")SuperVillain:ResetMovables("Boss Frames")end}, + resetSettings = {type = "execute", order = 3, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("boss")SV:ResetMovables("Boss Frames")end}, tabGroups = { order = 3, type = "group", @@ -73,7 +73,7 @@ SuperVillain.Options.args.SVUnit.args.boss = { name = "", }, rangeCheck = {order = 3, name = L["Range Check"], desc = L["Check if you are in range to cast spells on this specific unit."], type = "toggle"}, - hideonnpc = {type = "toggle", order = 4, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], get = function(l)return SuperVillain.db.SVUnit["boss"]["power"].hideonnpc end, set = function(l, m)SuperVillain.db.SVUnit["boss"]["power"].hideonnpc = m;MOD:SetEnemyFrames("boss")end}, + hideonnpc = {type = "toggle", order = 4, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], get = function(l)return SV.db.SVUnit["boss"]["power"].hideonnpc end, set = function(l, m)SV.db.SVUnit["boss"]["power"].hideonnpc = m;MOD:SetEnemyFrames("boss")end}, threatEnabled = {type = "toggle", order = 5, name = L["Show Threat"]} } }, @@ -107,17 +107,17 @@ SuperVillain.Options.args.SVUnit.args.boss = { ################################################################################################## ################################################################################################## ]] -SuperVillain.Options.args.SVUnit.args.arena = { +SV.Options.args.SVUnit.args.arena = { name = L["Arena Frames"], type = "group", order = 1100, childGroups = "tab", - get = function(l)return SuperVillain.db.SVUnit["arena"][l[#l]]end, + get = function(l)return SV.db.SVUnit["arena"][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "arena");MOD:SetEnemyFrames("arena", 5)end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, displayFrames = {type = "execute", order = 2, name = L["Display Frames"], desc = L["Force the frames to show, they will act as if they are the player frame."], func = function()MOD:SwapElement("arena", 5)end}, - resetSettings = {type = "execute", order = 3, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("arena")SuperVillain:ResetMovables("Arena Frames")end}, + resetSettings = {type = "execute", order = 3, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("arena")SV:ResetMovables("Arena Frames")end}, tabGroups = { order = 3, type = "group", @@ -143,7 +143,7 @@ SuperVillain.Options.args.SVUnit.args.arena = { }, predict = {order = 3, name = L["Heal Prediction"], desc = L["Show a incomming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."], type = "toggle"}, rangeCheck = {order = 4, name = L["Range Check"], desc = L["Check if you are in range to cast spells on this specific unit."], type = "toggle"}, - hideonnpc = {type = "toggle", order = 5, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], get = function(l)return SuperVillain.db.SVUnit["arena"]["power"].hideonnpc end, set = function(l, m)SuperVillain.db.SVUnit["arena"]["power"].hideonnpc = m;MOD:SetEnemyFrames("arena")end}, + hideonnpc = {type = "toggle", order = 5, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], get = function(l)return SV.db.SVUnit["arena"]["power"].hideonnpc end, set = function(l, m)SV.db.SVUnit["arena"]["power"].hideonnpc = m;MOD:SetEnemyFrames("arena")end}, threatEnabled = {type = "toggle", order = 6, name = L["Show Threat"]} } }, @@ -167,7 +167,7 @@ SuperVillain.Options.args.SVUnit.args.arena = { type = "toggle", order = 1, name = L["Enable"], - get = function(l)return SuperVillain.db.SVUnit.arena.pvp.enable end, + get = function(l)return SV.db.SVUnit.arena.pvp.enable end, set = function(l, m)MOD:ChangeDBVar(m, "enable", "arena", "pvp");MOD:SetEnemyFrames("arena", 5)end, }, trinketGroup = { @@ -175,9 +175,9 @@ SuperVillain.Options.args.SVUnit.args.arena = { guiInline = true, type = "group", name = L["Trinkets"], - get = function(l)return SuperVillain.db.SVUnit.arena.pvp[l[#l]]end, + get = function(l)return SV.db.SVUnit.arena.pvp[l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "arena", "pvp");MOD:SetEnemyFrames("arena", 5)end, - disabled = function() return not SuperVillain.db.SVUnit.arena.pvp.enable end, + disabled = function() return not SV.db.SVUnit.arena.pvp.enable end, args = { trinketPosition = { type = "select", @@ -219,9 +219,9 @@ SuperVillain.Options.args.SVUnit.args.arena = { guiInline = true, type = "group", name = L["Enemy Specs"], - get = function(l)return SuperVillain.db.SVUnit.arena.pvp[l[#l]]end, + get = function(l)return SV.db.SVUnit.arena.pvp[l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "arena", "pvp");MOD:SetEnemyFrames("arena", 5)end, - disabled = function() return not SuperVillain.db.SVUnit.arena.pvp.enable end, + disabled = function() return not SV.db.SVUnit.arena.pvp.enable end, args = { specPosition = { type = "select", @@ -278,12 +278,12 @@ SuperVillain.Options.args.SVUnit.args.arena = { ################################################################################################## ################################################################################################## ]] -SuperVillain.Options.args.SVUnit.args.tank = { +SV.Options.args.SVUnit.args.tank = { name = L["Tank Frames"], type = "group", order = 1200, childGroups = "tab", - get = function(l)return SuperVillain.db.SVUnit["tank"][l[#l]]end, + get = function(l)return SV.db.SVUnit["tank"][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "tank");MOD:SetGroupFrame("tank")end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, @@ -308,7 +308,7 @@ SuperVillain.Options.args.SVUnit.args.tank = { type = "group", name = L["Tank Target"], guiInline = true, - get = function(l)return SuperVillain.db.SVUnit["tank"]["targetsGroup"][l[#l]]end, + get = function(l)return SV.db.SVUnit["tank"]["targetsGroup"][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "tank", "targetsGroup");MOD:SetGroupFrame("tank")end, args = { enable = {type = "toggle", name = L["Enable"], order = 1}, @@ -328,12 +328,12 @@ SuperVillain.Options.args.SVUnit.args.tank = { ################################################################################################## ################################################################################################## ]] -SuperVillain.Options.args.SVUnit.args.assist = { +SV.Options.args.SVUnit.args.assist = { name = L["Assist Frames"], type = "group", order = 1300, childGroups = "tab", - get = function(l)return SuperVillain.db.SVUnit["assist"][l[#l]]end, + get = function(l)return SV.db.SVUnit["assist"][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "assist");MOD:SetGroupFrame("assist")end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, @@ -358,7 +358,7 @@ SuperVillain.Options.args.SVUnit.args.assist = { type = "group", name = L["Assist Target"], guiInline = true, - get = function(l)return SuperVillain.db.SVUnit["assist"]["targetsGroup"][l[#l]]end, + get = function(l)return SV.db.SVUnit["assist"]["targetsGroup"][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "assist", "targetsGroup");MOD:SetGroupFrame("assist")end, args = { enable = {type = "toggle", name = L["Enable"], order = 1}, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/party.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/party.lua index d57be1e..9441a00 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/party.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/party.lua @@ -29,18 +29,18 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(SVUI); +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ... -SuperVillain.Options.args.SVUnit.args.party = { +SV.Options.args.SVUnit.args.party = { name = L['Party Frames'], type = 'group', order = 11, childGroups = "tab", get = function(l)return - SuperVillain.db.SVUnit['party'][l[#l]]end, + SV.db.SVUnit['party'][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party");MOD:SetGroupFrame('party')end, args = { enable = { @@ -60,7 +60,7 @@ SuperVillain.Options.args.SVUnit.args.party = { type = 'execute', order = 3, name = L['Restore Defaults'], - func = function(l, m)MOD:ResetUnitOptions('party')SuperVillain:ResetMovables('Party Frames')end, + func = function(l, m)MOD:ResetUnitOptions('party')SV:ResetMovables('Party Frames')end, }, tabGroups= { order=3, @@ -73,21 +73,13 @@ SuperVillain.Options.args.SVUnit.args.party = { type = 'group', name = L['General'], args = { - gridAllowed = { - type = 'toggle', - order = 1, - name = L['Grid Mode Allowed'], - desc = L['If grid-mode is enabled, these units will be changed.'], - get = function(l)return SuperVillain.db.SVUnit['party'].gridAllowed end, - set = function(l, m) SuperVillain.db.SVUnit['party'].gridAllowed = m; MOD:SetGroupFrame('party') end, - }, hideonnpc = { type = 'toggle', order = 2, name = L['Text Toggle On NPC'], desc = L['Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point.'], - get = function(l)return SuperVillain.db.SVUnit['party']['power'].hideonnpc end, - set = function(l, m)SuperVillain.db.SVUnit['party']['power'].hideonnpc = m;MOD:SetGroupFrame('party')end, + get = function(l)return SV.db.SVUnit['party']['power'].hideonnpc end, + set = function(l, m)SV.db.SVUnit['party']['power'].hideonnpc = m;MOD:SetGroupFrame('party')end, }, rangeCheck = { order = 3, @@ -291,14 +283,14 @@ SuperVillain.Options.args.SVUnit.args.party = { order = 5, name = L['Invert Grouping Order'], desc = L['Enabling this inverts the sorting order.'], - disabled = function()return not SuperVillain.db.SVUnit['party'].customSorting end, + disabled = function()return not SV.db.SVUnit['party'].customSorting end, type = 'toggle', }, startFromCenter = { order = 6, name = L['Start Near Center'], desc = L['The initial group will start near the center and grow out.'], - disabled = function()return not SuperVillain.db.SVUnit['party'].customSorting end, + disabled = function()return not SV.db.SVUnit['party'].customSorting end, type = 'toggle', }, }, @@ -311,7 +303,7 @@ SuperVillain.Options.args.SVUnit.args.party = { type = 'group', name = L['Aura Watch'], get = function(l)return - SuperVillain.db.SVUnit['party']['auraWatch'][l[#l]]end, + SV.db.SVUnit['party']['auraWatch'][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party", "auraWatch");MOD:SetGroupFrame('party')end, args = { enable = { @@ -348,7 +340,7 @@ SuperVillain.Options.args.SVUnit.args.party = { order = 800, type = 'group', name = L['Party Pets'], - get = function(l)return SuperVillain.db.SVUnit['party']['petsGroup'][l[#l]]end, + get = function(l)return SV.db.SVUnit['party']['petsGroup'][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party", "petsGroup");MOD:SetGroupFrame('party')end, args = { enable = { @@ -356,14 +348,6 @@ SuperVillain.Options.args.SVUnit.args.party = { name = L['Enable'], order = 1, }, - gridAllowed = { - type = 'toggle', - order = 2, - name = L['Grid Mode Allowed'], - desc = L['If grid-mode is enabled, these units will be changed.'], - get = function(l)return SuperVillain.db.SVUnit['party']['petsGroup'].gridAllowed end, - set = function(l, m) SuperVillain.db.SVUnit['party']['petsGroup'].gridAllowed = m; MOD:SetGroupFrame('party') end, - }, width = { order = 3, name = L['Width'], @@ -427,7 +411,7 @@ SuperVillain.Options.args.SVUnit.args.party = { type = 'group', name = L['Party Targets'], get = function(l)return - SuperVillain.db.SVUnit['party']['targetsGroup'][l[#l]]end, + SV.db.SVUnit['party']['targetsGroup'][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "party", "targetsGroup");MOD:SetGroupFrame('party')end, args = { enable = { @@ -435,14 +419,6 @@ SuperVillain.Options.args.SVUnit.args.party = { name = L['Enable'], order = 1, }, - gridAllowed = { - type = 'toggle', - order = 2, - name = L['Grid Mode Allowed'], - desc = L['If grid-mode is enabled, these units will be changed.'], - get = function(l)return SuperVillain.db.SVUnit['party']['targetsGroup'].gridAllowed end, - set = function(l, m) SuperVillain.db.SVUnit['party']['targetsGroup'].gridAllowed = m; MOD:SetGroupFrame('party') end, - }, width = { order = 3, name = L['Width'], diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/pet.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/pet.lua index c9a2f95..36ec8b3 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/pet.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/pet.lua @@ -29,25 +29,25 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(SVUI); +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ... --[[ ################################################################################################## ################################################################################################## ################################################################################################## ]] -SuperVillain.Options.args.SVUnit.args.pet = { +SV.Options.args.SVUnit.args.pet = { name = L["Pet Frame"], type = "group", order = 4, childGroups = "tab", - get = function(l)return SuperVillain.db.SVUnit["pet"][l[#l]]end, + get = function(l)return SV.db.SVUnit["pet"][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "pet");MOD:SetUnitFrame("pet")end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, - resetSettings = {type = "execute", order = 2, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("pet")SuperVillain:ResetMovables("Pet Frame")end}, + resetSettings = {type = "execute", order = 2, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("pet")SV:ResetMovables("Pet Frame")end}, tabGroups = { order = 3, type = "group", @@ -63,7 +63,7 @@ SuperVillain.Options.args.SVUnit.args.pet = { order = 1, type = "execute", name = L["Show Auras"], - func = function()local U = SVUI_Pet;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end;MOD:SetUnitFrame("pet")end + func = function()local U = SVUI_Pet;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("pet")end }, miscGroup = { order = 2, @@ -88,8 +88,8 @@ SuperVillain.Options.args.SVUnit.args.pet = { order = 4, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], - get = function(l)return SuperVillain.db.SVUnit["pet"]["power"].hideonnpc end, - set = function(l, m)SuperVillain.db.SVUnit["pet"]["power"].hideonnpc = m;MOD:SetUnitFrame("pet")end + get = function(l)return SV.db.SVUnit["pet"]["power"].hideonnpc end, + set = function(l, m)SV.db.SVUnit["pet"]["power"].hideonnpc = m;MOD:SetUnitFrame("pet")end }, threatEnabled = { type = "toggle", @@ -113,7 +113,7 @@ SuperVillain.Options.args.SVUnit.args.pet = { type = "group", guiInline = true, name = L["Aura Watch"], - get = function(l)return SuperVillain.db.SVUnit["pet"]["auraWatch"][l[#l]]end, + get = function(l)return SV.db.SVUnit["pet"]["auraWatch"][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "pet", "auraWatch");MOD:SetUnitFrame("pet")end, args = { enable = { @@ -150,15 +150,15 @@ SuperVillain.Options.args.SVUnit.args.pet = { ################################################################################################## ################################################################################################## ]] -SuperVillain.Options.args.SVUnit.args.pettarget = { +SV.Options.args.SVUnit.args.pettarget = { name = L["PetTarget Frame"], type = "group", order = 5, childGroups = "tab", - get = function(l)return SuperVillain.db.SVUnit["pettarget"][l[#l]]end, + get = function(l)return SV.db.SVUnit["pettarget"][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "pettarget");MOD:SetUnitFrame("pettarget")end, args = { enable = {type = "toggle", order = 1, name = L["Enable"]}, - resetSettings = {type = "execute", order = 2, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("pettarget")SuperVillain:ResetMovables("PetTarget Frame")end}, + resetSettings = {type = "execute", order = 2, name = L["Restore Defaults"], func = function(l, m)MOD:ResetUnitOptions("pettarget")SV:ResetMovables("PetTarget Frame")end}, tabGroups = { order = 3, type = "group", @@ -174,7 +174,7 @@ SuperVillain.Options.args.SVUnit.args.pettarget = { order = 3, type = "execute", name = L["Show Auras"], - func = function()local U = SVUI_PetTarget;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end;MOD:SetUnitFrame("pettarget")end + func = function()local U = SVUI_PetTarget;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("pettarget")end }, width = {order = 4, name = L["Width"], type = "range", min = 50, max = 500, step = 1}, height = {order = 5, name = L["Height"], type = "range", min = 10, max = 250, step = 1}, @@ -184,8 +184,8 @@ SuperVillain.Options.args.SVUnit.args.pettarget = { order = 7, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], - get = function(l)return SuperVillain.db.SVUnit["pettarget"]["power"].hideonnpc end, - set = function(l, m)SuperVillain.db.SVUnit["pettarget"]["power"].hideonnpc = m;MOD:SetUnitFrame("pettarget")end + get = function(l)return SV.db.SVUnit["pettarget"]["power"].hideonnpc end, + set = function(l, m)SV.db.SVUnit["pettarget"]["power"].hideonnpc = m;MOD:SetUnitFrame("pettarget")end }, threatEnabled = {type = "toggle", order = 13, name = L["Show Threat"]} } @@ -199,7 +199,7 @@ SuperVillain.Options.args.SVUnit.args.pettarget = { order = 1, type = "execute", name = L["Show Auras"], - func = function()local U = SVUI_PetTarget;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end;MOD:SetUnitFrame("pettarget")end + func = function()local U = SVUI_PetTarget;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("pettarget")end }, miscGroup = { order = 2, @@ -218,8 +218,8 @@ SuperVillain.Options.args.SVUnit.args.pettarget = { order = 4, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], - get = function(l)return SuperVillain.db.SVUnit["pettarget"]["power"].hideonnpc end, - set = function(l, m)SuperVillain.db.SVUnit["pettarget"]["power"].hideonnpc = m;MOD:SetUnitFrame("pettarget")end + get = function(l)return SV.db.SVUnit["pettarget"]["power"].hideonnpc end, + set = function(l, m)SV.db.SVUnit["pettarget"]["power"].hideonnpc = m;MOD:SetUnitFrame("pettarget")end }, threatEnabled = { type = "toggle", diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/player.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/player.lua index aec9694..884c2a9 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/player.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/player.lua @@ -29,21 +29,21 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(SVUI); +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ... --[[ ################################################################################################## ################################################################################################## ################################################################################################## ]] -SuperVillain.Options.args.SVUnit.args.player={ +SV.Options.args.SVUnit.args.player={ name = L['Player Frame'], type = 'group', order = 3, childGroups = "tab", - get = function(l)return SuperVillain.db.SVUnit['player'][l[#l]]end, + get = function(l)return SV.db.SVUnit['player'][l[#l]]end, set = function(l,m)MOD:ChangeDBVar(m, l[#l], "player");MOD:SetUnitFrame('player')end, args = { enable = { @@ -57,7 +57,7 @@ SuperVillain.Options.args.SVUnit.args.player={ name = L['Restore Defaults'], func = function(l,m) MOD:ResetUnitOptions('player') - SuperVillain:ResetMovables('Player Frame') + SV:ResetMovables('Player Frame') end }, tabGroups = { @@ -81,7 +81,7 @@ SuperVillain.Options.args.SVUnit.args.player={ order = 1, type = "execute", name = L["Show Auras"], - func = function()local U = SVUI_Player;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end;MOD:SetUnitFrame("player")end + func = function()local U = SVUI_Player;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("player")end }, lowmana = { order = 2, @@ -118,8 +118,8 @@ SuperVillain.Options.args.SVUnit.args.player={ order = 5, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], - get = function(l)return SuperVillain.db.SVUnit["player"]["power"].hideonnpc end, - set = function(l, m)SuperVillain.db.SVUnit["player"]["power"].hideonnpc = m;MOD:SetUnitFrame("player")end + get = function(l)return SV.db.SVUnit["player"]["power"].hideonnpc end, + set = function(l, m)SV.db.SVUnit["player"]["power"].hideonnpc = m;MOD:SetUnitFrame("player")end }, threatEnabled = { type = "toggle", @@ -131,14 +131,14 @@ SuperVillain.Options.args.SVUnit.args.player={ name = "Playerframe Experience Bar", desc = "Show player experience on power bar mouseover", type = "toggle", - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "player");SuperVillain:StaticPopup_Show("RL_CLIENT")end + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "player");SV:StaticPopup_Show("RL_CLIENT")end }, playerRepBar = { order = 8, name = "Playerframe Reputation Bar", desc = "Show player reputations on power bar mouseover", type = "toggle", - set = function(l, m)MOD:ChangeDBVar(m, l[#l], "player");SuperVillain:StaticPopup_Show("RL_CLIENT")end + set = function(l, m)MOD:ChangeDBVar(m, l[#l], "player");SV:StaticPopup_Show("RL_CLIENT")end } } }, @@ -157,9 +157,9 @@ SuperVillain.Options.args.SVUnit.args.player={ max = 500, step = 1, set = function(l, m) - if SuperVillain.db.SVUnit["player"].castbar.width == SuperVillain.db.SVUnit["player"][l[#l]] then - SuperVillain.db.SVUnit["player"].castbar.width = m - end; + if SV.db.SVUnit["player"].castbar.width == SV.db.SVUnit["player"][l[#l]] then + SV.db.SVUnit["player"].castbar.width = m + end MOD:ChangeDBVar(m, l[#l], "player"); MOD:SetUnitFrame("player") end @@ -180,7 +180,7 @@ SuperVillain.Options.args.SVUnit.args.player={ type = "group", guiInline = true, name = PVP, - get = function(l)return SuperVillain.db.SVUnit["player"]["pvp"][l[#l]]end, + get = function(l)return SV.db.SVUnit["player"]["pvp"][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "player", "pvp");MOD:SetUnitFrame("player")end, args = { position = { @@ -224,7 +224,7 @@ SuperVillain.Options.args.SVUnit.args.player={ order = 1000, type = "group", name = L["Classbar"], - get = function(l)return SuperVillain.db.SVUnit["player"]["classbar"][l[#l]]end, + get = function(l)return SV.db.SVUnit["player"]["classbar"][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "player", "classbar");MOD:SetUnitFrame("player")end, args = { enable = { @@ -252,9 +252,9 @@ SuperVillain.Options.args.SVUnit.args.player={ type = "toggle", order = 3, name = L["Stagger Bar"], - get = function(l)return SuperVillain.db.SVUnit["player"]["stagger"].enable end, + get = function(l)return SV.db.SVUnit["player"]["stagger"].enable end, set = function(l, m)MOD:ChangeDBVar(m, "enable", "player", "stagger");MOD:SetUnitFrame("player")end, - disabled = SuperVillain.class ~= "MONK", + disabled = SV.class ~= "MONK", }, druidMana = { type = "toggle", @@ -262,13 +262,13 @@ SuperVillain.Options.args.SVUnit.args.player={ name = L["Druid Mana"], desc = L["Display druid mana bar when in cat or bear form and when mana is not 100%."], get = function(key) - return SuperVillain.db.SVUnit["player"]["power"].druidMana + return SV.db.SVUnit["player"]["power"].druidMana end, set = function(key, value) MOD:ChangeDBVar(value, "druidMana", "player", "power"); MOD:SetUnitFrame("player") end, - disabled = SuperVillain.class ~= "DRUID", + disabled = SV.class ~= "DRUID", } } }, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/raid.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/raid.lua index 0909417..a7f85ca 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/raid.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/raid.lua @@ -29,20 +29,20 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(SVUI); +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ... local subOrder = 11; for w=10,40,15 do subOrder = subOrder + 1 - SuperVillain.Options.args.SVUnit.args["raid" .. w] = { + SV.Options.args.SVUnit.args["raid" .. w] = { name = L["Raid-" .. w .. " Frames"], type = "group", order = subOrder, childGroups = "tab", - get = function(l) return SuperVillain.db.SVUnit["raid" .. w][l[#l]] end, + get = function(l) return SV.db.SVUnit["raid" .. w][l[#l]] end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "raid" .. w);MOD:SetGroupFrame("raid" .. w)end, args = { enable = @@ -61,7 +61,7 @@ for w=10,40,15 do type = "execute", order = 3, name = L["Restore Defaults"], - func = function(l, m)MOD:ResetUnitOptions("raid" .. w)SuperVillain:ResetMovables("Raid 1-" .. w .. " Frames")end, + func = function(l, m)MOD:ResetUnitOptions("raid" .. w)SV:ResetMovables("Raid 1-" .. w .. " Frames")end, }, tabGroups = { order = 3, @@ -74,48 +74,40 @@ for w=10,40,15 do type = "group", name = L["General Settings"], args = { - gridAllowed = { - type = 'toggle', - order = 1, - name = L['Grid Mode Allowed'], - desc = L['If grid-mode is enabled, these units will be changed.'], - get = function(l)return SuperVillain.db.SVUnit["raid" .. w].gridAllowed end, - set = function(l, m) SuperVillain.db.SVUnit["raid" .. w].gridAllowed = m; MOD:SetGroupFrame("raid" .. w) end, - }, hideonnpc = { type = "toggle", - order = 2, + order = 1, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], - get = function(l)return SuperVillain.db.SVUnit["raid" .. w]["power"].hideonnpc end, - set = function(l, m)SuperVillain.db.SVUnit["raid" .. w]["power"].hideonnpc = m;MOD:SetGroupFrame("raid" .. w)end, + get = function(l)return SV.db.SVUnit["raid" .. w]["power"].hideonnpc end, + set = function(l, m)SV.db.SVUnit["raid" .. w]["power"].hideonnpc = m;MOD:SetGroupFrame("raid" .. w)end, }, rangeCheck = { - order = 3, + order = 2, name = L["Range Check"], desc = L["Check if you are in range to cast spells on this specific unit."], type = "toggle", }, gps = { - order = 4, + order = 3, name = "GPS Tracking", desc = "Show an arrow giving the direction and distance to the frames unit.", type = "toggle", }, predict = { - order = 5, + order = 4, name = L["Heal Prediction"], desc = L["Show a incomming heal prediction bar on the unitframe. Also display a slightly different colored bar for incoming overheals."], type = "toggle", }, threatEnabled = { type = "toggle", - order = 6, + order = 5, name = L["Show Threat"], }, colorOverride = { - order = 7, + order = 6, name = L["Class Color Override"], desc = L["Override the default class color setting."], type = "select", @@ -316,7 +308,7 @@ for w=10,40,15 do order = 5, name = L["Invert Grouping Order"], desc = L["Enabling this inverts the grouping order when the raid is not full, this will reverse the direction it starts from."], - disabled = function()return not SuperVillain.db.SVUnit["raid" .. w].customSorting end, + disabled = function()return not SV.db.SVUnit["raid" .. w].customSorting end, type = "toggle", }, startFromCenter = @@ -324,7 +316,7 @@ for w=10,40,15 do order = 6, name = L["Start Near Center"], desc = L["The initial group will start near the center and grow out."], - disabled = function()return not SuperVillain.db.SVUnit["raid" .. w].customSorting end, + disabled = function()return not SV.db.SVUnit["raid" .. w].customSorting end, type = "toggle", }, }, @@ -346,7 +338,7 @@ for w=10,40,15 do type = "toggle", name = L["Enable"], order = 1, - get = function(l)return SuperVillain.db.SVUnit["raid" .. w].auraWatch.enable end, + get = function(l)return SV.db.SVUnit["raid" .. w].auraWatch.enable end, set = function(l, m)MOD:ChangeDBVar(m, "enable", "raid" .. w, "auraWatch");MOD:SetGroupFrame("raid" .. w)end, }, size = { @@ -357,7 +349,7 @@ for w=10,40,15 do min = 4, max = 15, step = 1, - get = function(l)return SuperVillain.db.SVUnit["raid" .. w].auraWatch.size end, + get = function(l)return SV.db.SVUnit["raid" .. w].auraWatch.size end, set = function(l, m)MOD:ChangeDBVar(m, "size", "raid" .. w, "auraWatch");MOD:SetGroupFrame("raid" .. w)end, }, configureButton = { @@ -374,7 +366,7 @@ for w=10,40,15 do type = "group", name = L["RaidDebuff Indicator"], get = function(l)return - SuperVillain.db.SVUnit["raid" .. w]["rdebuffs"][l[#l]]end, + SV.db.SVUnit["raid" .. w]["rdebuffs"][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "raid" .. w, "rdebuffs");MOD:SetGroupFrame("raid" .. w)end, args = { enable = { @@ -430,13 +422,13 @@ for w=10,40,15 do end subOrder = subOrder + 1 -SuperVillain.Options.args.SVUnit.args.raidpet ={ +SV.Options.args.SVUnit.args.raidpet ={ order = subOrder, type = 'group', name = L['Raid Pet Frames'], childGroups = "tab", get = function(l)return - SuperVillain.db.SVUnit['raidpet'][l[#l]]end, + SV.db.SVUnit['raidpet'][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "raidpet");MOD:SetGroupFrame('raidpet')end, args ={ enable ={ @@ -454,7 +446,7 @@ SuperVillain.Options.args.SVUnit.args.raidpet ={ type = 'execute', order = 3, name = L['Restore Defaults'], - func = function(l, m)MOD:ResetUnitOptions('raidpet')SuperVillain:ResetMovables('Raid Pet Frames')MOD:SetGroupFrame('raidpet', nil, nil, true)end, + func = function(l, m)MOD:ResetUnitOptions('raidpet')SV:ResetMovables('Raid Pet Frames')MOD:SetGroupFrame('raidpet', nil, nil, true)end, }, tabGroups={ order=3, @@ -467,14 +459,6 @@ SuperVillain.Options.args.SVUnit.args.raidpet ={ type='group', name=L['General Settings'], args={ - gridAllowed = { - type = 'toggle', - order = 1, - name = L['Grid Mode Allowed'], - desc = L['If grid-mode is enabled, these units will be changed.'], - get = function(l)return SuperVillain.db.SVUnit["raidpet"].gridAllowed end, - set = function(l, m) SuperVillain.db.SVUnit["raidpet"].gridAllowed = m; MOD:SetGroupFrame("raidpet") end, - }, rangeCheck ={ order = 3, name = L["Range Check"], @@ -649,14 +633,14 @@ SuperVillain.Options.args.SVUnit.args.raidpet ={ order = 5, name = L['Invert Grouping Order'], desc = L['Enabling this inverts the grouping order when the raid is not full, this will reverse the direction it starts from.'], - disabled = function()return not SuperVillain.db.SVUnit['raidpet'].customSorting end, + disabled = function()return not SV.db.SVUnit['raidpet'].customSorting end, type = 'toggle', }, startFromCenter ={ order = 6, name = L['Start Near Center'], desc = L['The initial group will start near the center and grow out.'], - disabled = function()return not SuperVillain.db.SVUnit['raidpet'].customSorting end, + disabled = function()return not SV.db.SVUnit['raidpet'].customSorting end, type = 'toggle', }, }, @@ -677,7 +661,7 @@ SuperVillain.Options.args.SVUnit.args.raidpet ={ type = "toggle", name = L["Enable"], order = 1, - get = function(l)return SuperVillain.db.SVUnit["raid" .. w].auraWatch.enable end, + get = function(l)return SV.db.SVUnit["raid" .. w].auraWatch.enable end, set = function(l, m)MOD:ChangeDBVar(m, "enable", "raid" .. w, "auraWatch");MOD:SetGroupFrame("raid" .. w)end, }, size = { @@ -688,7 +672,7 @@ SuperVillain.Options.args.SVUnit.args.raidpet ={ min = 4, max = 15, step = 1, - get = function(l)return SuperVillain.db.SVUnit["raid" .. w].auraWatch.size end, + get = function(l)return SV.db.SVUnit["raid" .. w].auraWatch.size end, set = function(l, m)MOD:ChangeDBVar(m, "size", "raid" .. w, "auraWatch");MOD:SetGroupFrame("raid" .. w)end, }, configureButton ={ @@ -704,7 +688,7 @@ SuperVillain.Options.args.SVUnit.args.raidpet ={ type = 'group', name = L['RaidDebuff Indicator'], get = function(l)return - SuperVillain.db.SVUnit['raidpet']['rdebuffs'][l[#l]]end, + SV.db.SVUnit['raidpet']['rdebuffs'][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "raidpet", "rdebuffs");MOD:SetGroupFrame('raidpet')end, args ={ enable ={ diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/target.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/target.lua index 417d94e..350ca1f 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/target.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/target.lua @@ -29,25 +29,25 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); -local MOD = SuperVillain.SVUnit -if(not MOD) then return end; +local SV, L = unpack(SVUI); +local MOD = SV.SVUnit +if(not MOD) then return end local _, ns = ... --[[ ################################################################################################## ################################################################################################## ################################################################################################## ]] -SuperVillain.Options.args.SVUnit.args.target={ - name=L['Target Frame'], - type='group', - order=6, - childGroups="tab", - get=function(l)return SuperVillain.db.SVUnit['target'][l[#l]]end, +SV.Options.args.SVUnit.args.target={ + name = L['Target Frame'], + type = 'group', + order = 6, + childGroups = "tab", + get=function(l)return SV.db.SVUnit['target'][l[#l]]end, set=function(l,m)MOD:ChangeDBVar(m, l[#l], "target");MOD:SetUnitFrame('target')end, args={ enable={type='toggle',order=1,name=L['Enable']}, - resetSettings={type='execute',order=2,name=L['Restore Defaults'],func=function(l,m)MOD:ResetUnitOptions('target')SuperVillain:ResetMovables('Target Frame')end}, + resetSettings={type='execute',order=2,name=L['Restore Defaults'],func=function(l,m)MOD:ResetUnitOptions('target')SV:ResetMovables('Target Frame')end}, tabGroups={ order=3, type='group', @@ -69,7 +69,7 @@ SuperVillain.Options.args.SVUnit.args.target={ order = 1, type = "execute", name = L["Show Auras"], - func = function()local U = SVUI_Target;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end;MOD:SetUnitFrame("target")end + func = function()local U = SVUI_Target;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("target")end }, smartAuraDisplay = { type = "select", @@ -99,8 +99,8 @@ SuperVillain.Options.args.SVUnit.args.target={ order = 5, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], - get = function(l)return SuperVillain.db.SVUnit["target"]["power"].hideonnpc end, - set = function(l, m)SuperVillain.db.SVUnit["target"]["power"].hideonnpc = m;MOD:SetUnitFrame("target")end + get = function(l)return SV.db.SVUnit["target"]["power"].hideonnpc end, + set = function(l, m)SV.db.SVUnit["target"]["power"].hideonnpc = m;MOD:SetUnitFrame("target")end }, threatEnabled = { type = "toggle", @@ -132,9 +132,9 @@ SuperVillain.Options.args.SVUnit.args.target={ max = 500, step = 1, set = function(l, m) - if SuperVillain.db.SVUnit["target"].castbar.width == SuperVillain.db.SVUnit["target"][l[#l]] then - SuperVillain.db.SVUnit["target"].castbar.width = m - end; + if SV.db.SVUnit["target"].castbar.width == SV.db.SVUnit["target"][l[#l]] then + SV.db.SVUnit["target"].castbar.width = m + end MOD:ChangeDBVar(m, l[#l], "target"); MOD:SetUnitFrame("target") end @@ -156,7 +156,7 @@ SuperVillain.Options.args.SVUnit.args.target={ order = 800, type = "group", name = L["Combobar"], - get = function(l)return SuperVillain.db.SVUnit["target"]["combobar"][l[#l]]end, + get = function(l)return SV.db.SVUnit["target"]["combobar"][l[#l]]end, set = function(l, m)MOD:ChangeDBVar(m, l[#l], "target", "combobar");MOD:SetUnitFrame("target")end, args = { enable = { @@ -203,16 +203,16 @@ SuperVillain.Options.args.SVUnit.args.target={ ################################################################################################## ################################################################################################## ]] -SuperVillain.Options.args.SVUnit.args.targettarget={ +SV.Options.args.SVUnit.args.targettarget={ name=L['TargetTarget Frame'], type='group', order=7, childGroups="tab", - get=function(l)return SuperVillain.db.SVUnit['targettarget'][l[#l]]end, + get=function(l)return SV.db.SVUnit['targettarget'][l[#l]]end, set=function(l,m)MOD:ChangeDBVar(m, l[#l], "targettarget");MOD:SetUnitFrame('targettarget')end, args={ enable={type='toggle',order=1,name=L['Enable']}, - resetSettings={type='execute',order=2,name=L['Restore Defaults'],func=function(l,m)MOD:ResetUnitOptions('targettarget')SuperVillain:ResetMovables('TargetTarget Frame')end}, + resetSettings={type='execute',order=2,name=L['Restore Defaults'],func=function(l,m)MOD:ResetUnitOptions('targettarget')SV:ResetMovables('TargetTarget Frame')end}, tabGroups={ order=3, type='group', @@ -234,7 +234,7 @@ SuperVillain.Options.args.SVUnit.args.targettarget={ order = 1, type = "execute", name = L["Show Auras"], - func = function()local U = SVUI_TargetTarget;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end;MOD:SetUnitFrame("targettarget")end + func = function()local U = SVUI_TargetTarget;if U.forceShowAuras then U.forceShowAuras = nil else U.forceShowAuras = true end MOD:SetUnitFrame("targettarget")end }, spacer1 = { order = 2, @@ -252,8 +252,8 @@ SuperVillain.Options.args.SVUnit.args.targettarget={ order = 4, name = L["Text Toggle On NPC"], desc = L["Power text will be hidden on NPC targets, in addition the name text will be repositioned to the power texts anchor point."], - get = function(l)return SuperVillain.db.SVUnit["target"]["power"].hideonnpc end, - set = function(l, m)SuperVillain.db.SVUnit["target"]["power"].hideonnpc = m;MOD:SetUnitFrame("target")end + get = function(l)return SV.db.SVUnit["target"]["power"].hideonnpc end, + set = function(l, m)SV.db.SVUnit["target"]["power"].hideonnpc = m;MOD:SetUnitFrame("target")end }, threatEnabled = { type = "toggle", diff --git a/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.lua b/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.lua index eed7439..e1b343e 100644 --- a/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.lua +++ b/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.lua @@ -33,15 +33,15 @@ GET ADDON DATA ########################################################## ]]-- local SVUIAddOnName, PLUGIN = ...; -local SuperVillain, L = unpack(SVUI); -local CONFIGS = SuperVillain.Configs +local SV, L, Registry = unpack(SVUI); +local CONFIGS = SV.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 = SV:Prototype(SVUIAddOnName) +local SCHEMA = PLUGIN.___schema; _G["LaborVillain"] = PLUGIN; --[[ @@ -49,25 +49,25 @@ _G["LaborVillain"] = PLUGIN; GLOBAL BINDINGS ########################################################## ]]-- -BINDING_HEADER_SVUILABORER = "SuperVillain UI: Laborer"; +BINDING_HEADER_SVUILABORER = "Supervillain UI: Laborer"; function SVUIFishingMode() - if InCombatLockdown() then SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); return; end + if InCombatLockdown() then SV:AddonMessage(ERR_NOT_IN_COMBAT); return; end if PLUGIN.CurrentMode and PLUGIN.CurrentMode == "Fishing" then PLUGIN:EndJobModes() else PLUGIN:SetJobMode("Fishing") end end function SVUIFarmingMode() - if InCombatLockdown() then SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); return; end - if PLUGIN.CurrentMode and SuperVillain.CurrentMode == "Farming" then PLUGIN:EndJobModes() else PLUGIN:SetJobMode("Farming") end + if InCombatLockdown() then SV:AddonMessage(ERR_NOT_IN_COMBAT); return; end + if PLUGIN.CurrentMode and SV.CurrentMode == "Farming" then PLUGIN:EndJobModes() else PLUGIN:SetJobMode("Farming") end end function SVUIArchaeologyMode() - if InCombatLockdown() then SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); return; end + if InCombatLockdown() then SV:AddonMessage(ERR_NOT_IN_COMBAT); return; end if PLUGIN.CurrentMode and PLUGIN.CurrentMode == "Archaeology" then PLUGIN:EndJobModes() else PLUGIN:SetJobMode("Archaeology") end end function SVUICookingMode() - if InCombatLockdown() then SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); return; end + if InCombatLockdown() then SV:AddonMessage(ERR_NOT_IN_COMBAT); return; end if PLUGIN.CurrentMode and PLUGIN.CurrentMode == "Cooking" then PLUGIN:EndJobModes() else PLUGIN:SetJobMode("Cooking") end end --[[ @@ -87,7 +87,7 @@ LOCAL VARS ]]-- local currentModeKey = false; local ModeLogsFrame = CreateFrame("Frame", "SVUI_ModeLogsFrame", UIParent) -local classColors = SVUI_CLASS_COLORS[SuperVillain.class] +local classColors = SVUI_CLASS_COLORS[SV.class] local classR, classG, classB = classColors.r, classColors.g, classColors.b local classA = 0.35 local lastClickTime; @@ -102,9 +102,9 @@ LOCAL FUNCTIONS ########################################################## ]]-- local function SendModeMessage(...) - if not CombatText_AddMessage then return end; + if not CombatText_AddMessage then return end CombatText_AddMessage(...) -end; +end local function onMouseWheel(self, delta) if (delta > 0) then @@ -112,7 +112,7 @@ local function onMouseWheel(self, delta) elseif (delta < 0) then self:ScrollDown() end -end; +end local function CheckForDoubleClick() if lastClickTime then @@ -173,7 +173,7 @@ function PLUGIN:ModeLootLoader(mode, msg, info) self.LogWindow:AddMessage("|cff55FF55"..data.amount.." x|r |T".. data.texture ..":16:16:0:0:64:64:4:60:4:60|t".." "..name, 0.8, 0.8, 0.8); previous = true end - end; + end if(previous) then self.LogWindow:AddMessage("----------------", 0, 0, 0); self.LogWindow:AddMessage(" ", 0, 0, 0); @@ -183,19 +183,19 @@ function PLUGIN:ModeLootLoader(mode, msg, info) end else self:LaborerReset() - end; + end end function PLUGIN:CheckForModeLoot(msg) - local item, amt = SuperVillain:DeFormat(msg, LOOT_ITEM_CREATED_SELF) + local item, amt = SV:DeFormat(msg, LOOT_ITEM_CREATED_SELF) if not item then - item = SuperVillain:DeFormat(msg, LOOT_ITEM_SELF_MULTIPLE) + item = SV:DeFormat(msg, LOOT_ITEM_SELF_MULTIPLE) if not item then - item = SuperVillain:DeFormat(msg, LOOT_ITEM_SELF) + item = SV:DeFormat(msg, LOOT_ITEM_SELF) if not item then - item = SuperVillain:DeFormat(msg, LOOT_ITEM_PUSHED_SELF_MULTIPLE) + item = SV:DeFormat(msg, LOOT_ITEM_PUSHED_SELF_MULTIPLE) if not item then - item, amt = SuperVillain:DeFormat(msg, LOOT_ITEM_PUSHED_SELF) + item, amt = SV:DeFormat(msg, LOOT_ITEM_PUSHED_SELF) --print(item) end end @@ -208,14 +208,14 @@ function PLUGIN:CheckForModeLoot(msg) end return item, amt end -end; +end function PLUGIN:SetJobMode(category) if InCombatLockdown() then return end if(not category) then self:EndJobModes() return; - end; + end self:ChangeModeGear() if(currentModeKey and self[currentModeKey] and self[currentModeKey].Disable) then self[currentModeKey].Disable() @@ -270,7 +270,7 @@ function PLUGIN:ChangeModeGear() end function PLUGIN:UpdateLogWindow() - self.LogWindow:SetFont(SuperVillain.Media.font.system, self.db.fontSize, "OUTLINE") + self.LogWindow:SetFont(SV.Media.font.system, self.db.fontSize, "OUTLINE") end function PLUGIN:MakeLogWindow() @@ -312,7 +312,7 @@ function PLUGIN:MakeLogWindow() log:SetFrameStrata("MEDIUM") log:SetPoint("TOPLEFT",title,"BOTTOMLEFT",0,0) log:SetPoint("BOTTOMRIGHT",ModeLogsFrame,"BOTTOMRIGHT",0,0) - log:SetFont(SuperVillain.Media.font.system, self.db.fontSize, "OUTLINE") + log:SetFontTemplate(nil, self.db.fontSize, "OUTLINE") log:SetJustifyH("CENTER") log:SetJustifyV("MIDDLE") log:SetShadowColor(0, 0, 0, 0) @@ -332,7 +332,7 @@ function PLUGIN:MakeLogWindow() self.LogWindow = log self.ListenerEnabled = false; - SuperVillain:RegisterDocklet("SVUI_ModesDockFrame", "Laborer Modes", ICON_FILE, false) + SV:RegisterDocklet("SVUI_ModesDockFrame", "Laborer Modes", ICON_FILE, false) self:LaborerReset() end @@ -361,13 +361,13 @@ end local ModeAlert_OnLeave = function(self) GameTooltip:Hide() - if InCombatLockdown() then return end; + if InCombatLockdown() then return end self:SetBackdropColor(0.25, 0.52, 0.1) end local ModeAlert_OnHide = function() if InCombatLockdown() then - SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); + SV:AddonMessage(ERR_NOT_IN_COMBAT); return; end SuperDockAlertRight:Deactivate() @@ -375,23 +375,23 @@ end local ModeAlert_OnShow = function(self) if InCombatLockdown() then - SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); + SV:AddonMessage(ERR_NOT_IN_COMBAT); self:Hide() return; end - SuperVillain:SecureFadeIn(self, 0.3, 0, 1) + SV:SecureFadeIn(self, 0.3, 0, 1) SuperDockAlertRight:Activate(self) end local ModeAlert_OnMouseDown = function(self) PLUGIN:EndJobModes() - SuperVillain:SecureFadeOut(self, 0.5, 1, 0, true) + SV:SecureFadeOut(self, 0.5, 1, 0, true) end local ModeButton_OnEnter = function(self) if InCombatLockdown() then return; end local name = self.modeName - self.icon:SetGradient(unpack(SuperVillain.Media.gradient.yellow)) + self.icon:SetGradient(unpack(SV.Media.gradient.yellow)) GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) GameTooltip:ClearLines() GameTooltip:AddLine(L[name .. " Mode"], 1, 1, 1) @@ -413,140 +413,13 @@ end BUILD FUNCTION ########################################################## ]]-- -local function LoadOptions() - SuperVillain.Options.args.plugins.args.pluginOptions.args.SVLaborer = { - type = 'group', - name = L['Laborer'], - get = function(key)return SuperVillain.db.SVLaborer[key[#key]]end, - set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key]) end, - args = { - intro = { - order = 1, - type = 'description', - name = L["Options for laborer modes"] - }, - enable = { - type = "toggle", - 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 - }, - fontSize = { - order = 3, - name = L["Font Size"], - desc = L["Set the font size of the log window."], - type = "range", - min = 6, - max = 22, - step = 1, - set = function(j,value)PLUGIN:ChangeDBVar(value,j[#j]);PLUGIN:UpdateLogWindow()end - }, - fishing = { - order = 4, - type = "group", - name = L["Fishing Mode Settings"], - guiInline = true, - args = { - autoequip = { - type = "toggle", - order = 1, - name = L['AutoEquip'], - desc = L['Enable/Disable automatically equipping fishing gear.'], - get = function(key)return SuperVillain.db.SVLaborer.fishing[key[#key]]end, - set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key], "fishing")end - } - } - }, - cooking = { - order = 5, - type = "group", - name = L["Cooking Mode Settings"], - guiInline = true, - args = { - autoequip = { - type = "toggle", - order = 1, - name = L['AutoEquip'], - desc = L['Enable/Disable automatically equipping cooking gear.'], - get = function(key)return SuperVillain.db.SVLaborer.cooking[key[#key]]end, - set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key], "cooking")end - } - } - }, - farming = { - order = 6, - 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, - args = { - buttonsize = { - type = 'range', - name = L['Button Size'], - desc = L['The size of the action buttons.'], - min = 15, - max = 60, - step = 1, - order = 1, - set = function(key, value) - PLUGIN:ChangeDBVar(value, key[#key],"farming"); - PLUGIN:RefreshFarmingTools() - end, - }, - buttonspacing = { - type = 'range', - name = L['Button Spacing'], - desc = L['The spacing between buttons.'], - min = 1, - max = 10, - step = 1, - order = 2, - set = function(key, value) - PLUGIN:ChangeDBVar(value, key[#key],"farming"); - PLUGIN:RefreshFarmingTools() - end, - }, - onlyactive = { - order = 3, - type = 'toggle', - name = L['Only active buttons'], - desc = L['Only show the buttons for the seeds, portals, tools you have in your bags.'], - set = function(key, value) - PLUGIN:ChangeDBVar(value, key[#key],"farming"); - PLUGIN:RefreshFarmingTools() - end, - }, - droptools = { - order = 4, - type = 'toggle', - name = L['Drop '], - desc = L['Automatically drop tools from your bags when leaving the farming area.'], - }, - toolbardirection = { - order = 5, - type = 'select', - name = L['Bar Direction'], - desc = L['The direction of the bar buttons (Horizontal or Vertical).'], - set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key],"farming"); PLUGIN:RefreshFarmingTools() end, - values = { - ['VERTICAL'] = L['Vertical'], ['HORIZONTAL'] = L['Horizontal'] - } - } - } - } - } - } -end +function PLUGIN:Load() + if(not SV.db[SCHEMA].enable) then return end -function LoadLaborVillain() - if(not SuperVillain.db.SVLaborer.enable) then return end - PLUGIN.db = SuperVillain.db.SVLaborer + self.db = SV.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 +517,129 @@ 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") + + local option = { + order = 2, + name = L["Font Size"], + desc = L["Set the font size of the log window."], + type = "range", + min = 6, + max = 22, + step = 1, + set = function(j,value)PLUGIN:ChangeDBVar(value,j[#j]);PLUGIN:UpdateLogWindow()end + } + self:AddOption("fontSize", option) + option = { + order = 3, + type = "group", + name = L["Fishing Mode Settings"], + guiInline = true, + args = { + autoequip = { + type = "toggle", + order = 1, + name = L['AutoEquip'], + desc = L['Enable/Disable automatically equipping fishing gear.'], + get = function(key)return SV.db[SCHEMA].fishing[key[#key]]end, + set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key], "fishing")end + } + } + } + self:AddOption("fishing", option) + option = { + order = 4, + type = "group", + name = L["Cooking Mode Settings"], + guiInline = true, + args = { + autoequip = { + type = "toggle", + order = 1, + name = L['AutoEquip'], + desc = L['Enable/Disable automatically equipping cooking gear.'], + get = function(key)return SV.db[SCHEMA].cooking[key[#key]]end, + set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key], "cooking")end + } + } + } + self:AddOption("cooking", option) + option = { + order = 5, + type = "group", + name = L["Farming Mode Settings"], + guiInline = true, + get = function(key)return SV.db[SCHEMA].farming[key[#key]]end, + set = function(key, value)SV.db[SCHEMA].farming[key[#key]] = value end, + args = { + buttonsize = { + type = 'range', + name = L['Button Size'], + desc = L['The size of the action buttons.'], + min = 15, + max = 60, + step = 1, + order = 1, + set = function(key, value) + PLUGIN:ChangeDBVar(value, key[#key],"farming"); + PLUGIN:RefreshFarmingTools() + end, + }, + buttonspacing = { + type = 'range', + name = L['Button Spacing'], + desc = L['The spacing between buttons.'], + min = 1, + max = 10, + step = 1, + order = 2, + set = function(key, value) + PLUGIN:ChangeDBVar(value, key[#key],"farming"); + PLUGIN:RefreshFarmingTools() + end, + }, + onlyactive = { + order = 3, + type = 'toggle', + name = L['Only active buttons'], + desc = L['Only show the buttons for the seeds, portals, tools you have in your bags.'], + set = function(key, value) + PLUGIN:ChangeDBVar(value, key[#key],"farming"); + PLUGIN:RefreshFarmingTools() + end, + }, + droptools = { + order = 4, + type = 'toggle', + name = L['Drop '], + desc = L['Automatically drop tools from your bags when leaving the farming area.'], + }, + toolbardirection = { + order = 5, + type = 'select', + name = L['Bar Direction'], + desc = L['The direction of the bar buttons (Horizontal or Vertical).'], + set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key],"farming"); PLUGIN:RefreshFarmingTools() end, + values = { + ['VERTICAL'] = L['Vertical'], ['HORIZONTAL'] = L['Horizontal'] + } + } + } + } + self:AddOption("farming", option) end -CONFIGS["SVLaborer"] = { +CONFIGS[SCHEMA] = { ["enable"] = true, ["fontSize"] = 12, ["farming"] = { @@ -673,5 +657,4 @@ CONFIGS["SVLaborer"] = { }, } -SuperVillain.Registry:NewScript(LoadLaborVillain) -SuperVillain.Registry:NewPlugin(PLUGIN, "SVLaborer", LoadOptions) \ No newline at end of file +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 f0552a2..e3603d1 100644 --- a/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.toc +++ b/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.toc @@ -1,10 +1,13 @@ ## Interface: 60000 ## Author: Munglunch -## Version: 5.02 +## Version: 4.4 ## Title: |cffFF9900SVUI |r|cffFFEF00Laborer|r ## Notes: Supervillain UI [|cff9911FFProfession Tools|r]. ## SavedVariables: LABOR_Data ## SavedVariablesPerCharacter: LABOR_Cache ## RequiredDeps: SVUI +## LoadOnDemand: 1 +## X-SVUI-Header: Laborer +## X-SVUI-Schema: SVLaborer SVUI_Laborer.xml diff --git a/Interface/AddOns/SVUI_Laborer/modes/archaeology.lua b/Interface/AddOns/SVUI_Laborer/modes/archaeology.lua index ad90bef..478bc0a 100644 --- a/Interface/AddOns/SVUI_Laborer/modes/archaeology.lua +++ b/Interface/AddOns/SVUI_Laborer/modes/archaeology.lua @@ -33,7 +33,7 @@ local min = math.min GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI) +local SV, L = unpack(SVUI) local MOD = _G.LaborVillain --[[ ########################################################## @@ -105,9 +105,9 @@ local function DisableSolve(button) button:SetAlpha(0) button.text:SetTextColor(0.5, 0.5, 0.5) button.text:SetText("") - button:SetScript("OnEnter", SuperVillain.fubar) - button:SetScript("OnLeave", SuperVillain.fubar) - button:SetScript("OnMouseUp", SuperVillain.fubar) + button:SetScript("OnEnter", SV.fubar) + button:SetScript("OnLeave", SV.fubar) + button:SetScript("OnMouseUp", SV.fubar) end local function UpdateArtifactBars(index) @@ -213,21 +213,21 @@ local function GetTitleAndSkill() skillRank = skillRank + skillModifier; end msg = msg .. " (|cff00ddff" .. skillRank .. "|r)"; - end; + end return msg end local function SendModeMessage(...) - if not CombatText_AddMessage then return end; + if not CombatText_AddMessage then return end CombatText_AddMessage(...) -end; +end --[[ ########################################################## EVENT HANDLER ########################################################## ]]-- do - local SURVEYCDFONT = SuperVillain.Media.font.numbers + local SURVEYCDFONT = SV.Media.font.numbers local SURVEYRED = {0,0.5,1} local last = 0 local time = 3 @@ -286,7 +286,7 @@ do UpdateArtifactCache() end end - end; + end local Survey_OnUpdate = function(self, elapsed) last = last + elapsed @@ -301,7 +301,7 @@ do self.text:SetTextColor(SURVEYRED[time],1,0.12,0.8) last = 0 end - end; + end local Survey_OnEvent = function(self, event, unit, _, _, _, spellid) if not unit == "player" then return end @@ -309,7 +309,7 @@ do self.text:SetText("3") self:SetScript("OnUpdate", Survey_OnUpdate) end - end; + end function EnableListener() UpdateArtifactCache() @@ -476,12 +476,12 @@ function MOD:LoadArchaeologyMode() end) -- Race Text - race:SetFont(SuperVillain.Media.font.roboto, 12, "OUTLINE") + race:SetFont(SV.Media.font.roboto, 12, "OUTLINE") race:SetText(RACE) race:SetPoint("LEFT", bar, "LEFT", 2, 0) -- Progress Text - progress:SetFont(SuperVillain.Media.font.roboto, 12, "OUTLINE") + progress:SetFont(SV.Media.font.roboto, 12, "OUTLINE") progress:SetText("") progress:SetPoint("RIGHT", bar, "RIGHT", 1, 0) @@ -490,11 +490,11 @@ function MOD:LoadArchaeologyMode() solve.bg = solve:CreateTexture(nil,"BORDER") solve.bg:SetAllPoints(solve) - solve.bg:SetTexture(SuperVillain.Media.bar.default) + solve.bg:SetTexture(SV.Media.bar.default) solve.bg:SetVertexColor(0.1,0.5,0) solve.text = solve:CreateFontString(nil,"OVERLAY") - solve.text:SetFont(SuperVillain.Media.font.roboto, 14, "NONE") + solve.text:SetFont(SV.Media.font.roboto, 14, "NONE") solve.text:SetShadowOffset(-1,-1) solve.text:SetShadowColor(0,0,0,0.5) solve.text:SetText(SOLVE) diff --git a/Interface/AddOns/SVUI_Laborer/modes/cooking.lua b/Interface/AddOns/SVUI_Laborer/modes/cooking.lua index 51ec82f..ed7e3c0 100644 --- a/Interface/AddOns/SVUI_Laborer/modes/cooking.lua +++ b/Interface/AddOns/SVUI_Laborer/modes/cooking.lua @@ -32,7 +32,7 @@ local floor,ceil = math.floor, math.ceil; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI) +local SV, L = unpack(SVUI) local MOD = _G.LaborVillain --[[ ########################################################## @@ -67,7 +67,7 @@ local function UpdateChefWear() EquipItemByName(86558) MOD.InModeGear = true end -end; +end local function GetTitleAndSkill() local msg = "|cff22ff11Cooking Mode|r" @@ -76,14 +76,14 @@ local function GetTitleAndSkill() skillRank = skillRank + skillModifier; end msg = msg .. " (|cff00ddff" .. skillRank .. "|r)"; - end; + end return msg -end; +end local function SendModeMessage(...) - if not CombatText_AddMessage then return end; + if not CombatText_AddMessage then return end CombatText_AddMessage(...) -end; +end --[[ ########################################################## CORE NAMESPACE @@ -109,7 +109,7 @@ do proxyTest = true; end end - end; + end local Cook_OnEvent = function(self, event, ...) if(InCombatLockdown()) then return end @@ -123,16 +123,16 @@ do local name, lnk, rarity, lvl, mlvl, itype, stype, cnt, ieq, tex, price = GetItemInfo(item); if proxyTest == false then LootProxy(lnk, name) - end; - if proxyTest == false then return end; + end + if proxyTest == false then return end if not MOD.Cooking.Log[name] then MOD.Cooking.Log[name] = {amount = 0, texture = ""}; - end; + end local r, g, b, hex = GetItemQualityColor(rarity); local stored = MOD.Cooking.Log local mod = stored[name]; local newAmt = mod.amount + 1; - if amt >= 2 then newAmt = mod.amount + amt end; + if amt >= 2 then newAmt = mod.amount + amt end MOD.Cooking.Log[name].amount = newAmt; MOD.Cooking.Log[name].texture = tex; MOD.LogWindow:Clear(); @@ -140,14 +140,14 @@ do if type(data) == "table" and data.amount and data.texture then MOD.LogWindow:AddMessage("|cff55FF55"..data.amount.." x|r |T".. data.texture ..":16:16:0:0:64:64:4:60:4:60|t".." "..name, r, g, b); end - end; + end MOD.LogWindow:AddMessage("----------------", 0, 0, 0); MOD.LogWindow:AddMessage("Cooked So Far...", 0, 1, 1); MOD.LogWindow:AddMessage(" ", 0, 0, 0); proxyTest = false; end end - end; + end function EnableListener() CookEventHandler:RegisterEvent("ZONE_CHANGED") @@ -216,7 +216,7 @@ function MOD.Cooking:Update() local _,_,_,_,cook,_ = GetProfessions(); if cook ~= nil then cookingSpell, _, skillRank, _, _, _, _, skillModifier = GetProfessionInfo(cook) - end; + end end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_Laborer/modes/farming.lua b/Interface/AddOns/SVUI_Laborer/modes/farming.lua index 4e4eeed..734bdc3 100644 --- a/Interface/AddOns/SVUI_Laborer/modes/farming.lua +++ b/Interface/AddOns/SVUI_Laborer/modes/farming.lua @@ -32,7 +32,7 @@ local floor,ceil = math.floor, math.ceil; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI) +local SV, L = unpack(SVUI) local MOD = _G.LaborVillain --[[ ########################################################## @@ -60,10 +60,10 @@ local Scroll_OnMouseWheel = function(self, delta) local value = (scroll - (20 * delta)); if value < -1 then value = 0 - end; + end if value > 420 then value = 420 - end; + end self:SetVerticalScroll(value) self.slider:SetValue(value) end @@ -108,7 +108,7 @@ do MOD.TitleWindow:AddMessage("|cffff2211Must be in Sunsong Ranch|r") end return false - end; + end end local UpdateFarmtoolCooldown = function() @@ -157,7 +157,7 @@ do elseif(event == "BAG_UPDATE_COOLDOWN") then UpdateFarmtoolCooldown() end - end; + end InventoryUpdate = function() if InCombatLockdown() then @@ -197,7 +197,7 @@ LOADING HANDLER ########################################################## ]]-- do - local seedsort = function(a, b) return a.sortname < b.sortname end; + local seedsort = function(a, b) return a.sortname < b.sortname end local SeedToSoil = function(group, itemId) if(UnitName("target") ~= L["Tilled Soil"]) then return false; end @@ -205,7 +205,7 @@ do if i == itemId then return true end end return false - end; + end local Button_OnEnter = function(self) GameTooltip:SetOwner(self, 'ANCHOR_TOPLEFT', 2, 4) @@ -215,11 +215,11 @@ do GameTooltip:AddLine(L['Right-click to drop the item.']) end GameTooltip:Show() - end; + end local Button_OnLeave = function() GameTooltip:Hide() - end; + end local Button_OnMouseDown = function(self, mousebutton) if InCombatLockdown() then return end @@ -244,7 +244,7 @@ do DeleteCursorItem() end end - end; + end local function CreateFarmingButton(index, owner, buttonName, buttonType, name, texture, allowDrop, showCount) local BUTTONSIZE = owner.ButtonSize; @@ -264,7 +264,7 @@ do button.icon:FillInner(button,2,2) if showCount then button.text = button:CreateFontString(nil, "OVERLAY") - button.text:SetFont(SuperVillain.Media.font.action, 12, "OUTLINE") + button.text:SetFont(SV.Media.font.action, 12, "OUTLINE") button.text:SetPoint("BOTTOMRIGHT", button, 1, 2) end button.cooldown = CreateFrame("Cooldown", ("FarmingButton"..buttonName.."%dCooldown"):format(index), button) @@ -288,7 +288,7 @@ do end if InCombatLockdown() or itemError then MOD.TitleWindow:AddMessage("|cffffff11Loading Farm Tools...|r|cffff1111PLEASE WAIT|r") - SuperVillain:ExecuteTimer(LoadFarmingModeTools, 5) + SV.Timers:ExecuteTimer(LoadFarmingModeTools, 5) else local horizontal = MOD.db.farming.toolbardirection == 'HORIZONTAL' @@ -335,7 +335,7 @@ do end MOD.Farming.Loaded = true - SuperVillain:ExecuteTimer(MOD.Farming.Enable, 1.5) + SV.Timers:ExecuteTimer(MOD.Farming.Enable, 1.5) end end end @@ -503,7 +503,7 @@ function MOD:PrepareFarmingTools() if not self.db.farming.undocked then local bgTex = [[Interface\BUTTONS\WHITE8X8]] - local bdTex = SuperVillain.Media.bar.glow + local bdTex = SV.Media.bar.glow local farmingDocklet = CreateFrame("ScrollFrame", "FarmModeFrame", ModeLogsFrame); farmingDocklet:SetPoint("TOPLEFT", ModeLogsFrame, 31, -3); farmingDocklet:SetPoint("BOTTOMRIGHT", ModeLogsFrame, -3, 3); @@ -579,8 +579,8 @@ function MOD:PrepareFarmingTools() local BUTTONSIZE = self.db.farming.buttonsize or 35; -- SEEDS - local farmSeedBarAnchor = CreateFrame("Frame", "FarmSeedBarAnchor", SuperVillain.UIParent) - farmSeedBarAnchor:Point("TOPRIGHT", SuperVillain.UIParent, "TOPRIGHT", -40, -300) + local farmSeedBarAnchor = CreateFrame("Frame", "FarmSeedBarAnchor", SV.UIParent) + farmSeedBarAnchor:Point("TOPRIGHT", SV.UIParent, "TOPRIGHT", -40, -300) farmSeedBarAnchor:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 10) or ((BUTTONSIZE + BUTTONSPACE) * 8), horizontal and ((BUTTONSIZE + BUTTONSPACE) * 8) or ((BUTTONSIZE + BUTTONSPACE) * 10)) for i = 1, NUM_SEED_BARS do local seedBar = CreateFrame("Frame", "FarmSeedBar"..i, farmSeedBarAnchor) @@ -588,26 +588,26 @@ function MOD:PrepareFarmingTools() seedBar:SetPoint("TOPRIGHT", _G["FarmSeedBarAnchor"], "TOPRIGHT", (horizontal and 0 or -((BUTTONSIZE + BUTTONSPACE) * i)), (horizontal and -((BUTTONSIZE + BUTTONSPACE) * i) or 0)) seedBar.ButtonSize = BUTTONSIZE; end - SuperVillain:SetSVMovable(farmSeedBarAnchor, "Farming Seeds") + SV:SetSVMovable(farmSeedBarAnchor, "Farming Seeds") -- FARM TOOLS - local farmToolBarAnchor = CreateFrame("Frame", "FarmToolBarAnchor", SuperVillain.UIParent) + local farmToolBarAnchor = CreateFrame("Frame", "FarmToolBarAnchor", SV.UIParent) farmToolBarAnchor:Point("TOPRIGHT", farmSeedBarAnchor, horizontal and "BOTTOMRIGHT" or "TOPLEFT", horizontal and 0 or -(BUTTONSPACE * 2), horizontal and -(BUTTONSPACE * 2) or 0) farmToolBarAnchor:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 4) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 4)) local farmToolBar = CreateFrame("Frame", "FarmToolBar", farmToolBarAnchor) farmToolBar:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 4) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 4)) farmToolBar:SetPoint("TOPRIGHT", farmToolBarAnchor, "TOPRIGHT", (horizontal and -BUTTONSPACE or -(BUTTONSIZE + BUTTONSPACE)), (horizontal and -(BUTTONSIZE + BUTTONSPACE) or -BUTTONSPACE)) farmToolBar.ButtonSize = BUTTONSIZE; - SuperVillain:SetSVMovable(farmToolBarAnchor, "Farming Tools") + SV:SetSVMovable(farmToolBarAnchor, "Farming Tools") -- PORTALS - local farmPortalBarAnchor = CreateFrame("Frame", "FarmPortalBarAnchor", SuperVillain.UIParent) + local farmPortalBarAnchor = CreateFrame("Frame", "FarmPortalBarAnchor", SV.UIParent) farmPortalBarAnchor:Point("TOPRIGHT", farmToolBarAnchor, horizontal and "BOTTOMRIGHT" or "TOPLEFT", horizontal and 0 or -(BUTTONSPACE * 2), horizontal and -(BUTTONSPACE * 2) or 0) farmPortalBarAnchor:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 4) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 4)) local farmPortalBar = CreateFrame("Frame", "FarmPortalBar", farmPortalBarAnchor) farmPortalBar:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 4) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 4)) farmPortalBar:SetPoint("TOPRIGHT", farmPortalBarAnchor, "TOPRIGHT", (horizontal and -BUTTONSPACE or -(BUTTONSIZE + BUTTONSPACE)), (horizontal and -(BUTTONSIZE + BUTTONSPACE) or -BUTTONSPACE)) farmPortalBar.ButtonSize = BUTTONSIZE; - SuperVillain:SetSVMovable(farmPortalBarAnchor, "Farming Portals") + SV:SetSVMovable(farmPortalBarAnchor, "Farming Portals") end end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_Laborer/modes/fishing.lua b/Interface/AddOns/SVUI_Laborer/modes/fishing.lua index e22c264..cf3eaa5 100644 --- a/Interface/AddOns/SVUI_Laborer/modes/fishing.lua +++ b/Interface/AddOns/SVUI_Laborer/modes/fishing.lua @@ -32,7 +32,7 @@ local floor,ceil = math.floor, math.ceil; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI) +local SV, L = unpack(SVUI) local MOD = _G.LaborVillain --[[ ########################################################## @@ -91,9 +91,9 @@ LOCAL FUNCTIONS ########################################################## ]]-- local function SendModeMessage(...) - if not CombatText_AddMessage then return end; + if not CombatText_AddMessage then return end CombatText_AddMessage(...) -end; +end local function GetFishingSkill() local fishing = select(4, GetProfessions()) @@ -102,7 +102,7 @@ local function GetFishingSkill() return rank end return 0, 0, 0 -end; +end local function FishingPoleIsEquipped() local itemId = GetInventoryItemID("player", 16) @@ -205,7 +205,7 @@ local function LootProxy(item, name) proxyTest = true; end end -end; +end local function GetTitleAndSkill() local skillRank, skillModifier; @@ -217,7 +217,7 @@ local function GetTitleAndSkill() skillRank = skillRank + skillModifier; end msg = msg .. " (|cff00ddff" .. skillRank .. "|r)"; - end; + end return msg end --[[ @@ -245,7 +245,7 @@ do proxyTest = true; end end - end; + end local Fish_OnEvent = function(self, event, ...) if(InCombatLockdown()) then return end @@ -265,16 +265,16 @@ do local name, lnk, rarity, lvl, mlvl, itype, stype, cnt, ieq, tex, price = GetItemInfo(item); if proxyTest == false then LootProxy(lnk, name) - end; - if proxyTest == false then return end; + end + if proxyTest == false then return end if not MOD.Fishing.Log[name] then MOD.Fishing.Log[name] = {amount = 0, texture = ""}; - end; + end local r, g, b, hex = GetItemQualityColor(rarity); local stored = MOD.Fishing.Log local mod = stored[name]; local newAmt = mod.amount + 1; - if amt >= 2 then newAmt = mod.amount + amt end; + if amt >= 2 then newAmt = mod.amount + amt end MOD.Fishing.Log[name].amount = newAmt; MOD.Fishing.Log[name].texture = tex; MOD.LogWindow:Clear(); @@ -283,14 +283,14 @@ do if type(data) == "table" and data.amount and data.texture then MOD.LogWindow:AddMessage("|cff55FF55"..data.amount.." x|r |T".. data.texture ..":16:16:0:0:64:64:4:60:4:60|t".." "..name, r, g, b); end - end; + end MOD.LogWindow:AddMessage("----------------", 0, 0, 0); MOD.LogWindow:AddMessage("Caught So Far...", 0, 1, 1); MOD.LogWindow:AddMessage(" ", 0, 0, 0); proxyTest = false; end end - end; + end function EnableListener() FishEventHandler:RegisterEvent("LOOT_OPENED") diff --git a/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua index b2a0e4e..ef130ef 100644 --- a/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua +++ b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua @@ -38,15 +38,14 @@ GET ADDON DATA ########################################################## ]]-- local SVUIAddOnName, PLUGIN = ...; -local SuperVillain, L = unpack(SVUI) +local SV, L, Registry = unpack(SVUI) local NewHook = hooksecurefunc; -local SVUILogEventHandler = CreateFrame("Frame", nil) -local version = GetAddOnMetadata(..., "Version"); -PLUGIN = SuperVillain:Prototype(SVUIAddOnName, version) +PLUGIN = SV:Prototype(SVUIAddOnName) +local SCHEMA = PLUGIN.___schema; _G["LogVillain"] = PLUGIN; -local CHAT = SuperVillain.SVChat; +local CHAT = SV.SVChat; --[[ ########################################################## LOCAL VARIABLES @@ -251,18 +250,18 @@ function CHAT:PLAYER_ENTERING_WORLD() end function PLUGIN:AppendBankFunctions() - local BAGS = SuperVillain.SVBag; + local BAGS = SV.SVBag; if(BAGS.BankFrame) then BAGS.BankFrame.RefreshBagsSlots = RefreshLoggedBagsSlots end end function PLUGIN:AppendChatFunctions() - if SuperVillain.db.SVChat.enable and SuperVillain.db.SVLogs.saveChats then + if SV.db.SVChat.enable and SV.db[SCHEMA].saveChats then for _,event in pairs(LoggingEvents) do - SuperVillain.SVChat:RegisterEvent(event, "LogCurrentChat") + SV.SVChat:RegisterEvent(event, "LogCurrentChat") end - SuperVillain.SVChat:RegisterEvent("PLAYER_ENTERING_WORLD") + SV.SVChat:RegisterEvent("PLAYER_ENTERING_WORLD") end end --[[ @@ -282,35 +281,10 @@ end BUILD FUNCTION ########################################################## ]]-- -local function LoadOptions() - SuperVillain.Options.args.plugins.args.pluginOptions.args.SVLogs = { - type = "group", - name = L["Log O Matic"], - childGroups = "tree", - args = { - enable = { - 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 - }, - 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 - }, - } - } -end - -local function LoadLogOMatic() - if not SuperVillain.db.SVLogs.enable then return end +function PLUGIN:Load() + if not SV.db[SCHEMA].enable then return end - PLUGIN.db = SuperVillain.db.SVLogs + self.db = SV.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 @@ -323,49 +297,58 @@ 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); + NewHook(SV, "ResetAllUI", ResetAllLogs); if not SVLOG_Cache["chat"] then SVLOG_Cache["chat"] = {} end 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 --[[ OVERRIDE DEFAULT FUNCTIONS ]]-- - if SuperVillain.db.SVBag.enable then - local BAGS = SuperVillain.SVBag; + if SV.db.SVBag.enable then + local BAGS = SV.SVBag; if BAGS.BagFrame then BAGS.BagFrame.RefreshBagsSlots = RefreshLoggedBagsSlots; - NewHook(BAGS, "MakeBank", PLUGIN.AppendBankFunctions); + NewHook(BAGS, "MakeBankOrReagent", self.AppendBankFunctions); RefreshLoggedBagsSlots(BAGS.BagFrame) end end - if SuperVillain.db.SVTip.enable then + if SV.db.SVTip.enable then GameTooltip:HookScript("OnTooltipSetItem", GameTooltip_LogTooltipSetItem) end --[[ APPLY HOOKS ]]-- - PLUGIN:AppendChatFunctions() - NewHook(CHAT, "ReLoad", PLUGIN.AppendChatFunctions); + self:AppendChatFunctions() + NewHook(CHAT, "ReLoad", self.AppendChatFunctions) + + local saveChats = { + order = 2, + type = "toggle", + name = L["Save Chats"], + desc = L["Retain chat messages even after logging out."], + get = function(a)return SV.db[SCHEMA].saveChats end, + set = function(a,b) SV.db[SCHEMA].saveChats = b; SV:StaticPopup_Show("RL_CLIENT") end + } + self:AddOption("saveChats", saveChats) end -SuperVillain.Configs["SVLogs"] = { +SV.Configs[SCHEMA] = { ["enable"] = true, ["saveChats"] = false } -SuperVillain.Registry:NewScript(LoadLogOMatic) -SuperVillain.Registry:NewPlugin(PLUGIN, "SVLogs", LoadOptions) \ No newline at end of file +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 025289e..f4f3e83 100644 --- a/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.toc +++ b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.toc @@ -1,10 +1,13 @@ ## Interface: 60000 ## Author: Munglunch -## Version: 5.02 +## Version: 4.4 ## Title: |cffFF9900SVUI |r|cffFFEF00Log O Matic|r ## Notes: Supervillain UI [|cff9911FFData Logging|r]. ## SavedVariables: SVLOG_Data ## SavedVariablesPerCharacter: SVLOG_Cache ## RequiredDeps: SVUI +## LoadOnDemand: 1 +## X-SVUI-Header: Log O Matic +## X-SVUI-Schema: SVLogs SVUI_LogOMatic.lua diff --git a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua index 3925868..46c4143 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua @@ -38,13 +38,13 @@ GET ADDON DATA ########################################################## ]]-- local SVUIAddOnName, PLUGIN = ...; -local SuperVillain, L = unpack(SVUI); -local CONFIGS = SuperVillain.Configs +local SV, L, Registry = unpack(SVUI); +local CONFIGS = SV.Configs local NewHook = hooksecurefunc; -local SVUIAddonEventHandler = CreateFrame("Frame", nil) -local version = GetAddOnMetadata(..., "Version"); -PLUGIN = SuperVillain:Prototype(SVUIAddOnName, version) +PLUGIN = SV: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 SV.db[SCHEMA].addons[a[#a]] end, + set = function(a,b) SV.db[SCHEMA].addons[a[#a]] = b; SV:StaticPopup_Show("RL_CLIENT")end, + disabled = function()return not SV.db[SCHEMA].addons.enable end, guiInline = true, args = { ace3 = { @@ -75,7 +75,7 @@ PLUGIN.OptionsCache = { }, } } -PLUGIN.Debugging = false +PLUGIN.Debugging = true --[[ ########################################################## CORE FUNCTIONS @@ -112,15 +112,15 @@ function PLUGIN:LoadAlert(MainText, Function) end function PLUGIN:Style(style, fn, ...) - -- self.Debugging = false local pass, error = pcall(fn, ...) if(pass and (not style:find("Blizzard")) and not self.StyledAddons[style]) then self.StyledAddons[style] = true 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)) + SV:Debugger(errorMessage:format(VERSION, style, error)) end + --self.Debugging = false end function PLUGIN:IsAddonReady(addon, ...) @@ -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 = SV.db[SCHEMA] or SV.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(SV.Configs[SCHEMA].addons[addon] == nil) then + SV.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,71 @@ 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], "addons"); SV: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(SV.db[SCHEMA].blizzard[name] == nil) then + SV.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 (SV.db[SCHEMA].blizzard[name] or SV.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(SV.db[SCHEMA].addons[name] == nil) then + SV.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) + -- print(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,101 +287,84 @@ 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"]; - local main = SuperVillain.db.SVDock.docklets.DockletMain; - local alternate = SuperVillain.db.SVDock.docklets.enableExtra and SuperVillain.db.SVDock.docklets.DockletExtra or ""; + local main = SV.db.SVDock.docklets.DockletMain; + local alternate = SV.db.SVDock.docklets.enableExtra and SV.db.SVDock.docklets.DockletExtra or ""; local tipLeft, tipRight = "", ""; if main == nil or main == "None" then return end if find(main, "Skada") or find(alternate, "Skada") then - if SuperVillain:IsDockletReady("Skada") then + if SV:IsDockletReady("Skada") then PLUGIN:Docklet_Skada() if find(alternate, "Skada") and EXTRA.FrameName ~= "SkadaHolder2" then tipRight = "and Skada"; - SuperVillain:RegisterExtraDocklet("SkadaHolder2") + SV:RegisterExtraDocklet("SkadaHolder2") --PLUGIN.DockedParent["Skada"] = EXTRA end if find(main, "Skada") and MAIN.FrameName ~= "SkadaHolder" then tipLeft = "Skada"; - SuperVillain:RegisterMainDocklet("SkadaHolder") + SV:RegisterMainDocklet("SkadaHolder") --PLUGIN.DockedParent["Skada"] = MAIN end end end if main == "Omen" or alternate == "Omen" then - if SuperVillain:IsDockletReady("Omen") then + if SV:IsDockletReady("Omen") then if alternate == "Omen" and EXTRA.FrameName ~= "OmenAnchor" then tipRight = "and Omen"; - SuperVillain:RegisterExtraDocklet("OmenAnchor") + SV:RegisterExtraDocklet("OmenAnchor") PLUGIN:Docklet_Omen(EXTRA) PLUGIN.DockedParent["Omen"] = EXTRA elseif MAIN.FrameName ~= "OmenAnchor" then tipLeft = "Omen"; - SuperVillain:RegisterMainDocklet("OmenAnchor") + SV:RegisterMainDocklet("OmenAnchor") PLUGIN:Docklet_Omen(MAIN) PLUGIN.DockedParent["Omen"] = MAIN end end end if main == "Recount" or alternate == "Recount" then - if SuperVillain:IsDockletReady("Recount") then + if SV:IsDockletReady("Recount") then if alternate == "Recount" and EXTRA.FrameName ~= "Recount_MainWindow" then tipRight = "and Recount"; - SuperVillain:RegisterExtraDocklet("Recount_MainWindow") + SV:RegisterExtraDocklet("Recount_MainWindow") PLUGIN:Docklet_Recount(EXTRA) PLUGIN.DockedParent["Recount"] = EXTRA elseif MAIN.FrameName ~= "Recount_MainWindow" then tipLeft = "Recount"; - SuperVillain:RegisterMainDocklet("Recount_MainWindow") + SV:RegisterMainDocklet("Recount_MainWindow") PLUGIN:Docklet_Recount(MAIN) PLUGIN.DockedParent["Recount"] = MAIN end end end if main == "TinyDPS" or alternate == "TinyDPS" then - if SuperVillain:IsDockletReady("TinyDPS") then + if SV:IsDockletReady("TinyDPS") then if alternate == "TinyDPS" and EXTRA.FrameName ~= "tdpsFrame" then tipRight = "and TinyDPS"; - SuperVillain:RegisterExtraDocklet("tdpsFrame") + SV:RegisterExtraDocklet("tdpsFrame") PLUGIN:Docklet_TinyDPS(EXTRA) PLUGIN.DockedParent["TinyDPS"] = EXTRA elseif MAIN.FrameName ~= "tdpsFrame" then tipLeft = "TinyDPS"; - SuperVillain:RegisterMainDocklet("tdpsFrame") + SV:RegisterMainDocklet("tdpsFrame") PLUGIN:Docklet_TinyDPS(MAIN) PLUGIN.DockedParent["TinyDPS"] = MAIN end end end if main == "alDamageMeter" or alternate == "alDamageMeter" then - if SuperVillain:IsDockletReady("alDamageMeter") then + if SV:IsDockletReady("alDamageMeter") then if alternate == "alDamageMeter" and EXTRA.FrameName ~= "alDamagerMeterFrame" then tipRight = "and alDamageMeter"; - SuperVillain:RegisterExtraDocklet("alDamagerMeterFrame") + SV:RegisterExtraDocklet("alDamagerMeterFrame") PLUGIN:Docklet_alDamageMeter(EXTRA) PLUGIN.DockedParent["alDamageMeter"] = EXTRA elseif MAIN.FrameName ~= "alDamagerMeterFrame" then tipLeft = "alDamageMeter"; - SuperVillain:RegisterMainDocklet("alDamagerMeterFrame") + SV:RegisterMainDocklet("alDamagerMeterFrame") PLUGIN:Docklet_alDamageMeter(MAIN) PLUGIN.DockedParent["alDamageMeter"] = MAIN end @@ -366,335 +380,9 @@ 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={ - type = "group", - name = L["Style O Matic"], - childGroups = "tree", - args = { - intro = { - order = 1, - type = "description", - name = L["ART_DESC"] - }, - blizzardEnable = { - 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 - }, - 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 - }, - 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, - guiInline = true, - args = { - bmah = { - type = "toggle", - 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"], - desc = L["TOGGLEART_DESC"] - }, - encounterjournal = { - type = "toggle", - name = L["Encounter Journal"], - desc = L["TOGGLEART_DESC"] - }, - reforge = { - type = "toggle", - name = L["Reforge Frame"], - desc = L["TOGGLEART_DESC"] - }, - calendar = { - type = "toggle", - name = L["Calendar Frame"], - desc = L["TOGGLEART_DESC"] - }, - achievement = { - type = "toggle", - name = L["Achievement Frame"], - desc = L["TOGGLEART_DESC"] - }, - lfguild = { - type = "toggle", - name = L["LF Guild Frame"], - desc = L["TOGGLEART_DESC"] - }, - inspect = { - type = "toggle", - name = L["Inspect Frame"], - desc = L["TOGGLEART_DESC"] - }, - binding = { - type = "toggle", - name = L["KeyBinding Frame"], - desc = L["TOGGLEART_DESC"] - }, - gbank = { - type = "toggle", - name = L["Guild Bank"], - desc = L["TOGGLEART_DESC"] - }, - archaeology = { - type = "toggle", - name = L["Archaeology Frame"], - desc = L["TOGGLEART_DESC"] - }, - guildcontrol = { - type = "toggle", - name = L["Guild Control Frame"], - desc = L["TOGGLEART_DESC"] - }, - guild = { - type = "toggle", - name = L["Guild Frame"], - desc = L["TOGGLEART_DESC"] - }, - tradeskill = { - type = "toggle", - name = L["TradeSkill Frame"], - desc = L["TOGGLEART_DESC"] - }, - raid = { - type = "toggle", - name = L["Raid Frame"], - desc = L["TOGGLEART_DESC"] - }, - talent = { - type = "toggle", - name = L["Talent Frame"], - desc = L["TOGGLEART_DESC"] - }, - auctionhouse = { - type = "toggle", - name = L["Auction Frame"], - desc = L["TOGGLEART_DESC"] - }, - timemanager = { - type = "toggle", - name = L["Time Manager"], - desc = L["TOGGLEART_DESC"] - }, - barber = { - type = "toggle", - name = L["Barbershop Frame"], - desc = L["TOGGLEART_DESC"] - }, - macro = { - type = "toggle", - name = L["Macro Frame"], - desc = L["TOGGLEART_DESC"] - }, - debug = { - type = "toggle", - name = L["Debug Tools"], - desc = L["TOGGLEART_DESC"] - }, - trainer = { - type = "toggle", - name = L["Trainer Frame"], - desc = L["TOGGLEART_DESC"] - }, - socket = { - type = "toggle", - name = L["Socket Frame"], - desc = L["TOGGLEART_DESC"] - }, - alertframes = { - type = "toggle", - name = L["Alert Frames"], - desc = L["TOGGLEART_DESC"] - }, - loot = { - type = "toggle", - name = L["Loot Frames"], - desc = L["TOGGLEART_DESC"] - }, - bgscore = { - type = "toggle", - name = L["BG Score"], - desc = L["TOGGLEART_DESC"] - }, - merchant = { - type = "toggle", - name = L["Merchant Frame"], - desc = L["TOGGLEART_DESC"] - }, - mail = { - type = "toggle", - name = L["Mail Frame"], - desc = L["TOGGLEART_DESC"] - }, - help = { - type = "toggle", - name = L["Help Frame"], - desc = L["TOGGLEART_DESC"] - }, - trade = { - type = "toggle", - name = L["Trade Frame"], - desc = L["TOGGLEART_DESC"] - }, - gossip = { - type = "toggle", - name = L["Gossip Frame"], - desc = L["TOGGLEART_DESC"] - }, - greeting = { - type = "toggle", - name = L["Greeting Frame"], - desc = L["TOGGLEART_DESC"] - }, - worldmap = { - type = "toggle", - name = L["World Map"], - desc = L["TOGGLEART_DESC"] - }, - taxi = { - type = "toggle", - name = L["Taxi Frame"], - desc = L["TOGGLEART_DESC"] - }, - lfg = { - type = "toggle", - name = L["LFG Frame"], - desc = L["TOGGLEART_DESC"] - }, - mounts = { - type = "toggle", - name = L["Mounts & Pets"], - desc = L["TOGGLEART_DESC"] - }, - quest = { - type = "toggle", - name = L["Quest Frames"], - desc = L["TOGGLEART_DESC"] - }, - petition = { - type = "toggle", - name = L["Petition Frame"], - desc = L["TOGGLEART_DESC"] - }, - dressingroom = { - type = "toggle", - name = L["Dressing Room"], - desc = L["TOGGLEART_DESC"] - }, - pvp = { - type = "toggle", - name = L["PvP Frames"], - desc = L["TOGGLEART_DESC"] - }, - nonraid = { - type = "toggle", - name = L["Non-Raid Frame"], - desc = L["TOGGLEART_DESC"] - }, - friends = { - type = "toggle", - name = L["Friends"], - desc = L["TOGGLEART_DESC"] - }, - spellbook = { - type = "toggle", - name = L["Spellbook"], - desc = L["TOGGLEART_DESC"] - }, - character = { - type = "toggle", - name = L["Character Frame"], - desc = L["TOGGLEART_DESC"] - }, - misc = { - type = "toggle", - name = L["Misc Frames"], - desc = L["TOGGLEART_DESC"] - }, - tabard = { - type = "toggle", - name = L["Tabard Frame"], - desc = L["TOGGLEART_DESC"] - }, - guildregistrar = { - type = "toggle", - name = L["Guild Registrar"], - desc = L["TOGGLEART_DESC"] - }, - bags = { - type = "toggle", - name = L["Bags"], - desc = L["TOGGLEART_DESC"] - }, - stable = { - type = "toggle", - name = L["Stable"], - desc = L["TOGGLEART_DESC"] - }, - bgmap = { - type = "toggle", - name = L["BG Map"], - desc = L["TOGGLEART_DESC"] - }, - petbattleui = { - type = "toggle", - name = L["Pet Battle"], - desc = L["TOGGLEART_DESC"] - }, - losscontrol = { - type = "toggle", - name = L["Loss Control"], - desc = L["TOGGLEART_DESC"] - }, - voidstorage = { - type = "toggle", - name = L["Void Storage"], - desc = L["TOGGLEART_DESC"] - }, - itemUpgrade = { - type = "toggle", - name = L["Item Upgrade"], - desc = L["TOGGLEART_DESC"] - } - } - }, - addons = PLUGIN.OptionsCache - } - } -end - -local function LoadStyleOMatic() - PLUGIN.db = SuperVillain.db.SVStyle +function PLUGIN:Load() + if(not SV.db[SCHEMA].enable) then return end + self.db = SV.db[SCHEMA] local alert = CreateFrame('Frame', nil, UIParent); alert:SetFixedPanelTemplate('Transparent'); @@ -702,37 +390,345 @@ local function LoadStyleOMatic() alert:SetPoint('CENTER', UIParent, 'CENTER'); alert:SetFrameStrata('DIALOG'); alert.Text = alert:CreateFontString(nil, "OVERLAY"); - alert.Text:SetFont(SuperVillain.Media.font.default, 12); + alert.Text:SetFont(SV.Media.font.default, 12); alert.Text:SetPoint('TOP', alert, 'TOP', 0, -10); alert.Accept = CreateFrame('Button', nil, alert); alert.Accept:SetSize(70, 25); alert.Accept:SetPoint('RIGHT', alert, 'BOTTOM', -10, 20); alert.Accept.Text = alert.Accept:CreateFontString(nil, "OVERLAY"); - alert.Accept.Text:SetFont(SuperVillain.Media.font.default, 10); + alert.Accept.Text:SetFont(SV.Media.font.default, 10); alert.Accept.Text:SetPoint('CENTER'); alert.Accept.Text:SetText(YES); 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:SetFont(SV.Media.font.default, 10); alert.Close.Text:SetPoint('CENTER'); alert.Close.Text:SetText(NO); alert.Accept:SetButtonTemplate(); alert.Close:SetButtonTemplate(); alert:Hide(); - PLUGIN.Alert = alert; + self.Alert = alert; + + NewHook(SV, "ReloadDocklets", RegisterAddonDocklets); + SV:ReloadDocklets(); + SV.DynamicOptions[SCHEMA] = {key = "addons", data = self.OptionsCache}; + + local option = { + order = 2, + type = "toggle", + name = "Standard UI Styling", + get = function(a)return SV.db[SCHEMA].blizzard.enable end, + set = function(a,b) SV.db[SCHEMA].blizzard.enable = b; SV:StaticPopup_Show("RL_CLIENT") end + } + self:AddOption("blizzardEnable", option) + + option = { + order = 3, + type = "toggle", + name = "Addon Styling", + get = function(a)return SV.db[SCHEMA].addons.enable end, + set = function(a,b) SV.db[SCHEMA].addons.enable = b; SV:StaticPopup_Show("RL_CLIENT") end + } + self:AddOption("addonEnable", option) - NewHook(SuperVillain, "ReloadDocklets", RegisterAddonDocklets); - SuperVillain:ReloadDocklets(); + option = { + order = 300, + type = "group", + name = "Individual Mods", + get = function(a)return SV.db[SCHEMA].blizzard[a[#a]]end, + set = function(a,b) SV.db[SCHEMA].blizzard[a[#a]] = b; SV:StaticPopup_Show("RL_CLIENT") end, + disabled = function() return not SV.db[SCHEMA].blizzard.enable end, + guiInline = true, + args = { + bmah = { + type = "toggle", + 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"], + desc = L["TOGGLEART_DESC"] + }, + encounterjournal = { + type = "toggle", + name = L["Encounter Journal"], + desc = L["TOGGLEART_DESC"] + }, + reforge = { + type = "toggle", + name = L["Reforge Frame"], + desc = L["TOGGLEART_DESC"] + }, + calendar = { + type = "toggle", + name = L["Calendar Frame"], + desc = L["TOGGLEART_DESC"] + }, + achievement = { + type = "toggle", + name = L["Achievement Frame"], + desc = L["TOGGLEART_DESC"] + }, + lfguild = { + type = "toggle", + name = L["LF Guild Frame"], + desc = L["TOGGLEART_DESC"] + }, + inspect = { + type = "toggle", + name = L["Inspect Frame"], + desc = L["TOGGLEART_DESC"] + }, + binding = { + type = "toggle", + name = L["KeyBinding Frame"], + desc = L["TOGGLEART_DESC"] + }, + gbank = { + type = "toggle", + name = L["Guild Bank"], + desc = L["TOGGLEART_DESC"] + }, + archaeology = { + type = "toggle", + name = L["Archaeology Frame"], + desc = L["TOGGLEART_DESC"] + }, + guildcontrol = { + type = "toggle", + name = L["Guild Control Frame"], + desc = L["TOGGLEART_DESC"] + }, + guild = { + type = "toggle", + name = L["Guild Frame"], + desc = L["TOGGLEART_DESC"] + }, + tradeskill = { + type = "toggle", + name = L["TradeSkill Frame"], + desc = L["TOGGLEART_DESC"] + }, + raid = { + type = "toggle", + name = L["Raid Frame"], + desc = L["TOGGLEART_DESC"] + }, + talent = { + type = "toggle", + name = L["Talent Frame"], + desc = L["TOGGLEART_DESC"] + }, + auctionhouse = { + type = "toggle", + name = L["Auction Frame"], + desc = L["TOGGLEART_DESC"] + }, + timemanager = { + type = "toggle", + name = L["Time Manager"], + desc = L["TOGGLEART_DESC"] + }, + barber = { + type = "toggle", + name = L["Barbershop Frame"], + desc = L["TOGGLEART_DESC"] + }, + macro = { + type = "toggle", + name = L["Macro Frame"], + desc = L["TOGGLEART_DESC"] + }, + debug = { + type = "toggle", + name = L["Debug Tools"], + desc = L["TOGGLEART_DESC"] + }, + trainer = { + type = "toggle", + name = L["Trainer Frame"], + desc = L["TOGGLEART_DESC"] + }, + socket = { + type = "toggle", + name = L["Socket Frame"], + desc = L["TOGGLEART_DESC"] + }, + alertframes = { + type = "toggle", + name = L["Alert Frames"], + desc = L["TOGGLEART_DESC"] + }, + loot = { + type = "toggle", + name = L["Loot Frames"], + desc = L["TOGGLEART_DESC"] + }, + bgscore = { + type = "toggle", + name = L["BG Score"], + desc = L["TOGGLEART_DESC"] + }, + merchant = { + type = "toggle", + name = L["Merchant Frame"], + desc = L["TOGGLEART_DESC"] + }, + mail = { + type = "toggle", + name = L["Mail Frame"], + desc = L["TOGGLEART_DESC"] + }, + help = { + type = "toggle", + name = L["Help Frame"], + desc = L["TOGGLEART_DESC"] + }, + trade = { + type = "toggle", + name = L["Trade Frame"], + desc = L["TOGGLEART_DESC"] + }, + gossip = { + type = "toggle", + name = L["Gossip Frame"], + desc = L["TOGGLEART_DESC"] + }, + greeting = { + type = "toggle", + name = L["Greeting Frame"], + desc = L["TOGGLEART_DESC"] + }, + worldmap = { + type = "toggle", + name = L["World Map"], + desc = L["TOGGLEART_DESC"] + }, + taxi = { + type = "toggle", + name = L["Taxi Frame"], + desc = L["TOGGLEART_DESC"] + }, + lfg = { + type = "toggle", + name = L["LFG Frame"], + desc = L["TOGGLEART_DESC"] + }, + mounts = { + type = "toggle", + name = L["Mounts & Pets"], + desc = L["TOGGLEART_DESC"] + }, + quest = { + type = "toggle", + name = L["Quest Frames"], + desc = L["TOGGLEART_DESC"] + }, + petition = { + type = "toggle", + name = L["Petition Frame"], + desc = L["TOGGLEART_DESC"] + }, + dressingroom = { + type = "toggle", + name = L["Dressing Room"], + desc = L["TOGGLEART_DESC"] + }, + pvp = { + type = "toggle", + name = L["PvP Frames"], + desc = L["TOGGLEART_DESC"] + }, + nonraid = { + type = "toggle", + name = L["Non-Raid Frame"], + desc = L["TOGGLEART_DESC"] + }, + friends = { + type = "toggle", + name = L["Friends"], + desc = L["TOGGLEART_DESC"] + }, + spellbook = { + type = "toggle", + name = L["Spellbook"], + desc = L["TOGGLEART_DESC"] + }, + character = { + type = "toggle", + name = L["Character Frame"], + desc = L["TOGGLEART_DESC"] + }, + misc = { + type = "toggle", + name = L["Misc Frames"], + desc = L["TOGGLEART_DESC"] + }, + tabard = { + type = "toggle", + name = L["Tabard Frame"], + desc = L["TOGGLEART_DESC"] + }, + guildregistrar = { + type = "toggle", + name = L["Guild Registrar"], + desc = L["TOGGLEART_DESC"] + }, + bags = { + type = "toggle", + name = L["Bags"], + desc = L["TOGGLEART_DESC"] + }, + stable = { + type = "toggle", + name = L["Stable"], + desc = L["TOGGLEART_DESC"] + }, + bgmap = { + type = "toggle", + name = L["BG Map"], + desc = L["TOGGLEART_DESC"] + }, + petbattleui = { + type = "toggle", + name = L["Pet Battle"], + desc = L["TOGGLEART_DESC"] + }, + losscontrol = { + type = "toggle", + name = L["Loss Control"], + desc = L["TOGGLEART_DESC"] + }, + voidstorage = { + type = "toggle", + name = L["Void Storage"], + desc = L["TOGGLEART_DESC"] + }, + itemUpgrade = { + type = "toggle", + name = L["Item Upgrade"], + desc = L["TOGGLEART_DESC"] + } + } + } + self:AddOption("blizzard", option) + self:AddOption("addons", self.OptionsCache) - SuperVillain.DynamicOptions["SVStyle"] = {key = "addons", data = PLUGIN.OptionsCache}; - SVUIAddonEventHandler:RegisterEvent("ADDON_LOADED", "StyleOnDemand"); - SVUIAddonEventHandler:RegisterEvent("PLAYER_ENTERING_WORLD", "StyleInit"); + self:RegisterEvent("PLAYER_ENTERING_WORLD"); + self:RegisterEvent("ADDON_LOADED"); end -CONFIGS["SVStyle"] = { +CONFIGS[SCHEMA] = { + ["enable"] = true, ["blizzard"] = { ["enable"] = true, ["bags"] = true, @@ -800,8 +796,7 @@ CONFIGS["SVStyle"] = { ["AtlasLoot"] = true, ["SexyCooldown"] = true, ["Lightheaded"] = true, - ["Outfitter"] = true, - ["WeakAuras"] = true, + ["Outfitter"] = true, ["Quartz"] = true, ["TomTom"] = true, ["TinyDPS"] = true, @@ -818,7 +813,4 @@ CONFIGS["SVStyle"] = { } } -SuperVillain.Registry:NewScript(LoadStyleOMatic) -SuperVillain.Registry:NewPlugin(PLUGIN, "SVStyle", LoadOptions) - -SVUIAddonEventHandler:SetScript("OnEvent", Registry_OnEvent) \ No newline at end of file +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 ad8b119..d817f26 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc +++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc @@ -1,9 +1,11 @@ ## Interface: 60000 ## Author: Munglunch, Azilroka, Sortokk -## Version: 5.02 +## Version: 4.4 ## Title: |cffFF9900SVUI |r|cffFFEF00Style O Matic|r ## Notes: Supervillain UI [|cff9911FFAddon Skins|r]. ## RequiredDeps: SVUI ## OptionalDeps: Blizzard_DebugTools, Blizzard_PetJournal, SharedMedia +## X-SVUI-Header: Style O Matic +## X-SVUI-Schema: SVStyle SVUI_StyleOMatic.xml diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/_load.xml b/Interface/AddOns/SVUI_StyleOMatic/addons/_load.xml index 969f53a..a250be8 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/_load.xml +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/_load.xml @@ -47,6 +47,7 @@ <Script file='voidstorage.lua'/> <Script file='worldmap.lua'/> <Script file='worldstate.lua'/> + <Script file='store.lua'/> <Script file='system.lua'/> <Include file='thirdparty\_load.xml'/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/achievement.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/achievement.lua index 8a5fb1d..592347a 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/achievement.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/achievement.lua @@ -13,52 +13,156 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## HELPERS ########################################################## ]]-- +local AchievementFrameList = { + "AchievementFrame", + "AchievementFrameCategories", + "AchievementFrameSummary", + "AchievementFrameHeader", + "AchievementFrameSummaryCategoriesHeader", + "AchievementFrameSummaryAchievementsHeader", + "AchievementFrameStatsBG", + "AchievementFrameAchievements", + "AchievementFrameComparison", + "AchievementFrameComparisonHeader", + "AchievementFrameComparisonSummaryPlayer", + "AchievementFrameComparisonSummaryFriend" +} + +local AchievementTextureList = { + "AchievementFrameStats", + "AchievementFrameSummary", + "AchievementFrameAchievements", + "AchievementFrameComparison" +} + +local AchievementItemButtons = { + "AchievementFrameAchievementsContainerButton1", + "AchievementFrameAchievementsContainerButton2", + "AchievementFrameAchievementsContainerButton3", + "AchievementFrameAchievementsContainerButton4", + "AchievementFrameAchievementsContainerButton5", + "AchievementFrameAchievementsContainerButton6", + "AchievementFrameAchievementsContainerButton7", +} + +local _hook_DescriptionColor = function(self, r, g, b) + if(r ~= 0.6 or g ~= 0.6 or b ~= 0.6) then + self:SetTextColor(0.6, 0.6, 0.6) + end +end + +local _hook_HiddenDescriptionColor = function(self, r, g, b) + if(r ~= 1 or g ~= 1 or b ~= 1) then + self:SetTextColor(1, 1, 1) + end +end + +local _hook_TrackingPoint = function(self, anchor, parent, relative, x, y) + local actual = self.ListParent + if(anchor ~= "BOTTOMLEFT" or parent ~= actual or relative ~= "BOTTOMLEFT" or x ~= 5 or y ~= 5) then + self:ClearAllPoints() + self:Point("BOTTOMLEFT", actual, "BOTTOMLEFT", 5, 5) + end +end + +local _hook_AchievementsUpdate = function() + for i = 1, ACHIEVEMENTUI_MAX_SUMMARY_ACHIEVEMENTS do + local globalName = ("AchievementFrameSummaryAchievement%d"):format(i) + local summary = _G[globalName] + if(summary) then + summary:RemoveTextures() + summary:SetButtonTemplate() + + local highlight = _G[("%sHighlight"):format(globalName)] + local desc = _G[("%sDescription"):format(globalName)] + local icon = _G[("%sIcon"):format(globalName)] + local iconbling = _G[("%sIconBling"):format(globalName)] + local iconover = _G[("%sIconOverlay"):format(globalName)] + local icontex = _G[("%sIconTexture"):format(globalName)] + + if(highlight) then highlight:Die() end + if(desc) then desc:SetTextColor(0.6, 0.6, 0.6) end + if(iconbling) then iconbling:Die() end + if(iconover) then iconover:Die() end + if(icontex) then + icontex:SetTexCoord(0.1, 0.9, 0.1, 0.9) + icontex:FillInner() + end + if(icon and not icon.Panel) then + icon:SetFixedPanelTemplate("Slot") + icon:Height(icon:GetHeight() - 14) + icon:Width(icon:GetWidth() - 14) + icon:ClearAllPoints() + icon:Point("LEFT", 6, 0) + end + + if summary.accountWide then + summary:SetBackdropBorderColor(ACHIEVEMENTUI_BLUEBORDER_R, ACHIEVEMENTUI_BLUEBORDER_G, ACHIEVEMENTUI_BLUEBORDER_B) + else + summary:SetBackdropBorderColor(0,0,0,1) + end + end + end + + collectgarbage("collect"); +end + local function BarStyleHelper(bar) - bar:Formula409() - bar:SetStatusBarTexture(SuperVillain.Media.bar.default) + bar:RemoveTextures() + bar:SetStatusBarTexture(SV.Media.bar.default) bar:SetStatusBarColor(4/255, 179/255, 30/255) bar:SetPanelTemplate("Default") if _G[bar:GetName().."Title"]then _G[bar:GetName().."Title"]:SetPoint("LEFT", 4, 0) - end; + end if _G[bar:GetName().."Label"]then _G[bar:GetName().."Label"]:SetPoint("LEFT", 4, 0) - end; + end if _G[bar:GetName().."Text"]then _G[bar:GetName().."Text"]:SetPoint("RIGHT", -4, 0) end -end; +end --[[ ########################################################## ACHIEVEMENTFRAME STYLER ########################################################## ]]-- local function AchievementStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.achievement ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.achievement ~= true then return - end; - local b = {"AchievementFrame", "AchievementFrameCategories", "AchievementFrameSummary", "AchievementFrameHeader", "AchievementFrameSummaryCategoriesHeader", "AchievementFrameSummaryAchievementsHeader", "AchievementFrameStatsBG", "AchievementFrameAchievements", "AchievementFrameComparison", "AchievementFrameComparisonHeader", "AchievementFrameComparisonSummaryPlayer", "AchievementFrameComparisonSummaryFriend"} - for c, d in pairs(b)do - _G[d]:Formula409(true) - end; - local e = {"AchievementFrameStats", "AchievementFrameSummary", "AchievementFrameAchievements", "AchievementFrameComparison"} - for c, d in pairs(e)do - for f = 1, _G[d]:GetNumChildren()do - local g = select(f, _G[d]:GetChildren()) - if g and not g:GetName()then - g:SetBackdrop(nil) - end - end - end; + end - AchievementFrame:SetPanelTemplate("Halftone",false,2,2,4) + for _, gName in pairs(AchievementFrameList) do + local frame = _G[gName] + if(frame) then + frame:RemoveTextures(true) + end + end + + for _, gName in pairs(AchievementTextureList) do + local frame = _G[gName] + if(frame) then + local count = frame:GetNumChildren() + for i = 1, count do + local childFrame = select(i, frame:GetChildren()) + if(childFrame and not childFrame:GetName()) then + childFrame:SetBackdrop(nil) + end + end + end + end + + STYLE:ApplyWindowStyle(AchievementFrame) + + AchievementFrameSummaryAchievements:RemoveTextures(true) + AchievementFrameSummaryAchievements:SetBasicPanel() AchievementFrameHeaderTitle:ClearAllPoints() AchievementFrameHeaderTitle:Point("TOPLEFT", AchievementFrame.Panel, "TOPLEFT", -30, -8) AchievementFrameHeaderPoints:ClearAllPoints() @@ -70,200 +174,212 @@ local function AchievementStyle() STYLE:ApplyCloseButtonStyle(AchievementFrameCloseButton, AchievementFrame.Panel) STYLE:ApplyDropdownStyle(AchievementFrameFilterDropDown) AchievementFrameFilterDropDown:Point("TOPRIGHT", AchievementFrame, "TOPRIGHT", -44, 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) - end; + + for i = 1, 3 do + local tab = _G["AchievementFrameTab"..i] + if(tab) then + STYLE:ApplyTabStyle(tab) + tab:SetFrameLevel(tab:GetFrameLevel() + 2) + end + end + BarStyleHelper(AchievementFrameSummaryCategoriesStatusBar) BarStyleHelper(AchievementFrameComparisonSummaryPlayerStatusBar) BarStyleHelper(AchievementFrameComparisonSummaryFriendStatusBar) + AchievementFrameComparisonSummaryFriendStatusBar.text:ClearAllPoints() AchievementFrameComparisonSummaryFriendStatusBar.text:SetPoint("CENTER") AchievementFrameComparisonHeader:Point("BOTTOMRIGHT", AchievementFrameComparison, "TOPRIGHT", 45, -20) + for f = 1, 10 do local d = _G["AchievementFrameSummaryCategoriesCategory"..f] local i = _G["AchievementFrameSummaryCategoriesCategory"..f.."Button"] local j = _G["AchievementFrameSummaryCategoriesCategory"..f.."ButtonHighlight"] BarStyleHelper(d) - i:Formula409() - j:Formula409() + i:RemoveTextures() + j:RemoveTextures() _G[j:GetName().."Middle"]:SetTexture(1, 1, 1, 0.3) _G[j:GetName().."Middle"]:SetAllPoints(d) - end; - AchievementFrame:HookScript("OnShow", function(k) - if k.containerStyleed then - return - end; - for f = 1, 20 do - local d = _G["AchievementFrameCategoriesContainerButton"..f] - STYLE:ApplyItemButtonStyle(d) - end; - k.containerStyleed = true - end) - hooksecurefunc("AchievementButton_DisplayAchievement", function(d) - if d.accountWide and d.bg3 then - d.bg3:SetTexture(ACHIEVEMENTUI_BLUEBORDER_R, ACHIEVEMENTUI_BLUEBORDER_G, ACHIEVEMENTUI_BLUEBORDER_B) - elseif d.bg3 then - d.bg3:SetTexture(0,0,0,1) + end + + AchievementFrame:HookScript("OnShow", function(self) + if(self.containerStyled) then return end + for i = 1, 20 do + STYLE:ApplyItemButtonStyle(_G["AchievementFrameCategoriesContainerButton"..i]) end + self.containerStyled = true end) - hooksecurefunc("AchievementFrameSummary_UpdateAchievements", function() - for f = 1, ACHIEVEMENTUI_MAX_SUMMARY_ACHIEVEMENTS do - local d = _G["AchievementFrameSummaryAchievement"..f] - _G["AchievementFrameSummaryAchievement"..f.."Highlight"]:MUNG() - _G["AchievementFrameSummaryAchievement"..f.."Description"]:SetTextColor(0.6, 0.6, 0.6) - if not d.Panel then - d:Formula409() - d:SetFixedPanelTemplate("Inset") - _G["AchievementFrameSummaryAchievement"..f.."IconBling"]:MUNG() - _G["AchievementFrameSummaryAchievement"..f.."IconOverlay"]:MUNG() - _G["AchievementFrameSummaryAchievement"..f.."Icon"]:SetFixedPanelTemplate("Default") - _G["AchievementFrameSummaryAchievement"..f.."Icon"]:Height(_G["AchievementFrameSummaryAchievement"..f.."Icon"]:GetHeight()-14) - _G["AchievementFrameSummaryAchievement"..f.."Icon"]:Width(_G["AchievementFrameSummaryAchievement"..f.."Icon"]:GetWidth()-14) - _G["AchievementFrameSummaryAchievement"..f.."Icon"]:ClearAllPoints() - _G["AchievementFrameSummaryAchievement"..f.."Icon"]:Point("LEFT", 6, 0) - _G["AchievementFrameSummaryAchievement"..f.."IconTexture"]:SetTexCoord(0.1, 0.9, 0.1, 0.9) - _G["AchievementFrameSummaryAchievement"..f.."IconTexture"]:FillInner() - end; - if d.accountWide then - d:SetBackdropBorderColor(ACHIEVEMENTUI_BLUEBORDER_R, ACHIEVEMENTUI_BLUEBORDER_G, ACHIEVEMENTUI_BLUEBORDER_B)else d:SetBackdropBorderColor(0,0,0,1) - end + + hooksecurefunc("AchievementButton_DisplayAchievement", function(self) + if(self.accountWide and self.bg3) then + self.bg3:SetTexture(ACHIEVEMENTUI_BLUEBORDER_R, ACHIEVEMENTUI_BLUEBORDER_G, ACHIEVEMENTUI_BLUEBORDER_B) + elseif self.bg3 then + self.bg3:SetTexture(0,0,0,1) end end) - --AchievementFrameAchievementsContainerScrollChild:SetFixedPanelTemplate("Button") - for f = 1, 7 do - local d = _G["AchievementFrameAchievementsContainerButton"..f] - _G["AchievementFrameAchievementsContainerButton"..f.."Highlight"]:MUNG() - d:Formula409(true) - d.bg1 = d:CreateTexture(nil, "BACKGROUND", nil, 4) - d.bg1:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - d.bg1:SetVertexColor(unpack(SuperVillain.Media.color.default)) - d.bg1:Point("TOPLEFT", 1, -1) - d.bg1:Point("BOTTOMRIGHT", -1, 1) - d.bg3 = d:CreateTexture(nil, "BACKGROUND", nil, 2) - d.bg3:SetTexture(SuperVillain.Media.color.button) - d.bg3:WrapOuter(1); - _G["AchievementFrameAchievementsContainerButton"..f.."Description"]:SetTextColor(0.6, 0.6, 0.6) - hooksecurefunc(_G["AchievementFrameAchievementsContainerButton"..f.."Description"], "SetTextColor", function(k, m, n, o) - if m ~= 0.6 or n ~= 0.6 or o ~= 0.6 then - k:SetTextColor(0.6, 0.6, 0.6) - end - end) - _G["AchievementFrameAchievementsContainerButton"..f.."HiddenDescription"]:SetTextColor(1, 1, 1) - hooksecurefunc(_G["AchievementFrameAchievementsContainerButton"..f.."HiddenDescription"], "SetTextColor", function(k, m, n, o) - if m ~= 1 or n ~= 1 or o ~= 1 then - k:SetTextColor(1, 1, 1) + + hooksecurefunc("AchievementFrameSummary_UpdateAchievements", _hook_AchievementsUpdate) + + for i = 1, #AchievementItemButtons do + local gName = AchievementItemButtons[i] + local button = _G[gName] + + if(button) then + local hl = _G[gName.."Highlight"] + local desc = _G[gName.."Description"] + local hdesc = _G[gName.."HiddenDescription"] + local icon = _G[gName.."Icon"] + local track = _G[gName.."Tracked"] + + if(hl) then hl:Die() end + + button:RemoveTextures(true) + + button.bg1 = button:CreateTexture(nil, "BACKGROUND", nil, 4) + button.bg1:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) + button.bg1:SetVertexColor(unpack(SV.Media.color.default)) + button.bg1:Point("TOPLEFT", 1, -1) + button.bg1:Point("BOTTOMRIGHT", -1, 1) + + button.bg3 = button:CreateTexture(nil, "BACKGROUND", nil, 2) + button.bg3:SetTexture(unpack(SV.Media.color.default)) + button.bg3:WrapOuter(1) + + if(desc) then + desc:SetTextColor(0.6, 0.6, 0.6) + hooksecurefunc(desc, "SetTextColor", _hook_DescriptionColor) + end + + if(hdesc) then + hdesc:SetTextColor(1, 1, 1) + hooksecurefunc(hdesc, "SetTextColor", _hook_HiddenDescriptionColor) + end + + if(icon) then + local bling = _G[gName.."IconBling"] + local over = _G[gName.."IconOverlay"] + local tex = _G[gName.."IconTexture"] + if(bling) then bling:Die() end + if(over) then over:Die() end + if(tex) then + tex:SetTexCoord(0.1, 0.9, 0.1, 0.9) + tex:FillInner() + end + + icon:SetFixedPanelTemplate("Default") + icon:Height(icon:GetHeight()-14) + icon:Width(icon:GetWidth()-14) + icon:ClearAllPoints() + icon:Point("LEFT", 6, 0) + end + + if(track) then + track:RemoveTextures() + track:SetCheckboxTemplate(true) + track:ClearAllPoints() + track:Point("BOTTOMLEFT", d, "BOTTOMLEFT", -1, -3) + track.ListParent = button + + hooksecurefunc(track, "SetPoint", _hook_TrackingPoint) + end + end + end + + local u = {"Player", "Friend"} + for c, v in pairs(u) do + for f = 1, 9 do + local d = "AchievementFrameComparisonContainerButton"..f..v; + _G[d]:RemoveTextures() + _G[d.."Background"]:Die() + if _G[d.."Description"]then + _G[d.."Description"]:SetTextColor(0.6, 0.6, 0.6) + hooksecurefunc(_G[d.."Description"], "SetTextColor", _hook_DescriptionColor) end - end) - _G["AchievementFrameAchievementsContainerButton"..f.."IconBling"]:MUNG() - _G["AchievementFrameAchievementsContainerButton"..f.."IconOverlay"]:MUNG() - _G["AchievementFrameAchievementsContainerButton"..f.."IconTexture"]:SetTexCoord(0.1, 0.9, 0.1, 0.9) - _G["AchievementFrameAchievementsContainerButton"..f.."IconTexture"]:FillInner() - - _G["AchievementFrameAchievementsContainerButton"..f.."Icon"]:SetFixedPanelTemplate("Default") - _G["AchievementFrameAchievementsContainerButton"..f.."Icon"]:Height(_G["AchievementFrameAchievementsContainerButton"..f.."Icon"]:GetHeight()-14) - _G["AchievementFrameAchievementsContainerButton"..f.."Icon"]:Width(_G["AchievementFrameAchievementsContainerButton"..f.."Icon"]:GetWidth()-14) - _G["AchievementFrameAchievementsContainerButton"..f.."Icon"]:ClearAllPoints() - _G["AchievementFrameAchievementsContainerButton"..f.."Icon"]:Point("LEFT", 6, 0) - - _G["AchievementFrameAchievementsContainerButton"..f.."Tracked"]:Formula409() - _G["AchievementFrameAchievementsContainerButton"..f.."Tracked"]:SetCheckboxTemplate(true) - _G["AchievementFrameAchievementsContainerButton"..f.."Tracked"]:ClearAllPoints() - _G["AchievementFrameAchievementsContainerButton"..f.."Tracked"]:Point("BOTTOMLEFT", d, "BOTTOMLEFT", -1, -3) - hooksecurefunc(_G["AchievementFrameAchievementsContainerButton"..f.."Tracked"], "SetPoint", function(k, p, q, r, s, t) - if p ~= "BOTTOMLEFT" or q ~= d or r ~= "BOTTOMLEFT" or s ~= 5 or t ~= 5 then - k:ClearAllPoints() - k:Point("BOTTOMLEFT", d, "BOTTOMLEFT", 5, 5) + _G[d].bg1 = _G[d]:CreateTexture(nil, "BACKGROUND") + _G[d].bg1:SetDrawLayer("BACKGROUND", 4) + _G[d].bg1:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) + _G[d].bg1:SetVertexColor(unpack(SV.Media.color.default)) + _G[d].bg1:Point("TOPLEFT", 4, -4) + _G[d].bg1:Point("BOTTOMRIGHT", -4, 4) + _G[d].bg2 = _G[d]:CreateTexture(nil, "BACKGROUND") + _G[d].bg2:SetDrawLayer("BACKGROUND", 3) + _G[d].bg2:SetTexture(0, 0, 0) + _G[d].bg2:Point("TOPLEFT", 3, -3) + _G[d].bg2:Point("BOTTOMRIGHT", -3, 3) + _G[d].bg3 = _G[d]:CreateTexture(nil, "BACKGROUND") + _G[d].bg3:SetDrawLayer("BACKGROUND", 2) + _G[d].bg3:SetTexture(0,0,0,1) + _G[d].bg3:Point("TOPLEFT", 2, -2) + _G[d].bg3:Point("BOTTOMRIGHT", -2, 2) + _G[d].bg4 = _G[d]:CreateTexture(nil, "BACKGROUND") + _G[d].bg4:SetDrawLayer("BACKGROUND", 1) + _G[d].bg4:SetTexture(0, 0, 0) + _G[d].bg4:Point("TOPLEFT", 1, -1) + _G[d].bg4:Point("BOTTOMRIGHT", -1, 1) + + if v == "Friend"then + _G[d.."Shield"]:Point("TOPRIGHT", _G["AchievementFrameComparisonContainerButton"..f.."Friend"], "TOPRIGHT", -20, -3) end - end) - end; - local u = {"Player", "Friend"} - for c, v in pairs(u)do for f = 1, 9 do local d = "AchievementFrameComparisonContainerButton"..f..v;_G[d]:Formula409() - _G[d.."Background"]:MUNG() - if _G[d.."Description"]then - _G[d.."Description"]:SetTextColor(0.6, 0.6, 0.6) - hooksecurefunc(_G[d.."Description"], "SetTextColor", function(k, m, n, o) - if m ~= 0.6 or n ~= 0.6 or o ~= 0.6 then - k:SetTextColor(0.6, 0.6, 0.6) - end - end) - end; - _G[d].bg1 = _G[d]:CreateTexture(nil, "BACKGROUND") - _G[d].bg1:SetDrawLayer("BACKGROUND", 4) - _G[d].bg1:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - _G[d].bg1:SetVertexColor(unpack(SuperVillain.Media.color.default)) - _G[d].bg1:Point("TOPLEFT", 4, -4) - _G[d].bg1:Point("BOTTOMRIGHT", -4, 4) - _G[d].bg2 = _G[d]:CreateTexture(nil, "BACKGROUND") - _G[d].bg2:SetDrawLayer("BACKGROUND", 3) - _G[d].bg2:SetTexture(0, 0, 0) - _G[d].bg2:Point("TOPLEFT", 3, -3) - _G[d].bg2:Point("BOTTOMRIGHT", -3, 3) - _G[d].bg3 = _G[d]:CreateTexture(nil, "BACKGROUND") - _G[d].bg3:SetDrawLayer("BACKGROUND", 2) - _G[d].bg3:SetTexture(0,0,0,1) - _G[d].bg3:Point("TOPLEFT", 2, -2) - _G[d].bg3:Point("BOTTOMRIGHT", -2, 2) - _G[d].bg4 = _G[d]:CreateTexture(nil, "BACKGROUND") - _G[d].bg4:SetDrawLayer("BACKGROUND", 1) - _G[d].bg4:SetTexture(0, 0, 0) - _G[d].bg4:Point("TOPLEFT", 1, -1) - _G[d].bg4:Point("BOTTOMRIGHT", -1, 1) - if v == "Friend"then - _G[d.."Shield"]:Point("TOPRIGHT", _G["AchievementFrameComparisonContainerButton"..f.."Friend"], "TOPRIGHT", -20, -3) - end; - _G[d.."IconBling"]:MUNG() - _G[d.."IconOverlay"]:MUNG() - _G[d.."Icon"]:SetFixedPanelTemplate("Default") - _G[d.."Icon"]:Height(_G[d.."Icon"]:GetHeight()-14) - _G[d.."Icon"]:Width(_G[d.."Icon"]:GetWidth()-14) - _G[d.."Icon"]:ClearAllPoints() - _G[d.."Icon"]:Point("LEFT", 6, 0) - _G[d.."IconTexture"]:SetTexCoord(0.1, 0.9, 0.1, 0.9) - _G[d.."IconTexture"]:FillInner() - end - end;hooksecurefunc("AchievementFrameComparison_DisplayAchievement", function(i) - local w = i.player;local x = i.friend;w.titleBar:MUNG()x.titleBar:MUNG() - if not w.bg3 or not x.bg3 then - return - end; - - if w.accountWide then - w.bg3:SetTexture(ACHIEVEMENTUI_BLUEBORDER_R, ACHIEVEMENTUI_BLUEBORDER_G, ACHIEVEMENTUI_BLUEBORDER_B) - else - w.bg3:SetTexture(0,0,0,1) - end; - - if x.accountWide then - x.bg3:SetTexture(ACHIEVEMENTUI_BLUEBORDER_R, ACHIEVEMENTUI_BLUEBORDER_G, ACHIEVEMENTUI_BLUEBORDER_B) - else - x.bg3:SetTexture(0,0,0,1) - end + + _G[d.."IconBling"]:Die() + _G[d.."IconOverlay"]:Die() + _G[d.."Icon"]:SetFixedPanelTemplate("Default") + _G[d.."Icon"]:Height(_G[d.."Icon"]:GetHeight()-14) + _G[d.."Icon"]:Width(_G[d.."Icon"]:GetWidth()-14) + _G[d.."Icon"]:ClearAllPoints() + _G[d.."Icon"]:Point("LEFT", 6, 0) + _G[d.."IconTexture"]:SetTexCoord(0.1, 0.9, 0.1, 0.9) + _G[d.."IconTexture"]:FillInner() + end + end + + hooksecurefunc("AchievementFrameComparison_DisplayAchievement", function(i) + local w = i.player; + local x = i.friend + w.titleBar:Die() + x.titleBar:Die() + if not w.bg3 or not x.bg3 then + return + end + if w.accountWide then + w.bg3:SetTexture(ACHIEVEMENTUI_BLUEBORDER_R, ACHIEVEMENTUI_BLUEBORDER_G, ACHIEVEMENTUI_BLUEBORDER_B) + else + w.bg3:SetTexture(0,0,0,1) + end + + if x.accountWide then + x.bg3:SetTexture(ACHIEVEMENTUI_BLUEBORDER_R, ACHIEVEMENTUI_BLUEBORDER_G, ACHIEVEMENTUI_BLUEBORDER_B) + else + x.bg3:SetTexture(0,0,0,1) + end end) + for f = 1, 20 do local d = _G["AchievementFrameStatsContainerButton"..f] _G["AchievementFrameStatsContainerButton"..f.."BG"]:SetTexture(1, 1, 1, 0.2) - _G["AchievementFrameStatsContainerButton"..f.."HeaderLeft"]:MUNG() - _G["AchievementFrameStatsContainerButton"..f.."HeaderRight"]:MUNG() - _G["AchievementFrameStatsContainerButton"..f.."HeaderMiddle"]:MUNG() + _G["AchievementFrameStatsContainerButton"..f.."HeaderLeft"]:Die() + _G["AchievementFrameStatsContainerButton"..f.."HeaderRight"]:Die() + _G["AchievementFrameStatsContainerButton"..f.."HeaderMiddle"]:Die() local d = "AchievementFrameComparisonStatsContainerButton"..f; - _G[d]:Formula409() + _G[d]:RemoveTextures() _G[d]:SetPanelTemplate("Default") _G[d.."BG"]:SetTexture(1, 1, 1, 0.2) - _G[d.."HeaderLeft"]:MUNG() - _G[d.."HeaderRight"]:MUNG() - _G[d.."HeaderMiddle"]:MUNG() - end; + _G[d.."HeaderLeft"]:Die() + _G[d.."HeaderRight"]:Die() + _G[d.."HeaderMiddle"]:Die() + end + hooksecurefunc("AchievementButton_GetProgressBar", function(y) local d = _G["AchievementFrameProgressBar"..y] if d then if not d.styled then - d:Formula409() + d:RemoveTextures() d:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) d:SetStatusBarColor(4/255, 179/255, 30/255) d:SetFrameLevel(d:GetFrameLevel()+3) @@ -271,7 +387,7 @@ local function AchievementStyle() d.bg1 = d:CreateTexture(nil, "BACKGROUND") d.bg1:SetDrawLayer("BACKGROUND", 4) d.bg1:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - d.bg1:SetVertexColor(unpack(SuperVillain.Media.color.default)) + d.bg1:SetVertexColor(unpack(SV.Media.color.default)) d.bg1:SetAllPoints() d.bg3 = d:CreateTexture(nil, "BACKGROUND") d.bg3:SetDrawLayer("BACKGROUND", 2) @@ -289,11 +405,12 @@ local function AchievementStyle() k:ClearAllPoints()k:SetPoint("TOP", _G["AchievementFrameProgressBar"..y-1], "BOTTOM", 0, -5, true) end end) - end; + end d.styled = true end end end) + hooksecurefunc("AchievementObjectives_DisplayCriteria", function(A, B) local C = GetAchievementNumCriteria(B) local D, E = 0, 0; @@ -328,7 +445,7 @@ local function AchievementStyle() end end end) -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/alert.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/alert.lua index 474c3ad..07e8370 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/alert.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/alert.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -31,7 +31,7 @@ ALERTFRAME STYLER ########################################################## ]]-- local function AlertStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.alertframes ~= true then return end + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.alertframes ~= true then return end for i = 1, 4 do local alert = _G["SVUI_SystemAlert"..i]; @@ -39,7 +39,7 @@ local function AlertStyle() for b = 1, 3 do alert.buttons[b]:SetButtonTemplate() end - alert:Formula409() + alert:RemoveTextures() STYLE:ApplyAlertStyle(alert) alert.input:SetEditboxTemplate() alert.input.Panel:Point("TOPLEFT", -2, -4) @@ -62,16 +62,16 @@ local function AlertStyle() frame.Panel:Point("BOTTOMRIGHT", _G[frame:GetName().."Background"], "BOTTOMRIGHT", -2, 6) end _G["AchievementAlertFrame"..i.."Background"]:SetTexture(0,0,0,0) - _G["AchievementAlertFrame"..i.."OldAchievement"]:MUNG() - _G["AchievementAlertFrame"..i.."Glow"]:MUNG() - _G["AchievementAlertFrame"..i.."Shine"]:MUNG() - _G["AchievementAlertFrame"..i.."GuildBanner"]:MUNG() - _G["AchievementAlertFrame"..i.."GuildBorder"]:MUNG() + _G["AchievementAlertFrame"..i.."OldAchievement"]:Die() + _G["AchievementAlertFrame"..i.."Glow"]:Die() + _G["AchievementAlertFrame"..i.."Shine"]:Die() + _G["AchievementAlertFrame"..i.."GuildBanner"]:Die() + _G["AchievementAlertFrame"..i.."GuildBorder"]:Die() _G["AchievementAlertFrame"..i.."Unlocked"]:SetFontTemplate(nil, 12) _G["AchievementAlertFrame"..i.."Unlocked"]:SetTextColor(1, 1, 1) _G["AchievementAlertFrame"..i.."Name"]:SetFontTemplate(nil, 12) _G["AchievementAlertFrame"..i.."IconTexture"]:SetTexCoord(0.1, 0.9, 0.1, 0.9) - _G["AchievementAlertFrame"..i.."IconOverlay"]:MUNG() + _G["AchievementAlertFrame"..i.."IconOverlay"]:Die() _G["AchievementAlertFrame"..i.."IconTexture"]:ClearAllPoints() _G["AchievementAlertFrame"..i.."IconTexture"]:Point("LEFT", frame, 7, 0) if not _G["AchievementAlertFrame"..i.."IconTexture"].b then @@ -95,15 +95,15 @@ local function AlertStyle() 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() - frame.raidArt:MUNG() - frame.dungeonArt1:MUNG() - frame.dungeonArt2:MUNG() - frame.dungeonArt3:MUNG() - frame.dungeonArt4:MUNG() - frame.heroicIcon:MUNG() + frame.shine:Die() + frame.glowFrame:Die() + frame.glowFrame.glow:Die() + frame.raidArt:Die() + frame.dungeonArt1:Die() + frame.dungeonArt2:Die() + frame.dungeonArt3:Die() + frame.dungeonArt4:Die() + frame.heroicIcon:Die() frame.dungeonTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9) frame.dungeonTexture:SetDrawLayer("OVERLAY") frame.dungeonTexture:ClearAllPoints() @@ -130,11 +130,11 @@ local function AlertStyle() end local j = select(2, frame:GetRegions()) if j:GetObjectType() == "Texture"then - if j:GetTexture() == "Interface\\GuildFrame\\GuildChallenges"then j:MUNG()end + if j:GetTexture() == "Interface\\GuildFrame\\GuildChallenges"then j:Die()end end - GuildChallengeAlertFrameGlow:MUNG() - GuildChallengeAlertFrameShine:MUNG() - GuildChallengeAlertFrameEmblemBorder:MUNG() + GuildChallengeAlertFrameGlow:Die() + GuildChallengeAlertFrameShine:Die() + GuildChallengeAlertFrameEmblemBorder:Die() if not GuildChallengeAlertFrameEmblemIcon.b then GuildChallengeAlertFrameEmblemIcon.b = CreateFrame("Frame", nil, frame) GuildChallengeAlertFrameEmblemIcon.b:SetFixedPanelTemplate("Default") @@ -159,13 +159,13 @@ local function AlertStyle() 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 + if j:GetTexture() == "Interface\\Challenges\\challenges-main" then j:Die() end end end - ChallengeModeAlertFrame1Shine:MUNG() - ChallengeModeAlertFrame1GlowFrame:MUNG() - ChallengeModeAlertFrame1GlowFrame.glow:MUNG() - ChallengeModeAlertFrame1Border:MUNG() + ChallengeModeAlertFrame1Shine:Die() + ChallengeModeAlertFrame1GlowFrame:Die() + ChallengeModeAlertFrame1GlowFrame.glow:Die() + ChallengeModeAlertFrame1Border:Die() ChallengeModeAlertFrame1DungeonTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9) ChallengeModeAlertFrame1DungeonTexture:ClearAllPoints() ChallengeModeAlertFrame1DungeonTexture:Point("LEFT", frame.Panel, 9, 0) @@ -191,12 +191,12 @@ local function AlertStyle() 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 + if j:GetTexture() == "Interface\\Scenarios\\ScenariosParts" then j:Die() end end end - ScenarioAlertFrame1Shine:MUNG() - ScenarioAlertFrame1GlowFrame:MUNG() - ScenarioAlertFrame1GlowFrame.glow:MUNG() + ScenarioAlertFrame1Shine:Die() + ScenarioAlertFrame1GlowFrame:Die() + ScenarioAlertFrame1GlowFrame.glow:Die() ScenarioAlertFrame1DungeonTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9) ScenarioAlertFrame1DungeonTexture:ClearAllPoints() ScenarioAlertFrame1DungeonTexture:Point("LEFT", frame.Panel, 9, 0) @@ -222,11 +222,11 @@ local function AlertStyle() end _G["CriteriaAlertFrame"..i.."Unlocked"]:SetTextColor(1, 1, 1) _G["CriteriaAlertFrame"..i.."Name"]:SetTextColor(1, 1, 0) - _G["CriteriaAlertFrame"..i.."Background"]:MUNG() - _G["CriteriaAlertFrame"..i.."Glow"]:MUNG() - _G["CriteriaAlertFrame"..i.."Shine"]:MUNG() - _G["CriteriaAlertFrame"..i.."IconBling"]:MUNG() - _G["CriteriaAlertFrame"..i.."IconOverlay"]:MUNG() + _G["CriteriaAlertFrame"..i.."Background"]:Die() + _G["CriteriaAlertFrame"..i.."Glow"]:Die() + _G["CriteriaAlertFrame"..i.."Shine"]:Die() + _G["CriteriaAlertFrame"..i.."IconBling"]:Die() + _G["CriteriaAlertFrame"..i.."IconOverlay"]:Die() if not _G["CriteriaAlertFrame"..i.."IconTexture"].b then _G["CriteriaAlertFrame"..i.."IconTexture"].b = CreateFrame("Frame", nil, frame) _G["CriteriaAlertFrame"..i.."IconTexture"].b:SetFixedPanelTemplate("Default") @@ -245,11 +245,11 @@ local function AlertStyle() if frame then frame:SetAlpha(1) hooksecurefunc(frame, "SetAlpha", AlphaHelper) - frame.Background:MUNG() + frame.Background:Die() frame.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - frame.IconBorder:MUNG() - frame.glow:MUNG() - frame.shine:MUNG() + frame.IconBorder:Die() + frame.glow:Die() + frame.shine:Die() if not frame.Icon.b then frame.Icon.b = CreateFrame("Frame", nil, frame) frame.Icon.b:SetFixedPanelTemplate("Default") @@ -271,9 +271,9 @@ local function AlertStyle() if frame then frame:SetAlpha(1) hooksecurefunc(frame, "SetAlpha", AlphaHelper) - frame.Background:MUNG() + frame.Background:Die() frame.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - frame.IconBorder:MUNG() + frame.IconBorder:Die() if not frame.Icon.b then frame.Icon.b = CreateFrame("Frame", nil, frame) frame.Icon.b:SetFixedPanelTemplate("Default") @@ -292,9 +292,9 @@ local function AlertStyle() local frame = BonusRollMoneyWonFrame; frame:SetAlpha(1) hooksecurefunc(frame, "SetAlpha", AlphaHelper) - frame.Background:MUNG() + frame.Background:Die() frame.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - frame.IconBorder:MUNG() + frame.IconBorder:Die() frame.Icon.b = CreateFrame("Frame", nil, frame) frame.Icon.b:SetFixedPanelTemplate("Default") frame.Icon.b:WrapOuter(frame.Icon) @@ -306,11 +306,11 @@ local function AlertStyle() local frame = BonusRollLootWonFrame; frame:SetAlpha(1) hooksecurefunc(frame, "SetAlpha", AlphaHelper) - frame.Background:MUNG() + frame.Background:Die() frame.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - frame.IconBorder:MUNG() - frame.glow:MUNG() - frame.shine:MUNG() + frame.IconBorder:Die() + frame.glow:Die() + frame.shine:Die() frame.Icon.b = CreateFrame("Frame", nil, frame) frame.Icon.b:SetFixedPanelTemplate("Default") frame.Icon.b:WrapOuter(frame.Icon) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/archeology.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/archeology.lua index 4bff2f3..de2c73c 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/archeology.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/archeology.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -24,11 +24,13 @@ ARCHEOLOGYFRAME STYLER local progressBarHolder = CreateFrame("Frame", "SVUI_ArcheologyProgressBar", nil) progressBarHolder:SetSize(240, 24) progressBarHolder:SetPoint("BOTTOM", CastingBarFrame, "TOP", 0, 10) -SuperVillain:SetSVMovable(progressBarHolder, "Archeology Progress Bar") +SV:SetSVMovable(progressBarHolder, "Archeology Progress Bar") local function ArchaeologyStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.archaeology ~= true then return end ArchaeologyFrame:Formula409() - ArchaeologyFrameInset:Formula409() + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.archaeology ~= true then return end + + ArchaeologyFrame:RemoveTextures() + ArchaeologyFrameInset:RemoveTextures() ArchaeologyFrame:SetPanelTemplate("Halftone") ArchaeologyFrame.Panel:SetAllPoints() ArchaeologyFrame.portrait:SetAlpha(0) @@ -41,18 +43,21 @@ local function ArchaeologyStyle() STYLE:ApplyDropdownStyle(ArchaeologyFrameRaceFilter, 125) STYLE:ApplyPaginationStyle(ArchaeologyFrameCompletedPageNextPageButton) STYLE:ApplyPaginationStyle(ArchaeologyFrameCompletedPagePrevPageButton) - ArchaeologyFrameRankBar:Formula409() + ArchaeologyFrameRankBar:RemoveTextures() ArchaeologyFrameRankBar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) ArchaeologyFrameRankBar:SetFrameLevel(ArchaeologyFrameRankBar:GetFrameLevel()+2) ArchaeologyFrameRankBar:SetPanelTemplate("Default") - ArchaeologyFrameArtifactPageSolveFrameStatusBar:Formula409() + ArchaeologyFrameArtifactPageSolveFrameStatusBar:RemoveTextures() ArchaeologyFrameArtifactPageSolveFrameStatusBar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) ArchaeologyFrameArtifactPageSolveFrameStatusBar:SetStatusBarColor(0.7, 0.2, 0) ArchaeologyFrameArtifactPageSolveFrameStatusBar:SetFrameLevel(ArchaeologyFrameArtifactPageSolveFrameStatusBar:GetFrameLevel()+2) - ArchaeologyFrameArtifactPageSolveFrameStatusBar:SetPanelTemplate("Default")for b = 1, ARCHAEOLOGY_MAX_COMPLETED_SHOWN do local c = _G["ArchaeologyFrameCompletedPageArtifact"..b] + ArchaeologyFrameArtifactPageSolveFrameStatusBar:SetPanelTemplate("Default") + + for b = 1, ARCHAEOLOGY_MAX_COMPLETED_SHOWN do + local c = _G["ArchaeologyFrameCompletedPageArtifact"..b] if c then - _G["ArchaeologyFrameCompletedPageArtifact"..b.."Border"]:MUNG() - _G["ArchaeologyFrameCompletedPageArtifact"..b.."Bg"]:MUNG() + _G["ArchaeologyFrameCompletedPageArtifact"..b.."Border"]:Die() + _G["ArchaeologyFrameCompletedPageArtifact"..b.."Bg"]:Die() _G["ArchaeologyFrameCompletedPageArtifact"..b.."Icon"]:SetTexCoord(0.1, 0.9, 0.1, 0.9) _G["ArchaeologyFrameCompletedPageArtifact"..b.."Icon"].backdrop = CreateFrame("Frame", nil, c) _G["ArchaeologyFrameCompletedPageArtifact"..b.."Icon"].backdrop:SetFixedPanelTemplate("Default") @@ -60,7 +65,8 @@ local function ArchaeologyStyle() _G["ArchaeologyFrameCompletedPageArtifact"..b.."Icon"].backdrop:SetFrameLevel(c:GetFrameLevel()-2) _G["ArchaeologyFrameCompletedPageArtifact"..b.."Icon"]:SetDrawLayer("OVERLAY") end - end + end + ArchaeologyFrameArtifactPageIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9) ArchaeologyFrameArtifactPageIcon.backdrop = CreateFrame("Frame", nil, ArchaeologyFrameArtifactPage) ArchaeologyFrameArtifactPageIcon.backdrop:SetFixedPanelTemplate("Default") diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/auctionhouse.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/auctionhouse.lua index 87c46e5..3a9616b 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/auctionhouse.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/auctionhouse.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -50,18 +50,9 @@ local AuctionBidButtons = { "AuctionsCloseButton", "BrowseResetButton", "AuctionsStackSizeMaxButton", - "AuctionsNumStacksMaxButton" -} -local AuctionMoneyFields = { - "BrowseBidPriceSilver", - "BrowseBidPriceCopper", - "BidBidPriceSilver", - "BidBidPriceCopper", - "StartPriceSilver", - "StartPriceCopper", - "BuyoutPriceSilver", - "BuyoutPriceCopper" + "AuctionsNumStacksMaxButton", } + local AuctionTextFields = { "BrowseName", "BrowseMinLevel", @@ -71,7 +62,15 @@ local AuctionTextFields = { "AuctionsStackSizeEntry", "AuctionsNumStacksEntry", "StartPriceGold", - "BuyoutPriceGold" + "BuyoutPriceGold", + "BrowseBidPriceSilver", + "BrowseBidPriceCopper", + "BidBidPriceSilver", + "BidBidPriceCopper", + "StartPriceSilver", + "StartPriceCopper", + "BuyoutPriceSilver", + "BuyoutPriceCopper" } --[[ ########################################################## @@ -79,15 +78,19 @@ AUCTIONFRAME STYLER ########################################################## ]]-- local function AuctionStyle() - if(SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.auctionhouse ~= true) then return end; + --STYLE.Debugging = true + if(SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.auctionhouse ~= true) then return end + + STYLE:ApplyWindowStyle(AuctionFrame, false, true) + + BrowseFilterScrollFrame:RemoveTextures() + BrowseScrollFrame:RemoveTextures() + AuctionsScrollFrame:RemoveTextures() + BidScrollFrame:RemoveTextures() + STYLE:ApplyCloseButtonStyle(AuctionFrameCloseButton) STYLE:ApplyScrollFrameStyle(AuctionsScrollFrameScrollBar) - AuctionFrame:Formula409(true) - AuctionFrame:SetPanelTemplate("Halftone", false, 2) - BrowseFilterScrollFrame:Formula409() - BrowseScrollFrame:Formula409() - AuctionsScrollFrame:Formula409() - BidScrollFrame:Formula409() + STYLE:ApplyDropdownStyle(BrowseDropDown) STYLE:ApplyDropdownStyle(PriceDropDown) STYLE:ApplyDropdownStyle(DurationDropDown) @@ -95,17 +98,18 @@ local function AuctionStyle() STYLE:ApplyScrollFrameStyle(BrowseScrollFrameScrollBar) IsUsableCheckButton:SetCheckboxTemplate(true) ShowOnPlayerCheckButton:SetCheckboxTemplate(true) - ExactMatchCheckButton:SetCheckboxTemplate(true) - SideDressUpFrame:Formula409(true) + + --ExactMatchCheckButton:SetCheckboxTemplate(true) + + SideDressUpFrame:RemoveTextures(true) SideDressUpFrame:SetPanelTemplate("Halftone") SideDressUpFrame:Point("TOPLEFT", AuctionFrame, "TOPRIGHT", 7, 0) - SideDressUpModel:Formula409(true) - SideDressUpModel:SetFixedPanelTemplate("Comic") - SideDressUpModel:SetPanelColor("special") + SideDressUpModel:RemoveTextures(true) + SideDressUpModel:SetFixedPanelTemplate("ModelComic") SideDressUpModelResetButton:SetButtonTemplate() STYLE:ApplyCloseButtonStyle(SideDressUpModelCloseButton) - AuctionProgressFrame:Formula409() + AuctionProgressFrame:RemoveTextures() AuctionProgressFrame:SetFixedPanelTemplate("Transparent", true) AuctionProgressFrameCancelButton:SetButtonTemplate() AuctionProgressFrameCancelButton:SetFixedPanelTemplate("Default") @@ -123,17 +127,20 @@ local function AuctionStyle() AuctionProgressBarText:ClearAllPoints() AuctionProgressBarText:SetPoint("CENTER") - AuctionProgressBar:Formula409() + AuctionProgressBar:RemoveTextures() AuctionProgressBar:SetPanelTemplate("Default") - AuctionProgressBar:SetStatusBarTexture(SuperVillain.Media.bar.default) + AuctionProgressBar:SetStatusBarTexture(SV.Media.bar.default) AuctionProgressBar:SetStatusBarColor(1, 1, 0) STYLE:ApplyPaginationStyle(BrowseNextPageButton) STYLE:ApplyPaginationStyle(BrowsePrevPageButton) - for _,button in pairs(AuctionBidButtons) do - _G[button]:SetButtonTemplate() - end; + for _,gName in pairs(AuctionBidButtons) do + if(_G[gName]) then + _G[gName]:RemoveTextures() + _G[gName]:SetButtonTemplate() + end + end AuctionsCloseButton:Point("BOTTOMRIGHT", AuctionFrameAuctions, "BOTTOMRIGHT", 66, 10) AuctionsCancelAuctionButton:Point("RIGHT", AuctionsCloseButton, "LEFT", -4, 0) @@ -144,7 +151,7 @@ local function AuctionStyle() BrowseBuyoutButton:Point("RIGHT", BrowseCloseButton, "LEFT", -4, 0) BrowseBidButton:Point("RIGHT", BrowseBuyoutButton, "LEFT", -4, 0) - AuctionsItemButton:Formula409() + AuctionsItemButton:RemoveTextures() AuctionsItemButton:SetButtonTemplate() AuctionsItemButton:SetScript("OnUpdate", function() if AuctionsItemButton:GetNormalTexture()then @@ -154,32 +161,46 @@ local function AuctionStyle() end) for _,frame in pairs(AuctionSortLinks)do - _G[frame.."Left"]:MUNG() - _G[frame.."Middle"]:MUNG() - _G[frame.."Right"]:MUNG() - end; + _G[frame.."Left"]:Die() + _G[frame.."Middle"]:Die() + _G[frame.."Right"]:Die() + end STYLE:ApplyTabStyle(_G["AuctionFrameTab1"]) STYLE:ApplyTabStyle(_G["AuctionFrameTab2"]) STYLE:ApplyTabStyle(_G["AuctionFrameTab3"]) - for h = 1, NUM_FILTERS_TO_DISPLAY do - local i = _G["AuctionFilterButton"..h]i:Formula409() - i:SetButtonTemplate() - end; + AuctionFrameBrowse.bg1 = CreateFrame("Frame", nil, AuctionFrameBrowse) + AuctionFrameBrowse.bg1:Point("TOPLEFT", 20, -103) + AuctionFrameBrowse.bg1:Point("BOTTOMRIGHT", -575, 40) + AuctionFrameBrowse.bg1:SetFixedPanelTemplate("Inset") - for _,field in pairs(AuctionTextFields)do + BrowseNoResultsText:SetParent(AuctionFrameBrowse.bg1) + BrowseSearchCountText:SetParent(AuctionFrameBrowse.bg1) + + BrowseResetButton:Point("TOPLEFT", AuctionFrameBrowse, "TOPLEFT", 81, -74) + BrowseSearchButton:Point("TOPRIGHT", AuctionFrameBrowse, "TOPRIGHT", 25, -34) + + AuctionFrameBrowse.bg1:SetFrameLevel(AuctionFrameBrowse.bg1:GetFrameLevel()-1) + BrowseFilterScrollFrame:Height(300) + AuctionFrameBrowse.bg2 = CreateFrame("Frame", nil, AuctionFrameBrowse) + AuctionFrameBrowse.bg2:SetFixedPanelTemplate("Inset") + AuctionFrameBrowse.bg2:Point("TOPLEFT", AuctionFrameBrowse.bg1, "TOPRIGHT", 4, 0) + AuctionFrameBrowse.bg2:Point("BOTTOMRIGHT", AuctionFrame, "BOTTOMRIGHT", -8, 40) + AuctionFrameBrowse.bg2:SetFrameLevel(AuctionFrameBrowse.bg2:GetFrameLevel() - 1) + + for i = 1, NUM_FILTERS_TO_DISPLAY do + local header = _G[("AuctionFilterButton%d"):format(i)] + if(header) then + header:RemoveTextures() + header:SetButtonTemplate() + end + end + + for _,field in pairs(AuctionTextFields)do _G[field]:SetEditboxTemplate() _G[field]:SetTextInsets(-1, -1, -2, -2) - end; - - for _,field in pairs(AuctionMoneyFields)do - local frame = _G[field] - frame:SetEditboxTemplate() - frame.Panel:Point("TOPLEFT", -2, 1) - frame.Panel:Point("BOTTOMRIGHT", -12, -1) - frame:SetTextInsets(-1, -1, -2, -2) - end; + end BrowseMaxLevel:Point("LEFT", BrowseMinLevel, "RIGHT", 8, 0) AuctionsStackSizeEntry.Panel:SetAllPoints() @@ -194,21 +215,17 @@ local function AuctionStyle() if(buttonTex) then buttonTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) buttonTex:FillInner() - end; + end - if(not button.styled) then - button:Formula409() - button:SetButtonTemplate() - end + button:RemoveTextures() + button:SetButtonTemplate() if(buttonItem) then - if(not buttonItem.styled) then - buttonItem:SetButtonTemplate() - buttonItem.Panel:SetAllPoints() - buttonItem:HookScript("OnUpdate", function() - buttonItem:GetNormalTexture():MUNG() - end) - end; + buttonItem:SetButtonTemplate() + buttonItem.Panel:SetAllPoints() + buttonItem:HookScript("OnUpdate", function() + buttonItem:GetNormalTexture():Die() + end) local highLight = button:GetHighlightTexture() _G["BrowseButton"..h.."Highlight"] = highLight @@ -216,9 +233,9 @@ local function AuctionStyle() highLight:Point("TOPLEFT", buttonItem, "TOPRIGHT", 2, 0) highLight:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 5) button:GetPushedTexture():SetAllPoints(highLight) - end; + end end - end; + end for h = 1, NUM_AUCTIONS_TO_DISPLAY do local button = _G["AuctionsButton"..h]; @@ -229,21 +246,17 @@ local function AuctionStyle() if(buttonTex) then buttonTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) buttonTex:FillInner() - end; + end - if(not button.styled) then - button:Formula409() - button:SetButtonTemplate() - end + button:RemoveTextures() + button:SetButtonTemplate() if(buttonItem) then - if(not buttonItem.styled) then - buttonItem:SetButtonTemplate() - buttonItem.Panel:SetAllPoints() - buttonItem:HookScript("OnUpdate", function() - buttonItem:GetNormalTexture():MUNG() - end) - end; + buttonItem:SetButtonTemplate() + buttonItem.Panel:SetAllPoints() + buttonItem:HookScript("OnUpdate", function() + buttonItem:GetNormalTexture():Die() + end) local highLight = button:GetHighlightTexture() _G["AuctionsButton"..h.."Highlight"] = highLight @@ -251,9 +264,9 @@ local function AuctionStyle() highLight:Point("TOPLEFT", buttonItem, "TOPRIGHT", 2, 0) highLight:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 5) button:GetPushedTexture():SetAllPoints(highLight) - end; + end end - end; + end for h = 1, NUM_BIDS_TO_DISPLAY do local button = _G["BidButton"..h]; @@ -264,21 +277,17 @@ local function AuctionStyle() if(buttonTex) then buttonTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) buttonTex:FillInner() - end; + end - if(not button.styled) then - button:Formula409() - button:SetButtonTemplate() - end + button:RemoveTextures() + button:SetButtonTemplate() if(buttonItem) then - if(not buttonItem.styled) then - buttonItem:SetButtonTemplate() - buttonItem.Panel:SetAllPoints() - buttonItem:HookScript("OnUpdate", function() - buttonItem:GetNormalTexture():MUNG() - end) - end; + buttonItem:SetButtonTemplate() + buttonItem.Panel:SetAllPoints() + buttonItem:HookScript("OnUpdate", function() + buttonItem:GetNormalTexture():Die() + end) local highLight = button:GetHighlightTexture() _G["BidButton"..h.."Highlight"] = highLight @@ -286,23 +295,10 @@ local function AuctionStyle() highLight:Point("TOPLEFT", buttonItem, "TOPRIGHT", 2, 0) highLight:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -2, 5) button:GetPushedTexture():SetAllPoints(highLight) - end; + end end - end; + end - AuctionFrameBrowse.bg1 = CreateFrame("Frame", nil, AuctionFrameBrowse) - AuctionFrameBrowse.bg1:SetFixedPanelTemplate("Inset") - AuctionFrameBrowse.bg1:Point("TOPLEFT", 20, -103) - AuctionFrameBrowse.bg1:Point("BOTTOMRIGHT", -575, 40) - BrowseNoResultsText:SetParent(AuctionFrameBrowse.bg1) - BrowseSearchCountText:SetParent(AuctionFrameBrowse.bg1) - AuctionFrameBrowse.bg1:SetFrameLevel(AuctionFrameBrowse.bg1:GetFrameLevel()-1) - BrowseFilterScrollFrame:Height(300) - AuctionFrameBrowse.bg2 = CreateFrame("Frame", nil, AuctionFrameBrowse) - AuctionFrameBrowse.bg2:SetFixedPanelTemplate("Inset") - AuctionFrameBrowse.bg2:Point("TOPLEFT", AuctionFrameBrowse.bg1, "TOPRIGHT", 4, 0) - AuctionFrameBrowse.bg2:Point("BOTTOMRIGHT", AuctionFrame, "BOTTOMRIGHT", -8, 40) - AuctionFrameBrowse.bg2:SetFrameLevel(AuctionFrameBrowse.bg2:GetFrameLevel() - 1) BrowseScrollFrame:Height(300) AuctionFrameBid.bg = CreateFrame("Frame", nil, AuctionFrameBid) AuctionFrameBid.bg:SetFixedPanelTemplate("Inset") @@ -321,7 +317,7 @@ local function AuctionStyle() AuctionFrameAuctions.bg2:Point("TOPLEFT", AuctionFrameAuctions.bg1, "TOPRIGHT", 3, 0) AuctionFrameAuctions.bg2:Point("BOTTOMRIGHT", AuctionFrame, -8, 35) AuctionFrameAuctions.bg2:SetFrameLevel(AuctionFrameAuctions.bg2:GetFrameLevel() - 2) -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/barbershop.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/barbershop.lua index f1cba95..557e700 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/barbershop.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/barbershop.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -21,13 +21,13 @@ BARBERSHOP STYLER ########################################################## ]]-- local function BarberShopStyle() - if SuperVillain.db.SVStyle.blizzard.enable~=true or SuperVillain.db.SVStyle.blizzard.barber~=true then return end; + if SV.db.SVStyle.blizzard.enable~=true or SV.db.SVStyle.blizzard.barber~=true then return end local buttons = {"BarberShopFrameOkayButton", "BarberShopFrameCancelButton", "BarberShopFrameResetButton"} BarberShopFrameOkayButton:Point("RIGHT", BarberShopFrameSelector4, "BOTTOM", 2, -50) for b = 1, #buttons do - _G[buttons[b]]:Formula409() + _G[buttons[b]]:RemoveTextures() _G[buttons[b]]:SetButtonTemplate() - end; + end for b = 1, 4 do local c = _G["BarberShopFrameSelector"..b] local d = _G["BarberShopFrameSelector"..b-1] @@ -35,28 +35,28 @@ local function BarberShopStyle() STYLE:ApplyPaginationStyle(_G["BarberShopFrameSelector"..b.."Next"]) if b ~= 1 then c:ClearAllPoints()c:Point("TOP", d, "BOTTOM", 0, -3) - end; + end if c then - c:Formula409() + c:RemoveTextures() end - end; + end BarberShopFrameSelector1:ClearAllPoints() BarberShopFrameSelector1:Point("TOP", 0, -12) BarberShopFrameResetButton:ClearAllPoints() BarberShopFrameResetButton:Point("BOTTOM", 0, 12) - BarberShopFrame:Formula409() + BarberShopFrame:RemoveTextures() BarberShopFrame:SetPanelTemplate("Halftone") BarberShopFrame:Size(BarberShopFrame:GetWidth()-30, BarberShopFrame:GetHeight()-56) - BarberShopFrameMoneyFrame:Formula409() + BarberShopFrameMoneyFrame:RemoveTextures() BarberShopFrameMoneyFrame:SetPanelTemplate() - BarberShopFrameBackground:MUNG() - BarberShopBannerFrameBGTexture:MUNG() - BarberShopBannerFrame:MUNG() - BarberShopAltFormFrameBorder:Formula409() + BarberShopFrameBackground:Die() + BarberShopBannerFrameBGTexture:Die() + BarberShopBannerFrame:Die() + BarberShopAltFormFrameBorder:RemoveTextures() BarberShopAltFormFrame:Point("BOTTOM", BarberShopFrame, "TOP", 0, 5) - BarberShopAltFormFrame:Formula409() + BarberShopAltFormFrame:RemoveTextures() BarberShopAltFormFrame:SetBasicPanel() -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/battlefield.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/battlefield.lua index 3e71a7b..f4ea85a 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/battlefield.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/battlefield.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -21,14 +21,14 @@ BATTLEFIELD STYLER ########################################################## ]]-- local function BattlefieldStyle() - if SuperVillain.db.SVStyle.blizzard.enable~=true or SuperVillain.db.SVStyle.blizzard.bgmap~=true then return end; + if SV.db.SVStyle.blizzard.enable~=true or SV.db.SVStyle.blizzard.bgmap~=true then return end BattlefieldMinimap:SetClampedToScreen(true) - BattlefieldMinimapCorner:MUNG() - BattlefieldMinimapBackground:MUNG() - BattlefieldMinimapTab:MUNG() - BattlefieldMinimapTabLeft:MUNG() - BattlefieldMinimapTabMiddle:MUNG() - BattlefieldMinimapTabRight:MUNG() + BattlefieldMinimapCorner:Die() + BattlefieldMinimapBackground:Die() + BattlefieldMinimapTab:Die() + BattlefieldMinimapTabLeft:Die() + BattlefieldMinimapTabMiddle:Die() + BattlefieldMinimapTabRight:Die() BattlefieldMinimap:SetFixedPanelTemplate("Transparent") BattlefieldMinimap.Panel:Point("BOTTOMRIGHT", -4, 2) BattlefieldMinimap:SetFrameStrata("LOW") @@ -83,7 +83,7 @@ local function BattlefieldStyle() BattlefieldMinimap_UpdateOpacity(i)i = nil end end) -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/blackmarket.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/blackmarket.lua index ccdf5c6..9305856 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/blackmarket.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/blackmarket.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -21,21 +21,21 @@ BLACKMARKET STYLER ########################################################## ]]-- local function BlackMarketStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.bmah ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.bmah ~= true then return - end; + end local ChangeTab = function(p) p.Left:SetAlpha(0) if p.Middle then p.Middle:SetAlpha(0) - end; + end p.Right:SetAlpha(0) - end; + end - BlackMarketFrame:Formula409() + BlackMarketFrame:RemoveTextures() BlackMarketFrame:SetPanelTemplate("Halftone") - BlackMarketFrame.Inset:Formula409() + BlackMarketFrame.Inset:RemoveTextures() BlackMarketFrame.Inset:SetFixedPanelTemplate("Inset") STYLE:ApplyCloseButtonStyle(BlackMarketFrame.CloseButton) STYLE:ApplyScrollFrameStyle(BlackMarketScrollFrameScrollBar, 4) @@ -47,7 +47,7 @@ local function BlackMarketStyle() ChangeTab(BlackMarketFrame.ColumnHighBidder) ChangeTab(BlackMarketFrame.ColumnCurrentBid) - BlackMarketFrame.MoneyFrameBorder:Formula409() + BlackMarketFrame.MoneyFrameBorder:RemoveTextures() BlackMarketBidPriceGold:SetEditboxTemplate() BlackMarketBidPriceGold.Panel:Point("TOPLEFT", -2, 0) BlackMarketBidPriceGold.Panel:Point("BOTTOMRIGHT", -2, 0) @@ -61,11 +61,11 @@ local function BlackMarketStyle() local u = buttons[b] local v = s+b; if not u.styled then - u:Formula409() + u:RemoveTextures() u:SetButtonTemplate() STYLE:ApplyItemButtonStyle(u.Item) u.styled = true - end; + end if v <= t then local w, x = C_BlackMarket.GetItemInfoByIndex(v) if w then @@ -74,7 +74,7 @@ local function BlackMarketStyle() end end end) - BlackMarketFrame.HotDeal:Formula409() + BlackMarketFrame.HotDeal:RemoveTextures() STYLE:ApplyItemButtonStyle(BlackMarketFrame.HotDeal.Item) for b = 1, BlackMarketFrame:GetNumRegions()do local y = select(b, BlackMarketFrame:GetRegions()) @@ -82,7 +82,7 @@ local function BlackMarketStyle() y:ClearAllPoints()y:SetPoint("TOP", BlackMarketFrame, "TOP", 0, -4) end end -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/calendar.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/calendar.lua index 7e14675..45ea3b0 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/calendar.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/calendar.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -32,11 +32,12 @@ CALENDAR STYLER ########################################################## ]]-- local function CalendarStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.calendar ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.calendar ~= true then return - end - _G["CalendarFrame"]:Formula409() - CalendarFrame:SetPanelTemplate("Halftone") + end + + STYLE:ApplyWindowStyle(CalendarFrame) + STYLE:ApplyCloseButtonStyle(CalendarCloseButton) CalendarCloseButton:Point("TOPRIGHT", CalendarFrame, "TOPRIGHT", -4, -4) STYLE:ApplyPaginationStyle(CalendarPrevMonthButton) @@ -46,7 +47,7 @@ local function CalendarStyle() local cfframe = _G["CalendarFilterFrame"]; if(cfframe) then - cfframe:Formula409() + cfframe:RemoveTextures() cfframe:Width(155) cfframe:SetPanelTemplate("Default") @@ -85,21 +86,21 @@ local function CalendarStyle() for u = 1, 42 do _G["CalendarDayButton"..u]:SetFrameLevel(_G["CalendarDayButton"..u]:GetFrameLevel()+1) end - CalendarCreateEventFrame:Formula409() + CalendarCreateEventFrame:RemoveTextures() CalendarCreateEventFrame:SetFixedPanelTemplate("Transparent", true) CalendarCreateEventFrame:Point("TOPLEFT", CalendarFrame, "TOPRIGHT", 3, -24) - CalendarCreateEventTitleFrame:Formula409() + CalendarCreateEventTitleFrame:RemoveTextures() CalendarCreateEventCreateButton:SetButtonTemplate() CalendarCreateEventMassInviteButton:SetButtonTemplate() CalendarCreateEventInviteButton:SetButtonTemplate() CalendarCreateEventInviteButton:Point("TOPLEFT", CalendarCreateEventInviteEdit, "TOPRIGHT", 4, 1) CalendarCreateEventInviteEdit:Width(CalendarCreateEventInviteEdit:GetWidth()-2) - CalendarCreateEventInviteList:Formula409() + CalendarCreateEventInviteList:RemoveTextures() CalendarCreateEventInviteList:SetFixedPanelTemplate("Default") CalendarCreateEventInviteEdit:SetEditboxTemplate() CalendarCreateEventTitleEdit:SetEditboxTemplate() STYLE:ApplyDropdownStyle(CalendarCreateEventTypeDropDown, 120) - CalendarCreateEventDescriptionContainer:Formula409() + CalendarCreateEventDescriptionContainer:RemoveTextures() CalendarCreateEventDescriptionContainer:SetFixedPanelTemplate("Default") STYLE:ApplyCloseButtonStyle(CalendarCreateEventCloseButton) CalendarCreateEventLockEventCheck:SetCheckboxTemplate(true) @@ -114,10 +115,10 @@ local function CalendarStyle() f:SetTexCoord(0.1, 0.9, 0.1, 0.9) end end) - CalendarCreateEventInviteListSection:Formula409() + CalendarCreateEventInviteListSection:RemoveTextures() CalendarClassButtonContainer:HookScript("OnShow", function() for u, D in ipairs(CLASS_SORT_ORDER)do - local e = _G["CalendarClassButton"..u]e:Formula409() + local e = _G["CalendarClassButton"..u]e:RemoveTextures() e:SetPanelTemplate("Default") local E = CLASS_ICON_TCOORDS[D] local F = e:GetNormalTexture() @@ -125,51 +126,51 @@ local function CalendarStyle() F:SetTexCoord(E[1]+0.015, E[2]-0.02, E[3]+0.018, E[4]-0.02) end CalendarClassButton1:Point("TOPLEFT", CalendarClassButtonContainer, "TOPLEFT", 5, 0) - CalendarClassTotalsButton:Formula409() + CalendarClassTotalsButton:RemoveTextures() CalendarClassTotalsButton:SetPanelTemplate("Default") end) - CalendarTexturePickerFrame:Formula409() - CalendarTexturePickerTitleFrame:Formula409() + CalendarTexturePickerFrame:RemoveTextures() + CalendarTexturePickerTitleFrame:RemoveTextures() CalendarTexturePickerFrame:SetFixedPanelTemplate("Transparent", true) STYLE:ApplyScrollFrameStyle(CalendarTexturePickerScrollBar) CalendarTexturePickerAcceptButton:SetButtonTemplate() CalendarTexturePickerCancelButton:SetButtonTemplate() CalendarCreateEventInviteButton:SetButtonTemplate() CalendarCreateEventRaidInviteButton:SetButtonTemplate() - CalendarMassInviteFrame:Formula409() + CalendarMassInviteFrame:RemoveTextures() CalendarMassInviteFrame:SetFixedPanelTemplate("Transparent", true) - CalendarMassInviteTitleFrame:Formula409() + CalendarMassInviteTitleFrame:RemoveTextures() STYLE:ApplyCloseButtonStyle(CalendarMassInviteCloseButton) CalendarMassInviteGuildAcceptButton:SetButtonTemplate() STYLE:ApplyDropdownStyle(CalendarMassInviteGuildRankMenu, 130) CalendarMassInviteGuildMinLevelEdit:SetEditboxTemplate() CalendarMassInviteGuildMaxLevelEdit:SetEditboxTemplate() - CalendarViewRaidFrame:Formula409() + CalendarViewRaidFrame:RemoveTextures() CalendarViewRaidFrame:SetFixedPanelTemplate("Transparent", true) CalendarViewRaidFrame:Point("TOPLEFT", CalendarFrame, "TOPRIGHT", 3, -24) - CalendarViewRaidTitleFrame:Formula409() + CalendarViewRaidTitleFrame:RemoveTextures() STYLE:ApplyCloseButtonStyle(CalendarViewRaidCloseButton) - CalendarViewHolidayFrame:Formula409(true) + CalendarViewHolidayFrame:RemoveTextures(true) CalendarViewHolidayFrame:SetFixedPanelTemplate("Transparent", true) CalendarViewHolidayFrame:Point("TOPLEFT", CalendarFrame, "TOPRIGHT", 3, -24) - CalendarViewHolidayTitleFrame:Formula409() + CalendarViewHolidayTitleFrame:RemoveTextures() STYLE:ApplyCloseButtonStyle(CalendarViewHolidayCloseButton) - CalendarViewEventFrame:Formula409() + CalendarViewEventFrame:RemoveTextures() CalendarViewEventFrame:SetFixedPanelTemplate("Transparent", true) CalendarViewEventFrame:Point("TOPLEFT", CalendarFrame, "TOPRIGHT", 3, -24) - CalendarViewEventTitleFrame:Formula409() - CalendarViewEventDescriptionContainer:Formula409() + CalendarViewEventTitleFrame:RemoveTextures() + CalendarViewEventDescriptionContainer:RemoveTextures() CalendarViewEventDescriptionContainer:SetFixedPanelTemplate("Transparent", true) - CalendarViewEventInviteList:Formula409() + CalendarViewEventInviteList:RemoveTextures() CalendarViewEventInviteList:SetFixedPanelTemplate("Transparent", true) - CalendarViewEventInviteListSection:Formula409() + CalendarViewEventInviteListSection:RemoveTextures() STYLE:ApplyCloseButtonStyle(CalendarViewEventCloseButton) STYLE:ApplyScrollFrameStyle(CalendarViewEventInviteListScrollFrameScrollBar) for _,btn in pairs(CalendarButtons)do _G[btn]:SetButtonTemplate() end - CalendarEventPickerFrame:Formula409() - CalendarEventPickerTitleFrame:Formula409() + CalendarEventPickerFrame:RemoveTextures() + CalendarEventPickerTitleFrame:RemoveTextures() CalendarEventPickerFrame:SetFixedPanelTemplate("Transparent", true) STYLE:ApplyScrollFrameStyle(CalendarEventPickerScrollBar) CalendarEventPickerCloseButton:SetButtonTemplate() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/challenges.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/challenges.lua index 910e142..ff6b263 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/challenges.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/challenges.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -21,8 +21,8 @@ CHALLENGES UI STYLER ########################################################## ]]-- local function ChallengesFrameStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.lfg ~= true then return end; - ChallengesFrameInset:Formula409() + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.lfg ~= true then return end + ChallengesFrameInset:RemoveTextures() ChallengesFrameInsetBg:Hide() ChallengesFrameDetails.bg:Hide() ChallengesFrameLeaderboard:SetButtonTemplate() @@ -39,8 +39,8 @@ local function ChallengesFrameStyle() v.selectedTex:SetAlpha(.2) v.selectedTex:SetPoint("TOPLEFT", 1, -1) v.selectedTex:SetPoint("BOTTOMRIGHT", -1, 1) - v.NoMedal:MUNG() - end; + v.NoMedal:Die() + end for u = 1, 3 do local F = ChallengesFrame["RewardRow"..u] for A = 1, 2 do @@ -49,7 +49,7 @@ local function ChallengesFrameStyle() v.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) end end -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/character.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/character.lua index 04e2845..860af88 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/character.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/character.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -59,8 +59,8 @@ local function SetItemFrame(frame, point) point.backdrop = frame:CreateTexture(nil, "BORDER") point.backdrop:SetDrawLayer("BORDER", -4) point.backdrop:SetAllPoints(point) - point.backdrop:SetTexture(SuperVillain.Media.bar.default) - point.backdrop:SetVertexColor(unpack(SuperVillain.Media.color.default)) + point.backdrop:SetTexture(SV.Media.bar.default) + point.backdrop:SetVertexColor(unpack(SV.Media.color.default)) point.bordertop = frame:CreateTexture(nil, "BORDER") point.bordertop:SetPoint("TOPLEFT", point, "TOPLEFT", -noscalemult, noscalemult) point.bordertop:SetPoint("TOPRIGHT", point, "TOPRIGHT", noscalemult, noscalemult) @@ -103,10 +103,10 @@ local function StyleCharacterSlots() charSlot:SetBackdropBorderColor(0,0,0,1) end end -end; +end local function EquipmentFlyout_OnShow() - EquipmentFlyoutFrameButtons:Formula409() + EquipmentFlyoutFrameButtons:RemoveTextures() local counter = 1; local button = _G["EquipmentFlyoutFrameButton"..counter] while button do @@ -119,11 +119,11 @@ local function EquipmentFlyout_OnShow() if not button.Panel then button:SetPanelTemplate("Default") button.Panel:SetAllPoints() - end; + end counter = counter + 1; button = _G["EquipmentFlyoutFrameButton"..counter] end -end; +end local function PaperDoll_UpdateTabs() for i = 1, #PAPERDOLL_SIDEBARS do @@ -135,7 +135,7 @@ local function PaperDoll_UpdateTabs() tab.Hider:SetTexture(0.4, 0.4, 0.4, 0.4) tab.Hider:Point("TOPLEFT", 3, -4) tab.Hider:Point("BOTTOMRIGHT", -1, 0) - tab.TabBg:MUNG() + tab.TabBg:Die() if i == 1 then for i = 1, tab:GetNumRegions()do local texture = select(i, tab:GetRegions()) @@ -146,13 +146,13 @@ local function PaperDoll_UpdateTabs() end end) end - end; + end tab:SetPanelTemplate("Default", true, 2) tab.Panel:Point("TOPLEFT", 2, -3) tab.Panel:Point("BOTTOMRIGHT", 0, -2) end end -end; +end local function Reputation_OnShow() for i = 1, GetNumFactions()do @@ -161,7 +161,7 @@ local function Reputation_OnShow() bar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) if not bar.Panel then bar:SetPanelTemplate("Inset") - end; + 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) @@ -171,16 +171,19 @@ local function Reputation_OnShow() _G["ReputationBar"..i.."ReputationBarRightTexture"]:SetTexture(0,0,0,0) end end -end; +end --[[ ########################################################## CHARACTERFRAME STYLER ########################################################## ]]-- local function CharacterFrameStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.character ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.character ~= true then return - end; + end + + STYLE:ApplyWindowStyle(CharacterFrame, true) + STYLE:ApplyCloseButtonStyle(CharacterFrameCloseButton) STYLE:ApplyScrollFrameStyle(CharacterStatsPaneScrollBar) STYLE:ApplyScrollFrameStyle(ReputationListScrollFrameScrollBar) @@ -191,16 +194,16 @@ local function CharacterFrameStyle() local charSlot = _G["Character"..slotName] local iconTex = _G["Character"..slotName.."IconTexture"] local cd = _G["Character"..slotName.."Cooldown"] - charSlot:Formula409() + charSlot:RemoveTextures() charSlot:SetSlotTemplate(true) charSlot.Panel:SetFrameLevel(charSlot.Panel:GetFrameLevel() + 1) charSlot.ignoreTexture:SetTexture([[Interface\PaperDollInfoFrame\UI-GearManager-LeaveItem-Transparent]]) iconTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) iconTex:FillInner(charSlot, 0, 0) if cd then - SuperVillain:AddCD(cd) + SV.Timers:AddCooldown(cd) end - end; + end local eqSlotListener = CreateFrame("Frame") eqSlotListener:RegisterEvent("PLAYER_EQUIPMENT_CHANGED") @@ -231,7 +234,7 @@ local function CharacterFrameStyle() SquareButton_SetIcon(CharacterFrameExpandButton, 'RIGHT') else SquareButton_SetIcon(CharacterFrameExpandButton, 'LEFT') - end; + end STYLE:ApplyCloseButtonStyle(ReputationDetailCloseButton) STYLE:ApplyCloseButtonStyle(TokenFramePopupCloseButton) @@ -241,21 +244,21 @@ local function CharacterFrameStyle() ReputationDetailLFGBonusReputationCheckBox:SetCheckboxTemplate(true) TokenFramePopupInactiveCheckBox:SetCheckboxTemplate(true) TokenFramePopupBackpackCheckBox:SetCheckboxTemplate(true) - EquipmentFlyoutFrameHighlight:MUNG() + EquipmentFlyoutFrameHighlight:Die() EquipmentFlyoutFrame:HookScript("OnShow", EquipmentFlyout_OnShow) hooksecurefunc("EquipmentFlyout_Show", EquipmentFlyout_OnShow) - CharacterFramePortrait:MUNG() + CharacterFramePortrait:Die() STYLE:ApplyScrollFrameStyle(_G["PaperDollTitlesPaneScrollBar"], 5) STYLE:ApplyScrollFrameStyle(_G["PaperDollEquipmentManagerPaneScrollBar"], 5) for _,btn in pairs(CharFrameList)do - _G[btn]:Formula409(true) - end; + _G[btn]:RemoveTextures(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) - CharacterFrame:SetPanelTemplate("Action") - CharacterModelFrame:SetPanelTemplate("Comic", false, 0) + + CharacterModelFrame:SetFixedPanelTemplate("ModelComic") CharacterFrameExpandButton:SetFrameLevel(CharacterModelFrame:GetFrameLevel() + 5) PaperDollTitlesPane:SetBasicPanel() @@ -267,7 +270,7 @@ local function CharacterFrameStyle() btn.BgMiddle:SetTexture(0,0,0,0) btn.Check:SetTexture(0,0,0,0) btn.text:FillInner(btn) - btn.text:SetFont(SuperVillain.Media.font.roboto,10,"NONE","LEFT") + btn.text:SetFont(SV.Media.font.roboto,10,"NONE","LEFT") end end) @@ -301,12 +304,12 @@ local function CharacterFrameStyle() if not btn.icon.bordertop then SetItemFrame(btn, btn.icon) end - end; - GearManagerDialogPopup:Formula409() + end + GearManagerDialogPopup:RemoveTextures() GearManagerDialogPopup:SetFixedPanelTemplate("Transparent", true) GearManagerDialogPopup:Point("LEFT", PaperDollFrame, "RIGHT", 4, 0) - GearManagerDialogPopupScrollFrame:Formula409() - GearManagerDialogPopupEditBox:Formula409() + GearManagerDialogPopupScrollFrame:RemoveTextures() + GearManagerDialogPopupEditBox:RemoveTextures() GearManagerDialogPopupEditBox:SetBasicPanel() @@ -317,7 +320,7 @@ local function CharacterFrameStyle() local e = _G["GearManagerDialogPopupButton"..i] local texture = e.icon; if e then - e:Formula409() + e:RemoveTextures() e:SetButtonTemplate() texture:SetTexCoord(0.1, 0.9, 0.1, 0.9) _G["GearManagerDialogPopupButton"..i.."Icon"]:SetTexture(0,0,0,0) @@ -340,14 +343,14 @@ local function CharacterFrameStyle() for i = 1, 7 do local category = _G["CharacterStatsPaneCategory"..i] if(category) then - category:Formula409() + category:RemoveTextures() category:SetButtonTemplate() end end - ReputationFrame:Formula409(true) - ReputationListScrollFrame:Formula409() - ReputationDetailFrame:Formula409() + ReputationFrame:RemoveTextures(true) + ReputationListScrollFrame:RemoveTextures() + ReputationDetailFrame:RemoveTextures() ReputationDetailFrame:SetBasicPanel() ReputationDetailFrame:Point("TOPLEFT", ReputationFrame, "TOPRIGHT", 4, -28) ReputationFrame:HookScript("OnShow", Reputation_OnShow) @@ -359,16 +362,16 @@ local function CharacterFrameStyle() for i = 1, GetCurrencyListSize() do local currency = _G["TokenFrameContainerButton"..i] if(currency) then - currency.highlight:MUNG() - currency.categoryMiddle:MUNG() - currency.categoryLeft:MUNG() - currency.categoryRight:MUNG() + currency.highlight:Die() + currency.categoryMiddle:Die() + currency.categoryLeft:Die() + currency.categoryRight:Die() if currency.icon then currency.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) end end - end; - TokenFramePopup:Formula409() + end + TokenFramePopup:RemoveTextures() TokenFramePopup:SetBasicPanel() TokenFramePopup:Point("TOPLEFT", TokenFrame, "TOPRIGHT", 4, -28) end) @@ -378,7 +381,7 @@ local function CharacterFrameStyle() PetPaperDollPetInfo:SetPanelTemplate("Slot") PetPaperDollPetInfo.Panel:SetFrameLevel(0) PetPaperDollPetInfo:Size(24, 24) -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/chat.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/chat.lua index f843cbc..0a14906 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/chat.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/chat.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -139,8 +139,7 @@ local ChatMenu_OnShow = function(self) self:Point("BOTTOMLEFT", ChatFrame1, "TOPLEFT", 0, 30) end -local ChatConfigChannelSettingsLeft_OnEvent = function(self, event) - ChatConfigChannelSettingsLeft:UnregisterEvent("PLAYER_ENTERING_WORLD") +local ChatConfigChannelSettingsLeft_OnEvent = function(self) local checkBoxTable = self.checkBoxTable; local checkBoxNameString = "ChatConfigChannelSettingsLeftCheckBox"; local boxHeight = ChatConfigOtherSettingsCombatCheckBox1:GetHeight() or 20 @@ -150,21 +149,21 @@ local ChatConfigChannelSettingsLeft_OnEvent = function(self, event) local checkbox = _G[gName] if(checkbox) then if(not checkbox.Panel) then - checkbox:Formula409() + checkbox:RemoveTextures() 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 + if(check) then check:SetCheckboxTemplate(true) end + local colors = _G[("%sColorClasses"):format(gName)] if(colors) then - if(not colors.Panel) then - colors:SetCheckboxTemplate(true) - end + colors:SetCheckboxTemplate(true) colors:SetHeight(colorsHeight) end end @@ -181,7 +180,7 @@ local ChatConfigBackgroundFrame_OnShow = function(self) checkbox = _G[gName] if(checkbox) then if(not checkbox.Panel) then - checkbox:Formula409() + checkbox:RemoveTextures() checkbox:SetPanelTemplate("Default") end checkbox.Panel:Point("TOPLEFT", 3, -1) @@ -189,14 +188,13 @@ local ChatConfigBackgroundFrame_OnShow = function(self) checkbox:SetHeight(boxHeight) check = _G[("%sCheck"):format(gName)] - if(check and not check.Panel) then + if(check) then check:SetCheckboxTemplate(true) end + colors = _G[("%sColorClasses"):format(gName)] if(colors) then - if(not colors.Panel) then - colors:SetCheckboxTemplate(true) - end + colors:SetCheckboxTemplate(true) colors:SetHeight(colorsHeight) end end @@ -206,14 +204,14 @@ local ChatConfigBackgroundFrame_OnShow = function(self) checkbox = _G[gName] if(checkbox) then if(not checkbox.Panel) then - checkbox:Formula409() + checkbox:RemoveTextures() 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 + if(check) then check:SetCheckboxTemplate(true) end end @@ -223,14 +221,14 @@ local ChatConfigBackgroundFrame_OnShow = function(self) checkbox = _G[gName] if(checkbox) then if(not checkbox.Panel) then - checkbox:Formula409() + checkbox:RemoveTextures() 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 + if(check) then check:SetCheckboxTemplate(true) end end @@ -240,14 +238,14 @@ local ChatConfigBackgroundFrame_OnShow = function(self) checkbox = _G[gName] if(checkbox) then if(not checkbox.Panel) then - checkbox:Formula409() + checkbox:RemoveTextures() 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 + if(check) then check:SetCheckboxTemplate(true) end end @@ -257,14 +255,14 @@ local ChatConfigBackgroundFrame_OnShow = function(self) checkbox = _G[gName] if(checkbox) then if(not checkbox.Panel) then - checkbox:Formula409() + checkbox:RemoveTextures() 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 + if(check) then check:SetCheckboxTemplate(true) end end @@ -274,14 +272,14 @@ local ChatConfigBackgroundFrame_OnShow = function(self) checkbox = _G[gName] if(checkbox) then if(not checkbox.Panel) then - checkbox:Formula409() + checkbox:RemoveTextures() 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 + if(check) then check:SetCheckboxTemplate(true) end end @@ -291,14 +289,14 @@ local ChatConfigBackgroundFrame_OnShow = function(self) checkbox = _G[gName] if(checkbox) then if(not checkbox.Panel) then - checkbox:Formula409() + checkbox:RemoveTextures() 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 + if(check) then check:SetCheckboxTemplate(true) end end @@ -308,7 +306,7 @@ local ChatConfigBackgroundFrame_OnShow = function(self) checkbox = _G[gName] if(checkbox) then if(not checkbox.Panel) then - checkbox:Formula409() + checkbox:RemoveTextures() checkbox:SetPanelTemplate("Default") end checkbox.Panel:Point("TOPLEFT", 3, -1) @@ -346,7 +344,7 @@ CHAT STYLER ########################################################## ]]-- local function ChatStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.chat ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.chat ~= true then return end @@ -366,7 +364,7 @@ local function ChatStyle() local name = ChatFrameList1[i] local this = _G[name] if(this) then - this:Formula409() + this:RemoveTextures() end end @@ -383,11 +381,11 @@ local function ChatStyle() 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 + if(_G["CombatConfigTab1"]) then _G["CombatConfigTab1"]:RemoveTextures() end + if(_G["CombatConfigTab2"]) then _G["CombatConfigTab2"]:RemoveTextures() end + if(_G["CombatConfigTab3"]) then _G["CombatConfigTab3"]:RemoveTextures() end + if(_G["CombatConfigTab4"]) then _G["CombatConfigTab4"]:RemoveTextures() end + if(_G["CombatConfigTab5"]) then _G["CombatConfigTab5"]:RemoveTextures() end CombatConfigSettingsNameEditBox:SetEditboxTemplate() ChatConfigFrame:SetPanelTemplate("Halftone", true) @@ -395,7 +393,7 @@ local function ChatStyle() for i = 1, #ChatFrameList3 do local frame = _G[ChatFrameList3[i]] if(frame) then - frame:Formula409() + frame:RemoveTextures() frame:SetBasicPanel() end end @@ -412,8 +410,7 @@ local function ChatStyle() end end - ChatConfigChannelSettingsLeft:RegisterEvent("PLAYER_ENTERING_WORLD") - ChatConfigChannelSettingsLeft:SetScript("OnEvent", ChatConfigChannelSettingsLeft_OnEvent) + ChatConfigChannelSettingsLeft:HookScript("OnShow", ChatConfigChannelSettingsLeft_OnEvent) CreateChatChannelList(ChatConfigChannelSettings, GetChannelList()) ChatConfig_CreateCheckboxes(ChatConfigChannelSettingsLeft, CHAT_CONFIG_CHANNEL_LIST, "ChatConfigCheckBoxWithSwatchAndClassColorTemplate", CHANNELS) @@ -468,7 +465,12 @@ local function ChatStyle() ChatConfigFrame:Size(680,596) ChatConfigFrameHeader:ClearAllPoints() ChatConfigFrameHeader:SetPoint("TOP", ChatConfigFrame, "TOP", 0, -5) -end; + + -- for i=1, select("#", GetChatWindowChannels(3)) do + -- local info = select(i, GetChatWindowChannels(3)) + -- print(info) + -- end +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/dressup.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/dressup.lua index d9b066f..460db5d 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/dressup.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/dressup.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -21,28 +21,26 @@ DRESSUP STYLER ########################################################## ]]-- local function DressUpStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.dressingroom ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.dressingroom ~= true then return - end; - DressUpFrame:Formula409(true) - local w = DressUpFrame:GetWidth() - 32 - local h = DressUpFrame:GetHeight() - 72 - local bg = CreateFrame("Frame",nil,DressUpFrame) - local lvl = DressUpFrame:GetFrameLevel() - if lvl > 0 then - lvl = lvl - 1 end - bg:SetPoint("TOPLEFT",DressUpFrame,"TOPLEFT",7,-7) - bg:SetSize(w,h) - bg:SetFrameLevel(lvl) - bg:SetPanelTemplate("Pattern") - DressUpModel:SetFixedPanelTemplate("Comic") - DressUpModel:SetPanelColor("special") - DressUpFrameResetButton:SetButtonTemplate() + + STYLE:ApplyWindowStyle(DressUpFrame, true, true) + + DressUpModel:ClearAllPoints() + DressUpModel:SetPoint("TOPLEFT", DressUpFrame, "TOPLEFT", 12, -76) + DressUpModel:SetPoint("BOTTOMRIGHT", DressUpFrame, "BOTTOMRIGHT", -12, 36) + + DressUpModel:SetFixedPanelTemplate("ModelComic") + + DressUpFrameCancelButton:Point("BOTTOMRIGHT", DressUpFrame, "BOTTOMRIGHT", -12, 12) DressUpFrameCancelButton:SetButtonTemplate() - STYLE:ApplyCloseButtonStyle(DressUpFrameCloseButton, bg.Panel) - DressUpFrameResetButton:Point("RIGHT", DressUpFrameCancelButton, "LEFT", -2, 0) -end; + + DressUpFrameResetButton:Point("RIGHT", DressUpFrameCancelButton, "LEFT", -12, 0) + DressUpFrameResetButton:SetButtonTemplate() + + STYLE:ApplyCloseButtonStyle(DressUpFrameCloseButton, DressUpFrame.Panel) +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/encounterjournal.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/encounterjournal.lua index 3213aaf..ff0fdd7 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/encounterjournal.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/encounterjournal.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -24,7 +24,7 @@ local PVP_LOST = [[Interface\WorldMap\Skull_64Red]] local function Tab_OnEnter(this) this.backdrop:SetPanelColor("highlight") - this.backdrop:SetBackdropBorderColor(unpack(SuperVillain.Media.color.highlight)) + this.backdrop:SetBackdropBorderColor(unpack(SV.Media.color.highlight)) end local function Tab_OnLeave(this) @@ -98,28 +98,28 @@ local function Outline(frame, noHighlight) end local function EncounterJournalStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.encounterjournal ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.encounterjournal ~= true then return - end; - - EncounterJournal:Formula409(true) - EncounterJournalInstanceSelect:Formula409(true) - EncounterJournalNavBar:Formula409(true) - EncounterJournalNavBarOverlay:Formula409(true) - EncounterJournalNavBarHomeButton:Formula409(true) - EncounterJournalInset:Formula409(true) - - EncounterJournalEncounterFrame:Formula409(true) - EncounterJournalEncounterFrameInfo:Formula409(true) - EncounterJournalEncounterFrameInfoDifficulty:Formula409(true) - EncounterJournalEncounterFrameInfoLootScrollFrameFilterToggle:Formula409(true) - EncounterJournalEncounterFrameInfoBossesScrollFrame:Formula409(true) - EncounterJournalInstanceSelectDungeonTab:Formula409(true) - EncounterJournalInstanceSelectRaidTab:Formula409(true) + end + + EncounterJournal:RemoveTextures(true) + EncounterJournalInstanceSelect:RemoveTextures(true) + EncounterJournalNavBar:RemoveTextures(true) + EncounterJournalNavBarOverlay:RemoveTextures(true) + EncounterJournalNavBarHomeButton:RemoveTextures(true) + EncounterJournalInset:RemoveTextures(true) + + EncounterJournalEncounterFrame:RemoveTextures(true) + EncounterJournalEncounterFrameInfo:RemoveTextures(true) + EncounterJournalEncounterFrameInfoDifficulty:RemoveTextures(true) + EncounterJournalEncounterFrameInfoLootScrollFrameFilterToggle:RemoveTextures(true) + EncounterJournalEncounterFrameInfoBossesScrollFrame:RemoveTextures(true) + EncounterJournalInstanceSelectDungeonTab:RemoveTextures(true) + EncounterJournalInstanceSelectRaidTab:RemoveTextures(true) ChangeTabHelper(EncounterJournalEncounterFrameInfoBossTab) ChangeTabHelper(EncounterJournalEncounterFrameInfoLootTab, 0, -10) - EncounterJournalSearchResults:Formula409(true) + EncounterJournalSearchResults:RemoveTextures(true) EncounterJournal:SetPanelTemplate("Action") EncounterJournal:SetPanelColor("dark") @@ -187,8 +187,8 @@ local function EncounterJournalStyle() local usedHeaders = EncounterJournal.encounter.usedHeaders for key,used in pairs(usedHeaders) do if(not used.button.Panel) then - used:Formula409(true) - used.button:Formula409(true) + used:RemoveTextures(true) + used.button:RemoveTextures(true) used.button:SetButtonTemplate() end used.description:SetTextColor(1, 1, 1) @@ -218,7 +218,7 @@ local function EncounterJournalStyle() end end end) -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/friends.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/friends.lua index fd0d8b5..f923df6 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/friends.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/friends.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -103,7 +103,7 @@ local function ChannelList_OnUpdate() for i = 1, MAX_DISPLAY_CHANNEL_BUTTONS do local btn = _G["ChannelButton"..i] if btn then - btn:Formula409() + btn:RemoveTextures() btn:SetHighlightTexture("Interface\\PaperDollInfoFrame\\UI-Character-Tab-Highlight") _G["ChannelButton"..i.."Text"]:SetFontTemplate(nil, 12) end @@ -115,37 +115,27 @@ FRIENDSFRAME STYLER ########################################################## ]]--FriendsFrameBattlenetFrameScrollFrame local function FriendsFrameStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.friends ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.friends ~= true then return end - FriendsFrame.Panel = CreateFrame('Frame', nil, FriendsFrame) - FriendsFrame.Panel:WrapOuter(FriendsFrame) - - local panelLevel = FriendsFrame:GetFrameLevel() - - if((panelLevel - 1) >= 0) then - FriendsFrame.Panel:SetFrameLevel(panelLevel - 1) - else - FriendsFrame.Panel:SetFrameLevel(0) - end - FriendsFrame.Panel:SetPanelTemplate("Halftone") + STYLE:ApplyWindowStyle(FriendsFrame) STYLE:ApplyScrollFrameStyle(FriendsFrameFriendsScrollFrameScrollBar, 5) STYLE:ApplyScrollFrameStyle(WhoListScrollFrameScrollBar, 5) STYLE:ApplyScrollFrameStyle(ChannelRosterScrollFrameScrollBar, 5) STYLE:ApplyScrollFrameStyle(FriendsFriendsScrollFrameScrollBar) - FriendsFrameInset:Formula409() - WhoFrameListInset:Formula409() - WhoFrameEditBoxInset:Formula409() + FriendsFrameInset:RemoveTextures() + WhoFrameListInset:RemoveTextures() + WhoFrameEditBoxInset:RemoveTextures() STYLE:ApplyEditBoxStyle(WhoFrameEditBoxInset) - ChannelFrameRightInset:Formula409() - ChannelFrameLeftInset:Formula409() + ChannelFrameRightInset:RemoveTextures() + ChannelFrameLeftInset:RemoveTextures() ChannelFrameRightInset:SetFixedPanelTemplate("Inset", true) ChannelFrameLeftInset:SetFixedPanelTemplate("Inset", true) - LFRQueueFrameListInset:Formula409() - LFRQueueFrameRoleInset:Formula409() - LFRQueueFrameCommentInset:Formula409() + LFRQueueFrameListInset:RemoveTextures() + LFRQueueFrameRoleInset:RemoveTextures() + LFRQueueFrameCommentInset:RemoveTextures() LFRQueueFrameListInset:SetFixedPanelTemplate("Inset", true) FriendsFrameFriendsScrollFrame:SetBasicPanel() FriendsFrameFriendsScrollFrame.Panel:Point("TOPRIGHT", -4, 0) @@ -156,11 +146,11 @@ local function FriendsFrameStyle() end -- for c, texture in pairs(FriendsFrameList2)do - -- _G[texture]:MUNG() + -- _G[texture]:Die() -- end for c, V in pairs(FriendsFrameList1)do - _G[V]:Formula409() + _G[V]:RemoveTextures() end for u = 1, FriendsFrame:GetNumRegions()do @@ -173,7 +163,7 @@ local function FriendsFrameStyle() FriendsFrameStatusDropDown:SetPoint('TOPLEFT', FriendsTabHeader, 'TOPLEFT', 0, -27) STYLE:ApplyDropdownStyle(FriendsFrameStatusDropDown, 70) - FriendsFrameBattlenetFrame:Formula409() + FriendsFrameBattlenetFrame:RemoveTextures() FriendsFrameBattlenetFrame:SetHeight(22) FriendsFrameBattlenetFrame:SetPoint('TOPLEFT', FriendsFrameStatusDropDown, 'TOPRIGHT', 0, -1) FriendsFrameBattlenetFrame:SetFixedPanelTemplate("Inset") @@ -182,7 +172,7 @@ local function FriendsFrameStyle() -- FriendsFrameBattlenetFrame.BroadcastButton:GetNormalTexture():SetTexCoord(.28, .72, .28, .72) -- FriendsFrameBattlenetFrame.BroadcastButton:GetPushedTexture():SetTexCoord(.28, .72, .28, .72) -- FriendsFrameBattlenetFrame.BroadcastButton:GetHighlightTexture():SetTexCoord(.28, .72, .28, .72) - FriendsFrameBattlenetFrame.BroadcastButton:Formula409() + FriendsFrameBattlenetFrame.BroadcastButton:RemoveTextures() FriendsFrameBattlenetFrame.BroadcastButton:SetSize(22,22) FriendsFrameBattlenetFrame.BroadcastButton:SetPoint('TOPLEFT', FriendsFrameBattlenetFrame, 'TOPRIGHT', 8, 0) FriendsFrameBattlenetFrame.BroadcastButton:SetButtonTemplate() @@ -190,9 +180,9 @@ local function FriendsFrameStyle() FriendsFrameBattlenetFrame.BroadcastButton:SetNormalTexture([[Interface\FriendsFrame\UI-Toast-BroadcastIcon]]) FriendsFrameBattlenetFrame.BroadcastButton:SetPushedTexture([[Interface\FriendsFrame\UI-Toast-BroadcastIcon]]) FriendsFrameBattlenetFrame.BroadcastButton:SetScript('OnClick', function() - SuperVillain:StaticPopup_Show("SET_BN_BROADCAST") + SV:StaticPopup_Show("SET_BN_BROADCAST") end) - FriendsFrameBattlenetFrame.Tag:SetFontTemplate(SuperVillain.Media.font.narrator,16,"NONE") + FriendsFrameBattlenetFrame.Tag:SetFontTemplate(SV.Media.font.narrator,16,"NONE") AddFriendNameEditBox:SetEditboxTemplate() AddFriendFrame:SetFixedPanelTemplate("Transparent", true) ScrollOfResurrectionSelectionFrame:SetFixedPanelTemplate('Transparent') @@ -204,19 +194,19 @@ local function FriendsFrameStyle() ChannelFrameDaughterFrameChannelPassword:SetPanelTemplate("Default") ChannelFrame:HookScript("OnShow", function() - ChannelRosterScrollFrame:Formula409() + ChannelRosterScrollFrame:RemoveTextures() end) hooksecurefunc("FriendsFrame_OnEvent", function() - ChannelRosterScrollFrame:Formula409() + ChannelRosterScrollFrame:RemoveTextures() end) WhoFrame:HookScript("OnShow", function() - ChannelRosterScrollFrame:Formula409() + ChannelRosterScrollFrame:RemoveTextures() end) hooksecurefunc("FriendsFrame_OnEvent", function() - WhoListScrollFrame:Formula409() + WhoListScrollFrame:RemoveTextures() end) ChannelFrameDaughterFrame:SetBasicPanel() @@ -235,9 +225,9 @@ local function FriendsFrameStyle() hooksecurefunc("ChannelList_Update", ChannelList_OnUpdate) FriendsFriendsFrame:SetBasicPanel() - _G["FriendsFriendsFrame"]:Formula409() - _G["FriendsFriendsList"]:Formula409() - _G["FriendsFriendsNoteFrame"]:Formula409() + _G["FriendsFriendsFrame"]:RemoveTextures() + _G["FriendsFriendsList"]:RemoveTextures() + _G["FriendsFriendsNoteFrame"]:RemoveTextures() _G["FriendsFriendsSendRequestButton"]:SetButtonTemplate() _G["FriendsFriendsCloseButton"]:SetButtonTemplate() @@ -245,9 +235,9 @@ local function FriendsFrameStyle() FriendsFriendsList:SetEditboxTemplate() FriendsFriendsNoteFrame:SetEditboxTemplate() STYLE:ApplyDropdownStyle(FriendsFriendsFrameDropDown, 150) - BNConversationInviteDialog:Formula409() + BNConversationInviteDialog:RemoveTextures() BNConversationInviteDialog:SetPanelTemplate('Transparent') - BNConversationInviteDialogList:Formula409() + BNConversationInviteDialogList:RemoveTextures() BNConversationInviteDialogList:SetFixedPanelTemplate('Default') BNConversationInviteDialogInviteButton:SetButtonTemplate() BNConversationInviteDialogCancelButton:SetButtonTemplate() @@ -270,15 +260,15 @@ local function FriendsFrameStyle() STYLE:ApplyScrollFrameStyle(FriendsFrameIgnoreScrollFrameScrollBar, 4) FriendsFramePendingScrollFrame:SetFixedPanelTemplate("Inset") STYLE:ApplyScrollFrameStyle(FriendsFramePendingScrollFrameScrollBar, 4) - IgnoreListFrame:Formula409() - PendingListFrame:Formula409() - ScrollOfResurrectionFrame:Formula409() + IgnoreListFrame:RemoveTextures() + PendingListFrame:RemoveTextures() + ScrollOfResurrectionFrame:RemoveTextures() ScrollOfResurrectionFrameAcceptButton:SetButtonTemplate() ScrollOfResurrectionFrameCancelButton:SetButtonTemplate() ScrollOfResurrectionFrameTargetEditBoxLeft:SetTexture(0,0,0,0) ScrollOfResurrectionFrameTargetEditBoxMiddle:SetTexture(0,0,0,0) ScrollOfResurrectionFrameTargetEditBoxRight:SetTexture(0,0,0,0) - ScrollOfResurrectionFrameNoteFrame:Formula409() + ScrollOfResurrectionFrameNoteFrame:RemoveTextures() ScrollOfResurrectionFrameNoteFrame:SetFixedPanelTemplate() ScrollOfResurrectionFrameTargetEditBox:SetFixedPanelTemplate() ScrollOfResurrectionFrame:SetFixedPanelTemplate('Transparent') diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/gossip.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/gossip.lua index 01cc7d6..3a4485f 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/gossip.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/gossip.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -21,9 +21,9 @@ GOSSIP STYLER ########################################################## ]]-- local function GossipStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.gossip ~= true then return end; - ItemTextFrame:Formula409(true) - ItemTextScrollFrame:Formula409() + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.gossip ~= true then return end + ItemTextFrame:RemoveTextures(true) + ItemTextScrollFrame:RemoveTextures() STYLE:ApplyCloseButtonStyle(GossipFrameCloseButton) STYLE:ApplyPaginationStyle(ItemTextPrevPageButton) STYLE:ApplyPaginationStyle(ItemTextNextPageButton) @@ -34,14 +34,14 @@ local function GossipStyle() end end) ItemTextFrame:SetPanelTemplate("Pattern") - ItemTextFrameInset:MUNG() + ItemTextFrameInset:Die() STYLE:ApplyScrollFrameStyle(ItemTextScrollFrameScrollBar) STYLE:ApplyCloseButtonStyle(ItemTextFrameCloseButton) local r = {"GossipFrameGreetingPanel", "GossipFrame", "GossipFrameInset", "GossipGreetingScrollFrame"} STYLE:ApplyScrollFrameStyle(GossipGreetingScrollFrameScrollBar, 5) for s, t in pairs(r)do - _G[t]:Formula409() - end; + _G[t]:RemoveTextures() + end GossipFrame:SetPanelTemplate("Halftone") GossipGreetingScrollFrame:SetFixedPanelTemplate("Inset", true) GossipGreetingScrollFrame.spellTex = GossipGreetingScrollFrame:CreateTexture(nil, "ARTWORK") @@ -49,14 +49,14 @@ local function GossipStyle() GossipGreetingScrollFrame.spellTex:SetPoint("TOPLEFT", 2, -2) GossipGreetingScrollFrame.spellTex:Size(506, 615) GossipGreetingScrollFrame.spellTex:SetTexCoord(0, 1, 0.02, 1) - _G["GossipFramePortrait"]:MUNG() - _G["GossipFrameGreetingGoodbyeButton"]:Formula409() + _G["GossipFramePortrait"]:Die() + _G["GossipFrameGreetingGoodbyeButton"]:RemoveTextures() _G["GossipFrameGreetingGoodbyeButton"]:SetButtonTemplate() STYLE:ApplyCloseButtonStyle(GossipFrameCloseButton, GossipFrame.Panel) - NPCFriendshipStatusBar:Formula409() + NPCFriendshipStatusBar:RemoveTextures() NPCFriendshipStatusBar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) NPCFriendshipStatusBar:SetPanelTemplate("Default") -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua index 89efbaf..a2655f2 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -21,6 +21,7 @@ HELPERS ########################################################## ]]-- local format = string.format; +local internalTest = false; local GuildFrameList = { "GuildNewPerksFrame", @@ -63,15 +64,15 @@ local GuildButtonList = { }; local GuildCheckBoxList = { - "Quest", - "Dungeon", - "Raid", - "PvP", - "RP", - "Weekdays", - "Weekends", - "LevelAny", - "LevelMax" + "GuildRecruitmentQuestButton", + "GuildRecruitmentDungeonButton", + "GuildRecruitmentRaidButton", + "GuildRecruitmentPvPButton", + "GuildRecruitmentRPButton", + "GuildRecruitmentWeekdaysButton", + "GuildRecruitmentWeekendsButton", + "GuildRecruitmentLevelAnyButton", + "GuildRecruitmentLevelMaxButton" }; local CalendarIconList = { @@ -95,7 +96,7 @@ local function GCTabHelper(tab) tab.bg1 = tab:CreateTexture(nil,"BACKGROUND") tab.bg1:SetDrawLayer("BACKGROUND",4) tab.bg1:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - tab.bg1:SetVertexColor(unpack(SuperVillain.Media.color.default)) + tab.bg1:SetVertexColor(unpack(SV.Media.color.default)) tab.bg1:FillInner(tab.Panel,1) tab.bg3 = tab:CreateTexture(nil,"BACKGROUND") tab.bg3:SetDrawLayer("BACKGROUND",2) @@ -160,13 +161,14 @@ GUILDFRAME STYLERS ########################################################## ]]-- local function GuildBankStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.gbank ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.gbank ~= true then return - end - GuildBankFrame:Formula409() - GuildBankFrame:SetPanelTemplate("Halftone") - GuildBankEmblemFrame:Formula409(true) - GuildBankMoneyFrameBackground:MUNG() + end + + STYLE:ApplyWindowStyle(GuildBankFrame) + + GuildBankEmblemFrame:RemoveTextures(true) + GuildBankMoneyFrameBackground:Die() STYLE:ApplyScrollFrameStyle(GuildBankPopupScrollFrameScrollBar) for b = 1, GuildBankFrame:GetNumChildren() do @@ -182,13 +184,14 @@ local function GuildBankStyle() GuildBankFramePurchaseButton:SetButtonTemplate() GuildBankFrameWithdrawButton:Point("RIGHT", GuildBankFrameDepositButton, "LEFT", -2, 0) GuildBankInfoScrollFrame:Point('TOPLEFT', GuildBankInfo, 'TOPLEFT', -10, 12) - GuildBankInfoScrollFrame:Formula409() + GuildBankInfoScrollFrame:RemoveTextures() GuildBankInfoScrollFrame:Width(GuildBankInfoScrollFrame:GetWidth()-8) - GuildBankTransactionsScrollFrame:Formula409() + GuildBankTransactionsScrollFrame:RemoveTextures() for b = 1, NUM_GUILDBANK_COLUMNS do if(_G["GuildBankColumn"..b]) then - _G["GuildBankColumn"..b]:Formula409() + _G["GuildBankColumn"..b]:RemoveTextures() + for d = 1, NUM_SLOTS_PER_GUILDBANK_GROUP do local e = _G["GuildBankColumn"..b.."Button"..d] local icon = _G["GuildBankColumn"..b.."Button"..d.."IconTexture"] @@ -207,8 +210,8 @@ local function GuildBankStyle() local e = _G["GuildBankTab"..b.."Button"] if(e) then local texture = _G["GuildBankTab"..b.."ButtonIconTexture"] - _G["GuildBankTab"..b]:Formula409(true) - e:Formula409() + _G["GuildBankTab"..b]:RemoveTextures(true) + e:RemoveTextures() e:SetButtonTemplate() e:SetFixedPanelTemplate("Default") texture:FillInner() @@ -248,17 +251,17 @@ local function GuildBankStyle() end end) - GuildBankPopupFrame:Formula409() - GuildBankPopupScrollFrame:Formula409() + GuildBankPopupFrame:RemoveTextures() + GuildBankPopupScrollFrame:RemoveTextures() GuildBankPopupFrame:SetFixedPanelTemplate("Transparent", true) GuildBankPopupFrame:Point("TOPLEFT", GuildBankFrame, "TOPRIGHT", 1, -30) GuildBankPopupOkayButton:SetButtonTemplate() GuildBankPopupCancelButton:SetButtonTemplate() GuildBankPopupEditBox:SetEditboxTemplate() - GuildBankPopupNameLeft:MUNG() - GuildBankPopupNameRight:MUNG() - GuildBankPopupNameMiddle:MUNG() - GuildItemSearchBox:Formula409() + GuildBankPopupNameLeft:Die() + GuildBankPopupNameRight:Die() + GuildBankPopupNameMiddle:Die() + GuildItemSearchBox:RemoveTextures() GuildItemSearchBox:SetPanelTemplate("Overlay") GuildItemSearchBox.Panel:Point("TOPLEFT", 10, -1) GuildItemSearchBox.Panel:Point("BOTTOMRIGHT", 4, 1) @@ -267,7 +270,7 @@ local function GuildBankStyle() local e = _G["GuildBankPopupButton"..b] if(e) then local icon = _G[e:GetName().."Icon"] - e:Formula409() + e:RemoveTextures() e:SetFixedPanelTemplate("Default") e:SetButtonTemplate() icon:FillInner() @@ -280,115 +283,130 @@ local function GuildBankStyle() end local function GuildFrameStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.guild ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.guild ~= true then return - end - GuildFrame:Formula409(true) - GuildFrame:SetPanelTemplate("Halftone") - GuildLevelFrame:MUNG() + end + + STYLE:ApplyWindowStyle(GuildFrame) + STYLE:ApplyCloseButtonStyle(GuildMemberDetailCloseButton) STYLE:ApplyCloseButtonStyle(GuildFrameCloseButton) GuildRewardsFrameVisitText:ClearAllPoints() GuildRewardsFrameVisitText:SetPoint("TOP", GuildRewardsFrame, "TOP", 0, 30) - for _, gName in pairs(GuildFrameList)do - local frame = _G[gName] + for i = 1, #GuildFrameList do + local frame = _G[GuildFrameList[i]] if(frame) then - frame:Formula409() + frame:RemoveTextures() end end - GuildNewsBossModel:SetBasicPanel() - GuildNewsBossModelTextFrame:SetPanelTemplate("Default") - 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:SetButtonTemplate() + for i = 1, #GuildButtonList do + local button = _G[GuildButtonList[i]] + if(button) then + button:RemoveTextures(true) + button:SetButtonTemplate() end end - for _, gName in pairs(GuildCheckBoxList)do - if(_G["GuildRecruitment"..gName.."Button"]) then - _G["GuildRecruitment"..gName.."Button"]:SetCheckboxTemplate(true) - end + for i = 1, #GuildCheckBoxList do + local check = _G[GuildCheckBoxList[i]] + if(check) then check:SetCheckboxTemplate(true) end end + for i = 1, 5 do + local tab = _G["GuildFrameTab"..i] + if(tab) then + STYLE:ApplyTabStyle(tab) + if i == 1 then + tab:Point("TOPLEFT", GuildFrame, "BOTTOMLEFT", -10, 3) + end + end + end + + GuildNewsBossModel:SetBasicPanel() + GuildNewsBossModelTextFrame:SetPanelTemplate("Default") + GuildNewsBossModelTextFrame.Panel:Point("TOPLEFT", GuildNewsBossModel.Panel, "BOTTOMLEFT", 0, -1) + GuildNewsBossModel:SetPoint("TOPLEFT", GuildFrame, "TOPRIGHT", 4, -43) + GuildRecruitmentTankButton.checkButton:SetCheckboxTemplate(true) GuildRecruitmentHealerButton.checkButton:SetCheckboxTemplate(true) GuildRecruitmentDamagerButton.checkButton:SetCheckboxTemplate(true) - for b = 1, 5 do - STYLE:ApplyTabStyle(_G["GuildFrameTab"..b]) - if b == 1 then - _G["GuildFrameTab"..b]:Point("TOPLEFT", GuildFrame, "BOTTOMLEFT", -10, 3) - end - end - GuildXPFrame:ClearAllPoints() - GuildXPFrame:Point("TOP", GuildFrame, "TOP", 0, -40) - STYLE:ApplyScrollFrameStyle(GuildPerksContainerScrollBar, 4) - GuildNewPerksFrame:SetFixedPanelTemplate("Pattern") - GuildFactionBar:Formula409() + GuildFactionBar:RemoveTextures() GuildFactionBar.progress:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) GuildFactionBar:SetPanelTemplate("Inset") GuildFactionBar.Panel:Point("TOPLEFT", GuildFactionBar.progress, "TOPLEFT", -1, 1) GuildFactionBar.Panel:Point("BOTTOMRIGHT", GuildFactionBar, "BOTTOMRIGHT", 1, 1) - GuildXPBar:Formula409() - GuildXPBar.progress:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - GuildXPBar:SetPanelTemplate("Inset") - GuildXPBar.Panel:Point("TOPLEFT", GuildXPBar, "TOPLEFT", -1, -3) - GuildXPBar.Panel:Point("BOTTOMRIGHT", GuildXPBar, "BOTTOMRIGHT", 0, 1) - GuildLatestPerkButton:Formula409() + + if(SV.___interface < 60000) then + GuildLevelFrame:Die() + + GuildXPFrame:ClearAllPoints() + GuildXPFrame:Point("TOP", GuildFrame, "TOP", 0, -40) + + GuildXPBar:RemoveTextures() + GuildXPBar.progress:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) + GuildXPBar:SetPanelTemplate("Inset") + GuildXPBar.Panel:Point("TOPLEFT", GuildXPBar, "TOPLEFT", -1, -3) + GuildXPBar.Panel:Point("BOTTOMRIGHT", GuildXPBar, "BOTTOMRIGHT", 0, 1) + end + + GuildLatestPerkButton:RemoveTextures() GuildLatestPerkButtonIconTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9) GuildLatestPerkButtonIconTexture:ClearAllPoints() GuildLatestPerkButtonIconTexture:Point("TOPLEFT", 2, -2) GuildLatestPerkButton:SetPanelTemplate("Inset") GuildLatestPerkButton.Panel:WrapOuter(GuildLatestPerkButtonIconTexture) - GuildNextPerkButton:Formula409() + + GuildNextPerkButton:RemoveTextures() GuildNextPerkButtonIconTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9) GuildNextPerkButtonIconTexture:ClearAllPoints() GuildNextPerkButtonIconTexture:Point("TOPLEFT", 2, -2) GuildNextPerkButton:SetPanelTemplate("Inset") GuildNextPerkButton.Panel:WrapOuter(GuildNextPerkButtonIconTexture) - GuildRosterContainer:SetFixedPanelTemplate("Pattern") - STYLE:ApplyScrollFrameStyle(GuildRosterContainerScrollBar, 5) + GuildRosterContainer:SetBasicPanel(-2, 2, -1, -2) + STYLE:ApplyScrollFrameStyle(GuildRosterContainerScrollBar, 4, -4) GuildRosterShowOfflineButton:SetCheckboxTemplate(true) for i = 1, 4 do local btn = _G["GuildRosterColumnButton"..i] if(btn) then - btn:Formula409(true) + btn:RemoveTextures(true) end end STYLE:ApplyDropdownStyle(GuildRosterViewDropdown, 200) + for i = 1, 14 do local btn = _G["GuildRosterContainerButton"..i.."HeaderButton"] if(btn) then + btn:RemoveTextures() btn:SetButtonTemplate() end - end + end GuildMemberDetailFrame:SetPanelTemplate("Default", true) GuildMemberNoteBackground:SetBasicPanel() GuildMemberOfficerNoteBackground:SetBasicPanel() GuildMemberRankDropdown:SetFrameLevel(GuildMemberRankDropdown:GetFrameLevel()+5) - STYLE:ApplyDropdownStyle(GuildMemberRankDropdown, 175) - GuildNewsFrame:Formula409() - GuildNewsContainer:SetFixedPanelTemplate("Pattern") + STYLE:ApplyDropdownStyle(GuildMemberRankDropdown, 182) + GuildMemberRankDropdown.Panel:SetBackdropColor(0,0,0,1) + GuildNewsFrame:RemoveTextures() + GuildNewsContainer:SetBasicPanel(-2, 2, 0, -2) for i = 1, 17 do local btn = _G["GuildNewsContainerButton"..i] - if(btn and btn.header) then - btn.header:MUNG() + if(btn) then + if(btn.header) then btn.header:Die() end + btn:RemoveTextures() + btn:SetButtonTemplate() end end - GuildNewsFiltersFrame:Formula409() + GuildNewsFiltersFrame:RemoveTextures() GuildNewsFiltersFrame:SetFixedPanelTemplate("Transparent", true) STYLE:ApplyCloseButtonStyle(GuildNewsFiltersFrameCloseButton) @@ -400,13 +418,13 @@ local function GuildFrameStyle() end GuildNewsFiltersFrame:Point("TOPLEFT", GuildFrame, "TOPRIGHT", 4, -20) - STYLE:ApplyScrollFrameStyle(GuildNewsContainerScrollBar, 4) - STYLE:ApplyScrollFrameStyle(GuildInfoDetailsFrameScrollBar, 4) + STYLE:ApplyScrollFrameStyle(GuildNewsContainerScrollBar, 4, 4) + STYLE:ApplyScrollFrameStyle(GuildInfoDetailsFrameScrollBar, 4, 4) for i = 1, 3 do local tab = _G["GuildInfoFrameTab"..i] if(tab) then - tab:Formula409() + tab:RemoveTextures() end end @@ -427,12 +445,13 @@ local function GuildFrameStyle() GuildRecruitmentCommentInputFrame:SetFixedPanelTemplate("Default") GuildTextEditFrame:SetFixedPanelTemplate("Transparent", true) - STYLE:ApplyScrollFrameStyle(GuildTextEditScrollFrameScrollBar, 5) + STYLE:ApplyScrollFrameStyle(GuildTextEditScrollFrameScrollBar, 4, 4) GuildTextEditContainer:SetFixedPanelTemplate("Default") local editChildren = GuildTextEditFrame:GetNumChildren() - for b = 1, editChildren do - local child = select(b, GuildTextEditFrame:GetChildren()) + + for i = 1, editChildren do + local child = select(i, GuildTextEditFrame:GetChildren()) if(child:GetName() == "GuildTextEditFrameCloseButton") then if(child:GetWidth() < 33) then STYLE:ApplyCloseButtonStyle(child) @@ -442,12 +461,13 @@ local function GuildFrameStyle() end end - STYLE:ApplyScrollFrameStyle(GuildLogScrollFrameScrollBar, 4) - GuildLogFrame:SetFixedPanelTemplate("Transparent", true) + STYLE:ApplyScrollFrameStyle(GuildLogScrollFrameScrollBar, 4, 4) + GuildLogFrame:SetBasicPanel() local logChildren = GuildLogFrame:GetNumChildren() - for b = 1, logChildren do - local child = select(b, GuildLogFrame:GetChildren()) + + for i = 1, logChildren do + local child = select(i, GuildLogFrame:GetChildren()) if child:GetName() == "GuildLogFrameCloseButton" then if(child:GetWidth() < 33) then STYLE:ApplyCloseButtonStyle(child) @@ -457,28 +477,32 @@ local function GuildFrameStyle() end end - GuildRewardsFrame:SetFixedPanelTemplate("Pattern") - STYLE:ApplyScrollFrameStyle(GuildRewardsContainerScrollBar, 5) + GuildRewardsFrame:SetBasicPanel(2, 0, -22, 18) + STYLE:ApplyScrollFrameStyle(GuildRewardsContainerScrollBar, 4, -4) - for b = 1, 8 do - local button = _G["GuildPerksContainerButton"..b] + GuildNewPerksFrame:SetBasicPanel(-1, 0, 1, 0) + GuildPerksContainer:SetBasicPanel(-3, 0, 26, -3) + + STYLE:ApplyScrollFrameStyle(GuildPerksContainerScrollBar, 4, 2) + + for i = 1, 8 do + local button = _G["GuildPerksContainerButton"..i] if button then - button:Formula409() + button:RemoveTextures() if button.icon then + STYLE:ApplyItemButtonStyle(button, nil, true) button.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) button.icon:ClearAllPoints() button.icon:Point("TOPLEFT", button, "TOPLEFT", 2, -2) - button:SetFixedPanelTemplate("Button") - button.Panel:WrapOuter(button.icon) button.icon:SetParent(button.Panel) end end end - for b = 1, 8 do - local button = _G["GuildRewardsContainerButton"..b] + for i = 1, 8 do + local button = _G["GuildRewardsContainerButton"..i] if button then - button:Formula409() + button:RemoveTextures() if button.icon then button.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) button.icon:ClearAllPoints() @@ -498,135 +522,168 @@ local function GuildFrameStyle() for _,button in next, GuildInfoFrameApplicantsContainer.buttons do counter = counter + 1; buttonIndex = offset + counter; - button.selectedTex:MUNG() - button:GetHighlightTexture():MUNG() + button.selectedTex:Die() + button:GetHighlightTexture():Die() button:SetBackdrop(nil) end end local function GuildControlStyle() - if SuperVillain.db.SVStyle.blizzard.enable~=true or SuperVillain.db.SVStyle.blizzard.guildcontrol~=true then return end - GuildControlUI:Formula409() - GuildControlUIHbar:Formula409() - GuildControlUI:SetFixedPanelTemplate("Halftone") - GuildControlUIRankBankFrameInset:Formula409() - GuildControlUIRankBankFrameInsetScrollFrame:Formula409() + if SV.db.SVStyle.blizzard.enable~=true or SV.db.SVStyle.blizzard.guildcontrol~=true then return end + + GuildControlUI:RemoveTextures() + GuildControlUIHbar:RemoveTextures() + GuildControlUIRankBankFrameInset:RemoveTextures() + GuildControlUIRankBankFrameInsetScrollFrame:RemoveTextures() + + STYLE:ApplyWindowStyle(GuildControlUI) + STYLE:ApplyScrollFrameStyle(GuildControlUIRankBankFrameInsetScrollFrameScrollBar) + hooksecurefunc("GuildControlUI_RankOrder_Update",RankOrder_OnUpdate) - GuildControlUIRankOrderFrameNewButton:HookScript("OnClick",function() - SuperVillain:ExecuteTimer(1,RankOrder_OnUpdate) + + GuildControlUIRankOrderFrameNewButton:HookScript("OnClick", function() + SV.Timers:ExecuteTimer(1,RankOrder_OnUpdate) end) + STYLE:ApplyDropdownStyle(GuildControlUINavigationDropDown) STYLE:ApplyDropdownStyle(GuildControlUIRankSettingsFrameRankDropDown,180) GuildControlUINavigationDropDownButton:Width(20) GuildControlUIRankSettingsFrameRankDropDownButton:Width(20) - for b=1,NUM_RANK_FLAGS do - if _G["GuildControlUIRankSettingsFrameCheckbox"..b]then - _G["GuildControlUIRankSettingsFrameCheckbox"..b]:SetCheckboxTemplate(true) - end - end + + for i=1, NUM_RANK_FLAGS do + local check = _G["GuildControlUIRankSettingsFrameCheckbox"..i] + if(check) then check:SetCheckboxTemplate(true) end + end + GuildControlUIRankOrderFrameNewButton:SetButtonTemplate() GuildControlUIRankSettingsFrameGoldBox:SetEditboxTemplate() GuildControlUIRankSettingsFrameGoldBox.Panel:Point("TOPLEFT",-2,-4) GuildControlUIRankSettingsFrameGoldBox.Panel:Point("BOTTOMRIGHT",2,4) - GuildControlUIRankSettingsFrameGoldBox:Formula409() - GuildControlUIRankBankFrame:Formula409() - local Z=false; + GuildControlUIRankSettingsFrameGoldBox:RemoveTextures() + GuildControlUIRankBankFrame:RemoveTextures() + hooksecurefunc("GuildControlUI_BankTabPermissions_Update",function() local tabs = GetNumGuildBankTabs() + if tabs < MAX_BUY_GUILDBANK_TABS then tabs = tabs + 1 + end + + for i=1, tabs do + local tab = _G["GuildControlBankTab"..i.."Owned"] + + if(tab) then + if(tab.tabIcon) then tab.tabIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9) end + if(tab.editBox) then tab.editBox:SetEditboxTemplate() end + + if internalTest == false then + _G["GuildControlBankTab"..i.."BuyPurchaseButton"]:SetButtonTemplate() + _G["GuildControlBankTab"..i.."OwnedStackBox"]:SetEditboxTemplate() + _G["GuildControlBankTab"..i.."OwnedViewCheck"]:SetCheckboxTemplate(true) + _G["GuildControlBankTab"..i.."OwnedDepositCheck"]:SetCheckboxTemplate(true) + _G["GuildControlBankTab"..i.."OwnedUpdateInfoCheck"]:SetCheckboxTemplate(true) + + GCTabHelper(_G["GuildControlBankTab"..i.."OwnedStackBox"]) + GCTabHelper(_G["GuildControlBankTab"..i.."OwnedViewCheck"]) + GCTabHelper(_G["GuildControlBankTab"..i.."OwnedDepositCheck"]) + GCTabHelper(_G["GuildControlBankTab"..i.."OwnedUpdateInfoCheck"]) + end + end end - for b=1,tabs do - local f=_G["GuildControlBankTab"..b.."Owned"] - local icon=f.tabIcon; - local a0=f.editBox;icon:SetTexCoord(0.1,0.9,0.1,0.9 ) - if Z==false then - _G["GuildControlBankTab"..b.."BuyPurchaseButton"]:SetButtonTemplate() - _G["GuildControlBankTab"..b.."OwnedStackBox"]:SetEditboxTemplate() - _G["GuildControlBankTab"..b.."OwnedViewCheck"]:SetCheckboxTemplate(true) - _G["GuildControlBankTab"..b.."OwnedDepositCheck"]:SetCheckboxTemplate(true) - _G["GuildControlBankTab"..b.."OwnedUpdateInfoCheck"]:SetCheckboxTemplate(true) - GCTabHelper(_G["GuildControlBankTab"..b.."OwnedStackBox"]) - GCTabHelper(_G["GuildControlBankTab"..b.."OwnedViewCheck"]) - GCTabHelper(_G["GuildControlBankTab"..b.."OwnedDepositCheck"]) - GCTabHelper(_G["GuildControlBankTab"..b.."OwnedUpdateInfoCheck"]) - end - end - Z=true + internalTest = true end) - STYLE:ApplyDropdownStyle(GuildControlUIRankBankFrameRankDropDown,180) + + STYLE:ApplyDropdownStyle(GuildControlUIRankBankFrameRankDropDown, 180) + GuildControlUIRankBankFrameRankDropDownButton:Width(20) end local function GuildRegistrarStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.guildregistrar ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.guildregistrar ~= true then return - end - GuildRegistrarFrame:Formula409(true) - GuildRegistrarFrame:SetPanelTemplate("Action") - GuildRegistrarFrameInset:MUNG() - GuildRegistrarFrameEditBox:Formula409() - GuildRegistrarGreetingFrame:Formula409() + end + + STYLE:ApplyWindowStyle(GuildRegistrarFrame, true, true) + + GuildRegistrarFrameInset:Die() + GuildRegistrarFrameEditBox:RemoveTextures() + GuildRegistrarGreetingFrame:RemoveTextures() + GuildRegistrarFrameGoodbyeButton:SetButtonTemplate() GuildRegistrarFrameCancelButton:SetButtonTemplate() GuildRegistrarFramePurchaseButton:SetButtonTemplate() STYLE:ApplyCloseButtonStyle(GuildRegistrarFrameCloseButton) GuildRegistrarFrameEditBox:SetEditboxTemplate() + for b = 1, GuildRegistrarFrameEditBox:GetNumRegions()do local a2 = select(b, GuildRegistrarFrameEditBox:GetRegions()) if a2 and a2:GetObjectType() == "Texture"then if a2:GetTexture() == "Interface\\ChatFrame\\UI-ChatInputBorder-Left" or a2:GetTexture() == "Interface\\ChatFrame\\UI-ChatInputBorder-Right" then - a2:MUNG() + a2:Die() end end - end + end + GuildRegistrarFrameEditBox:Height(20) - for b = 1, 2 do - _G["GuildRegistrarButton"..b]:GetFontString():SetTextColor(1, 1, 1) - end + + if(_G["GuildRegistrarButton1"]) then + _G["GuildRegistrarButton1"]:GetFontString():SetTextColor(1, 1, 1) + end + if(_G["GuildRegistrarButton2"]) then + _G["GuildRegistrarButton2"]:GetFontString():SetTextColor(1, 1, 1) + end + GuildRegistrarPurchaseText:SetTextColor(1, 1, 1) AvailableServicesText:SetTextColor(1, 1, 0) end local function LFGuildFrameStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.lfguild ~= true then return end - for r, I in pairs(LFGFrameList)do - _G[I]:SetCheckboxTemplate(true) - end - LookingForGuildTankButton.checkButton:SetCheckboxTemplate(true) - LookingForGuildHealerButton.checkButton:SetCheckboxTemplate(true) - LookingForGuildDamagerButton.checkButton:SetCheckboxTemplate(true) - LookingForGuildFrameInset:Formula409(false) - LookingForGuildFrame:Formula409() - LookingForGuildFrame:SetPanelTemplate("Action") - LookingForGuildBrowseButton_LeftSeparator:MUNG() - LookingForGuildRequestButton_RightSeparator:MUNG() - STYLE:ApplyScrollFrameStyle(LookingForGuildBrowseFrameContainerScrollBar) - LookingForGuildBrowseButton:SetButtonTemplate() - LookingForGuildRequestButton:SetButtonTemplate() - STYLE:ApplyCloseButtonStyle(LookingForGuildFrameCloseButton) - LookingForGuildCommentInputFrame:SetPanelTemplate("Default") - LookingForGuildCommentInputFrame:Formula409(false) - for u = 1, 5 do - local J = _G["LookingForGuildBrowseFrameContainerButton"..u] - local K = _G["LookingForGuildAppsFrameContainerButton"..u] - J:SetBackdrop(nil) - K:SetBackdrop(nil) - end - for u = 1, 3 do - local tab = _G["LookingForGuildFrameTab"..u] - STYLE:ApplyTabStyle(tab) - tab:SetFrameStrata("HIGH") - tab:SetFrameLevel(99) - end - GuildFinderRequestMembershipFrame:Formula409(true) - GuildFinderRequestMembershipFrame:SetFixedPanelTemplate("Transparent", true) - GuildFinderRequestMembershipFrameAcceptButton:SetButtonTemplate() - GuildFinderRequestMembershipFrameCancelButton:SetButtonTemplate() - GuildFinderRequestMembershipFrameInputFrame:Formula409() - GuildFinderRequestMembershipFrameInputFrame:SetFixedPanelTemplate("Default") + if(SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.lfguild ~= true) then return end + + STYLE:ApplyWindowStyle(LookingForGuildFrame, true) + + for i = 1, #LFGFrameList do + local check = _G[LFGFrameList[i]] + if(check) then check:SetCheckboxTemplate(true) end + end + + LookingForGuildTankButton.checkButton:SetCheckboxTemplate(true) + LookingForGuildHealerButton.checkButton:SetCheckboxTemplate(true) + LookingForGuildDamagerButton.checkButton:SetCheckboxTemplate(true) + LookingForGuildFrameInset:RemoveTextures(false) + LookingForGuildBrowseButton_LeftSeparator:Die() + LookingForGuildRequestButton_RightSeparator:Die() + + STYLE:ApplyScrollFrameStyle(LookingForGuildBrowseFrameContainerScrollBar) + LookingForGuildBrowseButton:SetButtonTemplate() + LookingForGuildRequestButton:SetButtonTemplate() + + STYLE:ApplyCloseButtonStyle(LookingForGuildFrameCloseButton) + LookingForGuildCommentInputFrame:SetPanelTemplate("Default") + LookingForGuildCommentInputFrame:RemoveTextures(false) + + for u = 1, 5 do + local J = _G["LookingForGuildBrowseFrameContainerButton"..u] + local K = _G["LookingForGuildAppsFrameContainerButton"..u] + J:SetBackdrop(nil) + K:SetBackdrop(nil) + end + + for u = 1, 3 do + local tab = _G["LookingForGuildFrameTab"..u] + STYLE:ApplyTabStyle(tab) + tab:SetFrameStrata("HIGH") + tab:SetFrameLevel(99) + end + + GuildFinderRequestMembershipFrame:RemoveTextures(true) + GuildFinderRequestMembershipFrame:SetFixedPanelTemplate("Transparent", true) + GuildFinderRequestMembershipFrameAcceptButton:SetButtonTemplate() + GuildFinderRequestMembershipFrameCancelButton:SetButtonTemplate() + GuildFinderRequestMembershipFrameInputFrame:RemoveTextures() + GuildFinderRequestMembershipFrameInputFrame:SetFixedPanelTemplate("Default") end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/help.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/help.lua index dab4f0d..cc98a24 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/help.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/help.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -62,53 +62,53 @@ HELPFRAME STYLER ########################################################## ]]-- local function HelpFrameStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.help ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.help ~= true then return end tinsert(HelpFrameButtonList, "HelpFrameButton16") tinsert(HelpFrameButtonList, "HelpFrameSubmitSuggestionSubmit") tinsert(HelpFrameButtonList, "HelpFrameReportBugSubmit") for d = 1, #HelpFrameList do - _G[HelpFrameList[d]]:Formula409(true) + _G[HelpFrameList[d]]:RemoveTextures(true) _G[HelpFrameList[d]]:SetPanelTemplate("Default") end HelpFrameHeader:SetFrameLevel(HelpFrameHeader:GetFrameLevel()+2) HelpFrameKnowledgebaseErrorFrame:SetFrameLevel(HelpFrameKnowledgebaseErrorFrame:GetFrameLevel()+2) - HelpFrameReportBugScrollFrame:Formula409() + HelpFrameReportBugScrollFrame:RemoveTextures() HelpFrameReportBugScrollFrame:SetPanelTemplate("Default") HelpFrameReportBugScrollFrame.Panel:Point("TOPLEFT", -4, 4) HelpFrameReportBugScrollFrame.Panel:Point("BOTTOMRIGHT", 6, -4) for d = 1, HelpFrameReportBug:GetNumChildren()do local e = select(d, HelpFrameReportBug:GetChildren()) if not e:GetName() then - e:Formula409() + e:RemoveTextures() end end STYLE:ApplyScrollFrameStyle(HelpFrameReportBugScrollFrameScrollBar) - HelpFrameSubmitSuggestionScrollFrame:Formula409() + HelpFrameSubmitSuggestionScrollFrame:RemoveTextures() HelpFrameSubmitSuggestionScrollFrame:SetPanelTemplate("Default") HelpFrameSubmitSuggestionScrollFrame.Panel:Point("TOPLEFT", -4, 4) HelpFrameSubmitSuggestionScrollFrame.Panel:Point("BOTTOMRIGHT", 6, -4) for d = 1, HelpFrameSubmitSuggestion:GetNumChildren()do local e = select(d, HelpFrameSubmitSuggestion:GetChildren()) if not e:GetName() then - e:Formula409() + e:RemoveTextures() end end STYLE:ApplyScrollFrameStyle(HelpFrameSubmitSuggestionScrollFrameScrollBar) - HelpFrameTicketScrollFrame:Formula409() + HelpFrameTicketScrollFrame:RemoveTextures() HelpFrameTicketScrollFrame:SetPanelTemplate("Default") HelpFrameTicketScrollFrame.Panel:Point("TOPLEFT", -4, 4) HelpFrameTicketScrollFrame.Panel:Point("BOTTOMRIGHT", 6, -4) for d = 1, HelpFrameTicket:GetNumChildren()do local e = select(d, HelpFrameTicket:GetChildren()) if not e:GetName() then - e:Formula409() + e:RemoveTextures() end end STYLE:ApplyScrollFrameStyle(HelpFrameKnowledgebaseScrollFrame2ScrollBar) for d = 1, #HelpFrameButtonList do - _G[HelpFrameButtonList[d]]:Formula409(true) + _G[HelpFrameButtonList[d]]:RemoveTextures(true) _G[HelpFrameButtonList[d]]:SetButtonTemplate() if _G[HelpFrameButtonList[d]].text then _G[HelpFrameButtonList[d]].text:ClearAllPoints() @@ -125,14 +125,14 @@ local function HelpFrameStyle() end for d = 1, HelpFrameKnowledgebaseScrollFrameScrollChild:GetNumChildren()do local f = _G["HelpFrameKnowledgebaseScrollFrameButton"..d] - f:Formula409(true) + f:RemoveTextures(true) f:SetButtonTemplate() end HelpFrameKnowledgebaseSearchBox:ClearAllPoints() HelpFrameKnowledgebaseSearchBox:Point("TOPLEFT", HelpFrameMainInset, "TOPLEFT", 13, -10) - HelpFrameKnowledgebaseNavBarOverlay:MUNG() - HelpFrameKnowledgebaseNavBar:Formula409() - HelpFrame:Formula409(true) + HelpFrameKnowledgebaseNavBarOverlay:Die() + HelpFrameKnowledgebaseNavBar:RemoveTextures() + HelpFrame:RemoveTextures(true) HelpFrame:SetPanelTemplate("Halftone") HelpFrameKnowledgebaseSearchBox:SetEditboxTemplate() STYLE:ApplyScrollFrameStyle(HelpFrameKnowledgebaseScrollFrameScrollBar, 5) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/inspect.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/inspect.lua index 58da4cb..7c03ee4 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/inspect.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/inspect.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -46,37 +46,37 @@ INSPECT UI STYLER ########################################################## ]]-- local function InspectStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.inspect ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.inspect ~= true then return - end; - InspectFrame:Formula409(true) - InspectFrameInset:Formula409(true) + end + InspectFrame:RemoveTextures(true) + InspectFrameInset:RemoveTextures(true) InspectFrame:SetPanelTemplate('Action') STYLE:ApplyCloseButtonStyle(InspectFrameCloseButton) for d = 1, 4 do STYLE:ApplyTabStyle(_G["InspectFrameTab"..d]) - end; - InspectModelFrameBorderTopLeft:MUNG() - InspectModelFrameBorderTopRight:MUNG() - InspectModelFrameBorderTop:MUNG() - InspectModelFrameBorderLeft:MUNG() - InspectModelFrameBorderRight:MUNG() - InspectModelFrameBorderBottomLeft:MUNG() - InspectModelFrameBorderBottomRight:MUNG() - InspectModelFrameBorderBottom:MUNG() - InspectModelFrameBorderBottom2:MUNG() - InspectModelFrameBackgroundOverlay:MUNG() + end + InspectModelFrameBorderTopLeft:Die() + InspectModelFrameBorderTopRight:Die() + InspectModelFrameBorderTop:Die() + InspectModelFrameBorderLeft:Die() + InspectModelFrameBorderRight:Die() + InspectModelFrameBorderBottomLeft:Die() + InspectModelFrameBorderBottomRight:Die() + InspectModelFrameBorderBottom:Die() + InspectModelFrameBorderBottom2:Die() + InspectModelFrameBackgroundOverlay:Die() InspectModelFrame:SetPanelTemplate("Default") for _, slot in pairs(InspectSlotList)do local texture = _G["Inspect"..slot.."IconTexture"] local frame = _G["Inspect"..slot] - frame:Formula409() + frame:RemoveTextures() frame:SetButtonTemplate() texture:SetTexCoord(0.1, 0.9, 0.1, 0.9) texture:FillInner() frame:SetFrameLevel(frame:GetFrameLevel() + 1) frame:SetFixedPanelTemplate() - end; + end hooksecurefunc('InspectPaperDollItemSlotButton_Update', function(q) local unit = InspectFrame.unit; local r = GetInventoryItemQuality(unit, q:GetID()) @@ -87,9 +87,9 @@ local function InspectStyle() q.Panel:SetBackdropBorderColor(0,0,0,1) end end) - InspectGuildFrameBG:MUNG() - InspectTalentFrame:Formula409() -end; + InspectGuildFrameBG:Die() + InspectTalentFrame:RemoveTextures() +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/itemsocketing.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/itemsocketing.lua index ff3268f..54bcc19 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/itemsocketing.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/itemsocketing.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -21,11 +21,11 @@ ITEMSOCKETING STYLER ########################################################## ]]-- local function ItemSocketStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.socket ~= true then return end; - ItemSocketingFrame:Formula409() + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.socket ~= true then return end + ItemSocketingFrame:RemoveTextures() ItemSocketingFrame:SetPanelTemplate("Action") - ItemSocketingFrameInset:MUNG() - ItemSocketingScrollFrame:Formula409() + ItemSocketingFrameInset:Die() + ItemSocketingScrollFrame:RemoveTextures() ItemSocketingScrollFrame:SetPanelTemplate("Inset", true) STYLE:ApplyScrollFrameStyle(ItemSocketingScrollFrameScrollBar, 2) for j = 1, MAX_NUM_SOCKETS do @@ -33,14 +33,14 @@ local function ItemSocketStyle() local C = _G[("ItemSocketingSocket%dBracketFrame"):format(j)]; local D = _G[("ItemSocketingSocket%dBackground"):format(j)]; local E = _G[("ItemSocketingSocket%dIconTexture"):format(j)]; - i:Formula409() + i:RemoveTextures() i:SetButtonTemplate() i:SetFixedPanelTemplate("Button", true) - C:MUNG() - D:MUNG() + C:Die() + D:Die() E:SetTexCoord(0.1, 0.9, 0.1, 0.9) E:FillInner() - end; + end hooksecurefunc("ItemSocketingFrame_Update", function() local max = GetNumSockets() for j=1, max do @@ -51,12 +51,12 @@ local function ItemSocketStyle() i:SetBackdropBorderColor(color.r, color.g, color.b) end end) - ItemSocketingFramePortrait:MUNG() + ItemSocketingFramePortrait:Die() ItemSocketingSocketButton:ClearAllPoints() ItemSocketingSocketButton:Point("BOTTOMRIGHT", ItemSocketingFrame, "BOTTOMRIGHT", -5, 5) ItemSocketingSocketButton:SetButtonTemplate() STYLE:ApplyCloseButtonStyle(ItemSocketingFrameCloseButton) -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/itemupgrade.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/itemupgrade.lua index 250dd27..ebb78de 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/itemupgrade.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/itemupgrade.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -21,14 +21,16 @@ ITEMUPGRADE UI STYLER ########################################################## ]]-- local function ItemUpgradeStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.itemUpgrade ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.itemUpgrade ~= true then return - end; - ItemUpgradeFrame:Formula409() - ItemUpgradeFrame:SetPanelTemplate("Action") + end + + STYLE:ApplyWindowStyle(ItemUpgradeFrame, true) + STYLE:ApplyCloseButtonStyle(ItemUpgradeFrameCloseButton) + ItemUpgradeFrameUpgradeButton:RemoveTextures() ItemUpgradeFrameUpgradeButton:SetButtonTemplate() - ItemUpgradeFrame.ItemButton:Formula409() + ItemUpgradeFrame.ItemButton:RemoveTextures() ItemUpgradeFrame.ItemButton:SetSlotTemplate(true) ItemUpgradeFrame.ItemButton.IconTexture:FillInner() hooksecurefunc('ItemUpgradeFrame_Update', function() @@ -39,10 +41,10 @@ local function ItemUpgradeStyle() ItemUpgradeFrame.ItemButton.IconTexture:SetAlpha(0) end end) - ItemUpgradeFrameMoneyFrame:Formula409() - ItemUpgradeFrame.FinishedGlow:MUNG() + ItemUpgradeFrameMoneyFrame:RemoveTextures() + ItemUpgradeFrame.FinishedGlow:Die() ItemUpgradeFrame.ButtonFrame:DisableDrawLayer('BORDER') -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/keybinding.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/keybinding.lua index 0b5db01..e664fdb 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/keybinding.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/keybinding.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -28,18 +28,32 @@ local BindButtons = { } local function BindingStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.binding ~= true then return end + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.binding ~= true then return end for _, gName in pairs(BindButtons)do local btn = _G[gName] if(btn) then - btn:Formula409() - btn:SetFixedPanelTemplate("Default") + btn:RemoveTextures() + btn:SetButtonTemplate() end end - STYLE:ApplyScrollStyle(KeyBindingFrameScrollFrameScrollBar) - KeyBindingFrame:Formula409() + for i = 1, KEY_BINDINGS_DISPLAYED do + local button1 = _G["KeyBindingFrameBinding"..i.."Key1Button"] + if(button1) then + button1:RemoveTextures(true) + button1:SetEditboxTemplate() + end + + local button2 = _G["KeyBindingFrameBinding"..i.."Key2Button"] + if(button2) then + button2:RemoveTextures(true) + button2:SetEditboxTemplate() + end + end + + STYLE:ApplyScrollFrameStyle(KeyBindingFrameScrollFrameScrollBar) + KeyBindingFrame:RemoveTextures() KeyBindingFrame:SetPanelTemplate("Halftone") end --[[ diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/lfd.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/lfd.lua index d3783ae..eee4b67 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/lfd.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/lfd.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -43,7 +43,7 @@ local Incentive_OnHide = function(button) end local LFDQueueRandom_OnUpdate = function() - LFDQueueFrame:Formula409() + LFDQueueFrame:RemoveTextures() for u = 1, LFD_MAX_REWARDS do local t = _G["LFDQueueFrameRandomScrollFrameChildFrameItem"..u] local icon = _G["LFDQueueFrameRandomScrollFrameChildFrameItem"..u.."IconTexture"] @@ -76,7 +76,7 @@ local LFDQueueRandom_OnUpdate = function() end local ScenarioQueueRandom_OnUpdate = function() - LFDQueueFrame:Formula409() + LFDQueueFrame:RemoveTextures() for u = 1, LFD_MAX_REWARDS do local t = _G["ScenarioQueueFrameRandomScrollFrameChildFrameItem"..u] local icon = _G["ScenarioQueueFrameRandomScrollFrameChildFrameItem"..u.."IconTexture"] @@ -106,12 +106,12 @@ LFD STYLER ########################################################## ]]-- local function LFDFrameStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.lfg ~= true then return end + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.lfg ~= true then return end - PVEFrame:Formula409() - PVEFrame:SetPanelTemplate("Action") - PVEFrameLeftInset:Formula409() - RaidFinderQueueFrame:Formula409(true) + STYLE:ApplyWindowStyle(PVEFrame, true) + + PVEFrameLeftInset:RemoveTextures() + RaidFinderQueueFrame:RemoveTextures(true) PVEFrameBg:Hide() PVEFrameTitleBg:Hide() PVEFramePortrait:Hide() @@ -133,14 +133,14 @@ local function LFDFrameStyle() GroupFinderFrameGroupButton3.icon:SetTexture("Interface\\Icons\\Icon_Scenarios") GroupFinderFrameGroupButton4.icon:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\SVUI-EMBLEM") - LFGDungeonReadyDialogBackground:MUNG() + LFGDungeonReadyDialogBackground:Die() LFGDungeonReadyDialogEnterDungeonButton:SetButtonTemplate() LFGDungeonReadyDialogLeaveQueueButton:SetButtonTemplate() STYLE:ApplyCloseButtonStyle(LFGDungeonReadyDialogCloseButton) - LFGDungeonReadyDialog:Formula409() + LFGDungeonReadyDialog:RemoveTextures() LFGDungeonReadyDialog:SetPanelTemplate("Pattern", true, 2, 4, 4) - LFGDungeonReadyStatus:Formula409() + LFGDungeonReadyStatus:RemoveTextures() LFGDungeonReadyStatus:SetPanelTemplate("Pattern", true, 2, 4, 4) LFGDungeonReadyDialogRoleIconTexture:SetTexture("Interface\\LFGFrame\\UI-LFG-ICONS-ROLEBACKGROUNDS") LFGDungeonReadyDialogRoleIconTexture:SetAlpha(0.5) @@ -167,9 +167,9 @@ local function LFDFrameStyle() LFDQueueFrameRoleButtonTankIncentiveIcon:HookScript("OnHide", Incentive_OnHide) LFDQueueFrameRoleButtonHealerIncentiveIcon:HookScript("OnHide", Incentive_OnHide) LFDQueueFrameRoleButtonDPSIncentiveIcon:HookScript("OnHide", Incentive_OnHide) - LFDQueueFrameRoleButtonTank.shortageBorder:MUNG() - LFDQueueFrameRoleButtonDPS.shortageBorder:MUNG() - LFDQueueFrameRoleButtonHealer.shortageBorder:MUNG() + LFDQueueFrameRoleButtonTank.shortageBorder:Die() + LFDQueueFrameRoleButtonDPS.shortageBorder:Die() + LFDQueueFrameRoleButtonHealer.shortageBorder:Die() LFGDungeonReadyDialog.filigree:SetAlpha(0) LFGDungeonReadyDialog.bottomArt:SetAlpha(0) STYLE:ApplyCloseButtonStyle(LFGDungeonReadyStatusCloseButton) @@ -177,7 +177,7 @@ local function LFDFrameStyle() for _,name in pairs(LFDFrameList) do local frame = _G[name]; if frame then - frame.checkButton:Formula409() + frame.checkButton:RemoveTextures() frame.checkButton:SetCheckboxTemplate(true, -4, -4) frame.checkButton:SetFrameLevel(frame.checkButton:GetFrameLevel() + 50) frame:DisableDrawLayer("BACKGROUND") @@ -245,10 +245,10 @@ local function LFDFrameStyle() PVEFrameTab1:SetPoint('BOTTOMLEFT', PVEFrame, 'BOTTOMLEFT', 19, -31) STYLE:ApplyCloseButtonStyle(PVEFrameCloseButton) - LFDParentFrame:Formula409() - LFDQueueFrameFindGroupButton:Formula409() - LFDParentFrameInset:Formula409() - LFDQueueFrameSpecificListScrollFrame:Formula409() + LFDParentFrame:RemoveTextures() + LFDQueueFrameFindGroupButton:RemoveTextures() + LFDParentFrameInset:RemoveTextures() + LFDQueueFrameSpecificListScrollFrame:RemoveTextures() LFDQueueFrameFindGroupButton:SetButtonTemplate() hooksecurefunc("LFDQueueFrameRandom_UpdateFrame", LFDQueueRandom_OnUpdate) @@ -256,7 +256,7 @@ local function LFDFrameStyle() for i = 1, NUM_SCENARIO_CHOICE_BUTTONS do local box = _G["ScenarioQueueFrameSpecificButton"..i.."EnableButton"] if(box and (not box.Panel)) then - box:Formula409() + box:RemoveTextures() box:SetCheckboxTemplate(true, -2, -3) end end @@ -264,18 +264,18 @@ local function LFDFrameStyle() STYLE:ApplyDropdownStyle(LFDQueueFrameTypeDropDown) - RaidFinderFrame:Formula409() - RaidFinderFrameBottomInset:Formula409() - RaidFinderFrameRoleInset:Formula409() - LFDQueueFrameRandomScrollFrameScrollBar:Formula409() - ScenarioQueueFrameSpecificScrollFrame:Formula409() + RaidFinderFrame:RemoveTextures() + RaidFinderFrameBottomInset:RemoveTextures() + RaidFinderFrameRoleInset:RemoveTextures() + LFDQueueFrameRandomScrollFrameScrollBar:RemoveTextures() + ScenarioQueueFrameSpecificScrollFrame:RemoveTextures() RaidFinderFrameBottomInsetBg:Hide() RaidFinderFrameBtnCornerRight:Hide() RaidFinderFrameButtonBottomBorder:Hide() STYLE:ApplyDropdownStyle(RaidFinderQueueFrameSelectionDropDown) - RaidFinderFrameFindRaidButton:Formula409() + RaidFinderFrameFindRaidButton:RemoveTextures() RaidFinderFrameFindRaidButton:SetButtonTemplate() - RaidFinderQueueFrame:Formula409() + RaidFinderQueueFrame:RemoveTextures() for u = 1, LFD_MAX_REWARDS do local t = _G["RaidFinderQueueFrameScrollFrameChildFrameItem"..u] @@ -285,7 +285,7 @@ local function LFDFrameStyle() local x = _G["RaidFinderQueueFrameScrollFrameChildFrameItem"..u.."ShortageBorder"] local y = _G["RaidFinderQueueFrameScrollFrameChildFrameItem"..u.."Count"] local z = _G["RaidFinderQueueFrameScrollFrameChildFrameItem"..u.."NameFrame"] - t:Formula409() + t:RemoveTextures() icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) icon:SetDrawLayer("OVERLAY") y:SetDrawLayer("OVERLAY") @@ -309,7 +309,7 @@ local function LFDFrameStyle() ScenarioQueueFrame.Bg:Hide() ScenarioFinderFrameInset:GetRegions():Hide() hooksecurefunc("ScenarioQueueFrameRandom_UpdateFrame", ScenarioQueueRandom_OnUpdate) - ScenarioQueueFrameFindGroupButton:Formula409() + ScenarioQueueFrameFindGroupButton:RemoveTextures() ScenarioQueueFrameFindGroupButton:SetButtonTemplate() STYLE:ApplyDropdownStyle(ScenarioQueueFrameTypeDropDown) LFRBrowseFrameRoleInset:DisableDrawLayer("BORDER") @@ -334,7 +334,7 @@ local function LFDFrameStyle() RaidBrowserFrame:HookScript('OnShow', function() if not LFRQueueFrameSpecificListScrollFrameScrollBar.styled then STYLE:ApplyScrollFrameStyle(LFRQueueFrameSpecificListScrollFrameScrollBar) - LFRBrowseFrame:Formula409() + LFRBrowseFrame:RemoveTextures() for u = 1, 2 do local C = _G['LFRParentFrameSideTab'..u] C:DisableDrawLayer('BACKGROUND') @@ -367,7 +367,7 @@ local function LFDFrameStyle() end end) - LFGInvitePopup:Formula409() + LFGInvitePopup:RemoveTextures() LFGInvitePopup:SetPanelTemplate("Pattern", true, 2, 4, 4) LFGInvitePopupAcceptButton:SetButtonTemplate() LFGInvitePopupDeclineButton:SetButtonTemplate() @@ -388,7 +388,7 @@ local function LFDFrameStyle() for u = 1, NUM_LFD_CHOICE_BUTTONS do local box = _G["LFDQueueFrameSpecificListButton"..u.."EnableButton"] if(box and (not box.Panel)) then - box:Formula409() + box:RemoveTextures() box:SetCheckboxTemplate(true, -2, -3) box:SetFrameLevel(box:GetFrameLevel() + 50) end @@ -397,7 +397,7 @@ local function LFDFrameStyle() for u = 1, NUM_LFR_CHOICE_BUTTONS do local box = _G["LFRQueueFrameSpecificListButton"..u.."EnableButton"] if(box and (not box.Panel)) then - box:Formula409() + box:RemoveTextures() box:SetCheckboxTemplate(true, -2, -3) box:SetFrameLevel(box:GetFrameLevel() + 50) end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/loothistory.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/loothistory.lua index 8664c68..cd54324 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/loothistory.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/loothistory.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -30,10 +30,10 @@ local MissingLootFrame_OnShow = function() local color = GetItemQualityColor(P) or 0,0,0,1 icon:SetTexture(g) M:SetBackdropBorderColor(color) - end; + end local Q = ceil(N/2) MissingLootFrame:SetHeight(Q * 43 + 38 + MissingLootFrameLabel:GetHeight()) -end; +end local LootHistoryFrame_OnUpdate = function(o) local N = C_LootHistory.GetNumItems() @@ -41,7 +41,7 @@ local LootHistoryFrame_OnUpdate = function(o) local M = LootHistoryFrame.itemFrames[u] if not M.isStyled then local Icon = M.Icon:GetTexture() - M:Formula409() + M:RemoveTextures() M.Icon:SetTexture(Icon) M.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) M:SetFixedPanelTemplate("Button") @@ -50,7 +50,7 @@ local LootHistoryFrame_OnUpdate = function(o) M.isStyled = true end end -end; +end --[[ ########################################################## LOOTHISTORY STYLER @@ -58,15 +58,15 @@ LOOTHISTORY STYLER ]]-- local function LootHistoryStyle() LootHistoryFrame:SetFrameStrata('HIGH') - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.loot ~= true then return end; + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.loot ~= true then return end local M = MissingLootFrame; - M:Formula409() + M:RemoveTextures() M:SetPanelTemplate("Pattern") STYLE:ApplyCloseButtonStyle(MissingLootFramePassButton) hooksecurefunc("MissingLootFrame_Show", MissingLootFrame_OnShow) - LootHistoryFrame:Formula409() + LootHistoryFrame:RemoveTextures() STYLE:ApplyCloseButtonStyle(LootHistoryFrame.CloseButton) - LootHistoryFrame:Formula409() + LootHistoryFrame:RemoveTextures() LootHistoryFrame:SetFixedPanelTemplate('Transparent') STYLE:ApplyCloseButtonStyle(LootHistoryFrame.ResizeButton) LootHistoryFrame.ResizeButton:SetFixedPanelTemplate() @@ -77,15 +77,15 @@ local function LootHistoryStyle() LootHistoryFrame.ResizeButton:SetNormalTexture("") local txt = LootHistoryFrame.ResizeButton:CreateFontString(nil,"OVERLAY") - txt:SetFont(SuperVillain.Media.font.roboto, 14, "NONE") + txt:SetFont(SV.Media.font.roboto, 14, "NONE") txt:SetAllPoints(LootHistoryFrame.ResizeButton) txt:SetJustifyH("CENTER") txt:SetText("RESIZE") - LootHistoryFrameScrollFrame:Formula409() + LootHistoryFrameScrollFrame:RemoveTextures() STYLE:ApplyScrollFrameStyle(LootHistoryFrameScrollFrameScrollBar) hooksecurefunc("LootHistoryFrame_FullUpdate", LootHistoryFrame_OnUpdate) - MasterLooterFrame:Formula409() + MasterLooterFrame:RemoveTextures() MasterLooterFrame:SetFixedPanelTemplate() MasterLooterFrame:SetFrameStrata('FULLSCREEN_DIALOG') hooksecurefunc("MasterLooterFrame_Show", function() @@ -94,13 +94,13 @@ local function LootHistoryStyle() local u = J.Icon; local icon = u:GetTexture() local S = ITEM_QUALITY_COLORS[LootFrame.selectedQuality] - J:Formula409() + J:RemoveTextures() u:SetTexture(icon) u:SetTexCoord(0.1, 0.9, 0.1, 0.9) J:SetPanelTemplate("Pattern") J.Panel:WrapOuter(u) J.Panel:SetBackdropBorderColor(S.r, S.g, S.b) - end; + end for u = 1, MasterLooterFrame:GetNumChildren()do local T = select(u, MasterLooterFrame:GetChildren()) if T and not T.isStyled and not T:GetName() then @@ -110,18 +110,18 @@ local function LootHistoryStyle() else T:SetFixedPanelTemplate() T:SetButtonTemplate() - end; + end T.isStyled = true end end end end) - BonusRollFrame:Formula409() + BonusRollFrame:RemoveTextures() STYLE:ApplyAlertStyle(BonusRollFrame) BonusRollFrame.PromptFrame.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - BonusRollFrame.PromptFrame.Timer.Bar:SetTexture(SuperVillain.Media.bar.default) + BonusRollFrame.PromptFrame.Timer.Bar:SetTexture(SV.Media.bar.default) BonusRollFrame.PromptFrame.Timer.Bar:SetVertexColor(0.1, 1, 0.1) -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/lossofcontrol.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/lossofcontrol.lua index 880b3ad..17d99f3 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/lossofcontrol.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/lossofcontrol.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -26,33 +26,33 @@ local _hook_LossOfControl = function(self, ...) self.AbilityName:ClearAllPoints() self.AbilityName:SetPoint("BOTTOM", self, 0, -28) self.AbilityName.scrollTime = nil; - self.AbilityName:SetFont(SuperVillain.Media.font.names, 20, 'OUTLINE') + self.AbilityName:SetFont(SV.Media.font.names, 20, 'OUTLINE') self.TimeLeft.NumberText:ClearAllPoints() self.TimeLeft.NumberText:SetPoint("BOTTOM", self, 4, -58) self.TimeLeft.NumberText.scrollTime = nil; - self.TimeLeft.NumberText:SetFont(SuperVillain.Media.font.numbers, 20, 'OUTLINE') + self.TimeLeft.NumberText:SetFont(SV.Media.font.numbers, 20, 'OUTLINE') self.TimeLeft.SecondsText:ClearAllPoints() self.TimeLeft.SecondsText:SetPoint("BOTTOM", self, 0, -80) self.TimeLeft.SecondsText.scrollTime = nil; - self.TimeLeft.SecondsText:SetFont(SuperVillain.Media.font.roboto, 20, 'OUTLINE') + self.TimeLeft.SecondsText:SetFont(SV.Media.font.roboto, 20, 'OUTLINE') if self.Anim:IsPlaying() then self.Anim:Stop() end end local function LossOfControlStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.losscontrol ~= true then return end; + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.losscontrol ~= true then return end local IconBackdrop = CreateFrame("Frame", nil, LossOfControlFrame) IconBackdrop:WrapOuter(LossOfControlFrame.Icon) IconBackdrop:SetFrameLevel(LossOfControlFrame:GetFrameLevel()-1) IconBackdrop:SetPanelTemplate("Slot") LossOfControlFrame.Icon:SetTexCoord(.1, .9, .1, .9) - LossOfControlFrame:Formula409() + LossOfControlFrame:RemoveTextures() LossOfControlFrame.AbilityName:ClearAllPoints() LossOfControlFrame:Size(LossOfControlFrame.Icon:GetWidth() + 50) --local bg = CreateFrame("Frame", nil, LossOfControlFrame) hooksecurefunc("LossOfControlFrame_SetUpDisplay", _hook_LossOfControl) -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/macro.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/macro.lua index 91cf285..4c4feb2 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/macro.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/macro.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -32,35 +32,35 @@ MACRO UI STYLER ########################################################## ]]-- local function MacroUIStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.macro ~= true then return end; + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.macro ~= true then return end STYLE:ApplyCloseButtonStyle(MacroFrameCloseButton) STYLE:ApplyScrollFrameStyle(MacroButtonScrollFrameScrollBar) STYLE:ApplyScrollFrameStyle(MacroFrameScrollFrameScrollBar) STYLE:ApplyScrollFrameStyle(MacroPopupScrollFrameScrollBar) MacroFrame:Width(360) for b = 1, #MacroButtonList do - _G[MacroButtonList[b]]:Formula409() + _G[MacroButtonList[b]]:RemoveTextures() _G[MacroButtonList[b]]:SetButtonTemplate() - end; + end for b = 1, #MacroButtonList2 do local a1,p,a2,x,y = _G[MacroButtonList2[b]]:GetPoint() _G[MacroButtonList2[b]]:SetPoint(a1,p,a2,x,-25) - end; + end for b = 1, 2 do tab = _G[format("MacroFrameTab%s", b)] tab:Height(22) - end; + end MacroFrameTab1:Point("TOPLEFT", MacroFrame, "TOPLEFT", 85, -39) MacroFrameTab2:Point("LEFT", MacroFrameTab1, "RIGHT", 4, 0) - MacroFrame:Formula409() + MacroFrame:RemoveTextures() MacroFrame:SetPanelTemplate("Action") MacroFrame.Panel:SetPoint("BOTTOMRIGHT",MacroFrame,"BOTTOMRIGHT",0,-25) - MacroFrameText:SetFont(SuperVillain.Media.font.roboto, 10, "OUTLINE") - MacroFrameTextBackground:Formula409() + MacroFrameText:SetFont(SV.Media.font.roboto, 10, "OUTLINE") + MacroFrameTextBackground:RemoveTextures() MacroFrameTextBackground:SetBasicPanel() - MacroPopupFrame:Formula409() + MacroPopupFrame:RemoveTextures() MacroPopupFrame:SetBasicPanel() - MacroPopupScrollFrame:Formula409() + MacroPopupScrollFrame:RemoveTextures() MacroPopupScrollFrame:SetPanelTemplate("Pattern") MacroPopupScrollFrame.Panel:Point("TOPLEFT", 51, 2) MacroPopupScrollFrame.Panel:Point("BOTTOMRIGHT", -4, 4) @@ -69,7 +69,7 @@ local function MacroUIStyle() MacroPopupNameLeft:SetTexture(0,0,0,0) MacroPopupNameMiddle:SetTexture(0,0,0,0) MacroPopupNameRight:SetTexture(0,0,0,0) - MacroFrameInset:MUNG() + MacroFrameInset:Die() MacroEditButton:ClearAllPoints() MacroEditButton:Point("BOTTOMLEFT", MacroFrameSelectedMacroButton, "BOTTOMRIGHT", 10, 0) STYLE:ApplyScrollFrameStyle(MacroButtonScrollFrame) @@ -77,7 +77,7 @@ local function MacroUIStyle() c:ClearAllPoints() c:Point("TOPLEFT", MacroFrame, "TOPRIGHT", 5, -2) end) - MacroFrameSelectedMacroButton:Formula409() + MacroFrameSelectedMacroButton:RemoveTextures() MacroFrameSelectedMacroButton:SetSlotTemplate() MacroFrameSelectedMacroButtonIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9) MacroFrameSelectedMacroButtonIcon:FillInner() @@ -89,7 +89,7 @@ local function MacroUIStyle() local f = _G["MacroPopupButton"..b] local g = _G["MacroPopupButton"..b.."Icon"] if d then - d:Formula409() + d:RemoveTextures() d:SetButtonTemplate() local level = d:GetFrameLevel() if(level > 0) then @@ -98,23 +98,23 @@ local function MacroUIStyle() d.Panel:SetFrameLevel(0) end d:SetBackdropColor(0, 0, 0, 0) - end; + end if e then e:SetTexCoord(0.1, 0.9, 0.1, 0.9) e:FillInner() e:SetDrawLayer("OVERLAY") - end; + end if f then - f:Formula409() + f:RemoveTextures() f:SetButtonTemplate() f:SetBackdropColor(0, 0, 0, 0) - end; + end if g then g:SetTexCoord(0.1, 0.9, 0.1, 0.9) g:FillInner() end end -end; +end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/mailbox.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/mailbox.lua index 23a6456..4189fbd 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/mailbox.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/mailbox.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -24,47 +24,48 @@ local function MailFrame_OnUpdate() for b = 1, ATTACHMENTS_MAX_SEND do local d = _G["SendMailAttachment"..b] if not d.styled then - d:Formula409()d:SetFixedPanelTemplate("Default") + d:RemoveTextures()d:SetFixedPanelTemplate("Default") d:SetButtonTemplate() d.styled = true - end; + end local e = d:GetNormalTexture() if e then e:SetTexCoord(0.1, 0.9, 0.1, 0.9) e:FillInner() end end -end; +end --[[ ########################################################## MAILBOX STYLER ########################################################## ]]-- local function MailBoxStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.mail ~= true then return end; - MailFrame:Formula409(true) - MailFrame:SetPanelTemplate("Halftone") + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.mail ~= true then return end + + STYLE:ApplyWindowStyle(MailFrame) + for b = 1, INBOXITEMS_TO_DISPLAY do local i = _G["MailItem"..b] - i:Formula409() + i:RemoveTextures() i:SetPanelTemplate("Inset") i.Panel:Point("TOPLEFT", 2, 1) i.Panel:Point("BOTTOMRIGHT", -2, 2) local d = _G["MailItem"..b.."Button"] - d:Formula409() + d:RemoveTextures() d:SetButtonTemplate() local e = _G["MailItem"..b.."ButtonIcon"] e:SetTexCoord(0.1, 0.9, 0.1, 0.9) e:FillInner() - end; + end STYLE:ApplyCloseButtonStyle(MailFrameCloseButton) STYLE:ApplyPaginationStyle(InboxPrevPageButton) STYLE:ApplyPaginationStyle(InboxNextPageButton) - MailFrameTab1:Formula409() - MailFrameTab2:Formula409() + MailFrameTab1:RemoveTextures() + MailFrameTab2:RemoveTextures() STYLE:ApplyTabStyle(MailFrameTab1) STYLE:ApplyTabStyle(MailFrameTab2) - SendMailScrollFrame:Formula409(true) + SendMailScrollFrame:RemoveTextures(true) SendMailScrollFrame:SetFixedPanelTemplate("Inset") STYLE:ApplyScrollFrameStyle(SendMailScrollFrameScrollBar) SendMailNameEditBox:SetEditboxTemplate() @@ -72,8 +73,8 @@ local function MailBoxStyle() SendMailMoneyGold:SetEditboxTemplate() SendMailMoneySilver:SetEditboxTemplate() SendMailMoneyCopper:SetEditboxTemplate() - SendMailMoneyBg:MUNG() - SendMailMoneyInset:Formula409() + SendMailMoneyBg:Die() + SendMailMoneyInset:RemoveTextures() _G["SendMailMoneySilver"]:SetEditboxTemplate() _G["SendMailMoneySilver"].Panel:Point("TOPLEFT", -2, 1) @@ -87,52 +88,52 @@ local function MailBoxStyle() SendMailNameEditBox.Panel:Point("BOTTOMRIGHT", 2, 4) SendMailSubjectEditBox.Panel:Point("BOTTOMRIGHT", 2, 0) - SendMailFrame:Formula409() + SendMailFrame:RemoveTextures() hooksecurefunc("SendMailFrame_Update", MailFrame_OnUpdate) SendMailMailButton:SetButtonTemplate() SendMailCancelButton:SetButtonTemplate() - OpenMailFrame:Formula409(true) + OpenMailFrame:RemoveTextures(true) OpenMailFrame:SetFixedPanelTemplate("Transparent", true) - OpenMailFrameInset:MUNG() + OpenMailFrameInset:Die() STYLE:ApplyCloseButtonStyle(OpenMailFrameCloseButton) OpenMailReportSpamButton:SetButtonTemplate() OpenMailReplyButton:SetButtonTemplate() OpenMailDeleteButton:SetButtonTemplate() OpenMailCancelButton:SetButtonTemplate() - InboxFrame:Formula409() - MailFrameInset:MUNG() - OpenMailScrollFrame:Formula409(true) + InboxFrame:RemoveTextures() + MailFrameInset:Die() + OpenMailScrollFrame:RemoveTextures(true) OpenMailScrollFrame:SetFixedPanelTemplate("Default") STYLE:ApplyScrollFrameStyle(OpenMailScrollFrameScrollBar) SendMailBodyEditBox:SetTextColor(1, 1, 1) OpenMailBodyText:SetTextColor(1, 1, 1) InvoiceTextFontNormal:SetTextColor(1, 1, 1) - OpenMailArithmeticLine:MUNG() - OpenMailLetterButton:Formula409() + OpenMailArithmeticLine:Die() + OpenMailLetterButton:RemoveTextures() OpenMailLetterButton:SetFixedPanelTemplate("Default") OpenMailLetterButton:SetButtonTemplate() OpenMailLetterButtonIconTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9) OpenMailLetterButtonIconTexture:FillInner() - OpenMailMoneyButton:Formula409() + OpenMailMoneyButton:RemoveTextures() OpenMailMoneyButton:SetFixedPanelTemplate("Default") OpenMailMoneyButton:SetButtonTemplate() OpenMailMoneyButtonIconTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9) OpenMailMoneyButtonIconTexture:FillInner() for b = 1, ATTACHMENTS_MAX_SEND do local d = _G["OpenMailAttachmentButton"..b] - d:Formula409() + d:RemoveTextures() d:SetButtonTemplate() local e = _G["OpenMailAttachmentButton"..b.."IconTexture"] if e then e:SetTexCoord(0.1, 0.9, 0.1, 0.9) e:FillInner() end - end; + end OpenMailReplyButton:Point("RIGHT", OpenMailDeleteButton, "LEFT", -2, 0) OpenMailDeleteButton:Point("RIGHT", OpenMailCancelButton, "LEFT", -2, 0) SendMailMailButton:Point("RIGHT", SendMailCancelButton, "LEFT", -2, 0) -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/merchant.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/merchant.lua index cb83a27..518b12f 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/merchant.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/merchant.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -21,8 +21,8 @@ FRAME STYLER ########################################################## ]]-- local function MerchantStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.merchant ~= true then return end; - MerchantFrame:Formula409(true) + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.merchant ~= true then return end + MerchantFrame:RemoveTextures(true) MerchantFrame:SetPanelTemplate("Halftone", false, nil, 2, 4) local level = MerchantFrame:GetFrameLevel() if(level > 0) then @@ -30,36 +30,36 @@ local function MerchantStyle() else MerchantFrame:SetFrameLevel(0) end - MerchantBuyBackItem:Formula409(true) + MerchantBuyBackItem:RemoveTextures(true) MerchantBuyBackItem:SetPanelTemplate("Inset", true, 2, 2, 3) MerchantBuyBackItem.Panel:SetFrameLevel(MerchantBuyBackItem.Panel:GetFrameLevel() + 1) - MerchantBuyBackItemItemButton:Formula409() + MerchantBuyBackItemItemButton:RemoveTextures() MerchantBuyBackItemItemButton:SetButtonTemplate() - MerchantExtraCurrencyInset:Formula409() - MerchantExtraCurrencyBg:Formula409() - MerchantFrameInset:Formula409() - MerchantMoneyBg:Formula409() - MerchantMoneyInset:Formula409() + MerchantExtraCurrencyInset:RemoveTextures() + MerchantExtraCurrencyBg:RemoveTextures() + MerchantFrameInset:RemoveTextures() + MerchantMoneyBg:RemoveTextures() + MerchantMoneyInset:RemoveTextures() MerchantFrameInset:SetPanelTemplate("Inset") MerchantFrameInset.Panel:SetFrameLevel(MerchantFrameInset.Panel:GetFrameLevel() + 1) STYLE:ApplyDropdownStyle(MerchantFrameLootFilter) for b = 1, 2 do STYLE:ApplyTabStyle(_G["MerchantFrameTab"..b]) - end; + end for b = 1, 12 do local d = _G["MerchantItem"..b.."ItemButton"] local e = _G["MerchantItem"..b.."ItemButtonIconTexture"] - local o = _G["MerchantItem"..b]o:Formula409(true) + local o = _G["MerchantItem"..b]o:RemoveTextures(true) o:SetFixedPanelTemplate("Inset") - d:Formula409() + d:RemoveTextures() d:SetButtonTemplate() d:Point("TOPLEFT", o, "TOPLEFT", 4, -4) e:SetTexCoord(0.1, 0.9, 0.1, 0.9) e:FillInner() _G["MerchantItem"..b.."MoneyFrame"]:ClearAllPoints() _G["MerchantItem"..b.."MoneyFrame"]:Point("BOTTOMLEFT", d, "BOTTOMRIGHT", 3, 0) - end; - MerchantBuyBackItemItemButton:Formula409() + end + MerchantBuyBackItemItemButton:RemoveTextures() MerchantBuyBackItemItemButton:SetButtonTemplate() MerchantBuyBackItemItemButtonIconTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9) MerchantBuyBackItemItemButtonIconTexture:FillInner() @@ -70,7 +70,7 @@ local function MerchantStyle() p:SetTexCoord(0.04, 0.24, 0.06, 0.5) p:FillInner() end - end;MerchantGuildBankRepairButton:SetButtonTemplate() + end MerchantGuildBankRepairButton:SetButtonTemplate() MerchantGuildBankRepairButtonIcon:SetTexCoord(0.61, 0.82, 0.1, 0.52) MerchantGuildBankRepairButtonIcon:FillInner() MerchantRepairAllButton:SetButtonTemplate() @@ -80,7 +80,7 @@ local function MerchantStyle() STYLE:ApplyCloseButtonStyle(MerchantFrameCloseButton, MerchantFrame.Panel) STYLE:ApplyPaginationStyle(MerchantNextPageButton) STYLE:ApplyPaginationStyle(MerchantPrevPageButton) -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/petbattle.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/petbattle.lua index d4a3a33..f3cf0fa 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/petbattle.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/petbattle.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -42,39 +42,46 @@ PETBATTLE STYLER ########################################################## ]]-- local function PetBattleStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.petbattleui ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.petbattleui ~= true then return - end + end + local PetBattleFrame = _G["PetBattleFrame"]; local BottomFrame = PetBattleFrame.BottomFrame; local ActiveFramesList = { PetBattleFrame.ActiveAlly, PetBattleFrame.ActiveEnemy } local StandardFramesList = { PetBattleFrame.Ally2, PetBattleFrame.Ally3, PetBattleFrame.Enemy2, PetBattleFrame.Enemy3 } STYLE:ApplyCloseButtonStyle(FloatingBattlePetTooltip.CloseButton) - PetBattleFrame:Formula409() + PetBattleFrame:RemoveTextures() + for i, frame in pairs(ActiveFramesList) do if(not frame.isStyled) then frame.Border:SetAlpha(0) frame.Border2:SetAlpha(0) frame.healthBarWidth = 300; + frame.IconBackdrop = CreateFrame("Frame", nil, frame) - frame.IconBackdrop:SetFrameLevel(frame:GetFrameLevel()-1) - frame.IconBackdrop:WrapOuter(frame.Icon) - frame.IconBackdrop:SetFixedPanelTemplate("Slot") - frame.BorderFlash:MUNG() - frame.HealthBarBG:MUNG() - frame.HealthBarFrame:MUNG() + frame.IconBackdrop:SetFrameLevel(0) + frame.IconBackdrop:WrapOuter(frame.Icon, 3, 3) + frame.IconBackdrop:SetSlotTemplate(true, 3, 0, 0, true); + + frame.IconBackdrop.Panel:SetFixedPanelTemplate("Blackout") + + frame.BorderFlash:Die() + frame.HealthBarBG:Die() + frame.HealthBarFrame:Die() frame.HealthBarBackdrop = CreateFrame("Frame", nil, frame) frame.HealthBarBackdrop:SetFrameLevel(frame:GetFrameLevel()-1) - frame.HealthBarBackdrop:SetFixedPanelTemplate("Inset") + frame.HealthBarBackdrop:SetFixedPanelTemplate("Blackout") frame.HealthBarBackdrop:Width(frame.healthBarWidth+(2)) - frame.ActualHealthBar:SetTexture([[Interface\BUTTONS\WHITE8X8]]) + frame.ActualHealthBar:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) frame.PetTypeFrame = CreateFrame("Frame", nil, frame) frame.PetTypeFrame:Size(100, 23) frame.PetTypeFrame.text = frame.PetTypeFrame:CreateFontString(nil, 'OVERLAY') - frame.PetTypeFrame.text:SetFontTemplate() + frame.PetTypeFrame.text:SetFont(SV.Media.font.roboto, 12, "OUTLINE") frame.PetTypeFrame.text:SetText("") frame.ActualHealthBar:ClearAllPoints() + frame.Name:SetFontObject(SystemFont_Shadow_Outline_Huge2) frame.Name:ClearAllPoints() frame.FirstAttack = frame:CreateTexture(nil, "ARTWORK") frame.FirstAttack:Size(30) @@ -86,7 +93,7 @@ local function PetBattleStyle() PetBattleFrame.Ally2.iconPoint = frame.IconBackdrop; PetBattleFrame.Ally3.iconPoint = frame.IconBackdrop; frame.ActualHealthBar:Point('BOTTOMLEFT', frame.Icon, 'BOTTOMRIGHT', 10, 0) - frame.Name:Point('BOTTOMLEFT', frame.ActualHealthBar, 'TOPLEFT', 0, 10) + frame.Name:Point('BOTTOMLEFT', frame.ActualHealthBar, 'TOPLEFT', 0, 8) frame.PetTypeFrame:SetPoint("BOTTOMRIGHT", frame.HealthBarBackdrop, "TOPRIGHT", 0, 4) frame.PetTypeFrame.text:SetPoint("RIGHT") frame.FirstAttack:SetPoint("LEFT", frame.HealthBarBackdrop, "RIGHT", 5, 0) @@ -99,7 +106,7 @@ local function PetBattleStyle() PetBattleFrame.Enemy2.iconPoint = frame.IconBackdrop; PetBattleFrame.Enemy3.iconPoint = frame.IconBackdrop; frame.ActualHealthBar:Point('BOTTOMRIGHT', frame.Icon, 'BOTTOMLEFT', -10, 0) - frame.Name:Point('BOTTOMRIGHT', frame.ActualHealthBar, 'TOPRIGHT', 0, 10) + frame.Name:Point('BOTTOMRIGHT', frame.ActualHealthBar, 'TOPRIGHT', 0, 8) frame.PetTypeFrame:SetPoint("BOTTOMLEFT", frame.HealthBarBackdrop, "TOPLEFT", 2, 4) frame.PetTypeFrame.text:SetPoint("LEFT") frame.FirstAttack:SetPoint("RIGHT", frame.HealthBarBackdrop, "LEFT", -5, 0) @@ -108,14 +115,14 @@ local function PetBattleStyle() end frame.HealthText:ClearAllPoints() frame.HealthText:SetPoint('CENTER', frame.HealthBarBackdrop, 'CENTER') + frame.PetType:SetFrameLevel(frame.PetTypeFrame:GetFrameLevel()+2) frame.PetType:ClearAllPoints() frame.PetType:SetAllPoints(frame.PetTypeFrame) - frame.PetType:SetFrameLevel(frame.PetTypeFrame:GetFrameLevel()+2) frame.PetType:SetAlpha(0) frame.LevelUnderlay:SetAlpha(0) frame.Level:SetFontObject(NumberFont_Outline_Huge) frame.Level:ClearAllPoints() - frame.Level:Point('BOTTOMLEFT', frame.Icon, 'BOTTOMLEFT', 2, 2) + frame.Level:Point('BOTTOMLEFT', frame.Icon, 'BOTTOMLEFT', -2, -2) if frame.SpeedIcon then frame.SpeedIcon:ClearAllPoints() frame.SpeedIcon:SetPoint("CENTER") @@ -133,25 +140,21 @@ local function PetBattleStyle() frame.HealthDivider:SetAlpha(0) frame:Size(40) - local tempBG = CreateFrame('Frame', nil, frame) - tempBG:WrapOuter(frame, 2, 2) - tempBG:SetFrameLevel(0) - tempBG:SetBackdrop({ edgeFile = [[Interface\BUTTONS\WHITE8X8]], edgeSize = 2 }) - tempBG:SetBackdropBorderColor(0, 0, 0) + frame.IconBackdrop = CreateFrame("Frame", nil, frame) + frame.IconBackdrop:SetFrameLevel(0) + frame.IconBackdrop:WrapOuter(frame, 2, 2) + frame.IconBackdrop:SetSlotTemplate(true, 2, 0, 0, true); - frame.bgTexture = tempBG:CreateTexture(nil, "BACKGROUND", nil, -5) - frame.bgTexture:FillInner(frame, 2, 2) - frame.bgTexture:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - frame.bgTexture:SetVertexColor(0.1, 0.1, 0.1) - frame.bgTexture:SetBlendMode("ADD") + frame.IconBackdrop.Panel:SetFixedPanelTemplate("Blackout") frame:ClearAllPoints() frame.healthBarWidth = 40; frame.ActualHealthBar:ClearAllPoints() - frame.ActualHealthBar:SetPoint("TOPLEFT", tempBG, 'BOTTOMLEFT', 1, -3) + frame.ActualHealthBar:SetPoint("TOPLEFT", frame.IconBackdrop, 'BOTTOMLEFT', 2, -3) + frame.ActualHealthBar:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) frame.HealthBarBackdrop = CreateFrame("Frame", nil, frame) frame.HealthBarBackdrop:SetFrameLevel(frame:GetFrameLevel()-1) - frame.HealthBarBackdrop:SetFixedPanelTemplate("Inset") + frame.HealthBarBackdrop:SetFixedPanelTemplate("Blackout") frame.HealthBarBackdrop:Width(frame.healthBarWidth+2) frame.HealthBarBackdrop:Point('TOPLEFT', frame.ActualHealthBar, 'TOPLEFT', -1, 1) frame.HealthBarBackdrop:Point('BOTTOMLEFT', frame.ActualHealthBar, 'BOTTOMLEFT', -1, -1) @@ -164,8 +167,13 @@ local function PetBattleStyle() PetBattleActionBar:EnableMouse(true) PetBattleActionBar:SetFrameLevel(0) PetBattleActionBar:SetFrameStrata('BACKGROUND') - PetBattleActionBar:SetFixedPanelTemplate("Inset") - PetBattleActionBar:SetPoint("BOTTOM", SuperVillain.UIParent, "BOTTOM", 0, 4) + PetBattleActionBar:SetFixedPanelTemplate("Blackout") + + if(SuperDockBottomDataAnchor) then + PetBattleActionBar:SetPoint("BOTTOM", SuperDockBottomDataAnchor, "TOP", 0, 4) + else + PetBattleActionBar:SetPoint("BOTTOM", SV.UIParent, "BOTTOM", 0, 4) + end PetBattleFrame.TopVersusText:ClearAllPoints() PetBattleFrame.TopVersusText:SetPoint("TOP", PetBattleFrame, "TOP", 0, -42) @@ -175,28 +183,29 @@ local function PetBattleStyle() PetBattleFrame.Enemy2:SetPoint("TOPLEFT", PetBattleFrame.Enemy2.iconPoint, "TOPRIGHT", 6, -2) PetBattleFrame.Enemy3:SetPoint('TOPLEFT', PetBattleFrame.Enemy2, 'TOPRIGHT', 8, 0) - BottomFrame:Formula409() - BottomFrame.TurnTimer:Formula409() + BottomFrame:RemoveTextures() + BottomFrame.TurnTimer:RemoveTextures() BottomFrame.TurnTimer.SkipButton:SetParent(PetBattleActionBar) BottomFrame.TurnTimer.SkipButton:SetButtonTemplate() - BottomFrame.TurnTimer.SkipButton:Width(PBAB_WIDTH) + BottomFrame.TurnTimer.SkipButton:Size((PBAB_WIDTH * 0.2) - 4, 18) BottomFrame.TurnTimer.SkipButton:ClearAllPoints() - BottomFrame.TurnTimer.SkipButton:SetPoint("BOTTOM", PetBattleActionBar, "TOP", 0, -1) + BottomFrame.TurnTimer.SkipButton:SetPoint("BOTTOMLEFT", PetBattleActionBar.Panel, "TOPLEFT", 2, 2) BottomFrame.TurnTimer:Size(BottomFrame.TurnTimer.SkipButton:GetWidth(), BottomFrame.TurnTimer.SkipButton:GetHeight()) BottomFrame.TurnTimer:ClearAllPoints() - BottomFrame.TurnTimer:SetPoint("TOP", SuperVillain.UIParent, "TOP", 0, -140) + BottomFrame.TurnTimer:SetPoint("TOP", SV.UIParent, "TOP", 0, -140) BottomFrame.TurnTimer.TimerText:SetPoint("CENTER") - BottomFrame.FlowFrame:Formula409() - BottomFrame.MicroButtonFrame:MUNG() - BottomFrame.Delimiter:Formula409() + BottomFrame.FlowFrame:RemoveTextures() + BottomFrame.MicroButtonFrame:Die() + BottomFrame.Delimiter:RemoveTextures() BottomFrame.xpBar:ClearAllPoints() BottomFrame.xpBar:SetParent(PetBattleActionBar) - BottomFrame.xpBar:Width(PBAB_WIDTH - 2) - BottomFrame.xpBar:SetPanelTemplate("Inset") - BottomFrame.xpBar:SetPoint("BOTTOM", BottomFrame.TurnTimer.SkipButton, "TOP", 0, 1) + BottomFrame.xpBar:Size((PBAB_WIDTH * 0.8) - 4, 16) + BottomFrame.xpBar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) + BottomFrame.xpBar:SetPanelTemplate("Bar") + BottomFrame.xpBar:SetPoint("BOTTOMRIGHT", PetBattleActionBar.Panel, "TOPRIGHT", -3, 3) BottomFrame.xpBar:SetScript("OnShow", function(self) - self:Formula409() - self:SetStatusBarTexture(SuperVillain.Media.bar.default) + self:RemoveTextures() + self:SetStatusBarTexture(SV.Media.bar.default) end) for i = 1, 3 do @@ -214,7 +223,7 @@ local function PetBattleStyle() pet.HealthText:SetAlpha(0) end - PetBattleQueueReadyFrame:Formula409() + PetBattleQueueReadyFrame:RemoveTextures() PetBattleQueueReadyFrame:SetBasicPanel() PetBattleQueueReadyFrame.AcceptButton:SetButtonTemplate() PetBattleQueueReadyFrame.DeclineButton:SetButtonTemplate() @@ -273,7 +282,7 @@ local function PetBattleStyle() else frame:SetBackdropBorderColor(1, 0, 0) end - frame.Duration:SetFont(SuperVillain.Media.font.numbers, 16, "OUTLINE") + frame.Duration:SetFont(SV.Media.font.numbers, 16, "OUTLINE") frame.Duration:ClearAllPoints() frame.Duration:SetPoint("BOTTOMLEFT", frame.Icon, "BOTTOMLEFT", 4, 4) if turnsRemaining > 0 then @@ -293,23 +302,32 @@ local function PetBattleStyle() self.Label:Hide() self.Duration:SetPoint("CENTER", self, 0, 8) self:ClearAllPoints() - self:SetPoint("TOP", SuperVillain.UIParent, 0, -15) + self:SetPoint("TOP", SV.UIParent, 0, -15) end end) hooksecurefunc("PetBattleUnitFrame_UpdateDisplay", function(self) self.Icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) + --Update the pet rarity border + if (self.IconBackdrop) then + local petOwner = self.petOwner; + local petIndex = self.petIndex; + local rarity = C_PetBattles.GetBreedQuality(petOwner, petIndex); + if (ENABLE_COLORBLIND_MODE ~= "1") then + self.IconBackdrop:SetBackdropColor(ITEM_QUALITY_COLORS[rarity-1].r, ITEM_QUALITY_COLORS[rarity-1].g, ITEM_QUALITY_COLORS[rarity-1].b); + self.IconBackdrop:SetBackdropBorderColor(ITEM_QUALITY_COLORS[rarity-1].r, ITEM_QUALITY_COLORS[rarity-1].g, ITEM_QUALITY_COLORS[rarity-1].b); + end + end end) hooksecurefunc("PetBattleAbilityTooltip_Show", function() - PetBattlePrimaryAbilityTooltip:ClearAllPoints() - PetBattlePrimaryAbilityTooltip:SetPoint("BOTTOMLEFT", RightSuperDock, "TOPLEFT") + SV:AnchorToCursor(PetBattlePrimaryAbilityTooltip) end) hooksecurefunc(BottomFrame.TurnTimer.SkipButton, "SetPoint", function(self, arg1, _, arg2, arg3, arg4) if (arg1 ~= "BOTTOM" or arg2 ~= "TOP" or arg3 ~= 0 or arg4 ~= -1) then self:ClearAllPoints() - self:SetPoint("BOTTOM", PetBattleActionBar, "TOP", 0, -1) + self:SetPoint("BOTTOMLEFT", PetBattleActionBar.Panel, "TOPLEFT", 2, 2) end end) @@ -345,7 +363,7 @@ local function PetBattleStyle() PetBattleButtonHelper(self.BottomFrame.ForfeitButton) end) - SuperVillain.SVTip:ReLoad() + SV.SVTip:ReLoad() end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/petition.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/petition.lua index 4897c43..5f58559 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/petition.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/petition.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -21,12 +21,12 @@ PETITIONFRAME STYLER ########################################################## ]]-- local function PetitionFrameStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.petition ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.petition ~= true then return - end; - PetitionFrame:Formula409(true) + end + PetitionFrame:RemoveTextures(true) PetitionFrame:SetFixedPanelTemplate("Transparent", true) - PetitionFrameInset:MUNG() + PetitionFrameInset:Die() PetitionFrameSignButton:SetButtonTemplate() PetitionFrameRequestButton:SetButtonTemplate() PetitionFrameRenameButton:SetButtonTemplate() @@ -39,11 +39,11 @@ local function PetitionFrameStyle() PetitionFrameMemberTitle:SetTextColor(1, 1, 0) for g = 1, 9 do _G["PetitionFrameMemberName"..g]:SetTextColor(1, 1, 1) - end; + end PetitionFrameInstructions:SetTextColor(1, 1, 1) PetitionFrameRenameButton:Point("LEFT", PetitionFrameRequestButton, "RIGHT", 3, 0) PetitionFrameRenameButton:Point("RIGHT", PetitionFrameCancelButton, "LEFT", -3, 0) -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/petjournal.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/petjournal.lua index bfeb0c1..817957a 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/petjournal.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/petjournal.lua @@ -13,69 +13,13 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## HELPERS ########################################################## ]]-- -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 StyleListButton(this, adjust, shrink) - if(not this or (this and this.StyleHooked)) then return end - - local link = this:GetName() - local barName = this.MountBar - local bar = _G[barName] - - this:SetPanelTemplate("Button", true, 1, -2, -2) - - 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) - 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"]:SetFont(SuperVillain.Media.font.numbers, 12, "OUTLINE") - _G[link.."Count"]:SetDrawLayer("ARTWORK",7) - end - - if bar then - bar:SetParent(this.Panel) - end - end - this:HookScript("OnEnter", Button_OnEnter) - this:HookScript("OnLeave", Button_OnLeave) - - this.StyleHooked = true -end - local function PetJournal_UpdateMounts() for b = 1, #MountJournal.ListScrollFrame.buttons do local d = _G["MountJournalListScrollFrameButton"..b] @@ -143,52 +87,58 @@ FRAME STYLER ########################################################## ]]-- local function PetJournalStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.mounts ~= true then return end - PetJournalParent:Formula409() - PetJournalParent:SetPanelTemplate("Halftone") + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.mounts ~= true then return end + + STYLE:ApplyWindowStyle(PetJournalParent) + PetJournalParentPortrait:Hide() STYLE:ApplyTabStyle(PetJournalParentTab1) STYLE:ApplyTabStyle(PetJournalParentTab2) STYLE:ApplyCloseButtonStyle(PetJournalParentCloseButton) - MountJournal:Formula409() - MountJournal.LeftInset:Formula409() - MountJournal.RightInset:Formula409() - MountJournal.MountDisplay:Formula409() - MountJournal.MountDisplay.ShadowOverlay:Formula409() - MountJournal.MountCount:Formula409() - MountJournalListScrollFrame:Formula409() + + MountJournal:RemoveTextures() + MountJournal.LeftInset:RemoveTextures() + MountJournal.RightInset:RemoveTextures() + MountJournal.MountDisplay:RemoveTextures() + MountJournal.MountDisplay.ShadowOverlay:RemoveTextures() + MountJournal.MountCount:RemoveTextures() + MountJournalListScrollFrame:RemoveTextures() MountJournalMountButton:SetButtonTemplate() MountJournalSearchBox:SetEditboxTemplate() + STYLE:ApplyScrollFrameStyle(MountJournalListScrollFrameScrollBar) - MountJournal.MountDisplay:SetFixedPanelTemplate("Comic") + MountJournal.MountDisplay:SetFixedPanelTemplate("ModelComic") + for i = 1, #MountJournal.ListScrollFrame.buttons do local button = _G["MountJournalListScrollFrameButton"..i] - if(button) then - StyleListButton(button) + STYLE:ApplyItemButtonStyle(button, nil, true, true) + local bar = _G["SVUI_MountSelectBar"..i] + if(bar) then bar:SetParent(button.Panel) end end end + hooksecurefunc("MountJournal_UpdateMountList", PetJournal_UpdateMounts) MountJournalListScrollFrame:HookScript("OnVerticalScroll", PetJournal_UpdateMounts) MountJournalListScrollFrame:HookScript("OnMouseWheel", PetJournal_UpdateMounts) - PetJournalSummonButton:Formula409() - PetJournalFindBattle:Formula409() + PetJournalSummonButton:RemoveTextures() + PetJournalFindBattle:RemoveTextures() PetJournalSummonButton:SetButtonTemplate() PetJournalFindBattle:SetButtonTemplate() - PetJournalRightInset:Formula409() - PetJournalLeftInset:Formula409() + PetJournalRightInset:RemoveTextures() + PetJournalLeftInset:RemoveTextures() for i = 1, 3 do local button = _G["PetJournalLoadoutPet" .. i .. "HelpFrame"] - button:Formula409() + button:RemoveTextures() end - PetJournalTutorialButton:MUNG() - PetJournal.PetCount:Formula409() + PetJournalTutorialButton:Die() + PetJournal.PetCount:RemoveTextures() PetJournalSearchBox:SetEditboxTemplate() - PetJournalFilterButton:Formula409(true) + PetJournalFilterButton:RemoveTextures(true) PetJournalFilterButton:SetButtonTemplate() - PetJournalListScrollFrame:Formula409() + PetJournalListScrollFrame:RemoveTextures() STYLE:ApplyScrollFrameStyle(PetJournalListScrollFrameScrollBar) for i = 1, #PetJournal.listScroll.buttons do @@ -215,29 +165,22 @@ local function PetJournalStyle() PetJournalAchievementStatus:DisableDrawLayer('BACKGROUND') STYLE:ApplyItemButtonStyle(PetJournalHealPetButton, true) PetJournalHealPetButton.texture:SetTexture([[Interface\Icons\spell_magic_polymorphrabbit]]) - PetJournalLoadoutBorder:Formula409() + PetJournalLoadoutBorder:RemoveTextures() for b = 1, 3 do local pjPet = _G['PetJournalLoadoutPet'..b] - pjPet:Formula409() - pjPet:SetPanelTemplate("Inset") - local level = pjPet:GetFrameLevel() - if(level > 0) then - pjPet.Panel:SetFrameLevel(level - 1) - else - pjPet.Panel:SetFrameLevel(0) - end + pjPet:RemoveTextures() pjPet.petTypeIcon:SetPoint('BOTTOMLEFT', 2, 2) pjPet.dragButton:WrapOuter(_G['PetJournalLoadoutPet'..b..'Icon']) pjPet.hover = true; pjPet.pushed = true; pjPet.checked = true; - STYLE:ApplyItemButtonStyle(pjPet) - pjPet.setButton:Formula409() - _G['PetJournalLoadoutPet'..b..'HealthFrame'].healthBar:Formula409() + STYLE:ApplyItemButtonStyle(pjPet, nil, nil, true) + pjPet.setButton:RemoveTextures() + _G['PetJournalLoadoutPet'..b..'HealthFrame'].healthBar:RemoveTextures() _G['PetJournalLoadoutPet'..b..'HealthFrame'].healthBar:SetPanelTemplate('Default') - _G['PetJournalLoadoutPet'..b..'HealthFrame'].healthBar:SetStatusBarTexture(SuperVillain.Media.bar.default) - _G['PetJournalLoadoutPet'..b..'XPBar']:Formula409() + _G['PetJournalLoadoutPet'..b..'HealthFrame'].healthBar:SetStatusBarTexture(SV.Media.bar.default) + _G['PetJournalLoadoutPet'..b..'XPBar']:RemoveTextures() _G['PetJournalLoadoutPet'..b..'XPBar']:SetPanelTemplate('Default') _G['PetJournalLoadoutPet'..b..'XPBar']:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) _G['PetJournalLoadoutPet'..b..'XPBar']:SetFrameLevel(_G['PetJournalLoadoutPet'..b..'XPBar']:GetFrameLevel()+2) @@ -251,7 +194,7 @@ local function PetJournalStyle() end end - PetJournalSpellSelect:Formula409() + PetJournalSpellSelect:RemoveTextures() for b = 1, 2 do local Q = _G['PetJournalSpellSelectSpell'..b] @@ -260,18 +203,12 @@ local function PetJournalStyle() _G['PetJournalSpellSelectSpell'..b..'Icon']:SetDrawLayer('BORDER') end - PetJournalPetCard:Formula409() - PetJournalPetCard:SetPanelTemplate("Inset") - local level = PetJournalPetCard:GetFrameLevel() - if(level > 0) then - PetJournalPetCard.Panel:SetFrameLevel(level - 1) - else - PetJournalPetCard.Panel:SetFrameLevel(0) - end - PetJournalPetCardInset:Formula409() + PetJournalPetCard:RemoveTextures() + STYLE:ApplyItemButtonStyle(PetJournalPetCard, nil, nil, true) + PetJournalPetCardInset:RemoveTextures() PetJournalPetCardPetInfo.levelBG:SetAlpha(0) PetJournalPetCardPetInfoIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - PetJournalPetCardPetInfo:SetPanelTemplate('Transparent') + STYLE:ApplyItemButtonStyle(PetJournalPetCardPetInfo, nil, true, true) local fg = CreateFrame("Frame", nil, PetJournalPetCardPetInfo) fg:SetSize(40,40) fg:SetPoint("TOPLEFT", PetJournalPetCardPetInfo, "TOPLEFT", -1, 1) @@ -303,12 +240,30 @@ local function PetJournalStyle() S.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) S.icon:FillInner(S.Panel) end - PetJournalPetCardHealthFrame.healthBar:Formula409() + PetJournalPetCardHealthFrame.healthBar:RemoveTextures() PetJournalPetCardHealthFrame.healthBar:SetPanelTemplate('Default') PetJournalPetCardHealthFrame.healthBar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - PetJournalPetCardXPBar:Formula409() + PetJournalPetCardXPBar:RemoveTextures() PetJournalPetCardXPBar:SetPanelTemplate('Default') PetJournalPetCardXPBar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) + + if(SV.___interface >= 60000) then + STYLE:ApplyTabStyle(PetJournalParentTab3) + ToyBox:RemoveTextures() + ToyBoxProgressBar:SetPanelTemplate("Bar", true) + ToyBoxSearchBox:SetEditboxTemplate() + ToyBoxFilterButton:SetButtonTemplate() + STYLE:ApplyDropdownStyle(ToyBoxFilterDropDown) + ToyBoxIconsFrame:SetBasicPanel() + + for i = 1, 18 do + local gName = ("ToySpellButton%d"):format(i) + local button = _G[gName] + if(button) then + button:SetButtonTemplate() + end + end + end end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/petstable.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/petstable.lua index d4a632e..d31a85c 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/petstable.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/petstable.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -21,11 +21,11 @@ PETSTABLE STYLER ########################################################## ]]-- local function PetStableStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.stable ~= true then return end; - PetStableFrame:Formula409() - PetStableFrameInset:Formula409() - PetStableLeftInset:Formula409() - PetStableBottomInset:Formula409() + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.stable ~= true then return end + PetStableFrame:RemoveTextures() + PetStableFrameInset:RemoveTextures() + PetStableLeftInset:RemoveTextures() + PetStableBottomInset:RemoveTextures() PetStableFrame:SetPanelTemplate("Halftone") PetStableFrameInset:SetFixedPanelTemplate('Inset') STYLE:ApplyCloseButtonStyle(PetStableFrameCloseButton) @@ -35,12 +35,12 @@ local function PetStableStyle() STYLE:ApplyPaginationStyle(PetStableNextPageButton) for j = 1, NUM_PET_ACTIVE_SLOTS do STYLE:ApplyItemButtonStyle(_G['PetStableActivePet'..j], true) - end; + end for j = 1, NUM_PET_STABLE_SLOTS do STYLE:ApplyItemButtonStyle(_G['PetStableStabledPet'..j], true) - end; + end PetStableSelectedPetIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9) -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/pvp.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/pvp.lua index 740e79b..74c44e9 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/pvp.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/pvp.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -23,13 +23,12 @@ PVP STYLER -- LoadAddOn("Blizzard_PVPUI") local function PVPFrameStyle() - if (SuperVillain.db.SVStyle and (SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.pvp ~= true)) then + if (SV.db.SVStyle and (SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.pvp ~= true)) then return end - PVPUIFrame:Formula409() - PVPUIFrame:SetPanelTemplate("Action") - + STYLE:ApplyWindowStyle(PVPUIFrame, true) + STYLE:ApplyCloseButtonStyle(PVPUIFrameCloseButton) for g = 1, 2 do @@ -39,8 +38,8 @@ local function PVPFrameStyle() for i = 1, 3 do local btn = _G["PVPQueueFrameCategoryButton"..i] if(btn) then - btn.Background:MUNG() - btn.Ring:MUNG() + btn.Background:Die() + btn.Ring:Die() btn:SetButtonTemplate() btn.Icon:Size(45) btn.Icon:SetTexCoord(.15, .85, .15, .85) @@ -50,36 +49,42 @@ local function PVPFrameStyle() end STYLE:ApplyDropdownStyle(HonorFrameTypeDropDown) - - HonorFrame.Inset:Formula409() - HonorFrame.Inset:SetBasicPanel() - + HonorFrame.Inset:RemoveTextures() + HonorFrame.Inset:SetFixedPanelTemplate("Inset") STYLE:ApplyScrollFrameStyle(HonorFrameSpecificFrameScrollBar) - - HonorFrameSoloQueueButton:Formula409() - HonorFrameGroupQueueButton:Formula409() + HonorFrameSoloQueueButton:RemoveTextures() + HonorFrameGroupQueueButton:RemoveTextures() HonorFrameSoloQueueButton:SetButtonTemplate() HonorFrameGroupQueueButton:SetButtonTemplate() - - HonorFrame.BonusFrame:Formula409() - HonorFrame.BonusFrame.ShadowOverlay:Formula409() - - HonorFrame.BonusFrame.RandomBGButton:Formula409() + HonorFrame.BonusFrame:RemoveTextures() + HonorFrame.BonusFrame.ShadowOverlay:RemoveTextures() + HonorFrame.BonusFrame.RandomBGButton:RemoveTextures() HonorFrame.BonusFrame.RandomBGButton:SetFixedPanelTemplate("Button") HonorFrame.BonusFrame.RandomBGButton:SetButtonTemplate() HonorFrame.BonusFrame.RandomBGButton.SelectedTexture:FillInner() HonorFrame.BonusFrame.RandomBGButton.SelectedTexture:SetTexture(1, 1, 0, 0.1) - HonorFrame.BonusFrame.CallToArmsButton:Formula409() - HonorFrame.BonusFrame.CallToArmsButton:SetFixedPanelTemplate("Button") - HonorFrame.BonusFrame.CallToArmsButton:SetButtonTemplate() - HonorFrame.BonusFrame.CallToArmsButton.SelectedTexture:FillInner() - HonorFrame.BonusFrame.CallToArmsButton.SelectedTexture:SetTexture(1, 1, 0, 0.1) - + if(SV.___interface < 60000) then + PVPUIFrame.Shadows:RemoveTextures() + HonorFrame.BonusFrame.CallToArmsButton:RemoveTextures() + HonorFrame.BonusFrame.CallToArmsButton:SetFixedPanelTemplate("Button") + HonorFrame.BonusFrame.CallToArmsButton:SetButtonTemplate() + HonorFrame.BonusFrame.CallToArmsButton.SelectedTexture:FillInner() + HonorFrame.BonusFrame.CallToArmsButton.SelectedTexture:SetTexture(1, 1, 0, 0.1) + for g = 1, 2 do + local I = HonorFrame.BonusFrame["WorldPVP"..g.."Button"] + I:RemoveTextures() + I:SetFixedPanelTemplate("Button", true) + I:SetButtonTemplate() + I.SelectedTexture:FillInner() + I.SelectedTexture:SetTexture(1, 1, 0, 0.1) + end + PVPUIFrame.LeftInset:RemoveTextures() + end + HonorFrame.BonusFrame.DiceButton:DisableDrawLayer("ARTWORK") HonorFrame.BonusFrame.DiceButton:SetHighlightTexture("") - - HonorFrame.RoleInset:Formula409() + HonorFrame.RoleInset:RemoveTextures() HonorFrame.RoleInset.DPSIcon.checkButton:SetCheckboxTemplate(true) HonorFrame.RoleInset.TankIcon.checkButton:SetCheckboxTemplate(true) HonorFrame.RoleInset.HealerIcon.checkButton:SetCheckboxTemplate(true) @@ -89,57 +94,49 @@ local function PVPFrameStyle() HonorFrame.RoleInset.HealerIcon:DisableDrawLayer("BACKGROUND") HonorFrame.RoleInset.DPSIcon:DisableDrawLayer("OVERLAY") HonorFrame.RoleInset.DPSIcon:DisableDrawLayer("BACKGROUND") - - hooksecurefunc("LFG_PermanentlyDisableRoleButton", function(self) - if self.bg then - self.bg:SetDesaturated(true) + hooksecurefunc("LFG_PermanentlyDisableRoleButton", function(n) + if n.bg then + n.bg:SetDesaturated(true) end end) - - ConquestFrame.Inset:Formula409() - ConquestPointsBarLeft:MUNG() - ConquestPointsBarRight:MUNG() - ConquestPointsBarMiddle:MUNG() - ConquestPointsBarBG:MUNG() - ConquestPointsBarShadow:MUNG() + + ConquestFrame.Inset:RemoveTextures() + ConquestPointsBarLeft:Die() + ConquestPointsBarRight:Die() + ConquestPointsBarMiddle:Die() + ConquestPointsBarBG:Die() + ConquestPointsBarShadow:Die() ConquestPointsBar.progress:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) ConquestPointsBar:SetFixedPanelTemplate('Inset') ConquestPointsBar.Panel:WrapOuter(ConquestPointsBar, nil, -2) - ConquestFrame:Formula409() - ConquestFrame.ShadowOverlay:Formula409() - - ConquestJoinButton:Formula409() + ConquestFrame:RemoveTextures() + ConquestFrame.ShadowOverlay:RemoveTextures() + ConquestJoinButton:RemoveTextures() ConquestJoinButton:SetButtonTemplate() - - ConquestFrame.RatedBG:Formula409() + ConquestFrame.RatedBG:RemoveTextures() ConquestFrame.RatedBG:SetFixedPanelTemplate("Inset") ConquestFrame.RatedBG:SetButtonTemplate() ConquestFrame.RatedBG.SelectedTexture:FillInner() ConquestFrame.RatedBG.SelectedTexture:SetTexture(1, 1, 0, 0.1) - - WarGamesFrame:Formula409() - WarGamesFrame.RightInset:Formula409() - WarGamesFrameInfoScrollFrame:Formula409() - WarGamesFrameInfoScrollFrameScrollBar:Formula409() - WarGameStartButton:Formula409() + WarGamesFrame:RemoveTextures() + WarGamesFrame.RightInset:RemoveTextures() + WarGamesFrameInfoScrollFrame:RemoveTextures() + WarGamesFrameInfoScrollFrameScrollBar:RemoveTextures() + WarGameStartButton:RemoveTextures() WarGameStartButton:SetButtonTemplate() - STYLE:ApplyScrollFrameStyle(WarGamesFrameScrollFrameScrollBar) STYLE:ApplyScrollFrameStyle(WarGamesFrameInfoScrollFrameScrollBar) - - WarGamesFrame.HorizontalBar:Formula409() - - PVPReadyDialog:Formula409() + WarGamesFrame.HorizontalBar:RemoveTextures() + + PVPReadyDialog:RemoveTextures() PVPReadyDialog:SetPanelTemplate("Pattern") PVPReadyDialogEnterBattleButton:SetButtonTemplate() PVPReadyDialogLeaveQueueButton:SetButtonTemplate() - STYLE:ApplyCloseButtonStyle(PVPReadyDialogCloseButton) - PVPReadyDialogRoleIcon.texture:SetTexture("Interface\\LFGFrame\\UI-LFG-ICONS-ROLEBACKGROUNDS") PVPReadyDialogRoleIcon.texture:SetAlpha(0.5) - ConquestFrame.Inset:SetBasicPanel() + ConquestFrame.Inset:SetFixedPanelTemplate("Inset") WarGamesFrameScrollFrame:SetPanelTemplate("Inset",false,2,2,6) hooksecurefunc("PVPReadyDialog_Display", function(self, l, N, O, P, Q, R) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua index 21d3548..2160d9d 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua @@ -15,7 +15,7 @@ S U P E R - V I L L A I N - U I By: Munglunch # credit: Elv. original logic from ElvUI. Adapted to SVUI # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -55,26 +55,12 @@ local function QueuedWatchFrameItems() _G["WatchFrameItem"..i.."NormalTexture"]:SetAlpha(0) _G["WatchFrameItem"..i.."IconTexture"]:FillInner() _G["WatchFrameItem"..i.."IconTexture"]:SetTexCoord(0.1,0.9,0.1,0.9) - SuperVillain:AddCD(_G["WatchFrameItem"..i.."Cooldown"]) + SV.Timers:AddCooldown(_G["WatchFrameItem"..i.."Cooldown"]) button.styled = true 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") @@ -118,36 +104,88 @@ QUEST STYLERS ########################################################## ]]-- local function QuestGreetingStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.greeting ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.greeting ~= true then return - end + end + QuestFrameGreetingPanel:HookScript("OnShow", function() - QuestFrameGreetingPanel:Formula409() + QuestFrameGreetingPanel:RemoveTextures() QuestFrameGreetingGoodbyeButton:SetButtonTemplate() - QuestGreetingFrameHorizontalBreak:MUNG() + QuestGreetingFrameHorizontalBreak:Die() end) end local function QuestFrameStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.quest ~= true then return end + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.quest ~= true then return end + + STYLE:ApplyWindowStyle(QuestFrame, true, true) + + --[[ THIS SECTION NOT WORKING IN WOD ]]-- + if(SV.___interface < 60000) then + QuestLogScrollFrame:RemoveTextures() + QuestLogCount:RemoveTextures() + EmptyQuestLogFrame:RemoveTextures() + QuestProgressScrollFrame:RemoveTextures() + QuestLogFrameShowMapButton:RemoveTextures() + QuestLogFrameCompleteButton:RemoveTextures() + + STYLE:ApplyWindowStyle(QuestLogFrame) + QuestLogCount:SetFixedPanelTemplate("Default") + + QuestLogDetailFrameInset:Die() + QuestLogFrameInset:Die() + + QuestLogFrameShowMapButton:SetButtonTemplate() + QuestLogFrameShowMapButton.text:ClearAllPoints() + QuestLogFrameShowMapButton.text:SetPoint("CENTER") + + 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) + + 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", 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) + end + --[[ ############################### ]]-- + STYLE:ApplyCloseButtonStyle(QuestLogFrameCloseButton) - STYLE:ApplyScrollStyle(QuestLogDetailScrollFrameScrollBar) - STYLE:ApplyScrollStyle(QuestLogScrollFrameScrollBar, 5) - STYLE:ApplyScrollStyle(QuestProgressScrollFrameScrollBar) - STYLE:ApplyScrollStyle(QuestRewardScrollFrameScrollBar) - - --[[MISC STYLINGS REMOVED HERE]]-- - - QuestGreetingScrollFrame:Formula409() - STYLE:ApplyScrollStyle(QuestGreetingScrollFrameScrollBar) - - --[[MISC STYLINGS REMOVED HERE]]-- + STYLE:ApplyScrollFrameStyle(QuestLogDetailScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(QuestLogScrollFrameScrollBar, 5) + STYLE:ApplyScrollFrameStyle(QuestProgressScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(QuestRewardScrollFrameScrollBar) + + QuestGreetingScrollFrame:RemoveTextures() + STYLE:ApplyScrollFrameStyle(QuestGreetingScrollFrameScrollBar) for i = 1, MAX_NUM_ITEMS do local item = _G["QuestInfoItem"..i] if(item) then local cLvl = item:GetFrameLevel() + 1 - item:Formula409() + item:RemoveTextures() item:Width(item:GetWidth() - 4) item:SetFrameLevel(cLvl) @@ -162,7 +200,7 @@ local function QuestFrameStyle() end end - QuestInfoSkillPointFrame:Formula409() + QuestInfoSkillPointFrame:RemoveTextures() QuestInfoSkillPointFrame:Width(QuestInfoSkillPointFrame:GetWidth() - 4) local curLvl = QuestInfoSkillPointFrame:GetFrameLevel() + 1 @@ -174,45 +212,43 @@ local function QuestFrameStyle() QuestInfoSkillPointFrameIconTexture:Point("TOPLEFT", 2, -2) QuestInfoSkillPointFrameIconTexture:Size(QuestInfoSkillPointFrameIconTexture:GetWidth()-2, QuestInfoSkillPointFrameIconTexture:GetHeight()-2) QuestInfoSkillPointFrameCount:SetDrawLayer("OVERLAY") - QuestInfoItemHighlight:Formula409() + QuestInfoItemHighlight:RemoveTextures() QuestInfoItemHighlight:SetFixedPanelTemplate("Slot") QuestInfoItemHighlight:SetBackdropBorderColor(1, 1, 0) QuestInfoItemHighlight:SetBackdropColor(0, 0, 0, 0) QuestInfoItemHighlight:Size(142, 40) hooksecurefunc("QuestInfoItem_OnClick", Hook_QuestInfoItem_OnClick) - - --QuestLogFrame:HookScript("OnShow", QuestLogScrollFrame_OnShow) + hooksecurefunc("QuestInfo_Display", Hook_QuestInfo_Display) QuestRewardScrollFrame:HookScript("OnShow", QuestRewardScrollFrame_OnShow) - hooksecurefunc("QuestInfo_Display", Hook_QuestInfo_Display) - QuestFrame:Formula409(true) - QuestFrameInset:MUNG() - QuestFrameDetailPanel:Formula409(true) - QuestDetailScrollFrame:Formula409(true) + QuestFrameInset:Die() + QuestFrameDetailPanel:RemoveTextures(true) + QuestDetailScrollFrame:RemoveTextures(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") + QuestDetailScrollChildFrame:RemoveTextures(true) + QuestRewardScrollFrame:RemoveTextures(true) + QuestRewardScrollChildFrame:RemoveTextures(true) + QuestFrameProgressPanel:RemoveTextures(true) + QuestFrameRewardPanel:RemoveTextures(true) + QuestFrameAcceptButton:SetButtonTemplate() QuestFrameDeclineButton:SetButtonTemplate() QuestFrameCompleteButton:SetButtonTemplate() QuestFrameGoodbyeButton:SetButtonTemplate() QuestFrameCompleteQuestButton:SetButtonTemplate() + STYLE:ApplyCloseButtonStyle(QuestFrameCloseButton, QuestFrame.Panel) for j = 1, 6 do local i = _G["QuestProgressItem"..j] local texture = _G["QuestProgressItem"..j.."IconTexture"] - i:Formula409() + i:RemoveTextures() i:SetFixedPanelTemplate("Inset") i:Width(_G["QuestProgressItem"..j]:GetWidth() - 4) texture:SetTexCoord(0.1, 0.9, 0.1, 0.9) @@ -222,10 +258,10 @@ local function QuestFrameStyle() _G["QuestProgressItem"..j.."Count"]:SetDrawLayer("OVERLAY") end - QuestNPCModel:Formula409() + QuestNPCModel:RemoveTextures() QuestNPCModel:SetPanelTemplate("Comic") - QuestNPCModelTextFrame:Formula409() + QuestNPCModelTextFrame:RemoveTextures() QuestNPCModelTextFrame:SetPanelTemplate("Default") QuestNPCModelTextFrame.Panel:Point("TOPLEFT", QuestNPCModel.Panel, "BOTTOMLEFT", 0, -2) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/raid.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/raid.lua index e839fd6..92964a8 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/raid.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/raid.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -44,39 +44,39 @@ RAID STYLERS ########################################################## ]]-- local function RaidUIStyle() - if InCombatLockdown() then return end; - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.raid ~= true then return end; + if InCombatLockdown() then return end + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.raid ~= true then return end for _,group in pairs(RaidGroupList)do - if not _G[group] then print(group) end; + if not _G[group] then print(group) end if _G[group] then - _G[group]:Formula409() + _G[group]:RemoveTextures() end - end; + end for e = 1, 8 do for f = 1, 5 do - _G["RaidGroup"..e.."Slot"..f]:Formula409() + _G["RaidGroup"..e.."Slot"..f]:RemoveTextures() _G["RaidGroup"..e.."Slot"..f]:SetFixedPanelTemplate("Transparent", true) end end -end; +end local function RaidInfoStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.nonraid ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.nonraid ~= true then return - end; - _G["RaidInfoFrame"]:Formula409() - _G["RaidInfoInstanceLabel"]:Formula409() - _G["RaidInfoIDLabel"]:Formula409() - _G["RaidInfoScrollFrameScrollBarBG"]:MUNG() - _G["RaidInfoScrollFrameScrollBarTop"]:MUNG() - _G["RaidInfoScrollFrameScrollBarBottom"]:MUNG() - _G["RaidInfoScrollFrameScrollBarMiddle"]:MUNG() + end + _G["RaidInfoFrame"]:RemoveTextures() + _G["RaidInfoInstanceLabel"]:RemoveTextures() + _G["RaidInfoIDLabel"]:RemoveTextures() + _G["RaidInfoScrollFrameScrollBarBG"]:Die() + _G["RaidInfoScrollFrameScrollBarTop"]:Die() + _G["RaidInfoScrollFrameScrollBarBottom"]:Die() + _G["RaidInfoScrollFrameScrollBarMiddle"]:Die() for g = 1, #RaidInfoFrameList do if _G[RaidInfoFrameList[g]] then _G[RaidInfoFrameList[g]]:SetButtonTemplate() end - end; - RaidInfoScrollFrame:Formula409() + end + RaidInfoScrollFrame:RemoveTextures() RaidInfoFrame:SetBasicPanel() RaidInfoFrame.Panel:Point("TOPLEFT", RaidInfoFrame, "TOPLEFT") RaidInfoFrame.Panel:Point("BOTTOMRIGHT", RaidInfoFrame, "BOTTOMRIGHT") @@ -84,7 +84,7 @@ local function RaidInfoStyle() STYLE:ApplyScrollFrameStyle(RaidInfoScrollFrameScrollBar) RaidFrameRaidBrowserButton:SetButtonTemplate() RaidFrameAllAssistCheckButton:SetCheckboxTemplate(true) -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/reforging.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/reforging.lua index 4f437f2..11a31de 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/reforging.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/reforging.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -21,17 +21,22 @@ REFORGING STYLER ########################################################## ]]-- local function ReforgingStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.reforge ~= true then return end; - ReforgingFrame:Formula409() - ReforgingFrame:SetPanelTemplate("Action") - ReforgingFrame.ButtonFrame:Formula409() + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.reforge ~= true then return end + + STYLE:ApplyWindowStyle(ReforgingFrame, true) + + ReforgingFrame.ButtonFrame:RemoveTextures() ReforgingFrameReforgeButton:ClearAllPoints() ReforgingFrameReforgeButton:Point("LEFT", ReforgingFrameRestoreButton, "RIGHT", 2, 0) ReforgingFrameReforgeButton:Point("BOTTOMRIGHT", -3, 3) ReforgingFrame.RestoreMessage:SetTextColor(1, 1, 1) + + ReforgingFrameRestoreButton:RemoveTextures() + ReforgingFrameReforgeButton:RemoveTextures() ReforgingFrameRestoreButton:SetButtonTemplate() ReforgingFrameReforgeButton:SetButtonTemplate() - ReforgingFrame.ItemButton:Formula409() + + ReforgingFrame.ItemButton:RemoveTextures() ReforgingFrame.ItemButton:SetSlotTemplate(true) ReforgingFrame.ItemButton.IconTexture:FillInner() hooksecurefunc("ReforgingFrame_Update", function(k) @@ -43,7 +48,7 @@ local function ReforgingStyle() end end) STYLE:ApplyCloseButtonStyle(ReforgingFrameCloseButton) -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/spellbook.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/spellbook.lua index 90ad3bc..2812bd9 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/spellbook.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/spellbook.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain --[[ ########################################################## @@ -21,8 +21,8 @@ FRAME LISTS ########################################################## ]]-- local bookFrames = { - "SpellBookFrame", - "SpellBookFrameInset", + "SpellBookFrame", + "SpellBookFrameInset", "SpellBookSpellIconsFrame", "SpellBookSideTabsFrame", "SpellBookPageNavigationFrame" @@ -64,8 +64,8 @@ HELPERS ########################################################## ]]-- local function Tab_OnEnter(this) - this.backdrop:SetBackdropColor(unpack(SuperVillain.Media.color.highlight)) - this.backdrop:SetBackdropBorderColor(unpack(SuperVillain.Media.color.highlight)) + this.backdrop:SetBackdropColor(unpack(SV.Media.color.highlight)) + this.backdrop:SetBackdropBorderColor(unpack(SV.Media.color.highlight)) end local function Tab_OnLeave(this) @@ -74,7 +74,7 @@ local function Tab_OnLeave(this) end local function ChangeTabHelper(this) - this:Formula409() + this:RemoveTextures() local nTex = this:GetNormalTexture() if(nTex) then nTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) @@ -169,14 +169,14 @@ local function AbilityButtonHelper(j) i.styled = true end -local function ButtonUpdateHelper(k, M) +local function ButtonUpdateHelper(self, strip) for j=1, SPELLS_PER_PAGE do local i = _G["SpellButton"..j] local x = _G["SpellButton"..j.."IconTexture"] if not InCombatLockdown() then i:SetFrameLevel(SpellBookFrame:GetFrameLevel() + 5) end - if M then + if strip then for j = 1, i:GetNumRegions()do local N = select(j, i:GetRegions()) if N:GetObjectType() == "Texture"then @@ -212,19 +212,24 @@ SPELLBOOK STYLER ########################################################## ]]-- local function SpellBookStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.spellbook ~= true then return end + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.spellbook ~= true then return end - SpellBookFrame:SetPanelTemplate("Pattern") + STYLE:ApplyWindowStyle(SpellBookFrame) STYLE:ApplyCloseButtonStyle(SpellBookFrameCloseButton) for _, gName in pairs(bookFrames) do local frame = _G[gName] if(frame) then - frame:Formula409() + frame:RemoveTextures() end - end + end + + -- SpellBookFrameInset:ClearAllPoints() + -- SpellBookFrameInset:Point("TOPLEFT", SpellBookFrame, "TOPLEFT", 20, -46) + -- SpellBookFrameInset:Point("BOTTOMRIGHT", SpellBookFrame, "BOTTOMRIGHT", -20, 20) + SpellBookFrameInset:SetFixedPanelTemplate("Blackout") - _G["SpellBookFrameTutorialButton"]:MUNG() + _G["SpellBookFrameTutorialButton"]:Die() for i = 1, 2 do local frame = _G[("SpellBookPage%d"):format(i)] @@ -245,7 +250,7 @@ local function SpellBookStyle() local tabName = ("SpellBookSkillLineTab%d"):format(i) local tab = _G[tabName] local tabFlash = _G[("%sFlash"):format(tabName)] - if(tabFlash) then tabFlash:MUNG() end + if(tabFlash) then tabFlash:Die() end if(tab) then ChangeTabHelper(tab) end end @@ -263,7 +268,7 @@ local function SpellBookStyle() local button = _G[gName] local buttonTex = _G[("%sIconTexture"):format(gName)] if(button) then - button:Formula409() + button:RemoveTextures() if(buttonTex) then buttonTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) buttonTex:FillInner() @@ -279,8 +284,9 @@ local function SpellBookStyle() for _, gName in pairs(proBars) do local bar = _G[gName] if(bar) then - bar:Formula409() - bar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) + bar:RemoveTextures() + bar:SetHeight(12) + bar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) bar:SetStatusBarColor(0, 220/255, 0) bar:SetPanelTemplate("Default") bar.rankText:ClearAllPoints() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/store.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/store.lua new file mode 100644 index 0000000..dade5fe --- /dev/null +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/store.lua @@ -0,0 +1,36 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +--]] +local SV, L = unpack(SVUI); +local STYLE = _G.StyleVillain; +--[[ +########################################################## +TAXIFRAME STYLER +########################################################## +]]-- +local function StoreStyle() + -- if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.store ~= true then + -- return + -- end + + --STYLE:ApplyWindowStyle(StoreFrame) + STYLE:ApplyTooltipStyle(StoreTooltip) +end +--[[ +########################################################## +STYLE LOADING +########################################################## +]]-- +STYLE:SaveBlizzardStyle("Blizzard_StoreUI", StoreStyle) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/supervillain.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/supervillain.lua index 2403635..95cf1db 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/supervillain.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/supervillain.lua @@ -13,13 +13,15 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## HELPERS ########################################################## ]]-- +local externaltest = false; + local ProxyLSMType = { ["LSM30_Font"] = true, ["LSM30_Sound"] = true, @@ -38,7 +40,7 @@ local ProxyType = { } local function Widget_OnEnter(b) - b:SetBackdropBorderColor(unpack(SuperVillain.Media.color.highlight)) + b:SetBackdropBorderColor(unpack(SV.Media.color.highlight)) end local function Widget_OnLeave(b) @@ -49,24 +51,25 @@ local function Widget_ScrollStyle(frame, arg) return STYLE:ApplyScrollFrameStyle(frame) end -local function Widget_ButtonStyle(frame, strip, j) +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(0,0,0,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(0,0,0,0) end - if strip then frame:Formula409() end - if not frame.template and not j then frame:SetFixedPanelTemplate("Button")end - frame:HookScript("OnEnter", Widget_OnEnter)frame:HookScript("OnLeave", Widget_OnLeave) + if frame.SetDisabledTexture then frame:SetDisabledTexture("") end + if strip then frame:RemoveTextures() 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(...) end -local NOOP = SuperVillain.fubar +local NOOP = SV.fubar local WidgetButton_OnClick = function(self) local obj = self.obj; @@ -102,7 +105,7 @@ local function StyleAceGUI(event, addon) if(widgetType == "MultiLineEditBox") then local widgetFrame = widget.frame; - widgetFrame:SetFixedPanelTemplate("Pattern") + widgetFrame:SetFixedPanelTemplate("Default") if not widget.scrollBG.Panel then widget.scrollBG:SetBasicPanel() end @@ -114,8 +117,8 @@ local function StyleAceGUI(event, addon) widget.scrollFrame:SetPoint("BOTTOMRIGHT", widget.scrollBG, "BOTTOMRIGHT", -4, 8) elseif(widgetType == "CheckBox") then - widget.checkbg:MUNG() - widget.highlight:MUNG() + widget.checkbg:Die() + widget.highlight:Die() if not widget.styledCheckBG then widget.styledCheckBG = CreateFrame("Frame", nil, widget.frame) widget.styledCheckBG:FillInner(widget.check) @@ -127,7 +130,7 @@ local function StyleAceGUI(event, addon) local widgetDropdown = widget.dropdown; local widgetButton = widget.button; - widgetDropdown:Formula409() + widgetDropdown:RemoveTextures() widgetButton:ClearAllPoints() widgetButton:Point("RIGHT", widgetDropdown, "RIGHT", -20, 0) widgetButton:SetFrameLevel(widgetButton:GetFrameLevel() + 1) @@ -148,19 +151,19 @@ local function StyleAceGUI(event, addon) local boxName = widgetEditbox:GetName() if(_G[boxName.."Left"]) then - _G[boxName.."Left"]:MUNG() + _G[boxName.."Left"]:Die() end if(_G[boxName.."Middle"]) then - _G[boxName.."Middle"]:MUNG() + _G[boxName.."Middle"]:Die() end if(_G[boxName.."Right"]) then - _G[boxName.."Right"]:MUNG() + _G[boxName.."Right"]:Die() end widgetEditbox:Height(17) - widgetEditbox:SetBasicPanel() + --widgetEditbox:SetFixedPanelTemplate("Default") Widget_ButtonStyle(widget.button) elseif(widgetType == "Button") then @@ -168,7 +171,7 @@ local function StyleAceGUI(event, addon) Widget_ButtonStyle(widgetFrame, nil, true) if(not widgetFrame.Panel) then - widgetFrame:Formula409() + widgetFrame:RemoveTextures() widgetFrame:SetFixedPanelTemplate("Button", true) end widget.text:SetParent(widgetFrame.Panel) @@ -178,8 +181,8 @@ local function StyleAceGUI(event, addon) local widgetEditbox = widget.editbox; if(not widgetSlider.Panel) then - widgetSlider:Formula409() - widgetSlider:SetBasicPanel() + widgetSlider:RemoveTextures() + widgetSlider:SetFixedPanelTemplate("Bar") end widgetSlider:Height(20) @@ -189,9 +192,9 @@ local function StyleAceGUI(event, addon) widgetEditbox:Height(15) widgetEditbox:SetPoint("TOP", widgetSlider, "BOTTOM", 0, -1) - if(not widgetEditbox.Panel) then - widgetEditbox:SetBasicPanel() - end + -- 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) @@ -200,7 +203,7 @@ local function StyleAceGUI(event, addon) local widgetFrame = widget.frame; local dropButton = widgetFrame.dropButton; - widgetFrame:Formula409() + widgetFrame:RemoveTextures() Widget_PaginationStyle(dropButton, true) widgetFrame.text:ClearAllPoints() widgetFrame.text:Point("RIGHT", dropButton, "LEFT", -2, 0) @@ -231,8 +234,6 @@ local function StyleAceGUI(event, addon) return regWidget(self, widget) end - local externaltest = false; - AceGUI.RegisterAsContainer = function(self, widget) local widgetType = widget.type; local widgetParent = widget.content:GetParent() @@ -242,13 +243,13 @@ local function StyleAceGUI(event, addon) widgetParent:SetPanelTemplate("Halftone") elseif(ProxyType[widgetType]) then if widgetType == "Frame" then - widgetParent:Formula409() - for z = 1, widgetParent:GetNumChildren()do - local A = select(z, widgetParent:GetChildren()) - if A:GetObjectType() == "Button"and A:GetText() then - Widget_ButtonStyle(A) + widgetParent:RemoveTextures() + 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:RemoveTextures() end end end @@ -259,7 +260,7 @@ local function StyleAceGUI(event, addon) local oldFunc = widget.CreateButton; widget.CreateButton = function(self) local newButton = oldFunc(self) - newButton.toggle:Formula409() + newButton.toggle:RemoveTextures() newButton.toggle.SetNormalTexture = NOOP; newButton.toggle.SetPushedTexture = NOOP; newButton.toggle:SetButtonTemplate() @@ -283,7 +284,7 @@ local function StyleAceGUI(event, addon) local oldFunc = widget.CreateTab; widget.CreateTab = function(self, arg) local newTab = oldFunc(self, arg) - newTab:Formula409() + newTab:RemoveTextures() return newTab end end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/system.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/system.lua index 1750f9f..051dc32 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/system.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/system.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; local ceil = math.ceil --[[ @@ -40,8 +40,6 @@ local SystemFrameList1 = { "ReadyCheckFrame", "StackSplitFrame", "QueueStatusFrame", -}; -local SystemFrameList2 = { "InterfaceOptionsFrame", "VideoOptionsFrame", "AudioOptionsFrame", @@ -290,6 +288,7 @@ local SystemFrameList17 = { "AudioOptionsSoundPanelPetBattleMusic", "NetworkOptionsPanelOptimizeSpeed", "NetworkOptionsPanelUseIPv6", + "NetworkOptionsPanelAdvancedCombatLogging" }; local SystemFrameList18 = { "Graphics_DisplayModeDropDown", @@ -393,12 +392,14 @@ SYSTEM WIDGET STYLERS ########################################################## ]]-- local function SystemPanelQue() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.misc ~= true then return end - QueueStatusFrame:Formula409() + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.misc ~= true then return end + + QueueStatusFrame:RemoveTextures() + for i = 1, #SystemPopList do local this = _G[SystemPopList[i]] if(this) then - this:Formula409() + this:RemoveTextures() STYLE:ApplyAlertStyle(this) this:SetBackdropColor(0.8, 0.2, 0.2) end @@ -406,26 +407,18 @@ local function SystemPanelQue() for i = 1, #SystemDropDownList do local this = _G[SystemDropDownList[i]] if(this) then - this:Formula409() + this:RemoveTextures() this:SetPanelTemplate("FramedTop") end end for i = 1, #SystemFrameList1 do local this = _G[SystemFrameList1[i]] if(this) then - this:Formula409() - this:SetPanelTemplate("Pattern") - end - end - for i = 1, #SystemFrameList2 do - local this = _G[SystemFrameList2[i]] - if(this) then - this:Formula409() - this:SetPanelTemplate("Halftone") + STYLE:ApplyWindowStyle(this) end end - LFDRoleCheckPopup:Formula409() + LFDRoleCheckPopup:RemoveTextures() LFDRoleCheckPopup:SetFixedPanelTemplate() LFDRoleCheckPopupAcceptButton:SetButtonTemplate() LFDRoleCheckPopupDeclineButton:SetButtonTemplate() @@ -444,8 +437,8 @@ local function SystemPanelQue() _G["StaticPopup"..i.."MoneyInputFrameCopper"]:SetEditboxTemplate() _G["StaticPopup"..i.."EditBox"].Panel:Point("TOPLEFT", -2, -4) _G["StaticPopup"..i.."EditBox"].Panel:Point("BOTTOMRIGHT", 2, 4) - _G["StaticPopup"..i.."ItemFrameNameFrame"]:MUNG() - _G["StaticPopup"..i.."ItemFrame"]:GetNormalTexture():MUNG() + _G["StaticPopup"..i.."ItemFrameNameFrame"]:Die() + _G["StaticPopup"..i.."ItemFrame"]:GetNormalTexture():Die() _G["StaticPopup"..i.."ItemFrame"]:SetFixedPanelTemplate("Default") _G["StaticPopup"..i.."ItemFrame"]:SetButtonTemplate() _G["StaticPopup"..i.."ItemFrameIconTexture"]:SetTexCoord(0.1,0.9,0.1,0.9 ) @@ -468,7 +461,7 @@ local function SystemPanelQue() hooksecurefunc(GhostFrame, "SetBackdropColor", forceBackdropColor) hooksecurefunc(GhostFrame, "SetBackdropBorderColor", forceBackdropColor) GhostFrame:ClearAllPoints() - GhostFrame:SetPoint("TOP", SuperVillain.UIParent, "TOP", 0, -150) + GhostFrame:SetPoint("TOP", SV.UIParent, "TOP", 0, -150) GhostFrameContentsFrame:SetButtonTemplate() GhostFrameContentsFrameIcon:SetTexture(0,0,0,0) local x = CreateFrame("Frame", nil, GhostFrame) @@ -562,34 +555,36 @@ local function SystemPanelQue() MacOptionsFrameDefaults:SetWidth(96) MacOptionsFrameDefaults:SetHeight(22) end - OpacityFrame:Formula409() + OpacityFrame:RemoveTextures() OpacityFrame:SetFixedPanelTemplate("Transparent", true) hooksecurefunc("UIDropDownMenu_InitializeHelper", function(self) for i = 1, UIDROPDOWNMENU_MAXLEVELS do local name = ("DropDownList%d"):format(i) local bg = _G[("%sBackdrop"):format(name)] - STYLE:ApplyBasicBG(bg) + bg:SetBasicPanel() local menu = _G[("%sMenuBackdrop"):format(name)] - STYLE:ApplyBasicBG(menu) + menu:SetBasicPanel() end end) - GuildInviteFrame:Formula409() - GuildInviteFrame:SetFixedPanelTemplate('Transparent') - GuildInviteFrame.Points:Formula409() - GuildInviteFrame.Points:ClearAllPoints() - GuildInviteFrame.Points:SetPoint('TOP', GuildInviteFrame, 'CENTER', -15, -25) - GuildInviteFrameJoinButton:SetButtonTemplate() - GuildInviteFrameDeclineButton:SetButtonTemplate() - GuildInviteFrame:Height(225) - GuildInviteFrame:HookScript("OnEvent", function() + if(SV.___interface < 60000) then + GuildInviteFrame:RemoveTextures() + GuildInviteFrame:SetFixedPanelTemplate('Transparent') + GuildInviteFrameLevel:RemoveTextures() + GuildInviteFrameLevel:ClearAllPoints() + GuildInviteFrameLevel:SetPoint('TOP', GuildInviteFrame, 'CENTER', -15, -25) + GuildInviteFrameJoinButton:SetButtonTemplate() + GuildInviteFrameDeclineButton:SetButtonTemplate() GuildInviteFrame:Height(225) - end) + GuildInviteFrame:HookScript("OnEvent", function() + GuildInviteFrame:Height(225) + end) - GuildInviteFrameWarningText:MUNG() - BattleTagInviteFrame:Formula409() - BattleTagInviteFrame:SetFixedPanelTemplate('Transparent') + GuildInviteFrameWarningText:Die() + BattleTagInviteFrame:RemoveTextures() + BattleTagInviteFrame:SetFixedPanelTemplate('Transparent') + end --BattleTagInviteFrameScrollFrame:SetEditboxTemplate() for i=1, BattleTagInviteFrame:GetNumChildren() do @@ -602,7 +597,7 @@ local function SystemPanelQue() for i = 1, #SystemFrameList13 do local frame = _G[SystemFrameList13[i]] if(frame) then - frame:Formula409() + frame:RemoveTextures() frame:SetBasicPanel() end end @@ -610,7 +605,7 @@ local function SystemPanelQue() for i = 1, #SystemFrameList14 do local this = _G[SystemFrameList14[i]] if(this) then - this:Formula409() + this:RemoveTextures() STYLE:ApplyTabStyle(this) end end @@ -658,30 +653,34 @@ local function SystemPanelQue() AudioOptionsVoicePanelChatMode1KeyBindingButton:Point("CENTER", AudioOptionsVoicePanelBinding, "CENTER", 0, -10) CompactUnitFrameProfilesRaidStylePartyFrames:SetCheckboxTemplate(true) CompactUnitFrameProfilesGeneralOptionsFrameResetPositionButton:SetButtonTemplate() + for i = 1, #SystemFrameList20 do local this = _G["CompactUnitFrameProfilesGeneralOptionsFrame"..SystemFrameList20[i]] if(this) then this:SetCheckboxTemplate(true) this:SetFrameLevel(40) end - end - Graphics_RightQuality:MUNG() + end + for i = 1, #SystemFrameList21 do local this = _G[SystemFrameList21[i]] if(this) then STYLE:ApplyScrollBarStyle(this) end end - MacOptionsFrame:Formula409() + Graphics_RightQuality:SetBackdrop(nil) + Graphics_RightQuality:Die() + + MacOptionsFrame:RemoveTextures() MacOptionsFrame:SetFixedPanelTemplate() MacOptionsButtonCompress:SetButtonTemplate() MacOptionsButtonKeybindings:SetButtonTemplate() MacOptionsFrameDefaults:SetButtonTemplate() MacOptionsFrameOkay:SetButtonTemplate() MacOptionsFrameCancel:SetButtonTemplate() - MacOptionsFrameMovieRecording:Formula409() - MacOptionsITunesRemote:Formula409() - MacOptionsFrameMisc:Formula409() + MacOptionsFrameMovieRecording:RemoveTextures() + MacOptionsITunesRemote:RemoveTextures() + MacOptionsFrameMisc:RemoveTextures() STYLE:ApplyDropdownStyle(MacOptionsFrameResolutionDropDown) STYLE:ApplyDropdownStyle(MacOptionsFrameFramerateDropDown) STYLE:ApplyDropdownStyle(MacOptionsFrameCodecDropDown) @@ -699,20 +698,20 @@ local function SystemPanelQue() MacOptionsFrameCancel:ClearAllPoints() MacOptionsFrameCancel:SetPoint("LEFT", MacOptionsFrameOkay, "RIGHT", 2, 0) MacOptionsFrameCancel:SetWidth(MacOptionsFrameCancel:GetWidth() - 6) - ReportCheatingDialog:Formula409() - ReportCheatingDialogCommentFrame:Formula409() + ReportCheatingDialog:RemoveTextures() + ReportCheatingDialogCommentFrame:RemoveTextures() ReportCheatingDialogReportButton:SetButtonTemplate() ReportCheatingDialogCancelButton:SetButtonTemplate() ReportCheatingDialog:SetFixedPanelTemplate("Transparent", true) ReportCheatingDialogCommentFrameEditBox:SetEditboxTemplate() - ReportPlayerNameDialog:Formula409() - ReportPlayerNameDialogCommentFrame:Formula409() + ReportPlayerNameDialog:RemoveTextures() + ReportPlayerNameDialogCommentFrame:RemoveTextures() ReportPlayerNameDialogCommentFrameEditBox:SetEditboxTemplate() ReportPlayerNameDialog:SetFixedPanelTemplate("Transparent", true) ReportPlayerNameDialogReportButton:SetButtonTemplate() ReportPlayerNameDialogCancelButton:SetButtonTemplate() STYLE:ApplyCloseButtonStyle(SideDressUpModelCloseButton) - SideDressUpFrame:Formula409() + SideDressUpFrame:RemoveTextures() SideDressUpFrame.BGTopLeft:Hide() SideDressUpFrame.BGBottomLeft:Hide() SideDressUpModelResetButton:SetButtonTemplate() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/tabard.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/tabard.lua index 6b9730d..38d0113 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/tabard.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/tabard.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -25,9 +25,9 @@ local function cleanT(a,b) local d=select(c,a:GetRegions()) if d and d:GetObjectType()=="Texture"then local n=d:GetName(); - if n=='TabardFrameEmblemTopRight' or n=='TabardFrameEmblemTopLeft' or n=='TabardFrameEmblemBottomRight' or n=='TabardFrameEmblemBottomLeft' then return end; + if n=='TabardFrameEmblemTopRight' or n=='TabardFrameEmblemTopLeft' or n=='TabardFrameEmblemBottomRight' or n=='TabardFrameEmblemBottomLeft' then return end if b and type(b)=='boolean'then - d:MUNG() + d:Die() elseif d:GetDrawLayer()==b then d:SetTexture(0,0,0,0) elseif b and type(b)=='string'and d:GetTexture()~=b then @@ -44,22 +44,22 @@ TABARDFRAME STYLER ########################################################## ]]-- local function TabardFrameStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.tabard ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.tabard ~= true then return - end; + end cleanT(TabardFrame, true) TabardFrame:SetPanelTemplate("Action", false) TabardModel:SetFixedPanelTemplate("Transparent") TabardFrameCancelButton:SetButtonTemplate() TabardFrameAcceptButton:SetButtonTemplate() STYLE:ApplyCloseButtonStyle(TabardFrameCloseButton) - TabardFrameCostFrame:Formula409() - TabardFrameCustomizationFrame:Formula409() - TabardFrameInset:MUNG() - TabardFrameMoneyInset:MUNG() - TabardFrameMoneyBg:Formula409() + TabardFrameCostFrame:RemoveTextures() + TabardFrameCustomizationFrame:RemoveTextures() + TabardFrameInset:Die() + TabardFrameMoneyInset:Die() + TabardFrameMoneyBg:RemoveTextures() for b = 1, 5 do - local c = "TabardFrameCustomization"..b;_G[c]:Formula409() + local c = "TabardFrameCustomization"..b;_G[c]:RemoveTextures() STYLE:ApplyPaginationStyle(_G[c.."LeftButton"]) STYLE:ApplyPaginationStyle(_G[c.."RightButton"]) if b>1 then @@ -69,7 +69,7 @@ local function TabardFrameStyle() local d, e, f, g, h = _G[c]:GetPoint() _G[c]:Point(d, e, f, g, h+4) end - end; + end TabardCharacterModelRotateLeftButton:Point("BOTTOMLEFT", 4, 4) TabardCharacterModelRotateRightButton:Point("TOPLEFT", TabardCharacterModelRotateLeftButton, "TOPRIGHT", 4, 0) hooksecurefunc(TabardCharacterModelRotateLeftButton, "SetPoint", function(i, d, j, k, l, m) @@ -82,7 +82,7 @@ local function TabardFrameStyle() i:Point("TOPLEFT", TabardCharacterModelRotateLeftButton, "TOPRIGHT", 4, 0) end end) -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/talents.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/talents.lua index 5f73355..2304091 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/talents.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/talents.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -30,7 +30,7 @@ local SpecButtonList = { local function Tab_OnEnter(this) this.backdrop:SetPanelColor("highlight") - this.backdrop:SetBackdropBorderColor(unpack(SuperVillain.Media.color.highlight)) + this.backdrop:SetBackdropBorderColor(unpack(SV.Media.color.highlight)) end local function Tab_OnLeave(this) @@ -39,7 +39,7 @@ local function Tab_OnLeave(this) end local function ChangeTabHelper(this) - this:Formula409() + this:RemoveTextures() local nTex = this:GetNormalTexture() if(nTex) then nTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) @@ -76,19 +76,19 @@ local function StyleGlyphHolder(holder, offset) local outer = holder:CreateTexture(nil, "OVERLAY") outer:WrapOuter(holder, offset, offset) outer:SetTexture(borderTex) - outer:SetGradient(unpack(SuperVillain.Media.gradient.class)) + outer:SetGradient(unpack(SV.Media.gradient.class)) local hover = holder:CreateTexture(nil, "HIGHLIGHT") hover:WrapOuter(holder, offset, offset) hover:SetTexture(borderTex) - hover:SetGradient(unpack(SuperVillain.Media.gradient.yellow)) + hover:SetGradient(unpack(SV.Media.gradient.yellow)) holder.hover = hover if holder.SetDisabledTexture then local disabled = holder:CreateTexture(nil, "BORDER") disabled:WrapOuter(holder, offset, offset) disabled:SetTexture(borderTex) - disabled:SetGradient(unpack(SuperVillain.Media.gradient.default)) + disabled:SetGradient(unpack(SV.Media.gradient.default)) holder:SetDisabledTexture(disabled) end @@ -105,43 +105,32 @@ TALENTFRAME STYLER ########################################################## ]]-- local function TalentFrameStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.talent ~= true then return end + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.talent ~= true then return end - PlayerTalentFrame:Formula409() - PlayerTalentFrameInset:Formula409() - PlayerTalentFrameTalents:Formula409() + STYLE:ApplyWindowStyle(PlayerTalentFrame) - 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:SetPanelTemplate("Halftone") + PlayerTalentFrameInset:RemoveTextures() + PlayerTalentFrameTalents:RemoveTextures() + PlayerTalentFrameTalentsClearInfoFrame:RemoveTextures() PlayerTalentFrame.Panel:Point("BOTTOMRIGHT", PlayerTalentFrame, "BOTTOMRIGHT", 0, -5) - PlayerTalentFrameSpecializationTutorialButton:MUNG() - PlayerTalentFrameTalentsTutorialButton:MUNG() - PlayerTalentFramePetSpecializationTutorialButton:MUNG() + PlayerTalentFrameSpecializationTutorialButton:Die() + PlayerTalentFrameTalentsTutorialButton:Die() + PlayerTalentFramePetSpecializationTutorialButton:Die() STYLE:ApplyCloseButtonStyle(PlayerTalentFrameCloseButton) PlayerTalentFrameActivateButton:SetButtonTemplate() for _,name in pairs(SpecButtonList)do local button = _G[name]; if(button) then - button:Formula409() + button:RemoveTextures() button:SetButtonTemplate() local initialAnchor, anchorParent, relativeAnchor, xPosition, yPosition = button:GetPoint() button:SetPoint(initialAnchor, anchorParent, relativeAnchor, xPosition, -28) end end - PlayerTalentFrameTalents:SetFixedPanelTemplate('Transparent') - PlayerTalentFrameTalentsClearInfoFrame:SetFixedPanelTemplate('Transparent') + PlayerTalentFrameTalents:SetFixedPanelTemplate("Inset") PlayerTalentFrameTalentsClearInfoFrame.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) PlayerTalentFrameTalentsClearInfoFrame:Width(PlayerTalentFrameTalentsClearInfoFrame:GetWidth()-2) PlayerTalentFrameTalentsClearInfoFrame:Height(PlayerTalentFrameTalentsClearInfoFrame:GetHeight()-2) @@ -168,7 +157,7 @@ local function TalentFrameStyle() for i = 1, 2 do local v = _G["PlayerSpecTab"..i] - _G["PlayerSpecTab"..i.."Background"]:MUNG() + _G["PlayerSpecTab"..i.."Background"]:Die() ChangeTabHelper(v) end @@ -177,49 +166,43 @@ local function TalentFrameStyle() PlayerSpecTab1:Point(d, x, f, -1, h) end) - 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"..i.."Talent"..z] - local B = _G["PlayerTalentFrameTalentsTalentRow"..i.."Talent"..z.."IconTexture"] - if(A and B) then - A:Formula409() - A:SetFrameLevel(A:GetFrameLevel()+5) - 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) - A.bg:SetFrameLevel(A:GetFrameLevel()-2) - 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:Point("TOPLEFT", A, "TOPLEFT", 15, -1) - A.bg.SelectedTexture:Point("BOTTOMRIGHT", A, "BOTTOMRIGHT", -10, 1) + for i = 1, MAX_NUM_TALENT_TIERS do + local gName = ("PlayerTalentFrameTalentsTalentRow%d"):format(i) + local rowFrame = _G[gName] + if(rowFrame) then + local bgFrame = _G[("%sBg"):format(gName)] + if(bgFrame) then bgFrame:Hide() end + + rowFrame:DisableDrawLayer("BORDER") + rowFrame:RemoveTextures() + rowFrame.TopLine:Point("TOP", 0, 4) + rowFrame.BottomLine:Point("BOTTOM", 0, -4) + + for z = 1, NUM_TALENT_COLUMNS do + local talentItem = _G[("%sTalent%d"):format(gName, z)] + if(talentItem) then + STYLE:ApplyItemButtonStyle(talentItem, false, true) + end end - end + end end hooksecurefunc("TalentFrame_Update", function() - for b = 1, MAX_NUM_TALENT_TIERS do - for z = 1, NUM_TALENT_COLUMNS do - local A = _G["PlayerTalentFrameTalentsTalentRow"..b.."Talent"..z] - if A.knownSelection:IsShown() then - A.bg.SelectedTexture:Show() - A.bg.SelectedTexture:SetTexture(0, 1, 0, 0.1) - else - A.bg.SelectedTexture:Hide() - end - if A.learnSelection:IsShown() then - A.bg.SelectedTexture:Show() - A.bg.SelectedTexture:SetTexture(1, 1, 0, 0.1) - end + for i = 1, MAX_NUM_TALENT_TIERS do + local gName = ("PlayerTalentFrameTalentsTalentRow%d"):format(i) + + for z = 1, NUM_TALENT_COLUMNS do + local talentItem = _G[("%sTalent%d"):format(gName, z)] + if(talentItem) then + if talentItem.knownSelection:IsShown() then + talentItem:SetBackdropBorderColor(0, 1, 0) + else + talentItem:SetBackdropBorderColor(0, 0, 0) + end + if talentItem.learnSelection:IsShown() then + talentItem:SetBackdropBorderColor(1, 1, 0) + end + end end end end) @@ -278,36 +261,41 @@ local function TalentFrameStyle() end) for b = 1, GetNumSpecializations(false, nil)do - local A = PlayerTalentFrameSpecialization["specButton"..b] - local p, p, p, icon = GetSpecializationInfo(b, false, nil) - A.ring:Hide() - A.specIcon:SetTexture(icon) - A.specIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - A.specIcon:SetSize(50, 50) - A.specIcon:Point("LEFT", A, "LEFT", 15, 0) - A.SelectedTexture = A:CreateTexture(nil, 'ARTWORK') - A.SelectedTexture:SetTexture(1, 1, 0, 0.1) + local button = PlayerTalentFrameSpecialization["specButton"..b] + if(button) then + local _, _, _, icon = GetSpecializationInfo(b, false, nil) + button.ring:Hide() + button.specIcon:SetTexture(icon) + button.specIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9) + button.specIcon:SetSize(50, 50) + button.specIcon:Point("LEFT", button, "LEFT", 15, 0) + button.SelectedTexture = button:CreateTexture(nil, 'ARTWORK') + button.SelectedTexture:SetTexture(1, 1, 0, 0.1) + end end local btnList = { "PlayerTalentFrameSpecializationSpecButton", "PlayerTalentFramePetSpecializationSpecButton" } - for p, M in pairs(btnList)do + for _, gName in pairs(btnList)do for b = 1, 4 do - local A = _G[M..b]_G["PlayerTalentFrameSpecializationSpecButton"..b.."Glow"]:MUNG() - local N = A:CreateTexture(nil, 'ARTWORK') - N:SetTexture(1, 1, 1, 0.1) - A:SetHighlightTexture(N) - A.bg:SetAlpha(0) - A.learnedTex:SetAlpha(0) - A.selectedTex:SetAlpha(0) - A:SetFixedPanelTemplate("Button") - A:GetHighlightTexture():FillInner(A.Panel) + local button = _G[gName..b] + if(button) then + if(_G[gName..b.."Glow"]) then _G[gName..b.."Glow"]:Die() end + local bTex = button:CreateTexture(nil, 'ARTWORK') + bTex:SetTexture(1, 1, 1, 0.1) + button:SetHighlightTexture(bTex) + button.bg:SetAlpha(0) + button.learnedTex:SetAlpha(0) + button.selectedTex:SetAlpha(0) + button:SetFixedPanelTemplate("Button") + button:GetHighlightTexture():FillInner(button.Panel) + end end end - if SuperVillain.class == "HUNTER" then + if SV.class == "HUNTER" then for b = 1, 6 do select(b, PlayerTalentFramePetSpecialization:GetRegions()):Hide() end @@ -353,12 +341,12 @@ STYLE LOADING STYLE:SaveBlizzardStyle("Blizzard_TalentUI", TalentFrameStyle) local function GlyphStyle() - GlyphFrame:Formula409() - GlyphFrame.background:ClearAllPoints() - GlyphFrame.background:SetAllPoints(PlayerTalentFrameInset) + GlyphFrame:RemoveTextures() + --GlyphFrame.background:ClearAllPoints() + --GlyphFrame.background:SetAllPoints(PlayerTalentFrameInset) GlyphFrame:SetFixedPanelTemplate("Comic", false, 0, 3, 3) - GlyphFrameSideInset:Formula409() - GlyphFrameClearInfoFrame:SetFixedPanelTemplate("Comic") + GlyphFrameSideInset:RemoveTextures() + GlyphFrameClearInfoFrame:RemoveTextures() GlyphFrameClearInfoFrame.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9 ) GlyphFrameClearInfoFrame:Width(GlyphFrameClearInfoFrame:GetWidth()-2) GlyphFrameClearInfoFrame:Height(GlyphFrameClearInfoFrame:GetHeight()-2) @@ -371,7 +359,7 @@ local function GlyphStyle() for b = 1, 10 do local e = _G["GlyphFrameScrollFrameButton"..b] local icon = _G["GlyphFrameScrollFrameButton"..b.."Icon"] - e:Formula409() + e:RemoveTextures() STYLE:ApplyItemButtonStyle(e) icon:SetTexCoord(0.1, 0.9, 0.1, 0.9 ) end @@ -379,7 +367,7 @@ local function GlyphStyle() for b = 1, 6 do local glyphHolder = _G["GlyphFrameGlyph"..b] if glyphHolder then - glyphHolder:Formula409() + glyphHolder:RemoveTextures() if(b % 2 == 0) then StyleGlyphHolder(glyphHolder, 4) else @@ -388,8 +376,8 @@ local function GlyphStyle() end end - GlyphFrameHeader1:Formula409() - GlyphFrameHeader2:Formula409() + GlyphFrameHeader1:RemoveTextures() + GlyphFrameHeader2:RemoveTextures() GlyphFrameScrollFrame:SetPanelTemplate("Inset", false, 3, 2, 2) end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/taxi.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/taxi.lua index 5a5c6ed..4f272b4 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/taxi.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/taxi.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -21,17 +21,17 @@ TAXIFRAME STYLER ########################################################## ]]-- local function TaxiStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.taxi ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.taxi ~= true then return - end; - TaxiFrame:Formula409() - TaxiFrame:SetPanelTemplate("Default") + end - TaxiRouteMap:SetBasicPanel() - TaxiRouteMap.Panel:WrapOuter(TaxiRouteMap, 4, 4) + STYLE:ApplyWindowStyle(TaxiFrame) + + TaxiRouteMap:SetPanelTemplate("Blackout") + --TaxiRouteMap.Panel:WrapOuter(TaxiRouteMap, 4, 4) STYLE:ApplyCloseButtonStyle(TaxiFrame.CloseButton) -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/ACP.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/ACP.lua index a225e8b..78860fe 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/ACP.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/ACP.lua @@ -26,7 +26,7 @@ local pairs = _G.pairs; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -55,7 +55,7 @@ local function cbResize(self,elapsed) d:SetWidth(20) d:SetHeight(20) end - end; + end if f:IsShown()then d:SetPoint("LEFT",5,0) d:SetWidth(26) @@ -70,15 +70,15 @@ local function StyleACP() STYLE:ApplyFrameStyle(ACP_AddonList) STYLE:ApplyFrameStyle(ACP_AddonList_ScrollFrame) local h={"ACP_AddonListSetButton","ACP_AddonListDisableAll","ACP_AddonListEnableAll","ACP_AddonList_ReloadUI","ACP_AddonListBottomClose"} - for i,j in pairs(h)do _G[j]:SetButtonTemplate()end; - for c=1,20 do _G["ACP_AddonListEntry"..c.."LoadNow"]:SetButtonTemplate()end; + for i,j in pairs(h)do _G[j]:SetButtonTemplate()end + for c=1,20 do _G["ACP_AddonListEntry"..c.."LoadNow"]:SetButtonTemplate()end STYLE:ApplyCloseButtonStyle(ACP_AddonListCloseButton) for c=1,20,1 do local k=_G["ACP_AddonList"] k.timeLapse = 0 k:SetScript("OnUpdate",cbResize) - end; - for c=1,20 do _G["ACP_AddonListEntry"..c.."Enabled"]:SetCheckboxTemplate(true)end; + end + for c=1,20 do _G["ACP_AddonListEntry"..c.."Enabled"]:SetCheckboxTemplate(true)end ACP_AddonList_NoRecurse:SetCheckboxTemplate(true) STYLE:ApplyScrollFrameStyle(ACP_AddonList_ScrollFrameScrollBar) STYLE:ApplyDropdownStyle(ACP_AddonListSortDropDown) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AdiBags.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AdiBags.lua index 500109e..c8caaf7 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AdiBags.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AdiBags.lua @@ -29,7 +29,7 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -51,7 +51,7 @@ local function StyleAdiBags(event) end if event == 'PLAYER_ENTERING_WORLD' then - SuperVillain:ExecuteTimer(function() + SV.Timers:ExecuteTimer(function() if not AdiBagsContainer1 then ToggleBackpack() ToggleBackpack() end if AdiBagsContainer1 then SkinFrame(AdiBagsContainer1) @@ -60,7 +60,7 @@ local function StyleAdiBags(event) end end, 1) elseif event == 'BANKFRAME_OPENED' then - SuperVillain:ExecuteTimer(function() + SV.Timers:ExecuteTimer(function() if AdiBagsContainer2 then SkinFrame(AdiBagsContainer2) STYLE:SafeEventRemoval("AdiBags", event) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Altoholic.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Altoholic.lua index 17fa321..1a47b5a 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Altoholic.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Altoholic.lua @@ -29,7 +29,7 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -50,7 +50,7 @@ local function StyleAltoholic(event, addon) if event == "PLAYER_ENTERING_WORLD" then STYLE:ApplyTooltipStyle(AltoTooltip) - AltoholicFramePortrait:MUNG() + AltoholicFramePortrait:Die() STYLE:ApplyFrameStyle(AltoholicFrame, "Action", false, true) STYLE:ApplyFrameStyle(AltoMsgBox) @@ -80,19 +80,19 @@ local function StyleAltoholic(event, addon) STYLE:ApplyDropdownStyle(AltoholicTabSummary_SelectLocation, 200) if(AltoholicFrameSummaryScrollFrame) then - AltoholicFrameSummaryScrollFrame:Formula409(true) + AltoholicFrameSummaryScrollFrame:RemoveTextures(true) end if(AltoholicFrameBagUsageScrollFrame) then - AltoholicFrameBagUsageScrollFrame:Formula409(true) + AltoholicFrameBagUsageScrollFrame:RemoveTextures(true) end if(AltoholicFrameSkillsScrollFrame) then - AltoholicFrameSkillsScrollFrame:Formula409(true) + AltoholicFrameSkillsScrollFrame:RemoveTextures(true) end if(AltoholicFrameActivityScrollFrame) then - AltoholicFrameActivityScrollFrame:Formula409(true) + AltoholicFrameActivityScrollFrame:RemoveTextures(true) end STYLE:ApplyButtonStyle(AltoholicTabSummary_RequestSharing) @@ -136,9 +136,9 @@ local function StyleAltoholic(event, addon) STYLE:ApplyButtonStyle(AltoholicTabCharacters_Sort1) STYLE:ApplyButtonStyle(AltoholicTabCharacters_Sort2) STYLE:ApplyButtonStyle(AltoholicTabCharacters_Sort3) - AltoholicFrameContainersScrollFrame:Formula409(true) - AltoholicFrameQuestsScrollFrame:Formula409(true) - AltoholicFrameRecipesScrollFrame:Formula409(true) + AltoholicFrameContainersScrollFrame:RemoveTextures(true) + AltoholicFrameQuestsScrollFrame:RemoveTextures(true) + AltoholicFrameRecipesScrollFrame:RemoveTextures(true) local Buttons = { 'AltoholicTabCharacters_Characters', @@ -167,8 +167,8 @@ local function StyleAltoholic(event, addon) if IsAddOnLoaded("Altoholic_Achievements") or addon == "Altoholic_Achievements" then STYLE:ApplyUnderlayStyle(AltoholicFrameAchievements) - AltoholicFrameAchievementsScrollFrame:Formula409(true) - AltoholicAchievementsMenuScrollFrame:Formula409(true) + AltoholicFrameAchievementsScrollFrame:RemoveTextures(true) + AltoholicAchievementsMenuScrollFrame:RemoveTextures(true) STYLE:ApplyScrollBarStyle(AltoholicFrameAchievementsScrollFrameScrollBar) STYLE:ApplyScrollBarStyle(AltoholicAchievementsMenuScrollFrameScrollBar) STYLE:ApplyDropdownStyle(AltoholicTabAchievements_SelectRealm) @@ -202,7 +202,7 @@ local function StyleAltoholic(event, addon) end if IsAddOnLoaded("Altoholic_Grids") or addon == "Altoholic_Grids" then - AltoholicFrameGridsScrollFrame:Formula409(true) + AltoholicFrameGridsScrollFrame:RemoveTextures(true) STYLE:ApplyUnderlayStyle(AltoholicFrameGrids) STYLE:ApplyScrollBarStyle(AltoholicFrameGridsScrollFrameScrollBar) STYLE:ApplyDropdownStyle(AltoholicTabGrids_SelectRealm) @@ -231,7 +231,7 @@ local function StyleAltoholic(event, addon) STYLE:ApplyFrameStyle(AltoholicFrameGuildMembers) STYLE:ApplyFrameStyle(AltoholicFrameGuildBank) STYLE:ApplyScrollBarStyle(AltoholicFrameGuildMembersScrollFrameScrollBar) - AltoholicFrameGuildMembersScrollFrame:Formula409(true) + AltoholicFrameGuildMembersScrollFrame:RemoveTextures(true) for i = 1, 2 do STYLE:ApplyButtonStyle(_G["AltoholicTabGuildMenuItem"..i]) @@ -254,8 +254,8 @@ local function StyleAltoholic(event, addon) if IsAddOnLoaded("Altoholic_Search") or addon == "Altoholic_Search" then STYLE:ApplyUnderlayStyle(AltoholicFrameSearch, true) - AltoholicFrameSearchScrollFrame:Formula409(true) - AltoholicSearchMenuScrollFrame:Formula409(true) + AltoholicFrameSearchScrollFrame:RemoveTextures(true) + AltoholicSearchMenuScrollFrame:RemoveTextures(true) STYLE:ApplyScrollBarStyle(AltoholicFrameSearchScrollFrameScrollBar) STYLE:ApplyScrollBarStyle(AltoholicSearchMenuScrollFrameScrollBar) STYLE:ApplyDropdownStyle(AltoholicTabSearch_SelectRarity) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AtlasLoot.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AtlasLoot.lua index cd01913..21be45e 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AtlasLoot.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AtlasLoot.lua @@ -26,7 +26,7 @@ local pairs = _G.pairs; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -78,7 +78,7 @@ local function AL_OnShow(self, event, ...) AtlasLootDefaultFrame_CloseButton:SetPoint("TOPRIGHT", AtlasLootDefaultFrame, "TOPRIGHT", -5 -2) AtlasLootDefaultFrame:SetFrameLevel(0) AtlasLootItemsFrame:SetFrameLevel(AtlasLootDefaultFrame:GetFrameLevel()+1) - for i = 1, 30 do if _G["AtlasLootDefaultFrame_ScrollLine"..i] then _G["AtlasLootDefaultFrame_ScrollLine"..i]:SetFrameLevel(AtlasLootDefaultFrame:GetFrameLevel()+1)end end; + for i = 1, 30 do if _G["AtlasLootDefaultFrame_ScrollLine"..i] then _G["AtlasLootDefaultFrame_ScrollLine"..i]:SetFrameLevel(AtlasLootDefaultFrame:GetFrameLevel()+1)end end if(AtlasLootDefaultFrame_PackageSelect) then AtlasLootDefaultFrame_PackageSelect:SetFrameLevel(AtlasLootDefaultFrame:GetFrameLevel()+1) @@ -97,20 +97,20 @@ local function Nine_IsThere(self, elapsed) else self.timeLapse = 0 end - for i = 1, 9 do local f = _G["AtlasLootCompareFrameSortButton_"..i]f:SetWidth(44.44)end; - for _, object in pairs(nineisthere) do STYLE:ApplyFrameStyle(_G[object]) end; + for i = 1, 9 do local f = _G["AtlasLootCompareFrameSortButton_"..i]f:SetWidth(44.44)end + for _, object in pairs(nineisthere) do STYLE:ApplyFrameStyle(_G[object]) end AtlasLootCompareFrameSortButton_7:Point("LEFT", AtlasLootCompareFrameSortButton_6, "RIGHT", 1, 0) AtlasLootCompareFrameSortButton_8:Point("LEFT", AtlasLootCompareFrameSortButton_7, "RIGHT", 1, 0) AtlasLootCompareFrameSortButton_9:Point("LEFT", AtlasLootCompareFrameSortButton_8, "RIGHT", 1, 0) end local function Compare_OnShow(self, event, ...) - for i = 1, 6 do _G["AtlasLootCompareFrameSortButton_"..i]:SetWidth(40)end; + for i = 1, 6 do _G["AtlasLootCompareFrameSortButton_"..i]:SetWidth(40)end local Nine = AtlasLootCompareFrameSortButton_9 if Nine ~= nil then Nine.timeLapse = 0 Nine:SetScript("OnUpdate", Nine_IsThere) - end; + end end local _hook_ALPanel = function(self,_,parent,_,_,_,breaker) @@ -134,9 +134,9 @@ end local function StyleAtlasLoot(event, addon) assert(AtlasLootPanel, "AddOn Not Loaded") - for _, object in pairs(StripAllTextures) do _G[object]:Formula409()end; - for _, object in pairs(SetTemplateDefault) do STYLE:ApplyFrameStyle(_G[object], "Default")end; - for _, button in pairs(buttons) do _G[button]:SetButtonTemplate()end; + for _, object in pairs(StripAllTextures) do _G[object]:RemoveTextures()end + for _, object in pairs(SetTemplateDefault) do STYLE:ApplyFrameStyle(_G[object], "Default")end + for _, button in pairs(buttons) do _G[button]:SetButtonTemplate()end -- Manipulate the main frames STYLE:ApplyFrameStyle(_G["AtlasLootDefaultFrame"], "Action"); @@ -160,7 +160,7 @@ local function StyleAtlasLoot(event, addon) if AtlasLoot_PanelButton_11 then AtlasLoot_PanelButton_11:SetButtonTemplate() end if AtlasLoot_PanelButton_12 then AtlasLoot_PanelButton_12:SetButtonTemplate() end - for i = 1, 15 do local f = _G["AtlasLootCompareFrameMainFilterButton"..i]f:Formula409() end; + for i = 1, 15 do local f = _G["AtlasLootCompareFrameMainFilterButton"..i]f:RemoveTextures() end STYLE:ApplyCloseButtonStyle(AtlasLootDefaultFrame_CloseButton) STYLE:ApplyCloseButtonStyle(AtlasLootCompareFrame_CloseButton) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AuctionLite.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AuctionLite.lua index 65b6df7..8d42a1c 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AuctionLite.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AuctionLite.lua @@ -29,7 +29,7 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/BigWigs.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/BigWigs.lua index e3e0fe1..80cee55 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/BigWigs.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/BigWigs.lua @@ -25,7 +25,7 @@ local select = _G.select; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain --[[ ########################################################## @@ -110,9 +110,9 @@ local function applystyle(bar) bar.candyBarBar:ClearAllPoints() bar.candyBarBar:SetAllPoints(bar) bar.candyBarBar.OldSetPoint = bar.candyBarBar.SetPoint - bar.candyBarBar.SetPoint = SuperVillain.fubar + bar.candyBarBar.SetPoint = SV.fubar bar.candyBarIconFrame.OldSetWidth = bar.candyBarIconFrame.SetWidth - bar.candyBarIconFrame.SetWidth = SuperVillain.fubar + bar.candyBarIconFrame.SetWidth = SV.fubar bar.candyBarIconFrame:ClearAllPoints() bar.candyBarIconFrame:Point("BOTTOMRIGHT", bar, "BOTTOMLEFT", -1, 0) bar.candyBarIconFrame:SetSize(20, 20) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Bugsack.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Bugsack.lua index 0132037..fff381f 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Bugsack.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Bugsack.lua @@ -29,7 +29,7 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -40,7 +40,7 @@ local function StyleBugSack(event, addon) assert(BugSack, "AddOn Not Loaded") hooksecurefunc(BugSack, "OpenSack", function() if BugSackFrame.Panel then return end - BugSackFrame:Formula409() + BugSackFrame:RemoveTextures() BugSackFrame:SetBasicPanel() STYLE:ApplyTabStyle(BugSackTabAll) BugSackTabAll:SetPoint("TOPLEFT", BugSackFrame, "BOTTOMLEFT", 0, 1) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Clique.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Clique.lua index 0fe5b66..bcd10d4 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Clique.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Clique.lua @@ -29,91 +29,122 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## CLIQUE ########################################################## ]]-- +local CliqueFrames = { + "CliqueDialog", + "CliqueConfig", + "CliqueConfigPage1", + "CliqueConfigPage2", + "CliqueClickGrabber", + "CliqueScrollFrame" +} + +local CliqueButtons = { + "CliqueConfigPage1ButtonSpell", + "CliqueConfigPage1ButtonOther", + "CliqueConfigPage1ButtonOptions", + "CliqueConfigPage2ButtonBinding", + "CliqueDialogButtonAccept", + "CliqueDialogButtonBinding", + "CliqueConfigPage2ButtonSave", + "CliqueConfigPage2ButtonCancel", + "CliqueSpellTab", +} + +local CliqueStripped = { + "CliqueConfigPage1Column1", + "CliqueConfigPage1Column2", + "CliqueConfigPage1_VSlider", + "CliqueSpellTab", + "CliqueConfigPage1ButtonSpell", + "CliqueConfigPage1ButtonOther", + "CliqueConfigPage1ButtonOptions", + "CliqueConfigPage2ButtonBinding", + "CliqueDialogButtonAccept", + "CliqueDialogButtonBinding", + "CliqueConfigPage2ButtonSave", + "CliqueConfigPage2ButtonCancel", +} + +local CliqueConfigPage1_OnShow = function(self) + for i = 1, 12 do + if _G["CliqueRow"..i] then + _G["CliqueRow"..i.."Icon"]:SetTexCoord(0.1,0.9,0.1,0.9); + _G["CliqueRow"..i.."Bind"]:ClearAllPoints() + if _G["CliqueRow"..i] == CliqueRow1 then + _G["CliqueRow"..i.."Bind"]:SetPoint("RIGHT", _G["CliqueRow"..i], 8,0) + else + _G["CliqueRow"..i.."Bind"]:SetPoint("RIGHT", _G["CliqueRow"..i], -9,0) + end + _G["CliqueRow"..i]:GetHighlightTexture():SetDesaturated(1) + end + end + CliqueRow1:ClearAllPoints() + CliqueRow1:SetPoint("TOPLEFT",5,-(CliqueConfigPage1Column1:GetHeight() +3)) +end + local function StyleClique() assert(CliqueDialog, "AddOn Not Loaded") - - local Frames = { - "CliqueDialog", - "CliqueConfig", - "CliqueConfigPage1", - "CliqueConfigPage2", - "CliqueClickGrabber", - } - for _, object in pairs(Frames) do - STYLE:ApplyFrameStyle(_G[object],"Transparent") - if _G[object] == CliqueConfig then - _G[object].Panel:SetPoint("TOPLEFT",0,0) - _G[object].Panel:SetPoint("BOTTOMRIGHT",0,-5) - elseif _G[object] == CliqueClickGrabber or _G[object] == CliqueScrollFrame then - _G[object].Panel:SetPoint("TOPLEFT",4,0) - _G[object].Panel:SetPoint("BOTTOMRIGHT",-2,4) - else - _G[object]:SetFrameLevel(_G[object]:GetFrameLevel()+1) - _G[object].Panel:SetPoint("TOPLEFT",0,0) - _G[object].Panel:SetPoint("BOTTOMRIGHT",2,0) + + for _, gName in pairs(CliqueFrames) do + local frame = _G[gName] + if(frame) then + STYLE:ApplyFrameStyle(frame, "Transparent") + if(gName == "CliqueConfig") then + frame.Panel:SetPoint("TOPLEFT",0,0) + frame.Panel:SetPoint("BOTTOMRIGHT",0,-5) + elseif(gName == "CliqueClickGrabber" or gName == "CliqueScrollFrame") then + frame.Panel:SetPoint("TOPLEFT",4,0) + frame.Panel:SetPoint("BOTTOMRIGHT",-2,4) + else + frame.Panel:SetPoint("TOPLEFT",0,0) + frame.Panel:SetPoint("BOTTOMRIGHT",2,0) + end end end - local CliqueButtons = { - "CliqueConfigPage1ButtonSpell", - "CliqueConfigPage1ButtonOther", - "CliqueConfigPage1ButtonOptions", - "CliqueConfigPage2ButtonBinding", - "CliqueDialogButtonAccept", - "CliqueDialogButtonBinding", - "CliqueConfigPage2ButtonSave", - "CliqueConfigPage2ButtonCancel", - } - for _, object in pairs(CliqueButtons) do - _G[object]:SetButtonTemplate() - end - STYLE:ApplyCloseButtonStyle(CliqueDialog.CloseButton) - local CliqueTabs = { - "CliqueConfigPage1Column1", - "CliqueConfigPage1Column2", - } - for _, object in pairs(CliqueTabs) do - _G[object]:Formula409(true) + + for _, gName in pairs(CliqueStripped) do + local frame = _G[gName] + if(frame) then + frame:RemoveTextures(true) + end end - CliqueConfigPage1:SetScript("OnShow", function(self) - for i = 1, 12 do - if _G["CliqueRow"..i] then - _G["CliqueRow"..i.."Icon"]:SetTexCoord(0.1,0.9,0.1,0.9); - _G["CliqueRow"..i.."Bind"]:ClearAllPoints() - if _G["CliqueRow"..i] == CliqueRow1 then - _G["CliqueRow"..i.."Bind"]:SetPoint("RIGHT", _G["CliqueRow"..i], 8,0) - else - _G["CliqueRow"..i.."Bind"]:SetPoint("RIGHT", _G["CliqueRow"..i], -9,0) - end - _G["CliqueRow"..i]:GetHighlightTexture():SetDesaturated(1) - end + + for _, gName in pairs(CliqueButtons) do + local button = _G[gName] + if(button) then + button:SetButtonTemplate() end - CliqueRow1:ClearAllPoints() - CliqueRow1:SetPoint("TOPLEFT",5,-(CliqueConfigPage1Column1:GetHeight() +3)) - end) - CliqueConfigPage1_VSlider:Formula409(true) + end + + STYLE:ApplyCloseButtonStyle(CliqueDialog.CloseButton) + + CliqueConfigPage1:SetScript("OnShow", CliqueConfigPage1_OnShow) + CliqueDialog:SetSize(CliqueDialog:GetWidth()-1, CliqueDialog:GetHeight()-1) + CliqueConfigPage1ButtonSpell:ClearAllPoints() - CliqueConfigPage1ButtonOptions:ClearAllPoints() CliqueConfigPage1ButtonSpell:SetPoint("TOPLEFT", CliqueConfigPage1,"BOTTOMLEFT",0,-4) + + CliqueConfigPage1ButtonOptions:ClearAllPoints() CliqueConfigPage1ButtonOptions:SetPoint("TOPRIGHT", CliqueConfigPage1,"BOTTOMRIGHT",2,-4) + CliqueConfigPage2ButtonSave:ClearAllPoints() - CliqueConfigPage2ButtonCancel:ClearAllPoints() CliqueConfigPage2ButtonSave:SetPoint("TOPLEFT", CliqueConfigPage2,"BOTTOMLEFT",0,-4) + + CliqueConfigPage2ButtonCancel:ClearAllPoints() CliqueConfigPage2ButtonCancel:SetPoint("TOPRIGHT", CliqueConfigPage2,"BOTTOMRIGHT",2,-4) + CliqueSpellTab:GetRegions():SetSize(.1,.1) CliqueSpellTab:GetNormalTexture():SetTexCoord(0.1,0.9,0.1,0.9) CliqueSpellTab:GetNormalTexture():ClearAllPoints() CliqueSpellTab:GetNormalTexture():FillInner() - STYLE:ApplyFrameStyle(CliqueSpellTab,"Transparent") - CliqueSpellTab.Panel:SetAllPoints() - CliqueSpellTab:SetButtonTemplate() end STYLE:SaveAddonStyle("Clique", StyleClique) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Cooline.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Cooline.lua index 8a1c7ff..6df4ee9 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Cooline.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Cooline.lua @@ -29,7 +29,7 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -44,7 +44,7 @@ local function StyleCoolLine() CoolLine.updatelook() STYLE:ApplyFrameStyle(CoolLine,"Transparent") CoolLine.Panel:SetAllPoints(CoolLine) - SuperVillain:AddToDisplayAudit(CoolLine) + SV:AddToDisplayAudit(CoolLine) if STYLE:IsAddonReady("DockletCoolLine") then if not CoolLineDB.vertical then diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DBM.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DBM.lua index 89efad3..d0cfd47 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DBM.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DBM.lua @@ -29,7 +29,7 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -98,8 +98,8 @@ local function StyleBars(self) frame:SetHeight(22) name:Point('LEFT', frame, 'LEFT', 4, 0) timer:Point('RIGHT', frame, 'RIGHT', -4, 0) - name:SetFontTemplate(SuperVillain.Media.font.default, 12, 'OUTLINE') - timer:SetFontTemplate(SuperVillain.Media.font.default, 12, 'OUTLINE') + name:SetFontTemplate(SV.Media.font.default, 12, 'OUTLINE') + timer:SetFontTemplate(SV.Media.font.default, 12, 'OUTLINE') name:SetTextColor(bar.owner.options.TextColorR, bar.owner.options.TextColorG, bar.owner.options.TextColorB) timer:SetTextColor(bar.owner.options.TextColorR, bar.owner.options.TextColorG, bar.owner.options.TextColorB) if bar.owner.options.IconLeft then icon1:Show() icon1.overlay:Show() else icon1:Hide() icon1.overlay:Hide() end @@ -121,7 +121,7 @@ local StyleBossTitle = function() if not anchor.styled then local header = {anchor:GetRegions()} if header[1]:IsObjectType('FontString') then - header[1]:SetFontTemplate(SuperVillain.Media.font.default, 12, 'OUTLINE') + header[1]:SetFontTemplate(SV.Media.font.default, 12, 'OUTLINE') header[1]:SetTextColor(1, 1, 1) header[1]:SetShadowColor(0, 0, 0, 0) anchor.styled = true @@ -169,8 +169,8 @@ local StyleBoss = function() bar:SetHeight(22) name:Point('LEFT', bar, 'LEFT', 4, 0) timer:Point('RIGHT', bar, 'RIGHT', -4, 0) - name:SetFontTemplate(SuperVillain.Media.font.default, 12, 'OUTLINE') - timer:SetFontTemplate(SuperVillain.Media.font.default, 12, 'OUTLINE') + name:SetFontTemplate(SV.Media.font.default, 12, 'OUTLINE') + timer:SetFontTemplate(SV.Media.font.default, 12, 'OUTLINE') count = count + 1 end end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DXE.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DXE.lua index 38c03e4..475f69c 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DXE.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DXE.lua @@ -29,7 +29,7 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; local playerName = UnitName("player"); local playerRealm = GetRealmName(); @@ -42,13 +42,13 @@ DXE local function StyleDXEBar(bar) bar:SetFixedPanelTemplate("Transparent") bar.bg:SetTexture(0,0,0,0) - bar.border.Show = SuperVillain.fubar + bar.border.Show = SV.fubar bar.border:Hide() bar.statusbar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) bar.statusbar:ClearAllPoints() bar.statusbar:FillInner() bar.righticon:SetFixedPanelTemplate("Default") - bar.righticon.border.Show = SuperVillain.fubar + bar.righticon.border.Show = SV.fubar bar.righticon.border:Hide() bar.righticon:ClearAllPoints() bar.righticon:SetPoint("LEFT", bar, "RIGHT", 2, 0) @@ -57,7 +57,7 @@ local function StyleDXEBar(bar) bar.righticon.t:FillInner() bar.righticon.t:SetDrawLayer("ARTWORK") bar.lefticon:SetFixedPanelTemplate("Default") - bar.lefticon.border.Show = SuperVillain.fubar + bar.lefticon.border.Show = SV.fubar bar.lefticon.border:Hide() bar.lefticon:ClearAllPoints() bar.lefticon:SetPoint("RIGHT", bar, "LEFT", -2, 0) @@ -75,7 +75,7 @@ local function RefreshDXEBars(frame) local bar = _G["DXEAlertBar"..i] if not bar.styled then bar:SetScale(1) - bar.SetScale = SuperVillain.fubar + bar.SetScale = SV.fubar StyleDXEBar(bar) bar.styled = true end @@ -95,7 +95,7 @@ local function StyleDXE() for i,hw in ipairs(frame.HW) do if hw:IsShown() then hw:SetFixedPanelTemplate("Transparent") - hw.border.Show = SuperVillain.fubar + hw.border.Show = SV.fubar hw.border:Hide() hw.healthbar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) end @@ -127,7 +127,7 @@ local function StyleDXE() DXEDB["profiles"][playerKey]["Globals"]["BackgroundTexture"] = [[Interface\BUTTONS\WHITE8X8]] DXEDB["profiles"][playerKey]["Globals"]["BarTexture"] = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]] DXEDB["profiles"][playerKey]["Globals"]["Border"] = "None" - DXEDB["profiles"][playerKey]["Globals"]["Font"] = SuperVillain.Media.font.default - DXEDB["profiles"][playerKey]["Globals"]["TimerFont"] = SuperVillain.Media.font.default + DXEDB["profiles"][playerKey]["Globals"]["Font"] = SV.Media.font.default + DXEDB["profiles"][playerKey]["Globals"]["TimerFont"] = SV.Media.font.default end STYLE:SaveAddonStyle("DXE", StyleDXE) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/LightHeaded.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/LightHeaded.lua index a23da07..2a34ea8 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/LightHeaded.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/LightHeaded.lua @@ -29,7 +29,7 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -62,7 +62,7 @@ local function StyleLightHeaded() STYLE:ApplyFrameStyle(LightHeadedFrameSub) STYLE:ApplyFrameStyle(LightHeadedSearchBox) STYLE:ApplyTooltipStyle(LightHeadedTooltip) - LightHeadedScrollFrame:Formula409() + LightHeadedScrollFrame:RemoveTextures() lhframe.close:Hide() STYLE:ApplyCloseButtonStyle(lhframe.close) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Mogit.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Mogit.lua index a1057e8..ec5b95b 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Mogit.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Mogit.lua @@ -29,7 +29,7 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -62,7 +62,7 @@ local function StyleMogItPreview() end if _G["MogItPreview"..i] then STYLE:ApplyFrameStyle(_G["MogItPreview"..i]) end if _G["MogItPreview"..i.."CloseButton"] then STYLE:ApplyCloseButtonStyle(_G["MogItPreview"..i.."CloseButton"]) end - if _G["MogItPreview"..i.."Inset"] then _G["MogItPreview"..i.."Inset"]:Formula409(true) end + if _G["MogItPreview"..i.."Inset"] then _G["MogItPreview"..i.."Inset"]:RemoveTextures(true) end if _G["MogItPreview"..i.."Activate"] then _G["MogItPreview"..i.."Activate"]:SetButtonTemplate() end end end @@ -71,15 +71,15 @@ local function StyleMogIt() assert(MogItFrame, "AddOn Not Loaded") STYLE:ApplyFrameStyle(MogItFrame) - MogItFrameInset:Formula409(true) + MogItFrameInset:RemoveTextures(true) STYLE:ApplyFrameStyle(MogItFilters) - MogItFiltersInset:Formula409(true) + MogItFiltersInset:RemoveTextures(true) hooksecurefunc(MogIt, "CreatePreview", StyleMogItPreview) STYLE:ApplyTooltipStyle(MogItTooltip) STYLE:ApplyCloseButtonStyle(MogItFrameCloseButton) STYLE:ApplyCloseButtonStyle(MogItFiltersCloseButton) - MogItFrameFiltersDefaults:Formula409(true) + MogItFrameFiltersDefaults:RemoveTextures(true) MogItFrameFiltersDefaults:SetButtonTemplate() STYLE:ApplyScrollFrameStyle(MogItScroll) STYLE:ApplyScrollFrameStyle(MogItFiltersScrollScrollBar) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Omen.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Omen.lua index e8af2eb..30829eb 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Omen.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Omen.lua @@ -29,7 +29,7 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -46,9 +46,9 @@ local function StyleOmen() Omen.db.profile.TitleBar.UseSameBG = true hooksecurefunc(Omen, 'UpdateBackdrop', function(self) - if not SuperVillain.CurrentlyDocked["OmenAnchor"] then + if not SV.CurrentlyDocked["OmenAnchor"] then STYLE:ApplyFrameStyle(self.BarList, 'Transparent') - self.Title:Formula409() + self.Title:RemoveTextures() self.Title:SetPanelTemplate("Default") self.Title:SetPanelColor("class") end @@ -56,8 +56,8 @@ local function StyleOmen() end) hooksecurefunc(Omen, 'Toggle', function(self) - if InCombatLockdown() then return end; - if not SuperVillain.CurrentlyDocked["OmenAnchor"] then return end + if InCombatLockdown() then return end + if not SV.CurrentlyDocked["OmenAnchor"] then return end if self.Anchor:IsShown() then SuperDockWindow:Show() else @@ -72,7 +72,7 @@ end STYLE:SaveAddonStyle("Omen", StyleOmen) function STYLE:Docklet_Omen(parent) - if not Omen then return end; + if not Omen then return end local db=Omen.db; db.profile.Scale=1; db.profile.Bar.Spacing=1; @@ -84,13 +84,13 @@ function STYLE:Docklet_Omen(parent) db.profile.TitleBar.ShowTitleBar=true; db.profile.FrameStrata='2-LOW' Omen:OnProfileChanged(nil,db) - OmenTitle:Formula409() + OmenTitle:RemoveTextures() OmenTitle.Panel = nil OmenTitle:SetPanelTemplate("Default") OmenTitle:SetPanelColor("class") - OmenBarList:Formula409() + OmenBarList:RemoveTextures() OmenBarList.Panel = nil OmenBarList:SetFixedPanelTemplate('Transparent') OmenAnchor:ClearAllPoints() OmenAnchor:SetAllPoints(parent) -end; \ No newline at end of file +end \ 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 7bee43f..ab94eb7 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Outfitter.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Outfitter.lua @@ -29,7 +29,7 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -45,7 +45,7 @@ local function StyleOutfitter() OutfitterFrameTab1:Size(60, 25) OutfitterFrameTab2:Size(60, 25) OutfitterFrameTab3:Size(60, 25) - OutfitterMainFrame:Formula409(true) + OutfitterMainFrame:RemoveTextures(true) for i = 0, 13 do if _G["OutfitterItem"..i.."OutfitSelected"] then _G["OutfitterItem"..i.."OutfitSelected"]:SetButtonTemplate() @@ -55,7 +55,7 @@ local function StyleOutfitter() end end end) - OutfitterMainFrameScrollbarTrench:Formula409(true) + OutfitterMainFrameScrollbarTrench:RemoveTextures(true) OutfitterFrameTab1:ClearAllPoints() OutfitterFrameTab2:ClearAllPoints() OutfitterFrameTab3:ClearAllPoints() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Postal.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Postal.lua index 62cbed9..045b077 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Postal.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Postal.lua @@ -29,7 +29,7 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Quartz.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Quartz.lua index 59a9487..3e13c86 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Quartz.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Quartz.lua @@ -29,7 +29,7 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Recount.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Recount.lua index cef9ccc..b699629 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Recount.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Recount.lua @@ -29,7 +29,7 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -43,11 +43,11 @@ local function NoColor(a) q:SetDesaturated(true) if q:GetTexture()=='Interface\\DialogFrame\\UI-DialogBox-Corner'then q:SetTexture(0,0,0,0) - q:MUNG() + q:Die() end end - end; -end; + end +end local function StyleRecount() assert(Recount, "AddOn Not Loaded") @@ -104,7 +104,7 @@ local function StyleRecount() 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:HookScript('OnShow', function(self) if InCombatLockdown() then return end if SV.CurrentlyDocked["Recount_MainWindow"] then SuperDockWindowRight:Show() end end) Recount.MainWindow.FileButton:HookScript('OnClick', function(self) if LibDropdownFrame0 then STYLE:ApplyFrameStyle(LibDropdownFrame0) end end) hooksecurefunc(Recount, 'ShowScrollbarElements', function(self, name) Recount_MainWindow_ScrollBarScrollBar:Show() end) @@ -123,12 +123,12 @@ end STYLE:SaveAddonStyle("Recount", StyleRecount) function STYLE:Docklet_Recount(parent) - if not Recount then return end; + if not Recount then return end local n=Recount.MainWindow.Panel; if n and not n.Panel then n:Show() n:SetFixedPanelTemplate('Transparent',true) - end; + end Recount.db.profile.Locked=true; Recount.db.profile.Scaling=1; Recount.db.profile.ClampToScreen=true; @@ -139,4 +139,4 @@ function STYLE:Docklet_Recount(parent) Recount:LockWindows(true) Recount:ResizeMainWindow() Recount_MainWindow_ScrollBar:Hide() -end; \ No newline at end of file +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/SexyCooldown.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/SexyCooldown.lua index 09ed020..b1b6831 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/SexyCooldown.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/SexyCooldown.lua @@ -29,7 +29,7 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -54,7 +54,7 @@ end local function StyleSexyCooldownBar(bar) SCDStripStyleSettings(bar) STYLE:ApplyFrameStyle(bar) - SuperVillain:AddToDisplayAudit(bar) + SV:AddToDisplayAudit(bar) if STYLE:IsAddonReady("DockletSexyCooldown") then bar:ClearAllPoints() bar:Point('BOTTOMRIGHT', SVUI_ActionBar1, 'TOPRIGHT', 0, 2) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Skada.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Skada.lua index 00dd257..0d8b30b 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Skada.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Skada.lua @@ -30,7 +30,7 @@ local twipe = table.wipe; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; local activePanels = {}; --[[ @@ -43,7 +43,7 @@ local function Skada_ShowPopup(self) end local function skada_panel_loader(holder, window, parent) - if not window then return end; + if not window then return end local bars = Skada.displays['bar'] @@ -66,7 +66,7 @@ local function skada_panel_loader(holder, window, parent) if bgroup and not bgroup.Panel then bgroup:Show() bgroup:SetFixedPanelTemplate('Transparent',true) - end; + end bars.ApplySettings(bars, window) end @@ -96,15 +96,22 @@ local function StyleSkada() hooksecurefunc(SkadaDisplayBar, 'ApplySettings', function(self, window) local skada = window.bargroup + skada:SetSpacing(1) skada:SetFrameLevel(5) skada:SetBackdrop(nil) - if(window.db.enabletitle and not skada.button.Panel) then - skada.button:SetFixedPanelTemplate('Default', true) + + if(window.db.enabletitle) then + skada.button:SetHeight(18) + skada.button:SetButtonTemplate() + skada.button:GetFontString():SetFont(SV.Media.font.names, 15, "OUTLINE") end + if(not skada.Panel) then - STYLE:ApplyFrameStyle(skada) - end - if(skada.Panel) then + STYLE:ApplyWindowHolder(skada, true) + skada.Panel:ClearAllPoints() + skada.Panel:Point('TOPLEFT', window.db.enabletitle and skada.button or skada, 'TOPLEFT', -2, 2) + skada.Panel:Point('BOTTOMRIGHT', skada, 'BOTTOMRIGHT', 2, -2) + else skada.Panel:ClearAllPoints() skada.Panel:Point('TOPLEFT', window.db.enabletitle and skada.button or skada, 'TOPLEFT', -2, 2) skada.Panel:Point('BOTTOMRIGHT', skada, 'BOTTOMRIGHT', 2, -2) @@ -112,38 +119,38 @@ local function StyleSkada() end) hooksecurefunc(Skada, 'ToggleWindow', function() - if InCombatLockdown() then return end; - if not SuperVillain.CurrentlyDocked["SkadaHolder"] or not SuperVillain.CurrentlyDocked["SkadaHolder2"] then return end + if InCombatLockdown() then return end + if not SV.CurrentlyDocked["SkadaHolder"] or not SV.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) hooksecurefunc(Skada, 'CreateWindow', function() - if SuperVillain.CurrentlyDocked["SkadaHolder"] or SuperVillain.CurrentlyDocked["SkadaHolder2"] then + if SV.CurrentlyDocked["SkadaHolder"] or SV.CurrentlyDocked["SkadaHolder2"] then STYLE:Docklet_Skada() end end) hooksecurefunc(Skada, 'DeleteWindow', function() - if SuperVillain.CurrentlyDocked["SkadaHolder"] or SuperVillain.CurrentlyDocked["SkadaHolder2"] then + if SV.CurrentlyDocked["SkadaHolder"] or SV.CurrentlyDocked["SkadaHolder2"] then STYLE:Docklet_Skada() end end) hooksecurefunc(Skada, 'UpdateDisplay', function() - if SuperVillain.CurrentlyDocked["SkadaHolder"] or SuperVillain.CurrentlyDocked["SkadaHolder2"] then + if SV.CurrentlyDocked["SkadaHolder"] or SV.CurrentlyDocked["SkadaHolder2"] then STYLE:Docklet_Skada() end end) end function STYLE:Docklet_Skada() - if not Skada then return end; + if not Skada then return end if(not SkadaHolder) then local SkadaHolder = CreateFrame("Frame", "SkadaHolder", UIParent) end @@ -152,9 +159,9 @@ function STYLE:Docklet_Skada() end for index,window in pairs(Skada:GetWindows()) do local key = "Skada"..window.db.name - if(SuperVillain.db.SVDock.docklets.DockletMain == key)then + if(SV.db.SVDock.docklets.DockletMain == key)then skada_panel_loader(SkadaHolder, window, SuperDockletMain) - elseif(SuperVillain.db.SVDock.docklets.enableExtra and SuperVillain.db.SVDock.docklets.DockletExtra == key) then + elseif(SV.db.SVDock.docklets.enableExtra and SV.db.SVDock.docklets.DockletExtra == key) then skada_panel_loader(SkadaHolder2, window, SuperDockletExtra) else window.db.barslocked = false; diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TinyDPS.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TinyDPS.lua index 493fa90..1ffb15a 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TinyDPS.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TinyDPS.lua @@ -29,7 +29,7 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -42,8 +42,8 @@ local function StyleTinyDPS() STYLE:ApplyFrameStyle(tdpsFrame) tdpsFrame:HookScript("OnShow", function() - if InCombatLockdown() then return end; - if SuperVillain.CurrentlyDocked["tdpsFrame"] then + if InCombatLockdown() then return end + if SV.CurrentlyDocked["tdpsFrame"] then SuperDockWindowRight:Show() end end) @@ -59,7 +59,7 @@ end STYLE:SaveAddonStyle("TinyDPS", StyleTinyDPS) function STYLE:Docklet_TinyDPS(parent) - if not tdpsFrame then return end; + if not tdpsFrame then return end tdpsFrame:SetFixedPanelTemplate("Transparent", true) tdpsFrame:SetFrameStrata("LOW") tdps.hideOOC = false; diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TomTom.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TomTom.lua index 91df25e..48a73e4 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TomTom.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TomTom.lua @@ -29,7 +29,7 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TradeSkillDW.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TradeSkillDW.lua index 777bce6..518e5d9 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TradeSkillDW.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TradeSkillDW.lua @@ -29,7 +29,7 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -40,12 +40,12 @@ local function StyleTradeSkillDW() assert(TradeSkillDW_QueueFrame, "AddOn Not Loaded") TradeSkillFrame:SetPanelTemplate("Action") - TradeSkillListScrollFrame:Formula409(true) - TradeSkillDetailScrollFrame:Formula409(true) - TradeSkillFrameInset:Formula409(true) - TradeSkillExpandButtonFrame:Formula409(true) - TradeSkillDetailScrollChildFrame:Formula409(true) - TradeSkillListScrollFrame:Formula409(true) + TradeSkillListScrollFrame:RemoveTextures(true) + TradeSkillDetailScrollFrame:RemoveTextures(true) + TradeSkillFrameInset:RemoveTextures(true) + TradeSkillExpandButtonFrame:RemoveTextures(true) + TradeSkillDetailScrollChildFrame:RemoveTextures(true) + TradeSkillListScrollFrame:RemoveTextures(true) STYLE:ApplyFrameStyle(TradeSkillGuildFrame,"Transparent") STYLE:ApplyFrameStyle(TradeSkillGuildFrameContainer,"Transparent") TradeSkillGuildFrame:Point("BOTTOMLEFT", TradeSkillFrame, "BOTTOMRIGHT", 3, 19) @@ -53,7 +53,7 @@ local function StyleTradeSkillDW() TradeSkillFrame:HookScript("OnShow", function() STYLE:ApplyFrameStyle(TradeSkillFrame) - TradeSkillListScrollFrame:Formula409() + TradeSkillListScrollFrame:RemoveTextures() if not TradeSkillDWExpandButton then return end if not TradeSkillDWExpandButton.styled then STYLE:ApplyPaginationStyle(TradeSkillDWExpandButton) @@ -63,7 +63,7 @@ local function StyleTradeSkillDW() TradeSkillFrame:Height(TradeSkillFrame:GetHeight() + 12) TradeSkillRankFrame:SetBasicPanel() - TradeSkillRankFrame:SetStatusBarTexture(SuperVillain.Media.bar.default) + TradeSkillRankFrame:SetStatusBarTexture(SV.Media.bar.default) TradeSkillCreateButton:SetButtonTemplate() TradeSkillCancelButton:SetButtonTemplate() TradeSkillFilterButton:SetButtonTemplate() @@ -71,7 +71,7 @@ local function StyleTradeSkillDW() TradeSkillViewGuildCraftersButton:SetButtonTemplate() 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() + TradeSkillLinkButton:GetHighlightTexture():Die() STYLE:ApplyFrameStyle(TradeSkillLinkButton,"Transparent") TradeSkillLinkButton:Size(17, 14) TradeSkillLinkButton:Point("LEFT", TradeSkillLinkFrame, "LEFT", 5, -1) @@ -113,7 +113,7 @@ local function StyleTradeSkillDW() button:Point(point, anchoredto, point2, x, y - 3) once = true end - _G["TradeSkillReagent"..i.."NameFrame"]:MUNG() + _G["TradeSkillReagent"..i.."NameFrame"]:Die() end end) @@ -121,22 +121,22 @@ local function StyleTradeSkillDW() STYLE:ApplyCloseButtonStyle(TradeSkillDW_QueueFrameCloseButton) - TradeSkillDW_QueueFrameInset:Formula409() + TradeSkillDW_QueueFrameInset:RemoveTextures() TradeSkillDW_QueueFrameClear:SetButtonTemplate() TradeSkillDW_QueueFrameDown:SetButtonTemplate() TradeSkillDW_QueueFrameUp:SetButtonTemplate() TradeSkillDW_QueueFrameDo:SetButtonTemplate() - TradeSkillDW_QueueFrameDetailScrollFrame:Formula409() - TradeSkillDW_QueueFrameDetailScrollFrameChildFrame:Formula409() - TradeSkillDW_QueueFrameDetailScrollFrameChildFrameReagent1:Formula409() - TradeSkillDW_QueueFrameDetailScrollFrameChildFrameReagent2:Formula409() - TradeSkillDW_QueueFrameDetailScrollFrameChildFrameReagent3:Formula409() - TradeSkillDW_QueueFrameDetailScrollFrameChildFrameReagent4:Formula409() - TradeSkillDW_QueueFrameDetailScrollFrameChildFrameReagent5:Formula409() - TradeSkillDW_QueueFrameDetailScrollFrameChildFrameReagent6:Formula409() - TradeSkillDW_QueueFrameDetailScrollFrameChildFrameReagent7:Formula409() - TradeSkillDW_QueueFrameDetailScrollFrameChildFrameReagent8:Formula409() + TradeSkillDW_QueueFrameDetailScrollFrame:RemoveTextures() + TradeSkillDW_QueueFrameDetailScrollFrameChildFrame:RemoveTextures() + TradeSkillDW_QueueFrameDetailScrollFrameChildFrameReagent1:RemoveTextures() + TradeSkillDW_QueueFrameDetailScrollFrameChildFrameReagent2:RemoveTextures() + TradeSkillDW_QueueFrameDetailScrollFrameChildFrameReagent3:RemoveTextures() + TradeSkillDW_QueueFrameDetailScrollFrameChildFrameReagent4:RemoveTextures() + TradeSkillDW_QueueFrameDetailScrollFrameChildFrameReagent5:RemoveTextures() + TradeSkillDW_QueueFrameDetailScrollFrameChildFrameReagent6:RemoveTextures() + TradeSkillDW_QueueFrameDetailScrollFrameChildFrameReagent7:RemoveTextures() + TradeSkillDW_QueueFrameDetailScrollFrameChildFrameReagent8:RemoveTextures() STYLE:ApplyScrollFrameStyle(TradeSkillDW_QueueFrameDetailScrollFrameScrollBar) - TradeSkillListScrollFrame:Formula409() + TradeSkillListScrollFrame:RemoveTextures() 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 539b4fe..725366a 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/VEM.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/VEM.lua @@ -29,7 +29,7 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -112,8 +112,8 @@ local function StyleBars(self) name:Point('LEFT', frame, 'LEFT', 4, 0) timer:Point('RIGHT', frame, 'RIGHT', -4, 0) - name:SetFont(SuperVillain.Media.font.default, 12, 'OUTLINE') - timer:SetFont(SuperVillain.Media.font.default, 12, 'OUTLINE') + name:SetFont(SV.Media.font.default, 12, 'OUTLINE') + timer:SetFont(SV.Media.font.default, 12, 'OUTLINE') name:SetTextColor(bar.owner.options.TextColorR, bar.owner.options.TextColorG, bar.owner.options.TextColorB) timer:SetTextColor(bar.owner.options.TextColorR, bar.owner.options.TextColorG, bar.owner.options.TextColorB) @@ -138,7 +138,7 @@ local StyleBossTitle = function() if not anchor.styled then local header = {anchor:GetRegions()} if header[1]:IsObjectType('FontString') then - header[1]:SetFont(SuperVillain.Media.font.default, 12, 'OUTLINE') + header[1]:SetFont(SV.Media.font.default, 12, 'OUTLINE') header[1]:SetTextColor(1, 1, 1) header[1]:SetShadowColor(0, 0, 0, 0) anchor.styled = true @@ -188,8 +188,8 @@ local StyleBoss = function() name:Point('LEFT', bar, 'LEFT', 4, 0) timer:Point('RIGHT', bar, 'RIGHT', -4, 0) - name:SetFont(SuperVillain.Media.font.default, 12, 'OUTLINE') - timer:SetFont(SuperVillain.Media.font.default, 12, 'OUTLINE') + name:SetFont(SV.Media.font.default, 12, 'OUTLINE') + timer:SetFont(SV.Media.font.default, 12, 'OUTLINE') count = count + 1 end end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/WeakAuras.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/WeakAuras.lua deleted file mode 100644 index 82ea63a..0000000 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/WeakAuras.lua +++ /dev/null @@ -1,77 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -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 string = _G.string; ---[[ STRING METHODS ]]-- -local format = string.format; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SuperVillain, L = unpack(SVUI); -local STYLE = _G.StyleVillain; ---[[ -########################################################## -WEAKAURAS -########################################################## -]]-- -local function Style_WeakAuras(frame) - if not frame.Panel then - STYLE:ApplyFrameStyle(frame,"Transparent") - frame.icon.OldAlpha = frame.icon.SetAlpha - frame.icon.SetAlpha = function(self, ...) - frame.icon.OldAlpha(self, ...) - frame.Panel:SetAlpha(...) - end - end - SuperVillain:AddCD(frame.cooldown) - frame.icon:SetTexCoord(0.1,0.9,0.1,0.9) - frame.icon.SetTexCoord = SuperVillain.fubar -end - -local function Create_WeakAuras(parent, data) - local region = WeakAuras.regionTypes.icon.OldCreate(parent, data) - Style_WeakAuras(region) - return region -end - -local function Modify_WeakAuras(parent, region, data) - WeakAuras.regionTypes.icon.OldModify(parent, region, data) - Style_WeakAuras(region) -end - -local function StyleWeakAuras() - assert(WeakAuras, "AddOn Not Loaded") - - WeakAuras.regionTypes.icon.OldCreate = WeakAuras.regionTypes.icon.create - 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 diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/_load.xml b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/_load.xml index aa9bc3a..2e19d58 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/_load.xml +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/_load.xml @@ -24,5 +24,4 @@ <Script file='TomTom.lua'/> <Script file='TradeSkillDW.lua'/> <Script file='VEM.lua'/> - <Script file='WeakAuras.lua'/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/alDamageMeter.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/alDamageMeter.lua index 0f07d92..081e283 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/alDamageMeter.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/alDamageMeter.lua @@ -29,7 +29,7 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -39,11 +39,11 @@ ALDAMAGEMETER local function StyleALDamageMeter() assert(_G['alDamagerMeterFrame'], "AddOn Not Loaded") - alDamageMeterFrame.bg:MUNG() + alDamageMeterFrame.bg:Die() STYLE:ApplyFrameStyle(alDamageMeterFrame) alDamageMeterFrame:HookScript('OnShow', function() - if InCombatLockdown() then return end; - if SuperVillain.CurrentlyDocked["alDamagerMeterFrame"] then + if InCombatLockdown() then return end + if SV.CurrentlyDocked["alDamagerMeterFrame"] then SuperDockWindow:Show() end end) @@ -51,13 +51,13 @@ end STYLE:SaveAddonStyle("alDamageMeter", StyleALDamageMeter) function STYLE:Docklet_alDamageMeter(parent) - if not _G['alDamagerMeterFrame'] then return end; + if not _G['alDamagerMeterFrame'] then return end local parentFrame=_G['alDamagerMeterFrame']:GetParent(); dmconf.barheight=floor(parentFrame:GetHeight()/dmconf.maxbars-dmconf.spacing) dmconf.width=parentFrame:GetWidth() alDamageMeterFrame:ClearAllPoints() alDamageMeterFrame:SetAllPoints(parent) alDamageMeterFrame.backdrop:SetFixedPanelTemplate('Transparent',true) - alDamageMeterFrame.bg:MUNG() + alDamageMeterFrame.bg:Die() alDamageMeterFrame:SetFrameStrata('LOW') -end; \ No newline at end of file +end \ 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 f3d6d58..d4d94f8 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/timemanager.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/timemanager.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -21,13 +21,14 @@ TIMEMANAGER STYLER ########################################################## ]]-- local function TimeManagerStyle() - -- if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.timemanager ~= true then - -- return - -- end; - TimeManagerFrame:Formula409() - TimeManagerFrame:SetPanelTemplate("Action", false) + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.timemanager ~= true then + return + end + + STYLE:ApplyWindowStyle(TimeManagerFrame, true) + STYLE:ApplyCloseButtonStyle(TimeManagerFrameCloseButton) - TimeManagerFrameInset:MUNG() + TimeManagerFrameInset:Die() STYLE:ApplyDropdownStyle(TimeManagerAlarmHourDropDown, 80) STYLE:ApplyDropdownStyle(TimeManagerAlarmMinuteDropDown, 80) STYLE:ApplyDropdownStyle(TimeManagerAlarmAMPMDropDown, 80) @@ -35,7 +36,7 @@ local function TimeManagerStyle() TimeManagerAlarmEnabledButton:SetCheckboxTemplate(true) TimeManagerMilitaryTimeCheck:SetCheckboxTemplate(true) TimeManagerLocalTimeCheck:SetCheckboxTemplate(true) - TimeManagerStopwatchFrame:Formula409() + TimeManagerStopwatchFrame:RemoveTextures() TimeManagerStopwatchCheck:SetFixedPanelTemplate("Default") TimeManagerStopwatchCheck:GetNormalTexture():SetTexCoord(0.1, 0.9, 0.1, 0.9) TimeManagerStopwatchCheck:GetNormalTexture():FillInner() @@ -45,19 +46,19 @@ local function TimeManagerStyle() sWatch:Point("BOTTOMRIGHT", TimeManagerStopwatchCheck, -2, 2) TimeManagerStopwatchCheck:SetHighlightTexture(sWatch) - StopwatchFrame:Formula409() + StopwatchFrame:RemoveTextures() StopwatchFrame:SetBasicPanel() StopwatchFrame.Panel:Point("TOPLEFT", 0, -17) StopwatchFrame.Panel:Point("BOTTOMRIGHT", 0, 2) - StopwatchTabFrame:Formula409() + StopwatchTabFrame:RemoveTextures() STYLE:ApplyCloseButtonStyle(StopwatchCloseButton) STYLE:ApplyPaginationStyle(StopwatchPlayPauseButton) STYLE:ApplyPaginationStyle(StopwatchResetButton) StopwatchPlayPauseButton:Point("RIGHT", StopwatchResetButton, "LEFT", -4, 0) StopwatchResetButton:Point("BOTTOMRIGHT", StopwatchFrame, "BOTTOMRIGHT", -4, 6) -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/trade.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/trade.lua index 0acff18..ef59323 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/trade.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/trade.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -21,26 +21,26 @@ TRADEFRAME STYLER ########################################################## ]]-- local function TradeFrameStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.trade ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.trade ~= true then return - end; - TradeFrame:Formula409(true) - TradeFrame:SetPanelTemplate("Action", false) - TradeFrame.Panel:SetAllPoints() - TradeFrameInset:MUNG() + end + + STYLE:ApplyWindowStyle(TradeFrame, true) + + TradeFrameInset:Die() TradeFrameTradeButton:SetButtonTemplate() TradeFrameCancelButton:SetButtonTemplate() STYLE:ApplyCloseButtonStyle(TradeFrameCloseButton, TradeFrame.Panel) TradePlayerInputMoneyFrameGold:SetEditboxTemplate() TradePlayerInputMoneyFrameSilver:SetEditboxTemplate() TradePlayerInputMoneyFrameCopper:SetEditboxTemplate() - TradeRecipientItemsInset:MUNG() - TradePlayerItemsInset:MUNG() - TradePlayerInputMoneyInset:MUNG() - TradePlayerEnchantInset:MUNG() - TradeRecipientEnchantInset:MUNG() - TradeRecipientMoneyInset:MUNG() - TradeRecipientMoneyBg:MUNG() + TradeRecipientItemsInset:Die() + TradePlayerItemsInset:Die() + TradePlayerInputMoneyInset:Die() + TradePlayerEnchantInset:Die() + TradeRecipientEnchantInset:Die() + TradeRecipientMoneyInset:Die() + TradeRecipientMoneyBg:Die() local inputs = { "TradePlayerInputMoneyFrameSilver", "TradePlayerInputMoneyFrameCopper" @@ -50,7 +50,7 @@ local function TradeFrameStyle() _G[frame].Panel:Point("TOPLEFT", -2, 1) _G[frame].Panel:Point("BOTTOMRIGHT", -12, -1) _G[frame]:SetTextInsets(-1, -1, -2, -2) - end; + end for i = 1, 7 do local W = _G["TradePlayerItem"..i] local X = _G["TradeRecipientItem"..i] @@ -59,10 +59,10 @@ local function TradeFrameStyle() local b = _G["TradePlayerItem"..i.."ItemButtonIconTexture"] local z = _G["TradeRecipientItem"..i.."ItemButtonIconTexture"] if Y and Z then - W:Formula409() - X:Formula409() - Y:Formula409() - Z:Formula409() + W:RemoveTextures() + X:RemoveTextures() + Y:RemoveTextures() + Z:RemoveTextures() b:FillInner(Y) b:SetTexCoord(0.1, 0.9, 0.1, 0.9) Y:SetFixedPanelTemplate("Button", true) @@ -84,7 +84,7 @@ local function TradeFrameStyle() Z.bg:SetFrameLevel(Z:GetFrameLevel()-3) Z:SetFrameLevel(Z:GetFrameLevel()-1) end - end; + end TradeHighlightPlayerTop:SetTexture(0, 1, 0, 0.2) TradeHighlightPlayerBottom:SetTexture(0, 1, 0, 0.2) TradeHighlightPlayerMiddle:SetTexture(0, 1, 0, 0.2) @@ -101,7 +101,7 @@ local function TradeFrameStyle() TradeHighlightRecipientEnchantBottom:SetTexture(0, 1, 0, 0.2) TradeHighlightRecipientEnchantMiddle:SetTexture(0, 1, 0, 0.2) TradeHighlightRecipientEnchant:SetFrameStrata("HIGH") -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/tradeskill.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/tradeskill.lua index 85ab9dd..960e48e 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/tradeskill.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/tradeskill.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -21,51 +21,66 @@ TRADESKILL STYLER ########################################################## ]]-- local function TradeSkillStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.tradeskill ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.tradeskill ~= true then return - end; - TradeSkillFrame:Formula409(true) - TradeSkillListScrollFrame:Formula409() - TradeSkillDetailScrollFrame:Formula409() - TradeSkillFrameInset:Formula409() - TradeSkillExpandButtonFrame:Formula409() - TradeSkillDetailScrollChildFrame:Formula409() - TradeSkillFrame:SetPanelTemplate("Action") - TradeSkillRankFrame:Formula409() - TradeSkillRankFrame:SetPanelTemplate("Slot", true, 1, 2, 2) - TradeSkillRankFrame:SetStatusBarTexture(SuperVillain.Media.bar.default) + end + + TradeSkillListScrollFrame:RemoveTextures() + TradeSkillDetailScrollFrame:RemoveTextures() + TradeSkillFrameInset:RemoveTextures() + TradeSkillExpandButtonFrame:RemoveTextures() + TradeSkillDetailScrollChildFrame:RemoveTextures() + TradeSkillRankFrame:RemoveTextures() + TradeSkillCreateButton:RemoveTextures(true) + TradeSkillCancelButton:RemoveTextures(true) + TradeSkillFilterButton:RemoveTextures(true) + TradeSkillCreateAllButton:RemoveTextures(true) + TradeSkillViewGuildCraftersButton:RemoveTextures(true) + + STYLE:ApplyWindowStyle(TradeSkillFrame, true, true) + STYLE:ApplyWindowStyle(TradeSkillGuildFrame) + + TradeSkillGuildFrame:Point("BOTTOMLEFT", TradeSkillFrame, "BOTTOMRIGHT", 3, 19) + TradeSkillGuildFrameContainer:RemoveTextures() + TradeSkillGuildFrameContainer:SetPanelTemplate("Inset") + STYLE:ApplyCloseButtonStyle(TradeSkillGuildFrameCloseButton) + + TradeSkillRankFrame:SetPanelTemplate("Bar", true) + TradeSkillRankFrame:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Bars\DEFAULT]]) TradeSkillListScrollFrame:SetPanelTemplate("Inset") TradeSkillDetailScrollFrame:SetPanelTemplate("Inset") - TradeSkillFilterButton:Formula409(true) + TradeSkillCreateButton:SetButtonTemplate() TradeSkillCancelButton:SetButtonTemplate() - TradeSkillFilterButton:SetPanelTemplate("Button", true) - TradeSkillFilterButton.Panel:SetAllPoints() + TradeSkillFilterButton:SetButtonTemplate() TradeSkillCreateAllButton:SetButtonTemplate() TradeSkillViewGuildCraftersButton:SetButtonTemplate() + 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() - TradeSkillLinkButton:SetPanelTemplate("Button", true) + TradeSkillLinkButton:Size(17, 14) TradeSkillLinkButton:Point("LEFT", TradeSkillLinkFrame, "LEFT", 5, -1) + TradeSkillLinkButton:SetButtonTemplate(nil, nil, nil, nil, true) + TradeSkillLinkButton:GetNormalTexture():SetTexCoord(0.25, 0.7, 0.45, 0.8) + TradeSkillFrameSearchBox:SetEditboxTemplate() TradeSkillInputBox:SetEditboxTemplate() + STYLE:ApplyPaginationStyle(TradeSkillDecrementButton) STYLE:ApplyPaginationStyle(TradeSkillIncrementButton) + TradeSkillIncrementButton:Point("RIGHT", TradeSkillCreateButton, "LEFT", -13, 0) STYLE:ApplyCloseButtonStyle(TradeSkillFrameCloseButton) + local internalTest = false; + hooksecurefunc("TradeSkillFrame_SetSelection", function(_) if TradeSkillSkillIcon:GetNormalTexture() then TradeSkillSkillIcon:GetNormalTexture():SetTexCoord(0.1, 0.9, 0.1, 0.9) TradeSkillSkillIcon:GetNormalTexture():FillInner() - if not TradeSkillSkillIcon.Panel then - TradeSkillSkillIcon:SetPanelTemplate("Slot") - end - end; + TradeSkillSkillIcon:SetSlotTemplate() + end for i=1, MAX_TRADE_SKILL_REAGENTS do local u = _G["TradeSkillReagent"..i] local icon = _G["TradeSkillReagent"..i.."IconTexture"] @@ -78,12 +93,12 @@ local function TradeSkillStyle() a2:SetFrameLevel(u:GetFrameLevel()-1) else a2:SetFrameLevel(0) - end; + end a2:WrapOuter(icon) a2:SetFixedPanelTemplate("Slot") icon:SetParent(a2) icon.backdrop = a2 - end; + end a1:SetParent(icon.backdrop) a1:SetDrawLayer("OVERLAY") if i > 2 and internalTest == false then @@ -91,17 +106,11 @@ local function TradeSkillStyle() u:ClearAllPoints() u:Point(d, a3, f, g, h-3) internalTest = true - end; - _G["TradeSkillReagent"..i.."NameFrame"]:MUNG() + end + _G["TradeSkillReagent"..i.."NameFrame"]:Die() end end) - TradeSkillGuildFrame:Formula409() - TradeSkillGuildFrame:SetPanelTemplate("Halftone") - TradeSkillGuildFrame:Point("BOTTOMLEFT", TradeSkillFrame, "BOTTOMRIGHT", 3, 19) - TradeSkillGuildFrameContainer:Formula409() - TradeSkillGuildFrameContainer:SetPanelTemplate("Inset") - STYLE:ApplyCloseButtonStyle(TradeSkillGuildFrameCloseButton) -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/trainer.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/trainer.lua index 3d237c2..13ec18b 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/trainer.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/trainer.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -40,9 +40,13 @@ TRAINER STYLER ########################################################## ]]-- local function TrainerStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.trainer ~= true then return end; + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.trainer ~= true then return end + + ClassTrainerFrame:SetHeight(ClassTrainerFrame:GetHeight() + 42) + STYLE:ApplyWindowStyle(ClassTrainerFrame) + for i=1, 8 do - _G["ClassTrainerScrollFrameButton"..i]:Formula409() + _G["ClassTrainerScrollFrameButton"..i]:RemoveTextures() _G["ClassTrainerScrollFrameButton"..i]:SetFixedPanelTemplate() _G["ClassTrainerScrollFrameButton"..i]:SetButtonTemplate() _G["ClassTrainerScrollFrameButton"..i.."Icon"]:SetTexCoord(0.1, 0.9, 0.1, 0.9) @@ -50,19 +54,21 @@ local function TrainerStyle() _G["ClassTrainerScrollFrameButton"..i.."Icon"]:SetParent(_G["ClassTrainerScrollFrameButton"..i].Panel) _G["ClassTrainerScrollFrameButton"..i].selectedTex:SetTexture(1, 1, 1, 0.3) _G["ClassTrainerScrollFrameButton"..i].selectedTex:FillInner() - end; + end + STYLE:ApplyScrollFrameStyle(ClassTrainerScrollFrameScrollBar, 5) + for _,frame in pairs(ClassTrainerFrameList)do - _G[frame]:Formula409() - end; + _G[frame]:RemoveTextures() + end + for _,texture in pairs(ClassTrainerTextureList)do - _G[texture]:MUNG() - end; - _G["ClassTrainerTrainButton"]:Formula409() + _G[texture]:Die() + end + + _G["ClassTrainerTrainButton"]:RemoveTextures() _G["ClassTrainerTrainButton"]:SetButtonTemplate() STYLE:ApplyDropdownStyle(ClassTrainerFrameFilterDropDown, 155) - ClassTrainerFrame:SetHeight(ClassTrainerFrame:GetHeight()+42) - ClassTrainerFrame:SetPanelTemplate("Halftone") ClassTrainerScrollFrame:SetFixedPanelTemplate("Inset") STYLE:ApplyCloseButtonStyle(ClassTrainerFrameCloseButton, ClassTrainerFrame) ClassTrainerFrameSkillStepButton.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) @@ -71,12 +77,12 @@ local function TrainerStyle() --ClassTrainerFrameSkillStepButton.icon:SetParent(ClassTrainerFrameSkillStepButton.Panel) ClassTrainerFrameSkillStepButtonHighlight:SetTexture(1, 1, 1, 0.3) ClassTrainerFrameSkillStepButton.selectedTex:SetTexture(1, 1, 1, 0.3) - ClassTrainerStatusBar:Formula409() - ClassTrainerStatusBar:SetStatusBarTexture(SuperVillain.Media.bar.default) + ClassTrainerStatusBar:RemoveTextures() + ClassTrainerStatusBar:SetStatusBarTexture(SV.Media.bar.default) ClassTrainerStatusBar:SetPanelTemplate("Slot", true, 1, 2, 2) ClassTrainerStatusBar.rankText:ClearAllPoints() ClassTrainerStatusBar.rankText:SetPoint("CENTER", ClassTrainerStatusBar, "CENTER") -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/transmog.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/transmog.lua index f07a2f2..29a4d19 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/transmog.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/transmog.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -48,25 +48,29 @@ TRANSMOG STYLER ########################################################## ]]-- local function TransmogStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.transmogrify ~= true then return end; - TransmogrifyFrame:Formula409() - TransmogrifyFrame:SetPanelTemplate("Action") - TransmogrifyModelFrame:SetFrameLevel(TransmogrifyFrame:GetFrameLevel()+2) + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.transmogrify ~= true then return end + + STYLE:ApplyWindowStyle(TransmogrifyFrame, true) + for p, texture in pairs(TransmogFrameList)do - _G[texture]:MUNG() - end; - select(2, TransmogrifyModelFrame:GetRegions()):MUNG() - TransmogrifyModelFrame:SetFixedPanelTemplate("Comic") - TransmogrifyFrameButtonFrame:GetRegions():MUNG() + _G[texture]:Die() + end + + select(2, TransmogrifyModelFrame:GetRegions()):Die() + + TransmogrifyModelFrame:SetFixedPanelTemplate("ModelComic") + TransmogrifyFrameButtonFrame:GetRegions():Die() + TransmogrifyApplyButton:RemoveTextures() TransmogrifyApplyButton:SetButtonTemplate() TransmogrifyApplyButton:Point("BOTTOMRIGHT", TransmogrifyFrame, "BOTTOMRIGHT", -4, 4) STYLE:ApplyCloseButtonStyle(TransmogrifyArtFrameCloseButton) - TransmogrifyArtFrame:Formula409() + TransmogrifyArtFrame:RemoveTextures() + for p, a9 in pairs(TransmogSlotList)do local icon = _G["TransmogrifyFrame"..a9 .."SlotIconTexture"] local a9 = _G["TransmogrifyFrame"..a9 .."Slot"] if a9 then - a9:Formula409() + a9:RemoveTextures() a9:SetSlotTemplate(true) a9:SetFrameLevel(a9:GetFrameLevel()+2) @@ -75,15 +79,16 @@ local function TransmogStyle() icon:ClearAllPoints() icon:FillInner() end - end; + end + TransmogrifyConfirmationPopup:SetParent(UIParent) - TransmogrifyConfirmationPopup:Formula409() + TransmogrifyConfirmationPopup:RemoveTextures() TransmogrifyConfirmationPopup:SetPanelTemplate("Pattern") TransmogrifyConfirmationPopup.Button1:SetButtonTemplate() TransmogrifyConfirmationPopup.Button2:SetButtonTemplate() STYLE:ApplyItemButtonStyle(TransmogrifyConfirmationPopupItemFrame1, true) STYLE:ApplyItemButtonStyle(TransmogrifyConfirmationPopupItemFrame2, true) -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/voidstorage.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/voidstorage.lua index 54b7cef..a49dc10 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/voidstorage.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/voidstorage.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -35,18 +35,23 @@ VOIDSTORAGE STYLER ########################################################## ]]-- local function VoidStorageStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.voidstorage ~= true then + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.voidstorage ~= true then return - end; + end + + STYLE:ApplyWindowStyle(VoidStorageFrame, true) + for _,frame in pairs(VoidStorageList)do - _G[frame]:Formula409() - end; + _G[frame]:RemoveTextures() + end + VoidStoragePurchaseFrame:SetFrameStrata('DIALOG') - VoidStorageFrame:SetPanelTemplate("Halftone") VoidStoragePurchaseFrame:SetFixedPanelTemplate("Button", true) - VoidStorageFrameMarbleBg:MUNG() - VoidStorageFrameLines:MUNG() - select(2, VoidStorageFrame:GetRegions()):MUNG() + VoidStorageFrameMarbleBg:Die() + VoidStorageFrameLines:Die() + + select(2, VoidStorageFrame:GetRegions()):Die() + VoidStoragePurchaseButton:SetButtonTemplate() VoidStorageHelpBoxButton:SetButtonTemplate() VoidStorageTransferButton:SetButtonTemplate() @@ -54,6 +59,7 @@ local function VoidStorageStyle() VoidItemSearchBox:SetPanelTemplate("Inset") VoidItemSearchBox.Panel:Point("TOPLEFT", 10, -1) VoidItemSearchBox.Panel:Point("BOTTOMRIGHT", 4, 1) + for e = 1, 9 do local f = _G["VoidStorageDepositButton"..e] local g = _G["VoidStorageWithdrawButton"..e] @@ -67,7 +73,8 @@ local function VoidStorageStyle() h:FillInner() i:SetTexCoord(0.1, 0.9, 0.1, 0.9) i:FillInner() - end; + end + for e = 1, 80 do local j = _G["VoidStorageStorageButton"..e] local k = _G["VoidStorageStorageButton"..e.."IconTexture"] @@ -76,7 +83,7 @@ local function VoidStorageStyle() k:SetTexCoord(0.1, 0.9, 0.1, 0.9) k:FillInner() end -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/worldmap.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/worldmap.lua index 1150dba..3f47f77 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/worldmap.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/worldmap.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -22,43 +22,144 @@ HELPERS ]]-- local function AdjustMapLevel() if InCombatLockdown()then return end - WorldMapFrame:SetFrameLevel(2) - WorldMapDetailFrame:SetFrameLevel(4) + WorldMapFrame:SetFrameLevel(4) + WorldMapDetailFrame:SetFrameLevel(6) WorldMapFrame:SetFrameStrata('HIGH') - WorldMapArchaeologyDigSites:SetFrameLevel(6) + WorldMapArchaeologyDigSites:SetFrameLevel(8) WorldMapArchaeologyDigSites:SetFrameStrata('DIALOG') end local function WorldMap_SmallView() WorldMapFrame.Panel:ClearAllPoints() - WorldMapFrame.Panel:SetAllPoints(WorldMapFrame) - WorldMapFrame.backdrop:ClearAllPoints() - WorldMapFrame.backdrop:Point("TOPLEFT", WorldMapFrame.Panel, 2, 2) - WorldMapFrame.backdrop:Point("BOTTOMRIGHT", WorldMapFrame.Panel, 2, -2) -end + WorldMapFrame.Panel:WrapOuter(WorldMapFrame, 4, 4) + WorldMapFrame.Panel.Panel:WrapOuter(WorldMapFrame.Panel) +end local function WorldMap_FullView() WorldMapFrame.Panel:ClearAllPoints() - WorldMapFrame.Panel:Point("TOPLEFT", WorldMapDetailFrame, "TOPLEFT", -12, 70) - WorldMapFrame.Panel:Point("BOTTOMRIGHT", WorldMapShowDropDown, "BOTTOMRIGHT", 4, -4) - WorldMapFrame.backdrop:ClearAllPoints() - WorldMapFrame.backdrop:Point("TOPLEFT", WorldMapFrame.Panel, 2, 2) - WorldMapFrame.backdrop:Point("BOTTOMRIGHT", WorldMapFrame.Panel, 2, -2) + + if(SV.___interface >= 60000) then + WorldMapFrame.Panel:Point("TOPLEFT", WorldMapDetailFrame, "TOPLEFT", -12, 74) + WorldMapFrame.Panel:Point("BOTTOMRIGHT", WorldMapDetailFrame, "BOTTOMRIGHT", 12, -24) + else + WorldMapFrame.Panel:Point("TOPLEFT", WorldMapDetailFrame, "TOPLEFT", -12, 74) + WorldMapFrame.Panel:Point("BOTTOMRIGHT", WorldMapShowDropDown, "BOTTOMRIGHT", 4, -4) + end + WorldMapFrame.Panel.Panel:SetAllPoints(SV.UIParent) end +local function WorldMap_QuestView() + WorldMap_FullView() + if not WorldMapQuestDetailScrollFrame.Panel then + WorldMapQuestDetailScrollFrame:SetFixedPanelTemplate("Inset") + WorldMapQuestDetailScrollFrame.Panel:Point("TOPLEFT", -22, 2) + WorldMapQuestDetailScrollFrame.Panel:Point("BOTTOMRIGHT", WorldMapShowDropDown, 4, -4) + WorldMapQuestDetailScrollFrame.spellTex = WorldMapQuestDetailScrollFrame:CreateTexture(nil, 'ARTWORK') + WorldMapQuestDetailScrollFrame.spellTex:SetTexture([[Interface\QuestFrame\QuestBG]]) + WorldMapQuestDetailScrollFrame.spellTex:SetPoint("TOPLEFT", WorldMapQuestDetailScrollFrame.Panel, 'TOPLEFT', 2, -2) + WorldMapQuestDetailScrollFrame.spellTex:Size(586, 310) + WorldMapQuestDetailScrollFrame.spellTex:SetTexCoord(0, 1, 0.02, 1) + end + if not WorldMapQuestRewardScrollFrame.Panel then + WorldMapQuestRewardScrollFrame:SetPanelTemplate("Inset") + WorldMapQuestRewardScrollFrame.Panel:Point("BOTTOMRIGHT", 22, -4) + WorldMapQuestRewardScrollFrame.spellTex = WorldMapQuestRewardScrollFrame:CreateTexture(nil, 'ARTWORK') + WorldMapQuestRewardScrollFrame.spellTex:SetTexture([[Interface\QuestFrame\QuestBG]]) + WorldMapQuestRewardScrollFrame.spellTex:SetPoint("TOPLEFT", WorldMapQuestRewardScrollFrame.Panel, 'TOPLEFT', 2, -2) + WorldMapQuestRewardScrollFrame.spellTex:Size(585, 310) + WorldMapQuestRewardScrollFrame.spellTex:SetTexCoord(0, 1, 0.02, 1) + end + if not WorldMapQuestScrollFrame.Panel then + WorldMapQuestScrollFrame:SetPanelTemplate("Inset") + WorldMapQuestScrollFrame.Panel:Point("TOPLEFT", 0, 2) + WorldMapQuestScrollFrame.Panel:Point("BOTTOMRIGHT", 25, -3) + WorldMapQuestScrollFrame.spellTex = WorldMapQuestScrollFrame:CreateTexture(nil, 'ARTWORK') + WorldMapQuestScrollFrame.spellTex:SetTexture([[Interface\QuestFrame\QuestBG]]) + WorldMapQuestScrollFrame.spellTex:SetPoint("TOPLEFT", WorldMapQuestScrollFrame.Panel, 'TOPLEFT', 2, -2) + WorldMapQuestScrollFrame.spellTex:Size(520, 1033) + WorldMapQuestScrollFrame.spellTex:SetTexCoord(0, 1, 0.02, 1) + end +end + +local function StripQuestMapFrame() + WorldMapFrame.BorderFrame:RemoveTextures(true) + WorldMapFrame.BorderFrame.ButtonFrameEdge:SetTexture(0,0,0,0) + WorldMapFrame.BorderFrame.InsetBorderTop:SetTexture(0,0,0,0) + WorldMapFrame.BorderFrame.Inset:RemoveTextures(true) + WorldMapTitleButton:RemoveTextures(true) + WorldMapFrameNavBar:RemoveTextures(true) + WorldMapFrameNavBarOverlay:RemoveTextures(true) + QuestMapFrame:RemoveTextures(true) + QuestMapFrame.DetailsFrame:RemoveTextures(true) + + QuestMapFrame.DetailsFrame:SetPanelTemplate("Paper") + + QuestMapFrame.DetailsFrame.CompleteQuestFrame:RemoveTextures(true) + QuestMapFrame.DetailsFrame.CompleteQuestFrame.CompleteButton:RemoveTextures(true) + QuestMapFrame.DetailsFrame.CompleteQuestFrame.CompleteButton:SetButtonTemplate() + + QuestMapFrame.DetailsFrame.BackButton:RemoveTextures(true) + QuestMapFrame.DetailsFrame.BackButton:SetButtonTemplate() + + QuestMapFrame.DetailsFrame.AbandonButton:RemoveTextures(true) + QuestMapFrame.DetailsFrame.AbandonButton:SetButtonTemplate() + + QuestMapFrame.DetailsFrame.ShareButton:RemoveTextures(true) + QuestMapFrame.DetailsFrame.ShareButton:SetButtonTemplate() + + QuestMapFrame.DetailsFrame.TrackButton:RemoveTextures(true) + QuestMapFrame.DetailsFrame.TrackButton:SetButtonTemplate() + + QuestMapFrame.DetailsFrame.RewardsFrame:RemoveTextures(true) + QuestMapFrame.DetailsFrame.RewardsFrame:SetPanelTemplate("Paper") + QuestMapFrame.DetailsFrame.RewardsFrame:SetPanelColor("dark") + + QuestScrollFrame:RemoveTextures(true) + + local w,h = WorldMapFrame.UIElementsFrame:GetSize() + local underlay = CreateFrame("Frame", nil, WorldMapFrame) + underlay:Size(w,h) + underlay:SetAllPoints(WorldMapFrame.UIElementsFrame) + underlay:SetPanelTemplate("Blackout") + + WorldMapFrame.UIElementsFrame:SetParent(underlay) + + local detailWidth = QuestMapFrame.DetailsFrame.RewardsFrame:GetWidth() + QuestMapFrame.DetailsFrame:ClearAllPoints() + QuestMapFrame.DetailsFrame:SetPoint("TOPLEFT", underlay, "TOPRIGHT", 2, 0) + QuestMapFrame.DetailsFrame:SetWidth(detailWidth) + + WorldMapFrameNavBar:ClearAllPoints() + WorldMapFrameNavBar:Point("TOPLEFT", WorldMapFrame.Panel, "TOPLEFT", 12, -22) + WorldMapFrameNavBar:SetPanelTemplate("Blackout") +end local function WorldMap_OnShow() - WorldMapFrame:Formula409() - if not SuperVillain.db.SVMap.tinyWorldMap then + + if(SV.___interface >= 60000) then + --StripQuestMapFrame() + if WORLDMAP_SETTINGS.size == WORLDMAP_FULLMAP_SIZE then + WorldMap_FullView() + elseif WORLDMAP_SETTINGS.size == WORLDMAP_WINDOWED_SIZE then + WorldMap_SmallView() + end + else + WorldMapFrame:RemoveTextures() + if WORLDMAP_SETTINGS.size == WORLDMAP_FULLMAP_SIZE then + WorldMap_FullView() + elseif WORLDMAP_SETTINGS.size == WORLDMAP_WINDOWED_SIZE then + WorldMap_SmallView() + elseif WORLDMAP_SETTINGS.size == WORLDMAP_QUESTLIST_SIZE then + WorldMap_QuestView() + end + end + + if not SV.db.SVMap.tinyWorldMap then BlackoutWorld:SetTexture(0, 0, 0, 1) else BlackoutWorld:SetTexture(0,0,0,0) - end - if WORLDMAP_SETTINGS.size == WORLDMAP_FULLMAP_SIZE then - WorldMap_FullView() - elseif WORLDMAP_SETTINGS.size == WORLDMAP_WINDOWED_SIZE then - WorldMap_SmallView() - end + end + WorldMapFrameAreaLabel:SetFontTemplate(nil, 50, "OUTLINE") WorldMapFrameAreaLabel:SetShadowOffset(2, -2) WorldMapFrameAreaLabel:SetTextColor(0.90, 0.8294, 0.6407) @@ -67,12 +168,8 @@ local function WorldMap_OnShow() WorldMapFrameAreaPetLevels:SetFontTemplate(nil, 25, 'OUTLINE') WorldMapZoneInfo:SetFontTemplate(nil, 27, "OUTLINE") WorldMapZoneInfo:SetShadowOffset(2, -2) + if InCombatLockdown() then return end - WorldMapFrame:SetFrameLevel(2) - WorldMapDetailFrame:SetFrameLevel(4) - WorldMapFrame:SetFrameStrata('HIGH') - WorldMapArchaeologyDigSites:SetFrameLevel(6) - WorldMapArchaeologyDigSites:SetFrameStrata('DIALOG') AdjustMapLevel() end --[[ @@ -80,49 +177,55 @@ end WORLDMAP STYLER ########################################################## ]]-- -local function WorldMapQuestStyle() - 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) - WorldMapFrame:SetBasicPanel() - WorldMapFrame.Panel:SetFrameLevel(1) - WorldMapFrame.backdrop = CreateFrame("Frame", nil, WorldMapFrame) - WorldMapFrame.backdrop:SetAllPoints(WorldMapFrame) - WorldMapFrame.backdrop:SetFrameLevel(0) - WorldMapFrame.backdrop:SetPanelTemplate("Action"); - WorldMapDetailFrame:SetFrameLevel(4) - WorldMapArchaeologyDigSites:SetFrameLevel(6) - WorldMapDetailFrame:SetBasicPanel() - WorldMapDetailFrame.Panel:SetFrameLevel(3) +local function WorldMapStyle() + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.worldmap ~= true then return end + + WorldMapFrame:SetFrameLevel(4) + STYLE:ApplyWindowStyle(WorldMapFrame, true, true) + WorldMapFrame.Panel:SetPanelTemplate("Blackout") + + STYLE:ApplyScrollFrameStyle(WorldMapQuestScrollFrameScrollBar) + STYLE:ApplyScrollFrameStyle(WorldMapQuestDetailScrollFrameScrollBar, 4) + STYLE:ApplyScrollFrameStyle(WorldMapQuestRewardScrollFrameScrollBar, 4) + + WorldMapDetailFrame:SetFrameLevel(6) + WorldMapDetailFrame:SetPanelTemplate("Blackout") + + WorldMapArchaeologyDigSites:SetFrameLevel(8) + + WorldMapFrameSizeDownButton:SetFrameLevel(999) + WorldMapFrameSizeUpButton:SetFrameLevel(999) + WorldMapFrameCloseButton:SetFrameLevel(999) + STYLE:ApplyCloseButtonStyle(WorldMapFrameCloseButton) STYLE:ApplyCloseButtonStyle(WorldMapFrameSizeDownButton) STYLE:ApplyCloseButtonStyle(WorldMapFrameSizeUpButton) - WorldMapFrameSizeDownButton:SetFrameLevel(50) - WorldMapFrameSizeUpButton:SetFrameLevel(50) - WorldMapFrameCloseButton:SetFrameLevel(50) + STYLE:ApplyDropdownStyle(WorldMapLevelDropDown) STYLE:ApplyDropdownStyle(WorldMapZoneMinimapDropDown) STYLE:ApplyDropdownStyle(WorldMapContinentDropDown) STYLE:ApplyDropdownStyle(WorldMapZoneDropDown) STYLE:ApplyDropdownStyle(WorldMapShowDropDown) - --[[MISC STYLINGS REMOVED HERE]]-- + if(SV.___interface < 60000) then + WorldMapZoomOutButton:SetButtonTemplate() + WorldMapTrackQuest:SetCheckboxTemplate(true) + hooksecurefunc("WorldMapFrame_SetFullMapView", WorldMap_FullView) + hooksecurefunc("WorldMapFrame_SetQuestMapView", WorldMap_QuestView) + else + StripQuestMapFrame() + end WorldMapFrame:HookScript("OnShow", WorldMap_OnShow) - - --[[MISC STYLINGS REMOVED HERE]]-- - hooksecurefunc("WorldMap_ToggleSizeUp", WorldMap_OnShow) - BlackoutWorld:SetParent(WorldMapFrame.backdrop) + BlackoutWorld:SetParent(WorldMapFrame.Panel.Panel) 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 89573dd..65f512f 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/worldstate.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/worldstate.lua @@ -13,7 +13,7 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; --[[ ########################################################## @@ -21,9 +21,9 @@ WORLDSTATE STYLER ########################################################## ]]-- local function WorldStateStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.bgscore ~= true then return end; - WorldStateScoreScrollFrame:Formula409() - WorldStateScoreFrame:Formula409() + if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.bgscore ~= true then return end + WorldStateScoreScrollFrame:RemoveTextures() + WorldStateScoreFrame:RemoveTextures() WorldStateScoreFrame:SetPanelTemplate("Halftone") STYLE:ApplyCloseButtonStyle(WorldStateScoreFrameCloseButton) STYLE:ApplyScrollFrameStyle(WorldStateScoreScrollFrameScrollBar) @@ -32,7 +32,7 @@ local function WorldStateStyle() for b = 1, 3 do STYLE:ApplyTabStyle(_G["WorldStateScoreFrameTab"..b]) end -end; +end --[[ ########################################################## STYLE LOADING diff --git a/Interface/AddOns/SVUI_StyleOMatic/common/methods.lua b/Interface/AddOns/SVUI_StyleOMatic/common/methods.lua index 053a502..5d2d83e 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/common/methods.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/common/methods.lua @@ -35,8 +35,9 @@ local twipe = table.wipe; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(SVUI); +local SV, L = unpack(SVUI); local STYLE = _G.StyleVillain; +local NewHook = hooksecurefunc; --[[ ########################################################## /$$$$$$$$/$$$$$$$ /$$$$$$ /$$ /$$ /$$$$$$$$ @@ -49,19 +50,50 @@ local STYLE = _G.StyleVillain; |__/ |__/ |__/|__/ |__/|__/ |__/|________/ ########################################################## ]]-- +local levelDiff = 2 + +local _hook_WindowLevel = function(self, level) + local adjustment = level - levelDiff; + if(adjustment < 0) then adjustment = 0 end + self.Panel:SetFrameLevel(adjustment) +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 + if not noStripping then this:RemoveTextures(fullStripping) end template = template or "Transparent" this:SetPanelTemplate(template) end function STYLE:ApplyUnderlayStyle(this, template, noStripping, fullStripping) if(not this or (this and this.Panel)) then return end - if not noStripping then this:Formula409(fullStripping) end + if not noStripping then this:RemoveTextures(fullStripping) end template = template or "Transparent" this:SetFixedPanelTemplate(template) end + +function STYLE:ApplyWindowStyle(this, action, fullStrip) + if(not this or (this and this.Panel)) then return end + local template = action and "Action" or "Halftone" + local baselevel = this:GetFrameLevel() + if(baselevel < 1) then + this:SetFrameLevel(1) + end + + this:RemoveTextures(fullStrip) + this:SetPanelTemplate(template) +end + +function STYLE:ApplyWindowHolder(this, fullStrip) + if(not this or (this and this.Panel)) then return end + local baselevel = this:GetFrameLevel() + if(baselevel < 1) then + this:SetFrameLevel(1) + end + + this:RemoveTextures(fullStrip) + this:SetPanelTemplate("Blackout") +end --[[ ########################################################## /$$$$$$$ /$$ /$$ /$$$$$$$$/$$$$$$$$/$$$$$$ /$$ /$$ @@ -75,11 +107,11 @@ end ########################################################## ]]-- local Button_OnEnter = function(self) - self:SetBackdropColor(unpack(SuperVillain.Media.color.highlight)) + self:SetBackdropColor(unpack(SV.Media.color.highlight)) end local Button_OnLeave = function(self) - self:SetBackdropColor(unpack(SuperVillain.Media.color.default)) + self:SetBackdropColor(unpack(SV.Media.color.default)) end function STYLE:ApplyButtonStyle(this) @@ -89,7 +121,7 @@ end --[[ CLOSE BUTTON ]]-- local CloseButton_OnEnter = function(self) - self:SetBackdropBorderColor(unpack(SuperVillain.Media.color.highlight)) + self:SetBackdropBorderColor(unpack(SV.Media.color.highlight)) end local CloseButton_OnLeave = function(self) @@ -110,12 +142,12 @@ end --[[ ITEM BUTTON ]]-- -function STYLE:ApplyItemButtonStyle(frame, adjust, shrink) +function STYLE:ApplyItemButtonStyle(frame, adjust, shrink, noScript) if(not frame or (frame and frame.StyleHooked)) then return end local link = frame:GetName() - frame:Formula409() + frame:RemoveTextures() if(not frame.Panel) then if shrink then @@ -127,11 +159,12 @@ function STYLE:ApplyItemButtonStyle(frame, adjust, shrink) if(link) then local nameObject = _G[("%sName"):format(link)] + local subNameObject = _G[("%sSubName"):format(link)] + local arrowObject = _G[("%sFlyoutArrow"):format(link)] + local levelObject = _G[("%sLevel"):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) @@ -143,25 +176,39 @@ function STYLE:ApplyItemButtonStyle(frame, adjust, shrink) frame.IconShadow:WrapOuter(iconObject) frame.IconShadow:SetBasicPanel(0,0,0,0,true) - iconObject:SetParent(frame.IconShadow) + --iconObject:SetParent(frame.IconShadow) end - if(countObject and not frame.CountRaised) then + if(not frame.Riser) then local fg = CreateFrame("Frame", nil, frame) fg:SetSize(120, 22) fg:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", 0, -11) - fg:SetFrameLevel(frame:GetFrameLevel() + 30) + fg:SetFrameLevel(frame:GetFrameLevel() + 1) + frame.Riser = fg + end - countObject:SetParent(fg) - countObject:SetAllPoints(fg) - countObject:SetFont(SuperVillain.Shared:Fetch("font", SuperVillain.db.media.fonts.number), SuperVillain.db.media.fonts.size, "OUTLINE") + if(countObject) then + countObject:SetParent(frame.Riser) + countObject:SetAllPoints(frame.Riser) + countObject:SetFont(SV.Shared:Fetch("font", SV.db.media.fonts.number), SV.db.media.fonts.size, "OUTLINE") countObject:SetDrawLayer("ARTWORK", 7) + end - frame.CountRaised = true - end + if(nameObject) then nameObject:SetParent(frame.Riser) end + if(subNameObject) then subNameObject:SetParent(frame.Riser) end + if(arrowObject) then arrowObject:SetParent(frame.Riser) end + + if(levelObject) then + levelObject:SetParent(frame.Riser) + levelObject:SetFont(SV.Shared:Fetch("font", SV.db.media.fonts.number), SV.db.media.fonts.size, "OUTLINE") + levelObject:SetDrawLayer("ARTWORK", 7) + end + + if(not noScript) then + frame:HookScript("OnEnter", Button_OnEnter) + frame:HookScript("OnLeave", Button_OnLeave) + end end - frame:HookScript("OnEnter", Button_OnEnter) - frame:HookScript("OnLeave", Button_OnLeave) frame.StyleHooked = true end @@ -177,46 +224,59 @@ end \______/ \______/ |__/ |__/ \______/ |________/|________/ ########################################################## --]] -function STYLE:ApplyScrollFrameStyle(this) +function STYLE:ApplyScrollFrameStyle(this, scale, yOffset) if(not this or (this and this.StyleHooked)) then return end + scale = scale or 5 local scrollName = this:GetName() local bg, track, top, bottom, mid, upButton, downButton bg = _G[("%sBG"):format(scrollName)] - if(bg) then bg:SetTexture(0, 0, 0, 0) end + if(bg) then bg:SetTexture(0,0,0,0) end track = _G[("%sTrack"):format(scrollName)] - if(track) then track:SetTexture(0, 0, 0, 0) end + if(track) then track:SetTexture(0,0,0,0) end top = _G[("%sTop"):format(scrollName)] - if(top) then top:SetTexture(0, 0, 0, 0) end + if(top) then top:SetTexture(0,0,0,0) end bottom = _G[("%sBottom"):format(scrollName)] - if(bottom) then bottom:SetTexture(0, 0, 0, 0) end + if(bottom) then bottom:SetTexture(0,0,0,0) end mid = _G[("%sMiddle"):format(scrollName)] - if(mid) then mid:SetTexture(0, 0, 0, 0) end + if(mid) then mid:SetTexture(0,0,0,0) end upButton = _G[("%sScrollUpButton"):format(scrollName)] downButton = _G[("%sScrollDownButton"):format(scrollName)] if(upButton and downButton) then - upButton:Formula409() + upButton:RemoveTextures() if(not upButton.icon) then local upW, upH = upButton:GetSize() STYLE:ApplyPaginationStyle(upButton) SquareButton_SetIcon(upButton, "UP") - upButton:Size(upW + 7, upH + 7) + upButton:Size(upW + scale, upH + scale) + if(yOffset) then + local anchor, parent, relative, xBase, yBase = upButton:GetPoint() + local yAdjust = (yOffset or 0) + yBase + upButton:ClearAllPoints() + upButton:SetPoint(anchor, parent, relative, xBase, yAdjust) + end end - downButton:Formula409() + downButton:RemoveTextures() if(not downButton.icon) then local dnW, dnH = downButton:GetSize() STYLE:ApplyPaginationStyle(downButton) SquareButton_SetIcon(downButton, "DOWN") - downButton:Size(dnW + 7, dnH + 7) + downButton:Size(dnW + scale, dnH + scale) + if(yOffset) then + local anchor, parent, relative, xBase, yBase = downButton:GetPoint() + local yAdjust = ((yOffset or 0) * -1) + yBase + downButton:ClearAllPoints() + downButton:SetPoint(anchor, parent, relative, xBase, yAdjust) + end end if(not this.ScrollBG) then @@ -235,28 +295,28 @@ function STYLE:ApplyScrollFrameStyle(this) 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") + if(not this or (this and not this.GetOrientation)) then return end if(this:GetOrientation() == "VERTICAL") then - this:Width(12) + this:SetWidth(12) else - this:Height(12) + this:SetHeight(12) for i=1, this:GetNumRegions() do local child = select(i, this:GetRegions()) if(child and child:GetObjectType() == "FontString") then local anchor, parent, relative, x, y = child:GetPoint() if relative:find("BOTTOM") then - child:Point(anchor, parent, relative, x, y - 4) + child:SetPoint(anchor, parent, relative, x, y - 4) end end end end - this:SetBasicPanel() + this:RemoveTextures() + this:SetBackdrop(nil) + this:SetFixedPanelTemplate("Component") this.Panel:SetBackdropBorderColor(0.2,0.2,0.2) + this:SetThumbTexture("Interface\\Buttons\\UI-ScrollBar-Knob") this.StyleHooked = true end @@ -274,7 +334,7 @@ end --]] local Tab_OnEnter = function(self) self.backdrop:SetPanelColor("highlight") - self.backdrop:SetBackdropBorderColor(unpack(SuperVillain.Media.color.highlight)) + self.backdrop:SetBackdropBorderColor(unpack(SV.Media.color.highlight)) end local Tab_OnLeave = function(self) @@ -294,56 +354,56 @@ function STYLE:ApplyTabStyle(this, addBackground) 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(not addBackground and (this.GetHighlightTexture and this:GetHighlightTexture())) then + if(this.GetHighlightTexture and this:GetHighlightTexture()) then this:GetHighlightTexture():SetTexture(0,0,0,0) - else - this:Formula409() - - if(addBackground) then - local nTex = this:GetNormalTexture() + end - if(nTex) then - nTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) - nTex:FillInner() - end + this:RemoveTextures() - 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(addBackground) then + local nTex = this:GetNormalTexture() - if(this:GetFrameLevel() > 0) then - this.backdrop:SetFrameLevel(this:GetFrameLevel() - 1) - end + if(nTex) then + nTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) + nTex:FillInner() end - this:HookScript("OnEnter", Tab_OnEnter) - this:HookScript("OnLeave", Tab_OnLeave) + 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.StyleHooked = true end --[[ @@ -365,11 +425,11 @@ function STYLE:ApplyPaginationStyle(button, isVertical) 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:RemoveTextures() + 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)) @@ -434,7 +494,7 @@ end |_______/ \______/ |__/ \__/|__/ \__/ ########################################################## --]] -local DropDownButton_SetPoint = function(self, _, _, _, _, _, breaker) +local _hook_DropDownButton_SetPoint = function(self, _, _, _, _, _, breaker) if not breaker then self:Point("RIGHT", self.AnchorParent, "RIGHT", -10, 3, true) end @@ -449,19 +509,19 @@ function STYLE:ApplyDropdownStyle(this, width) if not width then width = 155 end - this:Formula409() + this:RemoveTextures() this:Width(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", DropDownButton_SetPoint) + NewHook(ddButton, "SetPoint", _hook_DropDownButton_SetPoint) STYLE:ApplyPaginationStyle(ddButton, true) @@ -471,25 +531,11 @@ 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.StyleHooked = true @@ -589,7 +635,8 @@ end ########################################################## --]] function STYLE:ApplyEditBoxStyle(this, width, height) - if not this then return end + if not this then return end + this:RemoveTextures(true) this:SetEditboxTemplate() if width then this:Width(width) end if height then this:Height(height) end diff --git a/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.lua b/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.lua new file mode 100644 index 0000000..0db6c34 --- /dev/null +++ b/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.lua @@ -0,0 +1,752 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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 SV, L, Registry = unpack(SVUI); + +PLUGIN = SV:Prototype(SVUIAddOnName) + +_G["TrackingVillain"] = PLUGIN; +--[[ +########################################################## +LOCALS AND BINDING +########################################################## +]]-- +BINDING_HEADER_SVUITRACK = "Supervillain UI: Tracking Device"; + +local CONFIGS = SV.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(SV.Media.gradient.dark)) + frame.Arrow:SetVertexColor(0.1, 0.8, 0.8) + frame.Range:SetFont(SV.Media.font.roboto, 14, "OUTLINE") + frame.Range:SetTextColor(1, 1, 1, 0.75) + SV.Animate:Orbit(frame.Radar, 8, true) + frame:RegisterForDrag("LeftButton"); + frame:Hide() +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 not map then return end + 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 + +function Triangulate(unit, noMapLocation) + local distance, angle = GetFromPlayer(unit, noMapLocation) + return distance, angle +end +--[[ +########################################################## +MAIN MOVABLE TRACKER +########################################################## +]]-- +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 Rotate_Arrow = function(self, angle) + local radius, ULx, ULy, LLx, LLy, URx, URy, LRx, LRy + + radius = angle - 0.785398163 + URx = 0.5 + cos(radius) / sqrt2 + URy = 0.5 + sin(radius) / sqrt2 + -- (-1) + radius = angle + 0.785398163 + LRx = 0.5 + cos(radius) / sqrt2 + LRy = 0.5 + sin(radius) / sqrt2 + -- 1 + radius = angle + 2.35619449 + LLx = 0.5 + cos(radius) / sqrt2 + LLy = 0.5 + sin(radius) / sqrt2 + -- 3 + radius = angle + 3.92699082 + ULx = 0.5 + cos(radius) / sqrt2 + ULy = 0.5 + sin(radius) / sqrt2 + -- 5 + + self.Arrow:SetTexCoord(ULx, ULy, LLx, LLy, URx, URy, LRx, LRy); +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 + self.throttle = 4 + _ARROW:SetAlpha(0) + _SPINNER:SetVertexColor(0.8,0.1,0.1,0.15) + _BG:SetVertexColor(1,0,0,0.15) + else + self.throttle = 0.02 + local out = floor(tonumber(distance)) + self:Spin(angle) + if(out > 100) then + _ARROW:SetVertexColor(1,0.1,0.1,0.4) + _SPINNER:SetVertexColor(0.8,0.1,0.1,0.25) + _BG:SetVertexColor(0.8,0.4,0.1,0.25) + elseif(out > 40) then + _ARROW:SetVertexColor(1,0.8,0.1,0.6) + _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,0.9) + _SPINNER:SetVertexColor(0.1,0.8,0.8,0.75) + _BG:SetVertexColor(0.1,0.8,0.1,0.75) + end + _ARROW:SetAlpha(1) + _TEXT:SetText(out) + end + else + self:Hide() + end + self.elapsed = 0 + else + self.elapsed = (self.elapsed or 0) + elapsed + end +end +--[[ +########################################################## +GROUP UNIT TRACKERS +########################################################## +]]-- +local GPS_Triangulate = function(self, unit) + local available = (self.OnlyProximity == false and self.onMouseOver == false) + local distance, angle = Triangulate(unit, available) + return distance, angle +end + +local RefreshGPS = function(self, frame, template) + if(frame.GPS) then + local config = PLUGIN.db + if(config.groups) then + frame.GPS.OnlyProximity = config.proximity + local actualSz = min(frame.GPS.DefaultSize, (frame:GetHeight() - 2)) + if(not frame:IsElementEnabled("GPS")) then + frame:EnableElement("GPS") + end + else + if(frame:IsElementEnabled("GPS")) then + frame:DisableElement("GPS") + end + end + end +end + +function PLUGIN:CreateGPS(frame) + if not frame then return end + local size = 32 + + local gps = CreateFrame("Frame", nil, frame.InfoPanel) + gps:SetFrameLevel(99) + gps:Size(size, size) + gps.DefaultSize = size + gps:Point("RIGHT", frame, "RIGHT", 0, 0) + + gps.Arrow = gps:CreateTexture(nil, "OVERLAY", nil, 7) + gps.Arrow:SetTexture([[Interface\AddOns\SVUI_TrackingDevice\artwork\GPS-ARROW]]) + gps.Arrow:Size(size, size) + gps.Arrow:SetPoint("CENTER", gps, "CENTER", 0, 0) + gps.Arrow:SetVertexColor(0.1, 0.8, 0.8) + gps.Arrow:SetBlendMode("ADD") + + gps.onMouseOver = true + gps.OnlyProximity = false + + gps.Spin = Rotate_Arrow + + frame.GPS = gps + + --frame.GPS:Hide() +end +--[[ +########################################################## +CORE +########################################################## +]]-- +function PLUGIN:ReLoad() + if(not SV.db[SCHEMA].enable) then return end + + local frameSize = self.db.size or 70 + local arrowSize = frameSize * 0.5 + local fontSize = self.db.fontSize or 14 + local frame = _G["SVUI_TrackingDoodad"] + + frame:SetSize(frameSize, frameSize) + frame.Arrow:SetSize(arrowSize, arrowSize) + frame.Range:SetFont(SV.Media.font.roboto, fontSize, "OUTLINE") +end + +function PLUGIN:Load() + if(not SV.db[SCHEMA].enable) then return end + + local _TRACKER = SVUI_TrackingDoodad + local _TARGET = SVUI_Target + + if(_TRACKER) then + self.db = SV.db[SCHEMA] + + _TRACKER.Spin = Rotate_Arrow + _TRACKER:SetParent(SVUI_Target) + _TRACKER:SetScript("OnUpdate", Tracker_OnUpdate) + + self:RegisterEvent("PLAYER_TARGET_CHANGED") + end + + if(_TARGET) then + local frame = _G["SVUI_TrackingDoodad"] + frame:SetPoint("LEFT", _TARGET, "RIGHT", 2, 0) + _TARGET:HookScript("OnShow", TargetFrame_OnChange) + end + + NewHook(SV.SVUnit, "RefreshUnitLayout", RefreshGPS) + + local options = { + order = 3, + name = L["GPS"], + desc = L["Use group frame GPS elements"], + type = "toggle", + get = function() return SV.db.SVTracker.groups end, + set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); PLUGIN:UpdateLogWindow() end + } + + self:AddOption("groups", options) + + options = { + order = 4, + name = L["GPS Proximity"], + desc = L["Only point to closest low health unit"], + type = "toggle", + get = function() return SV.db.SVTracker.proximity end, + set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); PLUGIN:UpdateLogWindow() end + } + + self:AddOption("proximity", options) + + options = { + order = 5, + name = L["Font Size"], + desc = L["Set the font size of the range text"], + type = "range", + min = 6, + max = 22, + step = 1, + get = function() return SV.db.SVTracker.fontSize end, + set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); PLUGIN:UpdateLogWindow() end + } + + self:AddOption("fontSize", options) +end + +CONFIGS[SCHEMA] = { + ["enable"] = true, + ["size"] = 75, + ["fontSize"] = 12, + ["groups"] = true, + ["proximity"] = false, +} + +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..59e0b25 --- /dev/null +++ b/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.toc @@ -0,0 +1,12 @@ +## Interface: 50400 +## Author: Munglunch +## Version: 4.084 +## Title: |cffFF9900SVUI |r|cffFFEF00Tracking Device|r +## Notes: Supervillain UI [|cff9911FFRaid & Party Member Tracking|r]. +## RequiredDeps: SVUI +## LoadOnDemand: 1 +## X-oUF: oUF_Villain +## X-SVUI-Header: Tracking Device +## X-SVUI-Schema: 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..f53512c --- /dev/null +++ b/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.xml @@ -0,0 +1,46 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Script file='SVUI_TrackingDevice.lua'/> + <Script file='libs\oUF_GPS\oUF_GPS.lua'/> + + <Frame name="SVUI_TrackingDoodad" movable="true" frameStrata="DIALOG"> + <Size x="70" y="70"/> + <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="35" y="35"/> + <Anchors> + <Anchor point="CENTER" relativeTo="$parent" relativePoint="CENTER"/> + </Anchors> + </Texture> + </Layer> + <Layer level="OVERLAY"> + <Texture parentKey="Radar" setAllPoints="true" file="Interface\AddOns\SVUI_TrackingDevice\artwork\DOODAD-RADAR"/> + </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..c69bd6a 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 diff --git a/Interface/AddOns/SVUI_TrackingDevice/artwork/GPS-ARROW.blp b/Interface/AddOns/SVUI_TrackingDevice/artwork/GPS-ARROW.blp new file mode 100644 index 0000000..9fb0a32 Binary files /dev/null and b/Interface/AddOns/SVUI_TrackingDevice/artwork/GPS-ARROW.blp differ diff --git a/Interface/AddOns/SVUI_TrackingDevice/libs/oUF_GPS/oUF_GPS.lua b/Interface/AddOns/SVUI_TrackingDevice/libs/oUF_GPS/oUF_GPS.lua new file mode 100644 index 0000000..9bb1282 --- /dev/null +++ b/Interface/AddOns/SVUI_TrackingDevice/libs/oUF_GPS/oUF_GPS.lua @@ -0,0 +1,211 @@ +local oUF = oUF_Villain or oUF +assert(oUF, 'oUF not loaded') + +local PLUGIN = _G["TrackingVillain"]; + +local max, floor = math.max, math.floor; +local tinsert, tremove, tsort, twipe = table.insert, table.remove, table.sort, table.wipe; + +local playerGUID = UnitGUID("player") +local _FRAMES, _PROXIMITY, OnUpdateFrame = {}, {} +local minThrottle = 0.02 +local numArrows, inRange, GPS +--[[ +########################################################## +oUF TAGS +########################################################## +]]-- +local taggedUnits = {} +local groupTagManager = CreateFrame("Frame") +groupTagManager:RegisterEvent("GROUP_ROSTER_UPDATE") +groupTagManager:SetScript("OnEvent", function() + local group, count; + twipe(taggedUnits) + if IsInRaid() then + group = "raid" + count = GetNumGroupMembers() + elseif IsInGroup() then + group = "party" + count = GetNumGroupMembers() - 1; + taggedUnits["player"] = true + else + group = "solo" + count = 1 + end + for i = 1, count do + local realName = group..i; + if not UnitIsUnit(realName, "player") then + taggedUnits[realName] = true + end + end +end); + +oUF.Tags.OnUpdateThrottle['nearbyplayers:8'] = 0.25 +oUF.Tags.Methods["nearbyplayers:8"] = function(unit) + local unitsInRange, distance = 0; + if UnitIsConnected(unit)then + for taggedUnit, _ in pairs(taggedUnits)do + if not UnitIsUnit(unit, taggedUnit) and UnitIsConnected(taggedUnit)then + distance = Triangulate(unit, taggedUnit, true) + if distance and distance <= 8 then + unitsInRange = unitsInRange + 1 + end + end + end + end + return unitsInRange +end + +oUF.Tags.OnUpdateThrottle['nearbyplayers:10'] = 0.25 +oUF.Tags.Methods["nearbyplayers:10"] = function(unit) + local unitsInRange, distance = 0; + if UnitIsConnected(unit)then + for taggedUnit, _ in pairs(taggedUnits)do + if not UnitIsUnit(unit, taggedUnit) and UnitIsConnected(taggedUnit)then + distance = Triangulate(unit, taggedUnit, true) + if distance and distance <= 10 then + unitsInRange = unitsInRange + 1 + end + end + end + end + return unitsInRange +end + +oUF.Tags.OnUpdateThrottle['nearbyplayers:30'] = 0.25 +oUF.Tags.Methods["nearbyplayers:30"] = function(unit) + local unitsInRange, distance = 0; + if UnitIsConnected(unit)then + for taggedUnit, _ in pairs(taggedUnits)do + if not UnitIsUnit(unit, taggedUnit) and UnitIsConnected(taggedUnit)then + distance = Triangulate(unit, taggedUnit, true) + if distance and distance <= 30 then + unitsInRange = unitsInRange + 1 + end + end + end + end + return unitsInRange +end + +oUF.Tags.OnUpdateThrottle['distance'] = 0.25 +oUF.Tags.Methods["distance"] = function(unit) + if not UnitIsConnected(unit) or UnitIsUnit(unit, "player")then return "" end + local dst = Triangulate("player", unit, true) + if dst and dst > 0 then + return format("%d", dst) + end + return "" +end +--[[ +########################################################## +GPS ELEMENT +########################################################## +]]-- +local sortFunc = function(a,b) return a[1] < b[1] end + +local Update = function(self, elapsed) + if self.elapsed and self.elapsed > (self.throttle or minThrottle) then + numArrows = 0 + twipe(_PROXIMITY) + for _, object in next, _FRAMES do + if(object:IsShown()) then + GPS = object.GPS + local unit = object.unit + if(unit) then + if(GPS.PreUpdate) then GPS:PreUpdate(frame) end + + local outOfRange = GPS.outOfRange and UnitInRange(unit) or false + + if(not unit or not (UnitInParty(unit) or UnitInRaid(unit)) or UnitIsUnit(unit, "player") or not UnitIsConnected(unit) or (not GPS.OnlyProximity and ((GPS.onMouseOver and (GetMouseFocus() ~= object)) or outOfRange))) then + GPS:Hide() + else + local distance, angle = Triangulate(unit) + if not angle then + GPS:Hide() + else + if(GPS.OnlyProximity == false) then + GPS:Show() + else + GPS:Hide() + end + + if GPS.Arrow then + if(distance > 40) then + GPS.Arrow:SetVertexColor(1,0.1,0.1) + else + if(distance > 30) then + GPS.Arrow:SetVertexColor(0.4,0.8,0.1) + else + GPS.Arrow:SetVertexColor(0.1,1,0.1) + end + if(GPS.OnlyProximity and object.Health.percent and object.Health.percent < 80) then + local value = object.Health.percent + distance + _PROXIMITY[#_PROXIMITY + 1] = {value, GPS} + end + end + GPS:Spin(angle) + end + + if GPS.Text then + GPS.Text:SetText(floor(distance)) + end + + if(GPS.PostUpdate) then GPS:PostUpdate(frame, distance, angle) end + numArrows = numArrows + 1 + end + end + else + GPS:Hide() + end + end + end + + if(_PROXIMITY[1]) then + tsort(_PROXIMITY, sortFunc) + if(_PROXIMITY[1][2]) then + _PROXIMITY[1][2]:Show() + end + end + + self.elapsed = 0 + self.throttle = max(minThrottle, 0.005 * numArrows) + else + self.elapsed = (self.elapsed or 0) + elapsed + end +end + +local Enable = function(self) + local unit = self.unit + if(unit:find("raid") or unit:find("party")) then + if not self.GPS then PLUGIN:CreateGPS(self) end + tinsert(_FRAMES, self) + + if not OnUpdateFrame then + OnUpdateFrame = CreateFrame("Frame") + OnUpdateFrame:SetScript("OnUpdate", Update) + end + + OnUpdateFrame:Show() + return true + end +end + +local Disable = function(self) + local GPS = self.GPS + if GPS then + for k, frame in next, _FRAMES do + if(frame == self) then + tremove(_FRAMES, k) + GPS:Hide() + break + end + end + + if #_FRAMES == 0 and OnUpdateFrame then + OnUpdateFrame:Hide() + end + end +end + +oUF:AddElement('GPS', nil, Enable, Disable) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_TrackingDevice/libs/oUF_GPS/oUF_GPS.toc b/Interface/AddOns/SVUI_TrackingDevice/libs/oUF_GPS/oUF_GPS.toc new file mode 100644 index 0000000..cdca787 --- /dev/null +++ b/Interface/AddOns/SVUI_TrackingDevice/libs/oUF_GPS/oUF_GPS.toc @@ -0,0 +1,9 @@ +## Interface: 50001 +## Title: oUF GPS +## Notes: Adds GPS arrow to frames. +## Author: Omega1970, Munglunch +## Version: 1.00 +## X-Category: oUF +## Dependencies: oUF + +oUF_GPS.lua \ No newline at end of file diff --git a/Interface/SPELLBOOK/Professions-Book-Left.blp b/Interface/SPELLBOOK/Professions-Book-Left.blp new file mode 100644 index 0000000..d6496a0 Binary files /dev/null and b/Interface/SPELLBOOK/Professions-Book-Left.blp differ diff --git a/Interface/SPELLBOOK/Professions-Book-Right.blp b/Interface/SPELLBOOK/Professions-Book-Right.blp new file mode 100644 index 0000000..e499938 Binary files /dev/null and b/Interface/SPELLBOOK/Professions-Book-Right.blp differ diff --git a/Interface/SPELLBOOK/Spellbook-Page-1.blp b/Interface/SPELLBOOK/Spellbook-Page-1.blp new file mode 100644 index 0000000..c96119d Binary files /dev/null and b/Interface/SPELLBOOK/Spellbook-Page-1.blp differ diff --git a/Interface/SPELLBOOK/Spellbook-Page-2.blp b/Interface/SPELLBOOK/Spellbook-Page-2.blp new file mode 100644 index 0000000..97ee489 Binary files /dev/null and b/Interface/SPELLBOOK/Spellbook-Page-2.blp differ