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")