diff --git a/Interface/AddOns/SVUI/License.txt b/Interface/AddOns/SVUI/License.txt index a1eb750..5bd9961 100644 --- a/Interface/AddOns/SVUI/License.txt +++ b/Interface/AddOns/SVUI/License.txt @@ -35,4 +35,4 @@ the copyright holders. You can write Munglunch at Wowinterface.com for reporting abuse / bugs. You can contact Tukz or Elv at Tukui.org for details regarding -grants allowed for this license. \ No newline at end of file +grants allowed for their respective licenses. \ No newline at end of file diff --git a/Interface/AddOns/SVUI/SVUI.lua b/Interface/AddOns/SVUI/SVUI.lua index cd0fdcb..1112741 100644 --- a/Interface/AddOns/SVUI/SVUI.lua +++ b/Interface/AddOns/SVUI/SVUI.lua @@ -39,6 +39,7 @@ local tostring = _G.tostring; local error = _G.error; local getmetatable = _G.getmetatable; local setmetatable = _G.setmetatable; +local assert = assert; local string = _G.string; local math = _G.math; local table = _G.table; @@ -52,55 +53,18 @@ local twipe, tsort, tconcat = table.wipe, table.sort, table.concat; --[[ GET THE REGISTRY LIB ]]-- -local LibRegistry = LibStub("LibSystemRegistry-1.0") +local SVLib = LibSuperVillain; --[[ LOCALS ]]-- local callbacks = {}; local numCallbacks = 0; -local playerClass = select(2,UnitClass("player")); +local playerClass = select(2, UnitClass("player")); local actualWidth, actualHeight = UIParent:GetSize() ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- - -function enforce(condition, ...) - if not condition then - if next({...}) then - local fn = function (...) return(string.format(...)) end - local s,r = pcall(fn, ...) - if s then - error("Error!: " .. r, 2) - end - end - error("Error!", 2) - end -end -local assert = enforce; - --[[ CLASS COLOR LOCALS ]]-- -local function formatValueString(text) - if "string" == type(text) then - text = gsub(text,"\n","\\n") - if match(gsub(text,"[^'\"]",""),'^"+$') then - return "'"..text.."'"; - else - return '"'..gsub(text,'"','\\"')..'"'; - end - else - return tostring(text); - 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 - 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 @@ -178,77 +142,44 @@ do classes = nil end ---[[ APPENDED LUA METHODS ]]-- - -function math.parsefloat(value,decimal) - if decimal and decimal > 0 then - local calc1 = 10 ^ decimal; - local calc2 = (value * calc1) + 0.5; - return floor(calc2) / calc1 - end - return floor(value + 0.5) -end +--[[ CORE ENGINE CONSTRUCT ]]-- -function table.dump(targetTable) - local dumpTable = {}; - local dumpCheck = {}; - for key,value in ipairs(targetTable) do - tinsert(dumpTable, formatValueString(value)); - dumpCheck[key] = true; - end - for key,value in pairs(targetTable) do - if not dumpCheck[key] then - tinsert(dumpTable, "\n "..formatKeyString(key).." = "..formatValueString(value)); - end - end - local output = tconcat(dumpTable, ", "); - return "{ "..output.." }"; -end +local messagePattern = "|cffFF2F00%s:|r"; +local debugPattern = "|cffFF2F00%s|r [|cff992FFF%s|r]|cffFF2F00:|r"; +local errorPattern = "|cffff0000Error -- |r|cffff9900Required addon '|r|cffffff00%s|r|cffff9900' is %s.|r" -function table.copy(targetTable,deepCopy,mergeTable) - mergeTable = mergeTable or {}; - if targetTable==nil then return nil end - if mergeTable[targetTable] then return mergeTable[targetTable] end - local replacementTable = {} - for key,value in pairs(targetTable)do - if deepCopy and type(value) == "table" then - replacementTable[key] = table.copy(value, deepCopy, mergeTable) - else - replacementTable[key] = value - end - end - setmetatable(replacementTable, table.copy(getmetatable(targetTable), deepCopy, mergeTable)) - mergeTable[targetTable] = replacementTable; - return replacementTable +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 -function string.trim(this) - return this:find('^%s*$') and '' or this:match('^%s*(.*%S)') -end +local Core_DeadFunction = function() return end -function string.color(this, color) - return ("|cff%s%s|r"):format(color, this) +local Core_StaticPopup_Show = function(self, arg) + if arg == "ADDON_ACTION_FORBIDDEN" then + StaticPopup_Hide(arg) + end end -function string.link(this, prefix, text, color) - text = tostring(text) - local colorstring = tostring(this):color(color or "ffffff") - return ("|H%s:%s|h%s|h"):format(prefix, text, colorstring) +local Core_Debugger = function(self, msg) + if(not self.DebugMode) then return end + local outbound = (debugPattern):format(self.NameID, "DEBUG") + _sendmessage(msg, outbound) end -function string.explode(str, delim) - local res = { } - local pattern = string.format("([^%s]+)%s()", delim, delim) - while (true) do - line, pos = str:match(pattern, pos) - if line == nil then break end - table.insert(res, line) - end - return res +local Core_AddonMessage = function(self, msg) + local outbound = (messagePattern):format(self.NameID) + _sendmessage(msg, outbound) end ---[[ CORE ENGINE CONSTRUCT ]]-- - local Core_ResetAllUI = function(self, confirmed) if InCombatLockdown()then SendAddonMessage(ERR_NOT_IN_COMBAT) @@ -270,8 +201,14 @@ local Core_ResetUI = function(self, confirmed) self:StaticPopup_Show('RESETMOVERS_CHECK') return end - self:ResetMovables() -end + self.Mentalo:Reset() +end + +local Core_ImportProfile = function(self, key) + self.SystemAlert["COPY_PROFILE_PROMPT"].text = "Are you sure you want to copy the profile '" .. key .. "'?" + self.SystemAlert["COPY_PROFILE_PROMPT"].OnAccept = function() SVLib:ImportDatabase(key) end + self:StaticPopup_Show("COPY_PROFILE_PROMPT") +end local Core_ToggleConfig = function(self) if InCombatLockdown() then @@ -279,22 +216,23 @@ local Core_ToggleConfig = function(self) self.UIParent:RegisterEvent('PLAYER_REGEN_ENABLED') return end - if not IsAddOnLoaded("SVUI_ConfigOMatic") then - local _,_,_,_,_,state = GetAddOnInfo("SVUI_ConfigOMatic") + if not IsAddOnLoaded(self.ConfigID) then + local _,_,_,_,_,state = GetAddOnInfo(self.ConfigID) if state ~= "MISSING" and state ~= "DISABLED" then - LoadAddOn("SVUI_ConfigOMatic") - local config_version = GetAddOnMetadata("SVUI_ConfigOMatic", "Version") + LoadAddOn(self.ConfigID) + local config_version = GetAddOnMetadata(self.ConfigID, "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") + else + local errorMessage = (errorPattern):format(self.ConfigID, state) + self:AddonMessage(errorMessage) return end end local aceConfig = LibStub("AceConfigDialog-3.0") - local switch = not aceConfig.OpenFrames["SVUI"] and "Open" or "Close" - aceConfig[switch](aceConfig, "SVUI") + local switch = not aceConfig.OpenFrames[self.NameID] and "Open" or "Close" + aceConfig[switch](aceConfig, self.NameID) GameTooltip:Hide() end @@ -319,13 +257,13 @@ end --[[ INITIALIZE THE CORE OBJECT ]]-- -local SVUI = LibRegistry:InitializeCore() +-- We have to send the names of our three SavedVariables files since the WoW API +-- has no method for parsing them in LUA. +local SVUI = SVLib:NewCore("SVUI_Global", "SVUI_Profile", "SVUI_Cache") + +SVUI.ConfigID = "SVUI_ConfigOMatic"; -SVUI.Snap = {} SVUI.Media = {} -SVUI.DisplayAudit = {} -SVUI.DynamicOptions = {} -SVUI.Dispellable = {} SVUI.class = playerClass SVUI.ClassRole = "" @@ -337,10 +275,15 @@ SVUI.ActualWidth = actualWidth SVUI.yScreenArea = (actualHeight * 0.33) SVUI.xScreenArea = (actualWidth * 0.33) +SVUI.fubar = Core_DeadFunction SVUI.ResetAllUI = Core_ResetAllUI SVUI.ResetUI = Core_ResetUI SVUI.ToggleConfig = Core_ToggleConfig SVUI.TaintHandler = Core_TaintHandler +SVUI.ImportProfile = Core_ImportProfile +SVUI.AddonMessage = Core_AddonMessage +SVUI.Debugger = Core_Debugger +SVUI.StaticPopup_Show = Core_StaticPopup_Show --[[ UTILITY FRAMES ]]-- @@ -348,7 +291,6 @@ SVUI.UIParent = CreateFrame("Frame", "SVUIParent", UIParent); SVUI.UIParent:SetFrameLevel(UIParent:GetFrameLevel()); SVUI.UIParent:SetPoint("CENTER", UIParent, "CENTER"); SVUI.UIParent:SetSize(UIParent:GetSize()); -SVUI.Snap[1] = SVUI.UIParent; SVUI.Cloaked = CreateFrame("Frame", nil, UIParent); SVUI.Cloaked:Hide(); @@ -381,7 +323,7 @@ SVUI.Options = { active = { order = 1, type = "description", - name = function() return LibRegistry:GetPlugins() end + name = function() return SVLib:GetPlugins() end } } }, diff --git a/Interface/AddOns/SVUI/SVUI.toc b/Interface/AddOns/SVUI/SVUI.toc index 4e786df..4e5264d 100644 --- a/Interface/AddOns/SVUI/SVUI.toc +++ b/Interface/AddOns/SVUI/SVUI.toc @@ -1,11 +1,13 @@ ## Interface: 60000 ## Author: Munglunch -## Version: 4.4 +## Version: 4.8 ## Title: |cffFF9900SVUI|r ## Notes: Supervillain UI [|cff9911FFCore Framework|r]. ## SavedVariables: SVUI_Global ## SavedVariablesPerCharacter: SVUI_Profile, SVUI_Cache ## OptionalDeps: Blizzard_DebugTools, Blizzard_PetJournal, SharedMedia +## X-SVUI-Header: SuperVillain UI +## X-SVUI-Schema: Core ## 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 3c8071d..4a6cce4 100644 --- a/Interface/AddOns/SVUI/SVUI.xml +++ b/Interface/AddOns/SVUI/SVUI.xml @@ -1,9 +1,6 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> <Include file="libs\libs.xml"/> - <Include file="xml\system.xml"/> - - <Script file="SVUI.lua"/> <Script file="language\english_ui.lua"/> <Script file="language\italian_ui.lua"/> @@ -16,7 +13,14 @@ <Script file="language\chinese_ui.lua"/> <Script file="language\portuguese_ui.lua"/> - <Script file="system\database.lua"/> + <Include file="xml\system.xml"/> + + <Script file="SVUI.lua"/> + + <Script file="setup\configs.lua"/> + <Script file="setup\installer.lua"/> + <Script file="setup\presets.lua"/> + <Script file="system\media.lua"/> <Script file="system\utilities.lua"/> <Script file="system\animate.lua"/> @@ -25,18 +29,18 @@ <Script file="system\timers.lua"/> <Script file="system\slash.lua"/> <Script file="system\alerts.lua"/> - <Include file="system\mentalo.xml"/> - <Script file="system\setup.lua"/> + <Script file="system\moveable.lua"/> + <Script file="system\mentalo.lua"/> <Include file="packages\stats\SVStats.xml"/> <Script file="packages\dock\SVDock.lua"/> <Include file="packages\aura\SVAura.xml"/> + <Script file="packages\map\SVMap.lua"/> <Include file="packages\plates\SVPlate.xml"/> <Script file="packages\tip\SVTip.lua"/> <Script file="packages\actionbar\SVBar.lua"/> <Script file="packages\actionbar\KeyBind.lua"/> <Include file="packages\unit\SVUnit.xml"/> - <Script file="packages\map\SVMap.lua"/> <Script file="packages\chat\SVChat.lua"/> <Include file="packages\bag\SVBag.xml"/> <Script file="packages\override\SVOverride.lua"/> @@ -50,6 +54,7 @@ <Script file="scripts\raid.lua"/> <Script file="scripts\reactions.lua"/> <Script file="scripts\spellbind.lua"/> + <Script file="scripts\ego.lua"/> <Script file="system\load.lua"/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/assets/artwork/Icons/CLOSE-BUTTON.blp b/Interface/AddOns/SVUI/assets/artwork/Icons/CLOSE-BUTTON.blp index faf517b..ba31237 100644 Binary files a/Interface/AddOns/SVUI/assets/artwork/Icons/CLOSE-BUTTON.blp and b/Interface/AddOns/SVUI/assets/artwork/Icons/CLOSE-BUTTON.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Icons/MOVE-DOWN.blp b/Interface/AddOns/SVUI/assets/artwork/Icons/MOVE-DOWN.blp new file mode 100644 index 0000000..6ffc37a Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Icons/MOVE-DOWN.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Icons/MOVE-LEFT.blp b/Interface/AddOns/SVUI/assets/artwork/Icons/MOVE-LEFT.blp new file mode 100644 index 0000000..4b2dd74 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Icons/MOVE-LEFT.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Icons/MOVE-RIGHT.blp b/Interface/AddOns/SVUI/assets/artwork/Icons/MOVE-RIGHT.blp new file mode 100644 index 0000000..c078623 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Icons/MOVE-RIGHT.blp differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Icons/MOVE-UP.blp b/Interface/AddOns/SVUI/assets/artwork/Icons/MOVE-UP.blp new file mode 100644 index 0000000..721bb76 Binary files /dev/null and b/Interface/AddOns/SVUI/assets/artwork/Icons/MOVE-UP.blp differ diff --git a/Interface/AddOns/SVUI/docs/configs.lua b/Interface/AddOns/SVUI/docs/configs.lua new file mode 100644 index 0000000..b2409d8 --- /dev/null +++ b/Interface/AddOns/SVUI/docs/configs.lua @@ -0,0 +1,66 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## + /$$$$$$ /$$$$$$ /$$ /$$ /$$$$$$$$/$$$$$$ /$$$$$$ /$$$$$$ # + /$$__ $$ /$$__ $$| $$$ | $$| $$_____/_ $$_/ /$$__ $$ /$$__ $$ # +| $$ \__/| $$ \ $$| $$$$| $$| $$ | $$ | $$ \__/| $$ \__/ # +| $$ | $$ | $$| $$ $$ $$| $$$$$ | $$ | $$ /$$$$| $$$$$$ # +| $$ | $$ | $$| $$ $$$$| $$__/ | $$ | $$|_ $$ \____ $$ # +| $$ $$| $$ | $$| $$\ $$$| $$ | $$ | $$ \ $$ /$$ \ $$ # +| $$$$$$/| $$$$$$/| $$ \ $$| $$ /$$$$$$| $$$$$$/| $$$$$$/ # + \______/ \______/ |__/ \__/|__/ |______/ \______/ \______/ # +############################################################################## +]]-- + +--[[ + + The "configs" property is the default (also the backup) of ALL usable database entries. + When the addon core is initialized, a "db" property is created using a copy of "configs". + + When configs are set under their own index (ie.. SV.configs["Shiznit"]) AND a module (package, plugin ...etc) + has a schema (see NOTE) of the same name, then that index is used to set + the module's own "db" property using a pointer reference linking to the core database location. + + Package configs should be set in the primary config file (configs/configs.lua) since they are + treated and loaded as internal entities. + + For new packages (not already defined in my default configs) you will need to know the + associated schema name specific to that package. + + Just add the new package configs to the BOTTOM of the config file like this: + +]]-- + +-- SV and SV.configs will have already been defined +local Schema = "SumFukinPackage" +SV.configs[Schema] = { SumFukinValue = true } + +--[[ + + When adding plugins to the collective, be sure to set respective entries BEFORE loading, + as the same process takes place for externally connected addons. + + Plugin configs can be set like this: + +]]-- + +local SV = _G["SVUI"] +local Schema = _G["SumFukinPlugin"].Schema -- Get the already assigned schema name +SV.configs[Schema] = { SumFukinValue = true } + +--[[ + + NOTE: Schema and Modules are explained in their respective documents + +]]-- \ No newline at end of file diff --git a/Interface/AddOns/SVUI/docs/schema.lua b/Interface/AddOns/SVUI/docs/schema.lua new file mode 100644 index 0000000..61dffa4 --- /dev/null +++ b/Interface/AddOns/SVUI/docs/schema.lua @@ -0,0 +1,116 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## + /$$$$$$ /$$$$$$ /$$ /$$ /$$$$$$$$ /$$ /$$ /$$$$$$ # + /$$__ $$ /$$__ $$| $$ | $$| $$_____/| $$$ /$$$ /$$__ $$ # +| $$ \__/| $$ \__/| $$ | $$| $$ | $$$$ /$$$$| $$ \ $$ # +| $$$$$$ | $$ | $$$$$$$$| $$$$$ | $$ $$/$$ $$| $$$$$$$$ # + \____ $$| $$ | $$__ $$| $$__/ | $$ $$$| $$| $$__ $$ # + /$$ \ $$| $$ $$| $$ | $$| $$ | $$\ $ | $$| $$ | $$ # +| $$$$$$/| $$$$$$/| $$ | $$| $$$$$$$$| $$ \/ | $$| $$ | $$ # + \______/ \______/ |__/ |__/|________/|__/ |__/|__/ |__/ # +############################################################################## +]]-- + +--[[ + + Schema is a property and concept used to help dynamically define database indexes. + The main purpose for its creation was to provide a way to generate useable config + variables for any plugin, including those that are LoadOnDemand! + + To the best of my knowledge, this has never been done before (/flex)! + + The schema convention is utilized by the "LibSuperVillain" library to ensure + proper organization of our various addon configs (see NOTE) + + For Packages: + + You have to define the modules schema when you send its object to the library + + Here is an example: + +]]-- + +local lib = LibSuperVillain +local PKG = {}; + +--Here you would build your package object, then... + +lib:NewPackage(PKG, "SumFukinPackage") + +--So now you can get the schema name like this: + +local Schema = PKG.Schema + +--[[ + + For Plugins: + + You will set the schema in the plugins .toc file using meta-data fields + prefixed with "X" to indicate its a custom entry, the SuperVillain indicator "SVUI", + and finally the type of entry it is + + (there are two possibilities at the time of this writing. "Header" and "Schema") + + so it will end up looking like this: + X-SVUI-Header + + or this: + X-SVUI-Schema + + Your toc should end up looking something like this: + + ~(SumFukinPlugin.toc) + + ## Interface: 60000 + ## Author: SumFukinDude + ## Version: 1.0 + ## X-SVUI-Header: Some Fukin Addon + ## X-SVUI-Schema: SumFukinSchema + + + Having defined and initialized all requirements at this point, your database will now + have named references linking to this object by schema. +]]-- + +--[[ + + LoadOnDemand: + + When schema is defined for plugins that are NOT loaded by default, the library will + be able to parse all toc files that contain an "X-SVUI-Schema" property and generate + a database entry as well as a config option so that we can manipulate that plugin and + save our changes. + + The benefit here is this: + + Let's use SVUI_CraftOMatic for example. If by default this LOD addon is Disabled, we can't read + on any lua code inside the addon. This prevents the ability to set config variables and therefore + build config options. Before we would have had to add a button to allow the player to click and "Enable" it. + This is fine but what if we also want to make the choice to keep it enabled every time we log in? + That would not have worked since your options would not be loaded UNTIL you clicked the enable button! + Using schema however, we can still create our configs + AND set the data entry from saved variables (if they exist in the file) + which allows our core to not only detect its existence but also see if it was previously enabled + and if so then go ahead and load/enable the addon. + + BOOM!! + +]]-- + +--[[ + + NOTE: Configs and Modules are explained in their respective documents + +]]-- \ 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 2360e49..6ce4bc7 100644 --- a/Interface/AddOns/SVUI/language/chinese_ui.lua +++ b/Interface/AddOns/SVUI/language/chinese_ui.lua @@ -1,5 +1,4 @@ -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale:SetLocaleData("zhCN"); +local L = LibSuperVillain:Lang("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 424a8d4..fdff64a 100644 --- a/Interface/AddOns/SVUI/language/english_ui.lua +++ b/Interface/AddOns/SVUI/language/english_ui.lua @@ -1,5 +1,4 @@ -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale:SetLocaleData("enUS", true); +local L = LibSuperVillain:Lang("enUS", true); if not L then return; end --[[REACTION TEXTS]]-- L[" is drinking."] = true; @@ -373,8 +372,8 @@ L["FadeIn Delay"]=true; L["The time to wait before fading the minimap back in after combat hide. (0 = Disabled)"]=true; L["Minimap Button Bar"]=true; L["Style Buttons"]=true; -L["SVStyle the minimap buttons in SV UI style."]=true; -L["Style Style"]=true; +L["Customize the minimap buttons in SVUI style."]=true; +L["SVUI Style"]=true; L["Change settings for how the minimap buttons are styled."]=true; L["The size of the minimap buttons."]=true; L["No Anchor Bar"]=true; diff --git a/Interface/AddOns/SVUI/language/french_ui.lua b/Interface/AddOns/SVUI/language/french_ui.lua index 7e0c622..5767ed6 100644 --- a/Interface/AddOns/SVUI/language/french_ui.lua +++ b/Interface/AddOns/SVUI/language/french_ui.lua @@ -1,5 +1,4 @@ -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale:SetLocaleData("frFR"); +local L = LibSuperVillain:Lang("frFR"); if not L then return; end --[[REACTION TEXTS]]-- L[" is drinking."] = true; @@ -469,8 +468,8 @@ L["Hide minimap while in combat."]="Cacher la minicarte quand vous êtes en comb L["FadeIn Delay"]="Délais d'estompage" L["The time to wait before fading the minimap back in after combat hide. (0 = Disabled)"]="Le temps à attendre avant que la minicarte s'estompe avec que le combat ait commencé. (0 = désactié)" L["Style Buttons"]="Boutons Style" -L["SVStyle the minimap buttons in SV UI style."]="Habillez les boutons de la minicarte avec le style SVUI." -L["Style Style"]="Style Style" +L["Customize the minimap buttons in SVUI style."]="Habillez les boutons de la minicarte avec le style SVUI." +L["SVUI Style"]="SVUI Style" L["Change settings for how the minimap buttons are styled."]="Change les réglages pour comment sont habillés les boutons." L["The size of the minimap buttons."]="Taille des boutons de la minicarte." L["No Anchor Bar"]="Ne pas ancré à une Barre" diff --git a/Interface/AddOns/SVUI/language/german_ui.lua b/Interface/AddOns/SVUI/language/german_ui.lua index 479db1c..1b597e7 100644 --- a/Interface/AddOns/SVUI/language/german_ui.lua +++ b/Interface/AddOns/SVUI/language/german_ui.lua @@ -1,5 +1,4 @@ -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale:SetLocaleData("deDE"); +local L = LibSuperVillain:Lang("deDE"); if not L then return end --[[REACTION TEXTS]]-- L[" is drinking."] = true; @@ -468,8 +467,8 @@ L["Hide minimap while in combat."]="Ausblenden der Minimap während des Kampfes. L["FadeIn Delay"]="Einblendungsverzögerung" L["The time to wait before fading the minimap back in after combat hide. (0 = Disabled)"]="Die Zeit vor dem wieder Einblenden der Minimap nach dem Kampf. (0 = deaktiviert)" L["Style Buttons"]="Style Buttons" -L["SVStyle the minimap buttons in SV UI style."]='Stylene die Minimap-Buttons im SVUI-Stil.' -L["Style Style"]="Style Stil" +L["Customize the minimap buttons in SVUI style."]='Stylene die Minimap-Buttons im SVUI-Stil.' +L["SVUI Style"]="Style Stil" L["Change settings for how the minimap buttons are styled."]="Ändern der Einstellungen, wie die Minimap-Buttons gestylent werden." L["The size of the minimap buttons."]="Die Größe der Minimap-Buttons." L["No Anchor Bar"]="Keine Ankerleiste" diff --git a/Interface/AddOns/SVUI/language/italian_ui.lua b/Interface/AddOns/SVUI/language/italian_ui.lua index 2b7f338..09c14a2 100644 --- a/Interface/AddOns/SVUI/language/italian_ui.lua +++ b/Interface/AddOns/SVUI/language/italian_ui.lua @@ -1,5 +1,4 @@ -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale:SetLocaleData("itIT"); +local L = LibSuperVillain:Lang("itIT"); if not L then return; end --[[REACTION TEXTS]]-- L[" is drinking."] = true; @@ -470,8 +469,8 @@ L["FadeIn Delay"]=true; L["The time to wait before fading the minimap back in after combat hide. (0 = Disabled)"]=true; L["Minimap Button Bar"]=true; L["Style Buttons"]=true; -L["SVStyle the minimap buttons in SV UI style."]=true; -L["Style Style"]=true; +L["Customize the minimap buttons in SVUI style."]=true; +L["SVUI Style"]=true; L["Change settings for how the minimap buttons are styled."]=true; L["The size of the minimap buttons."]=true; L["No Anchor Bar"]=true; diff --git a/Interface/AddOns/SVUI/language/korean_ui.lua b/Interface/AddOns/SVUI/language/korean_ui.lua index b6d555c..5fb983b 100644 --- a/Interface/AddOns/SVUI/language/korean_ui.lua +++ b/Interface/AddOns/SVUI/language/korean_ui.lua @@ -1,5 +1,4 @@ -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale:SetLocaleData("koKR"); +local L = LibSuperVillain:Lang("koKR"); if not L then return; end --[[REACTION TEXTS]]-- L[" is drinking."] = true; @@ -470,8 +469,8 @@ L["FadeIn Delay"]=true; L["The time to wait before fading the minimap back in after combat hide. (0 = Disabled)"]=true; L["Minimap Button Bar"]=true; L["Style Buttons"]=true; -L["SVStyle the minimap buttons in SV UI style."]=true; -L["Style Style"]=true; +L["Customize the minimap buttons in SVUI style."]=true; +L["SVUI Style"]=true; L["Change settings for how the minimap buttons are styled."]=true; L["The size of the minimap buttons."]=true; L["No Anchor Bar"]=true; diff --git a/Interface/AddOns/SVUI/language/portuguese_ui.lua b/Interface/AddOns/SVUI/language/portuguese_ui.lua index 44d9bff..2b55f4c 100644 --- a/Interface/AddOns/SVUI/language/portuguese_ui.lua +++ b/Interface/AddOns/SVUI/language/portuguese_ui.lua @@ -1,5 +1,4 @@ -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale:SetLocaleData("ptBR"); +local L = LibSuperVillain:Lang("ptBR"); if not L then return; end --[[REACTION TEXTS]]-- L[" is drinking."] = true; @@ -469,8 +468,8 @@ L["Hide minimap while in combat."]=true; L["FadeIn Delay"]=true; L["The time to wait before fading the minimap back in after combat hide. (0 = Disabled)"]=true; L["Style Buttons"]="Customizar Botões" -L["SVStyle the minimap buttons in SV UI style."]="Customiza os botões do minimapa no estilo do SV UI." -L["Style Style"]="Estilo de Customização" +L["Customize the minimap buttons in SVUI style."]="Customiza os botões do minimapa no estilo do SVUI." +L["SVUI Style"]="Estilo de Customização" L["Change settings for how the minimap buttons are styled."]="Mudar definições de como os botões do minimapa são customizados." L["The size of the minimap buttons."]="O tamanho dos botões do minimapa." L["No Anchor Bar"]="Sem Ancora de Barra" diff --git a/Interface/AddOns/SVUI/language/russian_ui.lua b/Interface/AddOns/SVUI/language/russian_ui.lua index 882b3bb..78a0df3 100644 --- a/Interface/AddOns/SVUI/language/russian_ui.lua +++ b/Interface/AddOns/SVUI/language/russian_ui.lua @@ -1,5 +1,4 @@ -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale:SetLocaleData("ruRU"); +local L = LibSuperVillain:Lang("ruRU"); if not L then return; end --[[REACTION TEXTS]]-- L[" is drinking."] = true; @@ -470,8 +469,8 @@ L["FadeIn Delay"]=true; L["The time to wait before fading the minimap back in after combat hide. (0 = Disabled)"]=true; L["Minimap Button Bar"]=true; L["Style Buttons"]=true; -L["SVStyle the minimap buttons in SV UI style."]=true; -L["Style Style"]=true; +L["Customize the minimap buttons in SVUI style."]=true; +L["SVUI Style"]=true; L["Change settings for how the minimap buttons are styled."]=true; L["The size of the minimap buttons."]=true; L["No Anchor Bar"]=true; diff --git a/Interface/AddOns/SVUI/language/spanish_ui.lua b/Interface/AddOns/SVUI/language/spanish_ui.lua index 7766dd4..64a3e0c 100644 --- a/Interface/AddOns/SVUI/language/spanish_ui.lua +++ b/Interface/AddOns/SVUI/language/spanish_ui.lua @@ -1,7 +1,6 @@ -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale:SetLocaleData("esES"); +local L = LibSuperVillain:Lang("esES"); if not L then - L = LibLocale:SetLocaleData("esMX") + L = LibSuperVillain:Lang("esMX") end if not L then return; end --[[REACTION TEXTS]]-- @@ -473,8 +472,8 @@ L["FadeIn Delay"]=true; L["The time to wait before fading the minimap back in after combat hide. (0 = Disabled)"]=true; L["Minimap Button Bar"]=true; L["Style Buttons"]=true; -L["SVStyle the minimap buttons in SV UI style."]=true; -L["Style Style"]=true; +L["Customize the minimap buttons in SVUI style."]=true; +L["SVUI Style"]=true; L["Change settings for how the minimap buttons are styled."]=true; L["The size of the minimap buttons."]=true; L["No Anchor Bar"]=true; diff --git a/Interface/AddOns/SVUI/language/taiwanese_ui.lua b/Interface/AddOns/SVUI/language/taiwanese_ui.lua index 8048d63..759aebe 100644 --- a/Interface/AddOns/SVUI/language/taiwanese_ui.lua +++ b/Interface/AddOns/SVUI/language/taiwanese_ui.lua @@ -1,5 +1,4 @@ -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale:SetLocaleData("zhTW"); +local L = LibSuperVillain:Lang("zhTW"); if not L then return; end --[[REACTION TEXTS]]-- L[" is drinking."] = true; @@ -470,8 +469,8 @@ L["FadeIn Delay"]="隱藏延遲" L["The time to wait before fading the minimap back in after combat hide. (0 = Disabled)"]="戰鬥開始後隱藏小地圖前的延遲時間 (0=停用)" L["Minimap Button Bar"]="小地圖按鈕整合列" L["Style Buttons"]="美化按鈕" -L["SVStyle the minimap buttons in SV UI style."]="將小地圖圖標美化成SVUI風格." -L["Style Style"]="美化風格" +L["Customize the minimap buttons in SVUI style."]="將小地圖圖標美化成SVUI風格." +L["SVUI Style"]="美化風格" L["Change settings for how the minimap buttons are styled."]="改變美化設定." L["The size of the minimap buttons."]="小地圖圖標尺寸." L["No Anchor Bar"]="沒有錨點" diff --git a/Interface/AddOns/SVUI/libs/LibLocale-1.0/LibLocale-1.0.lua b/Interface/AddOns/SVUI/libs/LibLocale-1.0/LibLocale-1.0.lua deleted file mode 100644 index a64ec44..0000000 --- a/Interface/AddOns/SVUI/libs/LibLocale-1.0/LibLocale-1.0.lua +++ /dev/null @@ -1,66 +0,0 @@ ---[[ GLOBALS ]]-- - -local _G = _G; -local rawset = _G.rawset; -local rawget = _G.rawget; -local getmetatable = _G.getmetatable; -local setmetatable = _G.setmetatable; - -local MAJOR, MINOR = "LibLocale", 1 -local LibLocale = _G[MAJOR] - -if not LibLocale or LibLocale.minor < MINOR then - LibLocale = LibLocale or {} - _G[MAJOR] = LibLocale - LibLocale.minor = MINOR - - local rootstring = function(self) return self.___addonName end - - 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); - - function LibLocale:SetLocaleData(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 - - function LibLocale:GetLocaleData() - return Localization - end - - setmetatable(LibLocale, { __call = LibLocale.GetLocaleData }) -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/LibSuperVillain-1.0.lua b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/LibSuperVillain-1.0.lua new file mode 100644 index 0000000..3c27e64 --- /dev/null +++ b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/LibSuperVillain-1.0.lua @@ -0,0 +1,1158 @@ +--[[ + /$$$$$$ /$$ /$$ /$$$$$$$ /$$$$$$$$ /$$$$$$$ + /$$__ $$| $$ | $$| $$__ $$| $$_____/| $$__ $$ +| $$ \__/| $$ | $$| $$ \ $$| $$ | $$ \ $$ +| $$$$$$ | $$ | $$| $$$$$$$/| $$$$$ | $$$$$$$/ + \____ $$| $$ | $$| $$____/ | $$__/ | $$__ $$ + /$$ \ $$| $$ | $$| $$ | $$ | $$ \ $$ +| $$$$$$/| $$$$$$/| $$ | $$$$$$$$| $$ | $$ + \______/ \______/ |__/ |________/|__/ |__/ + /$$ /$$ /$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$ /$$ /$$ +| $$ | $$|_ $$_/| $$ | $$ /$$__ $$|_ $$_/| $$$ | $$ +| $$ | $$ | $$ | $$ | $$ | $$ \ $$ | $$ | $$$$| $$ +| $$ / $$/ | $$ | $$ | $$ | $$$$$$$$ | $$ | $$ $$ $$ + \ $$ $$/ | $$ | $$ | $$ | $$__ $$ | $$ | $$ $$$$ + \ $$$/ | $$ | $$ | $$ | $$ | $$ | $$ | $$\ $$$ + \ $/ /$$$$$$| $$$$$$$$| $$$$$$$$| $$ | $$ /$$$$$$| $$ \ $$ + \_/ |______/|________/|________/|__/ |__/|______/|__/ \__/ + + +LibSuperVillain is a library used to manage localization, packages, scripts and data embedded +into the SVUI core addon. + +It's main purpose is to keep all methods and logic needed to properly keep +core add-ins functioning outside of the core object. +--]] + +--[[ LOCALIZED GLOBALS ]]-- +local _G = getfenv(0); +--LUA +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local type = _G.type; +local rawset = _G.rawset; +local rawget = _G.rawget; +local tostring = _G.tostring; +local error = _G.error; +local next = _G.next; +local pcall = _G.pcall; +local getmetatable = _G.getmetatable; +local setmetatable = _G.setmetatable; +local assert = _G.assert; +--BLIZZARD +local tinsert = _G.tinsert; +local tremove = _G.tremove; +local twipe = _G.wipe; +--STRING +local string = _G.string; +local upper = string.upper; +local format = string.format; +local find = string.find; +local match = string.match; +local gsub = string.gsub; +--MATH +local math = _G.math; +local floor = math.floor +--TABLE +local table = _G.table; +local tsort = table.sort; +local tconcat = table.concat; + +--[[ LIB CONSTRUCT ]]-- +local lib = _G["LibSuperVillain"] +if not lib then + _G["LibSuperVillain"] = {} + lib = _G["LibSuperVillain"] +end + +--[[ ADDON DATA ]]-- + +local CoreName, CoreObject = ... +local AddonVersion = GetAddOnMetadata(..., "Version"); +local SchemaFromMeta = "X-" .. CoreName .. "-Schema"; +local HeaderFromMeta = "X-" .. CoreName .. "-Header"; +local InterfaceVersion = select(4, GetBuildInfo()); + +--[[ COMMON LOCAL VARS ]]-- + +local GLOBAL_FILENAME = CoreName.."_Global"; +local PROFILE_FILENAME = CoreName.."_Profile"; +local CACHE_FILENAME = CoreName.."_Cache"; +local SOURCE_KEY = 1; +local GLOBAL_SV, PROFILE_SV, CACHE_SV, PLUGINS, MODULES; +local PluginString = "" +local AllowedIndexes, LoadOnDemand = {},{}; +local Callbacks, ScriptQueue = {},{}; + +local playerClass = select(2,UnitClass("player")); + +local INFO_FORMAT = "|cffFFFF00%s|r\n |cff33FF00Version: %s|r |cff0099FFby %s|r"; + +if GetLocale() == "ruRU" then + INFO_FORMAT = "|cffFFFF00%s|r\n |cff33FF00Версия: %s|r |cff0099FFот %s|r"; +end + +--[[ LIB EVENT LISTENER ]]-- + +lib.EventManager = CreateFrame("Frame", nil) + +--[[ COMMON META METHODS ]]-- + +local rootstring = function(self) return self.NameID end + +--[[ CUSTOM LUA METHODS ]]-- + +--LOCAL HELPERS +local function formatValueString(text) + if "string" == type(text) then + text = gsub(text,"\n","\\n") + if match(gsub(text,"[^'\"]",""),'^"+$') then + return "'"..text.."'"; + else + return '"'..gsub(text,'"','\\"')..'"'; + end + else + return tostring(text); + 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 + +--APPENDED METHODS +function table.dump(targetTable) + local dumpTable = {}; + local dumpCheck = {}; + for key,value in ipairs(targetTable) do + tinsert(dumpTable, formatValueString(value)); + dumpCheck[key] = true; + end + for key,value in pairs(targetTable) do + if not dumpCheck[key] then + tinsert(dumpTable, "\n "..formatKeyString(key).." = "..formatValueString(value)); + end + end + local output = tconcat(dumpTable, ", "); + return "{ "..output.." }"; +end + +function math.parsefloat(value,decimal) + if decimal and decimal > 0 then + local calc1 = 10 ^ decimal; + local calc2 = (value * calc1) + 0.5; + return floor(calc2) / calc1 + end + return floor(value + 0.5) +end + +function table.copy(targetTable,deepCopy,mergeTable) + mergeTable = mergeTable or {}; + if targetTable==nil then return nil end + if mergeTable[targetTable] then return mergeTable[targetTable] end + local replacementTable = {} + for key,value in pairs(targetTable)do + if deepCopy and type(value) == "table" then + replacementTable[key] = table.copy(value, deepCopy, mergeTable) + else + replacementTable[key] = value + end + end + setmetatable(replacementTable, table.copy(getmetatable(targetTable), deepCopy, mergeTable)) + mergeTable[targetTable] = replacementTable; + return replacementTable +end + +function string.trim(this) + return find(this, '^%s*$') and '' or match(this, '^%s*(.*%S)') +end + +function string.color(this, color) + return format("|cff%s%s|r", color, this) +end + +function string.link(this, prefix, text, color) + text = tostring(text) + local colorstring = tostring(this):color(color or "ffffff") + return format("|H%s:%s|h%s|h", prefix, text, colorstring) +end + +function string.explode(str, delim) + local res = { } + local pattern = format("([^%s]+)%s()", delim, delim) + while (true) do + line, pos = match(str, pattern, pos) + if line == nil then break end + tinsert(res, line) + end + return res +end + +--[[ + /$$ /$$ /$$ /$$ +| $$ |__/ |__/ | $$ +| $$ /$$ /$$$$$$$ /$$$$$$ /$$ /$$ /$$ /$$$$$$$/$$$$$$ +| $$ | $$| $$__ $$ /$$__ $$| $$ | $$| $$ /$$_____/_ $$_/ +| $$ | $$| $$ \ $$| $$ \ $$| $$ | $$| $$| $$$$$$ | $$ +| $$ | $$| $$ | $$| $$ | $$| $$ | $$| $$ \____ $$ | $$ /$$ +| $$$$$$$$| $$| $$ | $$| $$$$$$$| $$$$$$/| $$ /$$$$$$$/ | $$$$/ +|________/|__/|__/ |__/ \____ $$ \______/ |__/|_______/ \___/ + /$$ \ $$ + | $$$$$$/ + \______/ + +Linguist is a simple localization component. Seriously, thats it! +--]] + +--LINGUIST HELPERS +local activeLocale + +local failsafe = function() assert(false) end + +--LINGUIST META METHODS +local metaread = { + __index = function(self, key) + rawset(self, key, key) + return key + end +} + +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 +}) + +--LINGUIST STORAGE +lib.Localization = setmetatable({}, metaread); + +--LINGUIST PUBLIC METHOD +function lib:Lang(locale, isDefault) + if(not locale) then + return self.Localization + else + 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 +end + +--[[ + /$$$$$$$ /$$ /$$ +| $$__ $$ | $$ | $$ +| $$ \ $$ /$$$$$$ /$$$$$$ /$$$$$$ | $$$$$$$ /$$$$$$ /$$$$$$$ /$$$$$$ +| $$ | $$|____ $$|_ $$_/ |____ $$| $$__ $$|____ $$ /$$_____/ /$$__ $$ +| $$ | $$ /$$$$$$$ | $$ /$$$$$$$| $$ \ $$ /$$$$$$$| $$$$$$ | $$$$$$$$ +| $$ | $$/$$__ $$ | $$ /$$/$$__ $$| $$ | $$/$$__ $$ \____ $$| $$_____/ +| $$$$$$$/ $$$$$$$ | $$$$/ $$$$$$$| $$$$$$$/ $$$$$$$ /$$$$$$$/| $$$$$$$ +|_______/ \_______/ \___/ \_______/|_______/ \_______/|_______/ \_______/ + + +DataBase is a component used to create and manage SVUI data objects. + +It's main purpose is to keep all methods and logic needed to properly maintain +valid data outside of the core object. +--]] + +--DATABASE LOCAL HELPERS +local function tablecopy(d, s, debug) + if(debug) then + print(debug) + assert(type(s) == "table", "tablecopy ERROR: source (" .. debug .. ") is not a table") + assert(type(d) == "table", "tablecopy ERROR: destination (" .. debug .. ") is not a table") + end + if(type(s) ~= "table") then return end + if(type(d) ~= "table") then return end + for k, v in pairs(s) do + local saved = rawget(d, k) + if type(v) == "table" then + if not saved then rawset(d, k, {}) end + tablecopy(d[k], v) + elseif(saved == nil or (saved and type(saved) ~= type(v))) then + rawset(d, k, v) + end + end +end + +local function tablesplice(targetTable, mergeTable) + if type(targetTable) ~= "table" then targetTable = {} end + + if type(mergeTable) == 'table' then + for key,val in pairs(mergeTable) do + if type(val) == "table" then + val = tablesplice(targetTable[key], val) + end + targetTable[key] = val + end + end + return targetTable +end + +local function importdata(s, d) + if type(d) ~= "table" then d = {} end + if type(s) == "table" then + for k,v in pairs(s) do + if type(v) == "table" then + v = importdata(v, d[k]) + end + d[k] = v + end + end + return d +end + +local function removedefaults(db, src, nometa) + if(type(src) ~= "table") then + if(db == src) then db = nil end + return + end + if(not nometa) then + setmetatable(db, nil) + end + for k,v in pairs(src) do + if type(v) == "table" and type(db[k]) == "table" then + removedefaults(db[k], v, nometa) + if next(db[k]) == nil then + db[k] = nil + end + else + if db[k] == v then + db[k] = nil + end + end + end +end + +--DATABASE META METHODS +local meta_database = { + __index = function(t, k) + if(not k or k == "") then return end + local sv = rawget(t, "data") + local dv = rawget(t, "defaults") + local src = dv and dv[k] + + if(src ~= nil) then + if(type(src) == "table") then + if(sv[k] == nil or (sv[k] ~= nil and type(sv[k]) ~= "table")) then sv[k] = {} end + tablecopy(sv[k], src) + else + if(sv[k] == nil or (sv[k] ~= nil and type(sv[k]) ~= type(src))) then sv[k] = src end + end + end + + rawset(t, k, sv[k]) + return rawget(t, k) + end, +} + +local meta_cache = { + __index = function(t, k) + if(not k or k == "") then return end + local sv = rawget(t, "data") + if(not sv[k]) then sv[k] = {} end + rawset(t, k, sv[k]) + return rawget(t, k) + end, +} + +--DATABASE PUBLIC METHODS +function lib:Remove(key) + if(GLOBAL_SV.profiles[key]) then GLOBAL_SV.profiles[key] = nil end + if(GLOBAL_SV.cache[key]) then GLOBAL_SV.cache[key] = nil end + twipe(GLOBAL_SV.profileKeys) + for k,v in pairs(GLOBAL_SV.profiles) do + GLOBAL_SV.profileKeys[k] = k + end + for k,v in pairs(GLOBAL_SV.cache) do + GLOBAL_SV.profileKeys[k] = k + end +end + +function lib:GetProfiles() + local list = GLOBAL_SV.profileKeys or {} + return list +end + +function lib:CheckProfiles() + local hasProfile = false + local list = GLOBAL_SV.profileKeys or {} + for key,_ in pairs(list) do + hasProfile = true + end + return hasProfile +end + +function lib:ImportDatabase(key) + if(not GLOBAL_SV.profiles[key]) then GLOBAL_SV.profiles[key] = {} end; + PROFILE_SV.STORED[SOURCE_KEY] = GLOBAL_SV.profiles[key] + + if(not GLOBAL_SV.cache[key]) then GLOBAL_SV.cache[key] = {} end; + CACHE_SV.STORED[SOURCE_KEY] = GLOBAL_SV.cache[key] + + ReloadUI() +end + +function lib:ExportDatabase(key) + local export, saved + + if(not GLOBAL_SV.profiles[key]) then GLOBAL_SV.profiles[key] = {} end; + export = rawget(CoreObject.db, "data"); + saved = GLOBAL_SV.profiles[key]; + tablecopy(saved, export); + + if not GLOBAL_SV.cache[key] then GLOBAL_SV.cache[key] = {} end + export = rawget(CoreObject.cache, "data") + saved = GLOBAL_SV.cache[key] + tablecopy(saved, export); + + + twipe(GLOBAL_SV.profileKeys) + for k,v in pairs(GLOBAL_SV.profiles) do + GLOBAL_SV.profileKeys[k] = k + end + for k,v in pairs(GLOBAL_SV.cache) do + GLOBAL_SV.profileKeys[k] = k + end +end + +function lib:WipeDatabase() + for k,v in pairs(PROFILE_SV.STORED[SOURCE_KEY]) do + PROFILE_SV.STORED[SOURCE_KEY][k] = nil + end +end + +function lib:WipeCache(index) + if(index) then + CACHE_SV.STORED[SOURCE_KEY][index] = nil + else + for k,v in pairs(CACHE_SV.STORED[SOURCE_KEY]) do + CACHE_SV.STORED[SOURCE_KEY][k] = nil + end + end +end + +function lib:WipeGlobal() + for k,v in pairs(GLOBAL_SV) do + GLOBAL_SV[k] = nil + end +end + +function lib:UpdateDatabase(event) + if event == "PLAYER_LOGOUT" then + local sv = rawget(CoreObject.db, "data") + local src = rawget(CoreObject.db, "defaults") + for k,v in pairs(sv) do + if(not src[k]) then + sv[k] = nil + elseif(src[k] ~= nil and (not LoadOnDemand[k])) then + removedefaults(sv[k], src[k]) + end + end + for k,v in pairs(CACHE_SV) do + if(k ~= "STORED") then + CACHE_SV[k] = nil + end + end + elseif(event == "ACTIVE_TALENT_GROUP_CHANGED") then + local LastKey = SOURCE_KEY + if(PROFILE_SV.SAFEDATA and PROFILE_SV.SAFEDATA.dualSpecEnabled) then + SOURCE_KEY = GetSpecialization() + self.EventManager:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") + + if(not SOURCE_KEY) then + SOURCE_KEY = 1 + end + + if(LastKey ~= SOURCE_KEY) then + --construct core dataset + local db = setmetatable({}, meta_database) + db.data = PROFILE_SV.STORED[SOURCE_KEY] + db.defaults = CoreObject.configs + CoreObject.db = db + + local cache = setmetatable({}, meta_cache) + cache.data = CACHE_SV.STORED[SOURCE_KEY] + CoreObject.cache = cache + + if(CoreObject.ReLoad) then + CoreObject:ReLoad() + end + + self:RefreshAll() + end + else + SOURCE_KEY = 1 + self.EventManager:UnregisterEvent("ACTIVE_TALENT_GROUP_CHANGED") + end + end +end + +function lib:GetSafeData(index) + if(index) then + return PROFILE_SV.SAFEDATA[index] + else + return PROFILE_SV.SAFEDATA + end +end + +function lib:SaveSafeData(index, value) + PROFILE_SV.SAFEDATA[index] = value +end + +function lib:CheckData(schema, key) + local file = PROFILE_SV.STORED[SOURCE_KEY][schema] + print("______" .. schema .. ".db[" .. key .. "]_____") + print(file[key]) + print("______SAVED_____") +end + +function lib:NewGlobal(index) + index = index or CoreObject.Schema + if(not GLOBAL_SV[index]) then + GLOBAL_SV[index] = {} + end + return GLOBAL_SV[index] +end + +--[[ + /$$$$$$$ /$$ /$$ +| $$__ $$ |__/ | $$ +| $$ \ $$ /$$$$$$ /$$$$$$ /$$ /$$$$$$$/$$$$$$ /$$$$$$ /$$ /$$ +| $$$$$$$/ /$$__ $$ /$$__ $$| $$ /$$_____/_ $$_/ /$$__ $$| $$ | $$ +| $$__ $$| $$$$$$$$| $$ \ $$| $$| $$$$$$ | $$ | $$ \__/| $$ | $$ +| $$ \ $$| $$_____/| $$ | $$| $$ \____ $$ | $$ /$$| $$ | $$ | $$ +| $$ | $$| $$$$$$$| $$$$$$$| $$ /$$$$$$$/ | $$$$/| $$ | $$$$$$$ +|__/ |__/ \_______/ \____ $$|__/|_______/ \___/ |__/ \____ $$ + /$$ \ $$ /$$ | $$ + | $$$$$$/ | $$$$$$/ + \______/ \______/ + +Registry is a component used to manage packages and scripts embedded +into the SVUI core addon. + +It's main purpose is to keep all methods and logic needed to properly keep +core add-ins functioning outside of the core object. +--]] + +--REGISTRY LOCAL HELPERS +local changeDBVar = function(self, value, key, sub1, sub2, sub3) + local db = CoreObject.db[self.Schema] + if((sub1 and sub2 and sub3) and (db[sub1] and db[sub1][sub2] and db[sub1][sub2][sub3])) then + db[sub1][sub2][sub3][key] = value + elseif((sub1 and sub2) and (db[sub1] and db[sub1][sub2])) then + db[sub1][sub2][key] = value + elseif(sub1 and db[sub1]) then + db[sub1][key] = value + else + db[key] = value + end + + 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] + elseif(not fn and self[eventname]) then + fn = self[eventname] + end + self.___eventframe[eventname] = fn + end + + self.___eventframe:RegisterEvent(eventname) +end + +local unregisterEvent = function(self, event, ...) + if(self.___eventframe) then + self.___eventframe:UnregisterEvent(event) + end +end + +local innerOnUpdate = function(self, elapsed) + if self.elapsed and self.elapsed > (self.throttle) then + local obj = self.module + local callbacks = self.callbacks + + for name, fn in pairs(callbacks) do + local _, error = pcall(fn, obj) + if(error and CoreObject.Debugging) then + print(error) + end + end + + self.elapsed = 0 + else + self.elapsed = (self.elapsed or 0) + elapsed + end +end + +local registerUpdate = function(self, updatefunc, throttle) + if not self.___updateframe then + self.___updateframe = CreateFrame("Frame", nil); + self.___updateframe.module = self; + self.___updateframe.callbacks = {}; + self.___updateframe.elapsed = 0; + self.___updateframe.throttle = throttle or 0.2; + end + + if(updatefunc and type(updatefunc) == "string" and self[updatefunc]) then + self.___updateframe.callbacks[updatefunc] = self[updatefunc] + end + + self.___updateframe:SetScript("OnUpdate", innerOnUpdate) +end + +local unregisterUpdate = function(self, updatefunc) + if(updatefunc and type(updatefunc) == "string" and self.___updateframe.callbacks[updatefunc]) then + self.___updateframe.callbacks[updatefunc] = nil + if(#self.___updateframe.callbacks == 0) then + self.___updateframe:SetScript("OnUpdate", nil) + end + else + self.___updateframe:SetScript("OnUpdate", nil) + end +end + +local function SetPluginString(addonName) + local author = GetAddOnMetadata(addonName, "Author") or "Unknown" + local name = GetAddOnMetadata(addonName, "Title") or addonName + local version = GetAddOnMetadata(addonName, "Version") or "???" + return INFO_FORMAT:format(name, version, author) +end + +--REGISTRY PUBLIC METHODS + +function lib:RunCallbacks() + for i=1, #Callbacks do + local fn = Callbacks[i] + if(fn and type(fn) == "function") then + fn() + end + end +end + +function lib:RefreshModule(schema) + local obj = CoreObject[schema] + if obj and obj.ReLoad then + obj:ReLoad() + end +end + +function lib:RefreshPlugin(schema) + local obj = _G[schema] + if obj and obj.ReLoad then + obj:ReLoad() + end +end + +function lib:RefreshAll() + for _,schema in pairs(MODULES) do + local obj = CoreObject[schema] + if obj and obj.ReLoad then + obj:ReLoad() + end + end + + for _,schema in pairs(PLUGINS) do + local obj = _G[schema] + if obj and obj.ReLoad then + obj:ReLoad() + end + end +end + +function lib:GetModuletable() + return MODULES +end + +function lib:GetPlugins() + return PluginString +end + +function lib:CheckDualProfile() + return PROFILE_SV.SAFEDATA.dualSpecEnabled +end + +function lib:ToggleDualProfile(enabled) + PROFILE_SV.SAFEDATA.dualSpecEnabled = enabled + if(enabled) then + self.EventManager:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") + self:UpdateDatabase() + else + self.EventManager:UnregisterEvent("ACTIVE_TALENT_GROUP_CHANGED") + end +end + +function lib:LoadQueuedModules() + if MODULES then + for i=1,#MODULES do + local schema = MODULES[i] + local obj = CoreObject[schema] + if obj and not obj.initialized then + local halt = false + local data = CoreObject.db[schema] + if(data and data.incompatible) then + for addon,_ in pairs(data.incompatible) do + if IsAddOnLoaded(addon) then halt = true end + end + end + if(obj.Load and (not halt)) then + obj:Load() + obj.initialized = true + end + end + end + end +end + +function lib:LoadQueuedPlugins() + if PLUGINS then + for i=1,#PLUGINS do + local schema = PLUGINS[i] + local obj = _G[schema] + if obj and not obj.initialized then + local halt = false + local data = CoreObject.db[schema] + if(data and data.incompatible) then + for addon,_ in pairs(data.incompatible) do + if IsAddOnLoaded(addon) then halt = true end + end + end + if(obj.Load and (not halt)) then + obj:Load() + obj.initialized = true + end + end + end + end +end + +--[[ CONSTRUCTORS ]]-- + +function lib:NewPlugin(addonName, addonObject) + local version = GetAddOnMetadata(addonName, "Version") + local header = GetAddOnMetadata(addonName, HeaderFromMeta) + local schema = GetAddOnMetadata(addonName, SchemaFromMeta) + local lod = IsAddOnLoadOnDemand(addonName) + + local addonmeta = {} + local oldmeta = getmetatable(addonObject) + if oldmeta then + for k, v in pairs(oldmeta) do addonmeta[k] = v end + end + addonmeta.__tostring = rootstring + setmetatable( addonObject, addonmeta ) + + addonObject.Version = version + addonObject.NameID = addonName + addonObject.TitleID = header + addonObject.Schema = schema + addonObject.LoD = lod + addonObject.initialized = false + addonObject.CombatLocked = false + addonObject.ChangeDBVar = changeDBVar + addonObject.RegisterEvent = registerEvent + addonObject.UnregisterEvent = unregisterEvent + addonObject.RegisterUpdate = registerUpdate + addonObject.UnregisterUpdate = unregisterUpdate + + if(IsAddOnLoaded(addonName) and not lod) then + CoreObject.Options.args.plugins.args.pluginOptions.args[schema] = { + type = "group", + name = header, + childGroups = "tree", + args = { + enable = { + order = 1, + type = "toggle", + name = "Enable", + get = function() + return CoreObject.db[schema].enable + end, + set = function(key, value) + addonObject:ChangeDBVar(value, "enable"); + CoreObject:StaticPopup_Show("RL_CLIENT") + end, + } + } + } + end + + _G[schema] = addonObject + + if(not PLUGINS) then PLUGINS = {} end + + PLUGINS[#PLUGINS+1] = schema + AllowedIndexes[schema] = schema + + local infoString = SetPluginString(addonName) + local oldString = PluginString + PluginString = ("%s%s\n"):format(oldString, infoString) + + return addonObject +end + +local function NewLoadOnDemand(addonName, schema, header) + LoadOnDemand[schema] = addonName; + PROFILE_SV.SAFEDATA[schema] = PROFILE_SV.SAFEDATA[schema] or {["enable"] = false} + CoreObject.configs[schema] = {["enable"] = false} + CoreObject.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) + PROFILE_SV.SAFEDATA[schema].enable = true + lib:LoadQueuedPlugins() + else + PROFILE_SV.SAFEDATA[schema].enable = false + CoreObject:StaticPopup_Show("RL_CLIENT") + end + end, + } + } + } +end + +local function SanitizeStorage(data) + for k,v in pairs(data) do + if(k == "STORED" or k == "SAFEDATA" or k == "LAYOUT") then + data[k] = nil + end + end +end + +--DATABASE EVENT HANDLER +local DataBase_OnEvent = function(self, event) + if(event == "PLAYER_LOGOUT" or event == "ACTIVE_TALENT_GROUP_CHANGED") then + lib:UpdateDatabase(event) + end +end + +-- CORE OBJECT CONSTRUCT +local Core_NewCallback = function(self, fn) + if(fn and type(fn) == "function") then + Callbacks[#Callbacks+1] = fn + end +end + +local Core_NewScript = function(self, fn) + if(fn and type(fn) == "function") then + ScriptQueue[#ScriptQueue+1] = fn + end +end + +local Core_NewPackage = function(self, schema, header) + if(self[schema]) then return end + + if(not MODULES) then MODULES = {} end + MODULES[#MODULES+1] = schema + + AllowedIndexes[schema] = schema + + local addonName = ("SVUI [%s]"):format(schema) + + local obj = { + NameID = addonName, + TitleID = header, + Schema = schema, + initialized = false, + CombatLocked = false, + ChangeDBVar = changeDBVar, + RegisterEvent = registerEvent, + UnregisterEvent = unregisterEvent, + RegisterUpdate = registerUpdate, + UnregisterUpdate = unregisterUpdate + } + + 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 ) + + self[schema] = obj + + return self[schema] +end + +local Core_ResetData = function(self, sub, sub2) + local data = self.db + local sv = rawget(data, "data") + local src = rawget(data, "defaults") + local targetData + if(sub2 and sv and sv[sub]) then + targetData = sv[sub][sub2] + elseif(sub and sv) then + targetData = sv[sub] + else + targetData = sv + end + if(targetData) then + for k,v in pairs(targetData) do + targetData[k] = nil + end + else + sv = {} + end + tablecopy(sv, src) +end + +function lib:NewCore(gfile, pfile, cfile) + --meta assurance + local mt = {}; + local old = getmetatable(CoreObject); + if old then + for k, v in pairs(old) do mt[k] = v end + end + mt.__tostring = rootstring; + setmetatable(CoreObject, mt); + + --database + GLOBAL_FILENAME = gfile or GLOBAL_FILENAME + PROFILE_FILENAME = pfile or PROFILE_FILENAME + CACHE_FILENAME = cfile or CACHE_FILENAME + + --events + if(not self.EventManager.Initialized) then + self.EventManager:RegisterEvent("PLAYER_LOGOUT") + self.EventManager:SetScript("OnEvent", DataBase_OnEvent) + self.EventManager.Initialized = true + end + + --internals + CoreObject.NameID = CoreName; + CoreObject.Version = AddonVersion; + CoreObject.GameVersion = tonumber(InterfaceVersion); + CoreObject.DebugMode = false; + CoreObject.Schema = GetAddOnMetadata(CoreName, SchemaFromMeta); + CoreObject.TitleID = GetAddOnMetadata(CoreName, HeaderFromMeta); + CoreObject.NewCallback = Core_NewCallback + CoreObject.NewScript = Core_NewScript + CoreObject.NewPackage = Core_NewPackage + CoreObject.ResetData = Core_ResetData + CoreObject.db = tablesplice(CoreObject.configs, {}) + CoreObject.L = self:Lang() + + --set global + _G[CoreName] = CoreObject; + + return _G[CoreName] +end + +-- INITIALIZE AND LAUNCH + +function lib:Initialize() + local coreSchema = CoreObject.Schema + --GLOBAL SAVED VARIABLES + if not _G[GLOBAL_FILENAME] then _G[GLOBAL_FILENAME] = {} end + GLOBAL_SV = _G[GLOBAL_FILENAME] + + if(GLOBAL_SV.profileKeys) then + twipe(GLOBAL_SV.profileKeys) + else + GLOBAL_SV.profileKeys = {} + end + + GLOBAL_SV.profiles = GLOBAL_SV.profiles or {} + for k,v in pairs(GLOBAL_SV.profiles) do + GLOBAL_SV.profileKeys[k] = k + end + + GLOBAL_SV.cache = GLOBAL_SV.cache or {} + for k,v in pairs(GLOBAL_SV.cache) do + GLOBAL_SV.profileKeys[k] = k + end + + --CACHE SAVED VARIABLES + if not _G[CACHE_FILENAME] then _G[CACHE_FILENAME] = {} end + CACHE_SV = _G[CACHE_FILENAME] + if(not CACHE_SV.STORED) then + CACHE_SV.STORED = {} + CACHE_SV.STORED[1] = {} + CACHE_SV.STORED[2] = {} + CACHE_SV.STORED[3] = {} + if playerClass == "DRUID" then + CACHE_SV.STORED[4] = {} + end + for k,v in pairs(CACHE_SV) do + if(k ~= "STORED") then + CACHE_SV.STORED[1][k] = v + end + end + end + + --PROFILE SAVED VARIABLES + if not _G[PROFILE_FILENAME] then _G[PROFILE_FILENAME] = {} end + PROFILE_SV = _G[PROFILE_FILENAME] + PROFILE_SV.SAFEDATA = PROFILE_SV.SAFEDATA or {dualSpecEnabled = false} + + if(PROFILE_SV.SAFEDATA and PROFILE_SV.SAFEDATA.dualSpecEnabled) then + SOURCE_KEY = GetSpecialization() or 1 + self.EventManager:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") + else + SOURCE_KEY = 1 + self.EventManager:UnregisterEvent("ACTIVE_TALENT_GROUP_CHANGED") + end + + if(not PROFILE_SV.STORED) then + PROFILE_SV.STORED = {} + PROFILE_SV.STORED[1] = {} + PROFILE_SV.STORED[1][coreSchema] = {} + PROFILE_SV.STORED[2] = {} + PROFILE_SV.STORED[2][coreSchema] = {} + PROFILE_SV.STORED[3] = {} + PROFILE_SV.STORED[3][coreSchema] = {} + if playerClass == "DRUID" then + PROFILE_SV.STORED[4] = {} + PROFILE_SV.STORED[4][coreSchema] = {} + end + + --Attempt to copy any prior variables, even outdated + if(PROFILE_SV.system or (MODULES[1] and PROFILE_SV[MODULES[1]])) then + for k,v in pairs(PROFILE_SV) do + if(k == "system") then + tablecopy(v, PROFILE_SV.STORED[1][coreSchema]) + elseif(k == "media" or k == "filter") then + PROFILE_SV.STORED[1][coreSchema][k] = v + elseif(AllowedIndexes[k]) then + PROFILE_SV.STORED[1][k] = v + end + end + end + else + PROFILE_SV.STORED[1] = PROFILE_SV.STORED[1] or {} + PROFILE_SV.STORED[1][coreSchema] = PROFILE_SV.STORED[1][coreSchema] or {} + SanitizeStorage(PROFILE_SV.STORED[1]) + + PROFILE_SV.STORED[2] = PROFILE_SV.STORED[2] or {} + PROFILE_SV.STORED[2][coreSchema] = PROFILE_SV.STORED[2][coreSchema] or {} + SanitizeStorage(PROFILE_SV.STORED[2]) + + PROFILE_SV.STORED[3] = PROFILE_SV.STORED[3] or {} + PROFILE_SV.STORED[3][coreSchema] = PROFILE_SV.STORED[3][coreSchema] or {} + SanitizeStorage(PROFILE_SV.STORED[3]) + + if playerClass == "DRUID" then + PROFILE_SV.STORED[4] = PROFILE_SV.STORED[4] or {} + PROFILE_SV.STORED[4][coreSchema] = PROFILE_SV.STORED[4][coreSchema] or {} + SanitizeStorage(PROFILE_SV.STORED[4]) + elseif PROFILE_SV.STORED[4] then + PROFILE_SV.STORED[4] = nil + end + + end + + for k,v in pairs(PROFILE_SV) do + if(k ~= "STORED" and k ~= "SAFEDATA") then + PROFILE_SV[k] = nil + end + end + + --construct core dataset + local db = setmetatable({}, meta_database) + db.data = PROFILE_SV.STORED[SOURCE_KEY] + db.defaults = CoreObject.configs + CoreObject.db = db + + local cache = setmetatable({}, meta_cache) + cache.data = CACHE_SV.STORED[SOURCE_KEY] + CoreObject.cache = cache + + --check for LOD plugins + local addonCount = GetNumAddOns() + + for i = 1, addonCount do + local addonName, _, _, _, _, reason = GetAddOnInfo(i) + local lod = IsAddOnLoadOnDemand(i) + local header = GetAddOnMetadata(i, HeaderFromMeta) + local schema = GetAddOnMetadata(i, SchemaFromMeta) + + if(lod and schema) then + NewLoadOnDemand(addonName, schema, header) + end + end +end + +function lib:Launch() + if LoadOnDemand then + for schema,name in pairs(LoadOnDemand) do + local db = PROFILE_SV.SAFEDATA[schema] + if(db and (db.enable or db.enable ~= false)) then + CoreObject.db[schema].enable = PROFILE_SV.SAFEDATA[schema].enable + if(not IsAddOnLoaded(name)) then + local loaded, reason = LoadAddOn(name) + end + EnableAddOn(name) + end + end + end + + self:LoadQueuedModules() + self:LoadQueuedPlugins() + + if ScriptQueue then + for i=1, #ScriptQueue do + local fn = ScriptQueue[i] + if(fn and type(fn) == "function") then + fn() + end + end + + ScriptQueue = nil + end +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/LibSystemRegistry-1.0/LibSystemRegistry-1.0.lua b/Interface/AddOns/SVUI/libs/LibSystemRegistry-1.0/LibSystemRegistry-1.0.lua deleted file mode 100644 index d20005d..0000000 --- a/Interface/AddOns/SVUI/libs/LibSystemRegistry-1.0/LibSystemRegistry-1.0.lua +++ /dev/null @@ -1,555 +0,0 @@ -local AddonName, AddonCore = ... -local MAJOR, MINOR = "LibSystemRegistry-1.0", 1 -local lib = LibStub:NewLibrary(MAJOR, MINOR) - -if not lib then return end - ---[[ GLOBALS ]]-- - -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local type = _G.type; -local rawset = _G.rawset; -local rawget = _G.rawget; -local tostring = _G.tostring; -local error = _G.error; -local getmetatable = _G.getmetatable; -local setmetatable = _G.setmetatable; -local string = _G.string; -local math = _G.math; -local table = _G.table; -local tinsert = _G.tinsert; -local tremove = _G.tremove; - -local upper = string.upper; -local format, find, match, gsub = string.format, string.find, string.match, string.gsub; -local floor = math.floor -local twipe, tsort, tconcat = table.wipe, table.sort, table.concat; - ---[[ LOCAL VARS ]]-- -local AddonVersion = GetAddOnMetadata(..., "Version"); -local clientVersion, internalVersion, releaseDate, uiVersion = GetBuildInfo(); - -local PluginString = "" -local PluginList, Modules, LoadOnDemand, Callbacks, ModuleQueue, ScriptQueue = {},{},{},{},{},{}; - -local INFO_FORMAT = "|cffFFFF00%s|r\n |cff33FF00Version: %s|r |cff0099FFby %s|r"; - -if GetLocale() == "ruRU" then - INFO_FORMAT = "|cffFFFF00%s|r\n |cff33FF00Версия: %s|r |cff0099FFот %s|r"; -end - -local schemaHeader = "X-" .. AddonName .. "-Schema"; -local messagePattern = "|cffFF2F00%s:|r"; -local debugPattern = "|cffFF2F00%s|r [|cff992FFF%s|r]|cffFF2F00:|r"; - ---[[ META METHODS ]]-- - -local rootstring = function(self) return self.___addonName end - ---[[ REGISTRY CONSTRUCT ]]-- - -local changeDBVar = function(self, value, key, sub1, sub2, sub3) - local schema = self.___schema - local config = AddonCore.db[schema] - - if((sub1 and sub2 and sub3) and (config[sub1] and config[sub1][sub2] and config[sub1][sub2][sub3])) then - AddonCore.db[schema][sub1][sub2][sub3][key] = value - elseif((sub1 and sub2) and (config[sub1] and config[sub1][sub2])) then - AddonCore.db[schema][sub1][sub2][key] = value - elseif(sub1 and config[sub1]) then - AddonCore.db[schema][sub1][key] = value - else - AddonCore.db[schema][key] = value - end - - self.db = AddonCore.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] - elseif(not fn and self[eventname]) then - fn = self[eventname] - end - self.___eventframe[eventname] = fn - end - - self.___eventframe:RegisterEvent(eventname) -end - -local unregisterEvent = function(self, event, ...) - if(self.___eventframe) then - self.___eventframe:UnregisterEvent(event) - end -end - -local innerOnUpdate = function(self, elapsed) - if self.elapsed and self.elapsed > (self.throttle) then - local obj = self.module - local callbacks = self.callbacks - - for name, fn in pairs(callbacks) do - local _, error = pcall(fn, obj) - if(error and AddonCore.Debugging) then - print(error) - end - end - - self.elapsed = 0 - else - self.elapsed = (self.elapsed or 0) + elapsed - end -end - -local registerUpdate = function(self, updatefunc, throttle) - if not self.___updateframe then - self.___updateframe = CreateFrame("Frame", nil); - self.___updateframe.module = self; - self.___updateframe.callbacks = {}; - self.___updateframe.elapsed = 0; - self.___updateframe.throttle = throttle or 0.2; - end - - if(updatefunc and type(updatefunc) == "string" and self[updatefunc]) then - self.___updateframe.callbacks[updatefunc] = self[updatefunc] - end - - self.___updateframe:SetScript("OnUpdate", innerOnUpdate) -end - -local unregisterUpdate = function(self, updatefunc) - if(updatefunc and type(updatefunc) == "string" and self.___updateframe.callbacks[updatefunc]) then - self.___updateframe.callbacks[updatefunc] = nil - if(#self.___updateframe.callbacks == 0) then - self.___updateframe:SetScript("OnUpdate", nil) - end - else - self.___updateframe:SetScript("OnUpdate", nil) - end -end - -local add_OptionsIndex = function(self, index, data) - local addonName = self.___addonName - local schema = self.___schema - local header = GetAddOnMetadata(addonName, "X-SVUI-Header") - - AddonCore.Options.args.plugins.args.pluginOptions.args[schema].args[index] = data -end - -local function SetPluginString(addonName) - local author = GetAddOnMetadata(addonName, "Author") or "Unknown" - local name = GetAddOnMetadata(addonName, "Title") or addonName - local version = GetAddOnMetadata(addonName, "Version") or "???" - return INFO_FORMAT:format(name, version, author) -end - -local function SetInternalModule(obj, 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 addonName = ("SVUI [%s]"):format(schema) - - obj.___addonName = addonName - obj.___schema = schema - - 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, 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.___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) - AddonCore.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) - AddonCore:UpdateDatabase() - obj:ChangeDBVar(true, "enable") - else - obj:ChangeDBVar(false, "enable") - AddonCore:StaticPopup_Show("RL_CLIENT") - end - end, - } - } - } - else - AddonCore.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"); AddonCore:StaticPopup_Show("RL_CLIENT") end, - } - } - } - end - - return obj -end - ---[[ PUBLIC METHODS ]]-- - -function lib:NewCallback(fn) - if(fn and type(fn) == "function") then - Callbacks[#Callbacks+1] = fn - end -end - -function lib:NewScript(fn) - if(fn and type(fn) == "function") then - ScriptQueue[#ScriptQueue+1] = fn - end -end - -function lib:NewPackage(obj, schema) - if(AddonCore[schema]) then return end - - ModuleQueue[#ModuleQueue+1] = schema - Modules[#Modules+1] = schema - - AddonCore[schema] = SetInternalModule(obj, schema) - - if(AddonCore.AddonLaunched) then - if(AddonCore[schema].Load) then - AddonCore[schema]:Load() - end - end -end - -function lib:NewPlugin(obj) - local coreName = AddonCore.___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 - Modules[#Modules+1] = schema - - local infoString = SetPluginString(addonName) - local oldString = PluginString - - PluginList[addonName] = infoString - PluginString = ("%s%s\n"):format(oldString, infoString) - - AddonCore[schema] = SetExternalModule(obj, schema, addonName, header, lod) - - if(AddonCore.AddonLaunched and AddonCore[schema].Load) then - AddonCore[schema]:Load() - --print(schema) - end - end -end - -function lib:NewAddon(addonName, schema, header) - LoadOnDemand[addonName] = schema; - - AddonCore.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) - AddonCore:UpdateDatabase() - AddonCore.db[schema].enable = true - self:LoadPackages() - else - AddonCore.db[schema].enable = false - AddonCore:StaticPopup_Show("RL_CLIENT") - end - end, - } - } - } -end - -function lib:FindAddons() - local addonCount = GetNumAddOns() - 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 - -function lib:RunCallbacks() - for i=1, #Callbacks do - local fn = Callbacks[i] - if(fn and type(fn) == "function") then - fn() - end - end -end - -function lib:Update(name, dataOnly) - local obj = AddonCore[name] - if obj then - if AddonCore.db[name] then - obj.db = AddonCore.db[name] - end - if obj.ReLoad and not dataOnly then - obj:ReLoad() - end - end -end - -function lib:UpdateAll() - for _,name in pairs(Modules) do - local obj = AddonCore[name] - - if AddonCore.db[name] then - obj.db = AddonCore.db[name] - end - - if obj and obj.ReLoad then - obj:ReLoad() - end - end -end - -function lib:LoadRegisteredAddons() - for name,schema in pairs(LoadOnDemand) do - local config = AddonCore.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 - -function lib:LoadPackages() - if not ModuleQueue then return end - - for i=1,#ModuleQueue do - local name = ModuleQueue[i] - local obj = AddonCore[name] - if obj and not obj.initialized then - if AddonCore.db[name] then - obj.db = AddonCore.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 - --print(name) - end - end - obj.initialized = true; - end - end - - 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 - - ScriptQueue = nil -end - -function lib:NewPrototype(name) - local version = GetAddOnMetadata(name, "Version") - local schema = GetAddOnMetadata(name, schemaHeader) - - AddonCore.private[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 - -function lib:GetPlugins(tableList) - if(tableList and tableList ~= false) then - return PluginList - end - return PluginString -end - ---[[ CONSTRUCTORS ]]-- - -local Core_DeadFunction = function() return end - -local Core_StaticPopup_Show = function(self, arg) - if arg == "ADDON_ACTION_FORBIDDEN" then - StaticPopup_Hide(arg) - end -end - -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 Core_Debugger = function(self, msg) - if(not self.___debugging) then return end - local outbound = (debugPattern):format(self.___addonName, "DEBUG") - _sendmessage(msg, outbound) -end - -local Core_AddonMessage = function(self, msg) - local outbound = (messagePattern):format(self.___addonName) - _sendmessage(msg, outbound) -end - -function lib:InitializeCore() - local obj = {}; - --internals - AddonCore.___addonName = AddonName; - AddonCore.___version = AddonVersion; - AddonCore.___interface = tonumber(uiVersion); - AddonCore.___debugging = false; - --tables - AddonCore.db = {}; - AddonCore.private = {}; - AddonCore.public = { profiles = {}, profileKeys = {} }; - --functions - AddonCore.fubar = Core_DeadFunction; - AddonCore.AddonMessage = Core_AddonMessage; - AddonCore.Debugger = Core_Debugger; - AddonCore.StaticPopup_Show = Core_StaticPopup_Show; - - local mt = {}; - local old = getmetatable(AddonCore); - if old then - for k, v in pairs(old) do mt[k] = v end - end - mt.__tostring = rootstring; - setmetatable(AddonCore, mt); - - --set global - _G[AddonName] = AddonCore; - - return AddonCore -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/libs.xml b/Interface/AddOns/SVUI/libs/libs.xml index 0e8898e..bc724e1 100644 --- a/Interface/AddOns/SVUI/libs/libs.xml +++ b/Interface/AddOns/SVUI/libs/libs.xml @@ -1,7 +1,6 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Script file="LibSuperVillain-1.0\LibSuperVillain-1.0.lua"/> <Script file="LibStub\LibStub.lua"/> - <Script file="LibLocale-1.0\LibLocale-1.0.lua"/> - <Script file="LibSystemRegistry-1.0\LibSystemRegistry-1.0.lua"/> <Script file="CallbackHandler-1.0\CallbackHandler-1.0.lua"/> <Script file="LibSharedMedia-3.0\LibSharedMedia-3.0.lua"/> <Script file="LibActionButton-1.0\LibActionButton-1.0.lua"/> diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ActionPanel/oUF_ActionPanel.toc b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ActionPanel/oUF_ActionPanel.toc index 28b273d..5517fa0 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ActionPanel/oUF_ActionPanel.toc +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ActionPanel/oUF_ActionPanel.toc @@ -2,7 +2,7 @@ ## Title: oUF ActionPanel ## Notes: Adds a backing to all unit frames that provides many utilities. ## Author: Munglunch -## Version: 4.4 +## Version: 4.8 ## X-Category: oUF ## Dependencies: oUF diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Afflicted/oUF_Afflicted.toc b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Afflicted/oUF_Afflicted.toc index c8b4d84..f86751f 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Afflicted/oUF_Afflicted.toc +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Afflicted/oUF_Afflicted.toc @@ -2,7 +2,7 @@ ## Title: oUF Afflicted ## Notes: Adds Custom Debuff Highlighting to oUF. ## Author: Munglunch -## Version: 4.4 +## Version: 4.8 ## X-Category: oUF ## Dependencies: oUF diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc index 8d226c3..4c12506 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc @@ -2,7 +2,7 @@ ## Title: oUF Arcane Charge ## Notes: Adds support for arcane charge indicators to oUF. ## Author: Munglunch -## Version: 4.4 +## Version: 4.8 ## Dependencies: oUF oUF_ArcaneCharge.lua \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Combatant/oUF_Combatant.toc b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Combatant/oUF_Combatant.toc index 10740d3..2d58083 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Combatant/oUF_Combatant.toc +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Combatant/oUF_Combatant.toc @@ -2,7 +2,7 @@ ## Title: oUF Combatant ## Notes: Adds PvP trinket status and spec icons to oUF frames. ## Author: Munglunch -## Version: 4.40 +## Version: 4.80 ## X-Category: oUF ## Dependencies: oUF diff --git a/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua b/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua index 1588aef..a37c248 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 SVUI_ADDON_NAME, SV = ... -local L = LibLocale(); +local SV = select(2, ...) +local L = SV.L; local MOD = SV.SVBar; local _G = getfenv(0); diff --git a/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua b/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua index 6bccfd8..35531aa 100644 --- a/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua +++ b/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua @@ -33,12 +33,11 @@ local ceil = math.ceil; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); +local SV = select(2, ...) +local L = SV.L local LSM = LibStub("LibSharedMedia-3.0") -local CONFIGS = SV.private -local MOD = {}; + +local MOD = SV:NewPackage("SVBar", L["ActionBars"]); MOD.ButtonCache = {}; --[[ ########################################################## @@ -104,8 +103,8 @@ end local function RefreshMicrobar() if not SVUI_MicroBar then return end local lastParent = SVUI_MicroBar; - local buttonSize = MOD.db.Micro.buttonsize or 30; - local spacing = MOD.db.Micro.buttonspacing or 1; + local buttonSize = SV.db.SVBar.Micro.buttonsize or 30; + local spacing = SV.db.SVBar.Micro.buttonspacing or 1; local barWidth = (buttonSize + spacing) * 13; SVUI_MicroBar_MOVE:Size(barWidth, buttonSize + 6) SVUI_MicroBar:SetAllPoints(SVUI_MicroBar_MOVE) @@ -115,7 +114,7 @@ local function RefreshMicrobar() if(button) then button:ClearAllPoints() button:Size(buttonSize, buttonSize + 28) - button._fade = MOD.db.Micro.mouseover + button._fade = SV.db.SVBar.Micro.mouseover if lastParent == SVUI_MicroBar then button:SetPoint("BOTTOMLEFT",lastParent,"BOTTOMLEFT",1,1) else @@ -187,7 +186,7 @@ local MicroButton_OnLeave = function(self) end local MicroButton_OnUpdate = function() - if(not MOD.db.Micro.mouseover) then + if(not SV.db.SVBar.Micro.mouseover) then SVUI_MicroBar:SetAlpha(1) SVUI_MicroBar.screenMarker:SetAlpha(0) else @@ -262,7 +261,7 @@ end local function SaveActionButton(parent) local button = parent:GetName() local cooldown = _G[button.."Cooldown"] - cooldown.SizeOverride = MOD.db.cooldownSize + cooldown.SizeOverride = SV.db.SVBar.cooldownSize MOD:FixKeybindText(parent) if not MOD.ButtonCache[parent] then SV.Timers:AddCooldown(cooldown) @@ -339,7 +338,7 @@ local function ModifyActionButton(parent) local pushed = parent:GetPushedTexture() local checked = parent:GetCheckedTexture() if cooldown then - cooldown.SizeOverride = MOD.db.cooldownSize + cooldown.SizeOverride = SV.db.SVBar.cooldownSize --cooldown:SetAlpha(0) end if highlight then @@ -369,7 +368,7 @@ local function ModifyActionButton(parent) count:ClearAllPoints() count:SetPoint("BOTTOMRIGHT",1,1) count:SetShadowOffset(1,-1) - count:SetFontTemplate(LSM:Fetch("font",MOD.db.countFont),MOD.db.countFontSize,MOD.db.countFontOutline) + count:SetFontTemplate(LSM:Fetch("font",SV.db.SVBar.countFont),SV.db.SVBar.countFontSize,SV.db.SVBar.countFontOutline) end if icon then icon:SetTexCoord(.1,.9,.1,.9) @@ -377,10 +376,10 @@ local function ModifyActionButton(parent) icon:FillInner() end if shine then shine:SetAllPoints()end - if MOD.db.hotkeytext then + if SV.db.SVBar.hotkeytext then hotkey:ClearAllPoints() hotkey:SetAllPoints() - hotkey:SetFontTemplate(LSM:Fetch("font",MOD.db.font),MOD.db.fontSize,MOD.db.fontOutline) + hotkey:SetFontTemplate(LSM:Fetch("font",SV.db.SVBar.font),SV.db.SVBar.fontSize,SV.db.SVBar.fontOutline) hotkey:SetJustifyH("RIGHT") hotkey:SetJustifyV("TOP") hotkey:SetShadowOffset(1,-1) @@ -479,7 +478,7 @@ function MOD:UpdateBarBindings(pet, stance) local name = ("SVUI_StanceBarButton%s"):format(i) local hkname = ("SVUI_StanceBarButton%sHotKey"):format(i) local hotkey = _G[hkname] - if self.db.hotkeytext then + if SV.db.SVBar.hotkeytext then local key = bindText:format(i); local binding = GetBindingKey(key) hotkey:Show() @@ -498,7 +497,7 @@ function MOD:UpdateBarBindings(pet, stance) local name = ("PetActionButton%s"):format(i) local hkname = ("PetActionButton%sHotKey"):format(i) local hotkey = _G[hkname] - if self.db.hotkeytext then + if SV.db.SVBar.hotkeytext then local key = bindText:format(i); local binding = GetBindingKey(key) hotkey:Show() @@ -540,7 +539,7 @@ function MOD:UpdateAllBindings(event) end function MOD:SetBarConfigData(bar) - local db = self.db + local db = SV.db.SVBar local thisBinding = bar.binding; local buttonList = bar.buttons; local config = bar.config @@ -567,7 +566,7 @@ end function MOD:UpdateBarPagingDefaults() local parse, custom; - if self.db.Bar6.enable then + if SV.db.SVBar.Bar6.enable then parse = "[vehicleui,mod:alt,mod:ctrl] %d; [possessbar] %d; [overridebar] %d; [form,noform] 0; [shapeshift] 13; [bar:3] 3; [bar:4] 4; [bar:5] 5; [bar:6] 6; %s"; else parse = "[vehicleui,mod:alt,mod:ctrl] %d; [possessbar] %d; [overridebar] %d; [form,noform] 0; [shapeshift] 13; [bar:2] 2; [bar:3] 3; [bar:4] 4; [bar:5] 5; [bar:6] 6; %s"; @@ -575,8 +574,8 @@ function MOD:UpdateBarPagingDefaults() local mainbar = _G["SVUI_ActionBar1"] if(mainbar) then - if self.db.Bar1.useCustomPaging then - custom = self.db.Bar1.customPaging[SV.class]; + if SV.db.SVBar.Bar1.useCustomPaging then + custom = SV.db.SVBar.Bar1.customPaging[SV.class]; else custom = "" end @@ -587,8 +586,8 @@ function MOD:UpdateBarPagingDefaults() for i=2, 6 do 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[SV.class]; + if(bar and SV.db.SVBar[id].useCustomPaging) then + bar.conditions = SV.db.SVBar[id].customPaging[SV.class]; end end @@ -598,15 +597,15 @@ function MOD:UpdateBarPagingDefaults() local Bar4Option = InterfaceOptionsActionBarsPanelRightTwo local Bar5Option = InterfaceOptionsActionBarsPanelRight - if (self.db.Bar2.enable and not Bar2Option:GetChecked()) or (not self.db.Bar2.enable and Bar2Option:GetChecked()) then + if (SV.db.SVBar.Bar2.enable and not Bar2Option:GetChecked()) or (not SV.db.SVBar.Bar2.enable and Bar2Option:GetChecked()) then Bar2Option:Click() end - if (self.db.Bar3.enable and not Bar3Option:GetChecked()) or (not self.db.Bar3.enable and Bar3Option:GetChecked()) then + if (SV.db.SVBar.Bar3.enable and not Bar3Option:GetChecked()) or (not SV.db.SVBar.Bar3.enable and Bar3Option:GetChecked()) then Bar3Option:Click() end - if not self.db.Bar5.enable and not self.db.Bar4.enable then + if not SV.db.SVBar.Bar5.enable and not SV.db.SVBar.Bar4.enable then if Bar4Option:GetChecked() then Bar4Option:Click() end @@ -614,7 +613,7 @@ function MOD:UpdateBarPagingDefaults() if Bar5Option:GetChecked() then Bar5Option:Click() end - elseif not self.db.Bar5.enable then + elseif not SV.db.SVBar.Bar5.enable then if not Bar5Option:GetChecked() then Bar5Option:Click() end @@ -622,9 +621,9 @@ function MOD:UpdateBarPagingDefaults() if not Bar4Option:GetChecked() then Bar4Option:Click() end - elseif (self.db.Bar4.enable and not Bar4Option:GetChecked()) or (not self.db.Bar4.enable and Bar4Option:GetChecked()) then + elseif (SV.db.SVBar.Bar4.enable and not Bar4Option:GetChecked()) or (not SV.db.SVBar.Bar4.enable and Bar4Option:GetChecked()) then Bar4Option:Click() - elseif (self.db.Bar5.enable and not Bar5Option:GetChecked()) or (not self.db.Bar5.enable and Bar5Option:GetChecked()) then + elseif (SV.db.SVBar.Bar5.enable and not Bar5Option:GetChecked()) or (not SV.db.SVBar.Bar5.enable and Bar5Option:GetChecked()) then Bar5Option:Click() end end @@ -736,7 +735,7 @@ do end local function _getPage(bar, defaultPage, condition) - local page = MOD.db[bar].customPaging[SV.class] + local page = SV.db.SVBar[bar].customPaging[SV.class] if not condition then condition = '' end if not page then page = '' end if page then @@ -751,7 +750,7 @@ do local bar local isPet, isStance = false, false - local db = self.db[id] + local db = SV.db.SVBar[id] if(id == "Pet") then bar = _G["SVUI_PetActionBar"] @@ -848,7 +847,7 @@ do bar:Hide() UnregisterStateDriver(bar, "visibility") end - SV:SetSnapOffset(("SVUI_Action%d_MOVE"):format(id), (space / 2)) + SV.Mentalo:ChangeSnapOffset(("SVUI_Action%d_MOVE"):format(id), (space / 2)) end end end @@ -883,15 +882,15 @@ end local Vehicle_Updater = function() local bar = _G["SVUI_ActionBar1"] - local space = MOD.db["Bar1"].buttonspacing - local total = MOD.db["Bar1"].buttons; - local rows = MOD.db["Bar1"].buttonsPerRow; - local size = MOD.db["Bar1"].buttonsize - local point = MOD.db["Bar1"].point; + local space = SV.db.SVBar["Bar1"].buttonspacing + local total = SV.db.SVBar["Bar1"].buttons; + local rows = SV.db.SVBar["Bar1"].buttonsPerRow; + local size = SV.db.SVBar["Bar1"].buttonsize + local point = SV.db.SVBar["Bar1"].point; local columns = ceil(total / rows) if (HasOverrideActionBar() or HasVehicleActionBar()) and total == 12 then bar.backdrop:ClearAllPoints() - bar.backdrop:Point(MOD.db["Bar1"].point, bar, MOD.db["Bar1"].point) + bar.backdrop:Point(SV.db.SVBar["Bar1"].point, bar, SV.db.SVBar["Bar1"].point) bar.backdrop:Width(space + ((size * rows) + (space * (rows - 1)) + space)) bar.backdrop:Height(space + ((size * columns) + (space * (columns - 1)) + space)) bar.backdrop:SetFrameLevel(0); @@ -961,6 +960,8 @@ CreateActionBars = function(self) local barName = ("SVUI_Action%s"):format(barID) local buttonMax = NUM_ACTIONBAR_BUTTONS + local space = SV.db.SVBar["Bar"..i].buttonspacing + local thisBar = NewActionBar(barName) thisBar.binding = barBindingIndex[i] thisBar.page = barPageIndex[i] @@ -968,15 +969,15 @@ CreateActionBars = function(self) if(i == 1) then thisBar:Point("BOTTOM", SV.UIParent, "BOTTOM", 0, 28) elseif(i == 2) then - thisBar:Point("BOTTOM", _G["SVUI_ActionBar1"], "TOP", 0, 4) + thisBar:Point("BOTTOM", _G["SVUI_ActionBar1"], "TOP", 0, -space) elseif(i == 3) then - thisBar:Point("BOTTOMLEFT", _G["SVUI_ActionBar1"], "BOTTOMRIGHT", 4, 0) + thisBar:Point("BOTTOMLEFT", _G["SVUI_ActionBar1"], "BOTTOMRIGHT", space, 0) elseif(i == 4) then - thisBar:Point("RIGHT", SV.UIParent, "RIGHT", -4, 0) + thisBar:Point("RIGHT", SV.UIParent, "RIGHT", -space, 0) elseif(i == 5) then - thisBar:Point("BOTTOMRIGHT", _G["SVUI_ActionBar1"], "BOTTOMLEFT", -4, 0) + thisBar:Point("BOTTOMRIGHT", _G["SVUI_ActionBar1"], "BOTTOMLEFT", -space, 0) else - thisBar:Point("BOTTOM", _G["SVUI_ActionBar2"], "TOP", 0, 4) + thisBar:Point("BOTTOM", _G["SVUI_ActionBar2"], "TOP", 0, space) end local bg = CreateFrame("Frame", nil, thisBar) @@ -1037,7 +1038,7 @@ CreateActionBars = function(self) ]]) self:RefreshBar(barID) - SV:SetSVMovable(thisBar, L[barID], nil, nil, nil, "ALL, ACTIONBARS") + SV.Mentalo:Add(thisBar, L[barID], nil, nil, nil, "ALL, ACTIONBARS") end end @@ -1053,7 +1054,7 @@ do 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 + if texture == "Interface\\Icons\\Spell_Nature_WispSplode" and SV.db.SVBar.Stance.style == "darkenInactive" then _, _, texture = GetSpellInfo(name) end @@ -1080,7 +1081,7 @@ do if button.checked then button.checked:SetAlpha(1) end - if MOD.db.Stance.style == "darkenInactive" then + if SV.db.SVBar.Stance.style == "darkenInactive" then icon:SetVertexColor(0.25, 0.25, 0.25) else icon:SetVertexColor(1, 1, 1) @@ -1154,7 +1155,7 @@ do local barID = "Stance"; local parent = _G["SVUI_ActionBar1"] local maxForms = GetNumShapeshiftForms(); - if self.db["Bar2"].enable then + if SV.db.SVBar["Bar2"].enable then parent = _G["SVUI_ActionBar2"] end @@ -1189,7 +1190,7 @@ do self:RegisterEvent("UPDATE_SHAPESHIFT_FORM", SetStanceBarButtons) self:RegisterEvent("ACTIONBAR_PAGE_CHANGED", SetStanceBarButtons) UpdateShapeshiftForms() - SV:SetSVMovable(stanceBar, L["Stance Bar"], nil, -3, nil, "ALL, ACTIONBARS") + SV.Mentalo:Add(stanceBar, L["Stance Bar"], nil, -3, nil, "ALL, ACTIONBARS") self:RefreshBar("Stance") SetStanceBarButtons() self:UpdateBarBindings(false, true) @@ -1265,7 +1266,7 @@ do CreatePetBar = function(self) local barID = "Pet"; local parent = _G["SVUI_ActionBar1"] - if self.db["Bar2"].enable then + if SV.db.SVBar["Bar2"].enable then parent = _G["SVUI_ActionBar2"] end @@ -1307,13 +1308,13 @@ do self:RegisterEvent("PLAYER_FARSIGHT_FOCUS_CHANGED", RefreshPet) self:RegisterEvent("PET_BAR_UPDATE_COOLDOWN", PetActionBar_UpdateCooldowns) - SV:SetSVMovable(petBar, L["Pet Bar"], nil, nil, nil, "ALL, ACTIONBARS") + SV.Mentalo:Add(petBar, L["Pet Bar"], nil, nil, nil, "ALL, ACTIONBARS") end end CreateMicroBar = function(self) - local buttonSize = self.db.Micro.buttonsize or 30; - local spacing = self.db.Micro.buttonspacing or 1; + local buttonSize = SV.db.SVBar.Micro.buttonsize or 30; + local spacing = SV.db.SVBar.Micro.buttonspacing or 1; local barWidth = (buttonSize + spacing) * 13; local microBar = NewFrame('Frame','SVUI_MicroBar',SV.UIParent) microBar:Size(barWidth,buttonSize + 6) @@ -1355,7 +1356,7 @@ CreateMicroBar = function(self) buttonMask.icon:SetTexCoord(data[2],data[3],data[4],data[5]) buttonMask.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) button.overlay = buttonMask; - button._fade = self.db.Micro.mouseover + button._fade = SV.db.SVBar.Micro.mouseover button:HookScript('OnEnter', MicroButton_OnEnter) button:HookScript('OnLeave', MicroButton_OnLeave) button:Show() @@ -1376,7 +1377,7 @@ CreateMicroBar = function(self) SVUIMicroButtonsParent(microBar) SVUIMicroButton_SetNormal() - SV:SetSVMovable(microBar, L["Micro Bar"]) + SV.Mentalo:Add(microBar, L["Micro Bar"]) RefreshMicrobar() @@ -1424,7 +1425,7 @@ local CreateExtraBar = function(self) if HasExtraActionBar()then ExtraActionBarFrame:Show() end - SV:SetSVMovable(specialBar, L["Boss Button"], nil, nil, nil, "ALL, ACTIONBAR") + SV.Mentalo:Add(specialBar, L["Boss Button"], nil, nil, nil, "ALL, ACTIONBAR") end --[[ ########################################################## @@ -1553,7 +1554,7 @@ function MOD:ReLoad() end function MOD:Load() - if not self.db.enable then return end + if not SV.db.SVBar.enable then return end RemoveDefaults(); self:UpdateBarPagingDefaults() @@ -1582,227 +1583,4 @@ function MOD:Load() SetSpellFlyoutHook() self.IsLoaded = true -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -CONFIGS["SVBar"] = { - ["enable"] = true, - ["font"] = "Roboto", - ["fontSize"] = 11, - ["fontOutline"] = "OUTLINE", - ["countFont"] = "SVUI Number Font", - ["countFontSize"] = 11, - ["countFontOutline"] = "OUTLINE", - ["cooldownSize"] = 18, - ["rightClickSelf"] = false, - ["macrotext"] = false, - ["hotkeytext"] = false, - ["hotkeyAbbrev"] = true, - ["showGrid"] = true, - ["unc"] = {0.8, 0.1, 0.1, 0.7}, - ["unpc"] = {0.5, 0.5, 1, 0.7}, - ["keyDown"] = false, - ["unlock"] = "SHIFT", - ["Micro"] = { - ["enable"] = true, - ["mouseover"] = true, - ["alpha"] = 1, - ["buttonsize"] = 30, - ["buttonspacing"] = 4, - ["yOffset"] = 4 - }, - ["Bar1"] = { - ["enable"] = true, - ["buttons"] = 12, - ["mouseover"] = false, - ["buttonsPerRow"] = 12, - ["point"] = "BOTTOMLEFT", - ["backdrop"] = false, - ["buttonsize"] = 32, - ["buttonspacing"] = 2, - ["useCustomPaging"] = true, - ["useCustomVisibility"] = false, - ["customVisibility"] = "[petbattle] hide; show", - ["customPaging"] = { - ["HUNTER"] = "", - ["WARLOCK"] = "[form:2] 10;", - ["PRIEST"] = "[bonusbar:1] 7;", - ["PALADIN"] = "", - ["MAGE"] = "", - ["ROGUE"] = "[stance:1] 7; [stance:2] 7; [stance:3] 7; [bonusbar:1] 7; [form:3] 7;", - ["DRUID"] = "[bonusbar:1, nostealth] 7; [bonusbar:1, stealth] 8; [bonusbar:2] 8; [bonusbar:3] 9; [bonusbar:4] 10;", - ["SHAMAN"] = "", - ["WARRIOR"] = "", - ["DEATHKNIGHT"] = "", - ["MONK"] = "[bonusbar:1] 7; [bonusbar:2] 8; [bonusbar:3] 9;", - }, - ["alpha"] = 1 - }, - ["Bar2"] = { - ["enable"] = false, - ["mouseover"] = false, - ["buttons"] = 12, - ["buttonsPerRow"] = 12, - ["point"] = "BOTTOMLEFT", - ["backdrop"] = false, - ["buttonsize"] = 32, - ["buttonspacing"] = 2, - ["useCustomPaging"] = false, - ["useCustomVisibility"] = false, - ["customVisibility"] = "[vehicleui] hide; [overridebar] hide; [petbattle] hide; show", - ["customPaging"] = { - ["HUNTER"] = "", - ["WARLOCK"] = "", - ["PRIEST"] = "", - ["PALADIN"] = "", - ["MAGE"] = "", - ["ROGUE"] = "", - ["DRUID"] = "", - ["SHAMAN"] = "", - ["WARRIOR"] = "", - ["DEATHKNIGHT"] = "", - ["MONK"] = "", - }, - ["alpha"] = 1 - }, - ["Bar3"] = { - ["enable"] = true, - ["mouseover"] = false, - ["buttons"] = 6, - ["buttonsPerRow"] = 6, - ["point"] = "BOTTOMLEFT", - ["backdrop"] = false, - ["buttonsize"] = 32, - ["buttonspacing"] = 2, - ["useCustomPaging"] = false, - ["useCustomVisibility"] = false, - ["customVisibility"] = "[vehicleui] hide; [overridebar] hide; [petbattle] hide; show", - ["customPaging"] = { - ["HUNTER"] = "", - ["WARLOCK"] = "", - ["PRIEST"] = "", - ["PALADIN"] = "", - ["MAGE"] = "", - ["ROGUE"] = "", - ["DRUID"] = "", - ["SHAMAN"] = "", - ["WARRIOR"] = "", - ["DEATHKNIGHT"] = "", - ["MONK"] = "", - }, - ["alpha"] = 1 - }, - ["Bar4"] = { - ["enable"] = true, - ["mouseover"] = true, - ["buttons"] = 12, - ["buttonsPerRow"] = 1, - ["point"] = "TOPRIGHT", - ["backdrop"] = false, - ["buttonsize"] = 32, - ["buttonspacing"] = 2, - ["useCustomPaging"] = false, - ["useCustomVisibility"] = false, - ["customVisibility"] = "[vehicleui] hide; [overridebar] hide; [petbattle] hide; show", - ["customPaging"] = { - ["HUNTER"] = "", - ["WARLOCK"] = "", - ["PRIEST"] = "", - ["PALADIN"] = "", - ["MAGE"] = "", - ["ROGUE"] = "", - ["DRUID"] = "", - ["SHAMAN"] = "", - ["WARRIOR"] = "", - ["DEATHKNIGHT"] = "", - ["MONK"] = "", - }, - ["alpha"] = 1 - }, - ["Bar5"] = { - ["enable"] = true, - ["mouseover"] = false, - ["buttons"] = 6, - ["buttonsPerRow"] = 6, - ["point"] = "BOTTOMLEFT", - ["backdrop"] = false, - ["buttonsize"] = 32, - ["buttonspacing"] = 2, - ["useCustomPaging"] = false, - ["useCustomVisibility"] = false, - ["customVisibility"] = "[vehicleui] hide; [overridebar] hide; [petbattle] hide; show", - ["customPaging"] = { - ["HUNTER"] = "", - ["WARLOCK"] = "", - ["PRIEST"] = "", - ["PALADIN"] = "", - ["MAGE"] = "", - ["ROGUE"] = "", - ["DRUID"] = "", - ["SHAMAN"] = "", - ["WARRIOR"] = "", - ["DEATHKNIGHT"] = "", - ["MONK"] = "", - }, - ["alpha"] = 1 - }, - ["Bar6"] = { - ["enable"] = false, - ["mouseover"] = false, - ["buttons"] = 12, - ["buttonsPerRow"] = 12, - ["point"] = "BOTTOMLEFT", - ["backdrop"] = false, - ["buttonsize"] = 32, - ["buttonspacing"] = 2, - ["useCustomPaging"] = false, - ["useCustomVisibility"] = false, - ["customVisibility"] = "[vehicleui] hide; [overridebar] hide; [petbattle] hide; show", - ["customPaging"] = { - ["HUNTER"] = "", - ["WARLOCK"] = "", - ["PRIEST"] = "", - ["PALADIN"] = "", - ["MAGE"] = "", - ["ROGUE"] = "", - ["DRUID"] = "", - ["SHAMAN"] = "", - ["WARRIOR"] = "", - ["DEATHKNIGHT"] = "", - ["MONK"] = "", - }, - ["alpha"] = 1 - }, - ["Pet"] = { - ["enable"] = true, - ["mouseover"] = false, - ["buttons"] = NUM_PET_ACTION_SLOTS, - ["buttonsPerRow"] = NUM_PET_ACTION_SLOTS, - ["point"] = "TOPLEFT", - ["backdrop"] = false, - ["buttonsize"] = 24, - ["buttonspacing"] = 3, - ["useCustomVisibility"] = false, - ["customVisibility"] = "[petbattle] hide; [pet, novehicleui, nooverridebar, nopossessbar] show; hide", - ["alpha"] = 1 - }, - ["Stance"] = { - ["enable"] = true, - ["style"] = "darkenInactive", - ["mouseover"] = false, - ["buttons"] = NUM_STANCE_SLOTS, - ["buttonsPerRow"] = NUM_STANCE_SLOTS, - ["point"] = "BOTTOMRIGHT", - ["backdrop"] = false, - ["buttonsize"] = 24, - ["buttonspacing"] = 5, - ["useCustomVisibility"] = false, - ["customVisibility"] = "[petbattle] hide; show", - ["alpha"] = 1 - }, -} - -Registry:NewPackage(MOD, "SVBar") \ No newline at end of file +end \ 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 fc7949e..a849539 100644 --- a/Interface/AddOns/SVUI/packages/aura/SVAura.lua +++ b/Interface/AddOns/SVUI/packages/aura/SVAura.lua @@ -42,12 +42,10 @@ local tremove, twipe = table.remove, table.wipe; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); +local SV = select(2, ...) +local L = SV.L local LSM = LibStub("LibSharedMedia-3.0") -local CONFIGS = SV.private -local MOD = {}; +local MOD = SV:NewPackage("SVAura", BUFFOPTIONS_LABEL); --[[ ########################################################## LOCAL VARS @@ -292,16 +290,16 @@ do end aura.Skinned = true end - local font = LSM:Fetch("font", MOD.db.font) + local font = LSM:Fetch("font", SV.db.SVAura.font) aura.texture = aura:CreateTexture(nil, "BORDER") aura.texture:FillInner(aura, 2, 2) aura.texture:SetTexCoord(0.1, 0.9, 0.1, 0.9) aura.count = aura:CreateFontString(nil, "ARTWORK") - aura.count:SetPoint("BOTTOMRIGHT", (-1 + MOD.db.countOffsetH), (1 + MOD.db.countOffsetV)) - aura.count:SetFontTemplate(font, MOD.db.fontSize, MOD.db.fontOutline) + aura.count:SetPoint("BOTTOMRIGHT", (-1 + SV.db.SVAura.countOffsetH), (1 + SV.db.SVAura.countOffsetV)) + aura.count:SetFontTemplate(font, SV.db.SVAura.fontSize, SV.db.SVAura.fontOutline) aura.time = aura:CreateFontString(nil, "ARTWORK") - aura.time:SetPoint("TOP", aura, "BOTTOM", 1 + MOD.db.timeOffsetH, 0 + MOD.db.timeOffsetV) - aura.time:SetFontTemplate(font, MOD.db.fontSize, MOD.db.fontOutline) + aura.time:SetPoint("TOP", aura, "BOTTOM", 1 + SV.db.SVAura.timeOffsetH, 0 + SV.db.SVAura.timeOffsetV) + aura.time:SetFontTemplate(font, SV.db.SVAura.fontSize, SV.db.SVAura.fontOutline) aura.highlight = aura:CreateTexture(nil, "HIGHLIGHT") aura.highlight:SetTexture(0, 0, 0, 0.45) aura.highlight:FillInner() @@ -384,7 +382,7 @@ do end function MOD:ToggleConsolidatedBuffs() - if MOD.db.hyperBuffs.enable then + if SV.db.SVAura.hyperBuffs.enable then CB_HEIGHT = Minimap:GetHeight() CB_WIDTH = (CB_HEIGHT / 5) + 4 SVUI_AurasAnchor:SetSize(CB_WIDTH, CB_HEIGHT) @@ -428,7 +426,7 @@ do function MOD:Update_ConsolidatedBuffsSettings(event) SVUI_ConsolidatedBuffs:SetAllPoints(SVUI_AurasAnchor) local swapIndex1, swapIndex2, hideIndex1, hideIndex2 - if MOD.db.hyperBuffs.filter then + if SV.db.SVAura.hyperBuffs.filter then if SV.ClassRole == 'C' then swapIndex1 = 4 hideIndex1 = 3 @@ -484,12 +482,12 @@ end function MOD:UpdateAuraHeader(auraHeader, auraType) if(InCombatLockdown() or not auraHeader) then return end - local db = self.db[auraType] + local db = SV.db.SVAura[auraType] local showBy = db.showBy - local font = LSM:Fetch("font", self.db.font) + local font = LSM:Fetch("font", SV.db.SVAura.font) if auraType == "buffs" then - auraHeader:SetAttribute("consolidateTo", self.db.hyperBuffs.enable == true and 1 or 0) + auraHeader:SetAttribute("consolidateTo", SV.db.SVAura.hyperBuffs.enable == true and 1 or 0) auraHeader:SetAttribute("weaponTemplate", ("SVUI_AuraTemplate%d"):format(db.size)) end @@ -528,9 +526,9 @@ function MOD:UpdateAuraHeader(auraHeader, auraType) end if(auraChild.time) then auraChild.time:ClearAllPoints() - auraChild.time:SetPoint("TOP", auraChild, "BOTTOM", 1 + self.db.timeOffsetH, self.db.timeOffsetV) + auraChild.time:SetPoint("TOP", auraChild, "BOTTOM", 1 + SV.db.SVAura.timeOffsetH, SV.db.SVAura.timeOffsetV) auraChild.count:ClearAllPoints() - auraChild.count:SetPoint("BOTTOMRIGHT", -1 + self.db.countOffsetH, self.db.countOffsetV) + auraChild.count:SetPoint("BOTTOMRIGHT", -1 + SV.db.SVAura.countOffsetH, SV.db.SVAura.countOffsetV) end if (i > (db.maxWraps * db.wrapAfter) and auraChild:IsShown()) then auraChild:Hide() @@ -562,7 +560,7 @@ function MOD:ReLoad() CB_HEIGHT = Minimap:GetHeight() CB_WIDTH = (CB_HEIGHT / 5) + 4 SVUI_AurasAnchor:SetSize(CB_WIDTH, CB_HEIGHT) - AURA_FADE_TIME = MOD.db.fadeBy + AURA_FADE_TIME = SV.db.SVAura.fadeBy MOD:UpdateAuraHeader(SVUI_PlayerBuffs, "buffs"); MOD:UpdateAuraHeader(SVUI_PlayerDebuffs, "debuffs"); end @@ -595,50 +593,5 @@ function MOD:Load() self:Update_ConsolidatedBuffsSettings() - SV:SetSVMovable(auras, L["Auras Frame"]) -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -CONFIGS["SVAura"] = { - ["enable"] = true, - ["disableBlizzard"] = true, - ["font"] = "SVUI Number Font", - ["fontSize"] = 12, - ["fontOutline"] = "THINOUTLINE", - ["countOffsetV"] = 0, - ["countOffsetH"] = 0, - ["timeOffsetV"] = -4, - ["timeOffsetH"] = 0, - ["hyperBuffs"] = { - ["enable"] = true, - ["filter"] = true, - }, - ["fadeBy"] = 5, - ["buffs"] = { - ["showBy"] = "LEFT_DOWN", - ["wrapAfter"] = 12, - ["maxWraps"] = 3, - ["wrapXOffset"] = 6, - ["wrapYOffset"] = 16, - ["sortMethod"] = "TIME", - ["sortDir"] = "-", - ["isolate"] = 1, - ["size"] = 32, - }, - ["debuffs"] = { - ["showBy"] = "LEFT_DOWN", - ["wrapAfter"] = 12, - ["maxWraps"] = 1, - ["wrapXOffset"] = 6, - ["wrapYOffset"] = 16, - ["sortMethod"] = "TIME", - ["sortDir"] = "-", - ["isolate"] = 1, - ["size"] = 32, - }, -} - -Registry:NewPackage(MOD, "SVAura") \ No newline at end of file + SV.Mentalo:Add(auras, L["Auras Frame"]) +end \ 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 1dc4d5d..421cc81 100644 --- a/Interface/AddOns/SVUI/packages/bag/SVBag.lua +++ b/Interface/AddOns/SVUI/packages/bag/SVBag.lua @@ -40,11 +40,9 @@ local twipe = table.wipe; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); -local CONFIGS = SV.private -local MOD = {}; +local SV = select(2, ...) +local L = SV.L +local MOD = SV:NewPackage("SVBag", L["Bags"]); local TTIP = SV.SVTip; --[[ ########################################################## @@ -347,9 +345,9 @@ 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 buttonSize = isBank and SV.db.SVBag.bankSize or SV.db.SVBag.bagSize; local buttonSpacing = 8; - 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 containerWidth = (SV.db.SVBag.alignToChat == true and (isBank and (SV.db.SVDock.dockLeftWidth - 14) or (SV.db.SVDock.dockRightWidth - 14))) or (isBank and SV.db.SVBag.bankWidth) or SV.db.SVBag.bagWidth local numContainerColumns = floor(containerWidth / (buttonSize + buttonSpacing)); local holderWidth = ((buttonSize + buttonSpacing) * numContainerColumns) - buttonSpacing; local numContainerRows = 0; @@ -365,10 +363,10 @@ function MOD:Layout(isBank, isReagent) 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); + globalName = "SVUI_BankBag" .. (bagID - 4); f.ContainerHolder[i] = NewFrame("CheckButton", globalName, f.ContainerHolder, "BankItemButtonBagTemplate") else - globalName = "SuperMainBag" .. bagID .. "Slot"; + globalName = "SVUI_MainBag" .. bagID .. "Slot"; f.ContainerHolder[i] = NewFrame("CheckButton", globalName, f.ContainerHolder, "BagSlotButtonTemplate") end --f.ContainerHolder[i]:SetSlotTemplate(true, 2, 4, 4, true) @@ -377,22 +375,18 @@ function MOD:Layout(isBank, isReagent) f.ContainerHolder[i]:SetPushedTexture("") f.ContainerHolder[i]:SetScript("OnClick", nil) f.ContainerHolder[i].id = isBank and bagID or bagID + 1; - f.ContainerHolder[i]:HookScript("OnEnter", function(self) - MOD.UseSlotFading(self, f) end) - f.ContainerHolder[i]:HookScript("OnLeave", function(self) - MOD.FlushSlotFading(self, f) end) - if isBank then - f.ContainerHolder[i]:SetID(bagID) - if not f.ContainerHolder[i].tooltipText then - f.ContainerHolder[i].tooltipText = "" - end + f.ContainerHolder[i]:SetID(isBank and bagID or (bagID + 1)) + f.ContainerHolder[i]:HookScript("OnEnter", function(self) MOD.UseSlotFading(self, f) end) + f.ContainerHolder[i]:HookScript("OnLeave", function(self) MOD.FlushSlotFading(self, f) end) + if(isBank and (not f.ContainerHolder[i].tooltipText)) then + f.ContainerHolder[i].tooltipText = "" end f.ContainerHolder[i].iconTexture = _G[f.ContainerHolder[i]:GetName().."IconTexture"]; f.ContainerHolder[i].iconTexture:FillInner() f.ContainerHolder[i].iconTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9 ) end f.ContainerHolder:Size(((buttonSize + buttonSpacing) * (isBank and i - 1 or i)) + buttonSpacing, buttonSize + (buttonSpacing * 2)) - if isBank then + if(isBank and f.ContainerHolder[i].GetInventorySlot) then BankFrameItemButton_Update(f.ContainerHolder[i]) BankFrameItemButton_UpdateLocked(f.ContainerHolder[i]) end @@ -481,7 +475,7 @@ function MOD:Layout(isBank, isReagent) f.Bags[bagID].numSlots = numSlots; end if(self.isBank and not self.isReagent) then - if self.ContainerHolder[i] then + if(self.ContainerHolder[i] and self.ContainerHolder[i].GetInventorySlot) then BankFrameItemButton_Update(self.ContainerHolder[i]) BankFrameItemButton_UpdateLocked(self.ContainerHolder[i]) end @@ -558,17 +552,17 @@ function MOD:VendorGrays(arg1, arg2, arg3) end function MOD:ModifyBags() - local docked = self.db.alignToChat + local docked = SV.db.SVBag.alignToChat local anchor, x, y if self.BagFrame then local parent = docked and RightSuperDock or SV.UIParent - local anchor, x, y = self.db.bags.point, self.db.bags.xOffset, self.db.bags.yOffset + local anchor, x, y = SV.db.SVBag.bags.point, SV.db.SVBag.bags.xOffset, SV.db.SVBag.bags.yOffset self.BagFrame:ClearAllPoints() self.BagFrame:Point(anchor, parent, anchor, x, y) end if self.BankFrame then local parent = docked and LeftSuperDock or SV.UIParent - local anchor, x, y = self.db.bank.point, self.db.bank.xOffset, self.db.bank.yOffset + local anchor, x, y = SV.db.SVBag.bank.point, SV.db.SVBag.bank.xOffset, SV.db.SVBag.bank.yOffset self.BankFrame:ClearAllPoints() self.BankFrame:Point(anchor, parent, anchor, x, y) end @@ -576,12 +570,12 @@ end do local function Bags_OnEnter() - if MOD.db.bagBar.mouseover ~= true then return end + if SV.db.SVBag.bagBar.mouseover ~= true then return end SV:SecureFadeIn(SVUI_BagBar, 0.2, SVUI_BagBar:GetAlpha(), 1) end local function Bags_OnLeave() - if MOD.db.bagBar.mouseover ~= true then return end + if SV.db.SVBag.bagBar.mouseover ~= true then return end SV:SecureFadeOut(SVUI_BagBar, 0.2, SVUI_BagBar:GetAlpha(), 0) end @@ -641,16 +635,16 @@ do if not self.BagBarLoaded then LoadBagBar() end - if self.db.bagBar.mouseover then + if SV.db.SVBag.bagBar.mouseover then SVUI_BagBar:SetAlpha(0) else SVUI_BagBar:SetAlpha(1) 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 + local showBy = SV.db.SVBag.bagBar.showBy + local sortDir = SV.db.SVBag.bagBar.sortDirection + local bagSize = SV.db.SVBag.bagBar.size + local bagSpacing = SV.db.SVBag.bagBar.spacing for i = 1, #SVUI_BagBar.buttons do local button = SVUI_BagBar.buttons[i] @@ -695,10 +689,10 @@ do if not SVUI_BagBar_MOVE then SVUI_BagBar:SetPanelTemplate("Default") - SV:SetSVMovable(SVUI_BagBar, L["Bags Bar"]) + SV.Mentalo:Add(SVUI_BagBar, L["Bags Bar"]) end - if self.db.bagBar.showBackdrop then + if SV.db.SVBag.bagBar.showBackdrop then SVUI_BagBar.Panel:Show() else SVUI_BagBar.Panel:Hide() @@ -1018,7 +1012,7 @@ do frame.sortButton.ttText = L["Sort Bags"] frame.sortButton:SetScript("OnEnter", Tooltip_Show) frame.sortButton:SetScript("OnLeave", Tooltip_Hide) - local Sort_OnClick = (SV.___interface >= 60000) and SortBankBags or MOD:RunSortingProcess(MOD.Sort, "bags") + local Sort_OnClick = (SV.GameVersion >= 60000) and SortBankBags or MOD:RunSortingProcess(MOD.Sort, "bags") frame.sortButton:SetScript("OnClick", Sort_OnClick) frame.stackButton = NewFrame("Button", nil, frame) @@ -1160,7 +1154,7 @@ do frame.sortButton.ttText = L["Sort Bags"] frame.sortButton:SetScript("OnEnter", Tooltip_Show) frame.sortButton:SetScript("OnLeave", Tooltip_Hide) - local Sort_OnClick = (SV.___interface >= 60000) and SortReagentBankBags or MOD:RunSortingProcess(MOD.Sort, "bank") + local Sort_OnClick = (SV.GameVersion >= 60000) and SortReagentBankBags or MOD:RunSortingProcess(MOD.Sort, "bank") frame.sortButton:SetScript("OnClick", Sort_OnClick) frame.stackButton = NewFrame("Button", nil, frame) @@ -1228,7 +1222,7 @@ do end frame.purchaseBagButton:SetScript("OnClick", PurchaseBtn_OnClick) - if(SV.___interface >= 60000) then + if(SV.GameVersion >= 60000) then frame.swapButton = NewFrame("Button", nil, frame) frame.swapButton:Point("TOPRIGHT", frame, "TOPRIGHT", -40, -10) frame.swapButton:Size(25, 25) @@ -1263,9 +1257,9 @@ function MOD:RefreshTokens() set:ClearAllPoints() if name then set.icon:SetTexture(icon) - if MOD.db.currencyFormat == 'ICON_TEXT' then + if SV.db.SVBag.currencyFormat == 'ICON_TEXT' then set.text:SetText(name..': '..count) - elseif MOD.db.currencyFormat == 'ICON' then + elseif SV.db.SVBag.currencyFormat == 'ICON' then set.text:SetText(count) end set.currencyID = currencyID; @@ -1348,7 +1342,7 @@ do end function MOD:BANKFRAME_OPENED() - local hasReagent = (SV.___interface >= 60000) + local hasReagent = (SV.GameVersion >= 60000) if not MOD.BankFrame then MOD:MakeBankOrReagent() MOD:ModifyBags() @@ -1404,7 +1398,6 @@ BUILD FUNCTION / UPDATE function MOD:ReLoad() if not SV.db.SVBag.enable then return end self:Layout(); - self:Layout(true); self:ModifyBags(); self:ModifyBagBar(); end @@ -1428,50 +1421,7 @@ function MOD:Load() self:RegisterEvent("PLAYER_ENTERING_WORLD") self:RegisterEvent("PLAYER_TRADE_MONEY", "UpdateGoldText") self:RegisterEvent("TRADE_MONEY_CHANGED", "UpdateGoldText") - if(SV.___interface >= 60000) then self:RegisterEvent("PLAYERBANKBAGSLOTS_CHANGED"); end + if(SV.GameVersion >= 60000) then self:RegisterEvent("PLAYERBANKBAGSLOTS_CHANGED"); end StackSplitFrame:SetFrameStrata("DIALOG") self.BagFrame:RefreshBagsSlots() -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -CONFIGS["SVBag"] = { - ["incompatible"] = { - ["AdiBags"] = true, - ["ArkInventory"] = true, - ["Bagnon"] = true, - }, - ["enable"] = true, - ["sortInverted"] = false, - ["bags"] = { - ["xOffset"] = -40, - ["yOffset"] = 40, - ["point"] = "BOTTOMRIGHT", - }, - ["bank"] = { - ["xOffset"] = 40, - ["yOffset"] = 40, - ["point"] = "BOTTOMLEFT", - }, - ["bagSize"] = 34, - ["bankSize"] = 34, - ["alignToChat"] = false, - ["bagWidth"] = 525, - ["bankWidth"] = 525, - ["currencyFormat"] = "ICON", - ["ignoreItems"] = "", - ["bagTools"] = true, - ["bagBar"] = { - ["enable"] = false, - ["showBy"] = "VERTICAL", - ["sortDirection"] = "ASCENDING", - ["size"] = 30, - ["spacing"] = 4, - ["showBackdrop"] = false, - ["mouseover"] = false, - }, -} - -Registry:NewPackage(MOD, "SVBag"); \ No newline at end of file +end \ 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 77ab520..ff08004 100644 --- a/Interface/AddOns/SVUI/packages/bag/tools/breakstuff.lua +++ b/Interface/AddOns/SVUI/packages/bag/tools/breakstuff.lua @@ -32,8 +32,8 @@ local tremove, tcopy, twipe, tsort, tcat = table.remove, table.copy, table.wipe, GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale(); +local SV = select(2, ...) +local L = SV.L; local MOD = SV.SVBag; local TTIP = SV.SVTip; --[[ diff --git a/Interface/AddOns/SVUI/packages/bag/tools/sorting.lua b/Interface/AddOns/SVUI/packages/bag/tools/sorting.lua index 4a2213f..b1dc03e 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 SVUI_ADDON_NAME, SV = ... -local L = LibLocale(); +local SV = select(2, ...) +local L = SV.L; local MOD = SV.SVBag; --[[ ########################################################## @@ -436,7 +436,7 @@ do if not sorter then sorter = reverse and ReverseSort or DefaultSort end if not itemTypes then BuildSortOrder() end twipe(blackListedSlots) - local ignoreItems = MOD.db.ignoreItems + local ignoreItems = SV.db.SVBag.ignoreItems ignoreItems = ignoreItems:gsub(',%s', ',') SetBlockedCache(split(",", ignoreItems)) for i, bag, slot in IterateBagsForSorting(bags, nil, 'both') do @@ -510,14 +510,14 @@ do if bagType ~= 'Normal' then MOD.Stack(sortedBags, sortedBags, IsPartial) MOD.Stack(sortingCache[1]['Normal'], sortedBags) - SortFiller(sortingCache[1]['Normal'], sortedBags, MOD.db.sortInverted) - Sorter(sortedBags, nil, MOD.db.sortInverted) + SortFiller(sortingCache[1]['Normal'], sortedBags, SV.db.SVBag.sortInverted) + Sorter(sortedBags, nil, SV.db.SVBag.sortInverted) twipe(sortedBags) end end if sortingCache[1]['Normal'] then MOD.Stack(sortingCache[1]['Normal'], sortingCache[1]['Normal'], IsPartial) - Sorter(sortingCache[1]['Normal'], nil, MOD.db.sortInverted) + Sorter(sortingCache[1]['Normal'], nil, SV.db.SVBag.sortInverted) twipe(sortingCache[1]['Normal']) end twipe(sortingCache[1]) diff --git a/Interface/AddOns/SVUI/packages/chat/SVChat.lua b/Interface/AddOns/SVUI/packages/chat/SVChat.lua index 698c9b9..bb31726 100644 --- a/Interface/AddOns/SVUI/packages/chat/SVChat.lua +++ b/Interface/AddOns/SVUI/packages/chat/SVChat.lua @@ -34,12 +34,10 @@ local twipe = table.wipe; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); +local SV = select(2, ...) +local L = SV.L local LSM = LibStub("LibSharedMedia-3.0") -local CONFIGS = SV.private -local MOD = {}; +local MOD = SV:NewPackage("SVChat", L["Chat"]); --[[ ########################################################## LOCAL VARS @@ -174,7 +172,7 @@ do local function SetEmoticon(text) if not text then return end - if (not MOD.db.smileys or text:find(" / run") or text:find(" / dump") or text:find(" / script")) then + if (not SV.db.SVChat.smileys or text:find(" / run") or text:find(" / dump") or text:find(" / script")) then return text end local result = ""; @@ -906,22 +904,22 @@ end function MOD:UpdateLocals() 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 = LSM:Fetch("font", self.db.font); + CHAT_THROTTLE = SV.db.SVChat.throttleInterval; + CHAT_ALLOW_URL = SV.db.SVChat.url; + CHAT_HOVER_URL = SV.db.SVChat.hyperlinkHover; + CHAT_STICKY = SV.db.SVChat.sticky; + CHAT_FONT = LSM:Fetch("font", SV.db.SVChat.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 = LSM:Fetch("font", self.db.tabFont); - TAB_FONTSIZE = self.db.tabFontSize; - TAB_FONTOUTLINE = self.db.tabFontOutline; - CHAT_FADING = self.db.fade; - CHAT_PSST = LSM:Fetch("sound", self.db.psst); - TIME_STAMP_MASK = self.db.timeStampFormat; + CHAT_FONTOUTLINE = SV.db.SVChat.fontOutline; + TAB_WIDTH = SV.db.SVChat.tabWidth; + TAB_HEIGHT = SV.db.SVChat.tabHeight; + TAB_SKINS = SV.db.SVChat.tabStyled; + TAB_FONT = LSM:Fetch("font", SV.db.SVChat.tabFont); + TAB_FONTSIZE = SV.db.SVChat.tabFontSize; + TAB_FONTOUTLINE = SV.db.SVChat.tabFontOutline; + CHAT_FADING = SV.db.SVChat.fade; + CHAT_PSST = LSM:Fetch("sound", SV.db.SVChat.psst); + TIME_STAMP_MASK = SV.db.SVChat.timeStampFormat; if(CHAT_THROTTLE and CHAT_THROTTLE == 0) then twipe(THROTTLE_CACHE) end @@ -967,35 +965,4 @@ function MOD:Load() _G.InterfaceOptionsSocialPanelChatStyle:EnableMouse(false) _G.InterfaceOptionsSocialPanelChatStyleButton:Hide() _G.InterfaceOptionsSocialPanelChatStyle:SetAlpha(0) -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -CONFIGS["SVChat"] = { - ["enable"] = true, - ["tabHeight"] = 20, - ["tabWidth"] = 75, - ["tabStyled"] = true, - ["font"] = "Roboto", - ["fontOutline"] = "OUTLINE", - ["tabFont"] = "SVUI Alert Font", - ["tabFontSize"] = 10, - ["tabFontOutline"] = "OUTLINE", - ["url"] = true, - ["shortChannels"] = true, - ["hyperlinkHover"] = true, - ["throttleInterval"] = 45, - ["fade"] = false, - ["sticky"] = true, - ["smileys"] = true, - ["secretWordTone"] = "None", - ["psst"] = "Whisper Alert", - ["noWipe"] = false, - ["timeStampFormat"] = "NONE", - ["secretWords"] = "%MYNAME%, SVUI", - ["basicTools"] = true, -} - -Registry:NewPackage(MOD, "SVChat") \ No newline at end of file +end \ 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 06aae69..080b9eb 100644 --- a/Interface/AddOns/SVUI/packages/dock/SVDock.lua +++ b/Interface/AddOns/SVUI/packages/dock/SVDock.lua @@ -33,17 +33,16 @@ local format, gsub, strfind, strmatch, tonumber = format, gsub, strfind, strmatc GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); -local CONFIGS = SV.private -local MOD, DOCKLET_CACHE, TOOL_CACHE, SAFETY_CACHE = {}, {}, {}, {}; -local PREV_TOOL, DEFAULT_DOCKLET; +local SV = select(2, ...) +local L = SV.L +local MOD = SV:NewPackage("SVDock", L["Docks"]); --[[ ########################################################## LOCAL VARS ########################################################## ]]-- +local DOCKLET_CACHE, TOOL_CACHE, SAFETY_CACHE = {}, {}, {}; +local PREV_TOOL, DEFAULT_DOCKLET; local AddOnButton = CreateFrame("Button", "SVUI_AddonDocklet", UIParent); local SuperDockletMain = CreateFrame('Frame', 'SuperDockletMain', UIParent); local SuperDockletExtra = CreateFrame('Frame', 'SuperDockletExtra', UIParent); @@ -89,7 +88,7 @@ local function CycleDocklets() end local AlertActivate = function(self, child) - local size = MOD.db.buttonSize or 22; + local size = SV.db.SVDock.buttonSize or 22; self:Height(size) child:ClearAllPoints() child:SetAllPoints(self) @@ -115,16 +114,15 @@ end local ToggleDocks = function(self) GameTooltip:Hide() - if MOD.SuperDockFaded then - MOD.SuperDockFaded = nil; + if SV.cache.Docks.SuperDockFaded then + SV.cache.Docks.SuperDockFaded = nil; SV:SecureFadeIn(LeftSuperDock, 0.2, LeftSuperDock:GetAlpha(), 1) SV:SecureFadeIn(RightSuperDock, 0.2, RightSuperDock:GetAlpha(), 1) else - MOD.SuperDockFaded = true; + SV.cache.Docks.SuperDockFaded = 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 end local Docklet_OnShow = function(self) @@ -158,7 +156,7 @@ local DockButtonDeactivate = function(self) end local DockletButton_OnEnter = function(self, ...) - if MOD.SuperDockFaded then + if SV.cache.Docks.SuperDockFaded then LeftSuperDock:Show() SV:SecureFadeIn(LeftSuperDock, 0.2, LeftSuperDock:GetAlpha(), 1) RightSuperDock:Show() @@ -179,7 +177,7 @@ local DockletButton_OnEnter = function(self, ...) end local DockletButton_OnLeave = function(self, ...) - if MOD.SuperDockFaded then + if SV.cache.Docks.SuperDockFaded then SV:SecureFadeOut(LeftSuperDock, 0.2, LeftSuperDock:GetAlpha(), 0, true) SV:SecureFadeOut(RightSuperDock, 0.2, RightSuperDock:GetAlpha(), 0, true) end @@ -240,7 +238,7 @@ local AddonDockletToggle = function(self) end self:Deactivate() end - if MOD.db.docklets.enableExtra and SuperDockletExtra.FrameName and _G[SuperDockletExtra.FrameName] then + if SV.db.SVDock.docklets.enableExtra and SuperDockletExtra.FrameName and _G[SuperDockletExtra.FrameName] then if not _G[SuperDockletExtra.FrameName]:IsShown() then if not InCombatLockdown() and not SuperDockletExtra:IsShown()then SuperDockletExtra:Show() @@ -428,18 +426,16 @@ local function BorderColorUpdates() SVUIBottomPanel:SetBackdropBorderColor(0,0,0,1) end -Registry:NewCallback(BorderColorUpdates) +SV:NewCallback(BorderColorUpdates) function MOD:CreateDockPanels() - self.SuperDockFaded = SVUI_Cache["Dock"].SuperDockFaded - - local leftWidth = self.db.dockLeftWidth or 350; - local leftHeight = self.db.dockLeftHeight or 180; - local rightWidth = self.db.dockRightWidth or 350; - local rightHeight = self.db.dockRightHeight or 180; - local buttonsize = self.db.buttonSize or 22; - local spacing = self.db.buttonSpacing or 4; - local statBarWidth = self.db.dockStatWidth + local leftWidth = SV.db.SVDock.dockLeftWidth or 350; + local leftHeight = SV.db.SVDock.dockLeftHeight or 180; + local rightWidth = SV.db.SVDock.dockRightWidth or 350; + local rightHeight = SV.db.SVDock.dockRightHeight or 180; + local buttonsize = SV.db.SVDock.buttonSize or 22; + local spacing = SV.db.SVDock.buttonSpacing or 4; + local statBarWidth = SV.db.SVDock.dockStatWidth or defaultStatBarWidth local STATS = SV.SVStats; -- [[ CORNER BUTTON ]] -- @@ -453,7 +449,7 @@ function MOD:CreateDockPanels() leftbutton.icon:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Icons\\SVUI-EMBLEM") leftbutton.TText = L["Toggle Docks"] leftbutton:RegisterForClicks("AnyUp") - MOD:ActivateDockletButton(leftbutton, ToggleDocks) + self:ActivateDockletButton(leftbutton, ToggleDocks) -- [[ TOOLBARS AND OTHER NONSENSE ]] -- local toolbarLeft = CreateFrame("Frame", "SuperDockToolBarLeft", SV.UIParent) @@ -473,7 +469,7 @@ function MOD:CreateDockPanels() leftdock:SetFrameStrata("BACKGROUND") leftdock:Point("BOTTOMLEFT", SV.UIParent, "BOTTOMLEFT", 1, buttonsize + 10) leftdock:Size(leftWidth, leftHeight) - SV:SetSVMovable(leftdock, L["Left Dock"]) + SV.Mentalo:Add(leftdock, L["Left Dock"]) leftalert:SetParent(leftdock) leftalert:SetFrameStrata("BACKGROUND") @@ -500,7 +496,7 @@ function MOD:CreateDockPanels() rightbutton.icon:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-HENCHMAN]]) rightbutton.TText = "Call Henchman!" rightbutton:RegisterForClicks("AnyUp") - MOD:ActivateDockletButton(rightbutton, SV.ToggleHenchman) + self:ActivateDockletButton(rightbutton, SV.ToggleHenchman) -- [[ TOOLBARS AND OTHER NONSENSE ]] -- local toolbarRight = CreateFrame("Frame", "SuperDockToolBarRight", SV.UIParent) @@ -517,7 +513,7 @@ function MOD:CreateDockPanels() rightdock:SetFrameStrata("BACKGROUND") rightdock:Point("BOTTOMRIGHT", SV.UIParent, "BOTTOMRIGHT", -1, buttonsize + 10) rightdock:Size(rightWidth, rightHeight) - SV:SetSVMovable(rightdock, L["Right Dock"]) + SV.Mentalo:Add(rightdock, L["Right Dock"]) rightalert:SetParent(rightdock) rightalert:SetFrameStrata("BACKGROUND") @@ -533,7 +529,7 @@ function MOD:CreateDockPanels() rightwindow:Size(rightWidth, rightHeight) rightdock.backdrop = SetSuperDockStyle(rightwindow) - if MOD.SuperDockFaded then LeftSuperDock:Hide()RightSuperDock:Hide() end + if SV.cache.Docks.SuperDockFaded then LeftSuperDock:Hide() RightSuperDock:Hide() end local toolbarTop = CreateFrame("Frame", "SuperDockToolBarTop", SV.UIParent) toolbarTop:Point("TOPLEFT", SV.UIParent, "TOPLEFT", 2, -4) @@ -750,10 +746,9 @@ SV.CurrentlyDocked = {}; function SV:IsDockletReady(arg) local addon = arg; if arg == "DockletMain" or arg == "DockletExtra" then - addon = MOD.db.docklets[arg] + addon = self.db.SVDock.docklets[arg] end - if addon:find("Skada") then addon = "Skada" end - if addon == nil or addon == "None" or not IsAddOnLoaded(addon) then + if addon == nil or addon == "None" then return false end return true @@ -768,7 +763,9 @@ function SV:RemoveTool() tremove(TOOL_CACHE, i) local width; local height = SuperDockToolBarRight.currentSize; - PREV_TOOL = TOOL_CACHE[#TOOL_CACHE] + local PREV_TOOL = TOOL_CACHE[#TOOL_CACHE] + local xOffset = (#TOOL_CACHE - 1) * (height + 6) + 6 + PREV_TOOL:SetPoint("RIGHT", SuperDockToolBarRight, "RIGHT", (xOffset * -1), 0); width = #TOOL_CACHE * (height + 6) SuperDockToolBarRight:Size(width, height) self:Hide() @@ -780,14 +777,10 @@ function SV:AddTool() SAFETY_CACHE[name] = true; local width; local height = SuperDockToolBarRight.currentSize; - if not PREV_TOOL or PREV_TOOL == self then - self:Point("RIGHT", SuperDockToolBarRight, "RIGHT", -6, 0); - else - self:Point("RIGHT", PREV_TOOL, "LEFT", -6, 0); - end + local xOffset = #TOOL_CACHE * (height + 6) + 6 + self:SetPoint("RIGHT", SuperDockToolBarRight, "RIGHT", (xOffset * -1), 0); tinsert(TOOL_CACHE, self) self.listIndex = #TOOL_CACHE; - PREV_TOOL = self; width = #TOOL_CACHE * (height + 6) SuperDockToolBarRight:Size(width, height) self:Show() @@ -801,38 +794,37 @@ do tremove(DOCKLET_CACHE, i) end - local function UnregisterDocklets() + function SV:ReloadDocklets(alert) + if InCombatLockdown() then return end + local frame, i; - twipe(SV.CurrentlyDocked); - if SV:IsDockletReady("DockletMain") then - frame = MOD.db.docklets.MainWindow + twipe(self.CurrentlyDocked); + if self:IsDockletReady("DockletMain") then + frame = self.db.SVDock.docklets.MainWindow if frame ~= nil and frame ~= "None" and _G[frame] then UnregisterDocklet(frame) - MOD.db.docklets.MainWindow = "None" + self.db.SVDock.docklets.MainWindow = "None" end elseif AddOnButton.IsRegistered then - SV.RemoveTool(AddOnButton) + self.RemoveTool(AddOnButton) AddOnButton.TText = ""; AddOnButton.IsRegistered = false; end - if SV:IsDockletReady("DockletExtra") then - frame = MOD.db.docklets.ExtraWindow + if self:IsDockletReady("DockletExtra") then + frame = self.db.SVDock.docklets.ExtraWindow if frame ~= nil and frame ~= "None" and _G[frame] then UnregisterDocklet(frame) - MOD.db.docklets.ExtraWindow = "None" + self.db.SVDock.docklets.ExtraWindow = "None" end end SuperDockletMain.FrameName = "None" SuperDockletExtra.FrameName = "None" - end - 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 SV:IsDockletReady('DockletMain') then - if SV:IsDockletReady("DockletExtra") and MOD.db.docklets.enableExtra then + local width = self.db.SVDock.dockRightWidth or 350; + local height = (self.db.SVDock.dockRightHeight or 180) - 22 + + if self:IsDockletReady('DockletMain') then + if self:IsDockletReady("DockletExtra") and self.db.SVDock.docklets.enableExtra then width = width * 0.5; end SuperDockletMain:ClearAllPoints() @@ -854,7 +846,7 @@ function SV:RegisterDocklet(name, tooltip, texture, onclick, isdefault) frame.FrameName = name; tinsert(DOCKLET_CACHE, frame); frame.listIndex = #DOCKLET_CACHE; - MOD:CreateBasicToolButton(tooltip, texture, onclick, name, isdefault) + self.SVDock:CreateBasicToolButton(tooltip, texture, onclick, name, isdefault) end end @@ -862,7 +854,7 @@ 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; - MOD.db.docklets.MainWindow = name; + SV.db.SVDock.docklets.MainWindow = name; frame:ClearAllPoints() frame:SetParent(SuperDockletMain) frame:SetAllPoints(SuperDockletMain) @@ -881,7 +873,7 @@ 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; - MOD.db.docklets.ExtraWindow = name; + SV.db.SVDock.docklets.ExtraWindow = name; frame:ClearAllPoints() frame:SetParent(SuperDockletExtra) frame:SetAllPoints(SuperDockletExtra) @@ -899,13 +891,13 @@ BUILD/UPDATE ########################################################## ]]-- function MOD:UpdateSuperDock() - local leftWidth = self.db.dockLeftWidth or 350; - local leftHeight = self.db.dockLeftHeight or 180; - local rightWidth = self.db.dockRightWidth or 350; - local rightHeight = self.db.dockRightHeight or 180; - local buttonsize = self.db.buttonSize or 22; - local spacing = self.db.buttonSpacing or 4; - local statBarWidth = self.db.dockStatWidth + local leftWidth = SV.db.SVDock.dockLeftWidth or 350; + local leftHeight = SV.db.SVDock.dockLeftHeight or 180; + local rightWidth = SV.db.SVDock.dockRightWidth or 350; + local rightHeight = SV.db.SVDock.dockRightHeight or 180; + local buttonsize = SV.db.SVDock.buttonSize or 22; + local spacing = SV.db.SVDock.buttonSpacing or 4; + local statBarWidth = SV.db.SVDock.dockStatWidth or defaultStatBarWidth _G["LeftSuperDock"]:Size(leftWidth, leftHeight) _G["SuperDockAlertLeft"]:Width(leftWidth) @@ -924,14 +916,14 @@ function MOD:UpdateSuperDock() end function MOD:UpdateDockBackdrops() - if self.db.rightDockBackdrop then + if SV.db.SVDock.rightDockBackdrop then RightSuperDock.backdrop:Show() RightSuperDock.backdrop:ClearAllPoints() RightSuperDock.backdrop:WrapOuter(RightSuperDock, 4, 4) else RightSuperDock.backdrop:Hide() end - if self.db.leftDockBackdrop then + if SV.db.SVDock.leftDockBackdrop then LeftSuperDock.backdrop:Show() LeftSuperDock.backdrop:ClearAllPoints() LeftSuperDock.backdrop:WrapOuter(LeftSuperDock, 4, 4) @@ -941,7 +933,7 @@ function MOD:UpdateDockBackdrops() end function MOD:BottomPanelVisibility() - if self.db.bottomPanel then + if SV.db.SVDock.bottomPanel then self.BottomPanel:Show() else self.BottomPanel:Hide() @@ -949,7 +941,7 @@ function MOD:BottomPanelVisibility() end function MOD:TopPanelVisibility() - if self.db.topPanel then + if SV.db.SVDock.topPanel then self.TopPanel:Show() else self.TopPanel:Hide() @@ -966,6 +958,12 @@ function MOD:ReLoad() end function MOD:Load() + SV.cache.Docks = SV.cache.Docks or {} + + if(not SV.cache.Docks.SuperDockFaded) then + SV.cache.Docks.SuperDockFaded = false + end + self:CreateSuperBorders() self:CreateDockPanels() local width = RightSuperDock:GetWidth(); @@ -1003,33 +1001,4 @@ function MOD:Load() SuperDockletExtra:SetScript("OnShow", DockletFrame_OnShow) SV:ReloadDocklets(true) SV.Timers:ExecuteTimer(self.LoadToolBarProfessions, 5) -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -CONFIGS["SVDock"] = { - ["enable"] = true, - ["dockLeftWidth"] = 412, - ["dockLeftHeight"] = 224, - ["dockRightWidth"] = 412, - ["dockRightHeight"] = 224, - ["dockStatWidth"] = defaultStatBarWidth, - ["buttonSize"] = 30, - ["buttonSpacing"] = 4, - ["leftDockBackdrop"] = true, - ["rightDockBackdrop"] = true, - ["topPanel"] = true, - ["bottomPanel"] = true, - ["docklets"] = { - ["DockletMain"] = "None", - ["MainWindow"] = "None", - ["DockletExtra"] = "None", - ["ExtraWindow"] = "None", - ["enableExtra"] = false, - ["DockletCombatFade"] = true - }, -} - -Registry:NewPackage(MOD, "SVDock") \ No newline at end of file +end \ 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 479d602..e1c3edc 100644 --- a/Interface/AddOns/SVUI/packages/gear/SVGear.lua +++ b/Interface/AddOns/SVUI/packages/gear/SVGear.lua @@ -32,11 +32,9 @@ local ceil, floor, round = math.ceil, math.floor, math.round; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); -local CONFIGS = SV.private -local MOD = {}; +local SV = select(2, ...) +local L = SV.L +local MOD = SV:NewPackage("SVGear", L["Gear Managment"]); --[[ ########################################################## LOCAL VARS @@ -124,10 +122,10 @@ local function GetActiveGear() local count = GetNumEquipmentSets() local resultSpec = GetActiveSpecGroup() local resultSet - EQUIP_SET = MOD.db.equipmentset + EQUIP_SET = SV.db.SVGear.equipmentset SPEC_SET = nil if(resultSpec and GetSpecializationInfo(resultSpec)) then - SPEC_SET = resultSpec == 1 and MOD.db.primary or MOD.db.secondary + SPEC_SET = resultSpec == 1 and SV.db.SVGear.primary or SV.db.SVGear.secondary end if(count == 0) then return resultSpec,false @@ -238,7 +236,7 @@ local function GearSwap() if(InCombatLockdown()) then return; end local gearSpec, gearSet = GetActiveGear() if(not gearSet) then return; end - if MOD.db.battleground.enable then + if SV.db.SVGear.battleground.enable then local inDungeon,dungeonType = IsInInstance() if(inDungeon and dungeonType == "pvp" or dungeonType == "arena") then if EQUIP_SET ~= "none" and EQUIP_SET ~= gearSet then @@ -256,9 +254,9 @@ end function MOD:PLAYER_ENTERING_WORLD() self:UnregisterEvent("PLAYER_ENTERING_WORLD") - SHOW_LEVEL = self.db.itemlevel.enable - SHOW_DURABILITY = self.db.durability.enable - ONLY_DAMAGED = self.db.durability.onlydamaged + SHOW_LEVEL = SV.db.SVGear.itemlevel.enable + SHOW_DURABILITY = SV.db.SVGear.durability.enable + ONLY_DAMAGED = SV.db.SVGear.durability.onlydamaged MAX_LEVEL, AVG_LEVEL = GetAverageItemLevel() LoadAddOn("Blizzard_InspectUI") SetDisplayStats("Character") @@ -279,9 +277,9 @@ local GearSwapComplete = function() end function MOD:UpdateLocals() - SHOW_LEVEL = self.db.itemlevel.enable - SHOW_DURABILITY = self.db.durability.enable - ONLY_DAMAGED = self.db.durability.onlydamaged + SHOW_LEVEL = SV.db.SVGear.itemlevel.enable + SHOW_DURABILITY = SV.db.SVGear.durability.enable + ONLY_DAMAGED = SV.db.SVGear.durability.onlydamaged MAX_LEVEL, AVG_LEVEL = GetAverageItemLevel() end @@ -300,32 +298,4 @@ function MOD:Load() self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED", GearSwap) self:RegisterEvent("EQUIPMENT_SWAP_FINISHED", GearSwapComplete) self:RegisterEvent("PLAYER_ENTERING_WORLD") -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -CONFIGS["SVGear"] = { - ["enable"] = true, - ["specialization"] = { - ["enable"] = false, - }, - ["battleground"] = { - ["enable"] = false, - }, - ["primary"] = "none", - ["secondary"] = "none", - ["equipmentset"] = "none", - ["durability"] = { - ["enable"] = true, - ["onlydamaged"] = true, - }, - ["itemlevel"] = { - ["enable"] = true, - }, - ["misc"] = { - setoverlay = true, - } -} -Registry:NewPackage(MOD, "SVGear"); \ No newline at end of file +end \ 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 da42f41..eba7b36 100644 --- a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua +++ b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua @@ -13,11 +13,9 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); -local CONFIGS = SV.private -local MOD = {} +local SV = select(2, ...) +local L = SV.L +local MOD = SV:NewPackage("SVHenchmen", L["Henchmen"]); --[[ ########################################################## LOCAL VARS @@ -80,10 +78,10 @@ local AutomatedEvents = { SCRIPT HANDLERS ########################################################## ]]-- -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 ColorFunc = function(self) SV.Setup:ColorTheme(self.value, true); SV:ToggleHenchman() end +local UnitFunc = function(self) SV.Setup:UnitframeLayout(self.value, true); SV:ToggleHenchman() end +local BarFunc = function(self) SV.Setup:BarLayout(self.value, true); SV:ToggleHenchman() end +local AuraFunc = function(self) SV.Setup:Auralayout(self.value, true); SV:ToggleHenchman() end local ConfigFunc = function() SV:ToggleConfig(); SV:ToggleHenchman() end local speechTimer; @@ -109,10 +107,8 @@ local Minion_OnMouseUp = function(self) end local Option_OnMouseUp = function(self) - local param = self.value - local func = self.callback - if(type(func) == "function") then - func(param) + if(type(self.callback) == "function") then + self:callback(param) end end @@ -282,12 +278,12 @@ local function CreateMinionOptions(i) end local setting = options[4]; - local dbSet = MOD.db[setting]; + local dbSet = SV.db.SVHenchmen[setting]; option.setting = function(toggle) if(toggle == nil) then - return MOD.db[setting] + return SV.db.SVHenchmen[setting] else - MOD.db[setting] = toggle; + SV.db.SVHenchmen[setting] = toggle; end end SV.Animate:Slide(option,-500,-500) @@ -503,7 +499,7 @@ local function CreateHenchmenFrame() CreateHenchmenSubOptions(3,1) HenchmenOptionButton3Sub1.txt:SetText("One Row: Small Buttons") HenchmenOptionButton3Sub1.txthigh:SetText("One Row: Small Buttons") - HenchmenOptionButton3Sub1.value = "onesmall" + HenchmenOptionButton3Sub1.value = "default" HenchmenOptionButton3Sub1.callback = BarFunc HenchmenOptionButton3Sub1:SetScript("OnMouseUp", Option_OnMouseUp) @@ -517,7 +513,7 @@ local function CreateHenchmenFrame() CreateHenchmenSubOptions(3,3) HenchmenOptionButton3Sub3.txt:SetText("One Row: Large Buttons") HenchmenOptionButton3Sub3.txthigh:SetText("One Row: Large Buttons") - HenchmenOptionButton3Sub3.value = "default" + HenchmenOptionButton3Sub3.value = "onebig" HenchmenOptionButton3Sub3.callback = BarFunc HenchmenOptionButton3Sub3:SetScript("OnMouseUp", Option_OnMouseUp) @@ -634,7 +630,7 @@ MAIL HELPER ########################################################## ]]-- function MOD:ToggleMailMinions() - if not MOD.db.mailOpener then + if not SV.db.SVHenchmen.mailOpener then SVUI_MailMinion:Hide() else SVUI_MailMinion:Show() @@ -755,8 +751,8 @@ REPAIR AUTOMATONS ########################################################## ]]-- function MOD:MERCHANT_SHOW() - if self.db.vendorGrays then SV.SVBag:VendorGrays(nil,true) end - local autoRepair = self.db.autoRepair; + if SV.db.SVHenchmen.vendorGrays then SV.SVBag:VendorGrays(nil,true) end + local autoRepair = SV.db.SVHenchmen.autoRepair; if IsShiftKeyDown() or autoRepair == "NONE" or not CanMerchantRepair() then return end local repairCost,canRepair=GetRepairAllCost() local loan=GetGuildBankWithdrawMoney() @@ -781,7 +777,7 @@ REP AUTOMATONS ########################################################## ]]-- function MOD:CHAT_MSG_COMBAT_FACTION_CHANGE(event, msg) - if not self.db.autorepchange then return end + if not SV.db.SVHenchmen.autorepchange then return end local _, _, faction, amount = msg:find(incpat) if not faction then _, _, faction, amount = msg:find(changedpat) or msg:find(decpat) @@ -806,13 +802,13 @@ QUEST AUTOMATONS ]]-- function MOD:AutoQuestProxy() if(IsShiftKeyDown()) then return false; end - if((not QuestIsDaily() or not QuestIsWeekly()) and (self.db.autodailyquests)) then return false; end - if(QuestFlagsPVP() and (not self.db.autopvpquests)) then return false; end + if((not QuestIsDaily() or not QuestIsWeekly()) and (SV.db.SVHenchmen.autodailyquests)) then return false; end + if(QuestFlagsPVP() and (not SV.db.SVHenchmen.autopvpquests)) then return false; end return true end function MOD:QUEST_GREETING() - if(self.db.autoquestaccept == true and self:AutoQuestProxy()) then + if(SV.db.SVHenchmen.autoquestaccept == true and self:AutoQuestProxy()) then local active,available = GetNumActiveQuests(), GetNumAvailableQuests() if(active + available == 0) then return end if(available > 0) then @@ -825,7 +821,7 @@ function MOD:QUEST_GREETING() end function MOD:GOSSIP_SHOW() - if(self.db.autoquestaccept == true and self:AutoQuestProxy()) then + if(SV.db.SVHenchmen.autoquestaccept == true and self:AutoQuestProxy()) then if GetGossipAvailableQuests() then SelectGossipAvailableQuest(1) elseif GetGossipActiveQuests() then @@ -835,7 +831,7 @@ function MOD:GOSSIP_SHOW() end function MOD:QUEST_DETAIL() - if(self.db.autoquestaccept == true and self:AutoQuestProxy()) then + if(SV.db.SVHenchmen.autoquestaccept == true and self:AutoQuestProxy()) then if not QuestGetAutoAccept() then AcceptQuest() else @@ -845,7 +841,7 @@ function MOD:QUEST_DETAIL() end function MOD:QUEST_ACCEPT_CONFIRM() - if(self.db.autoquestaccept == true and self:AutoQuestProxy()) then + if(SV.db.SVHenchmen.autoquestaccept == true and self:AutoQuestProxy()) then ConfirmAcceptQuest() StaticPopup_Hide("QUEST_ACCEPT_CONFIRM") end @@ -853,19 +849,19 @@ end function MOD:QUEST_PROGRESS() if(IsShiftKeyDown()) then return false; end - if(self.db.autoquestcomplete == true and IsQuestCompletable()) then + if(SV.db.SVHenchmen.autoquestcomplete == true and IsQuestCompletable()) then CompleteQuest() end end function MOD:QUEST_COMPLETE() - if(not self.db.autoquestcomplete and (not self.db.autoquestreward)) then return end + if(not SV.db.SVHenchmen.autoquestcomplete and (not SV.db.SVHenchmen.autoquestreward)) then return end if(IsShiftKeyDown()) then return false; end local rewards = GetNumQuestChoices() if rewards > 1 then local auto_select = QuestFrameRewardPanel.itemChoice or QuestInfoFrame.itemChoice; local selection, value = 1, 0; - if self.db.autoquestreward == true then + if SV.db.SVHenchmen.autoquestreward == true then for i = 1, rewards do local iLink = GetQuestItemLink("choice", i) if iLink then @@ -886,11 +882,11 @@ function MOD:QUEST_COMPLETE() end end auto_select = selection - if self.db.autoquestcomplete == true then + if SV.db.SVHenchmen.autoquestcomplete == true then GetQuestReward(auto_select) end else - if(self.db.autoquestcomplete == true) then + if(SV.db.SVHenchmen.autoquestcomplete == true) then GetQuestReward(GetNumQuestChoices()) end end @@ -921,7 +917,7 @@ function MOD:Load() bubble:SetScript('OnShow', Speech_OnShow) if IsAddOnLoaded("Postal") then - self.db.mailOpener = false + SV.db.SVHenchmen.mailOpener = false else self:LoadMailMinions() self:ToggleMailMinions() @@ -955,40 +951,17 @@ function MOD:Load() skippy:RegisterEvent("CINEMATIC_START") skippy:SetScript("OnEvent", function(_, event) if event == "CINEMATIC_START" then - if(MOD.db.skipcinematics) then + if(SV.db.SVHenchmen.skipcinematics) then CinematicFrame_CancelCinematic() end end end) local PlayMovie_hook = MovieFrame_PlayMovie MovieFrame_PlayMovie = function(...) - if(MOD.db.skipcinematics) then + if(SV.db.SVHenchmen.skipcinematics) then GameMovieFinished() else PlayMovie_hook(...) end end -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -CONFIGS["SVHenchmen"] = { - ["enable"] = true, - ["autoRoll"] = false, - ["vendorGrays"] = true, - ["autoAcceptInvite"] = false, - ["autorepchange"] = false, - ["pvpautorelease"] = false, - ["autoquestcomplete"] = false, - ["autoquestreward"] = false, - ["autoquestaccept"] = false, - ["autodailyquests"] = false, - ["autopvpquests"] = false, - ["skipcinematics"] = false, - ["mailOpener"] = true, - ["autoRepair"] = "PLAYER", -} - -Registry:NewPackage(MOD, "SVHenchmen") \ No newline at end of file +end \ 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 79ffa70..fe2fdc8 100644 --- a/Interface/AddOns/SVUI/packages/map/SVMap.lua +++ b/Interface/AddOns/SVUI/packages/map/SVMap.lua @@ -36,11 +36,9 @@ local parsefloat = math.parsefloat; -- Uncommon GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); -local CONFIGS = SV.private -local MOD = {}; +local SV = select(2, ...) +local L = SV.L +local MOD = SV:NewPackage("SVMap", L["Minimap"]); MOD.MinimapButtons = {} --[[ ########################################################## @@ -57,6 +55,18 @@ LOCAL VARS local temp = SLASH_CALENDAR1:gsub("/", ""); local calendar_string = temp:gsub("^%l", upper) local cColor = RAID_CLASS_COLORS[SV.class]; +local MMBHolder, MMBBar; + +local NewHook = hooksecurefunc +local Initialized = false +--[[ +########################################################## +DATA UPVALUES +########################################################## +]]-- +local NARR_TEXT = "Meanwhile"; +local NARR_PREFIX = "In "; +local NARR_ENABLE = true; local MM_COLOR = {"VERTICAL", 0.65, 0.65, 0.65, 0.95, 0.95, 0.95} local MM_BRDR = 0 local MM_SIZE = 240 @@ -64,21 +74,19 @@ local MM_OFFSET_TOP = (MM_SIZE * 0.07) local MM_OFFSET_BOTTOM = (MM_SIZE * 0.11) 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) -local NewHook = hooksecurefunc -local Initialized = false ---[[ -########################################################## -LOCAL FUNCTIONS -########################################################## -]]-- +--local +--[[ + /$$$$$$$ /$$ /$$ /$$$$$$$$/$$$$$$$$/$$$$$$ /$$ /$$ /$$$$$$ +| $$__ $$| $$ | $$|__ $$__/__ $$__/$$__ $$| $$$ | $$ /$$__ $$ +| $$ \ $$| $$ | $$ | $$ | $$ | $$ \ $$| $$$$| $$| $$ \__/ +| $$$$$$$ | $$ | $$ | $$ | $$ | $$ | $$| $$ $$ $$| $$$$$$ +| $$__ $$| $$ | $$ | $$ | $$ | $$ | $$| $$ $$$$ \____ $$ +| $$ \ $$| $$ | $$ | $$ | $$ | $$ | $$| $$\ $$$ /$$ \ $$ +| $$$$$$$/| $$$$$$/ | $$ | $$ | $$$$$$/| $$ \ $$| $$$$$$/ +|_______/ \______/ |__/ |__/ \______/ |__/ \__/ \______/ +--]] local MMB_OnEnter = function(self) - if(not MOD.db.minimapbar.mouseover or MOD.db.minimapbar.styleType == "NOANCHOR") then return end + if(not SV.db.SVMap.minimapbar.mouseover or SV.db.SVMap.minimapbar.styleType == "NOANCHOR") then return end UIFrameFadeIn(SVUI_MiniMapButtonBar, 0.2, SVUI_MiniMapButtonBar:GetAlpha(), 1) if self:GetName() ~= "SVUI_MiniMapButtonBar" then self:SetBackdropBorderColor(.7, .7, 0) @@ -86,41 +94,22 @@ local MMB_OnEnter = function(self) end local MMB_OnLeave = function(self) - if(not MOD.db.minimapbar.mouseover or MOD.db.minimapbar.styleType == "NOANCHOR") then return end + if(not SV.db.SVMap.minimapbar.mouseover or SV.db.SVMap.minimapbar.styleType == "NOANCHOR") then return end UIFrameFadeOut(SVUI_MiniMapButtonBar, 0.2, SVUI_MiniMapButtonBar:GetAlpha(), 0) if self:GetName() ~= "SVUI_MiniMapButtonBar" then self:SetBackdropBorderColor(0, 0, 0) end -end - -local MiniMap_MouseUp = function(self, btn) - local position = self:GetPoint() - if btn == "RightButton" then - local xoff = -1 - if position:match("RIGHT") then xoff = -16 end - ToggleDropDownMenu(1, nil, MiniMapTrackingDropDown, self, xoff, -3) - else - Minimap_OnClick(self) - end -end - -local MiniMap_MouseWheel = function(self, delta) - if delta > 0 then - _G.MinimapZoomIn:Click() - elseif delta < 0 then - _G.MinimapZoomOut:Click() - end end do local reserved = {"Node", "Tab", "Pin", "SVUI_ConsolidatedBuffs", "GameTimeframe", "HelpOpenTicketButton", "SVUI_MinimapFrame", "SVUI_EnhancedMinimap", "QueueStatusMinimapButton", "TimeManagerClockButton", "Archy", "GatherMatePin", "GatherNote", "GuildInstance", "HandyNotesPin", "MinimMap", "Spy_MapNoteList_mini", "ZGVMarker"} local function UpdateMinimapButtons() - if(not MOD.db.minimapbar.enable) then return end + if(not SV.db.SVMap.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) + MMBBar:Height(SV.db.SVMap.minimapbar.buttonSize + 4) + MMBBar:Width(SV.db.SVMap.minimapbar.buttonSize + 4) local lastButton, anchor, relative, xPos, yPos; local list = MOD.MinimapButtons @@ -128,7 +117,7 @@ do for name,btn in pairs(list) do local preset = btn.preset; - if(MOD.db.minimapbar.styleType == "NOANCHOR") then + if(SV.db.SVMap.minimapbar.styleType == "NOANCHOR") then btn:SetParent(preset.Parent) if preset.DragStart then btn:SetScript("OnDragStart", preset.DragStart) @@ -151,8 +140,8 @@ do btn:ClearAllPoints() btn:SetFrameStrata("LOW") btn:SetFrameLevel(20) - btn:Size(MOD.db.minimapbar.buttonSize) - if MOD.db.minimapbar.styleType == "HORIZONTAL"then + btn:Size(SV.db.SVMap.minimapbar.buttonSize) + if SV.db.SVMap.minimapbar.styleType == "HORIZONTAL"then anchor = "RIGHT" relative = "LEFT" xPos = -2; @@ -172,11 +161,11 @@ do lastButton = btn count = count + 1 end - if (MOD.db.minimapbar.styleType ~= "NOANCHOR" and (count > 0)) then - if MOD.db.minimapbar.styleType == "HORIZONTAL" then - MMBBar:Width((MOD.db.minimapbar.buttonSize * count) + count * 2) + if (SV.db.SVMap.minimapbar.styleType ~= "NOANCHOR" and (count > 0)) then + if SV.db.SVMap.minimapbar.styleType == "HORIZONTAL" then + MMBBar:Width((SV.db.SVMap.minimapbar.buttonSize * count) + count * 2) else - MMBBar:Height((MOD.db.minimapbar.buttonSize * count) + count * 2) + MMBBar:Height((SV.db.SVMap.minimapbar.buttonSize * count) + count * 2) end MMBHolder:SetSize(MMBBar:GetSize()) MMBBar:Show() @@ -264,7 +253,7 @@ do UpdateMinimapButtons() - if MOD.db.minimapbar.mouseover then + if SV.db.SVMap.minimapbar.mouseover then MMBBar:SetAlpha(0) else MMBBar:SetAlpha(1) @@ -272,7 +261,7 @@ do end function MOD:UpdateMinimapButtonSettings(notimer) - if(not self.db.minimapbar.enable or not MMBBar:IsShown()) then return end + if(not SV.db.SVMap.minimapbar.enable or not MMBBar:IsShown()) then return end if(notimer) then StyleMinimapButtons() else @@ -281,9 +270,80 @@ do end end +local function CheckMovement() + if(not WorldMapFrame:IsShown()) then return end + if GetUnitSpeed("player") ~= 0 then + WorldMapFrame:SetAlpha(SV.db.SVMap.mapAlpha) + else + WorldMapFrame:SetAlpha(1) + end +end + +local function UpdateMapCoords() + local xF, yF = "|cffffffffx: |r%.1f", "|cffffffffy: |r%.1f" + local skip = IsInInstance() + local c, d = GetPlayerMapPosition("player") + if(not skip and not IsIndoors() and c ~= 0 and d ~= 0) then + c = parsefloat(100 * c, 2) + d = parsefloat(100 * d, 2) + if(MM_XY_COORD == "SIMPLE") then + xF, yF = "%.1f", "%.1f"; + end + if c ~= 0 and d ~= 0 then + SVUI_MiniMapCoords.playerXCoords:SetFormattedText(xF, c) + SVUI_MiniMapCoords.playerYCoords:SetFormattedText(yF, d) + if(SVUI_WorldMapCoords and WorldMapFrame:IsShown()) then + SVUI_WorldMapCoords.playerCoords:SetText(PLAYER..": "..c..", "..d) + end + else + SVUI_MiniMapCoords.playerXCoords:SetText("") + SVUI_MiniMapCoords.playerYCoords:SetText("") + if(SVUI_WorldMapCoords and WorldMapFrame:IsShown()) then + SVUI_WorldMapCoords.playerCoords:SetText("") + end + end + if(not WorldMapFrame:IsShown() or not SVUI_WorldMapCoords) then return end + local e = WorldMapDetailFrame:GetEffectiveScale() + local f = WorldMapDetailFrame:GetWidth() + local g = WorldMapDetailFrame:GetHeight() + local h, i = WorldMapDetailFrame:GetCenter() + local c, d = GetCursorPosition() + local j = (c / e - (h - (f / 2))) / f; + local k = (i + (g / 2)-d / e) / g; + if j >= 0 and k >= 0 and j <= 1 and k <= 1 then + j = parsefloat(100 * j, 2) + k = parsefloat(100 * k, 2) + SVUI_WorldMapCoords.mouseCoords:SetText(MOUSE_LABEL..": "..j..", "..k) + else + SVUI_WorldMapCoords.mouseCoords:SetText("") + end + else + SVUI_MiniMapCoords.playerXCoords:SetText("") + SVUI_MiniMapCoords.playerYCoords:SetText("") + if(SVUI_WorldMapCoords and WorldMapFrame:IsShown()) then + SVUI_WorldMapCoords.playerCoords:SetText("") + end + end + if(SV.db.SVMap.mapAlpha < 100) then + CheckMovement() + end +end + +--[[ + /$$ /$$ /$$$$$$ /$$$$$$$ /$$ /$$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$$ +| $$ /$ | $$ /$$__ $$| $$__ $$| $$ | $$__ $$| $$$ /$$$ /$$__ $$| $$__ $$ +| $$ /$$$| $$| $$ \ $$| $$ \ $$| $$ | $$ \ $$| $$$$ /$$$$| $$ \ $$| $$ \ $$ +| $$/$$ $$ $$| $$ | $$| $$$$$$$/| $$ | $$ | $$| $$ $$/$$ $$| $$$$$$$$| $$$$$$$/ +| $$$$_ $$$$| $$ | $$| $$__ $$| $$ | $$ | $$| $$ $$$| $$| $$__ $$| $$____/ +| $$$/ \ $$$| $$ | $$| $$ \ $$| $$ | $$ | $$| $$\ $ | $$| $$ | $$| $$ +| $$/ \ $$| $$$$$$/| $$ | $$| $$$$$$$$| $$$$$$$/| $$ \/ | $$| $$ | $$| $$ +|__/ \__/ \______/ |__/ |__/|________/|_______/ |__/ |__/|__/ |__/|__/ +--]] + local function SetLargeWorldMap() - if InCombatLockdown() then return end - if MOD.db.tinyWorldMap == true then + if InCombatLockdown() then return end + + if SV.db.SVMap.tinyWorldMap == true then WorldMapFrame:SetParent(SV.UIParent) WorldMapFrame:EnableMouse(false) WorldMapFrame:EnableKeyboard(false) @@ -294,14 +354,16 @@ local function SetLargeWorldMap() if WorldMapFrame:GetAttribute('UIPanelLayout-allowOtherPanels') ~= true then SetUIPanelAttribute(WorldMapFrame, "allowOtherPanels", true) end - end + end + WorldMapFrameSizeUpButton:Hide() WorldMapFrameSizeDownButton:Show() end local function SetQuestWorldMap() - if InCombatLockdown() then return end - if MOD.db.tinyWorldMap == true then + if InCombatLockdown() then return end + + if SV.db.SVMap.tinyWorldMap == true then WorldMapFrame:SetParent(SV.UIParent) WorldMapFrame:EnableMouse(false) WorldMapFrame:EnableKeyboard(false) @@ -311,7 +373,8 @@ local function SetQuestWorldMap() if WorldMapFrame:GetAttribute('UIPanelLayout-allowOtherPanels') ~= true then SetUIPanelAttribute(WorldMapFrame, "allowOtherPanels", true) end - end + end + WorldMapFrameSizeUpButton:Hide() WorldMapFrameSizeDownButton:Show() end @@ -322,20 +385,11 @@ local function SetSmallWorldMap() WorldMapLevelDropDown:Point("TOPLEFT", WorldMapDetailFrame, "TOPLEFT", -10, -4) WorldMapFrameSizeUpButton:Show() WorldMapFrameSizeDownButton:Hide() -end - -local function AdjustMapLevel() - if InCombatLockdown()then return end - WorldMapFrame:SetFrameLevel(2) - WorldMapDetailFrame:SetFrameLevel(4) - WorldMapFrame:SetFrameStrata('HIGH') - WorldMapArchaeologyDigSites:SetFrameLevel(6) - WorldMapArchaeologyDigSites:SetFrameStrata('DIALOG') -end +end local function AdjustMapSize() if InCombatLockdown() then return end - if MOD.db.tinyWorldMap == true then + if SV.db.SVMap.tinyWorldMap == true then if WORLDMAP_SETTINGS.size == WORLDMAP_FULLMAP_SIZE then SetLargeWorldMap() elseif WORLDMAP_SETTINGS.size == WORLDMAP_WINDOWED_SIZE then @@ -354,81 +408,28 @@ local function AdjustMapSize() end BlackoutWorld:SetTexture(0, 0, 0, 1) end - AdjustMapLevel() -end - -local function CheckMovement() - if(not WorldMapFrame:IsShown()) then return end - if GetUnitSpeed("player") ~= 0 then - WorldMapFrame:SetAlpha(MOD.db.mapAlpha) - else - WorldMapFrame:SetAlpha(1) - end -end - -local function UpdateMapCoords() - local xF, yF = "|cffffffffx: |r%.1f", "|cffffffffy: |r%.1f" - local skip = IsInInstance() - local c, d = GetPlayerMapPosition("player") - if(not skip and not IsIndoors() and c ~= 0 and d ~= 0) then - c = parsefloat(100 * c, 2) - d = parsefloat(100 * d, 2) - if(MOD.db.playercoords == "SIMPLE") then - xF, yF = "%.1f", "%.1f"; - end - if c ~= 0 and d ~= 0 then - SVUI_MiniMapCoords.playerXCoords:SetFormattedText(xF, c) - SVUI_MiniMapCoords.playerYCoords:SetFormattedText(yF, d) - if(SVUI_WorldMapCoords and WorldMapFrame:IsShown()) then - SVUI_WorldMapCoords.playerCoords:SetText(PLAYER..": "..c..", "..d) - end - else - SVUI_MiniMapCoords.playerXCoords:SetText("") - SVUI_MiniMapCoords.playerYCoords:SetText("") - if(SVUI_WorldMapCoords and WorldMapFrame:IsShown()) then - SVUI_WorldMapCoords.playerCoords:SetText("") - end - end - if(not WorldMapFrame:IsShown() or not SVUI_WorldMapCoords) then return end - local e = WorldMapDetailFrame:GetEffectiveScale() - local f = WorldMapDetailFrame:GetWidth() - local g = WorldMapDetailFrame:GetHeight() - local h, i = WorldMapDetailFrame:GetCenter() - local c, d = GetCursorPosition() - local j = (c / e - (h - (f / 2))) / f; - local k = (i + (g / 2)-d / e) / g; - if j >= 0 and k >= 0 and j <= 1 and k <= 1 then - j = parsefloat(100 * j, 2) - k = parsefloat(100 * k, 2) - SVUI_WorldMapCoords.mouseCoords:SetText(MOUSE_LABEL..": "..j..", "..k) - else - SVUI_WorldMapCoords.mouseCoords:SetText("") - end - else - SVUI_MiniMapCoords.playerXCoords:SetText("") - SVUI_MiniMapCoords.playerYCoords:SetText("") - if(SVUI_WorldMapCoords and WorldMapFrame:IsShown()) then - SVUI_WorldMapCoords.playerCoords:SetText("") - end - end - if(MOD.db.mapAlpha < 100) then - CheckMovement() - end -end + + WorldMapFrame:SetFrameLevel(2) + WorldMapDetailFrame:SetFrameLevel(4) + WorldMapFrame:SetFrameStrata('HIGH') + WorldMapArchaeologyDigSites:SetFrameLevel(6) + WorldMapArchaeologyDigSites:SetFrameStrata('DIALOG') +end local function UpdateWorldMapConfig() - if InCombatLockdown()then return end + if InCombatLockdown()then return end + if(not MOD.WorldMapHooked) then NewHook("WorldMap_ToggleSizeUp", AdjustMapSize) NewHook("WorldMap_ToggleSizeDown", SetSmallWorldMap) - if(SV.___interface < 60000) then + if(SV.GameVersion < 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(not MM_XY_COORD or MM_XY_COORD == "HIDE") then if MOD.CoordTimer then SV.Timers:RemoveLoop(MOD.CoordTimer) MOD.CoordTimer = nil; @@ -442,229 +443,195 @@ local function UpdateWorldMapConfig() UpdateMapCoords() end AdjustMapSize() -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 SV.db.SVMap.tinyWorldMap and not Initialized) then - WorldMap_ToggleSizeUp() - Initialized = true - end - AdjustMapLevel() -end - -local WorldMapFrameOnHide_Hook = function() - MOD:UnregisterEvent("PLAYER_REGEN_DISABLED") end --[[ ########################################################## -CORE FUNCTIONS +HANDLERS ########################################################## ]]-- -MOD.narrative = ""; -MOD.locationPrefix = ""; -do - local function _createCoords() - local x, y = GetPlayerMapPosition("player") - x = tonumber(parsefloat(100 * x, 0)) - y = tonumber(parsefloat(100 * y, 0)) - return x, y - end - - local function Tour_OnEnter(self,...) - if InCombatLockdown() then - GameTooltip:Hide() - else - GameTooltip:SetOwner(self, "ANCHOR_BOTTOM", 0, -4) - GameTooltip:ClearAllPoints() - GameTooltip:SetPoint("BOTTOM", self, "BOTTOM", 0, 0) - GameTooltip:AddLine(" ") - GameTooltip:AddDoubleLine(L["Click : "], L["Toggle WorldMap"], 0.7, 0.7, 1, 0.7, 0.7, 1) - GameTooltip:AddDoubleLine(L["ShiftClick : "], L["Announce your position in chat"],0.7, 0.7, 1, 0.7, 0.7, 1) - GameTooltip:Show() - end - end - - local function Tour_OnLeave(self,...) - GameTooltip:Hide() - end - - local function Tour_OnClick(self, btn) - local zoneText = GetRealZoneText() or UNKNOWN; - if IsShiftKeyDown() then - local edit_box = ChatEdit_ChooseBoxForSend() - local x, y = _createCoords() - local message - local coords = x..", "..y - if zoneText ~= GetSubZoneText() then - message = format("%s: %s (%s)", zoneText, GetSubZoneText(), coords) - else - message = format("%s (%s)", zoneText, coords) - end - ChatEdit_ActivateChat(edit_box) - edit_box:Insert(message) - else - ToggleFrame(WorldMapFrame) - end - GameTooltip:Hide() - end - - local Calendar_OnClick = function(self) - GameTimeFrame:Click(); - end - - local Tracking_OnClick = function(self) - local position = self:GetPoint() +local MiniMap_MouseUp = function(self, btn) + local position = self:GetPoint() + if btn == "RightButton" then local xoff = -1 if position:match("RIGHT") then xoff = -16 end ToggleDropDownMenu(1, nil, MiniMapTrackingDropDown, self, xoff, -3) + else + Minimap_OnClick(self) end +end - local Basic_OnEnter = function(self) - GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) - GameTooltip:ClearLines() - GameTooltip:AddLine(self.TText, 1, 1, 1) - GameTooltip:Show() - end - - local Basic_OnLeave = function(self) - GameTooltip:Hide() +local MiniMap_MouseWheel = function(self, delta) + if delta > 0 then + _G.MinimapZoomIn:Click() + elseif delta < 0 then + _G.MinimapZoomOut:Click() end +end - function SetMiniMapCoords() - if(not SVUI_MiniMapCoords) then - local CoordsHolder = CreateFrame("Frame", "SVUI_MiniMapCoords", Minimap) - CoordsHolder:SetFrameLevel(Minimap:GetFrameLevel() + 1) - CoordsHolder:SetFrameStrata(Minimap:GetFrameStrata()) - CoordsHolder:SetPoint("TOPLEFT", SVUI_MinimapFrame, "BOTTOMLEFT", 0, -4) - CoordsHolder:SetPoint("TOPRIGHT", SVUI_MinimapFrame, "BOTTOMRIGHT", 0, -4) - CoordsHolder:SetHeight(22) - CoordsHolder:EnableMouse(true) - CoordsHolder:SetScript("OnEnter",Tour_OnEnter) - CoordsHolder:SetScript("OnLeave",Tour_OnLeave) - CoordsHolder:SetScript("OnMouseDown",Tour_OnClick) - - CoordsHolder.playerXCoords = CoordsHolder:CreateFontString(nil, "OVERLAY") - CoordsHolder.playerXCoords:SetPoint("BOTTOMLEFT", CoordsHolder, "BOTTOMLEFT", 0, 0) - CoordsHolder.playerXCoords:SetWidth(70) - CoordsHolder.playerXCoords:SetHeight(22) - 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(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: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") - calendarButton.TText = "Calendar" - calendarButton:RegisterForClicks("AnyUp") - calendarButton:SetScript("OnEnter", Basic_OnEnter) - calendarButton:SetScript("OnLeave", Basic_OnLeave) - calendarButton:SetScript("OnClick", Calendar_OnClick) - - local trackingButton = CreateFrame("Button", "SVUI_TrackingButton", CoordsHolder) - trackingButton:SetSize(22,22) - trackingButton:SetPoint("RIGHT", calendarButton, "LEFT", -4, 0) - 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") - trackingButton.TText = "Tracking" - trackingButton:RegisterForClicks("AnyUp") - trackingButton:SetScript("OnEnter", Basic_OnEnter) - trackingButton:SetScript("OnLeave", Basic_OnLeave) - trackingButton:SetScript("OnClick", Tracking_OnClick) - end - end +local Calendar_OnClick = function(self) + GameTimeFrame:Click(); end -local function UpdateMinimapNarration() - SVUI_MinimapNarrator.Text:SetText(MOD.narrative) +local Tracking_OnClick = function(self) + local position = self:GetPoint() + local xoff = -1 + if position:match("RIGHT") then xoff = -16 end + ToggleDropDownMenu(1, nil, MiniMapTrackingDropDown, self, xoff, -3) +end + +local Basic_OnEnter = function(self) + GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) + GameTooltip:ClearLines() + GameTooltip:AddLine(self.TText, 1, 1, 1) + GameTooltip:Show() +end + +local Basic_OnLeave = function(self) + GameTooltip:Hide() +end + +local Tour_OnEnter = function(self, ...) + if InCombatLockdown() then + GameTooltip:Hide() + else + GameTooltip:SetOwner(self, "ANCHOR_BOTTOM", 0, -4) + GameTooltip:ClearAllPoints() + GameTooltip:SetPoint("BOTTOM", self, "BOTTOM", 0, 0) + GameTooltip:AddLine(" ") + GameTooltip:AddDoubleLine(L["Click : "], L["Toggle WorldMap"], 0.7, 0.7, 1, 0.7, 0.7, 1) + GameTooltip:AddDoubleLine(L["ShiftClick : "], L["Announce your position in chat"],0.7, 0.7, 1, 0.7, 0.7, 1) + GameTooltip:Show() + end end -local function UpdateMinimapLocation() - SVUI_MinimapZonetext.Text:SetText(MOD.locationPrefix .. strsub(GetMinimapZoneText(), 1, 25)) +local Tour_OnLeave = function(self, ...) + GameTooltip:Hide() end -local function UpdateMinimapTexts() - MOD.narrative = ""; - MOD.locationPrefix = ""; - if(not MOD.db.locationText or MOD.db.locationText == "HIDE") then - SVUI_MinimapNarrator:Hide(); - SVUI_MinimapZonetext:Hide(); - elseif(MOD.db.locationText == "SIMPLE") then - SVUI_MinimapNarrator:Hide(); - SVUI_MinimapZonetext:Show(); - UpdateMinimapLocation() - UpdateMinimapNarration() +local Tour_OnClick = function(self, btn) + if IsShiftKeyDown() then + local zoneText = GetRealZoneText() or UNKNOWN; + local subZone = GetSubZoneText() or UNKNOWN; + local edit_box = ChatEdit_ChooseBoxForSend(); + local x, y = GetPlayerMapPosition("player"); + x = tonumber(parsefloat(100 * x, 0)); + y = tonumber(parsefloat(100 * y, 0)); + local coords = ("%d, %d"):format(x, y); + + ChatEdit_ActivateChat(edit_box) + + if(zoneText ~= subZone) then + local message = ("%s: %s (%s)"):format(zoneText, subZone, coords) + edit_box:Insert(message) + else + local message = ("%s (%s)"):format(zoneText, coords) + edit_box:Insert(message) + end else - SVUI_MinimapNarrator:Show(); - SVUI_MinimapZonetext:Show(); - MOD.narrative = L['Meanwhile...']; - MOD.locationPrefix = L["..at "]; - UpdateMinimapLocation() - UpdateMinimapNarration() + ToggleFrame(WorldMapFrame) end + GameTooltip:Hide() +end +--[[ +########################################################## +HOOKS +########################################################## +]]-- +local _hook_WorldMapZoneDropDownButton_OnClick = function(self) + DropDownList1:ClearAllPoints() + DropDownList1:Point("TOPRIGHT",self,"BOTTOMRIGHT",-17,-4) end -local function UpdateSizing() - 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 +local _hook_WorldMapFrame_OnShow = function() + MOD:RegisterEvent("PLAYER_REGEN_DISABLED"); + + if InCombatLockdown()then return end + + if(not SV.db.SVMap.tinyWorldMap and not Initialized) then + WorldMap_ToggleSizeUp() + Initialized = true + end + + WorldMapFrame:SetFrameLevel(2) + WorldMapDetailFrame:SetFrameLevel(4) + WorldMapFrame:SetFrameStrata('HIGH') + WorldMapArchaeologyDigSites:SetFrameLevel(6) + WorldMapArchaeologyDigSites:SetFrameStrata('DIALOG') end +local _hook_WorldMapFrame_OnHide = function() + MOD:UnregisterEvent("PLAYER_REGEN_DISABLED") +end + +local _hook_DropDownList1 = function(self) + local parentScale = UIParent:GetScale() + if(self:GetScale() ~= parentScale) then + self:SetScale(parentScale) + end +end +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- function MOD:RefreshMiniMap() if(not SV.db.SVMap.enable) then return; end if(InCombatLockdown()) then self.CombatLocked = true return end - UpdateSizing() - if(SVUI_MinimapFrame and SVUI_MinimapFrame:IsShown()) then + + self:UpdateLocals() + + NARR_TEXT = ""; + NARR_PREFIX = ""; + + if(self.Holder and self.Holder:IsShown()) then --local minimapRotationEnabled = GetCVar("rotateMinimap") ~= "0" - SVUI_MinimapFrame:Size(MM_WIDTH, MM_HEIGHT) - SVUI_MinimapFrame.backdrop:SetGradient(unpack(MM_COLOR)) + self.Holder:Size(MM_WIDTH, MM_HEIGHT) + self.Holder.backdrop:SetGradient(unpack(MM_COLOR)) Minimap:Size(MM_SIZE,MM_SIZE) - if MOD.db.customshape then - Minimap:SetPoint("BOTTOMLEFT", SVUI_MinimapFrame, "BOTTOMLEFT", MM_BRDR, -(MM_OFFSET_BOTTOM - MM_BRDR)) - Minimap:SetPoint("TOPRIGHT", SVUI_MinimapFrame, "TOPRIGHT", -MM_BRDR, (MM_OFFSET_TOP - MM_BRDR)) + if SV.db.SVMap.customshape then + Minimap:SetPoint("BOTTOMLEFT", self.Holder, "BOTTOMLEFT", MM_BRDR, -(MM_OFFSET_BOTTOM - MM_BRDR)) + Minimap:SetPoint("TOPRIGHT", self.Holder, "TOPRIGHT", -MM_BRDR, (MM_OFFSET_TOP - MM_BRDR)) Minimap:SetMaskTexture('Interface\\AddOns\\SVUI\\assets\\artwork\\Minimap\\MINIMAP_MASK_RECTANGLE') else Minimap:SetHitRectInsets(0, 0, 0, 0) - Minimap:FillInner(SVUI_MinimapFrame, MM_BRDR, MM_BRDR) + Minimap:FillInner(self.Holder, MM_BRDR, MM_BRDR) Minimap:SetMaskTexture('Interface\\AddOns\\SVUI\\assets\\artwork\\Minimap\\MINIMAP_MASK_SQUARE') end - Minimap:SetParent(SVUI_MinimapFrame) + Minimap:SetParent(self.Holder) Minimap:SetZoom(1) Minimap:SetZoom(0) end - SVUI_MinimapZonetext:SetSize(MM_WIDTH,28) - SVUI_MinimapZonetext.Text:SetSize(MM_WIDTH,32) - UpdateMinimapTexts() + self.Zone:SetSize(MM_WIDTH,28) + self.Zone.Text:SetSize(MM_WIDTH,32) + + if(not NARR_ENABLE or NARR_ENABLE == "HIDE") then + self.Narrator:Hide(); + self.Zone:Hide(); + else + if(NARR_ENABLE == "SIMPLE") then + self.Narrator:Hide(); + self.Zone:Show(); + self.Narrator.Text:SetText(NARR_TEXT) + else + self.Narrator:Show(); + self.Zone:Show(); + NARR_TEXT = L['Meanwhile...']; + NARR_PREFIX = L["..at "]; + self.Narrator.Text:SetText(NARR_TEXT) + end + local zone = GetMinimapZoneText(); + zone = zone:sub(1, 25); + local zoneText = ("%s%s"):format(NARR_PREFIX, zone); + self.Zone.Text:SetText(zoneText) + end if SVUI_AurasAnchor then SVUI_AurasAnchor:Height(MM_HEIGHT) - if SVUI_AurasAnchor_MOVE and not SV:TestMovableMoved('SVUI_AurasAnchor_MOVE') and not SV:TestMovableMoved('SVUI_MinimapFrame_MOVE') then + if SVUI_AurasAnchor_MOVE and not SV.Mentalo:HasMoved('SVUI_AurasAnchor_MOVE') and not SV.Mentalo:HasMoved('SVUI_MinimapFrame_MOVE') then SVUI_AurasAnchor_MOVE:ClearAllPoints() SVUI_AurasAnchor_MOVE:Point("TOPRIGHT", SVUI_MinimapFrame_MOVE, "TOPLEFT", -8, 0) end @@ -679,12 +646,90 @@ function MOD:RefreshMiniMap() TimeManagerClockButton:Die() end - SetMiniMapCoords() UpdateWorldMapConfig() end +--[[ +########################################################## +EVENTS +########################################################## +]]-- +function MOD:ZONE_CHANGED() + local zone = GetRealZoneText() or UNKNOWN + zone = zone:sub(1, 25) + local zoneText = ("%s%s"):format(NARR_PREFIX, zone) + self.Zone.Text:SetText(zoneText) +end + +function MOD:ZONE_CHANGED_NEW_AREA() + local zone = GetRealZoneText() or UNKNOWN + zone = zone:sub(1, 25) + local zoneText = ("%s%s"):format(NARR_PREFIX, zone) + self.Zone.Text:SetText(zoneText) +end + +function MOD:ADDON_LOADED(event, addon) + if TimeManagerClockButton then + TimeManagerClockButton:Die() + end + self:UnregisterEvent("ADDON_LOADED") + if addon == "Blizzard_FeedbackUI" then + FeedbackUIButton:Die() + end + self:UpdateMinimapButtonSettings() +end + +function MOD:PLAYER_REGEN_ENABLED() + if(WorldMapFrame:IsShown()) then + WorldMapFrameSizeDownButton:Enable() + WorldMapFrameSizeUpButton:Enable() + end + if(self.CombatLocked) then + self:RefreshMiniMap() + self.CombatLocked = nil + end +end + +function MOD:PLAYER_REGEN_DISABLED() + WorldMapFrameSizeDownButton:Disable() + WorldMapFrameSizeUpButton:Disable() +end + +function MOD:PET_BATTLE_CLOSE() + self:UpdateMinimapButtonSettings() +end +--[[ +########################################################## +BUILD FUNCTION / UPDATE +########################################################## +]]-- +function MOD:UpdateLocals() + local db = SV.db.SVMap + if not db then return end + + MM_XY_COORD = db.playercoords; + WM_TINY = db.tinyWorldMap; + NARR_ENABLE = db.locationText; + MM_COLOR = SV.Media.gradient[db.bordercolor] + MM_BRDR = db.bordersize or 0 + MM_SIZE = 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 = db.customshape and (MM_SIZE - (MM_OFFSET_TOP + MM_OFFSET_BOTTOM) + (MM_BRDR * 2)) or MM_WIDTH +end -local function CreateMiniMapElements() - UpdateSizing() +function MOD:ReLoad() + if(not SV.db.SVMap.enable) then return; end + self:RefreshMiniMap() +end + +function MOD:Load() + if(not SV.db.SVMap.enable) then + Minimap:SetMaskTexture('Textures\\MinimapMask') + return + end + + self:UpdateLocals() Minimap:SetPlayerTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Minimap\\MINIMAP_ARROW") Minimap:SetCorpsePOIArrowTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Minimap\\MINIMAP_CORPSE_ARROW") @@ -692,16 +737,19 @@ local function CreateMiniMapElements() Minimap:SetBlipTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Minimap\\MINIMAP_ICONS") Minimap:SetClampedToScreen(false) - 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) + local mapHolder = CreateFrame("Frame", "SVUI_MinimapFrame", UIParent) + mapHolder:SetFrameStrata("BACKGROUND") + mapHolder.backdrop = mapHolder:CreateTexture(nil, "BACKGROUND", nil, -2) + mapHolder:Point("TOPRIGHT", SV.UIParent, "TOPRIGHT", -10, -10) + mapHolder:Size(MM_WIDTH, MM_HEIGHT) + mapHolder.backdrop:ClearAllPoints() + mapHolder.backdrop:WrapOuter(mapHolder, 2) + mapHolder.backdrop:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) + mapHolder.backdrop:SetGradient(unpack(MM_COLOR)) + mapHolder:SetPanelTemplate("Blackout") + + local border = CreateFrame("Frame", nil, mapHolder) + border:WrapOuter(mapHolder.backdrop) border.left = border:CreateTexture(nil, "BACKGROUND", nil, -1) border.left:SetTexture(0, 0, 0) border.left:SetPoint("TOPLEFT") @@ -723,14 +771,15 @@ local function CreateMiniMapElements() border.bottom:SetPoint("BOTTOMRIGHT") border.bottom:SetHeight(1) - -- MOD:RefreshMiniMap() + mapHolder.border = border + if TimeManagerClockButton then TimeManagerClockButton:Die() end Minimap:SetQuestBlobRingAlpha(0) Minimap:SetArchBlobRingAlpha(0) - Minimap:SetParent(SVUI_MinimapFrame) + Minimap:SetParent(mapHolder) Minimap:SetFrameStrata("LOW") Minimap:SetFrameLevel(Minimap:GetFrameLevel() + 2) ShowUIPanel(SpellBookFrame) @@ -745,21 +794,21 @@ local function CreateMiniMapElements() MinimapZoneTextButton:Hide() MiniMapTracking:Hide() MiniMapMailFrame:ClearAllPoints() - MiniMapMailFrame:Point("TOPRIGHT", SVUI_MinimapFrame, 3, 4) + MiniMapMailFrame:Point("TOPRIGHT", mapHolder, 3, 4) MiniMapMailBorder:Hide() MiniMapMailIcon:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Minimap\\MINIMAP-MAIL") MiniMapWorldMapButton:Hide() MiniMapInstanceDifficulty:ClearAllPoints() MiniMapInstanceDifficulty:SetParent(Minimap) - MiniMapInstanceDifficulty:Point("BOTTOMLEFT", SVUI_MinimapFrame, "BOTTOMLEFT", 0, 0) + MiniMapInstanceDifficulty:Point("BOTTOMLEFT", mapHolder, "BOTTOMLEFT", 0, 0) GuildInstanceDifficulty:ClearAllPoints() GuildInstanceDifficulty:SetParent(Minimap) - GuildInstanceDifficulty:Point("BOTTOMLEFT", SVUI_MinimapFrame, "BOTTOMLEFT", 0, 0) + GuildInstanceDifficulty:Point("BOTTOMLEFT", mapHolder, "BOTTOMLEFT", 0, 0) MiniMapChallengeMode:ClearAllPoints() MiniMapChallengeMode:SetParent(Minimap) - MiniMapChallengeMode:Point("BOTTOMLEFT", SVUI_MinimapFrame, "BOTTOMLEFT", 8, -8) + MiniMapChallengeMode:Point("BOTTOMLEFT", mapHolder, "BOTTOMLEFT", 8, -8) QueueStatusMinimapButton:ClearAllPoints() - QueueStatusMinimapButton:Point("BOTTOMLEFT", SVUI_MinimapFrame, "BOTTOMLEFT", 6, 5) + QueueStatusMinimapButton:Point("BOTTOMLEFT", mapHolder, "BOTTOMLEFT", 6, 5) QueueStatusMinimapButton:SetPanelTemplate("Button", false, 1, -2, -2) QueueStatusFrame:SetClampedToScreen(true) QueueStatusMinimapButtonBorder:Hide() @@ -769,9 +818,9 @@ local function CreateMiniMapElements() MiniMapChallengeMode:Point("BOTTOMLEFT", QueueStatusMinimapButton, "BOTTOMLEFT", 0, 0) end) QueueStatusMinimapButton:SetScript("OnHide", function() - MiniMapInstanceDifficulty:Point("BOTTOMLEFT", SVUI_MinimapFrame, "BOTTOMLEFT", 0, 0) - GuildInstanceDifficulty:Point("BOTTOMLEFT", SVUI_MinimapFrame, "BOTTOMLEFT", 0, 0) - MiniMapChallengeMode:Point("BOTTOMLEFT", SVUI_MinimapFrame, "BOTTOMLEFT", 8, -8) + MiniMapInstanceDifficulty:Point("BOTTOMLEFT", mapHolder, "BOTTOMLEFT", 0, 0) + GuildInstanceDifficulty:Point("BOTTOMLEFT", mapHolder, "BOTTOMLEFT", 0, 0) + MiniMapChallengeMode:Point("BOTTOMLEFT", mapHolder, "BOTTOMLEFT", 8, -8) end) if FeedbackUIButton then FeedbackUIButton:Die() @@ -779,35 +828,39 @@ local function CreateMiniMapElements() local mwfont = SV.Media.font.dialog - SVUI_MinimapNarrator:Point("TOPLEFT", SVUI_MinimapFrame, "TOPLEFT", 2, -2) - SVUI_MinimapNarrator:SetSize(100, 22) - SVUI_MinimapNarrator:SetFixedPanelTemplate("Component", true) - SVUI_MinimapNarrator:SetPanelColor("yellow") - SVUI_MinimapNarrator:SetBackdropColor(1, 1, 0, 1) - SVUI_MinimapNarrator:SetFrameLevel(Minimap:GetFrameLevel() + 2) - SVUI_MinimapNarrator:SetParent(Minimap) - - SVUI_MinimapNarrator.Text = SVUI_MinimapNarrator:CreateFontString(nil, "ARTWORK", nil, 7) - SVUI_MinimapNarrator.Text:SetFontTemplate(mwfont, 12, "OUTLINE", "CENTER", "MIDDLE") - SVUI_MinimapNarrator.Text:SetAllPoints(SVUI_MinimapNarrator) - SVUI_MinimapNarrator.Text:SetTextColor(1, 1, 1) - SVUI_MinimapNarrator.Text:SetShadowColor(0, 0, 0, 0.3) - SVUI_MinimapNarrator.Text:SetShadowOffset(2, -2) - - SVUI_MinimapZonetext:Point("BOTTOMRIGHT", SVUI_MinimapFrame, "BOTTOMRIGHT", 2, -3) - SVUI_MinimapZonetext:SetSize(MM_WIDTH, 28) - SVUI_MinimapZonetext:SetFrameLevel(Minimap:GetFrameLevel() + 1) - SVUI_MinimapZonetext:SetParent(Minimap) - - SVUI_MinimapZonetext.Text = SVUI_MinimapZonetext:CreateFontString(nil, "ARTWORK", nil, 7) - SVUI_MinimapZonetext.Text:SetFontTemplate(mwfont, 12, "OUTLINE", "RIGHT", "MIDDLE") - SVUI_MinimapZonetext.Text:Point("RIGHT", SVUI_MinimapZonetext) - SVUI_MinimapZonetext.Text:SetSize(MM_WIDTH, 32) - SVUI_MinimapZonetext.Text:SetTextColor(1, 1, 0) - SVUI_MinimapZonetext.Text:SetShadowColor(0, 0, 0, 0.3) - SVUI_MinimapZonetext.Text:SetShadowOffset(-2, 2) - - UpdateMinimapTexts() + local narr = CreateFrame("Frame", nil, mapHolder) + narr:Point("TOPLEFT", mapHolder, "TOPLEFT", 2, -2) + narr:SetSize(100, 22) + narr:SetFixedPanelTemplate("Component", true) + narr:SetPanelColor("yellow") + narr:SetBackdropColor(1, 1, 0, 1) + narr:SetFrameLevel(Minimap:GetFrameLevel() + 2) + narr:SetParent(Minimap) + + narr.Text = narr:CreateFontString(nil, "ARTWORK", nil, 7) + narr.Text:SetFontTemplate(mwfont, 12, "OUTLINE", "CENTER", "MIDDLE") + narr.Text:SetAllPoints(narr) + narr.Text:SetTextColor(1, 1, 1) + narr.Text:SetShadowColor(0, 0, 0, 0.3) + narr.Text:SetShadowOffset(2, -2) + + self.Narrator = narr + + local zt = CreateFrame("Frame", nil, mapHolder) + zt:Point("BOTTOMRIGHT", mapHolder, "BOTTOMRIGHT", 2, -3) + zt:SetSize(MM_WIDTH, 28) + zt:SetFrameLevel(Minimap:GetFrameLevel() + 1) + zt:SetParent(Minimap) + + zt.Text = zt:CreateFontString(nil, "ARTWORK", nil, 7) + zt.Text:SetFontTemplate(mwfont, 12, "OUTLINE", "RIGHT", "MIDDLE") + zt.Text:Point("RIGHT", zt) + zt.Text:SetSize(MM_WIDTH, 32) + zt.Text:SetTextColor(1, 1, 0) + zt.Text:SetShadowColor(0, 0, 0, 0.3) + zt.Text:SetShadowOffset(-2, 2) + + self.Zone = zt Minimap:EnableMouseWheel(true) Minimap:SetScript("OnMouseWheel", MiniMap_MouseWheel) @@ -818,29 +871,25 @@ local function CreateMiniMapElements() PetJournalParent:SetAttribute("UIPanelLayout-"..name, value); end PetJournalParent:SetAttribute("UIPanelLayout-defined", true); - SV:SetSVMovable(SVUI_MinimapFrame, L["Minimap"]) - - MOD:RefreshMiniMap() -end - -local function LoadWorldMap() - setfenv(WorldMapFrame_OnShow, setmetatable({ UpdateMicroButtons = SV.fubar }, { __index = _G })) + SV.Mentalo:Add(mapHolder, L["Minimap"]) - if(SV.___interface < 60000) then + if(SV.GameVersion < 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) + WorldMapZoneDropDownButton:HookScript('OnClick', _hook_WorldMapZoneDropDownButton_OnClick) end - WorldMapFrame:SetParent(SV.UIParent) - WorldMapFrame:SetFrameLevel(4) - WorldMapFrame:SetFrameStrata('HIGH') - WorldMapDetailFrame:SetFrameLevel(6) - - WorldMapFrame:HookScript('OnShow', WorldMapFrameOnShow_Hook) - WorldMapFrame:HookScript('OnHide', WorldMapFrameOnHide_Hook) + if(SV.db.SVMap.tinyWorldMap) then + setfenv(WorldMapFrame_OnShow, setmetatable({ UpdateMicroButtons = SV.fubar }, { __index = _G })) + WorldMapFrame:SetParent(SV.UIParent) + WorldMapFrame:SetFrameLevel(4) + WorldMapFrame:SetFrameStrata('HIGH') + WorldMapDetailFrame:SetFrameLevel(6) + WorldMapFrame:HookScript('OnShow', _hook_WorldMapFrame_OnShow) + WorldMapFrame:HookScript('OnHide', _hook_WorldMapFrame_OnHide) + end local CoordsHolder = CreateFrame('Frame', 'SVUI_WorldMapCoords', WorldMapFrame) CoordsHolder:SetFrameLevel(WorldMapDetailFrame:GetFrameLevel()+1) @@ -856,79 +905,66 @@ local function LoadWorldMap() CoordsHolder.mouseCoords:SetPoint("BOTTOMLEFT",CoordsHolder.playerCoords,"TOPLEFT",0,5) CoordsHolder.mouseCoords:SetText(MOUSE_LABEL..": 0, 0") - DropDownList1:HookScript('OnShow',function(self) - if(DropDownList1:GetScale() ~= UIParent:GetScale() and SV.db.SVMap.tinyWorldMap) then - DropDownList1:SetScale(UIParent:GetScale()) - end - end) + DropDownList1:HookScript('OnShow', _hook_DropDownList1) WorldFrame:SetAllPoints() -end ---[[ -########################################################## -HOOKED / REGISTERED FUNCTIONS -########################################################## -]]-- -function MOD:ADDON_LOADED(event, addon) - if TimeManagerClockButton then - TimeManagerClockButton:Die() - end - self:UnregisterEvent("ADDON_LOADED") - if addon == "Blizzard_FeedbackUI" then - FeedbackUIButton:Die() - end - self:UpdateMinimapButtonSettings() -end - -function MOD:PLAYER_REGEN_ENABLED() - if(WorldMapFrame:IsShown()) then - WorldMapFrameSizeDownButton:Enable() - WorldMapFrameSizeUpButton:Enable() - end - if(self.CombatLocked) then - self:RefreshMiniMap() - self.CombatLocked = nil - end -end - -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 SV.db.SVMap.enable) then return; end - self:RefreshMiniMap() -end - -function MOD:Load() - if(not SV.db.SVMap.enable) then - Minimap:SetMaskTexture('Textures\\MinimapMask') - return - end - CreateMiniMapElements() - - self:RegisterEvent("PLAYER_ENTERING_WORLD", UpdateMinimapLocation) - self:RegisterEvent('PLAYER_REGEN_ENABLED') - self:RegisterEvent('PLAYER_REGEN_DISABLED') - self:RegisterEvent("ZONE_CHANGED_NEW_AREA", UpdateMinimapLocation) - 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) + SV:AddToDisplayAudit(mapHolder) + + local CoordsHolder = CreateFrame("Frame", "SVUI_MiniMapCoords", Minimap) + CoordsHolder:SetFrameLevel(Minimap:GetFrameLevel() + 1) + CoordsHolder:SetFrameStrata(Minimap:GetFrameStrata()) + CoordsHolder:SetPoint("TOPLEFT", mapHolder, "BOTTOMLEFT", 0, -4) + CoordsHolder:SetPoint("TOPRIGHT", mapHolder, "BOTTOMRIGHT", 0, -4) + CoordsHolder:SetHeight(22) + CoordsHolder:EnableMouse(true) + CoordsHolder:SetScript("OnEnter",Tour_OnEnter) + CoordsHolder:SetScript("OnLeave",Tour_OnLeave) + CoordsHolder:SetScript("OnMouseDown",Tour_OnClick) + + CoordsHolder.playerXCoords = CoordsHolder:CreateFontString(nil, "OVERLAY") + CoordsHolder.playerXCoords:SetPoint("BOTTOMLEFT", CoordsHolder, "BOTTOMLEFT", 0, 0) + CoordsHolder.playerXCoords:SetWidth(70) + CoordsHolder.playerXCoords:SetHeight(22) + 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(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: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") + calendarButton.TText = "Calendar" + calendarButton:RegisterForClicks("AnyUp") + calendarButton:SetScript("OnEnter", Basic_OnEnter) + calendarButton:SetScript("OnLeave", Basic_OnLeave) + calendarButton:SetScript("OnClick", Calendar_OnClick) + + local trackingButton = CreateFrame("Button", "SVUI_TrackingButton", CoordsHolder) + trackingButton:SetSize(22,22) + trackingButton:SetPoint("RIGHT", calendarButton, "LEFT", -4, 0) + 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") + trackingButton.TText = "Tracking" + trackingButton:RegisterForClicks("AnyUp") + trackingButton:SetScript("OnEnter", Basic_OnEnter) + trackingButton:SetScript("OnLeave", Basic_OnLeave) + trackingButton:SetScript("OnClick", Tracking_OnClick) + + if(SV.db.SVMap.minimapbar.enable == true) then + MMBHolder = CreateFrame("Frame", "SVUI_MiniMapButtonHolder", mapHolder) MMBHolder:Point("TOPRIGHT", SVUI_MiniMapCoords, "BOTTOMRIGHT", 0, -4) - MMBHolder:Size(SVUI_MinimapFrame:GetWidth(), 32) + MMBHolder:Size(mapHolder:GetWidth(), 32) MMBHolder:SetFrameStrata("BACKGROUND") MMBBar = CreateFrame("Frame", "SVUI_MiniMapButtonBar", MMBHolder) MMBBar:SetFrameStrata("LOW") @@ -936,41 +972,17 @@ function MOD:Load() MMBBar:SetPoint("CENTER", MMBHolder, "CENTER", 0, 0) MMBBar:SetScript("OnEnter", MMB_OnEnter) MMBBar:SetScript("OnLeave", MMB_OnLeave) - SV:SetSVMovable(MMBHolder, L["Minimap Button Bar"]) + SV.Mentalo:Add(MMBHolder, L["Minimap Button Bar"]) self:UpdateMinimapButtonSettings() - end + end - LoadWorldMap() - SV:AddToDisplayAudit(SVUI_MinimapFrame) - self:ReLoad() -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -CONFIGS["SVMap"] = { - ["incompatible"] = { - ["SexyMap"] = true, - ["SquareMap"] = true, - ["PocketPlot"] = true, - }, - ["enable"] = true, - ["mapAlpha"] = 1, - ["tinyWorldMap"] = true, - ["size"] = 240, - ["customshape"] = true, - ["locationText"] = "CUSTOM", - ["playercoords"] = "CUSTOM", - ["bordersize"] = 6, - ["bordercolor"] = "light", - ["minimapbar"] = { - ["enable"] = true, - ["styleType"] = "HORIZONTAL", - ["layoutDirection"] = "NORMAL", - ["buttonSize"] = 28, - ["mouseover"] = false, - }, -} - -Registry:NewPackage(MOD, "SVMap") \ No newline at end of file + self.Holder = mapHolder + + self:RefreshMiniMap() + + self:RegisterEvent('ADDON_LOADED') + self:RegisterEvent('PLAYER_REGEN_ENABLED') + self:RegisterEvent('PLAYER_REGEN_DISABLED') + self:RegisterEvent("ZONE_CHANGED") + self:RegisterEvent("ZONE_CHANGED_NEW_AREA") +end \ 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 0ca0d5a..65bfac9 100644 --- a/Interface/AddOns/SVUI/packages/override/SVOverride.lua +++ b/Interface/AddOns/SVUI/packages/override/SVOverride.lua @@ -33,12 +33,10 @@ local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); +local SV = select(2, ...) +local L = SV.L local LSM = LibStub("LibSharedMedia-3.0") -local CONFIGS = SV.private -local MOD = {}; +local MOD = SV:NewPackage("SVOverride", "Overrides"); MOD.LewtRollz = {}; --[[ ########################################################## @@ -128,7 +126,7 @@ local CaptureBarHandler = function() end local ErrorFrameHandler = function(self, event) - if not SV.db.system.hideErrorFrame then return end + if not SV.db.general.hideErrorFrame then return end if event == 'PLAYER_REGEN_DISABLED' then UIErrorsFrame:UnregisterEvent('UI_ERROR_MESSAGE') else @@ -143,7 +141,7 @@ local Vehicle_OnSetPoint = function(self,_,parent) VehicleSeatIndicator:Point("BOTTOM", VehicleSeatIndicator_MOVE, "BOTTOM", 0, 0) else VehicleSeatIndicator:Point("TOPLEFT", SV.UIParent, "TOPLEFT", 22, -45) - SV:SetSVMovable(VehicleSeatIndicator, L["Vehicle Seat Frame"]) + SV.Mentalo:Add(VehicleSeatIndicator, L["Vehicle Seat Frame"]) end VehicleSeatIndicator:SetScale(0.8) end @@ -301,7 +299,7 @@ local AlertFramePostMove_Hook = function(forced) YOFFSET = 10; SVUI_AlertFrame_MOVE:SetText(SVUI_AlertFrame_MOVE.textString.." (Grow Up)") end - if MOD.db.lootRoll then + if SV.db.SVOverride.lootRoll then local f, g; for h, i in pairs(MOD.LewtRollz) do i:ClearAllPoints() @@ -456,8 +454,8 @@ LOOTING ########################################################## ]]-- local function UpdateLootUpvalues() - LOOT_WIDTH = MOD.db.lootRollWidth - LOOT_HEIGHT = MOD.db.lootRollHeight + LOOT_WIDTH = SV.db.SVOverride.lootRollWidth + LOOT_HEIGHT = SV.db.SVOverride.lootRollHeight end local Loot_OnHide = function(self) @@ -1021,7 +1019,7 @@ function MOD:Load() TicketStatusFrame:ClearAllPoints() TicketStatusFrame:SetPoint("TOPLEFT", SV.UIParent, "TOPLEFT", 250, -5) - SV:SetSVMovable(TicketStatusFrame, L["GM Ticket Frame"], nil, nil, nil, nil, "GM") + SV.Mentalo:Add(TicketStatusFrame, L["GM Ticket Frame"], nil, nil, nil, nil, "GM") HelpOpenTicketButton:SetParent(Minimap) HelpOpenTicketButton:ClearAllPoints() HelpOpenTicketButton:SetPoint("TOPRIGHT", Minimap, "TOPRIGHT") @@ -1037,7 +1035,7 @@ function MOD:Load() 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) + SV.Mentalo:Add(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) @@ -1053,7 +1051,7 @@ function MOD:Load() LootFrame:UnregisterAllEvents(); SVUI_LootFrame:SetFixedPanelTemplate('Transparent'); SVUI_LootFrame.title:SetFont(LSM:Fetch("font", "SVUI Number Font"),18,"OUTLINE") - SV:SetSVMovable(SVUI_LootFrameHolder, L["Loot Frame"], nil, nil, nil, nil, "SVUI_LootFrame"); + SV.Mentalo:Add(SVUI_LootFrameHolder, L["Loot Frame"], nil, nil, nil, nil, "SVUI_LootFrame"); tinsert(UISpecialFrames, "SVUI_LootFrame"); UIParent:UnregisterEvent("LOOT_BIND_CONFIRM") @@ -1063,7 +1061,7 @@ function MOD:Load() self:RegisterEvent("CONFIRM_LOOT_ROLL", AutoConfirmLoot) self:RegisterEvent("LOOT_BIND_CONFIRM", AutoConfirmLoot) - if(SV.___interface < 60000) then + if(SV.GameVersion < 60000) then self:RegisterEvent("LOOT_OPENED", OpenedLootHandler) else self:RegisterEvent("LOOT_READY", OpenedLootHandler) @@ -1073,7 +1071,7 @@ function MOD:Load() self:RegisterEvent("LOOT_CLOSED", LootSimpleEventsHandler); self:RegisterEvent("OPEN_MASTER_LOOT_LIST", LootSimpleEventsHandler); self:RegisterEvent("UPDATE_MASTER_LOOT_LIST", LootSimpleEventsHandler); - if self.db.lootRoll then + if SV.db.SVOverride.lootRoll then self:RegisterEvent("LOOT_HISTORY_ROLL_CHANGED", LootComplexEventsHandler); self:RegisterEvent("START_LOOT_ROLL", LootComplexEventsHandler); UIParent:UnregisterEvent("START_LOOT_ROLL"); @@ -1107,7 +1105,7 @@ function MOD:Load() exit:SetScript("OnEvent", BailOut_OnEvent) exit:Hide() - SV:SetSVMovable(exit, L["Bail Out"]) + SV.Mentalo:Add(exit, L["Bail Out"]) local altPower = CreateFrame("Frame", "SVUI_AltPowerBar", UIParent) altPower:SetPoint("TOP", SV.UIParent, "TOP", 0, -18) @@ -1116,27 +1114,13 @@ function MOD:Load() PlayerPowerBarAlt:SetPoint("CENTER", altPower, "CENTER") PlayerPowerBarAlt:SetParent(altPower) PlayerPowerBarAlt.ignoreFramePositionManager = true; - SV:SetSVMovable(altPower, L["Alternative Power"]) + SV.Mentalo:Add(altPower, L["Alternative Power"]) local wsc = CreateFrame("Frame", "SVUI_WorldStateHolder", SV.UIParent) wsc:SetSize(200, 45) wsc:SetPoint("TOP", SV.UIParent, "TOP", 0, -100) - SV:SetSVMovable(wsc, L["Capture Bars"]) + SV.Mentalo:Add(wsc, L["Capture Bars"]) NewHook("UIParent_ManageFramePositions", CaptureBarHandler) - SV:SetSVMovable(LossOfControlFrame, L["Loss Control Icon"], nil, nil, nil, nil, "LoC") -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -CONFIGS["SVOverride"] = { - ["enable"] = true, - ["loot"] = true, - ["lootRoll"] = true, - ["lootRollWidth"] = 328, - ["lootRollHeight"] = 28, -} - -Registry:NewPackage(MOD, "SVOverride"); \ No newline at end of file + SV.Mentalo:Add(LossOfControlFrame, L["Loss Control Icon"], nil, nil, nil, nil, "LoC") +end \ 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 1a6931a..b00c06e 100644 --- a/Interface/AddOns/SVUI/packages/plates/SVPlate.lua +++ b/Interface/AddOns/SVUI/packages/plates/SVPlate.lua @@ -49,12 +49,10 @@ local tremove, tcopy, twipe, tsort, tconcat = table.remove, table.copy, table.wi GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); +local SV = select(2, ...) +local L = SV.L local LSM = LibStub("LibSharedMedia-3.0") -local CONFIGS = SV.private -local MOD = {}; +local MOD = SV:NewPackage("SVPlate", L["NamePlates"]); --[[ ########################################################## LOCALIZED GLOBALS @@ -1471,7 +1469,7 @@ UPDATE AND BUILD ########################################################## ]]-- function MOD:UpdateLocals() - local db = self.db + local db = SV.db.SVPlate if not db then return end NPClassRole = SV.ClassRole; @@ -1568,7 +1566,7 @@ function MOD:ReLoad() end function MOD:Load() - if SV.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") @@ -1577,75 +1575,4 @@ function MOD:Load() self:RegisterEvent("UPDATE_MOUSEOVER_UNIT") WorldFrame:HookScript('OnUpdate', WorldFrameUpdateHook) self:CombatToggle(true) -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -CONFIGS["SVPlate"] = { - ["enable"] = true, - ["filter"] = {}, - ["font"] = "SVUI Name Font", - ["fontSize"] = 10, - ["fontOutline"] = "OUTLINE", - ["comboPoints"] = true, - ["nonTargetAlpha"] = 0.6, - ["combatHide"] = false, - ["colorNameByValue"] = true, - ["showthreat"] = true, - ["targetcount"] = true, - ["pointer"] = { - ["enable"] = true, - ["colorMatchHealthBar"] = true, - ["color"] = {0.9, 1, 0.9}, - }, - ["healthBar"] = { - ["lowThreshold"] = 0.4, - ["width"] = 108, - ["height"] = 9, - ["text"] = { - ["enable"] = false, - ["format"] = "CURRENT", - ["xOffset"] = 0, - ["yOffset"] = 0, - ["attachTo"] = "CENTER", - }, - }, - ["castBar"] = { - ["height"] = 6, - ["color"] = {1, 0.81, 0}, - ["noInterrupt"] = {0.78, 0.25, 0.25}, - }, - ["raidHealIcon"] = { - ["xOffset"] = -4, - ["yOffset"] = 6, - ["size"] = 36, - ["attachTo"] = "LEFT", - }, - ["threat"] = { - ["enable"] = false, - ["goodScale"] = 1, - ["badScale"] = 1, - ["goodColor"] = {0.29, 0.68, 0.3}, - ["badColor"] = {0.78, 0.25, 0.25}, - ["goodTransitionColor"] = {0.85, 0.77, 0.36}, - ["badTransitionColor"] = {0.94, 0.6, 0.06}, - }, - ["auras"] = { - ["font"] = "SVUI Number Font", - ["fontSize"] = 7, - ["fontOutline"] = "OUTLINE", - ["numAuras"] = 5, - ["additionalFilter"] = "CC" - }, - ["reactions"] = { - ["tapped"] = {0.6, 0.6, 0.6}, - ["friendlyNPC"] = { 0.31, 0.45, 0.63}, - ["friendlyPlayer"] = {0.29, 0.68, 0.3}, - ["neutral"] = {0.85, 0.77, 0.36}, - ["enemy"] = {0.78, 0.25, 0.25}, - }, -} - -Registry:NewPackage(MOD, "SVPlate") \ No newline at end of file +end \ 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 1bef13e..3d94bb0 100644 --- a/Interface/AddOns/SVUI/packages/stats/SVStats.lua +++ b/Interface/AddOns/SVUI/packages/stats/SVStats.lua @@ -24,23 +24,26 @@ local pairs = _G.pairs; local type = _G.type; local string = _G.string; local math = _G.math; +local table = _G.table; --[[ STRING METHODS ]]-- -local join = string.join; +local join, len = string.join, string.len; --[[ MATH METHODS ]]-- local min = math.min; +local tsort, twipe = table.sort, _G.wipe; --[[ ########################################################## GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); +local SV = select(2, ...) +local L = SV.L local LSM = LibStub("LibSharedMedia-3.0") -local CONFIGS = SV.private -local MOD = {}; +local LDB = LibStub("LibDataBroker-1.1", true) +local MOD = SV:NewPackage("SVStats", L["Statistics"]); + MOD.Anchors = {}; MOD.Statistics = {}; +MOD.DisabledList = {}; MOD.StatListing = {[""] = "None"}; MOD.tooltip = CreateFrame("GameTooltip", "StatisticTooltip", UIParent, "GameTooltipTemplate") MOD.BGPanels = { @@ -62,6 +65,7 @@ MOD.BGStats = { ["Changes"] = {13, RATING_CHANGE}, ["Spec"] = {16, SPECIALIZATION} }; +MOD.ListNeedsUpdate = true --[[ ########################################################## LOCALIZED GLOBALS @@ -81,9 +85,9 @@ local myName = UnitName("player"); local myClass = select(2,UnitClass("player")); local classColor = RAID_CLASS_COLORS[myClass]; local StatMenuFrame = CreateFrame("Frame", "SVUI_StatMenu", UIParent); -local ListNeedsUpdate = true local SCORE_CACHE = {}; - +local hexHighlight = "FFFFFF"; +local StatMenuListing = {} -- When its vertical then "left" = "top" and "right" = "bottom". Yes I know thats ghetto, bite me! local positionIndex = {{"middle", "left", "right"}, {"middle", "top", "bottom"}}; --[[ @@ -116,7 +120,7 @@ local function GrabPlot(parent, slot, max) end local UpdateAnchor = function() - local backdrops, width, height = MOD.db.showBackground + local backdrops, width, height = SV.db.SVStats.showBackground for _, anchor in pairs(MOD.Anchors) do if(anchor.vertical) then width = anchor:GetWidth() - 4; @@ -182,7 +186,7 @@ function MOD:ShowTip(noSpace) end function MOD:NewAnchor(parent, maxCount, tipAnchor, isTop, customTemplate, isVertical) - ListNeedsUpdate = true + self.ListNeedsUpdate = true local activeIndex = isVertical and 2 or 1 local template, strata @@ -208,7 +212,7 @@ function MOD:NewAnchor(parent, maxCount, tipAnchor, isTop, customTemplate, isVer parent.holders[position] = CreateFrame("Button", "DataText"..i, parent) parent.holders[position]:RegisterForClicks("AnyUp") parent.holders[position].barframe = CreateFrame("Frame", nil, parent.holders[position]) - if(MOD.db.showBackground) then + if(SV.db.SVStats.showBackground) then parent.holders[position].barframe:Point("TOPLEFT", parent.holders[position], "TOPLEFT", 24, -2) parent.holders[position].barframe:Point("BOTTOMRIGHT", parent.holders[position], "BOTTOMRIGHT", -2, 2) parent.holders[position]:SetFramedButtonTemplate(template) @@ -251,12 +255,12 @@ function MOD:NewAnchor(parent, maxCount, tipAnchor, isTop, customTemplate, isVer parent.holders[position].textframe:SetFrameStrata(strata) 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(LSM:Fetch("font", MOD.db.font), MOD.db.fontSize, "NONE", "CENTER", "MIDDLE") + if(SV.db.SVStats.showBackground) then + parent.holders[position].text:SetFontTemplate(LSM:Fetch("font", SV.db.SVStats.font), SV.db.SVStats.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(LSM:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + parent.holders[position].text:SetFontTemplate(LSM:Fetch("font", SV.db.SVStats.font), SV.db.SVStats.fontSize, SV.db.SVStats.fontOutline) parent.holders[position].text:SetJustifyH("CENTER") parent.holders[position].text:SetJustifyV("MIDDLE") end @@ -272,6 +276,7 @@ function MOD:Extend(newStat, eventList, onEvents, update, click, focus, blur, in if not newStat then return end self.Statistics[newStat] = {} self.StatListing[newStat] = newStat + tinsert(StatMenuListing, newStat) if type(eventList) == "table" then self.Statistics[newStat]["events"] = eventList; self.Statistics[newStat]["event_handler"] = onEvents @@ -293,14 +298,6 @@ function MOD:Extend(newStat, eventList, onEvents, update, click, focus, blur, in end end -function MOD:UnSet(parent) - parent:UnregisterAllEvents() - parent:SetScript("OnUpdate", nil) - parent:SetScript("OnEnter", nil) - parent:SetScript("OnLeave", nil) - parent:SetScript("OnClick", nil) -end - do local dataStrings = { NAME, @@ -385,6 +382,7 @@ do for i=1, #StatMenuFrame.buttons do StatMenuFrame.buttons[i]:Hide() end + for i=1, #list do if not StatMenuFrame.buttons[i] then StatMenuFrame.buttons[i] = CreateFrame("Button", nil, StatMenuFrame) @@ -440,7 +438,8 @@ do end end - local function _load(parent, config) + local function _load(parent, name, config) + parent.StatParent = name if config["events"]then for _, event in pairs(config["events"])do parent:RegisterEvent(event) @@ -543,27 +542,39 @@ do SV:AddonMessage(L["Battleground statistics temporarily hidden, to show type \"/sv bg\" or \"/sv pvp\""]) end - local function SetMenuLists() - for place,parent in pairs(MOD.Anchors)do + local sortMenuList = function(a, b) return a < b end + + function MOD:SetMenuLists() + local stats = self.Anchors; + local list = StatMenuListing; + local disabled = self.DisabledList; + + tsort(list) + + for place,parent in pairs(stats)do for i = 1, parent.numPoints do local this = positionIndex[parent.useIndex][i] - tinsert(parent.holders[this].MenuList,{text = NONE, func = function() MOD:ChangeDBVar(NONE, this, "panels", place); MOD:Generate() end}); - for name,config in pairs(MOD.Statistics) do - tinsert(parent.holders[this].MenuList,{text = name, func = function() MOD:ChangeDBVar(name, this, "panels", place); MOD:Generate() end}); - end + local subList = twipe(parent.holders[this].MenuList) + + tinsert(subList,{text = NONE, func = function() MOD:ChangeDBVar(NONE, this, "panels", place); MOD:Generate() end}); + for _,name in pairs(list) do + if(not disabled[name]) then + tinsert(subList,{text = name, func = function() MOD:ChangeDBVar(name, this, "panels", place); MOD:Generate() end}); + end + end end - ListNeedsUpdate = false; + self.ListNeedsUpdate = false; end end function MOD:Generate() - if(ListNeedsUpdate) then - SetMenuLists() + if(self.ListNeedsUpdate) then + self:SetMenuLists() end local instance, groupType = IsInInstance() local anchorTable = self.Anchors local statTable = self.Statistics - local db = self.db + local db = SV.db.SVStats local allowPvP = (db.battleground and not ForceHideBGStats) or false for place, parent in pairs(anchorTable) do local pvpTable = allowPvP and self.BGPanels[place] @@ -606,11 +617,11 @@ do for panelName, panelData in pairs(db.panels) do if(panelData and type(panelData) == "table") then if(panelName == place and panelData[position] and panelData[position] == name) then - _load(parent.holders[position], config) + _load(parent.holders[position], name, config) end elseif(panelData and type(panelData) == "string" and panelData == name) then if(name == place) then - _load(parent.holders[position], config) + _load(parent.holders[position], name, config) end end end @@ -620,7 +631,17 @@ do end if ForceHideBGStats then ForceHideBGStats = nil end end -end +end + +function MOD:UnSet(parent) + parent:UnregisterAllEvents() + parent:SetScript("OnUpdate", nil) + parent:SetScript("OnEnter", nil) + parent:SetScript("OnLeave", nil) + parent:SetScript("OnClick", nil) + self.DisabledList[parent.StatParent] = true + self:SetMenuLists() +end --[[ ########################################################## BUILD FUNCTION / UPDATE @@ -631,15 +652,18 @@ function MOD:ReLoad() end function MOD:Load() - local hexHighlight = SV:HexColor("highlight") or "FFFFFF" + 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 {}; - SVUI_Global["Accountant"][playerRealm] = SVUI_Global["Accountant"][playerRealm] or {}; - SVUI_Global["Accountant"][playerRealm]["gold"] = SVUI_Global["Accountant"][playerRealm]["gold"] or {}; - SVUI_Global["Accountant"][playerRealm]["gold"][playerName] = SVUI_Global["Accountant"][playerRealm]["gold"][playerName] or 0; - SVUI_Global["Accountant"][playerRealm]["tokens"] = SVUI_Global["Accountant"][playerRealm]["tokens"] or {}; - SVUI_Global["Accountant"][playerRealm]["tokens"][playerName] = SVUI_Global["Accountant"][playerRealm]["tokens"][playerName] or 738; + + self.Accountant = LibSuperVillain:NewGlobal("Accountant") + + self.Accountant = self.Accountant or {}; + self.Accountant[playerRealm] = self.Accountant[playerRealm] or {}; + self.Accountant[playerRealm]["gold"] = self.Accountant[playerRealm]["gold"] or {}; + self.Accountant[playerRealm]["gold"][playerName] = self.Accountant[playerRealm]["gold"][playerName] or 0; + self.Accountant[playerRealm]["tokens"] = self.Accountant[playerRealm]["tokens"] or {}; + self.Accountant[playerRealm]["tokens"][playerName] = self.Accountant[playerRealm]["tokens"][playerName] or 738; self:LoadServerGold() self:CacheRepData() @@ -653,52 +677,61 @@ function MOD:Load() self.tooltip:SetFrameStrata("DIALOG") self.tooltip:HookScript("OnShow", _hook_TooltipOnShow) + if(LDB) then + for dataName, dataObj in LDB:DataObjectIterator() do + + local OnEnter, OnLeave, OnClick, lastObj; + + if dataObj.OnTooltipShow then + function OnEnter(self) + MOD:Tip(self) + dataObj.OnTooltipShow(MOD.tooltip) + MOD:ShowTip() + end + end + + if dataObj.OnEnter then + function OnEnter(self) + MOD:Tip(self) + dataObj.OnEnter(MOD.tooltip) + MOD:ShowTip() + end + end + + if dataObj.OnLeave then + function OnLeave(self) + dataObj.OnLeave(self) + MOD.tooltip:Hide() + end + end + + if dataObj.OnClick then + function OnClick(self, button) + dataObj.OnClick(self, button) + end + end + + local function textUpdate(event, name, key, value, dataobj) + if value == nil or (len(value) > 5) or value == 'n/a' or name == value then + lastObj.text:SetText(value ~= 'n/a' and value or name) + else + lastObj.text:SetText(name..': '.. '|cff' .. hexHighlight ..value..'|r') + end + end + + local function OnEvent(self) + lastObj = self; + LDB:RegisterCallback("LibDataBroker_AttributeChanged_"..dataName.."_text", textUpdate) + LDB:RegisterCallback("LibDataBroker_AttributeChanged_"..dataName.."_value", textUpdate) + LDB.callbacks:Fire("LibDataBroker_AttributeChanged_"..dataName.."_text", dataName, nil, dataObj.text, dataObj) + end + + MOD:Extend(dataName, {"PLAYER_ENTERING_WORLD"}, OnEvent, nil, OnClick, OnEnter, OnLeave) + end + end + self:Generate() self:RegisterEvent("PLAYER_ENTERING_WORLD", "Generate") myName = UnitName("player"); -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -CONFIGS["SVStats"] = { - ["enable"] = true, - ["font"] = "SVUI Number Font", - ["fontSize"] = 12, - ["fontOutline"] = "OUTLINE", - ["showBackground"] = true, - ["shortGold"] = true, - ["panels"] = { - ["BottomRightDataPanel"] = { - ["right"] = "Bags", - ["left"] = "Friends", - ["middle"] = "Guild", - }, - ["BottomLeftDataPanel"] = { - ["left"] = "Time", - ["middle"] = "System", - ["right"] = "Gold", - }, - ["TopLeftDataPanel"] = { - ["left"] = "Durability Bar", - ["middle"] = "Reputation Bar", - ["right"] = "Experience Bar", - }, - ["TopRightDataPanel"] = { - ["left"] = "None", - ["middle"] = "None", - ["right"] = "None", - }, - }, - ["localtime"] = true, - ["time24"] = false, - ["battleground"] = true, - ["topLeftDockPanel"] = true, - ["bottomLeftDockPanel"] = true, - ["bottomRightDockPanel"] = true, - ["panelTransparency"] = false, -} - -Registry:NewPackage(MOD, "SVStats") \ No newline at end of file +end \ 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 aa9cba7..0d79b1f 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/bags.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/bags.lua @@ -49,9 +49,8 @@ local twipe, tsort = table.wipe, table.sort; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); +local SV = select(2, ...) +local L = SV.L local MOD = SV.SVStats; --[[ ########################################################## @@ -100,5 +99,5 @@ local BagsColorUpdate = function() end end -Registry:NewCallback(BagsColorUpdate) +SV: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 5901ec0..3a195b1 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/cta.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/cta.lua @@ -49,9 +49,8 @@ local twipe, tsort = table.wipe, table.sort; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); +local SV = select(2, ...) +local L = SV.L local MOD = SV.SVStats; --[[ ########################################################## @@ -156,6 +155,6 @@ local CTAColorUpdate = function() CTA_OnEvent(currentObject) end end -Registry:NewCallback(CTAColorUpdate) +SV: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 c791785..bee4c11 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/dps.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/dps.lua @@ -31,9 +31,8 @@ local match, sub, join = string.match, string.sub, string.join; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); +local SV = select(2, ...) +local L = SV.L local MOD = SV.SVStats; --[[ ########################################################## @@ -125,5 +124,5 @@ local DPSColorUpdate = function() end end -Registry:NewCallback(DPSColorUpdate) +SV: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 d6fd41e..d2c817f 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/durability.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/durability.lua @@ -49,9 +49,8 @@ local twipe, tsort = table.wipe, table.sort; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); +local SV = select(2, ...) +local L = SV.L local LSM = LibStub("LibSharedMedia-3.0") local MOD = SV.SVStats; --[[ @@ -145,7 +144,7 @@ local DurColorUpdate = function() Durability_OnEvent(currentObject) end end -Registry:NewCallback(DurColorUpdate) +SV: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 e28184e..eafb704 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/experience.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/experience.lua @@ -19,6 +19,7 @@ STATS:Extend EXAMPLE USAGE: MOD:Extend(newStat,eventList,onEvents,update,click,f LOCALIZED LUA FUNCTIONS ########################################################## ]]-- +if (UnitLevel("player") == GetMaxPlayerLevel()) then return end; --[[ GLOBALS ]]-- local _G = _G; local unpack = _G.unpack; @@ -32,8 +33,8 @@ local gsub = string.gsub; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale(); +local SV = select(2, ...) +local L = SV.L; local LSM = LibStub("LibSharedMedia-3.0") local MOD = SV.SVStats; --[[ @@ -129,7 +130,7 @@ local function Experience_OnEnter(self) end local function ExperienceBar_OnLoad(self) - if (UnitLevel("player") == GetMaxPlayerLevel())then + if (UnitLevel("player") == GetMaxPlayerLevel()) then self:Hide() MOD:UnSet(self) end diff --git a/Interface/AddOns/SVUI/packages/stats/stats/friends.lua b/Interface/AddOns/SVUI/packages/stats/stats/friends.lua index d009f08..b0fc852 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/friends.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/friends.lua @@ -49,9 +49,8 @@ local twipe, tsort = table.wipe, table.sort; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); +local SV = select(2, ...) +local L = SV.L local MOD = SV.SVStats; --[[ ########################################################## @@ -381,6 +380,6 @@ local FriendsColorUpdate = function() end end -Registry:NewCallback(FriendsColorUpdate) +SV: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 9976ff6..1a59fcf 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 SVUI_ADDON_NAME, SV = ... -local L = LibLocale(); +local SV = select(2, ...) +local L = SV.L; local MOD = SV.SVStats; --[[ ########################################################## @@ -101,21 +101,21 @@ end local function Gold_OnEvent(self, event,...) if not IsLoggedIn() then return end local current = GetMoney() - recorded = SVUI_Global["Accountant"][playerRealm]["gold"][playerName] or GetMoney(); + recorded = MOD.Accountant[playerRealm]["gold"][playerName] or GetMoney(); local adjusted = current - recorded; if recorded > current then loss = loss - adjusted else gains = gains + adjusted end - self.text:SetText(FormatCurrency(current, MOD.db.shortGold)) - SVUI_Global["Accountant"][playerRealm]["gold"][playerName] = GetMoney() + self.text:SetText(FormatCurrency(current, SV.db.SVStats.shortGold)) + MOD.Accountant[playerRealm]["gold"][playerName] = GetMoney() end local function Gold_OnClick(self, button) if IsLeftControlKeyDown() and IsShiftKeyDown() then - SVUI_Global["Accountant"][playerRealm]["gold"] = {}; - SVUI_Global["Accountant"][playerRealm]["gold"][playerName] = GetMoney(); + MOD.Accountant[playerRealm]["gold"] = {}; + MOD.Accountant[playerRealm]["gold"][playerName] = GetMoney(); Gold_OnEvent(self) MOD.tooltip:Hide() else @@ -134,7 +134,7 @@ local function Gold_OnEnter(self) MOD.tooltip:AddDoubleLine(L["Profit:"],FormatCurrency(gains - loss),0,1,0,1,1,1) end MOD.tooltip:AddLine(" ") - local cash = SVUI_Global["Accountant"][playerRealm]["gold"][playerName]; + local cash = MOD.Accountant[playerRealm]["gold"][playerName]; MOD.tooltip:AddLine(L[playerName..": "]) MOD.tooltip:AddDoubleLine(L["Total: "], FormatCurrency(cash), 1,1,1,1,1,1) MOD.tooltip:AddLine(" ") @@ -157,9 +157,10 @@ end MOD:Extend('Gold', StatEvents, Gold_OnEvent, nil, Gold_OnClick, Gold_OnEnter); function MOD:LoadServerGold() + local SVUI_Global = _G.SVUI_Global local totalGold = 0; - for name,amount in pairs(SVUI_Global["Accountant"][playerRealm]["gold"])do - if SVUI_Global["Accountant"][playerRealm]["gold"][name] then + for name,amount in pairs(self.Accountant[playerRealm]["gold"])do + if self.Accountant[playerRealm]["gold"][name] then serverGold[name] = amount; totalGold = totalGold + amount end diff --git a/Interface/AddOns/SVUI/packages/stats/stats/guild.lua b/Interface/AddOns/SVUI/packages/stats/stats/guild.lua index 81aa645..8990323 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/guild.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/guild.lua @@ -36,9 +36,8 @@ local twipe, tsort = table.wipe, table.sort; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); +local SV = select(2, ...) +local L = SV.L local MOD = SV.SVStats; --[[ ########################################################## @@ -306,6 +305,6 @@ local GuildColorUpdate = function() Guild_OnEvent(currentObject, 'SVUI_COLOR_UPDATE') end end -Registry:NewCallback(GuildColorUpdate) +SV: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 912b008..1375031 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/hps.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/hps.lua @@ -32,9 +32,8 @@ local max = math.max; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); +local SV = select(2, ...) +local L = SV.L local MOD = SV.SVStats; --[[ ########################################################## @@ -132,5 +131,5 @@ local HPSColorUpdate = function() end end -Registry:NewCallback(HPSColorUpdate) +SV: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 58beb27..86a7c8d 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 SVUI_ADDON_NAME, SV = ... -local L = LibLocale(); +local SV = select(2, ...) +local L = SV.L; local MOD = SV.SVStats; --[[ ########################################################## diff --git a/Interface/AddOns/SVUI/packages/stats/stats/system.lua b/Interface/AddOns/SVUI/packages/stats/stats/system.lua index 194cc27..83586c7 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 SVUI_ADDON_NAME, SV = ... -local L = LibLocale(); +local SV = select(2, ...) +local L = SV.L; local MOD = SV.SVStats; --[[ ########################################################## @@ -66,23 +66,26 @@ local function formatMem(memory) local mult = 10^1 if memory > 999 then local mem = ((memory/1024) * mult) / mult - return format(megaByteString, mem) + return megaByteString:format(mem) else local mem = (memory * mult) / mult - return format(kiloByteString, mem) + return kiloByteString:format(mem) end end local memoryTable = {} local cpuTable = {} +--local eventTable = {"ZONE_CHANGED", "ZONE_CHANGED_NEW_AREA", "PLAYER_ENTERING_WORLD"} + local function RebuildAddonList() local addOnCount = GetNumAddOns() if (addOnCount == #memoryTable) then return end memoryTable = {} cpuTable = {} for i = 1, addOnCount do - memoryTable[i] = { i, select(2, GetAddOnInfo(i)), 0, IsAddOnLoaded(i) } - cpuTable[i] = { i, select(2, GetAddOnInfo(i)), 0, IsAddOnLoaded(i) } + local addonName = select(2, GetAddOnInfo(i)) + memoryTable[i] = { i, addonName, 0, IsAddOnLoaded(i) } + cpuTable[i] = { i, addonName, 0, IsAddOnLoaded(i) } end end @@ -138,11 +141,13 @@ local function OnEnter(self) UpdateMemory() bandwidth = GetAvailableBandwidth() - MOD.tooltip:AddDoubleLine(L['Home Latency:'], format(homeLatencyString, select(3, GetNetStats())), 0.69, 0.31, 0.31,0.84, 0.75, 0.65) + MOD.tooltip:AddDoubleLine(L['Home Latency:'], homeLatencyString:format(select(3, GetNetStats())), 0.69, 0.31, 0.31,0.84, 0.75, 0.65) if bandwidth ~= 0 then - MOD.tooltip:AddDoubleLine(L['Bandwidth'] , format(bandwidthString, bandwidth),0.69, 0.31, 0.31,0.84, 0.75, 0.65) - MOD.tooltip:AddDoubleLine(L['Download'] , format(percentageString, GetDownloadedPercentage() *100),0.69, 0.31, 0.31, 0.84, 0.75, 0.65) + local percent = GetDownloadedPercentage() + percent = percent * 100 + MOD.tooltip:AddDoubleLine(L['Bandwidth'] , bandwidthString:format(bandwidth), 0.69, 0.31, 0.31,0.84, 0.75, 0.65) + MOD.tooltip:AddDoubleLine(L['Download'] , percentageString:format(percent), 0.69, 0.31, 0.31, 0.84, 0.75, 0.65) MOD.tooltip:AddLine(" ") end @@ -150,7 +155,7 @@ local function OnEnter(self) MOD.tooltip:AddDoubleLine(L['Total Memory:'], formatMem(totalMemory), 0.69, 0.31, 0.31,0.84, 0.75, 0.65) if cpuProfiling then totalCPU = UpdateCPU() - MOD.tooltip:AddDoubleLine(L['Total CPU:'], format(homeLatencyString, totalCPU), 0.69, 0.31, 0.31,0.84, 0.75, 0.65) + MOD.tooltip:AddDoubleLine(L['Total CPU:'], homeLatencyString:format(totalCPU), 0.69, 0.31, 0.31,0.84, 0.75, 0.65) end local red, green @@ -171,9 +176,32 @@ local function OnEnter(self) if (cpuTable[i][4]) then red = cpuTable[i][3] / totalCPU green = 1 - red - MOD.tooltip:AddDoubleLine(cpuTable[i][2], format(homeLatencyString, cpuTable[i][3]), 1, 1, 1, red, green + .5, 0) + MOD.tooltip:AddDoubleLine(cpuTable[i][2], homeLatencyString:format(cpuTable[i][3]), 1, 1, 1, red, green + .5, 0) end end + + -- if(MOD.DebugList) then + -- MOD.tooltip:AddLine(" ") + -- for _,schema in pairs(MOD.DebugList) do + -- local obj = SV[schema] + -- if obj and obj.___eventframe then + -- local upTime, numEvents = GetFrameCPUUsage(obj.___eventframe) + -- local eventString = ("%s:"):format(schema) + -- local eventResults = ("Calls: |cffFFFF00%d|r @: |cffFFFF00%dms|r"):format(numEvents, upTime) + -- MOD.tooltip:AddDoubleLine(eventString, eventResults, 1, 0.5, 0, 1, 1, 1) + -- end + -- end + -- end + + -- MOD.tooltip:AddLine(" ") + -- for i = 1, #eventTable do + -- local upTime, numEvents = GetEventCPUUsage(eventTable[i]) + -- local eventString = ("%s:"):format(eventTable[i]) + -- local eventResults = ("Calls: |cffFFFF00%d|r @: |cffFFFF00%dms|r"):format(numEvents, upTime) + -- MOD.tooltip:AddDoubleLine(eventString, eventResults, 1, 0.5, 0, 1, 1, 1) + -- end + + MOD.tooltip:AddLine(" ") MOD.tooltip:AddLine(L['(Hold Shift) Memory Usage']) end @@ -186,28 +214,53 @@ local function OnLeave(self) MOD.tooltip:Hide() end -local function Update(self, t) - int = int - t - int2 = int2 - t - - if int < 0 then - RebuildAddonList() - int = 10 +local Update +if(SV.DebugMode) then + Update = function(self, t) + int = int - t + if int < 0 then + UpdateAddOnMemoryUsage() + local svuiRAMout = formatMem(GetAddOnMemoryUsage("SVUI")) + self.text:SetFormattedText("RAM: %s%s|r", statusColors[1], svuiRAMout) + int = 1 + if enteredFrame then + OnEnter(self) + end + end end - if int2 < 0 then - local framerate = floor(GetFramerate()) - local latency = select(4, GetNetStats()) - - self.text:SetFormattedText("FPS: %s%d|r MS: %s%d|r", - statusColors[framerate >= 30 and 1 or (framerate >= 20 and framerate < 30) and 2 or (framerate >= 10 and framerate < 20) and 3 or 4], - framerate, - statusColors[latency < 150 and 1 or (latency >= 150 and latency < 300) and 2 or (latency >= 300 and latency < 500) and 3 or 4], - latency) - int2 = 1 - if enteredFrame then - OnEnter(self) - end +else + Update = function(self, t) + int = int - t + int2 = int2 - t + + if int < 0 then + RebuildAddonList() + int = 10 + end + if int2 < 0 then + local framerate = floor(GetFramerate()) + local latency = select(4, GetNetStats()) + + self.text:SetFormattedText("FPS: %s%d|r MS: %s%d|r", + statusColors[framerate >= 30 and 1 or (framerate >= 20 and framerate < 30) and 2 or (framerate >= 10 and framerate < 20) and 3 or 4], + framerate, + statusColors[latency < 150 and 1 or (latency >= 150 and latency < 300) and 2 or (latency >= 300 and latency < 500) and 3 or 4], + latency) + int2 = 1 + if enteredFrame then + OnEnter(self) + end + end end end -MOD:Extend('System', nil, nil, Update, Click, OnEnter, OnLeave) \ No newline at end of file +MOD:Extend('System', nil, nil, Update, Click, OnEnter, OnLeave) + +--[[ +OTHER CHECKS + +GetScriptCPUUsage() +print(debugstack()) +local usage, calls = GetFunctionCPUUsage(function, includeSubroutines) +local usage, numEvents = GetEventCPUUsage(["event"]) +]]-- \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/time.lua b/Interface/AddOns/SVUI/packages/stats/stats/time.lua index 3c759d5..39755a5 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/time.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/time.lua @@ -35,9 +35,8 @@ local floor = math.floor; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); +local SV = select(2, ...) +local L = SV.L local MOD = SV.SVStats; --[[ ########################################################## @@ -74,7 +73,7 @@ end local function ConvertTime(h, m) local AmPm - if MOD.db.time24 == true then + if SV.db.SVStats.time24 == true then return h, m, -1 else if h >= 12 then @@ -89,7 +88,7 @@ local function ConvertTime(h, m) end local function CalculateTimeValues(tooltip) - if (tooltip and MOD.db.localtime) or (not tooltip and not MOD.db.localtime) then + if (tooltip and SV.db.SVStats.localtime) or (not tooltip and not SV.db.SVStats.localtime) then return ConvertTime(GetGameTime()) else local dateTable = date("*t") @@ -177,10 +176,10 @@ local function OnEnter(self) MOD.tooltip:AddLine(" ") if AmPm == -1 then - MOD.tooltip:AddDoubleLine(MOD.db.localtime and TIMEMANAGER_TOOLTIP_REALMTIME or TIMEMANAGER_TOOLTIP_LOCALTIME, + MOD.tooltip:AddDoubleLine(SV.db.SVStats.localtime and TIMEMANAGER_TOOLTIP_REALMTIME or TIMEMANAGER_TOOLTIP_LOCALTIME, format(europeDisplayFormat_nocolor, Hr, Min), 1, 1, 1, lockoutColorNormal.r, lockoutColorNormal.g, lockoutColorNormal.b) else - MOD.tooltip:AddDoubleLine(MOD.db.localtime and TIMEMANAGER_TOOLTIP_REALMTIME or TIMEMANAGER_TOOLTIP_LOCALTIME, + MOD.tooltip:AddDoubleLine(SV.db.SVStats.localtime and TIMEMANAGER_TOOLTIP_REALMTIME or TIMEMANAGER_TOOLTIP_LOCALTIME, format(ukDisplayFormat_nocolor, Hr, Min, APM[AmPm]), 1, 1, 1, lockoutColorNormal.r, lockoutColorNormal.g, lockoutColorNormal.b) end @@ -233,6 +232,6 @@ local ColorUpdate = function() end end -Registry:NewCallback(ColorUpdate) +SV: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 464ea65..17ded7f 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 SVUI_ADDON_NAME, SV = ... -local L = LibLocale(); +local SV = select(2, ...) +local L = SV.L; local MOD = SV.SVStats; --[[ ########################################################## @@ -80,7 +80,7 @@ end local function TokensEventHandler(self, event,...) if not IsLoggedIn() or not self then return end - local id = SVUI_Global["Accountant"][playerRealm]["tokens"][playerName]; + local id = MOD.Accountant[playerRealm]["tokens"][playerName]; local _, current, tex = GetCurrencyInfo(id) local currentText = ("\124T%s:12\124t %s"):format(tex, current); self.text:SetText(currentText) @@ -90,7 +90,7 @@ local function AddToTokenMenu(id) local name, _, tex, _, _, _, _ = GetCurrencyInfo(id) local itemName = "\124T"..tex..":12\124t "..name; local fn = function() - SVUI_Global["Accountant"][playerRealm]["tokens"][playerName] = id; + MOD.Accountant[playerRealm]["tokens"][playerName] = id; TokensEventHandler(TokenParent) end tinsert(TokenMenuList, {text = itemName, func = fn}); diff --git a/Interface/AddOns/SVUI/packages/tip/SVTip.lua b/Interface/AddOns/SVUI/packages/tip/SVTip.lua index 1384ff4..6a92e5f 100644 --- a/Interface/AddOns/SVUI/packages/tip/SVTip.lua +++ b/Interface/AddOns/SVUI/packages/tip/SVTip.lua @@ -36,12 +36,10 @@ local twipe, tconcat = table.wipe, table.concat; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); +local SV = select(2, ...) +local L = SV.L local LSM = LibStub("LibSharedMedia-3.0") -local CONFIGS = SV.private -local MOD = {}; +local MOD = SV:NewPackage("SVTip", L["Tooltip"]); --[[ ########################################################## LOCAL VARIABLES @@ -209,103 +207,6 @@ local ClearMaskColors = function(self) self[8]:SetTexture(0, 0, 0) end --- local _hook_GameTooltip_ShowCompareItem = function(self, shift) --- if not self then self = GameTooltip end --- local _,link = self:GetItem() --- if not link then return; end --- local shoppingTooltip1, shoppingTooltip2, shoppingTooltip3 = unpack(self.shoppingTooltips) --- local item1 = nil; --- local item2 = nil; --- local item3 = nil; --- local side = "left" - --- if shoppingTooltip1:SetHyperlinkCompareItem(link, 1, shift, self) then item1 = true end --- if shoppingTooltip2:SetHyperlinkCompareItem(link, 2, shift, self) then item2 = true end --- if shoppingTooltip3:SetHyperlinkCompareItem(link, 3, shift, self) then item3 = true end - --- local rightDist = 0; --- local leftPos = self:GetLeft() --- local rightPos = self:GetRight() - --- if not rightPos then rightPos = 0 end --- if not leftPos then leftPos = 0 end - --- rightDist = GetScreenWidth() - rightPos; - --- if(leftPos and (rightDist < leftPos)) then --- side = "left" --- else --- side = "right" --- end - --- if(self:GetAnchorType() and (self:GetAnchorType() ~= "ANCHOR_PRESERVE")) then --- local totalWidth = 0; --- if item1 then --- totalWidth = totalWidth + shoppingTooltip1:GetWidth() --- end --- if item2 then --- totalWidth = totalWidth + shoppingTooltip2:GetWidth() --- end --- if item3 then --- totalWidth = totalWidth + shoppingTooltip3:GetWidth() --- end --- if(side == "left" and (totalWidth > leftPos)) then --- self:SetAnchorType(self:GetAnchorType(), (totalWidth - leftPos), 0) --- elseif(side == "right" and ((rightPos + totalWidth) > GetScreenWidth())) then --- self:SetAnchorType(self:GetAnchorType(), -((rightPos + totalWidth) - GetScreenWidth()), 0) --- end --- end - --- if item3 then --- shoppingTooltip3:SetOwner(self, "ANCHOR_NONE") --- shoppingTooltip3:ClearAllPoints() --- if(side and side == "left") then --- shoppingTooltip3:SetPoint("TOPRIGHT", self, "TOPLEFT", -2, -10) --- else --- shoppingTooltip3:SetPoint("TOPLEFT", self, "TOPRIGHT", 2, -10) --- end --- shoppingTooltip3:SetHyperlinkCompareItem(link, 3, shift, self) --- shoppingTooltip3:Show() --- end - --- if item1 then --- if item3 then --- shoppingTooltip1:SetOwner(shoppingTooltip3, "ANCHOR_NONE") --- else --- shoppingTooltip1:SetOwner(self, "ANCHOR_NONE") --- end --- shoppingTooltip1:ClearAllPoints() - --- if(side and side == "left") then --- if item3 then --- shoppingTooltip1:SetPoint("TOPRIGHT", shoppingTooltip3, "TOPLEFT", -2, 0) --- else --- shoppingTooltip1:SetPoint("TOPRIGHT", self, "TOPLEFT", -2, -10) --- end --- else --- if item3 then --- shoppingTooltip1:SetPoint("TOPLEFT", shoppingTooltip3, "TOPRIGHT", 2, 0) --- else --- shoppingTooltip1:SetPoint("TOPLEFT", self, "TOPRIGHT", 2, -10) --- end --- end --- shoppingTooltip1:SetHyperlinkCompareItem(link, 1, shift, self) --- shoppingTooltip1:Show() - --- if item2 then --- shoppingTooltip2:SetOwner(shoppingTooltip1, "ANCHOR_NONE") --- shoppingTooltip2:ClearAllPoints() --- if (side and side == "left") then --- shoppingTooltip2:SetPoint("TOPRIGHT", shoppingTooltip1, "TOPLEFT", -2, 0) --- else --- shoppingTooltip2:SetPoint("TOPLEFT", shoppingTooltip1, "TOPRIGHT", 2, 0) --- end --- shoppingTooltip2:SetHyperlinkCompareItem(link, 2, shift, self) --- shoppingTooltip2:Show() --- end --- end --- end - function MOD:INSPECT_READY(_,guid) if MOD.lastGUID ~= guid then return end local unit = "mouseover" @@ -374,8 +275,8 @@ local _hook_GameTooltip_OnTooltipSetUnit = function(self) self.SuperBorder:ClearMaskColors() local unit = select(2, self:GetUnit()) local TamablePet; - if self:GetOwner() ~= UIParent and MOD.db.visibility.unitFrames ~= "NONE" then - local vis = MOD.db.visibility.unitFrames; + if self:GetOwner() ~= UIParent and SV.db.SVTip.visibility.unitFrames ~= "NONE" then + local vis = SV.db.SVTip.visibility.unitFrames; if vis == "ALL" or not (vis == "SHIFT" and IsShiftKeyDown() or vis == "CTRL" and IsControlKeyDown() or vis == "ALT" and IsAltKeyDown()) then self:Hide() return @@ -406,7 +307,7 @@ local _hook_GameTooltip_OnTooltipSetUnit = function(self) self.SuperBorder:SetBurstColor(burst.r, burst.g, burst.b) - if MOD.db.playerTitles and pvpName then + if SV.db.SVTip.playerTitles and pvpName then unitName = pvpName end if unitRealm and unitRealm ~= "" then @@ -432,7 +333,7 @@ local _hook_GameTooltip_OnTooltipSetUnit = function(self) guildName = guildName.."-"..guildRealm end - if guildRankName and MOD.db.guildRanks then + if guildRankName and SV.db.SVTip.guildRanks then GameTooltipTextLeft2:SetText(("<|cff00ff10%s|r> [|cff00ff10%s|r]"):format(guildName, guildRankName)) else GameTooltipTextLeft2:SetText(("<|cff00ff10%s|r>"):format(guildName)) @@ -452,7 +353,7 @@ local _hook_GameTooltip_OnTooltipSetUnit = function(self) lvlLine:SetFormattedText("|cff%02x%02x%02x%s|r %s |c%s%s|r", qColor.r * 255, qColor.g * 255, qColor.b * 255, unitLevel > 0 and unitLevel or SKULL_ICON, race or "", colors.colorStr, className) end - if(not IsAddOnLoaded("HealBot") and (MOD.db.inspectInfo or isShiftKeyDown)) then + if(not IsAddOnLoaded("HealBot") and (SV.db.SVTip.inspectInfo or isShiftKeyDown)) then ShowInspectInfo(self, unit, unitLevel, colors.r, colors.g, colors.b, 0) end else @@ -503,7 +404,7 @@ local _hook_GameTooltip_OnTooltipSetUnit = function(self) if(TamablePet) then GameTooltip:AddLine(TAMABLE_INDICATOR) end - if MOD.db.targetInfo then + if SV.db.SVTip.targetInfo then local unitTarget = unit.."target" if(unit ~= "player" and UnitExists(unitTarget)) then if UnitIsPlayer(unitTarget) and not UnitHasVehicleUI(unitTarget) then @@ -536,7 +437,7 @@ local _hook_GameTooltip_OnTooltipSetUnit = function(self) end local _hook_GameTooltipStatusBar_OnValueChanged = function(self, value) - if not value or not MOD.db.healthBar.text or not self.text then return end + if not value or not SV.db.SVTip.healthBar.text or not self.text then return end local unit = select(2,self:GetParent():GetUnit()) if not unit then local mFocus = GetMouseFocus() @@ -568,7 +469,7 @@ local _hook_GameTooltip_OnTooltipSetItem = function(self) end local left = ""; local right = ""; - if itemID ~= nil and MOD.db.spellID then + if itemID ~= nil and SV.db.SVTip.spellID then left = "|cFFCA3C3CSpell ID: |r" right = ("|cFFCA3C3C%s|r %s"):format(ID,itemID):match(":(%w+)") end @@ -606,7 +507,7 @@ end local _hook_OnSetUnitAura = function(self, unit, index, filter) local _, _, _, _, _, _, _, caster, _, _, spellID = UnitAura(unit, index, filter) - if spellID and MOD.db.spellID then + if spellID and SV.db.SVTip.spellID then self.SuperBorder:ClearMaskColors() if caster then local name = UnitName(caster) @@ -666,19 +567,19 @@ end local _hook_GameTooltip_SetDefaultAnchor = function(self, parent) 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 + if InCombatLockdown() and SV.db.SVTip.visibility.combat then self:Hide() return end if parent then - if(MOD.db.cursorAnchor) then + if(SV.db.SVTip.cursorAnchor) then self:SetOwner(parent, "ANCHOR_CURSOR") return else self:SetOwner(parent, "ANCHOR_NONE") end end - if not SV:TestMovableMoved("SVUI_ToolTip_MOVE")then + if not SV.Mentalo:HasMoved("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 @@ -954,7 +855,7 @@ end function MOD:Load() BNToastFrame:Point("TOPRIGHT", SVUI_MinimapFrame, "BOTTOMLEFT", 0, -10) - SV:SetSVMovable(BNToastFrame, L["BNet Frame"], nil, nil, nil, nil, "BNET") + SV.Mentalo:Add(BNToastFrame, L["BNet Frame"], nil, nil, nil, nil, "BNET") NewHook(BNToastFrame, "SetPoint", _hook_BNToastOnShow) if not SV.db.SVTip.enable then return end @@ -962,9 +863,9 @@ function MOD:Load() anchor:Point("BOTTOMRIGHT", RightSuperDock, "TOPRIGHT", 0, 60) anchor:Size(130, 20) anchor:SetFrameLevel(anchor:GetFrameLevel() + 50) - SV:SetSVMovable(anchor, L["Tooltip"]) + SV.Mentalo:Add(anchor, L["Tooltip"]) - local barHeight = self.db.healthBar.height + local barHeight = SV.db.SVTip.healthBar.height ApplyTooltipSkins() @@ -975,7 +876,7 @@ function MOD:Load() 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(LSM:Fetch("font", MOD.db.healthBar.font), MOD.db.healthBar.fontSize, "OUTLINE") + GameTooltipStatusBar.text:SetFontTemplate(LSM:Fetch("font", SV.db.SVTip.healthBar.font), SV.db.SVTip.healthBar.fontSize, "OUTLINE") if not GameTooltipStatusBar.border then local border = CreateFrame("Frame", nil, GameTooltipStatusBar) @@ -996,7 +897,7 @@ function MOD:Load() NewHook(GameTooltip, "SetUnitDebuff", _hook_OnSetUnitAura) NewHook(GameTooltip, "SetUnitConsolidatedBuff", _hook_OnSetHyperUnitAura) - if self.db.spellID then + if SV.db.SVTip.spellID then NewHook("SetItemRef", _hook_OnItemRef) GameTooltip:HookScript("OnTooltipSetSpell", _hook_GameTooltip_OnTooltipSetSpell) end @@ -1006,32 +907,4 @@ function MOD:Load() GameTooltip:HookScript("OnTooltipSetUnit", _hook_GameTooltip_OnTooltipSetUnit) GameTooltipStatusBar:HookScript("OnValueChanged", _hook_GameTooltipStatusBar_OnValueChanged) self:RegisterEvent("MODIFIER_STATE_CHANGED", TooltipModifierChangeHandler) -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -CONFIGS["SVTip"] = { - ["enable"] = true, - ["cursorAnchor"] = false, - ["targetInfo"] = true, - ["playerTitles"] = true, - ["guildRanks"] = true, - ["inspectInfo"] = false, - ["itemCount"] = true, - ["spellID"] = false, - ["progressInfo"] = true, - ["visibility"] = { - ["unitFrames"] = "NONE", - ["combat"] = false, - }, - ["healthBar"] = { - ["text"] = true, - ["height"] = 10, - ["font"] = "Roboto", - ["fontSize"] = 10, - }, -} - -Registry:NewPackage(MOD, "SVTip") \ No newline at end of file +end \ 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 6e0a8de..12023ad 100644 --- a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua +++ b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua @@ -16,24 +16,35 @@ S U P E R - V I L L A I N - U I By: Munglunch # LOCALIZED LUA FUNCTIONS ########################################################## ]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local ipairs = _G.ipairs; -local type = _G.type; -local tostring = _G.tostring; -local tinsert = _G.tinsert; -local string = _G.string; -local math = _G.math; ---[[ STRING METHODS ]]-- -local find, format, upper = string.find, string.format, string.upper; -local match, gsub = string.match, string.gsub; ---[[ MATH METHODS ]]-- -local min, random = math.min, math.random; ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; +--LUA +local unpack = unpack; +local select = select; +local pairs = pairs; +local type = type; +local rawset = rawset; +local rawget = rawget; +local tostring = tostring; +local error = error; +local next = next; +local pcall = pcall; +local getmetatable = getmetatable; +local setmetatable = setmetatable; +local assert = assert; +--BLIZZARD +local _G = _G; +local tinsert = _G.tinsert; +local tremove = _G.tremove; +local twipe = _G.wipe; +--STRING +local string = string; +local format = string.format; +local find = string.find; +local match = string.match; +--MATH +local math = math; +local min, random = math.min, math.random; +--TABLE +local table = table; --[[ LOCALIZED BLIZZ FUNCTIONS ]]-- local NewHook = hooksecurefunc; --[[ @@ -41,21 +52,22 @@ local NewHook = hooksecurefunc; GET ADDON DATA AND TEST FOR oUF ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF + assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); -local LSM = LibStub("LibSharedMedia-3.0") +local L = SV.L; +local LSM = LibStub("LibSharedMedia-3.0"); --[[ ########################################################## MODULE AND INNER CLASSES ########################################################## ]]-- -local MOD = {} +local MOD = SV:NewPackage("SVUnit", L["UnitFrames"]) MOD.Units = {} MOD.Headers = {} +MOD.Dispellable = {} oUF_Villain.SVConfigs = {} --[[ @@ -220,8 +232,8 @@ end function MOD:GetActiveSize(db) local width, height, best = 0,0,0 - if(self.db.grid.enable and db.gridAllowed) then - width = self.db.grid.size + if(SV.db.SVUnit.grid.enable and db.gridAllowed) then + width = SV.db.SVUnit.grid.size height = width best = width else @@ -291,14 +303,14 @@ function MOD:RestrictChildren(parentFrame, ...) for i=1,select("#",...) do local childFrame = select(i,...) - childFrame:RegisterForClicks(MOD.db.fastClickTarget and 'AnyDown' or 'AnyUp') + childFrame:RegisterForClicks(SV.db.SVUnit.fastClickTarget and 'AnyDown' or 'AnyUp') childFrame.TargetGlow:SetAlpha(1) self:RestrictElement(childFrame) end end function MOD:ResetUnitOptions(unit) - SV.db:SetDefault("SVUnit", unit) + SV:ResetData("SVUnit", unit) self:RefreshUnitFrames() end @@ -330,10 +342,10 @@ function MOD:RefreshUnitColors() end function MOD:RefreshAllUnitMedia() - if(not self.db or (self.db and self.db.enable ~= true)) then return end + if(not SV.db.SVUnit or (SV.db.SVUnit and SV.db.SVUnit.enable ~= true)) then return end self:RefreshUnitColors() for unit,frame in pairs(self.Units)do - if self.db[frame.___key].enable then + if SV.db.SVUnit[frame.___key].enable then frame:MediaUpdate() frame:UpdateAllElements() end @@ -348,7 +360,7 @@ function MOD:RefreshUnitFrames() if(InCombatLockdown()) then self:RegisterEvent("PLAYER_REGEN_ENABLED"); return end self:RefreshUnitColors() for unit,frame in pairs(self.Units)do - if(self.db.enable == true and self.db[frame.___key].enable) then + if(SV.db.SVUnit.enable == true and SV.db.SVUnit[frame.___key].enable) then frame:Enable() frame:Update() else @@ -379,7 +391,7 @@ function MOD:RefreshUnitFrames() end function MOD:RefreshUnitMedia(unitName) - local db = MOD.db + local db = SV.db.SVUnit local key = unitName or self.___key if(not (db and db.enable) or not self) then return end local CURRENT_BAR_TEXTURE = LSM:Fetch("statusbar", db.statusbar) @@ -438,7 +450,7 @@ function MOD:RefreshUnitMedia(unitName) ab.textOutline = db.auraFontOutline ab.buffColor = oUF_Villain.colors.buff_bars - if MOD.db.auraBarByType then + if SV.db.SVUnit.auraBarByType then ab.debuffColor = nil; ab.defaultDebuffColor = oUF_Villain.colors.debuff_bars else @@ -467,7 +479,7 @@ function MOD:RefreshUnitMedia(unitName) end function MOD:RefreshUnitLayout(frame, template) - local db = self.db[template] + local db = SV.db.SVUnit[template] local TOP_ANCHOR1, TOP_ANCHOR2, TOP_MODIFIER = "TOPRIGHT", "TOPLEFT", 1; local BOTTOM_ANCHOR1, BOTTOM_ANCHOR2, BOTTOM_MODIFIER = "BOTTOMLEFT", "BOTTOMRIGHT", -1; @@ -483,8 +495,8 @@ function MOD:RefreshUnitLayout(frame, template) local UNIT_WIDTH, UNIT_HEIGHT, BEST_SIZE = self:GetActiveSize(db) local POWER_HEIGHT = (db.power and db.power.enable) and (db.power.height - 1) or 1; local PORTRAIT_WIDTH = (1 * TOP_MODIFIER) - local GRID_MODE = (self.db.grid.enable and db.gridAllowed) or false - local MINI_GRID = (GRID_MODE and self.db.grid.size < 26) or false + local GRID_MODE = (SV.db.SVUnit.grid.enable and db.gridAllowed) or false + local MINI_GRID = (GRID_MODE and SV.db.SVUnit.grid.size < 26) or false local healthPanel = frame.HealthPanel local infoPanel = frame.InfoPanel @@ -496,7 +508,7 @@ function MOD:RefreshUnitLayout(frame, template) PORTRAIT_WIDTH = ((db.portrait.width * TOP_MODIFIER) + (1 * TOP_MODIFIER)) else portraitOverlay = true - overlayAnimation = self.db.overlayAnimation + overlayAnimation = SV.db.SVUnit.overlayAnimation end end @@ -558,7 +570,7 @@ function MOD:RefreshUnitLayout(frame, template) if(infoPanel.Name and db.name) then local nametext = infoPanel.Name if(GRID_MODE) then - if(self.db.grid.shownames and self.db.grid.size >= 30) then + if(SV.db.SVUnit.grid.shownames and SV.db.SVUnit.grid.size >= 30) then if(not nametext:IsShown()) then nametext:Show() end nametext:Point("CENTER", frame, "CENTER", 0, 0) nametext:SetJustifyH("CENTER") @@ -650,7 +662,7 @@ function MOD:RefreshUnitLayout(frame, template) health.fillInverted = false end - health.Smooth = self.db.smoothbars; + health.Smooth = SV.db.SVUnit.smoothbars; health.colorSmooth = nil; health.colorHealth = nil; health.colorClass = nil; @@ -661,21 +673,21 @@ function MOD:RefreshUnitLayout(frame, template) if(not GRID_MODE and frame.HealPrediction) then frame.HealPrediction["frequentUpdates"] = health.frequentUpdates end - if(not GRID_MODE and portraitOverlay and self.db.forceHealthColor) then + if(not GRID_MODE and portraitOverlay and SV.db.SVUnit.forceHealthColor) then health.colorOverlay = true; else if(GRID_MODE or (db.colorOverride and db.colorOverride == "FORCE_ON")) then health.colorClass = true; health.colorReaction = true elseif(db.colorOverride and db.colorOverride == "FORCE_OFF") then - if self.db.colorhealthbyvalue == true then + if SV.db.SVUnit.colorhealthbyvalue == true then health.colorSmooth = true else health.colorHealth = true end else - if(not self.db.healthclass) then - if self.db.colorhealthbyvalue == true then + if(not SV.db.SVUnit.healthclass) then + if SV.db.SVUnit.colorhealthbyvalue == true then health.colorSmooth = true else health.colorHealth = true @@ -709,12 +721,12 @@ function MOD:RefreshUnitLayout(frame, template) power:Show() end - power.Smooth = self.db.smoothbars; + power.Smooth = SV.db.SVUnit.smoothbars; power.colorClass = nil; power.colorReaction = nil; power.colorPower = nil; - if self.db.powerclass then + if SV.db.SVUnit.powerclass then power.colorClass = true; power.colorReaction = true else @@ -753,7 +765,7 @@ function MOD:RefreshUnitLayout(frame, template) altPower:Point(TOP_ANCHOR2, frame, TOP_ANCHOR2, PORTRAIT_WIDTH, -1) altPower:Point(TOP_ANCHOR1, frame, TOP_ANCHOR1, (1 * BOTTOM_MODIFIER), -1) altPower:SetHeight(POWER_HEIGHT) - altPower.Smooth = self.db.smoothbars; + altPower.Smooth = SV.db.SVUnit.smoothbars; altPower:HookScript("OnShow", Alt_OnShow) altPower:HookScript("OnHide", Alt_OnHide) else @@ -1015,7 +1027,7 @@ function MOD:RefreshUnitLayout(frame, template) end auraBar.buffColor = oUF_Villain.colors.buff_bars - if self.db.auraBarByType then + if SV.db.SVUnit.auraBarByType then auraBar.debuffColor = nil; auraBar.defaultDebuffColor = oUF_Villain.colors.debuff_bars else @@ -1133,7 +1145,7 @@ function MOD:RefreshUnitLayout(frame, template) --[[ DEBUFF HIGHLIGHT LAYOUT ]]-- if frame.Afflicted then - if self.db.debuffHighlighting then + if SV.db.SVUnit.debuffHighlighting then if(template ~= "player" and template ~= "target" and template ~= "focus") then frame.Afflicted:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) end @@ -1147,9 +1159,9 @@ function MOD:RefreshUnitLayout(frame, template) if frame.Range then if(template:find("raid") or template:find("party")) then - frame.Range.outsideAlpha = self.db.groupOORAlpha or 1 + frame.Range.outsideAlpha = SV.db.SVUnit.groupOORAlpha or 1 else - frame.Range.outsideAlpha = self.db.OORAlpha or 1 + frame.Range.outsideAlpha = SV.db.SVUnit.OORAlpha or 1 end if db.rangeCheck then @@ -1244,7 +1256,7 @@ local function ChangeGroupIndex(self) local max = MAX_RAID_MEMBERS; local key = self.___groupkey - local db = MOD.db[key] + local db = SV.db.SVUnit[key] local newIndex = db.customSorting and -(min(db.groupCount * (db.gRowCol * 5), max) + 1 ) or -4; if self:GetAttribute("startingIndex") ~= newIndex then @@ -1280,7 +1292,7 @@ function MOD:UpdateGroupConfig(headerFrame, setForced) SetProxyEnv() local key = headerFrame.___groupkey - local db = self.db[key] + local db = SV.db.SVUnit[key] headerFrame.forceShow = setForced; headerFrame.forceShowAuras = setForced; headerFrame.isForced = setForced; @@ -1377,6 +1389,18 @@ function MOD:KillBlizzardRaidFrames() end end +-- function MOD:GROUP_ROSTER_UPDATE() +-- self:KillBlizzardRaidFrames() +-- if(IsInGroup()) then +-- if(not self:IsEventRegistered("ZONE_CHANGED_NEW_AREA")) then +-- self:ZONE_CHANGED_NEW_AREA() +-- self:RegisterEvent("ZONE_CHANGED_NEW_AREA") +-- end +-- else +-- self:UnregisterEvent("ZONE_CHANGED_NEW_AREA") +-- end; +-- end + function MOD:PLAYER_REGEN_DISABLED() for _,frame in pairs(self.Headers) do if frame and frame.forceShow then @@ -1413,6 +1437,62 @@ local UnitFrameThreatIndicator_Hook = function(unit, unitFrame) end --[[ ########################################################## +CLASS SPECIFIC INFO +########################################################## +]]-- +local RefMagicSpec; +local PlayerClass = select(2,UnitClass("player")); +local droodSpell1, droodSpell2 = GetSpellInfo(110309), GetSpellInfo(4987); + +if(PlayerClass == "PRIEST") then + MOD.Dispellable = {["Magic"] = true, ["Disease"] = true} +elseif(PlayerClass == "MAGE") then + MOD.Dispellable = {["Curse"] = true} +elseif(PlayerClass == "DRUID") then + RefMagicSpec = 4 + MOD.Dispellable = {["Curse"] = true, ["Poison"] = true} +elseif(PlayerClass == "SHAMAN") then + RefMagicSpec = 3 + MOD.Dispellable = {["Curse"] = true} +elseif(PlayerClass == "MONK") then + RefMagicSpec = 2 + MOD.Dispellable = {["Disease"] = true, ["Poison"] = true} +elseif(PlayerClass == "PALADIN") then + RefMagicSpec = 1 + MOD.Dispellable = {["Poison"] = true, ["Disease"] = true} +end + +local function GetTalentInfo(arg) + if type(arg) == "number" then + return arg == GetActiveSpecGroup(); + else + return false; + end +end + +function MOD:CanClassDispel() + if RefMagicSpec then + if(GetTalentInfo(RefMagicSpec)) then + self.Dispellable["Magic"] = true + elseif(self.Dispellable["Magic"]) then + self.Dispellable["Magic"] = nil + end + end +end + +function MOD:SPELLS_CHANGED() + if (PlayerClass ~= "DRUID") then + self:UnregisterEvent("SPELLS_CHANGED") + return + end + if GetSpellInfo(droodSpell1) == droodSpell2 then + self.Dispellable["Disease"] = true + elseif(self.Dispellable["Disease"]) then + self.Dispellable["Disease"] = nil + end +end +--[[ +########################################################## BUILD FUNCTION / UPDATE ########################################################## ]]-- @@ -1428,9 +1508,18 @@ function MOD:Load() local SVUI_UnitFrameParent = CreateFrame("Frame", "SVUI_UnitFrameParent", SV.UIParent, "SecureHandlerStateTemplate") RegisterStateDriver(SVUI_UnitFrameParent, "visibility", "[petbattle] hide; show") + self:CanClassDispel() + self:FrameForge() self:RegisterEvent("PLAYER_ENTERING_WORLD") self:RegisterEvent("PLAYER_REGEN_DISABLED") + self:RegisterEvent("SPELLS_CHANGED") + + self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED", "CanClassDispel") + self:RegisterEvent("PLAYER_TALENT_UPDATE", "CanClassDispel") + self:RegisterEvent("CHARACTER_POINTS_CHANGED", "CanClassDispel") + self:RegisterEvent("UNIT_INVENTORY_CHANGED", "CanClassDispel") + self:RegisterEvent("UPDATE_BONUS_ACTIONBAR", "CanClassDispel") if(SV.db.SVUnit.disableBlizzard) then self:KillBlizzardRaidFrames() @@ -1473,10 +1562,4 @@ function MOD:Load() rDebuffs.ShowDispelableDebuff = true; rDebuffs.FilterDispellableDebuff = true; rDebuffs.MatchBySpellName = true; -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -Registry:NewPackage(MOD, "SVUnit") \ No newline at end of file +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/SVUnit.xml b/Interface/AddOns/SVUI/packages/unit/SVUnit.xml index b95f83d..a8bbb31 100644 --- a/Interface/AddOns/SVUI/packages/unit/SVUnit.xml +++ b/Interface/AddOns/SVUI/packages/unit/SVUnit.xml @@ -40,7 +40,6 @@ </Frames> </Button> - <Script file="config.lua"/> <Script file="SVUnit.lua"/> <Script file="elements\tags.lua"/> diff --git a/Interface/AddOns/SVUI/packages/unit/config.lua b/Interface/AddOns/SVUI/packages/unit/config.lua deleted file mode 100644 index 5b0c2f0..0000000 --- a/Interface/AddOns/SVUI/packages/unit/config.lua +++ /dev/null @@ -1,2444 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; ---[[ -########################################################## -GET ADDON DATA AND TEST FOR oUF -########################################################## -]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale(); -local CONFIGS = SV.private ---[[ -########################################################## -LOCALS -########################################################## -]]-- -CONFIGS["SVUnit"] = { - ["enable"] = true, - ["disableBlizzard"] = true, - - ["smoothbars"] = false, - ["statusbar"] = "SVUI BasicBar", - ["auraBarStatusbar"] = "SVUI GlowBar", - - ["font"] = "SVUI Number Font", - ["fontSize"] = 12, - ["fontOutline"] = "OUTLINE", - - ["auraFont"] = "SVUI Alert Font", - ["auraFontSize"] = 12, - ["auraFontOutline"] = "OUTLINE", - - ["OORAlpha"] = 0.65, - ["groupOORAlpha"] = 0.45, - ["combatFadeRoles"] = true, - ["combatFadeNames"] = true, - ["debuffHighlighting"] = true, - ["smartRaidFilter"] = true, - ["fastClickTarget"] = false, - ["healglow"] = true, - ["glowtime"] = 0.8, - ["glowcolor"] = {1, 1, 0}, - ["autoRoleSet"] = false, - ["healthclass"] = true, - ["forceHealthColor"] = false, - ["overlayAnimation"] = true, - ["powerclass"] = false, - ["colorhealthbyvalue"] = true, - ["customhealthbackdrop"] = true, - ["classbackdrop"] = false, - ["auraBarByType"] = true, - ["auraBarShield"] = true, - ["castClassColor"] = false, - ["xrayFocus"] = true, - ["gpsLowHealth"] = false, - ["grid"] = { - ["enable"] = false, - ["size"] = 28, - ["shownames"] = false, - ["font"] = "Roboto", - ["fontsize"] = 16, - }, - ["player"] = { - ["enable"] = true, - ["width"] = 215, - ["height"] = 60, - ["lowmana"] = 30, - ["combatfade"] = false, - ["predict"] = false, - ["threatEnabled"] = true, - ["playerExpBar"] = false, - ["playerRepBar"] = false, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "current", - ["name_colored"] = true, - ["name_length"] = 21, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "[health:color][health:current]", - ["position"] = "INNERRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 11, - }, - ["power"] = - { - ["enable"] = true, - ["tags"] = "", - ["height"] = 10, - ["position"] = "INNERLEFT", - ["hideonnpc"] = false, - ["xOffset"] = 0, - ["yOffset"] = 0, - ["detachedWidth"] = 250, - ["attachTextToPower"] = false, - ["druidMana"] = true, - ["fontSize"] = 11, - }, - ["name"] = - { - ["position"] = "CENTER", - ["tags"] = "", - ["xOffset"] = 0, - ["yOffset"] = 0, - ["font"] = "SVUI Number Font", - ["fontSize"] = 13, - ["fontOutline"] = "OUTLINE", - }, - ["pvp"] = - { - ["font"] = "SVUI Number Font", - ["fontSize"] = 12, - ["fontOutline"] = "OUTLINE", - ["position"] = "BOTTOM", - ["tags"] = "||cFFB04F4F[pvptimer][mouseover]||r", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - ["portrait"] = - { - ["enable"] = true, - ["width"] = 50, - ["overlay"] = true, - ["camDistanceScale"] = 1.4, - ["rotation"] = 0, - ["style"] = "3D", - }, - ["buffs"] = - { - ["enable"] = false, - ["perrow"] = 8, - ["numrows"] = 1, - ["attachTo"] = "DEBUFFS", - ["anchorPoint"] = "TOPLEFT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = true, - ["filterRaid"] = true, - ["filterBlocked"] = true, - ["filterAllowed"] = true, - ["filterInfinite"] = true, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = 8, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = true, - ["perrow"] = 8, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "TOPLEFT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = false, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = false, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = 8, - ["sizeOverride"] = 0, - }, - ["aurabar"] = - { - ["enable"] = false, - ["anchorPoint"] = "ABOVE", - ["attachTo"] = "DEBUFFS", - ["filterPlayer"] = true, - ["filterRaid"] = true, - ["filterBlocked"] = true, - ["filterAllowed"] = true, - ["filterInfinite"] = true, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["friendlyAuraType"] = "HELPFUL", - ["enemyAuraType"] = "HARMFUL", - ["height"] = 18, - ["sort"] = "TIME_REMAINING", - }, - ["castbar"] = - { - ["enable"] = true, - ["width"] = 215, - ["height"] = 20, - ["matchFrameWidth"] = true, - ["icon"] = true, - ["latency"] = false, - ["format"] = "REMAINING", - ["ticks"] = false, - ["spark"] = true, - ["displayTarget"] = false, - ["useCustomColor"] = false, - ["castingColor"] = {0.8, 0.8, 0}, - ["sparkColor"] = {1, 0.72, 0}, - }, - ["classbar"] = - { - ["enable"] = true, - ["slideLeft"] = true, - ["inset"] = "inset", - ["height"] = 25, - ["detachFromFrame"] = false, - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 25, - ["attachTo"] = "INNERBOTTOMRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - ["combatIcon"] = { - ["enable"] = true, - ["size"] = 26, - ["attachTo"] = "INNERTOPRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - ["restIcon"] = { - ["enable"] = true, - ["size"] = 25, - ["attachTo"] = "INNERTOPRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - }, - ["stagger"] = - { - ["enable"] = true, - }, - }, - ["target"] = { - ["enable"] = true, - ["width"] = 215, - ["height"] = 60, - ["threatEnabled"] = true, - ["rangeCheck"] = true, - ["predict"] = false, - ["smartAuraDisplay"] = "DISABLED", - ["middleClickFocus"] = true, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "current", - ["name_colored"] = true, - ["name_length"] = 18, - ["smartlevel"] = true, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "[health:color][health:current]", - ["position"] = "INNERLEFT", - ["xOffset"] = 0, - ["yOffset"] = 0, - ["reversed"] = true, - ["fontSize"] = 11, - }, - ["power"] = - { - ["enable"] = true, - ["tags"] = "[power:color][power:current]", - ["height"] = 10, - ["position"] = "INNERRIGHT", - ["hideonnpc"] = true, - ["xOffset"] = 0, - ["yOffset"] = 0, - ["attachTextToPower"] = false, - ["fontSize"] = 11, - }, - ["name"] = - { - ["position"] = "INNERRIGHT", - ["tags"] = "[name:color][name:18][smartlevel]", - ["xOffset"] = -2, - ["yOffset"] = 36, - ["font"] = "SVUI Name Font", - ["fontSize"] = 15, - ["fontOutline"] = "NONE", - }, - ["portrait"] = - { - ["enable"] = true, - ["width"] = 50, - ["overlay"] = true, - ["rotation"] = 0, - ["camDistanceScale"] = 1.4, - ["style"] = "3D", - }, - ["buffs"] = - { - ["enable"] = true, - ["perrow"] = 8, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "TOPRIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "LEFT", - ["filterPlayer"] = - { - friendly = false, - enemy = false, - }, - ["filterRaid"] = - { - friendly = false, - enemy = false, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = false, - enemy = false, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = 8, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = true, - ["perrow"] = 8, - ["numrows"] = 1, - ["attachTo"] = "BUFFS", - ["anchorPoint"] = "TOPRIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "LEFT", - ["filterPlayer"] = - { - friendly = false, - enemy = true, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = false, - enemy = false, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = 8, - ["sizeOverride"] = 0, - }, - ["aurabar"] = - { - ["enable"] = false, - ["anchorPoint"] = "ABOVE", - ["attachTo"] = "DEBUFFS", - ["filterPlayer"] = - { - friendly = true, - enemy = true, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = true, - enemy = true, - }, - ["filterRaid"] = - { - friendly = true, - enemy = true, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "", - ["friendlyAuraType"] = "HELPFUL", - ["enemyAuraType"] = "HARMFUL", - ["height"] = 18, - ["sort"] = "TIME_REMAINING", - }, - ["castbar"] = - { - ["enable"] = true, - ["width"] = 215, - ["height"] = 20, - ["matchFrameWidth"] = true, - ["icon"] = true, - ["format"] = "REMAINING", - ["spark"] = true, - ["useCustomColor"] = false, - ["castingColor"] = {0.8, 0.8, 0}, - ["sparkColor"] = {1, 0.72, 0}, - }, - ["combobar"] = - { - ["enable"] = true, - ["height"] = 30, - ["smallIcons"] = false, - ["hudStyle"] = false, - ["hudScale"] = 64, - ["autoHide"] = true, - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 30, - ["attachTo"] = "INNERLEFT", - ["xOffset"] = 0, - ["yOffset"] = 0, - } - }, - }, - ["targettarget"] = { - ["enable"] = true, - ["rangeCheck"] = true, - ["threatEnabled"] = false, - ["width"] = 150, - ["height"] = 30, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "none", - ["name_colored"] = true, - ["name_length"] = 10, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "", - ["position"] = "INNERRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 9, - }, - ["power"] = - { - ["enable"] = false, - ["tags"] = "", - ["height"] = 7, - ["position"] = "INNERLEFT", - ["hideonnpc"] = false, - ["xOffset"] = 0, - ["yOffset"] = 0, - ["fontSize"] = 9, - }, - ["name"] = - { - ["position"] = "CENTER", - ["tags"] = "[name:color][name:10]", - ["xOffset"] = 0, - ["yOffset"] = 1, - ["font"] = "SVUI Narrator Font", - ["fontSize"] = 14, - ["fontOutline"] = "OUTLINE", - }, - ["portrait"] = - { - ["enable"] = true, - ["width"] = 45, - ["overlay"] = true, - ["rotation"] = 0, - ["camDistanceScale"] = 1, - ["style"] = "3D", - }, - ["buffs"] = - { - ["enable"] = false, - ["perrow"] = 7, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "BOTTOMLEFT", - ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = - { - friendly = true, - enemy = false, - }, - ["filterRaid"] = - { - friendly = true, - enemy = false, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = true, - enemy = false, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = -8, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = false, - ["perrow"] = 5, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "TOPLEFT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = - { - friendly = false, - enemy = true, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = false, - enemy = false, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = 8, - ["sizeOverride"] = 0, - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 18, - ["attachTo"] = "INNERRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - }, - }, - ["focus"] = { - ["enable"] = true, - ["rangeCheck"] = true, - ["threatEnabled"] = true, - ["width"] = 170, - ["height"] = 30, - ["predict"] = false, - ["smartAuraDisplay"] = "DISABLED", - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "none", - ["name_colored"] = true, - ["name_length"] = 15, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "", - ["position"] = "INNERRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["power"] = - { - ["enable"] = true, - ["tags"] = "", - ["height"] = 7, - ["position"] = "INNERLEFT", - ["hideonnpc"] = false, - ["xOffset"] = 0, - ["yOffset"] = 0, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "CENTER", - ["tags"] = "[name:color][name:15]", - ["xOffset"] = 0, - ["yOffset"] = 0, - ["font"] = "SVUI Narrator Font", - ["fontSize"] = 14, - ["fontOutline"] = "OUTLINE", - }, - ["buffs"] = - { - ["enable"] = false, - ["perrow"] = 7, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "BOTTOMRIGHT", - ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "LEFT", - ["filterPlayer"] = - { - friendly = true, - enemy = false, - }, - ["filterRaid"] = - { - friendly = true, - enemy = false, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = true, - enemy = false, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = -8, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = true, - ["perrow"] = 5, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "TOPRIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "LEFT", - ["filterPlayer"] = - { - friendly = false, - enemy = true, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = false, - enemy = false, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = 8, - ["sizeOverride"] = 0, - }, - ["castbar"] = - { - ["enable"] = true, - ["width"] = 170, - ["height"] = 18, - ["icon"] = true, - ["matchFrameWidth"] = true, - ["format"] = "REMAINING", - ["spark"] = true, - ["useCustomColor"] = false, - ["castingColor"] = {0.8, 0.8, 0}, - ["sparkColor"] = {1, 0.72, 0}, - }, - ["aurabar"] = - { - ["enable"] = false, - ["anchorPoint"] = "ABOVE", - ["attachTo"] = "FRAME", - ["filterPlayer"] = - { - friendly = false, - enemy = true, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = false, - enemy = false, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["filterRaid"] = - { - friendly = true, - enemy = true, - }, - ["useFilter"] = "", - ["friendlyAuraType"] = "HELPFUL", - ["enemyAuraType"] = "HARMFUL", - ["height"] = 18, - ["sort"] = "TIME_REMAINING", - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 18, - ["attachTo"] = "INNERLEFT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - }, - }, - ["focustarget"] = { - ["enable"] = false, - ["rangeCheck"] = true, - ["threatEnabled"] = false, - ["width"] = 150, - ["height"] = 26, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "none", - ["name_colored"] = true, - ["name_length"] = 15, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "", - ["position"] = "INNERRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["power"] = - { - ["enable"] = false, - ["tags"] = "", - ["height"] = 7, - ["position"] = "INNERLEFT", - ["hideonnpc"] = false, - ["xOffset"] = 0, - ["yOffset"] = 0, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "CENTER", - ["tags"] = "[name:color][name:15]", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["font"] = "SVUI Narrator Font", - ["fontSize"] = 14, - ["fontOutline"] = "OUTLINE", - }, - ["buffs"] = - { - ["enable"] = false, - ["perrow"] = 7, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "BOTTOMLEFT", - ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = - { - friendly = true, - enemy = false, - }, - ["filterRaid"] = - { - friendly = true, - enemy = false, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = true, - enemy = false, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = -8, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = false, - ["perrow"] = 5, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "TOPLEFT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = - { - friendly = false, - enemy = true, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = false, - enemy = false, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = 8, - ["sizeOverride"] = 0, - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 18, - ["attachTo"] = "INNERLEFT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - }, - }, - ["pet"] = { - ["enable"] = true, - ["rangeCheck"] = true, - ["threatEnabled"] = true, - ["width"] = 150, - ["height"] = 30, - ["predict"] = false, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "none", - ["name_colored"] = true, - ["name_length"] = 10, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "", - ["position"] = "INNERRIGHT", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["power"] = - { - ["enable"] = false, - ["tags"] = "", - ["height"] = 7, - ["position"] = "INNERLEFT", - ["hideonnpc"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "CENTER", - ["tags"] = "[name:color][name:8]", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["font"] = "SVUI Narrator Font", - ["fontSize"] = 14, - ["fontOutline"] = "OUTLINE", - }, - ["portrait"] = - { - ["enable"] = true, - ["width"] = 45, - ["overlay"] = true, - ["rotation"] = 0, - ["camDistanceScale"] = 1, - ["style"] = "3D", - }, - ["buffs"] = - { - ["enable"] = true, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "LEFT", - ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "LEFT", - ["filterPlayer"] = true, - ["filterRaid"] = true, - ["filterBlocked"] = true, - ["filterAllowed"] = true, - ["filterInfinite"] = true, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = -3, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = true, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = false, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = false, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 3, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["castbar"] = - { - ["enable"] = true, - ["width"] = 130, - ["height"] = 8, - ["icon"] = false, - ["matchFrameWidth"] = true, - ["format"] = "REMAINING", - ["spark"] = false, - ["useCustomColor"] = false, - ["castingColor"] = {0.8, 0.8, 0}, - ["sparkColor"] = {1, 0.72, 0}, - }, - ["auraWatch"] = - { - ["enable"] = true, - ["size"] = 8, - }, - }, - ["pettarget"] = { - ["enable"] = false, - ["rangeCheck"] = true, - ["threatEnabled"] = false, - ["width"] = 130, - ["height"] = 26, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "none", - ["name_colored"] = true, - ["name_length"] = 15, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "", - ["position"] = "INNERRIGHT", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["power"] = - { - ["enable"] = false, - ["tags"] = "", - ["height"] = 7, - ["position"] = "INNERLEFT", - ["hideonnpc"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "CENTER", - ["tags"] = "[name:color][name:15]", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["font"] = "SVUI Narrator Font", - ["fontSize"] = 14, - ["fontOutline"] = "OUTLINE", - }, - ["buffs"] = - { - ["enable"] = false, - ["perrow"] = 7, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "BOTTOMLEFT", - ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = - { - friendly = true, - enemy = false, - }, - ["filterRaid"] = - { - friendly = true, - enemy = false, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = true, - enemy = false, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = -8, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = false, - ["perrow"] = 5, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "BOTTOMRIGHT", - ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "LEFT", - ["filterPlayer"] = - { - friendly = false, - enemy = true, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = false, - enemy = false, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = 8, - ["sizeOverride"] = 0, - }, - }, - ["boss"] = { - ["enable"] = true, - ["rangeCheck"] = true, - ["showBy"] = "UP", - ["width"] = 200, - ["height"] = 45, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "current", - ["name_colored"] = true, - ["name_length"] = 15, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "[health:color][health:current]", - ["position"] = "INNERTOPRIGHT", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = true, - ["fontSize"] = 10, - }, - ["power"] = - { - ["enable"] = true, - ["tags"] = "[power:color][power:current]", - ["height"] = 7, - ["position"] = "INNERBOTTOMRIGHT", - ["hideonnpc"] = false, - ["yOffset"] = 7, - ["xOffset"] = 0, - ["fontSize"] = 10, - }, - ["portrait"] = - { - ["enable"] = true, - ["width"] = 35, - ["overlay"] = true, - ["rotation"] = 0, - ["camDistanceScale"] = 1, - ["style"] = "3D", - }, - ["name"] = - { - ["position"] = "INNERLEFT", - ["tags"] = "[name:color][name:15]", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["font"] = "SVUI Number Font", - ["fontSize"] = 12, - ["fontOutline"] = "OUTLINE", - }, - ["buffs"] = - { - ["enable"] = true, - ["perrow"] = 2, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "LEFT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "LEFT", - ["filterPlayer"] = false, - ["filterRaid"] = false, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = false, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = -8, - ["yOffset"] = 0, - ["sizeOverride"] = 40, - }, - ["debuffs"] = - { - ["enable"] = true, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "BUFFS", - ["anchorPoint"] = "LEFT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "LEFT", - ["filterPlayer"] = true, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = false, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = -8, - ["yOffset"] = 0, - ["sizeOverride"] = 40, - }, - ["castbar"] = - { - ["enable"] = true, - ["width"] = 200, - ["height"] = 18, - ["icon"] = true, - ["matchFrameWidth"] = true, - ["format"] = "REMAINING", - ["spark"] = true, - ["useCustomColor"] = false, - ["castingColor"] = {0.8, 0.8, 0}, - ["sparkColor"] = {1, 0.72, 0}, - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 22, - ["attachTo"] = "CENTER", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - }, - }, - ["arena"] = { - ["enable"] = true, - ["rangeCheck"] = true, - ["showBy"] = "UP", - ["width"] = 215, - ["height"] = 45, - ["predict"] = false, - ["colorOverride"] = "USE_DEFAULT", - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "current", - ["name_colored"] = true, - ["name_length"] = 15, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "[health:color][health:current]", - ["position"] = "INNERTOPRIGHT", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = true, - ["fontSize"] = 10, - }, - ["power"] = - { - ["enable"] = true, - ["tags"] = "[power:color][power:current]", - ["height"] = 7, - ["position"] = "INNERBOTTOMRIGHT", - ["hideonnpc"] = false, - ["yOffset"] = 7, - ["xOffset"] = 0, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "INNERLEFT", - ["tags"] = "[name:color][name:15]", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["font"] = "SVUI Number Font", - ["fontSize"] = 12, - ["fontOutline"] = "OUTLINE", - }, - ["portrait"] = - { - ["enable"] = true, - ["width"] = 45, - ["overlay"] = true, - ["rotation"] = 0, - ["camDistanceScale"] = 1, - ["style"] = "3D", - }, - ["buffs"] = - { - ["enable"] = true, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "LEFT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "LEFT", - ["filterPlayer"] = - { - friendly = false, - enemy = false, - }, - ["filterRaid"] = - { - friendly = false, - enemy = false, - }, - ["filterBlocked"] = - { - friendly = false, - enemy = false, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "Shield", - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["xOffset"] = -8, - ["yOffset"] = 0, - ["sizeOverride"] = 40, - }, - ["debuffs"] = - { - ["enable"] = true, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "BUFFS", - ["anchorPoint"] = "LEFT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "LEFT", - ["filterPlayer"] = - { - friendly = false, - enemy = false, - }, - ["filterBlocked"] = - { - friendly = false, - enemy = false, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "CC", - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["xOffset"] = -8, - ["yOffset"] = 0, - ["sizeOverride"] = 40, - }, - ["castbar"] = - { - ["enable"] = true, - ["width"] = 215, - ["height"] = 18, - ["icon"] = true, - ["matchFrameWidth"] = true, - ["format"] = "REMAINING", - ["spark"] = true, - ["useCustomColor"] = false, - ["castingColor"] = {0.8, 0.8, 0}, - ["sparkColor"] = {1, 0.72, 0}, - }, - ["pvp"] = - { - ["enable"] = true, - ["trinketPosition"] = "LEFT", - ["trinketSize"] = 45, - ["trinketX"] = -2, - ["trinketY"] = 0, - ["specPosition"] = "RIGHT", - ["specSize"] = 45, - ["specX"] = 2, - ["specY"] = 0, - }, - }, - ["party"] = { - ["enable"] = true, - ["rangeCheck"] = true, - ["threatEnabled"] = true, - ["visibility"] = "[@raid6, exists][nogroup] hide;show", - ["showBy"] = "UP_RIGHT", - ["wrapXOffset"] = 9, - ["wrapYOffset"] = 13, - ["groupCount"] = 1, - ["gRowCol"] = 1, - ["customSorting"] = false, - ["sortMethod"] = "GROUP", - ["sortDir"] = "ASC", - ["invertGroupingOrder"] = false, - ["startFromCenter"] = false, - ["showPlayer"] = true, - ["predict"] = false, - ["colorOverride"] = "USE_DEFAULT", - ["width"] = 70, - ["height"] = 70, - ["gridAllowed"] = true, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "none", - ["name_colored"] = true, - ["name_length"] = 10, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "", - ["position"] = "BOTTOM", - ["orientation"] = "HORIZONTAL", - ["frequentUpdates"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["power"] = - { - ["enable"] = true, - ["tags"] = "", - ["frequentUpdates"] = false, - ["height"] = 7, - ["position"] = "BOTTOMRIGHT", - ["hideonnpc"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "INNERTOPLEFT", - ["tags"] = "[name:color][name:10]", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["font"] = "SVUI Narrator Font", - ["fontSize"] = 13, - ["fontOutline"] = "OUTLINE", - }, - ["buffs"] = - { - ["enable"] = false, - ["perrow"] = 2, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHTTOP", - ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = true, - ["filterRaid"] = true, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = true, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = true, - ["perrow"] = 2, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHTTOP", - ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = false, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = false, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["auraWatch"] = - { - ["enable"] = true, - ["size"] = 8, - ["fontSize"] = 11, - }, - ["petsGroup"] = - { - ["enable"] = false, - ["width"] = 30, - ["height"] = 30, - ["gridAllowed"] = true, - ["anchorPoint"] = "BOTTOMLEFT", - ["xOffset"] = - 1, - ["yOffset"] = 0, - ["name_length"] = 3, - ["tags"] = "[name:3]", - }, - ["targetsGroup"] = - { - ["enable"] = false, - ["width"] = 30, - ["height"] = 30, - ["gridAllowed"] = true, - ["anchorPoint"] = "TOPLEFT", - ["xOffset"] = - 1, - ["yOffset"] = 0, - ["name_length"] = 3, - ["tags"] = "[name:3]", - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 25, - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - ["roleIcon"] = - { - ["enable"] = true, - ["size"] = 18, - ["attachTo"] = "INNERBOTTOMRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - ["raidRoleIcons"] = - { - ["enable"] = true, - ["size"] = 18, - ["attachTo"] = "TOPLEFT", - ["xOffset"] = 0, - ["yOffset"] = -4, - }, - }, - ["portrait"] = - { - ["enable"] = true, - ["width"] = 45, - ["overlay"] = true, - ["rotation"] = 0, - ["camDistanceScale"] = 1, - ["style"] = "3D", - }, - }, - ["raid10"] = { - ["enable"] = true, - ["rangeCheck"] = true, - ["threatEnabled"] = true, - ["visibility"] = "[@raid6, noexists][@raid11, exists][nogroup] hide;show", - ["showBy"] = "RIGHT_DOWN", - ["wrapXOffset"] = 8, - ["wrapYOffset"] = 8, - ["groupCount"] = 2, - ["gRowCol"] = 1, - ["customSorting"] = false, - ["sortMethod"] = "GROUP", - ["sortDir"] = "ASC", - ["showPlayer"] = true, - ["predict"] = false, - ["colorOverride"] = "USE_DEFAULT", - ["width"] = 75, - ["height"] = 34, - ["gridAllowed"] = true, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "none", - ["name_colored"] = true, - ["name_length"] = 4, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "", - ["position"] = "BOTTOM", - ["orientation"] = "HORIZONTAL", - ["frequentUpdates"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["power"] = - { - ["enable"] = true, - ["tags"] = "", - ["frequentUpdates"] = false, - ["height"] = 4, - ["position"] = "BOTTOMRIGHT", - ["hideonnpc"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "INNERTOPLEFT", - ["tags"] = "[name:color][name:4]", - ["yOffset"] = 0, - ["xOffset"] = 8, - ["font"] = "SVUI Default Font", - ["fontSize"] = 10, - ["fontOutline"] = "OUTLINE", - }, - ["buffs"] = - { - ["enable"] = false, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = true, - ["filterRaid"] = true, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = true, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = false, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = false, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = false, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["auraWatch"] = - { - ["enable"] = true, - ["size"] = 8, - }, - ["rdebuffs"] = - { - ["enable"] = true, - ["size"] = 26, - ["xOffset"] = 0, - ["yOffset"] = 2, - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 15, - ["attachTo"] = "INNERBOTTOMRIGHT", - ["xOffset"] = -8, - ["yOffset"] = 0, - }, - ["roleIcon"] = - { - ["enable"] = true, - ["size"] = 12, - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - ["raidRoleIcons"] = - { - ["enable"] = true, - ["size"] = 18, - ["attachTo"] = "TOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = -4, - }, - }, - }, - ["raid25"] = { - ["enable"] = true, - ["rangeCheck"] = true, - ["threatEnabled"] = true, - ["visibility"] = "[@raid6, noexists][@raid11, noexists][@raid26, exists][nogroup] hide;show", - ["showBy"] = "RIGHT_DOWN", - ["wrapXOffset"] = 8, - ["wrapYOffset"] = 8, - ["groupCount"] = 5, - ["gRowCol"] = 1, - ["customSorting"] = false, - ["sortMethod"] = "GROUP", - ["sortDir"] = "ASC", - ["showPlayer"] = true, - ["predict"] = false, - ["colorOverride"] = "USE_DEFAULT", - ["width"] = 50, - ["height"] = 30, - ["gridAllowed"] = true, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "none", - ["name_colored"] = true, - ["name_length"] = 4, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "", - ["position"] = "BOTTOM", - ["orientation"] = "HORIZONTAL", - ["frequentUpdates"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["power"] = - { - ["enable"] = true, - ["tags"] = "", - ["height"] = 4, - ["position"] = "BOTTOMRIGHT", - ["hideonnpc"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "INNERTOPLEFT", - ["tags"] = "[name:color][name:4]", - ["yOffset"] = 0, - ["xOffset"] = 8, - ["font"] = "SVUI Default Font", - ["fontSize"] = 10, - ["fontOutline"] = "OUTLINE", - }, - ["buffs"] = - { - ["enable"] = false, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = true, - ["filterRaid"] = true, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = true, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = false, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = false, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = false, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["auraWatch"] = - { - ["enable"] = true, - ["size"] = 8, - }, - ["rdebuffs"] = - { - ["enable"] = true, - ["size"] = 26, - ["xOffset"] = 0, - ["yOffset"] = 2, - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 15, - ["attachTo"] = "INNERBOTTOMRIGHT", - ["xOffset"] = -8, - ["yOffset"] = 0, - }, - ["roleIcon"] = - { - ["enable"] = true, - ["size"] = 12, - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - ["raidRoleIcons"] = - { - ["enable"] = true, - ["size"] = 18, - ["attachTo"] = "TOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = -4, - }, - }, - }, - ["raid40"] = { - ["enable"] = true, - ["rangeCheck"] = true, - ["threatEnabled"] = true, - ["visibility"] = "[@raid6, noexists][@raid11, noexists][@raid26, noexists][nogroup] hide;show", - ["showBy"] = "RIGHT_DOWN", - ["wrapXOffset"] = 8, - ["wrapYOffset"] = 8, - ["groupCount"] = 8, - ["gRowCol"] = 1, - ["customSorting"] = false, - ["sortMethod"] = "GROUP", - ["sortDir"] = "ASC", - ["showPlayer"] = true, - ["predict"] = false, - ["colorOverride"] = "USE_DEFAULT", - ["width"] = 50, - ["height"] = 30, - ["gridAllowed"] = true, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "none", - ["name_colored"] = true, - ["name_length"] = 4, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "", - ["position"] = "BOTTOM", - ["orientation"] = "HORIZONTAL", - ["frequentUpdates"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["power"] = - { - ["enable"] = false, - ["tags"] = "", - ["frequentUpdates"] = false, - ["height"] = 4, - ["position"] = "BOTTOMRIGHT", - ["hideonnpc"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "INNERTOPLEFT", - ["tags"] = "[name:color][name:4]", - ["yOffset"] = 0, - ["xOffset"] = 8, - ["font"] = "SVUI Default Font", - ["fontSize"] = 10, - ["fontOutline"] = "OUTLINE", - }, - ["buffs"] = - { - ["enable"] = false, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = true, - ["filterRaid"] = true, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = true, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = false, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = false, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = false, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["rdebuffs"] = - { - ["enable"] = true, - ["size"] = 22, - ["xOffset"] = 0, - ["yOffset"] = 2, - }, - ["auraWatch"] = - { - ["enable"] = true, - ["size"] = 8, - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 15, - ["attachTo"] = "INNERBOTTOMRIGHT", - ["xOffset"] = -8, - ["yOffset"] = 0, - }, - ["roleIcon"] = - { - ["enable"] = true, - ["size"] = 12, - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - ["raidRoleIcons"] = - { - ["enable"] = true, - ["size"] = 18, - ["attachTo"] = "TOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = -4, - }, - }, - }, - ["raidpet"] = { - ["enable"] = false, - ["rangeCheck"] = true, - ["threatEnabled"] = true, - ["visibility"] = "[group:raid] show; hide", - ["showBy"] = "DOWN_RIGHT", - ["wrapXOffset"] = 3, - ["wrapYOffset"] = 3, - ["groupCount"] = 2, - ["gRowCol"] = 1, - ["customSorting"] = true, - ["sortMethod"] = "PETNAME", - ["sortDir"] = "ASC", - ["invertGroupingOrder"] = false, - ["startFromCenter"] = false, - ["predict"] = false, - ["colorOverride"] = "USE_DEFAULT", - ["width"] = 80, - ["height"] = 30, - ["gridAllowed"] = true, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "deficit", - ["name_colored"] = true, - ["name_length"] = 4, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "[health:color][health:deficit]", - ["position"] = "BOTTOM", - ["orientation"] = "HORIZONTAL", - ["frequentUpdates"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "INNERTOPLEFT", - ["tags"] = "[name:color][name:4]", - ["yOffset"] = 4, - ["xOffset"] = -4, - ["font"] = "SVUI Default Font", - ["fontSize"] = 10, - ["fontOutline"] = "OUTLINE", - }, - ["buffs"] = - { - ["enable"] = false, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = true, - ["filterRaid"] = true, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = true, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = false, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = false, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = false, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["auraWatch"] = - { - ["enable"] = true, - ["size"] = 8, - }, - ["rdebuffs"] = - { - ["enable"] = true, - ["size"] = 26, - ["xOffset"] = 0, - ["yOffset"] = 2, - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 18, - ["attachTo"] = "INNERTOPLEFT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - }, - }, - ["tank"] = { - ["enable"] = true, - ["threatEnabled"] = true, - ["rangeCheck"] = true, - ["width"] = 120, - ["height"] = 28, - ["gridAllowed"] = true, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "deficit", - ["name_colored"] = true, - ["name_length"] = 8, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "[health:color][health:deficit]", - ["position"] = "INNERRIGHT", - ["orientation"] = "HORIZONTAL", - ["frequentUpdates"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "INNERLEFT", - ["tags"] = "[name:color][name:8]", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["font"] = "SVUI Default Font", - ["fontSize"] = 10, - ["fontOutline"] = "OUTLINE", - }, - ["targetsGroup"] = - { - ["enable"] = false, - ["anchorPoint"] = "RIGHT", - ["xOffset"] = 1, - ["yOffset"] = 0, - ["width"] = 120, - ["height"] = 28, - }, - }, - ["assist"] = { - ["enable"] = true, - ["threatEnabled"] = true, - ["rangeCheck"] = true, - ["width"] = 120, - ["height"] = 28, - ["gridAllowed"] = true, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "deficit", - ["name_colored"] = true, - ["name_length"] = 8, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "[health:color][health:deficit]", - ["position"] = "INNERRIGHT", - ["orientation"] = "HORIZONTAL", - ["frequentUpdates"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "INNERLEFT", - ["tags"] = "[name:color][name:8]", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["font"] = "SVUI Default Font", - ["fontSize"] = 10, - ["fontOutline"] = "OUTLINE", - }, - ["targetsGroup"] = - { - ["enable"] = false, - ["anchorPoint"] = "RIGHT", - ["xOffset"] = 1, - ["yOffset"] = 0, - ["width"] = 120, - ["height"] = 28, - }, - } -} \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/elements/auras.lua b/Interface/AddOns/SVUI/packages/unit/elements/auras.lua index d27cce4..20d02f2 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/auras.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/auras.lua @@ -16,39 +16,52 @@ S U P E R - V I L L A I N - U I By: Munglunch # LOCALIZED LUA FUNCTIONS ########################################################## ]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local ipairs = _G.ipairs; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local tostring = _G.tostring; -local tonumber = _G.tonumber; -local tinsert = _G.tinsert; -local string = _G.string; -local math = _G.math; -local table = _G.table; ---[[ MATH METHODS ]]-- -local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; ---[[ TABLE METHODS ]]-- -local tremove, tsort, twipe = table.remove, table.sort, table.wipe; +--LUA +local unpack = unpack; +local select = select; +local pairs = pairs; +local type = type; +local rawset = rawset; +local rawget = rawget; +local tostring = tostring; +local error = error; +local next = next; +local pcall = pcall; +local getmetatable = getmetatable; +local setmetatable = setmetatable; +local assert = assert; +--BLIZZARD +local _G = _G; +local tinsert = _G.tinsert; +local tremove = _G.tremove; +local twipe = _G.wipe; +--STRING +local string = string; +local upper = string.upper; +local format = string.format; +local find = string.find; +local match = string.match; +local gsub = string.gsub; +--MATH +local math = math; +--TABLE +local table = table; +local tsort = table.sort; +local tremove = table.remove; --[[ ########################################################## GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH"s FASTER ASSERT FUNCTION ]]-- -local assert = enforce; + assert(oUF_Villain, "SVUI was unable to locate oUF."); -local L = LibLocale(); +local L = SV.L; local LSM = LibStub("LibSharedMedia-3.0") local MOD = SV.SVUnit + if(not MOD) then return end local CustomAuraFilter,CustomBarFilter; @@ -285,7 +298,7 @@ do end CustomAuraFilter = function(self, unit, icon, name, _, _, _, debuffType, duration, _, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossAura) - local db = MOD.db[self.db] + local db = SV.db.SVUnit[self.___key] local auraType = self.type; if(not auraType) then return true end if((not db) or (db and not db[auraType]) or (spellID == 65148)) then @@ -318,7 +331,7 @@ do pass = true end if _test(auraDB.filterDispellable, friendly) then - if (auraType == "buffs" and not isStealable) or (auraType == "debuffs" and debuffType and not SV.Dispellable[debuffType]) or debuffType == nil then + if (auraType == "buffs" and not isStealable) or (auraType == "debuffs" and debuffType and not MOD.Dispellable[debuffType]) or debuffType == nil then filtered = false end pass = true @@ -349,8 +362,10 @@ do filtered = false end pass = true - end + end + local active = auraDB.useFilter + if active and active ~= "" and SV.db.filter[active] then local spellDB = SV.db.filter[active]; if active ~= "Blocked" then @@ -371,8 +386,7 @@ do end CustomBarFilter = function(self, unit, name, _, _, _, debuffType, duration, _, caster, isStealable, shouldConsolidate, spellID) - local key = self.___key - local db = MOD.db[key] + local db = SV.db.SVUnit[self.___key] if((not db) or (db and not db.aurabar) or (spellID == 65148)) then return false; end @@ -393,7 +407,7 @@ do pass = true end if _test(barDB.filterDispellable, friendly) then - if (debuffType and not SV.Dispellable[debuffType]) or debuffType == nil then + if (debuffType and not MOD.Dispellable[debuffType]) or debuffType == nil then filtered = false end pass = true @@ -445,31 +459,31 @@ BUILD FUNCTION ]]-- function MOD:CreateBuffs(frame, unit) local aura = CreateFrame("Frame", nil, frame) - aura.db = unit + aura.___key = unit aura.spacing = 2; aura.PostCreateIcon = PostCreateAuraIcon; aura.PostUpdateIcon = PostUpdateAuraIcon; aura.CustomFilter = CustomAuraFilter; aura:SetFrameLevel(10) aura.type = "buffs" - aura.textFont = LSM:Fetch("font", MOD.db.auraFont) - aura.textSize = MOD.db.auraFontSize - aura.textOutline = MOD.db.auraFontOutline + aura.textFont = LSM:Fetch("font", SV.db.SVUnit.auraFont) + aura.textSize = SV.db.SVUnit.auraFontSize + aura.textOutline = SV.db.SVUnit.auraFontOutline return aura end function MOD:CreateDebuffs(frame, unit) local aura = CreateFrame("Frame", nil, frame) - aura.db = unit + aura.___key = unit aura.spacing = 2; aura.PostCreateIcon = PostCreateAuraIcon; aura.PostUpdateIcon = PostUpdateAuraIcon; aura.CustomFilter = CustomAuraFilter; aura.type = "debuffs" aura:SetFrameLevel(10) - aura.textFont = LSM:Fetch("font", MOD.db.auraFont) - aura.textSize = MOD.db.auraFontSize - aura.textOutline = MOD.db.auraFontOutline + aura.textFont = LSM:Fetch("font", SV.db.SVUnit.auraFont) + aura.textSize = SV.db.SVUnit.auraFontSize + aura.textOutline = SV.db.SVUnit.auraFontOutline return aura end @@ -493,17 +507,17 @@ function MOD:CreateAuraBarHeader(frame, unitName) auraBarParent.spark = true; auraBarParent.filter = CustomBarFilter; auraBarParent.PostUpdate = ColorizeAuraBars; - auraBarParent.barTexture = LSM:Fetch("statusbar", MOD.db.auraBarStatusbar) + auraBarParent.barTexture = LSM:Fetch("statusbar", SV.db.SVUnit.auraBarStatusbar) auraBarParent.timeFont = LSM:Fetch("font", "Roboto") - auraBarParent.textFont = LSM:Fetch("font", MOD.db.auraFont) - auraBarParent.textSize = MOD.db.auraFontSize - auraBarParent.textOutline = MOD.db.auraFontOutline + auraBarParent.textFont = LSM:Fetch("font", SV.db.SVUnit.auraFont) + auraBarParent.textSize = SV.db.SVUnit.auraFontSize + auraBarParent.textOutline = SV.db.SVUnit.auraFontOutline return auraBarParent end function MOD:SmartAuraDisplay() local unit = self.unit; - local db = MOD.db[unit]; + local db = SV.db.SVUnit[unit]; if not db or not db.smartAuraDisplay or db.smartAuraDisplay == 'DISABLED' or not UnitExists(unit) then return end local buffs = self.Buffs; local debuffs = self.Debuffs; @@ -553,11 +567,10 @@ end UPDATE ########################################################## ]]-- -local WATCH_CACHE = {} function MOD:UpdateAuraWatch(frame, key, override) local AW = frame.AuraWatch - if not self.db[key] then return end - local db = self.db[key].auraWatch + if not SV.db.SVUnit[key] then return end + local db = SV.db.SVUnit[key].auraWatch if not db then return end if not db.enable then @@ -567,13 +580,14 @@ function MOD:UpdateAuraWatch(frame, key, override) AW:Show() end - local bwSize = db.size; + local WATCH_CACHE if key == "pet" and not override then local petBW = SV.db.filter["PetBuffWatch"] if(petBW) then + WATCH_CACHE = {} for _, buff in pairs(petBW)do - if buff.style == "text" then + if(buff.style == "text") then buff.style = "NONE" end tinsert(WATCH_CACHE, buff) @@ -582,149 +596,153 @@ function MOD:UpdateAuraWatch(frame, key, override) else local unitBW = SV.db.filter["BuffWatch"] if(unitBW) then + WATCH_CACHE = {} for _, buff in pairs(unitBW)do - if buff.style == "text" then + if(buff.style == "text") then buff.style = "NONE" end tinsert(WATCH_CACHE, buff) end end - end - - if AW.icons then - for i = 1, #AW.icons do - local iconTest = false; - for j = 1, #WATCH_CACHE do - if #WATCH_CACHE[j].id and #WATCH_CACHE[j].id == AW.icons[i] then - iconTest = true; - break + end + + if WATCH_CACHE then + local fontFile = LSM:Fetch("font", SV.db.SVUnit.auraFont) + local fontSize = SV.db.SVUnit.auraFontSize + local fontOutline = SV.db.SVUnit.auraFontOutline + + if AW.icons then + for i = 1, #AW.icons do + local iconTest = false; + for j = 1, #WATCH_CACHE do + if(#WATCH_CACHE[j].id and #WATCH_CACHE[j].id == AW.icons[i]) then + iconTest = true; + break + end + end + if not iconTest then + AW.icons[i]:Hide() + AW.icons[i] = nil end end - if not iconTest then - AW.icons[i]:Hide() - AW.icons[i] = nil - end - end - end + end - local fontFile = LSM:Fetch("font", self.db.auraFont) - local fontSize = self.db.auraFontSize - local fontOutline = self.db.auraFontOutline - - for i = 1, #WATCH_CACHE do - if WATCH_CACHE[i].id then - local buffName, _, buffTexture = GetSpellInfo(WATCH_CACHE[i].id) - if buffName then - local watchedAura; - if not AW.icons[WATCH_CACHE[i].id]then - watchedAura = CreateFrame("Frame", nil, AW) - else - watchedAura = AW.icons[WATCH_CACHE[i].id] - end - watchedAura.name = buffName; - watchedAura.image = buffTexture; - watchedAura.spellID = WATCH_CACHE[i].id; - watchedAura.anyUnit = WATCH_CACHE[i].anyUnit; - watchedAura.style = WATCH_CACHE[i].style; - watchedAura.onlyShowMissing = WATCH_CACHE[i].onlyShowMissing; - watchedAura.presentAlpha = watchedAura.onlyShowMissing and 0 or 1; - watchedAura.missingAlpha = watchedAura.onlyShowMissing and 1 or 0; - watchedAura.textThreshold = WATCH_CACHE[i].textThreshold or -1; - watchedAura.displayText = WATCH_CACHE[i].displayText; - watchedAura:Width(bwSize) - watchedAura:Height(bwSize) - watchedAura:ClearAllPoints() - - watchedAura:SetPoint(WATCH_CACHE[i].point, frame.Health, WATCH_CACHE[i].point, WATCH_CACHE[i].xOffset, WATCH_CACHE[i].yOffset) - if not watchedAura.icon then - watchedAura.icon = watchedAura:CreateTexture(nil, "BORDER") - watchedAura.icon:SetAllPoints(watchedAura) - end - if not watchedAura.text then - local awText = CreateFrame("Frame", nil, watchedAura) - awText:SetFrameLevel(watchedAura:GetFrameLevel() + 50) - watchedAura.text = awText:CreateFontString(nil, "BORDER") - end - if not watchedAura.border then - watchedAura.border = watchedAura:CreateTexture(nil, "BACKGROUND") - watchedAura.border:Point("TOPLEFT", -1, 1) - watchedAura.border:Point("BOTTOMRIGHT", 1, -1) - watchedAura.border:SetTexture([[Interface\BUTTONS\WHITE8X8]]) - watchedAura.border:SetVertexColor(0, 0, 0) - end - if not watchedAura.cd then - watchedAura.cd = CreateFrame("Cooldown", nil, watchedAura) - watchedAura.cd:SetAllPoints(watchedAura) - watchedAura.cd:SetReverse(true) - watchedAura.cd:SetFrameLevel(watchedAura:GetFrameLevel()) - end - if watchedAura.style == "coloredIcon"then - watchedAura.icon:SetTexture([[Interface\BUTTONS\WHITE8X8]]) - if WATCH_CACHE[i]["color"]then - watchedAura.icon:SetVertexColor(WATCH_CACHE[i]["color"].r, WATCH_CACHE[i]["color"].g, WATCH_CACHE[i]["color"].b) + for i = 1, #WATCH_CACHE do + if WATCH_CACHE[i].id then + local buffName, _, buffTexture = GetSpellInfo(WATCH_CACHE[i].id) + if buffName then + local watchedAura; + if not AW.icons[WATCH_CACHE[i].id]then + watchedAura = CreateFrame("Frame", nil, AW) else - watchedAura.icon:SetVertexColor(0.8, 0.8, 0.8) + watchedAura = AW.icons[WATCH_CACHE[i].id] end - watchedAura.icon:Show() - watchedAura.border:Show() - watchedAura.cd:SetAlpha(1) - elseif watchedAura.style == "texturedIcon" then - watchedAura.icon:SetVertexColor(1, 1, 1) - watchedAura.icon:SetTexCoord(.18, .82, .18, .82) - watchedAura.icon:SetTexture(watchedAura.image) - watchedAura.icon:Show() - watchedAura.border:Show() - watchedAura.cd:SetAlpha(1) - else - watchedAura.border:Hide() - watchedAura.icon:Hide() - watchedAura.cd:SetAlpha(0) - end - if watchedAura.displayText then - watchedAura.text:Show() - local r, g, b = 1, 1, 1; - if WATCH_CACHE[i].textColor then - r, g, b = WATCH_CACHE[i].textColor.r, WATCH_CACHE[i].textColor.g, WATCH_CACHE[i].textColor.b + watchedAura.name = buffName; + watchedAura.image = buffTexture; + watchedAura.spellID = WATCH_CACHE[i].id; + watchedAura.anyUnit = WATCH_CACHE[i].anyUnit; + watchedAura.style = WATCH_CACHE[i].style; + watchedAura.onlyShowMissing = WATCH_CACHE[i].onlyShowMissing; + watchedAura.presentAlpha = watchedAura.onlyShowMissing and 0 or 1; + watchedAura.missingAlpha = watchedAura.onlyShowMissing and 1 or 0; + watchedAura.textThreshold = WATCH_CACHE[i].textThreshold or -1; + watchedAura.displayText = WATCH_CACHE[i].displayText; + watchedAura:Width(db.size) + watchedAura:Height(db.size) + watchedAura:ClearAllPoints() + + watchedAura:SetPoint(WATCH_CACHE[i].point, frame.Health, WATCH_CACHE[i].point, WATCH_CACHE[i].xOffset, WATCH_CACHE[i].yOffset) + if not watchedAura.icon then + watchedAura.icon = watchedAura:CreateTexture(nil, "BORDER") + watchedAura.icon:SetAllPoints(watchedAura) end - watchedAura.text:SetTextColor(r, g, b) - else - watchedAura.text:Hide() - end - if not watchedAura.count then - watchedAura.count = watchedAura:CreateFontString(nil, "OVERLAY") - end - watchedAura.count:ClearAllPoints() - if watchedAura.displayText then - local anchor, relative, x, y = unpack(textCounterOffsets[WATCH_CACHE[i].point]) - watchedAura.count:SetPoint(anchor, watchedAura.text, relative, x, y) - else - watchedAura.count:SetPoint("CENTER", unpack(counterOffsets[WATCH_CACHE[i].point])) - end - - watchedAura.count:SetFont(fontFile, fontSize, fontOutline) - watchedAura.text:SetFont(fontFile, fontSize, fontOutline) - watchedAura.text:ClearAllPoints() - watchedAura.text:SetPoint(WATCH_CACHE[i].point, watchedAura, WATCH_CACHE[i].point) - if WATCH_CACHE[i].enabled then - AW.icons[WATCH_CACHE[i].id] = watchedAura; - if AW.watched then - AW.watched[WATCH_CACHE[i].id] = watchedAura + if not watchedAura.text then + local awText = CreateFrame("Frame", nil, watchedAura) + awText:SetFrameLevel(watchedAura:GetFrameLevel() + 50) + watchedAura.text = awText:CreateFontString(nil, "BORDER") end - else - AW.icons[WATCH_CACHE[i].id] = nil; - if AW.watched then - AW.watched[WATCH_CACHE[i].id] = nil + if not watchedAura.border then + watchedAura.border = watchedAura:CreateTexture(nil, "BACKGROUND") + watchedAura.border:Point("TOPLEFT", -1, 1) + watchedAura.border:Point("BOTTOMRIGHT", 1, -1) + watchedAura.border:SetTexture([[Interface\BUTTONS\WHITE8X8]]) + watchedAura.border:SetVertexColor(0, 0, 0) + end + if not watchedAura.cd then + watchedAura.cd = CreateFrame("Cooldown", nil, watchedAura) + watchedAura.cd:SetAllPoints(watchedAura) + watchedAura.cd:SetReverse(true) + watchedAura.cd:SetFrameLevel(watchedAura:GetFrameLevel()) + end + if watchedAura.style == "coloredIcon"then + watchedAura.icon:SetTexture([[Interface\BUTTONS\WHITE8X8]]) + if WATCH_CACHE[i]["color"]then + watchedAura.icon:SetVertexColor(WATCH_CACHE[i]["color"].r, WATCH_CACHE[i]["color"].g, WATCH_CACHE[i]["color"].b) + else + watchedAura.icon:SetVertexColor(0.8, 0.8, 0.8) + end + watchedAura.icon:Show() + watchedAura.border:Show() + watchedAura.cd:SetAlpha(1) + elseif watchedAura.style == "texturedIcon" then + watchedAura.icon:SetVertexColor(1, 1, 1) + watchedAura.icon:SetTexCoord(.18, .82, .18, .82) + watchedAura.icon:SetTexture(watchedAura.image) + watchedAura.icon:Show() + watchedAura.border:Show() + watchedAura.cd:SetAlpha(1) + else + watchedAura.border:Hide() + watchedAura.icon:Hide() + watchedAura.cd:SetAlpha(0) + end + if watchedAura.displayText then + watchedAura.text:Show() + local r, g, b = 1, 1, 1; + if WATCH_CACHE[i].textColor then + r, g, b = WATCH_CACHE[i].textColor.r, WATCH_CACHE[i].textColor.g, WATCH_CACHE[i].textColor.b + end + watchedAura.text:SetTextColor(r, g, b) + else + watchedAura.text:Hide() + end + if not watchedAura.count then + watchedAura.count = watchedAura:CreateFontString(nil, "OVERLAY") + end + watchedAura.count:ClearAllPoints() + if watchedAura.displayText then + local anchor, relative, x, y = unpack(textCounterOffsets[WATCH_CACHE[i].point]) + watchedAura.count:SetPoint(anchor, watchedAura.text, relative, x, y) + else + watchedAura.count:SetPoint("CENTER", unpack(counterOffsets[WATCH_CACHE[i].point])) + end + + watchedAura.count:SetFont(fontFile, fontSize, fontOutline) + watchedAura.text:SetFont(fontFile, fontSize, fontOutline) + watchedAura.text:ClearAllPoints() + watchedAura.text:SetPoint(WATCH_CACHE[i].point, watchedAura, WATCH_CACHE[i].point) + if WATCH_CACHE[i].enabled then + AW.icons[WATCH_CACHE[i].id] = watchedAura; + if AW.watched then + AW.watched[WATCH_CACHE[i].id] = watchedAura + end + else + AW.icons[WATCH_CACHE[i].id] = nil; + if AW.watched then + AW.watched[WATCH_CACHE[i].id] = nil + end + watchedAura:Hide() + watchedAura = nil end - watchedAura:Hide() - watchedAura = nil end end - end - end + end + + WATCH_CACHE = nil + end if frame.AuraWatch.Update then frame.AuraWatch.Update(frame) end - wipe(WATCH_CACHE) end function MOD:UpdateGroupAuraWatch(header, override) diff --git a/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua b/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua index d93765f..f47c6f4 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua @@ -16,38 +16,51 @@ S U P E R - V I L L A I N - U I By: Munglunch # LOCALIZED LUA FUNCTIONS ########################################################## ]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local tostring = _G.tostring; -local tonumber = _G.tonumber; -local tinsert = _G.tinsert; -local string = _G.string; -local math = _G.math; -local table = _G.table; ---[[ STRING METHODS ]]-- -local find, format, len, split = string.find, string.format, string.len, string.split; -local match, sub, join = string.match, string.sub, string.join; +--LUA +local unpack = unpack; +local select = select; +local pairs = pairs; +local type = type; +local rawset = rawset; +local rawget = rawget; +local tostring = tostring; +local error = error; +local next = next; +local pcall = pcall; +local getmetatable = getmetatable; +local setmetatable = setmetatable; +local assert = assert; +--BLIZZARD +local _G = _G; +local tinsert = _G.tinsert; +local tremove = _G.tremove; +local twipe = _G.wipe; +--STRING +local string = string; +local format = string.format; +local sub = string.sub; +--MATH +local math = math; +--TABLE +local table = table; +local tsort = table.sort; +local tremove = table.remove; --[[ MATH METHODS ]]-- local abs, ceil, floor = math.abs, math.ceil, math.floor; -- Basic local parsefloat = math.parsefloat; -- Uncommon ---[[ TABLE METHODS ]]-- -local tremove, tcopy, twipe, tsort, tconcat = table.remove, table.copy, table.wipe, table.sort, table.concat; --[[ ########################################################## GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; + assert(oUF_Villain, "SVUI was unable to locate oUF."); -local L = LibLocale(); +local L = SV.L; local MOD = SV.SVUnit + if(not MOD) then return end --[[ ########################################################## @@ -697,7 +710,7 @@ function MOD:CreateCastbar(frame, reversed, moverName, ryu, useFader, isBoss) castbar.SparkColor = oUF_Villain.colors.spark if moverName then - SV:SetSVMovable(castbar.Holder, moverName, nil, -6, nil, "ALL, SOLO") + SV.Mentalo:Add(castbar.Holder, moverName, nil, -6, nil, "ALL, SOLO") end if useFader then @@ -714,7 +727,7 @@ UPDATE ]]-- function MOD:PostCastStart(unit, index, ...) if unit == "vehicle" then unit = "player" end - local db = MOD.db + local db = SV.db.SVUnit if(not db or not(db and db[unit] and db[unit].castbar)) then return end local unitDB = db[unit].castbar if unitDB.displayTarget and self.curTarget then @@ -736,14 +749,14 @@ end function MOD:PostChannelUpdate(unit, index) if unit == "vehicle" then unit = "player" end - local db = MOD.db[unit]; + local db = SV.db.SVUnit[unit]; if(not db or not db.castbar or not(unit == "player")) then return end CustomChannelUpdate(self, unit, index, db.castbar.ticks) end function MOD:PostCastInterruptible(unit) if unit == "vehicle" or unit == "player" then return end - CustomInterruptible(self, unit, MOD.db.castClassColor) + CustomInterruptible(self, unit, SV.db.SVUnit.castClassColor) end function MOD:PostCastNotInterruptible(unit) diff --git a/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua b/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua index b5e12e8..4eb14f4 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua @@ -16,27 +16,29 @@ 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 assert = _G.assert; -local math = _G.math; -local random = math.random; +--LUA +local unpack = unpack; +local select = select; +local assert = assert; +--BLIZZARD +local _G = _G; +--MATH +local math = math; +local random = math.random; --[[ ########################################################## GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; + assert(oUF_Villain, "SVUI was unable to locate oUF."); -local L = LibLocale(); +local L = SV.L; local LSM = LibStub("LibSharedMedia-3.0") local MOD = SV.SVUnit + if(not MOD) then return end --[[ ########################################################## @@ -303,9 +305,9 @@ local function CreateActionPanel(frame, offset) end local function CreateNameText(frame, unitName) - local db = MOD.db - if(MOD.db[unitName] and MOD.db[unitName].name) then - db = MOD.db[unitName].name + local db = SV.db.SVUnit + if(SV.db.SVUnit[unitName] and SV.db.SVUnit[unitName].name) then + db = SV.db.SVUnit[unitName].name end local name = frame:CreateFontString(nil, "OVERLAY") name:SetFont(LSM:Fetch("font", db.font), db.fontSize, db.fontOutline) @@ -416,7 +418,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(LSM:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + frame.InfoPanel.Health:SetFont(LSM:Fetch("font", SV.db.SVUnit.font), SV.db.SVUnit.fontSize, SV.db.SVUnit.fontOutline) offset = reverse and 2 or -2; direction = reverse and "LEFT" or "RIGHT"; frame.InfoPanel.Health:Point(direction, frame.InfoPanel, direction, offset, 0) @@ -424,7 +426,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(LSM:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + frame.InfoPanel.Power:SetFont(LSM:Fetch("font", SV.db.SVUnit.font), SV.db.SVUnit.fontSize, SV.db.SVUnit.fontOutline) offset = reverse and -2 or 2; direction = reverse and "RIGHT" or "LEFT"; frame.InfoPanel.Power:Point(direction, frame.InfoPanel, direction, offset, 0) @@ -432,7 +434,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(LSM:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + frame.InfoPanel.Misc:SetFont(LSM:Fetch("font", SV.db.SVUnit.font), SV.db.SVUnit.fontSize, SV.db.SVUnit.fontOutline) frame.InfoPanel.Misc:Point("CENTER", frame, "CENTER", 0, 0) end @@ -583,13 +585,13 @@ function MOD:CreateAltPowerBar(frame) altPower.text = altPower:CreateFontString(nil, "OVERLAY") altPower.text:SetPoint("CENTER") altPower.text:SetJustifyH("CENTER") - altPower.text:SetFont(LSM:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + altPower.text:SetFont(LSM:Fetch("font", SV.db.SVUnit.font), SV.db.SVUnit.fontSize, SV.db.SVUnit.fontOutline) altPower.PostUpdate = PostUpdateAltPower; return altPower end function MOD:PostUpdatePower(unit, value, max) - local db = MOD.db[unit] + local db = SV.db.SVUnit[unit] local powerType, _, _, _, _ = UnitPowerType(unit) local parent = self:GetParent() if parent.isForced then diff --git a/Interface/AddOns/SVUI/packages/unit/elements/misc.lua b/Interface/AddOns/SVUI/packages/unit/elements/misc.lua index e7b0220..581fe67 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/misc.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/misc.lua @@ -13,14 +13,21 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SVUI_ADDON_NAME, SV = ... +--LUA +local unpack = unpack; +local select = select; +local assert = assert; +--BLIZZARD +local _G = _G; + +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; + assert(oUF_Villain, "SVUI was unable to locate oUF."); -local L = LibLocale(); +local L = SV.L; local MOD = SV.SVUnit + if(not MOD) then return end --[[ ########################################################## @@ -178,7 +185,7 @@ end local UpdateRoleIcon = function(self) local key = self.___key - local db = MOD.db[key] + local db = SV.db.SVUnit[key] if(not db or not db.icons or (db.icons and not db.icons.roleIcon)) then return end local lfd = self.LFDRole if(not db.icons.roleIcon.enable) then lfd:Hide() return end @@ -245,7 +252,7 @@ function MOD:RaidRoleUpdate() local looterIcon = frame.MasterLooter; if not leaderIcon or not looterIcon then return end local key = frame.___key; - local db = MOD.db[key]; + local db = SV.db.SVUnit[key]; local leaderShown = leaderIcon:IsShown() local looterShown = looterIcon:IsShown() leaderIcon:ClearAllPoints() @@ -306,7 +313,7 @@ local ExRep_OnEnter = function(self)if self:IsShown() then UIFrameFadeIn(self,.1 local ExRep_OnLeave = function(self)if self:IsShown() then UIFrameFadeOut(self,.2,1,0) end end function MOD:CreateExperienceRepBar(frame) - local db = MOD.db.player; + local db = SV.db.SVUnit.player; if db.playerExpBar then local xp = CreateFrame("StatusBar", "PlayerFrameExperienceBar", frame.Power) diff --git a/Interface/AddOns/SVUI/packages/unit/elements/tags.lua b/Interface/AddOns/SVUI/packages/unit/elements/tags.lua index 53ef010..8737477 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/tags.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/tags.lua @@ -15,26 +15,26 @@ S U P E R - V I L L A I N - U I By: Munglunch # ]]-- --[[ GLOBALS ]]-- local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local table = _G.table; -local string = _G.string; +local unpack = unpack; +local select = select; +local pairs = pairs; +local assert = assert; +local table = table; +local string = string; --[[ STRING METHODS ]]-- local find, format, byte, upper = string.find, string.format, string.byte, string.upper; local sub, gsub, len = string.sub, string.gsub, string.len; --[[ TABLE METHODS ]]-- -local twipe = table.wipe; +local twipe = _G.wipe; --[[ ########################################################## GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale(); +local SV = select(2, ...) +local L = SV.L; local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; + assert(oUF_Villain, "SVUI was unable to locate oUF.") --[[ ########################################################## diff --git a/Interface/AddOns/SVUI/packages/unit/frames.lua b/Interface/AddOns/SVUI/packages/unit/frames.lua index dfcf07d..7561c1e 100644 --- a/Interface/AddOns/SVUI/packages/unit/frames.lua +++ b/Interface/AddOns/SVUI/packages/unit/frames.lua @@ -13,31 +13,49 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local ipairs = _G.ipairs; -local type = _G.type; -local tostring = _G.tostring; -local tinsert = _G.tinsert; -local string = _G.string; -local math = _G.math, math.ceil; ---[[ STRING METHODS ]]-- -local find, format, upper = string.find, string.format, string.upper; -local match, gsub = string.match, string.gsub; -local numMin, ceil = math.min; - -local SVUI_ADDON_NAME, SV = ... +--LUA +local unpack = unpack; +local select = select; +local pairs = pairs; +local type = type; +local rawset = rawset; +local rawget = rawget; +local tostring = tostring; +local error = error; +local next = next; +local pcall = pcall; +local getmetatable = getmetatable; +local setmetatable = setmetatable; +local assert = assert; +--BLIZZARD +local _G = _G; +local tinsert = _G.tinsert; +local tremove = _G.tremove; +local twipe = _G.wipe; +--STRING +local string = string; +local format = string.format; +local sub = string.sub; +local upper = string.upper; +local match = string.match; +local gsub = string.gsub; +--MATH +local math = math; +local numMin = math.min; +--TABLE +local table = table; +local tsort = table.sort; +local tremove = table.remove; + +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; + assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibLocale(); +local L = SV.L; local LSM = LibStub("LibSharedMedia-3.0") local MOD = SV.SVUnit + if(not MOD) then return end --[[ ########################################################## @@ -143,7 +161,7 @@ PLAYER ########################################################## ]]-- local UpdatePlayerFrame = function(self) - local db = MOD.db["player"] + local db = SV.db.SVUnit["player"] local UNIT_WIDTH = db.width; local UNIT_HEIGHT = db.height; local USE_CLASSBAR = db.classbar.enable; @@ -151,7 +169,7 @@ local UpdatePlayerFrame = function(self) local classBarWidth = db.width * 0.4; local healthPanel = self.HealthPanel local iconDB = db.icons - self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, "player") @@ -315,13 +333,13 @@ CONSTRUCTORS["player"] = function(self, unit) self.Resting = MOD:CreateRestingIndicator(self) self.Combat = MOD:CreateCombatIndicator(self) self.PvPText = self.InfoPanel:CreateFontString(nil,'OVERLAY') - self.PvPText:SetFontTemplate(LSM:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + self.PvPText:SetFontTemplate(LSM:Fetch("font", SV.db.SVUnit.font), SV.db.SVUnit.fontSize, SV.db.SVUnit.fontOutline) self.Afflicted = MOD:CreateAfflicted(self) self.HealPrediction = MOD:CreateHealPrediction(self, true) self.AuraBars = MOD:CreateAuraBarHeader(self, key) self.CombatFade = true; self:Point("BOTTOMLEFT", SV.UIParent, "BOTTOM", -413, 182) - SV:SetSVMovable(self, L["Player Frame"], nil, nil, nil, "ALL, SOLO") + SV.Mentalo:Add(self, L["Player Frame"], nil, nil, nil, "ALL, SOLO") self.MediaUpdate = MOD.RefreshUnitMedia self.Update = UpdatePlayerFrame @@ -334,12 +352,12 @@ TARGET ########################################################## ]]-- local UpdateTargetFrame = function(self) - local db = MOD.db["target"] + local db = SV.db.SVUnit["target"] local UNIT_WIDTH = db.width; local UNIT_HEIGHT = db.height; local USE_COMBOBAR = db.combobar.enable; local comboBarHeight = db.combobar.height; - self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, "target") self.colors = oUF_Villain.colors; @@ -353,7 +371,7 @@ local UpdateTargetFrame = function(self) end MOD:RefreshUnitLayout(self, "target") - if(MOD.db.xrayFocus) then + if(SV.db.SVUnit.xrayFocus) then self.XRay:Show() else self.XRay:Hide() @@ -424,7 +442,7 @@ CONSTRUCTORS["target"] = function(self, unit) self:RegisterEvent("PLAYER_TARGET_CHANGED", MOD.SmartAuraDisplay) self.RaidIcon = MOD:CreateRaidIcon(self) - local isSmall = MOD.db[key].combobar.smallIcons + local isSmall = SV.db.SVUnit[key].combobar.smallIcons if(SV.class == "ROGUE") then self.HyperCombo = MOD:CreateRogueCombobar(self, isSmall) elseif(SV.class == "DRUID") then @@ -437,7 +455,7 @@ CONSTRUCTORS["target"] = function(self, unit) self.XRay = MOD:CreateXRay(self) self.XRay:SetPoint("TOPRIGHT", 12, 12) self:Point("BOTTOMRIGHT", SV.UIParent, "BOTTOM", 413, 182) - SV:SetSVMovable(self, L["Target Frame"], nil, nil, nil, "ALL, SOLO") + SV.Mentalo:Add(self, L["Target Frame"], nil, nil, nil, "ALL, SOLO") self.MediaUpdate = MOD.RefreshUnitMedia self.Update = UpdateTargetFrame @@ -449,10 +467,10 @@ TARGET OF TARGET ########################################################## ]]-- local UpdateTargetTargetFrame = function(self) - local db = MOD.db["targettarget"] + local db = SV.db.SVUnit["targettarget"] local UNIT_WIDTH = db.width local UNIT_HEIGHT = db.height - self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, "targettarget") self.colors = oUF_Villain.colors; self:Size(UNIT_WIDTH, UNIT_HEIGHT) @@ -479,7 +497,7 @@ CONSTRUCTORS["targettarget"] = function(self, unit) self.RaidIcon = MOD:CreateRaidIcon(self) self.Range = { insideAlpha = 1, outsideAlpha = 1 } self:Point("BOTTOM", SV.UIParent, "BOTTOM", 0, 213) - SV:SetSVMovable(self, L["TargetTarget Frame"], nil, nil, nil, "ALL, SOLO") + SV.Mentalo:Add(self, L["TargetTarget Frame"], nil, nil, nil, "ALL, SOLO") self.MediaUpdate = MOD.RefreshUnitMedia self.Update = UpdateTargetTargetFrame @@ -491,10 +509,10 @@ PET ########################################################## ]]-- local UpdatePetFrame = function(self) - local db = MOD.db["pet"] + local db = SV.db.SVUnit["pet"] local UNIT_WIDTH = db.width; local UNIT_HEIGHT = db.height; - self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, "pet") self.colors = oUF_Villain.colors; self:Size(UNIT_WIDTH, UNIT_HEIGHT) @@ -530,7 +548,7 @@ CONSTRUCTORS["pet"] = function(self, unit) self.RaidIcon = MOD:CreateRaidIcon(self) self.Range = { insideAlpha = 1, outsideAlpha = 1 } self:Point("BOTTOM", SV.UIParent, "BOTTOM", 0, 182) - SV:SetSVMovable(self, L["Pet Frame"], nil, nil, nil, "ALL, SOLO") + SV.Mentalo:Add(self, L["Pet Frame"], nil, nil, nil, "ALL, SOLO") self.MediaUpdate = MOD.RefreshUnitMedia self.Update = UpdatePetFrame return self @@ -541,10 +559,10 @@ TARGET OF PET ########################################################## ]]-- local UpdatePetTargetFrame = function(self) - local db = MOD.db["pettarget"] + local db = SV.db.SVUnit["pettarget"] local UNIT_WIDTH = db.width; local UNIT_HEIGHT = db.height; - self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, "pettarget") self.colors = oUF_Villain.colors; self:Size(UNIT_WIDTH, UNIT_HEIGHT) @@ -574,7 +592,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) - SV:SetSVMovable(self, L["PetTarget Frame"], nil, -7, nil, "ALL, SOLO") + SV.Mentalo:Add(self, L["PetTarget Frame"], nil, -7, nil, "ALL, SOLO") self.MediaUpdate = MOD.RefreshUnitMedia self.Update = UpdatePetTargetFrame @@ -586,17 +604,17 @@ FOCUS ########################################################## ]]-- local UpdateFocusFrame = function(self) - local db = MOD.db["focus"] + local db = SV.db.SVUnit["focus"] local UNIT_WIDTH = db.width; local UNIT_HEIGHT = db.height; - self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, "focus") self.colors = oUF_Villain.colors; self:Size(UNIT_WIDTH, UNIT_HEIGHT) _G[self:GetName().."_MOVE"]:Size(self:GetSize()) MOD:RefreshUnitLayout(self, "focus") - if(MOD.db.xrayFocus) then + if(SV.db.SVUnit.xrayFocus) then self.XRay:Show() else self.XRay:Hide() @@ -638,7 +656,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) - SV:SetSVMovable(self, L["Focus Frame"], nil, nil, nil, "ALL, SOLO") + SV.Mentalo:Add(self, L["Focus Frame"], nil, nil, nil, "ALL, SOLO") self.MediaUpdate = MOD.RefreshUnitMedia self.Update = UpdateFocusFrame @@ -650,10 +668,10 @@ TARGET OF FOCUS ########################################################## ]]-- local UpdateFocusTargetFrame = function(self) - local db = MOD.db["focustarget"] + local db = SV.db.SVUnit["focustarget"] local UNIT_WIDTH = db.width; local UNIT_HEIGHT = db.height; - self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, "focustarget") self.colors = oUF_Villain.colors; self:Size(UNIT_WIDTH, UNIT_HEIGHT) @@ -679,7 +697,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) - SV:SetSVMovable(self, L["FocusTarget Frame"], nil, -7, nil, "ALL, SOLO") + SV.Mentalo:Add(self, L["FocusTarget Frame"], nil, -7, nil, "ALL, SOLO") self.MediaUpdate = MOD.RefreshUnitMedia self.Update = UpdateFocusTargetFrame @@ -691,7 +709,7 @@ BOSS ########################################################## ]]-- local UpdateBossFrame = function(self) - local db = MOD.db["boss"] + local db = SV.db.SVUnit["boss"] local INDEX = self:GetID() or 1; local holder = _G["SVUI_Boss_MOVE"] local UNIT_WIDTH = db.width; @@ -720,7 +738,7 @@ local UpdateBossFrame = function(self) end end - self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") MOD:RefreshUnitLayout(self, "boss") self:UpdateAllElements() end @@ -752,7 +770,7 @@ CONSTRUCTORS["boss"] = function(self, unit) if(not _G["SVUI_Boss_MOVE"]) then self:Point("RIGHT", SV.UIParent, "RIGHT", -105, 0) - SV:SetSVMovable(self, L["Boss Frames"], nil, nil, nil, "ALL, PARTY, RAID10, RAID25, RAID40", "SVUI_Boss") + SV.Mentalo:Add(self, L["Boss Frames"], nil, nil, nil, "ALL, PARTY, RAID10, RAID25, RAID40", "SVUI_Boss") else self:Point("TOPRIGHT", lastBossFrame, "BOTTOMRIGHT", 0, -20) end @@ -812,7 +830,7 @@ local function CreatePrepFrame(frameName, parentFrame, parentID) end local UpdateArenaFrame = function(self) - local db = MOD.db["arena"] + local db = SV.db.SVUnit["arena"] local INDEX = self:GetID() or 1; local holder = _G["SVUI_Arena_MOVE"] local UNIT_WIDTH = db.width; @@ -822,7 +840,7 @@ local UpdateArenaFrame = function(self) self.colors = oUF_Villain.colors; self:Size(UNIT_WIDTH, UNIT_HEIGHT) - self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") self:ClearAllPoints() @@ -919,7 +937,7 @@ CONSTRUCTORS["arena"] = function(self, unit) if(not _G["SVUI_Arena_MOVE"]) then self:Point("RIGHT", SV.UIParent, "RIGHT", -105, 0) - SV:SetSVMovable(self, L["Arena Frames"], nil, nil, nil, "ALL, ARENA", "SVUI_Arena") + SV.Mentalo:Add(self, L["Arena Frames"], nil, nil, nil, "ALL, ARENA", "SVUI_Arena") else self:Point("TOPRIGHT", lastArenaFrame, "BOTTOMRIGHT", 0, -20) end @@ -938,7 +956,7 @@ local ArenaPrepHandler = CreateFrame("Frame") local ArenaPrepHandler_OnEvent = function(self, event) local prepframe local _, instanceType = IsInInstance() - if(not SV.db.SVUnit.arena.enable or instanceType ~= "arena") then return end + if(not SV.db.SVUnit.arena or 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"] @@ -1025,7 +1043,7 @@ function MOD:SetUnitFrame(key) if frame:GetParent() ~= SVUI_UnitFrameParent then frame:SetParent(SVUI_UnitFrameParent) end - if(self.db.enable and self.db[key].enable) then + if(SV.db.SVUnit.enable and SV.db.SVUnit[key].enable) then frame:Enable() frame:Update() else @@ -1055,7 +1073,7 @@ function MOD:SetEnemyFrames(key, maxCount) if frame.isForced then self:AllowElement(frame) end - if(self.db.enable and self.db[key].enable) then + if(SV.db.SVUnit.enable and SV.db.SVUnit[key].enable) then frame:Enable() frame:Update() else @@ -1100,15 +1118,15 @@ RAID 10, 25, 40 ########################################################## ]]-- local Raid10Visibility = function(self, event) - local db = MOD.db["raid10"] - if (not db or (db and not db.enable) or (MOD.db and not MOD.db.smartRaidFilter) or self.isForced) then return end + local db = SV.db.SVUnit["raid10"] + if (not db or (db and not db.enable) or (SV.db.SVUnit and not SV.db.SVUnit.smartRaidFilter) or self.isForced) then return end local instance, instanceType = IsInInstance() local _, _, _, _, maxPlayers, _, _ = GetInstanceInfo() if(event == "PLAYER_REGEN_ENABLED") then self:UnregisterEvent("PLAYER_REGEN_ENABLED") end - if not InCombatLockdown()then + if not InCombatLockdown() then if(instance and (instanceType == "raid") and (maxPlayers == 10)) then UnregisterStateDriver(self, "visibility") self:Show() @@ -1125,8 +1143,8 @@ local Raid10Visibility = function(self, event) end local Raid25Visibility = function(self, event) - local db = MOD.db["raid25"] - if (not db or (db and not db.enable) or (MOD.db and not MOD.db.smartRaidFilter) or self.isForced) then return end + local db = SV.db.SVUnit["raid25"] + if (not db or (db and not db.enable) or (SV.db.SVUnit and not SV.db.SVUnit.smartRaidFilter) or self.isForced) then return end local instance, instanceType = IsInInstance() local _, _, _, _, maxPlayers, _, _ = GetInstanceInfo() @@ -1150,8 +1168,8 @@ local Raid25Visibility = function(self, event) end local Raid40Visibility = function(self, event) - local db = MOD.db["raid40"] - if (not db or (db and not db.enable) or (MOD.db and not MOD.db.smartRaidFilter) or self.isForced) then return end + local db = SV.db.SVUnit["raid40"] + if (not db or (db and not db.enable) or (SV.db.SVUnit and not SV.db.SVUnit.smartRaidFilter) or self.isForced) then return end local instance, instanceType = IsInInstance() local _, _, _, _, maxPlayers, _, _ = GetInstanceInfo() @@ -1176,7 +1194,7 @@ end local UpdateRaidSubUnit = function(self, key, db) self.colors = oUF_Villain.colors; - self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(db) if not InCombatLockdown() then self:Size(UNIT_WIDTH, UNIT_HEIGHT) @@ -1210,7 +1228,7 @@ GROUP_UPDATES["raid10"] = function(self) if not frame.positioned then frame:ClearAllPoints() frame:Point("LEFT", SV.UIParent, "LEFT", 4, 0) - SV:SetSVMovable(frame, L["Raid 10 Frames"], nil, nil, nil, "ALL, RAID"..10) + SV.Mentalo:Add(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) @@ -1218,7 +1236,7 @@ GROUP_UPDATES["raid10"] = function(self) end Raid10Visibility(frame) local key = "raid10" - local db = MOD.db[key] + local db = SV.db.SVUnit[key] local index = 1; local childFrame = self:GetAttribute("child"..index) while childFrame do @@ -1239,7 +1257,7 @@ GROUP_UPDATES["raid25"] = function(self) if not frame.positioned then frame:ClearAllPoints() frame:Point("LEFT", SV.UIParent, "LEFT", 4, 0) - SV:SetSVMovable(frame, L["Raid 25 Frames"], nil, nil, nil, "ALL, RAID"..25) + SV.Mentalo:Add(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) @@ -1247,7 +1265,7 @@ GROUP_UPDATES["raid25"] = function(self) end Raid25Visibility(frame) local key = "raid25" - local db = MOD.db[key] + local db = SV.db.SVUnit[key] local index = 1; local childFrame = self:GetAttribute("child"..index) while childFrame do @@ -1268,7 +1286,7 @@ GROUP_UPDATES["raid40"] = function(self) if not frame.positioned then frame:ClearAllPoints() frame:Point("LEFT", SV.UIParent, "LEFT", 4, 0) - SV:SetSVMovable(frame, L["Raid 40 Frames"], nil, nil, nil, "ALL, RAID"..40) + SV.Mentalo:Add(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) @@ -1276,7 +1294,7 @@ GROUP_UPDATES["raid40"] = function(self) end Raid40Visibility(frame) local key = "raid40" - local db = MOD.db[key] + local db = SV.db.SVUnit[key] local index = 1; local childFrame = self:GetAttribute("child"..index) while childFrame do @@ -1337,6 +1355,7 @@ CONSTRUCTORS["raid10"] = function(self, unit) self.___key = key MOD:SetActionPanel(self, key) self.Health = MOD:CreateHealthBar(self, true) + self.Health.frequentUpdates = false self.Power = MOD:CreatePowerBar(self, true) self.Power.frequentUpdates = false self.Buffs = MOD:CreateBuffs(self, key) @@ -1351,6 +1370,7 @@ CONSTRUCTORS["raid25"] = function(self, unit) self.___key = key MOD:SetActionPanel(self, key) self.Health = MOD:CreateHealthBar(self, true) + self.Health.frequentUpdates = false self.Power = MOD:CreatePowerBar(self, true) self.Power.frequentUpdates = false self.Buffs = MOD:CreateBuffs(self, key) @@ -1365,6 +1385,7 @@ CONSTRUCTORS["raid40"] = function(self, unit) self.___key = key MOD:SetActionPanel(self, key) self.Health = MOD:CreateHealthBar(self, true) + self.Health.frequentUpdates = false self.Power = MOD:CreatePowerBar(self, true) self.Power.frequentUpdates = false self.Buffs = MOD:CreateBuffs(self, key) @@ -1378,8 +1399,8 @@ RAID PETS ########################################################## ]]-- local RaidPetVisibility = function(self, event) - local db = MOD.db["raidpet"] - if (not db or (db and not db.enable) or (MOD.db and not MOD.db.smartRaidFilter) or self.isForced) then return end + local db = SV.db.SVUnit["raidpet"] + if (not db or (db and not db.enable) or (SV.db.SVUnit and not SV.db.SVUnit.smartRaidFilter) or self.isForced) then return end local inInstance, instanceType = IsInInstance() if event == "PLAYER_REGEN_ENABLED" then self:UnregisterEvent("PLAYER_REGEN_ENABLED") end @@ -1401,15 +1422,15 @@ GROUP_UPDATES["raidpet"] = function(self) if not raidPets.positioned then raidPets:ClearAllPoints() 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; + SV.Mentalo:Add(raidPets, L["Raid Pet Frames"], nil, nil, nil, "ALL, RAID10, RAID25, RAID40") raidPets:RegisterEvent("PLAYER_ENTERING_WORLD") raidPets:RegisterEvent("ZONE_CHANGED_NEW_AREA") raidPets:SetScript("OnEvent", RaidPetVisibility) + raidPets.positioned = true; end RaidPetVisibility(raidPets) local key = "raidpet" - local db = MOD.db[key] + local db = SV.db.SVUnit[key] local index = 1; local childFrame = self:GetAttribute("child"..index) while childFrame do @@ -1470,8 +1491,8 @@ PARTY ########################################################## ]]-- local PartyVisibility = function(self, event) - local db = MOD.db["party"] - if (not db or (db and not db.enable) or (MOD.db and not MOD.db.smartRaidFilter) or self.isForced) then return end + local db = SV.db.SVUnit["party"] + if (not db or (db and not db.enable) or (SV.db.SVUnit and not SV.db.SVUnit.smartRaidFilter) or self.isForced) then return end local instance, instanceType = IsInInstance() if(event == "PLAYER_REGEN_ENABLED") then self:UnregisterEvent("PLAYER_REGEN_ENABLED") @@ -1490,7 +1511,7 @@ end local UpdatePartySubUnit = function(self, key, db) self.colors = oUF_Villain.colors; - self:RegisterForClicks(MOD.db.fastClickTarget and 'AnyDown' or 'AnyUp') + self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and 'AnyDown' or 'AnyUp') MOD.RefreshUnitMedia(self, key) if self.isChild then local altDB = db.petsGroup; @@ -1545,15 +1566,15 @@ GROUP_UPDATES["party"] = function(self) if not group.positioned then group:ClearAllPoints() group:Point("LEFT",SV.UIParent,"LEFT",40,0) - SV:SetSVMovable(group, L['Party Frames'], nil, nil, nil, 'ALL,PARTY,ARENA'); - group.positioned = true; + SV.Mentalo:Add(group, L['Party Frames'], nil, nil, nil, 'ALL,PARTY,ARENA'); group:RegisterEvent("PLAYER_ENTERING_WORLD") group:RegisterEvent("ZONE_CHANGED_NEW_AREA") group:SetScript("OnEvent", PartyVisibility) + group.positioned = true; end PartyVisibility(group) local key = "party" - local db = MOD.db[key] + local db = SV.db.SVUnit[key] local index = 1; local childFrame = self:GetAttribute("child"..index) @@ -1632,7 +1653,7 @@ TANK ]]-- local UpdateTankSubUnit = function(self, key, db) self.colors = oUF_Villain.colors; - self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, key) if self.isChild and self.originalParent then local targets = db.targetsGroup; @@ -1669,7 +1690,7 @@ end local UpdateTankFrame = function(self) local key = "tank" - local db = MOD.db[key] + local db = SV.db.SVUnit[key] if db.enable ~= true then UnregisterAttributeDriver(self, "state-visibility") self:Hide() @@ -1689,7 +1710,7 @@ local UpdateTankFrame = function(self) if not self.positioned then self:ClearAllPoints() self:Point("TOPLEFT", SV.UIParent, "TOPLEFT", 4, -40) - SV:SetSVMovable(self, L["Tank Frames"], nil, nil, nil, "ALL, RAID10, RAID25, RAID40") + SV.Mentalo:Add(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) @@ -1709,7 +1730,7 @@ end CONSTRUCTORS["tank"] = function(self, unit) local key = "tank" - local db = MOD.db[key] + local db = SV.db.SVUnit[key] self.unit = unit self.___key = key self:SetScript("OnEnter", UnitFrame_OnEnter) @@ -1730,7 +1751,7 @@ ASSIST ]]-- local UpdateAssistSubUnit = function(self, key, db) self.colors = oUF_Villain.colors; - self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") + self:RegisterForClicks(SV.db.SVUnit.fastClickTarget and "AnyDown" or "AnyUp") MOD.RefreshUnitMedia(self, key) if self.isChild and self.originalParent then local targets = db.targetsGroup; @@ -1769,7 +1790,7 @@ end local UpdateAssistFrame = function(self) local key = "assist" - local db = MOD.db[key] + local db = SV.db.SVUnit[key] self:Hide() DetachSubFrames(self:GetChildren()) self:SetAttribute("startingIndex", -1) @@ -1784,7 +1805,7 @@ local UpdateAssistFrame = function(self) if not self.positioned then self:ClearAllPoints() self:Point("TOPLEFT", SV.UIParent, "TOPLEFT", 4, -140) - SV:SetSVMovable(self, L["Assist Frames"], nil, nil, nil, "ALL, RAID10, RAID25, RAID40") + SV.Mentalo:Add(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) @@ -1804,7 +1825,7 @@ end CONSTRUCTORS["assist"] = function(self, unit) local key = "assist" - local db = MOD.db[key] + local db = SV.db.SVUnit[key] self.unit = unit self.___key = key self:SetScript("OnEnter", UnitFrame_OnEnter) @@ -1825,7 +1846,7 @@ GROUP HEADER METHODS ]]-- local GroupSetConfigEnvironment = function(self) local key = self.___groupkey - local db = MOD.db[key] + local db = SV.db.SVUnit[key] local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(db) local anchorPoint; local sorting = db.showBy @@ -1932,7 +1953,7 @@ end local GroupHeaderUpdate = function(self) local key = self.___groupkey - if MOD.db[key].enable ~= true then + if SV.db.SVUnit[key].enable ~= true then UnregisterAttributeDriver(self, "state-visibility") self:Hide() return @@ -1951,7 +1972,7 @@ end local GroupSetActiveState = function(self) if not self.isForced then local key = self.___groupkey - local db = MOD.db[key] + local db = SV.db.SVUnit[key] if(db) then for i=1,#self.groups do local frame = self.groups[i] @@ -2000,7 +2021,7 @@ local SecureHeaderClear = function(self) end function MOD:ConstructGroupHeader(parentFrame, filter, styleName, headerName, template1, groupName, template2, updateFunc) - local db = self.db[groupName] + local db = SV.db.SVUnit[groupName] local UNIT_WIDTH, UNIT_HEIGHT = self:GetActiveSize(db) oUF_Villain:SetActiveStyle(styleName) @@ -2029,8 +2050,8 @@ LOAD/UPDATE METHOD ]]-- function MOD:SetGroupFrame(key, filter, template1, forceUpdate, template2) if(InCombatLockdown()) then self:RegisterEvent("PLAYER_REGEN_ENABLED"); return end - if(not self.db.enable or not self.db[key]) then return end - local db = self.db[key] + if(not SV.db.SVUnit.enable or not SV.db.SVUnit[key]) then return end + local db = SV.db.SVUnit[key] local realName = key:gsub("(.)", upper, 1) local styleName = "SVUI_"..realName local frame, groupName diff --git a/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua b/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua index 4801c25..29908af 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua @@ -27,6 +27,7 @@ local error = _G.error; local pcall = _G.pcall; local tostring = _G.tostring; local tonumber = _G.tonumber; +local assert = _G.assert; local math = _G.math; --[[ MATH METHODS ]]-- local random = math.random; @@ -35,13 +36,12 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; + assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibLocale(); +local L = SV.L; if(SV.class ~= "DEATHKNIGHT") then return end local MOD = SV.SVUnit if(not MOD) then return end @@ -64,7 +64,7 @@ POSITIONING ########################################################## ]]-- local Reposition = function(self) - local db = MOD.db.player + local db = SV.db.SVUnit.player local bar = self.Runes; local max = self.MaxClassPower; local size = db.classbar.height @@ -72,7 +72,7 @@ local Reposition = function(self) bar.Holder:Size(width, size) if(not db.classbar.detachFromFrame) then - SV:ResetMovables(L["Classbar"]) + SV.Mentalo:Reset(L["Classbar"]) end local holderUpdate = bar.Holder:GetScript('OnSizeChanged') if holderUpdate then @@ -125,7 +125,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") + SV.Mentalo:Add(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") playerFrame.MaxClassPower = max; playerFrame.ClassBarRefresh = Reposition; diff --git a/Interface/AddOns/SVUI/packages/unit/resources/druid.lua b/Interface/AddOns/SVUI/packages/unit/resources/druid.lua index b0f85c4..a51ffbe 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/druid.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/druid.lua @@ -27,6 +27,7 @@ local error = _G.error; local pcall = _G.pcall; local tostring = _G.tostring; local tonumber = _G.tonumber; +local assert = _G.assert; local math = _G.math; --[[ MATH METHODS ]]-- local random,floor = math.random, math.floor; @@ -35,13 +36,12 @@ local random,floor = math.random, math.floor; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; + assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibLocale(); +local L = SV.L; local LSM = LibStub("LibSharedMedia-3.0") if(SV.class ~= "DRUID") then return end local MOD = SV.SVUnit @@ -95,7 +95,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(LSM:Fetch("font", MOD.db.font), MOD.db.fontSize, MOD.db.fontOutline) + bar.Text:SetFont(LSM:Fetch("font", SV.db.SVUnit.font), SV.db.SVUnit.fontSize, SV.db.SVUnit.fontOutline) return bar end --[[ @@ -105,7 +105,7 @@ POSITIONING ]]-- local Reposition = function(self) local bar = self.EclipseBar - local db = MOD.db.player + local db = SV.db.SVUnit.player if not bar or not db then print("Error") return end local height = db.classbar.height local offset = (height - 10) @@ -116,7 +116,7 @@ local Reposition = function(self) bar.Holder:Size(width, height) if(not db.classbar.detachFromFrame) then - SV:ResetMovables(L["Classbar"]) + SV.Mentalo:Reset(L["Classbar"]) end local holderUpdate = bar.Holder:GetScript('OnSizeChanged') if holderUpdate then @@ -271,7 +271,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") + SV.Mentalo:Add(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") playerFrame.ClassBarRefresh = Reposition; playerFrame.EclipseBar = bar @@ -315,7 +315,7 @@ local HideSmallPoint = function(self) end local RepositionCombo = function(self) - local db = MOD.db.target + local db = SV.db.SVUnit.target local bar = self.HyperCombo.CPoints; local max = MAX_COMBO_POINTS; local height = db.combobar.height diff --git a/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua b/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua index 6e870d2..f35072b 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua @@ -25,13 +25,13 @@ local select = _G.select; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; + +local assert = _G.assert; assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibLocale(); +local L = SV.L; if(SV.class ~= "HUNTER") then return end local MOD = SV.SVUnit if(not MOD) then return end diff --git a/Interface/AddOns/SVUI/packages/unit/resources/mage.lua b/Interface/AddOns/SVUI/packages/unit/resources/mage.lua index eaaa29e..eca1a28 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/mage.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/mage.lua @@ -27,6 +27,7 @@ local error = _G.error; local pcall = _G.pcall; local tostring = _G.tostring; local tonumber = _G.tonumber; +local assert = _G.assert; local math = _G.math; --[[ MATH METHODS ]]-- local random = math.random; @@ -35,13 +36,12 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; + assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibLocale(); +local L = SV.L; if(SV.class ~= "MAGE") then return end local MOD = SV.SVUnit if(not MOD) then return end @@ -51,14 +51,14 @@ POSITIONING ########################################################## ]]-- local Reposition = function(self) - local db = MOD.db.player + local db = SV.db.SVUnit.player local bar = self.ArcaneChargeBar; local max = self.MaxClassPower; local size = db.classbar.height local width = size * max; bar.Holder:Size(width, size) if(not db.classbar.detachFromFrame) then - SV:ResetMovables(L["Classbar"]) + SV.Mentalo:Reset(L["Classbar"]) end local holderUpdate = bar.Holder:GetScript('OnSizeChanged') if holderUpdate then @@ -191,7 +191,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") + SV.Mentalo:Add(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") playerFrame.MaxClassPower = max; playerFrame.ClassBarRefresh = Reposition; diff --git a/Interface/AddOns/SVUI/packages/unit/resources/monk.lua b/Interface/AddOns/SVUI/packages/unit/resources/monk.lua index 58d37c6..99c4bf8 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/monk.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/monk.lua @@ -27,6 +27,7 @@ local error = _G.error; local pcall = _G.pcall; local tostring = _G.tostring; local tonumber = _G.tonumber; +local assert = _G.assert; local math = _G.math; --[[ MATH METHODS ]]-- local random = math.random; @@ -35,13 +36,12 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; + assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibLocale(); +local L = SV.L; if(SV.class ~= "MONK") then return end local MOD = SV.SVUnit if(not MOD) then return end @@ -51,14 +51,14 @@ POSITIONING ########################################################## ]]-- local Reposition = function(self) - local db = MOD.db.player + local db = SV.db.SVUnit.player local bar = self.MonkHarmony; local max = self.MaxClassPower; local size = db.classbar.height local width = size * max; bar.Holder:Size(width, size) if(not db.classbar.detachFromFrame) then - SV:ResetMovables(L["Classbar"]) + SV.Mentalo:Reset(L["Classbar"]) end local holderUpdate = bar.Holder:GetScript('OnSizeChanged') if holderUpdate then @@ -154,7 +154,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") + SV.Mentalo:Add(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") playerFrame.MaxClassPower = max playerFrame.DrunkenMaster = CreateDrunkenMasterBar(playerFrame) diff --git a/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua b/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua index 2f2fad1..89f056a 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua @@ -27,6 +27,7 @@ local error = _G.error; local pcall = _G.pcall; local tostring = _G.tostring; local tonumber = _G.tonumber; +local assert = _G.assert; local math = _G.math; --[[ MATH METHODS ]]-- local random = math.random; @@ -35,13 +36,12 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; + assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibLocale(); +local L = SV.L; if(SV.class ~= "PALADIN") then return end local MOD = SV.SVUnit if(not MOD) then return end @@ -57,14 +57,14 @@ POSITIONING ########################################################## ]]-- local Reposition = function(self) - local db = MOD.db.player + local db = SV.db.SVUnit.player local bar = self.HolyPower; local max = self.MaxClassPower; local size = db.classbar.height local width = size * max; bar.Holder:Size(width, size) if(not db.classbar.detachFromFrame) then - SV:ResetMovables(L["Classbar"]) + SV.Mentalo:Reset(L["Classbar"]) end local holderUpdate = bar.Holder:GetScript('OnSizeChanged') if holderUpdate then @@ -183,7 +183,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") + SV.Mentalo:Add(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") playerFrame.MaxClassPower = max; playerFrame.ClassBarRefresh = Reposition; diff --git a/Interface/AddOns/SVUI/packages/unit/resources/priest.lua b/Interface/AddOns/SVUI/packages/unit/resources/priest.lua index b32d7ed..cd84430 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/priest.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/priest.lua @@ -27,6 +27,7 @@ local error = _G.error; local pcall = _G.pcall; local tostring = _G.tostring; local tonumber = _G.tonumber; +local assert = _G.assert; local math = _G.math; --[[ MATH METHODS ]]-- local random = math.random; @@ -35,13 +36,12 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; + assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibLocale(); +local L = SV.L; if(SV.class ~= "PRIEST") then return end local MOD = SV.SVUnit if(not MOD) then return end @@ -53,7 +53,7 @@ POSITIONING ########################################################## ]]-- local Reposition = function(self) - local db = MOD.db.player + local db = SV.db.SVUnit.player local bar = self.PriestOrbs; local max = self.MaxClassPower; local size = db.classbar.height @@ -61,7 +61,7 @@ local Reposition = function(self) bar.Holder:Size(width, size) if(not db.classbar.detachFromFrame) then - SV:ResetMovables(L["Classbar"]) + SV.Mentalo:Reset(L["Classbar"]) end local holderUpdate = bar.Holder:GetScript('OnSizeChanged') if holderUpdate then @@ -155,7 +155,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") + SV.Mentalo:Add(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") playerFrame.MaxClassPower = max; playerFrame.ClassBarRefresh = Reposition; diff --git a/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua b/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua index 3290d26..0a9c5f9 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua @@ -27,6 +27,7 @@ local error = _G.error; local pcall = _G.pcall; local tostring = _G.tostring; local tonumber = _G.tonumber; +local assert = _G.assert; local math = _G.math; --[[ MATH METHODS ]]-- local random = math.random; @@ -35,13 +36,12 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; + assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibLocale(); +local L = SV.L; if(SV.class ~= "ROGUE") then return end local MOD = SV.SVUnit if(not MOD) then return end @@ -71,7 +71,7 @@ POSITIONING ########################################################## ]]-- local Reposition = function(self) - local db = MOD.db.target + local db = SV.db.SVUnit.target local bar = self.HyperCombo.CPoints; local max = MAX_COMBO_POINTS; local height = db.combobar.height @@ -171,7 +171,7 @@ ROGUE COMBO TRACKER ########################################################## ]]-- local RepositionTracker = function(self) - local db = MOD.db.player + local db = SV.db.SVUnit.player local bar = self.HyperCombo; if not db then return end local size = db.classbar.height @@ -179,7 +179,7 @@ local RepositionTracker = function(self) local textwidth = size * 1.25; bar.Holder:Size(width, size) if(not db.classbar.detachFromFrame) then - SV:ResetMovables(L["Classbar"]) + SV.Mentalo:Reset(L["Classbar"]) end local holderUpdate = bar.Holder:GetScript('OnSizeChanged') if holderUpdate then @@ -258,7 +258,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") + SV.Mentalo:Add(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") playerFrame.MaxClassPower = 5; playerFrame.ClassBarRefresh = RepositionTracker; diff --git a/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua b/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua index 500ea1b..0549aef 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua @@ -27,6 +27,7 @@ local error = _G.error; local pcall = _G.pcall; local tostring = _G.tostring; local tonumber = _G.tonumber; +local assert = _G.assert; local math = _G.math; --[[ MATH METHODS ]]-- local random = math.random; @@ -35,13 +36,12 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; + assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibLocale(); +local L = SV.L; if(SV.class ~= "SHAMAN") then return end local MOD = SV.SVUnit if(not MOD) then return end @@ -64,13 +64,13 @@ POSITIONING ########################################################## ]]-- local Reposition = function(self) - local db = MOD.db.player + local db = SV.db.SVUnit.player local bar = self.TotemBars local size = db.classbar.height local width = size * totemMax bar.Holder:Size(width, size) if(not db.classbar.detachFromFrame) then - SV:ResetMovables(L["Classbar"]) + SV.Mentalo:Reset(L["Classbar"]) end local holderUpdate = bar.Holder:GetScript('OnSizeChanged') if holderUpdate then @@ -117,7 +117,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") + SV.Mentalo:Add(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") playerFrame.MaxClassPower = totemMax; playerFrame.ClassBarRefresh = Reposition; diff --git a/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua b/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua index 0db2e3d..e02887b 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua @@ -27,6 +27,7 @@ local error = _G.error; local pcall = _G.pcall; local tostring = _G.tostring; local tonumber = _G.tonumber; +local assert = _G.assert; local math = _G.math; --[[ MATH METHODS ]]-- local random = math.random; @@ -35,13 +36,12 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; + assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibLocale(); +local L = SV.L; if(SV.class ~= "WARLOCK") then return end local MOD = SV.SVUnit if(not MOD) then return end @@ -79,7 +79,7 @@ POSITIONING ########################################################## ]]-- local Reposition = function(self) - local db = MOD.db.player + local db = SV.db.SVUnit.player local bar = self.WarlockShards; local max = self.MaxClassPower; local size = db.classbar.height @@ -87,7 +87,7 @@ local Reposition = function(self) local dbOffset = (size * 0.15) bar.Holder:Size(width, size) if(not db.classbar.detachFromFrame) then - SV:ResetMovables(L["Classbar"]) + SV.Mentalo:Reset(L["Classbar"]) end local holderUpdate = bar.Holder:GetScript('OnSizeChanged') if holderUpdate then @@ -360,7 +360,7 @@ function MOD:CreateClassBar(playerFrame) classBarHolder:Point("TOPLEFT", playerFrame, "BOTTOMLEFT", 0, -2) bar:SetPoint("TOPLEFT", classBarHolder, "TOPLEFT", 0, 0) bar.Holder = classBarHolder - SV:SetSVMovable(bar.Holder, L["Classbar"], nil, nil, nil, "ALL, SOLO") + SV.Mentalo:Add(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 d6fffa0..bf8280d 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/warrior.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/warrior.lua @@ -25,12 +25,13 @@ local select = _G.select; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; + +local assert = assert; assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibLocale(); + +local L = SV.L; if(SV.class ~= "WARRIOR") then return end local MOD = SV.SVUnit if(not MOD) then return end diff --git a/Interface/AddOns/SVUI/scripts/comix.lua b/Interface/AddOns/SVUI/scripts/comix.lua index f6fcbe0..c00c9d1 100644 --- a/Interface/AddOns/SVUI/scripts/comix.lua +++ b/Interface/AddOns/SVUI/scripts/comix.lua @@ -28,9 +28,8 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); +local SV = select(2, ...) +local L = SV.L local Comix = CreateFrame("Frame"); --[[ ########################################################## @@ -128,7 +127,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 SV.db.system.bigComix) then + if((rng < 3) and SV.db.general.bigComix) then self:LaunchPopup("PREMIUM") elseif rng < 8 then self:LaunchPopup("DELUXE") @@ -139,7 +138,7 @@ local Comix_OnEvent = function(self, event, ...) end function SV:ToggleComix() - if not SV.db.system.comix then + if not SV.db.general.comix then Comix:UnregisterEvent("COMBAT_LOG_EVENT_UNFILTERED") Comix:SetScript("OnEvent", nil) else @@ -222,4 +221,5 @@ local function LoadSVComix() Comix:ReadyState(true) SV:ToggleComix() end -Registry:NewScript(LoadSVComix) \ No newline at end of file + +SV:NewScript(LoadSVComix) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/ego.lua b/Interface/AddOns/SVUI/scripts/ego.lua new file mode 100644 index 0000000..4cbf1b5 --- /dev/null +++ b/Interface/AddOns/SVUI/scripts/ego.lua @@ -0,0 +1,94 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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 math = _G.math; +--[[ MATH METHODS ]]-- +local random = math.random; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) +local L = SV.L + +local EgoFrame = CreateFrame("Frame", "EgoFrame", UIParent); + +local LaunchPopup = function(self, emote) + local size = SVUIParent:GetHeight() + self.Model:Show() + self.anim[2]:SetOffset(size, -size) + self.anim[2]:SetOffset(0, 0) + self.anim:Play() + self.Model:SetAnimation(emote) +end + +local Ego_OnEvent = function(self, event) + if event == "ACHIEVEMENT_EARNED" then + self:LaunchPopup(74) + else + self:LaunchPopup(84) + end +end + +function BeAwesome() + EgoFrame:LaunchPopup(74) +end + +function SV:ToggleEgo() + if not SV.db.general.ego then + EgoFrame:UnregisterEvent("ACHIEVEMENT_EARNED") + EgoFrame:UnregisterEvent("SCREENSHOT_SUCCEEDED") + EgoFrame:SetScript("OnEvent", nil) + else + EgoFrame:RegisterEvent("ACHIEVEMENT_EARNED") + EgoFrame:RegisterEvent("SCREENSHOT_SUCCEEDED") + EgoFrame:SetScript("OnEvent", Ego_OnEvent) + end +end + +local EgoPop_OnUpdate = function(self) self.parent:SetAlpha(0) end + +local function LoadSVEgo() + local size = UIParent:GetWidth() + EgoFrame:SetParent(SV.UIParent) + EgoFrame:SetPoint("TOP", SV.UIParent, "TOP", 0, 0) + EgoFrame:SetWidth(size) + EgoFrame:SetHeight(size) + EgoFrame.LaunchPopup = LaunchPopup + + local model = CreateFrame("PlayerModel", "EgoFrameModel", EgoFrame) + model:SetAllPoints(EgoFrame) + model:SetUnit("player") + model:Hide() + + EgoFrame.Model = model + + SV.Animate:Slide(EgoFrame, size, -size, true, 1.5) + EgoFrame:SetAlpha(0) + EgoFrame.anim[4]:SetScript("OnFinished", EgoPop_OnUpdate) + + SLASH_SVUI_BADASS1="/badass" + SlashCmdList["SVUI_BADASS"] = BeAwesome; +end + +SV:NewScript(LoadSVEgo) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/misc.lua b/Interface/AddOns/SVUI/scripts/misc.lua index 2b8a639..c51e038 100644 --- a/Interface/AddOns/SVUI/scripts/misc.lua +++ b/Interface/AddOns/SVUI/scripts/misc.lua @@ -31,9 +31,8 @@ local cos, deg, rad, sin = math.cos, math.deg, math.rad, math.sin; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); +local SV = select(2, ...) +local L = SV.L local toonclass = select(2, UnitClass('player')) --[[ ########################################################## @@ -64,8 +63,7 @@ local function LoadStyledChatBubbles() LFRBrowseFrame.timeToClear = nil end end) - - if(SV.db.system.bubbles == true) then + if(SV.db.general.bubbles == true) then local ChatBubbleHandler = CreateFrame("Frame", nil, UIParent) local total = 0 local numKids = 0 @@ -126,7 +124,7 @@ local function LoadStyledChatBubbles() end end -Registry:NewScript(LoadStyledChatBubbles) +SV:NewScript(LoadStyledChatBubbles) --[[ ########################################################## DRESSUP HELPERS by: Leatrix @@ -216,6 +214,7 @@ local DressUp_OnLeave = function(self) end local function LoadDressupHelper() + if IsAddOnLoaded("DressingRoomFunctions") then return end --[[ PAPER DOLL ENHANCEMENT ]]-- local tabard1 = SV:CreateButton(DressUpFrame, "Tabard", "BOTTOMLEFT", 12, 12, 80, 22, "") tabard1:SetScript("OnClick", function() @@ -285,7 +284,7 @@ local function LoadDressupHelper() CharacterModelFrame:HookScript("OnShow", SetVanityPlacement) end -Registry:NewScript(LoadDressupHelper) +SV:NewScript(LoadDressupHelper) --[[ ########################################################## RAIDMARKERS @@ -418,10 +417,10 @@ local Totems_OnEvent = function(self, event) end function SV:UpdateTotems() - local totemSize = self.db.system.totems.size; - local totemSpace = self.db.system.totems.spacing; - local totemGrowth = self.db.system.totems.showBy; - local totemSort = self.db.system.totems.sortDirection; + local totemSize = self.db.totems.size; + local totemSpace = self.db.totems.spacing; + local totemGrowth = self.db.totems.showBy; + local totemSort = self.db.totems.sortDirection; for i = 1, MAX_TOTEMS do local button = TotemBar[i] @@ -473,7 +472,7 @@ local Totem_OnLeave = function() end local function CreateTotemBar() - if(not SV.db.system.totems.enable) then return; end + if(not SV.db.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) @@ -539,10 +538,10 @@ local function CreateTotemBar() else frame_name = L["Totem Bar"] end - SV:SetSVMovable(TotemBar, frame_name) + SV.Mentalo:Add(TotemBar, frame_name) end -Registry:NewScript(CreateTotemBar) +SV:NewScript(CreateTotemBar) --[[ ########################################################## THREAT THERMOMETER @@ -624,7 +623,7 @@ local function ThreatBar_OnEvent(self, event) end local function LoadThreatBar() - if(SV.db.system.threatbar == true) then + if(SV.db.general.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) @@ -649,8 +648,8 @@ local function LoadThreatBar() ThreatBar:RegisterEvent('GROUP_ROSTER_UPDATE') ThreatBar:RegisterEvent('UNIT_PET') ThreatBar:SetScript("OnEvent", ThreatBar_OnEvent) - SV:SetSVMovable(ThreatBar, "Threat Bar"); + SV.Mentalo:Add(ThreatBar, "Threat Bar"); end end -Registry:NewScript(LoadThreatBar); \ No newline at end of file +SV: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 f286bad..6a98ada 100644 --- a/Interface/AddOns/SVUI/scripts/mounts.lua +++ b/Interface/AddOns/SVUI/scripts/mounts.lua @@ -33,11 +33,8 @@ local twipe,band = table.wipe, bit.band; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); --- SVUI_Cache.Mounts.types --- SVUI_Cache.Mounts.names +local SV = select(2, ...) +local L = SV.L --[[ ########################################################## LOCAL VARIABLES @@ -66,36 +63,36 @@ local function UpdateMountCheckboxes(button, index) bar["SPECIAL"].index = index bar["SPECIAL"].name = creatureName - if(SVUI_Cache.Mounts.names["GROUND"] == creatureName) then - if(SVUI_Cache.Mounts.types["GROUND"] ~= index) then - SVUI_Cache.Mounts.types["GROUND"] = index + if(SV.cache.Mounts.names["GROUND"] == creatureName) then + if(SV.cache.Mounts.types["GROUND"] ~= index) then + SV.cache.Mounts.types["GROUND"] = index end bar["GROUND"]:SetChecked(1) else bar["GROUND"]:SetChecked(0) end - if(SVUI_Cache.Mounts.names["FLYING"] == creatureName) then - if(SVUI_Cache.Mounts.types["FLYING"] ~= index) then - SVUI_Cache.Mounts.types["FLYING"] = index + if(SV.cache.Mounts.names["FLYING"] == creatureName) then + if(SV.cache.Mounts.types["FLYING"] ~= index) then + SV.cache.Mounts.types["FLYING"] = index end bar["FLYING"]:SetChecked(1) else bar["FLYING"]:SetChecked(0) end - if(SVUI_Cache.Mounts.names["SWIMMING"] == creatureName) then - if(SVUI_Cache.Mounts.types["SWIMMING"] ~= index) then - SVUI_Cache.Mounts.types["SWIMMING"] = index + if(SV.cache.Mounts.names["SWIMMING"] == creatureName) then + if(SV.cache.Mounts.types["SWIMMING"] ~= index) then + SV.cache.Mounts.types["SWIMMING"] = index end bar["SWIMMING"]:SetChecked(1) else bar["SWIMMING"]:SetChecked(0) end - if(SVUI_Cache.Mounts.names["SPECIAL"] == creatureName) then - if(SVUI_Cache.Mounts.types["SPECIAL"] ~= index) then - SVUI_Cache.Mounts.types["SPECIAL"] = index + if(SV.cache.Mounts.names["SPECIAL"] == creatureName) then + if(SV.cache.Mounts.types["SPECIAL"] ~= index) then + SV.cache.Mounts.types["SPECIAL"] = index end bar["SPECIAL"]:SetChecked(1) else @@ -104,29 +101,29 @@ local function UpdateMountCheckboxes(button, index) end end -local function UpdateMountCache() +local function UpdateMountsCache() if(not MountJournal or not MountJournal.cachedMounts) then return end local num = GetNumCompanions("MOUNT") for index = 1, num, 1 do local _, info, id = GetCompanionInfo("MOUNT", index) - if(SVUI_Cache.Mounts.names["GROUND"] == info) then - if(SVUI_Cache.Mounts.types["GROUND"] ~= index) then - SVUI_Cache.Mounts.types["GROUND"] = index + if(SV.cache.Mounts.names["GROUND"] == info) then + if(SV.cache.Mounts.types["GROUND"] ~= index) then + SV.cache.Mounts.types["GROUND"] = index end end - if(SVUI_Cache.Mounts.names["FLYING"] == info) then - if(SVUI_Cache.Mounts.types["FLYING"] ~= index) then - SVUI_Cache.Mounts.types["FLYING"] = index + if(SV.cache.Mounts.names["FLYING"] == info) then + if(SV.cache.Mounts.types["FLYING"] ~= index) then + SV.cache.Mounts.types["FLYING"] = index end end - if(SVUI_Cache.Mounts.names["SWIMMING"] == info) then - if(SVUI_Cache.Mounts.types["SWIMMING"] ~= index) then - SVUI_Cache.Mounts.types["SWIMMING"] = index + if(SV.cache.Mounts.names["SWIMMING"] == info) then + if(SV.cache.Mounts.types["SWIMMING"] ~= index) then + SV.cache.Mounts.types["SWIMMING"] = index end end - if(SVUI_Cache.Mounts.names["SPECIAL"] == info) then - if(SVUI_Cache.Mounts.types["SPECIAL"] ~= index) then - SVUI_Cache.Mounts.types["SPECIAL"] = index + if(SV.cache.Mounts.names["SPECIAL"] == info) then + if(SV.cache.Mounts.types["SPECIAL"] ~= index) then + SV.cache.Mounts.types["SPECIAL"] = index end end end @@ -151,7 +148,7 @@ end local ProxyUpdate_Mounts = function(self, event, ...) if(event == "COMPANION_LEARNED" or event == "COMPANION_UNLEARNED") then - UpdateMountCache() + UpdateMountsCache() end Update_MountCheckButtons() end @@ -160,29 +157,29 @@ local function UpdateCurrentMountSelection() ttSummary = "" local creatureName - if(SVUI_Cache.Mounts.types["FLYING"]) then - creatureName = SVUI_Cache.Mounts.names["FLYING"] + if(SV.cache.Mounts.types["FLYING"]) then + creatureName = SV.cache.Mounts.names["FLYING"] if(creatureName) then ttSummary = ttSummary .. "\nFlying: " .. creatureName end end - if(SVUI_Cache.Mounts.types["SWIMMING"]) then - creatureName = SVUI_Cache.Mounts.names["SWIMMING"] + if(SV.cache.Mounts.types["SWIMMING"]) then + creatureName = SV.cache.Mounts.names["SWIMMING"] if(creatureName) then ttSummary = ttSummary .. "\nSwimming: " .. creatureName end end - if(SVUI_Cache.Mounts.types["GROUND"]) then - creatureName = SVUI_Cache.Mounts.names["GROUND"] + if(SV.cache.Mounts.types["GROUND"]) then + creatureName = SV.cache.Mounts.names["GROUND"] if(creatureName) then ttSummary = ttSummary .. "\nGround: " .. creatureName end end - if(SVUI_Cache.Mounts.types["SPECIAL"]) then - creatureName = SVUI_Cache.Mounts.names["SPECIAL"] + if(SV.cache.Mounts.types["SPECIAL"]) then + creatureName = SV.cache.Mounts.names["SPECIAL"] if(creatureName) then ttSummary = ttSummary .. "\nSpecial: " .. creatureName end @@ -196,11 +193,11 @@ local CheckButton_OnClick = function(self) if(index) then if(self:GetChecked() == 1) then - SVUI_Cache.Mounts.types[key] = index - SVUI_Cache.Mounts.names[key] = name + SV.cache.Mounts.types[key] = index + SV.cache.Mounts.names[key] = name else - SVUI_Cache.Mounts.types[key] = false - SVUI_Cache.Mounts.names[key] = "" + SV.cache.Mounts.types[key] = false + SV.cache.Mounts.names[key] = "" end Update_MountCheckButtons() UpdateCurrentMountSelection() @@ -235,24 +232,26 @@ ADDING CHECKBOXES TO JOURNAL ########################################################## ]]-- local function SetMountCheckButtons() - if not SVUI_Cache["Mounts"] then - SVUI_Cache["Mounts"] = { - ["types"] = { - ["GROUND"] = false, - ["FLYING"] = false, - ["SWIMMING"] = false, - ["SPECIAL"] = false - }, - ["names"] = { - ["GROUND"] = "", - ["FLYING"] = "", - ["SWIMMING"] = "", - ["SPECIAL"] = "" - } + SV.cache.Mounts = SV.cache.Mounts or {} + + if not SV.cache.Mounts.types then + SV.cache.Mounts.types = { + ["GROUND"] = false, + ["FLYING"] = false, + ["SWIMMING"] = false, + ["SPECIAL"] = false + } + end + if not SV.cache.Mounts.names then + SV.cache.Mounts.names = { + ["GROUND"] = "", + ["FLYING"] = "", + ["SWIMMING"] = "", + ["SPECIAL"] = "" } end - UpdateMountCache() + UpdateMountsCache() local scrollFrame = MountJournal.ListScrollFrame; local scrollBar = _G["MountJournalListScrollFrameScrollBar"] @@ -348,7 +347,7 @@ local function SetMountCheckButtons() scrollBar:HookScript("OnValueChanged", Update_MountCheckButtons) UpdateCurrentMountSelection() - if(SV.___interface >= 60000) then + if(SV.GameVersion >= 60000) then MountListener:RegisterEvent("MOUNT_JOURNAL_USABILITY_CHANGED") end @@ -363,7 +362,7 @@ SLASH FUNCTION ########################################################## ]]-- function SVUILetsRide() - local checkList = SVUI_Cache.Mounts.types + local checkList = SV.cache.Mounts.types local letsFly, letsSwim, letsSeahorse, vjZone, IbelieveIcantFly local maxMounts = GetNumCompanions("MOUNT") if(not maxMounts or IsMounted()) then @@ -446,4 +445,4 @@ end LOADER ########################################################## ]]-- -Registry:NewScript(SetMountCheckButtons); \ No newline at end of file +SV: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 ca7ffb9..e4e9627 100644 --- a/Interface/AddOns/SVUI/scripts/questwatch.lua +++ b/Interface/AddOns/SVUI/scripts/questwatch.lua @@ -51,9 +51,8 @@ local tremove, tcopy, twipe, tsort, tconcat = table.remove, table.copy, table.wi GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); +local SV = select(2, ...) +local L = SV.L local QuestDocklet = CreateFrame("Frame", "SVQuestFrameEventListener", UIParent) --[[ ########################################################## @@ -324,7 +323,7 @@ end local function CreateQuestDocklet() SuperDockWindowRight = _G["SuperDockWindowRight"] - if(SV.___interface >= 60000) then + if(SV.GameVersion >= 60000) then ObjectiveTrackerFrame:RemoveTextures(true) @@ -347,8 +346,8 @@ local function CreateQuestDocklet() ObjectiveTrackerFrame.HeaderMenu:RemoveTextures(true) ObjectiveTrackerFrame.BlockDropDown:RemoveTextures(true) - SV:SetSVMovable(frame, "Quest Watch"); - elseif(not SV.db.system.questWatch) then + SV.Mentalo:Add(frame, "Quest Watch"); + elseif(not SV.db.general.questWatch) then local frame = CreateFrame("Frame", "SVUI_QuestFrame", UIParent); frame:SetSize(200, WatchFrame:GetHeight()); frame:SetPoint("RIGHT", UIParent, "RIGHT", -100, 0); @@ -364,7 +363,7 @@ local function CreateQuestDocklet() WatchFrameLines.SetPoint = SV.fubar; WatchFrameLines.SetAllPoints = SV.fubar; - SV:SetSVMovable(frame, "Quest Watch"); + SV.Mentalo:Add(frame, "Quest Watch"); else local bgTex = [[Interface\BUTTONS\WHITE8X8]] local bdTex = SV.Media.bar.glow @@ -469,4 +468,4 @@ local function CreateQuestDocklet() end end -Registry:NewScript(CreateQuestDocklet) \ No newline at end of file +SV: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 be40dd4..6278c36 100644 --- a/Interface/AddOns/SVUI/scripts/raid.lua +++ b/Interface/AddOns/SVUI/scripts/raid.lua @@ -26,9 +26,8 @@ local pairs = _G.pairs; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); +local SV = select(2, ...) +local L = SV.L --[[ ########################################################## RAID UTILITY By: Elv @@ -260,4 +259,4 @@ local function LoadRaidUtility() end end end -Registry:NewScript(LoadRaidUtility); \ No newline at end of file +SV: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 bada875..aa97378 100644 --- a/Interface/AddOns/SVUI/scripts/reactions.lua +++ b/Interface/AddOns/SVUI/scripts/reactions.lua @@ -32,9 +32,8 @@ local format, gsub = string.format, string.gsub; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibLocale() -local Registry = LibStub("LibSystemRegistry-1.0"); +local SV = select(2, ...) +local L = SV.L --[[ ########################################################## LOCALS (from ShestakUI by:Shestak) @@ -102,7 +101,7 @@ WEARING NON COMBAT GEAR ]]-- local StupidHatHandler = CreateFrame("Frame") local StupidHatHandler_OnEvent = function(self, event) - if event ~= "ZONE_CHANGED_NEW_AREA" or not IsInInstance() then return end + if(not IsInInstance()) then return end local item = {} for i = 1, 17 do if Reactions.StupidHat[i] ~= nil then @@ -294,7 +293,7 @@ CONFIG TOGGLE ########################################################## ]]-- function SV:ToggleReactions() - local settings = self.db.system + local settings = self.db.general REACTION_INTERRUPT = settings.pvpinterrupt REACTION_WOOT = settings.woot @@ -328,4 +327,4 @@ local function LoadReactions() SV:ToggleReactions() end -Registry:NewScript(LoadReactions) \ No newline at end of file +SV: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 75af259..006f15c 100644 --- a/Interface/AddOns/SVUI/scripts/spellbind.lua +++ b/Interface/AddOns/SVUI/scripts/spellbind.lua @@ -16,6 +16,7 @@ S U P E R - V I L L A I N - U I By: Munglunch # LOCALIZED LUA FUNCTIONS ########################################################## ]]-- +local SV = select(2, ...) --[[ GLOBALS ]]-- local _G = _G; local unpack = _G.unpack; @@ -25,6 +26,8 @@ local ipairs = _G.ipairs; local type = _G.type; local tinsert = _G.tinsert; local string = _G.string; + +local SVLib = LibSuperVillain --[[ ########################################################## Simple click2cast spell SpellBinder(sBinder by Fernir) @@ -61,11 +64,6 @@ for _, gName in pairs(UnitParseListing) do end end -local DB = {}; -DB.spells = DB.spells or {} -DB.frames = DB.frames or {} -DB.keys = DB.keys or {} - local SpellBinder = CreateFrame("Frame", "SVUI_SpellBinder", SpellBookFrame, "ButtonFrameTemplate") SpellBinder:SetPoint("TOPLEFT", SpellBookFrame, "TOPRIGHT", 100, 0) SpellBinder:SetSize(300, 400) @@ -168,9 +166,9 @@ local SpellBindMask_OnClick = function(self, button) button = SecureButton_GetButtonSuffix(button) end - for i, v in pairs(DB.spells) do if v.spell == spellname then return end end + for i, v in pairs(SV.cache.SpellBinder.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,}) + tinsert(SV.cache.SpellBinder.spells, {["id"] = slot, ["modifier"] = modifier, ["button"] = button, ["spell"] = spellname, ["rank"] = rank, ["texture"] = texture, ["origbutton"] = originalbutton,}) SpellBinder:BuildSpells(false) end end @@ -178,8 +176,8 @@ end local SpellBindDelete_OnClick = function(self) local spell = self.spell - for j, k in ipairs(DB.spells) do - if k ~= spell then + for j, k in ipairs(SV.cache.SpellBinder.spells) do + if k ~= spell.spell then k.checked = false _G[j.."_cbs"]:SetBackdropColor(0, 0, 0, 0) end @@ -192,37 +190,8 @@ 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 {} - SpellBinder:BuildList() - SpellBinder:BuildSpells(true) - - for i = 1, SPELLS_PER_PAGE do - local parent = _G["SpellButton"..i] - local button = CreateFrame("Button", "SpellButtonMask"..i, parent) - button:SetID(parent:GetID()) - button:RegisterForClicks("AnyDown") - button:SetAllPoints(parent) - button:SetScript("OnClick", SpellBindMask_OnClick) - - button.shine = SpellBook_GetAutoCastShine() - button.shine:Show() - button.shine:SetParent(button) - button.shine:SetAllPoints() - AutoCastShine_AutoCastStart(button.shine) - - button:Hide() - 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 - SpellBinder:UpdateAll() - end +local SpellBind_OnEvent = function(self) + self:UpdateAll() end --[[ ########################################################## @@ -230,6 +199,14 @@ METHODS ########################################################## ]]-- function SpellBinder:BuildSpells(delete) + if(not SV.cache.SpellBinder) then return end + + if(not SV.cache.SpellBinder.spells) then + SV.cache.SpellBinder.spells = {} + SV.cache.SpellBinder.frames = {} + SV.cache.SpellBinder.keys = {} + end + local oldb, spellName local scroll = self.list.child scroll:SetPoint("TOPLEFT") @@ -247,7 +224,7 @@ function SpellBinder:BuildSpells(delete) end end - for i, spell in ipairs(DB.spells) do + for i, spell in ipairs(SV.cache.SpellBinder.spells) do spellName = spell.spell if spellName then local bf = _G[i.."_cbs"] or CreateFrame("Button", i.."_cbs", scroll) @@ -276,7 +253,7 @@ function SpellBinder:BuildSpells(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.spell = spellName + bf.delete.spell = spell bf.delete:SetScript("OnClick", SpellBindDelete_OnClick) bf:SetScript("OnEnter", BoundSpell_OnEnter) @@ -287,7 +264,7 @@ function SpellBinder:BuildSpells(delete) bf.fs:SetPoint("RIGHT", bf.delete, "LEFT", -4, 0) for frame,_ in pairs(ClickCastFrames) do - if frame and DB.frames[frame] then + if frame and SV.cache.SpellBinder.frames[frame] then if frame:CanChangeAttribute() or frame:CanChangeProtectedState() then if frame:GetAttribute(spell.modifier.."type"..spell.button) ~= "menu" then --frame:RegisterForClicks("AnyDown") @@ -296,15 +273,15 @@ function SpellBinder:BuildSpells(delete) frame:SetAttribute(spell.modifier.."type-"..spell.spell, "spell") frame:SetAttribute(spell.modifier.."spell-"..spell.spell, spell.spell) - DB.keys[spell.modifier..spell.button] = spell.spell - DB.keys[spell.modifier.."type-"..spell.spell] = "spell" - DB.keys[spell.modifier.."spell-"..spell.spell] = spell.spell + SV.cache.SpellBinder.keys[spell.modifier..spell.button] = spell.spell + SV.cache.SpellBinder.keys[spell.modifier.."type-"..spell.spell] = "spell" + SV.cache.SpellBinder.keys[spell.modifier.."spell-"..spell.spell] = spell.spell else frame:SetAttribute(spell.modifier.."type"..spell.button, "spell") frame:SetAttribute(spell.modifier.."spell"..spell.button, spell.spell) - DB.keys[spell.modifier.."type"..spell.button] = "spell" - DB.keys[spell.modifier.."spell"..spell.button] = spell.spell + SV.cache.SpellBinder.keys[spell.modifier.."type"..spell.button] = "spell" + SV.cache.SpellBinder.keys[spell.modifier.."spell"..spell.button] = spell.spell end end end @@ -318,34 +295,36 @@ function SpellBinder:BuildSpells(delete) end function SpellBinder:BuildList() - for frame,_ in pairs(ClickCastFrames) do - DB.frames[frame] = DB.frames[frame] or true + if(SV.cache.SpellBinder and SV.cache.SpellBinder.frames) then + for frame,_ in pairs(ClickCastFrames) do + SV.cache.SpellBinder.frames[frame] = SV.cache.SpellBinder.frames[frame] or true + end end end function SpellBinder:ToggleButtons() for i = 1, SPELLS_PER_PAGE do - 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(self.spellbuttons[i]) then + self.spellbuttons[i]:Hide() + if self.sbOpen and SpellBookFrame.bookType ~= BOOKTYPE_PROFESSION then + local slot = SpellBook_GetSpellBookSlot(self.spellbuttons[i]:GetParent()) if slot then local spellname, subtype = GetSpellBookItemName(slot, SpellBookFrame.bookType) if spellname then - SpellBinder.spellbuttons[i]:Show() + self.spellbuttons[i]:Show() end end end end end - SpellBinder:BuildList() - SpellBinder:BuildSpells(true) - if SpellBinder:IsVisible() then SpellBinder.tab:SetChecked(true) else SpellBinder.tab:SetChecked(false) end + self:BuildList() + self:BuildSpells(true) + if self:IsVisible() then self.tab:SetChecked(true) else self.tab:SetChecked(false) end end function SpellBinder:DeleteSpell() - local count = table.getn(DB.spells) - for i, spell in ipairs(DB.spells) do + local count = table.getn(SV.cache.SpellBinder.spells) + for i, spell in ipairs(SV.cache.SpellBinder.spells) do if spell.checked then for frame,_ in pairs(ClickCastFrames) do local f @@ -365,7 +344,7 @@ function SpellBinder:DeleteSpell() end end end - tremove(DB.spells, i) + tremove(SV.cache.SpellBinder.spells, i) end end self:BuildSpells(true) @@ -451,4 +430,35 @@ SpellBinder:RegisterEvent("PLAYER_ENTERING_WORLD") SpellBinder:RegisterEvent("PLAYER_LOGIN") SpellBinder:RegisterEvent("ZONE_CHANGED_NEW_AREA") SpellBinder:RegisterEvent("ZONE_CHANGED") -SpellBinder:SetScript("OnEvent", SpellBind_OnEvent) \ No newline at end of file + +local function LoadSpellBinder() + SV.cache.SpellBinder = SV.cache.SpellBinder or {} + SV.cache.SpellBinder.spells = SV.cache.SpellBinder.spells or {} + SV.cache.SpellBinder.frames = SV.cache.SpellBinder.frames or {} + SV.cache.SpellBinder.keys = SV.cache.SpellBinder.keys or {} + + SpellBinder:BuildList() + SpellBinder:BuildSpells(true) + + for i = 1, SPELLS_PER_PAGE do + local parent = _G["SpellButton"..i] + local button = CreateFrame("Button", "SpellButtonMask"..i, parent) + button:SetID(parent:GetID()) + button:RegisterForClicks("AnyDown") + button:SetAllPoints(parent) + button:SetScript("OnClick", SpellBindMask_OnClick) + + button.shine = SpellBook_GetAutoCastShine() + button.shine:Show() + button.shine:SetParent(button) + button.shine:SetAllPoints() + AutoCastShine_AutoCastStart(button.shine) + + button:Hide() + SpellBinder.spellbuttons[i] = button + end + + SpellBinder:SetScript("OnEvent", SpellBind_OnEvent) +end + +SV:NewScript(LoadSpellBinder) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/setup/configs.lua b/Interface/AddOns/SVUI/setup/configs.lua new file mode 100644 index 0000000..fc10475 --- /dev/null +++ b/Interface/AddOns/SVUI/setup/configs.lua @@ -0,0 +1,3658 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV = select(2, ...) + +local playerClass = select(2, UnitClass("player")); + +local filterClass = playerClass or "NONE" + +local function safename(id) + local n = GetSpellInfo(id) + if not n then + if type(id) == "string" then + n = id + else + SV:Debugger('|cffFF9900SVUI:|r Spell not found: (#ID) '..id) + n = "Voodoo Doll"; + end + end + return n +end + +--[[ SYSTEM DATA ]]-- + +SV.configs = {} + +SV.configs["general"] = { + ["cooldown"] = true, + ["autoScale"] = true, + ["multiMonitor"] = false, + ["taintLog"] = false, + ["stickyFrames"] = true, + ["loginmessage"] = true, + ["hideErrorFrame"] = true, + ["threatbar"] = false, + ["bubbles"] = true, + ["comix"] = true, + ["bigComix"] = true, + ["questWatch"] = true, + ["woot"] = true, + ["pvpinterrupt"] = true, + ["lookwhaticando"] = false, + ["reactionChat"] = false, + ["reactionEmote"] = false, + ["sharingiscaring"] = false, + ["arenadrink"] = true, + ["stupidhat"] = true, +} + +SV.configs["LAYOUT"] = { + mediastyle = "default", + barstyle = "default", + unitstyle = "default", + groupstyle = "default", + aurastyle = "default" +} + +SV.configs["totems"] = { + ["enable"] = true, + ["showBy"] = "VERTICAL", + ["sortDirection"] = "ASCENDING", + ["size"] = 40, + ["spacing"] = 4 +} + +SV.configs["media"] = { + ["fonts"] = { + ["default"] = "SVUI System Font", + ["name"] = "SVUI Name Font", + ["number"] = "SVUI Number Font", + ["combat"] = "SVUI Combat Font", + ["giant"] = "SVUI Action Font", + ["size"] = 10, + ["unicodeSize"] = 12, + }, + ["textures"] = { + ["pattern"] = "SVUI Backdrop 1", + ["comic"] = "SVUI Comic 1", + ["unitlarge"] = "SVUI Unit BG 3", + ["unitsmall"] = "SVUI Small BG 3" + }, + ["colors"] = { + ["default"] = {0.2, 0.2, 0.2, 1}, + ["special"] = {0.37, 0.32, 0.29, 1}, + }, + ["unitframes"] = { + ["health"] = {0.3, 0.5, 0.3}, + ["power"] = { + ["MANA"] = {0.41, 0.85, 1}, + ["RAGE"] = {1, 0.31, 0.31}, + ["FOCUS"] = {1, 0.63, 0.27}, + ["ENERGY"] = {0.85, 0.83, 0.25}, + ["RUNES"] = {0.55, 0.57, 0.61}, + ["RUNIC_POWER"] = {0, 0.82, 1}, + ["FUEL"] = {0, 0.75, 0.75} + }, + ["reaction"] = { + [1] = {0.92, 0.15, 0.15}, + [2] = {0.92, 0.15, 0.15}, + [3] = {0.92, 0.15, 0.15}, + [4] = {0.85, 0.85, 0.13}, + [5] = {0.19, 0.85, 0.13}, + [6] = {0.19, 0.85, 0.13}, + [7] = {0.19, 0.85, 0.13}, + [8] = {0.19, 0.85, 0.13}, + }, + ["tapped"] = {0.55, 0.57, 0.61}, + ["disconnected"] = {0.84, 0.75, 0.65}, + ["casting"] = {0.8, 0.8, 0}, + ["spark"] = {1, 0.72, 0}, + ["interrupt"] = {0.78, 0.25, 0.25}, + ["shield_bars"] = {0.56, 0.4, 0.62}, + ["buff_bars"] = {0.31, 0.31, 0.31}, + ["debuff_bars"] = {0.8, 0.1, 0.1}, + ["predict"] = { + ["personal"] = {0, 1, 0.5, 0.25}, + ["others"] = {0, 1, 0, 0.25}, + ["absorbs"] = {1, 1, 0, 0.25} + }, + ["spellcolor"] = { + [safename(2825)] = {0.98, 0.57, 0.11}, --Bloodlust + [safename(32182)] = {0.98, 0.57, 0.11}, --Heroism + [safename(80353)] = {0.98, 0.57, 0.11}, --Time Warp + [safename(90355)] = {0.98, 0.57, 0.11}, --Ancient Hysteria + [safename(84963)] = {0.98, 0.57, 0.11}, --Inquisition + [safename(86659)] = {0.98, 0.57, 0.11}, --Guardian of Ancient Kings + } + } +} + +SV.configs["SVBar"] = { + ["enable"] = true, + ["font"] = "Roboto", + ["fontSize"] = 11, + ["fontOutline"] = "OUTLINE", + ["countFont"] = "SVUI Number Font", + ["countFontSize"] = 11, + ["countFontOutline"] = "OUTLINE", + ["cooldownSize"] = 18, + ["rightClickSelf"] = false, + ["macrotext"] = false, + ["hotkeytext"] = false, + ["hotkeyAbbrev"] = true, + ["showGrid"] = true, + ["unc"] = {0.8, 0.1, 0.1, 0.7}, + ["unpc"] = {0.5, 0.5, 1, 0.7}, + ["keyDown"] = false, + ["unlock"] = "SHIFT", + ["Micro"] = { + ["enable"] = true, + ["mouseover"] = true, + ["alpha"] = 1, + ["buttonsize"] = 30, + ["buttonspacing"] = 4, + ["yOffset"] = 4 + }, + ["Bar1"] = { + ["enable"] = true, + ["buttons"] = 12, + ["mouseover"] = false, + ["buttonsPerRow"] = 12, + ["point"] = "BOTTOMLEFT", + ["backdrop"] = false, + ["buttonsize"] = 32, + ["buttonspacing"] = 2, + ["useCustomPaging"] = true, + ["useCustomVisibility"] = false, + ["customVisibility"] = "[petbattle] hide; show", + ["customPaging"] = { + ["HUNTER"] = "", + ["WARLOCK"] = "[form:2] 10;", + ["PRIEST"] = "[bonusbar:1] 7;", + ["PALADIN"] = "", + ["MAGE"] = "", + ["ROGUE"] = "[stance:1] 7; [stance:2] 7; [stance:3] 7; [bonusbar:1] 7; [form:3] 7;", + ["DRUID"] = "[bonusbar:1, nostealth] 7; [bonusbar:1, stealth] 8; [bonusbar:2] 8; [bonusbar:3] 9; [bonusbar:4] 10;", + ["SHAMAN"] = "", + ["WARRIOR"] = "", + ["DEATHKNIGHT"] = "", + ["MONK"] = "[bonusbar:1] 7; [bonusbar:2] 8; [bonusbar:3] 9;", + }, + ["alpha"] = 1 + }, + ["Bar2"] = { + ["enable"] = false, + ["mouseover"] = false, + ["buttons"] = 12, + ["buttonsPerRow"] = 12, + ["point"] = "BOTTOMLEFT", + ["backdrop"] = false, + ["buttonsize"] = 32, + ["buttonspacing"] = 2, + ["useCustomPaging"] = false, + ["useCustomVisibility"] = false, + ["customVisibility"] = "[vehicleui] hide; [overridebar] hide; [petbattle] hide; show", + ["customPaging"] = { + ["HUNTER"] = "", + ["WARLOCK"] = "", + ["PRIEST"] = "", + ["PALADIN"] = "", + ["MAGE"] = "", + ["ROGUE"] = "", + ["DRUID"] = "", + ["SHAMAN"] = "", + ["WARRIOR"] = "", + ["DEATHKNIGHT"] = "", + ["MONK"] = "", + }, + ["alpha"] = 1 + }, + ["Bar3"] = { + ["enable"] = true, + ["mouseover"] = false, + ["buttons"] = 6, + ["buttonsPerRow"] = 6, + ["point"] = "BOTTOMLEFT", + ["backdrop"] = false, + ["buttonsize"] = 32, + ["buttonspacing"] = 2, + ["useCustomPaging"] = false, + ["useCustomVisibility"] = false, + ["customVisibility"] = "[vehicleui] hide; [overridebar] hide; [petbattle] hide; show", + ["customPaging"] = { + ["HUNTER"] = "", + ["WARLOCK"] = "", + ["PRIEST"] = "", + ["PALADIN"] = "", + ["MAGE"] = "", + ["ROGUE"] = "", + ["DRUID"] = "", + ["SHAMAN"] = "", + ["WARRIOR"] = "", + ["DEATHKNIGHT"] = "", + ["MONK"] = "", + }, + ["alpha"] = 1 + }, + ["Bar4"] = { + ["enable"] = true, + ["mouseover"] = true, + ["buttons"] = 12, + ["buttonsPerRow"] = 1, + ["point"] = "TOPRIGHT", + ["backdrop"] = false, + ["buttonsize"] = 32, + ["buttonspacing"] = 2, + ["useCustomPaging"] = false, + ["useCustomVisibility"] = false, + ["customVisibility"] = "[vehicleui] hide; [overridebar] hide; [petbattle] hide; show", + ["customPaging"] = { + ["HUNTER"] = "", + ["WARLOCK"] = "", + ["PRIEST"] = "", + ["PALADIN"] = "", + ["MAGE"] = "", + ["ROGUE"] = "", + ["DRUID"] = "", + ["SHAMAN"] = "", + ["WARRIOR"] = "", + ["DEATHKNIGHT"] = "", + ["MONK"] = "", + }, + ["alpha"] = 1 + }, + ["Bar5"] = { + ["enable"] = true, + ["mouseover"] = false, + ["buttons"] = 6, + ["buttonsPerRow"] = 6, + ["point"] = "BOTTOMLEFT", + ["backdrop"] = false, + ["buttonsize"] = 32, + ["buttonspacing"] = 2, + ["useCustomPaging"] = false, + ["useCustomVisibility"] = false, + ["customVisibility"] = "[vehicleui] hide; [overridebar] hide; [petbattle] hide; show", + ["customPaging"] = { + ["HUNTER"] = "", + ["WARLOCK"] = "", + ["PRIEST"] = "", + ["PALADIN"] = "", + ["MAGE"] = "", + ["ROGUE"] = "", + ["DRUID"] = "", + ["SHAMAN"] = "", + ["WARRIOR"] = "", + ["DEATHKNIGHT"] = "", + ["MONK"] = "", + }, + ["alpha"] = 1 + }, + ["Bar6"] = { + ["enable"] = false, + ["mouseover"] = false, + ["buttons"] = 12, + ["buttonsPerRow"] = 12, + ["point"] = "BOTTOMLEFT", + ["backdrop"] = false, + ["buttonsize"] = 32, + ["buttonspacing"] = 2, + ["useCustomPaging"] = false, + ["useCustomVisibility"] = false, + ["customVisibility"] = "[vehicleui] hide; [overridebar] hide; [petbattle] hide; show", + ["customPaging"] = { + ["HUNTER"] = "", + ["WARLOCK"] = "", + ["PRIEST"] = "", + ["PALADIN"] = "", + ["MAGE"] = "", + ["ROGUE"] = "", + ["DRUID"] = "", + ["SHAMAN"] = "", + ["WARRIOR"] = "", + ["DEATHKNIGHT"] = "", + ["MONK"] = "", + }, + ["alpha"] = 1 + }, + ["Pet"] = { + ["enable"] = true, + ["mouseover"] = false, + ["buttons"] = NUM_PET_ACTION_SLOTS, + ["buttonsPerRow"] = NUM_PET_ACTION_SLOTS, + ["point"] = "TOPLEFT", + ["backdrop"] = false, + ["buttonsize"] = 24, + ["buttonspacing"] = 3, + ["useCustomVisibility"] = false, + ["customVisibility"] = "[petbattle] hide; [pet, novehicleui, nooverridebar, nopossessbar] show; hide", + ["alpha"] = 1 + }, + ["Stance"] = { + ["enable"] = true, + ["style"] = "darkenInactive", + ["mouseover"] = false, + ["buttons"] = NUM_STANCE_SLOTS, + ["buttonsPerRow"] = NUM_STANCE_SLOTS, + ["point"] = "BOTTOMRIGHT", + ["backdrop"] = false, + ["buttonsize"] = 24, + ["buttonspacing"] = 5, + ["useCustomVisibility"] = false, + ["customVisibility"] = "[petbattle] hide; show", + ["alpha"] = 1 + } +}; + +SV.configs["SVAura"] = { + ["enable"] = true, + ["disableBlizzard"] = true, + ["font"] = "SVUI Number Font", + ["fontSize"] = 12, + ["fontOutline"] = "THINOUTLINE", + ["countOffsetV"] = 0, + ["countOffsetH"] = 0, + ["timeOffsetV"] = -4, + ["timeOffsetH"] = 0, + ["hyperBuffs"] = { + ["enable"] = true, + ["filter"] = true, + }, + ["fadeBy"] = 5, + ["buffs"] = { + ["showBy"] = "LEFT_DOWN", + ["wrapAfter"] = 12, + ["maxWraps"] = 3, + ["wrapXOffset"] = 6, + ["wrapYOffset"] = 16, + ["sortMethod"] = "TIME", + ["sortDir"] = "-", + ["isolate"] = 1, + ["size"] = 32, + }, + ["debuffs"] = { + ["showBy"] = "LEFT_DOWN", + ["wrapAfter"] = 12, + ["maxWraps"] = 1, + ["wrapXOffset"] = 6, + ["wrapYOffset"] = 16, + ["sortMethod"] = "TIME", + ["sortDir"] = "-", + ["isolate"] = 1, + ["size"] = 32, + }, +}; + +SV.configs["SVBag"] = { + ["incompatible"] = { + ["AdiBags"] = true, + ["ArkInventory"] = true, + ["Bagnon"] = true, + }, + ["enable"] = true, + ["sortInverted"] = false, + ["bags"] = { + ["xOffset"] = -40, + ["yOffset"] = 40, + ["point"] = "BOTTOMRIGHT", + }, + ["bank"] = { + ["xOffset"] = 40, + ["yOffset"] = 40, + ["point"] = "BOTTOMLEFT", + }, + ["bagSize"] = 34, + ["bankSize"] = 34, + ["alignToChat"] = false, + ["bagWidth"] = 525, + ["bankWidth"] = 525, + ["currencyFormat"] = "ICON", + ["ignoreItems"] = "", + ["bagTools"] = true, + ["bagBar"] = { + ["enable"] = false, + ["showBy"] = "VERTICAL", + ["sortDirection"] = "ASCENDING", + ["size"] = 30, + ["spacing"] = 4, + ["showBackdrop"] = false, + ["mouseover"] = false, + }, +}; + +SV.configs["SVChat"] = { + ["enable"] = true, + ["tabHeight"] = 20, + ["tabWidth"] = 75, + ["tabStyled"] = true, + ["font"] = "Roboto", + ["fontOutline"] = "OUTLINE", + ["tabFont"] = "SVUI Alert Font", + ["tabFontSize"] = 10, + ["tabFontOutline"] = "OUTLINE", + ["url"] = true, + ["shortChannels"] = true, + ["hyperlinkHover"] = true, + ["throttleInterval"] = 45, + ["fade"] = false, + ["sticky"] = true, + ["smileys"] = true, + ["secretWordTone"] = "None", + ["psst"] = "Whisper Alert", + ["noWipe"] = false, + ["timeStampFormat"] = "NONE", + ["secretWords"] = "%MYNAME%, SVUI", + ["basicTools"] = true, +}; + +SV.configs["SVDock"] = { + ["enable"] = true, + ["dockLeftWidth"] = 412, + ["dockLeftHeight"] = 224, + ["dockRightWidth"] = 412, + ["dockRightHeight"] = 224, + ["dockStatWidth"] = defaultStatBarWidth, + ["buttonSize"] = 30, + ["buttonSpacing"] = 4, + ["leftDockBackdrop"] = true, + ["rightDockBackdrop"] = true, + ["topPanel"] = true, + ["bottomPanel"] = true, + ["docklets"] = { + ["DockletMain"] = "None", + ["MainWindow"] = "None", + ["DockletExtra"] = "None", + ["ExtraWindow"] = "None", + ["enableExtra"] = false, + ["DockletCombatFade"] = true + }, +}; + +SV.configs["SVGear"] = { + ["enable"] = true, + ["specialization"] = { + ["enable"] = false, + }, + ["battleground"] = { + ["enable"] = false, + }, + ["primary"] = "none", + ["secondary"] = "none", + ["equipmentset"] = "none", + ["durability"] = { + ["enable"] = true, + ["onlydamaged"] = true, + }, + ["itemlevel"] = { + ["enable"] = true, + }, + ["misc"] = { + setoverlay = true, + } +}; + +SV.configs["SVHenchmen"] = { + ["enable"] = true, + ["autoRoll"] = false, + ["vendorGrays"] = true, + ["autoAcceptInvite"] = false, + ["autorepchange"] = false, + ["pvpautorelease"] = false, + ["autoquestcomplete"] = false, + ["autoquestreward"] = false, + ["autoquestaccept"] = false, + ["autodailyquests"] = false, + ["autopvpquests"] = false, + ["skipcinematics"] = false, + ["mailOpener"] = true, + ["autoRepair"] = "PLAYER", +}; + +SV.configs["SVMap"] = { + ["incompatible"] = { + ["SexyMap"] = true, + ["SquareMap"] = true, + ["PocketPlot"] = true, + }, + ["enable"] = true, + ["mapAlpha"] = 1, + ["tinyWorldMap"] = true, + ["size"] = 240, + ["customshape"] = true, + ["locationText"] = "CUSTOM", + ["playercoords"] = "CUSTOM", + ["bordersize"] = 6, + ["bordercolor"] = "light", + ["minimapbar"] = { + ["enable"] = true, + ["styleType"] = "HORIZONTAL", + ["layoutDirection"] = "NORMAL", + ["buttonSize"] = 28, + ["mouseover"] = false, + }, +}; + +SV.configs["SVOverride"] = { + ["enable"] = true, + ["loot"] = true, + ["lootRoll"] = true, + ["lootRollWidth"] = 328, + ["lootRollHeight"] = 28, +}; + +SV.configs["SVPlate"] = { + ["enable"] = true, + ["filter"] = {}, + ["font"] = "SVUI Name Font", + ["fontSize"] = 10, + ["fontOutline"] = "OUTLINE", + ["comboPoints"] = true, + ["nonTargetAlpha"] = 0.6, + ["combatHide"] = false, + ["colorNameByValue"] = true, + ["showthreat"] = true, + ["targetcount"] = true, + ["pointer"] = { + ["enable"] = true, + ["colorMatchHealthBar"] = true, + ["color"] = {0.9, 1, 0.9}, + }, + ["healthBar"] = { + ["lowThreshold"] = 0.4, + ["width"] = 108, + ["height"] = 9, + ["text"] = { + ["enable"] = false, + ["format"] = "CURRENT", + ["xOffset"] = 0, + ["yOffset"] = 0, + ["attachTo"] = "CENTER", + }, + }, + ["castBar"] = { + ["height"] = 6, + ["color"] = {1, 0.81, 0}, + ["noInterrupt"] = {0.78, 0.25, 0.25}, + }, + ["raidHealIcon"] = { + ["xOffset"] = -4, + ["yOffset"] = 6, + ["size"] = 36, + ["attachTo"] = "LEFT", + }, + ["threat"] = { + ["enable"] = false, + ["goodScale"] = 1, + ["badScale"] = 1, + ["goodColor"] = {0.29, 0.68, 0.3}, + ["badColor"] = {0.78, 0.25, 0.25}, + ["goodTransitionColor"] = {0.85, 0.77, 0.36}, + ["badTransitionColor"] = {0.94, 0.6, 0.06}, + }, + ["auras"] = { + ["font"] = "SVUI Number Font", + ["fontSize"] = 7, + ["fontOutline"] = "OUTLINE", + ["numAuras"] = 5, + ["additionalFilter"] = "CC" + }, + ["reactions"] = { + ["tapped"] = {0.6, 0.6, 0.6}, + ["friendlyNPC"] = { 0.31, 0.45, 0.63}, + ["friendlyPlayer"] = {0.29, 0.68, 0.3}, + ["neutral"] = {0.85, 0.77, 0.36}, + ["enemy"] = {0.78, 0.25, 0.25}, + }, +}; + +SV.configs["SVStats"] = { + ["enable"] = true, + ["font"] = "SVUI Number Font", + ["fontSize"] = 12, + ["fontOutline"] = "OUTLINE", + ["showBackground"] = true, + ["shortGold"] = true, + ["panels"] = { + ["BottomRightDataPanel"] = { + ["right"] = "Bags", + ["left"] = "Friends", + ["middle"] = "Guild", + }, + ["BottomLeftDataPanel"] = { + ["left"] = "Time", + ["middle"] = "System", + ["right"] = "Gold", + }, + ["TopLeftDataPanel"] = { + ["left"] = "Durability Bar", + ["middle"] = "Reputation Bar", + ["right"] = "Experience Bar", + }, + ["TopRightDataPanel"] = { + ["left"] = "None", + ["middle"] = "None", + ["right"] = "None", + }, + }, + ["localtime"] = true, + ["time24"] = false, + ["battleground"] = true, + ["topLeftDockPanel"] = true, + ["bottomLeftDockPanel"] = true, + ["bottomRightDockPanel"] = true, + ["panelTransparency"] = false, +}; + +SV.configs["SVTip"] = { + ["enable"] = true, + ["cursorAnchor"] = false, + ["targetInfo"] = true, + ["playerTitles"] = true, + ["guildRanks"] = true, + ["inspectInfo"] = false, + ["itemCount"] = true, + ["spellID"] = false, + ["progressInfo"] = true, + ["visibility"] = { + ["unitFrames"] = "NONE", + ["combat"] = false, + }, + ["healthBar"] = { + ["text"] = true, + ["height"] = 10, + ["font"] = "Roboto", + ["fontSize"] = 10, + }, +}; + +SV.configs["SVUnit"] = { + ["enable"] = true, + ["disableBlizzard"] = true, + + ["smoothbars"] = false, + ["statusbar"] = "SVUI BasicBar", + ["auraBarStatusbar"] = "SVUI GlowBar", + + ["font"] = "SVUI Number Font", + ["fontSize"] = 12, + ["fontOutline"] = "OUTLINE", + + ["auraFont"] = "SVUI Alert Font", + ["auraFontSize"] = 12, + ["auraFontOutline"] = "OUTLINE", + + ["OORAlpha"] = 0.65, + ["groupOORAlpha"] = 0.45, + ["combatFadeRoles"] = true, + ["combatFadeNames"] = true, + ["debuffHighlighting"] = true, + ["smartRaidFilter"] = true, + ["fastClickTarget"] = false, + ["healglow"] = true, + ["glowtime"] = 0.8, + ["glowcolor"] = {1, 1, 0}, + ["autoRoleSet"] = false, + ["healthclass"] = true, + ["forceHealthColor"] = false, + ["overlayAnimation"] = true, + ["powerclass"] = false, + ["colorhealthbyvalue"] = true, + ["customhealthbackdrop"] = true, + ["classbackdrop"] = false, + ["auraBarByType"] = true, + ["auraBarShield"] = true, + ["castClassColor"] = false, + ["xrayFocus"] = true, + ["grid"] = { + ["enable"] = false, + ["size"] = 28, + ["shownames"] = false, + ["font"] = "Roboto", + ["fontsize"] = 16, + }, + ["player"] = { + ["enable"] = true, + ["width"] = 215, + ["height"] = 60, + ["lowmana"] = 30, + ["combatfade"] = false, + ["predict"] = false, + ["threatEnabled"] = true, + ["playerExpBar"] = false, + ["playerRepBar"] = false, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "current", + ["name_colored"] = true, + ["name_length"] = 21, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "[health:color][health:current]", + ["position"] = "INNERRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 11, + }, + ["power"] = + { + ["enable"] = true, + ["tags"] = "", + ["height"] = 10, + ["position"] = "INNERLEFT", + ["hideonnpc"] = false, + ["xOffset"] = 0, + ["yOffset"] = 0, + ["detachedWidth"] = 250, + ["attachTextToPower"] = false, + ["druidMana"] = true, + ["fontSize"] = 11, + }, + ["name"] = + { + ["position"] = "CENTER", + ["tags"] = "", + ["xOffset"] = 0, + ["yOffset"] = 0, + ["font"] = "SVUI Number Font", + ["fontSize"] = 13, + ["fontOutline"] = "OUTLINE", + }, + ["pvp"] = + { + ["font"] = "SVUI Number Font", + ["fontSize"] = 12, + ["fontOutline"] = "OUTLINE", + ["position"] = "BOTTOM", + ["tags"] = "||cFFB04F4F[pvptimer][mouseover]||r", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + ["portrait"] = + { + ["enable"] = true, + ["width"] = 50, + ["overlay"] = true, + ["camDistanceScale"] = 1.4, + ["rotation"] = 0, + ["style"] = "3D", + }, + ["buffs"] = + { + ["enable"] = false, + ["perrow"] = 8, + ["numrows"] = 1, + ["attachTo"] = "DEBUFFS", + ["anchorPoint"] = "TOPLEFT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = true, + ["filterRaid"] = true, + ["filterBlocked"] = true, + ["filterAllowed"] = true, + ["filterInfinite"] = true, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = 8, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = true, + ["perrow"] = 8, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "TOPLEFT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = false, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = false, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = 8, + ["sizeOverride"] = 0, + }, + ["aurabar"] = + { + ["enable"] = false, + ["anchorPoint"] = "ABOVE", + ["attachTo"] = "DEBUFFS", + ["filterPlayer"] = true, + ["filterRaid"] = true, + ["filterBlocked"] = true, + ["filterAllowed"] = true, + ["filterInfinite"] = true, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["friendlyAuraType"] = "HELPFUL", + ["enemyAuraType"] = "HARMFUL", + ["height"] = 18, + ["sort"] = "TIME_REMAINING", + }, + ["castbar"] = + { + ["enable"] = true, + ["width"] = 215, + ["height"] = 20, + ["matchFrameWidth"] = true, + ["icon"] = true, + ["latency"] = false, + ["format"] = "REMAINING", + ["ticks"] = false, + ["spark"] = true, + ["displayTarget"] = false, + ["useCustomColor"] = false, + ["castingColor"] = {0.8, 0.8, 0}, + ["sparkColor"] = {1, 0.72, 0}, + }, + ["classbar"] = + { + ["enable"] = true, + ["slideLeft"] = true, + ["inset"] = "inset", + ["height"] = 25, + ["detachFromFrame"] = false, + }, + ["icons"] = + { + ["raidicon"] = + { + ["enable"] = true, + ["size"] = 25, + ["attachTo"] = "INNERBOTTOMRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + ["combatIcon"] = { + ["enable"] = true, + ["size"] = 26, + ["attachTo"] = "INNERTOPRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + ["restIcon"] = { + ["enable"] = true, + ["size"] = 25, + ["attachTo"] = "INNERTOPRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + ["stagger"] = + { + ["enable"] = true, + }, + }, + ["target"] = { + ["enable"] = true, + ["width"] = 215, + ["height"] = 60, + ["threatEnabled"] = true, + ["rangeCheck"] = true, + ["predict"] = false, + ["smartAuraDisplay"] = "DISABLED", + ["middleClickFocus"] = true, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "current", + ["name_colored"] = true, + ["name_length"] = 18, + ["smartlevel"] = true, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "[health:color][health:current]", + ["position"] = "INNERLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + ["reversed"] = true, + ["fontSize"] = 11, + }, + ["power"] = + { + ["enable"] = true, + ["tags"] = "[power:color][power:current]", + ["height"] = 10, + ["position"] = "INNERRIGHT", + ["hideonnpc"] = true, + ["xOffset"] = 0, + ["yOffset"] = 0, + ["attachTextToPower"] = false, + ["fontSize"] = 11, + }, + ["name"] = + { + ["position"] = "INNERRIGHT", + ["tags"] = "[name:color][name:18][smartlevel]", + ["xOffset"] = -2, + ["yOffset"] = 36, + ["font"] = "SVUI Name Font", + ["fontSize"] = 15, + ["fontOutline"] = "NONE", + }, + ["portrait"] = + { + ["enable"] = true, + ["width"] = 50, + ["overlay"] = true, + ["rotation"] = 0, + ["camDistanceScale"] = 1.4, + ["style"] = "3D", + }, + ["buffs"] = + { + ["enable"] = true, + ["perrow"] = 8, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "TOPRIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "LEFT", + ["filterPlayer"] = + { + friendly = false, + enemy = false, + }, + ["filterRaid"] = + { + friendly = false, + enemy = false, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = false, + enemy = false, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = 8, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = true, + ["perrow"] = 8, + ["numrows"] = 1, + ["attachTo"] = "BUFFS", + ["anchorPoint"] = "TOPRIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "LEFT", + ["filterPlayer"] = + { + friendly = false, + enemy = true, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = false, + enemy = false, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = 8, + ["sizeOverride"] = 0, + }, + ["aurabar"] = + { + ["enable"] = false, + ["anchorPoint"] = "ABOVE", + ["attachTo"] = "DEBUFFS", + ["filterPlayer"] = + { + friendly = true, + enemy = true, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = true, + enemy = true, + }, + ["filterRaid"] = + { + friendly = true, + enemy = true, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "", + ["friendlyAuraType"] = "HELPFUL", + ["enemyAuraType"] = "HARMFUL", + ["height"] = 18, + ["sort"] = "TIME_REMAINING", + }, + ["castbar"] = + { + ["enable"] = true, + ["width"] = 215, + ["height"] = 20, + ["matchFrameWidth"] = true, + ["icon"] = true, + ["format"] = "REMAINING", + ["spark"] = true, + ["useCustomColor"] = false, + ["castingColor"] = {0.8, 0.8, 0}, + ["sparkColor"] = {1, 0.72, 0}, + }, + ["combobar"] = + { + ["enable"] = true, + ["height"] = 30, + ["smallIcons"] = false, + ["hudStyle"] = false, + ["hudScale"] = 64, + ["autoHide"] = true, + }, + ["icons"] = + { + ["raidicon"] = + { + ["enable"] = true, + ["size"] = 30, + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + } + }, + }, + ["targettarget"] = { + ["enable"] = true, + ["rangeCheck"] = true, + ["threatEnabled"] = false, + ["width"] = 150, + ["height"] = 30, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "none", + ["name_colored"] = true, + ["name_length"] = 10, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "", + ["position"] = "INNERRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 9, + }, + ["power"] = + { + ["enable"] = false, + ["tags"] = "", + ["height"] = 7, + ["position"] = "INNERLEFT", + ["hideonnpc"] = false, + ["xOffset"] = 0, + ["yOffset"] = 0, + ["fontSize"] = 9, + }, + ["name"] = + { + ["position"] = "CENTER", + ["tags"] = "[name:color][name:10]", + ["xOffset"] = 0, + ["yOffset"] = 1, + ["font"] = "SVUI Narrator Font", + ["fontSize"] = 14, + ["fontOutline"] = "OUTLINE", + }, + ["portrait"] = + { + ["enable"] = true, + ["width"] = 45, + ["overlay"] = true, + ["rotation"] = 0, + ["camDistanceScale"] = 1, + ["style"] = "3D", + }, + ["buffs"] = + { + ["enable"] = false, + ["perrow"] = 7, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "BOTTOMLEFT", + ["verticalGrowth"] = "DOWN", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = + { + friendly = true, + enemy = false, + }, + ["filterRaid"] = + { + friendly = true, + enemy = false, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = true, + enemy = false, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = -8, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = false, + ["perrow"] = 5, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "TOPLEFT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = + { + friendly = false, + enemy = true, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = false, + enemy = false, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = 8, + ["sizeOverride"] = 0, + }, + ["icons"] = + { + ["raidicon"] = + { + ["enable"] = true, + ["size"] = 18, + ["attachTo"] = "INNERRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + }, + ["focus"] = { + ["enable"] = true, + ["rangeCheck"] = true, + ["threatEnabled"] = true, + ["width"] = 170, + ["height"] = 30, + ["predict"] = false, + ["smartAuraDisplay"] = "DISABLED", + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "none", + ["name_colored"] = true, + ["name_length"] = 15, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "", + ["position"] = "INNERRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 10, + }, + ["power"] = + { + ["enable"] = true, + ["tags"] = "", + ["height"] = 7, + ["position"] = "INNERLEFT", + ["hideonnpc"] = false, + ["xOffset"] = 0, + ["yOffset"] = 0, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "CENTER", + ["tags"] = "[name:color][name:15]", + ["xOffset"] = 0, + ["yOffset"] = 0, + ["font"] = "SVUI Narrator Font", + ["fontSize"] = 14, + ["fontOutline"] = "OUTLINE", + }, + ["buffs"] = + { + ["enable"] = false, + ["perrow"] = 7, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "BOTTOMRIGHT", + ["verticalGrowth"] = "DOWN", + ["horizontalGrowth"] = "LEFT", + ["filterPlayer"] = + { + friendly = true, + enemy = false, + }, + ["filterRaid"] = + { + friendly = true, + enemy = false, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = true, + enemy = false, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = -8, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = true, + ["perrow"] = 5, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "TOPRIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "LEFT", + ["filterPlayer"] = + { + friendly = false, + enemy = true, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = false, + enemy = false, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = 8, + ["sizeOverride"] = 0, + }, + ["castbar"] = + { + ["enable"] = true, + ["width"] = 170, + ["height"] = 18, + ["icon"] = true, + ["matchFrameWidth"] = true, + ["format"] = "REMAINING", + ["spark"] = true, + ["useCustomColor"] = false, + ["castingColor"] = {0.8, 0.8, 0}, + ["sparkColor"] = {1, 0.72, 0}, + }, + ["aurabar"] = + { + ["enable"] = false, + ["anchorPoint"] = "ABOVE", + ["attachTo"] = "FRAME", + ["filterPlayer"] = + { + friendly = false, + enemy = true, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = false, + enemy = false, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["filterRaid"] = + { + friendly = true, + enemy = true, + }, + ["useFilter"] = "", + ["friendlyAuraType"] = "HELPFUL", + ["enemyAuraType"] = "HARMFUL", + ["height"] = 18, + ["sort"] = "TIME_REMAINING", + }, + ["icons"] = + { + ["raidicon"] = + { + ["enable"] = true, + ["size"] = 18, + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + }, + ["focustarget"] = { + ["enable"] = false, + ["rangeCheck"] = true, + ["threatEnabled"] = false, + ["width"] = 150, + ["height"] = 26, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "none", + ["name_colored"] = true, + ["name_length"] = 15, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "", + ["position"] = "INNERRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 10, + }, + ["power"] = + { + ["enable"] = false, + ["tags"] = "", + ["height"] = 7, + ["position"] = "INNERLEFT", + ["hideonnpc"] = false, + ["xOffset"] = 0, + ["yOffset"] = 0, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "CENTER", + ["tags"] = "[name:color][name:15]", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["font"] = "SVUI Narrator Font", + ["fontSize"] = 14, + ["fontOutline"] = "OUTLINE", + }, + ["buffs"] = + { + ["enable"] = false, + ["perrow"] = 7, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "BOTTOMLEFT", + ["verticalGrowth"] = "DOWN", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = + { + friendly = true, + enemy = false, + }, + ["filterRaid"] = + { + friendly = true, + enemy = false, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = true, + enemy = false, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = -8, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = false, + ["perrow"] = 5, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "TOPLEFT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = + { + friendly = false, + enemy = true, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = false, + enemy = false, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = 8, + ["sizeOverride"] = 0, + }, + ["icons"] = + { + ["raidicon"] = + { + ["enable"] = true, + ["size"] = 18, + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + }, + ["pet"] = { + ["enable"] = true, + ["rangeCheck"] = true, + ["threatEnabled"] = true, + ["width"] = 150, + ["height"] = 30, + ["predict"] = false, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "none", + ["name_colored"] = true, + ["name_length"] = 10, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "", + ["position"] = "INNERRIGHT", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 10, + }, + ["power"] = + { + ["enable"] = false, + ["tags"] = "", + ["height"] = 7, + ["position"] = "INNERLEFT", + ["hideonnpc"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "CENTER", + ["tags"] = "[name:color][name:8]", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["font"] = "SVUI Narrator Font", + ["fontSize"] = 14, + ["fontOutline"] = "OUTLINE", + }, + ["portrait"] = + { + ["enable"] = true, + ["width"] = 45, + ["overlay"] = true, + ["rotation"] = 0, + ["camDistanceScale"] = 1, + ["style"] = "3D", + }, + ["buffs"] = + { + ["enable"] = true, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "LEFT", + ["verticalGrowth"] = "DOWN", + ["horizontalGrowth"] = "LEFT", + ["filterPlayer"] = true, + ["filterRaid"] = true, + ["filterBlocked"] = true, + ["filterAllowed"] = true, + ["filterInfinite"] = true, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = -3, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = true, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "RIGHT", + ["verticalGrowth"] = "DOWN", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = false, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = false, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 3, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["castbar"] = + { + ["enable"] = true, + ["width"] = 130, + ["height"] = 8, + ["icon"] = false, + ["matchFrameWidth"] = true, + ["format"] = "REMAINING", + ["spark"] = false, + ["useCustomColor"] = false, + ["castingColor"] = {0.8, 0.8, 0}, + ["sparkColor"] = {1, 0.72, 0}, + }, + ["auraWatch"] = + { + ["enable"] = true, + ["size"] = 8, + }, + }, + ["pettarget"] = { + ["enable"] = false, + ["rangeCheck"] = true, + ["threatEnabled"] = false, + ["width"] = 130, + ["height"] = 26, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "none", + ["name_colored"] = true, + ["name_length"] = 15, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "", + ["position"] = "INNERRIGHT", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 10, + }, + ["power"] = + { + ["enable"] = false, + ["tags"] = "", + ["height"] = 7, + ["position"] = "INNERLEFT", + ["hideonnpc"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "CENTER", + ["tags"] = "[name:color][name:15]", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["font"] = "SVUI Narrator Font", + ["fontSize"] = 14, + ["fontOutline"] = "OUTLINE", + }, + ["buffs"] = + { + ["enable"] = false, + ["perrow"] = 7, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "BOTTOMLEFT", + ["verticalGrowth"] = "DOWN", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = + { + friendly = true, + enemy = false, + }, + ["filterRaid"] = + { + friendly = true, + enemy = false, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = true, + enemy = false, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = -8, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = false, + ["perrow"] = 5, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "BOTTOMRIGHT", + ["verticalGrowth"] = "DOWN", + ["horizontalGrowth"] = "LEFT", + ["filterPlayer"] = + { + friendly = false, + enemy = true, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = false, + enemy = false, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = 8, + ["sizeOverride"] = 0, + }, + }, + ["boss"] = { + ["enable"] = true, + ["rangeCheck"] = true, + ["showBy"] = "UP", + ["width"] = 200, + ["height"] = 45, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "current", + ["name_colored"] = true, + ["name_length"] = 15, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "[health:color][health:current]", + ["position"] = "INNERTOPRIGHT", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["reversed"] = true, + ["fontSize"] = 10, + }, + ["power"] = + { + ["enable"] = true, + ["tags"] = "[power:color][power:current]", + ["height"] = 7, + ["position"] = "INNERBOTTOMRIGHT", + ["hideonnpc"] = false, + ["yOffset"] = 7, + ["xOffset"] = 0, + ["fontSize"] = 10, + }, + ["portrait"] = + { + ["enable"] = true, + ["width"] = 35, + ["overlay"] = true, + ["rotation"] = 0, + ["camDistanceScale"] = 1, + ["style"] = "3D", + }, + ["name"] = + { + ["position"] = "INNERLEFT", + ["tags"] = "[name:color][name:15]", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["font"] = "SVUI Number Font", + ["fontSize"] = 12, + ["fontOutline"] = "OUTLINE", + }, + ["buffs"] = + { + ["enable"] = true, + ["perrow"] = 2, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "LEFT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "LEFT", + ["filterPlayer"] = false, + ["filterRaid"] = false, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = false, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = -8, + ["yOffset"] = 0, + ["sizeOverride"] = 40, + }, + ["debuffs"] = + { + ["enable"] = true, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "BUFFS", + ["anchorPoint"] = "LEFT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "LEFT", + ["filterPlayer"] = true, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = false, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = -8, + ["yOffset"] = 0, + ["sizeOverride"] = 40, + }, + ["castbar"] = + { + ["enable"] = true, + ["width"] = 200, + ["height"] = 18, + ["icon"] = true, + ["matchFrameWidth"] = true, + ["format"] = "REMAINING", + ["spark"] = true, + ["useCustomColor"] = false, + ["castingColor"] = {0.8, 0.8, 0}, + ["sparkColor"] = {1, 0.72, 0}, + }, + ["icons"] = + { + ["raidicon"] = + { + ["enable"] = true, + ["size"] = 22, + ["attachTo"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + }, + ["arena"] = { + ["enable"] = true, + ["rangeCheck"] = true, + ["showBy"] = "UP", + ["width"] = 215, + ["height"] = 45, + ["predict"] = false, + ["colorOverride"] = "USE_DEFAULT", + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "current", + ["name_colored"] = true, + ["name_length"] = 15, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "[health:color][health:current]", + ["position"] = "INNERTOPRIGHT", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["reversed"] = true, + ["fontSize"] = 10, + }, + ["power"] = + { + ["enable"] = true, + ["tags"] = "[power:color][power:current]", + ["height"] = 7, + ["position"] = "INNERBOTTOMRIGHT", + ["hideonnpc"] = false, + ["yOffset"] = 7, + ["xOffset"] = 0, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "INNERLEFT", + ["tags"] = "[name:color][name:15]", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["font"] = "SVUI Number Font", + ["fontSize"] = 12, + ["fontOutline"] = "OUTLINE", + }, + ["portrait"] = + { + ["enable"] = true, + ["width"] = 45, + ["overlay"] = true, + ["rotation"] = 0, + ["camDistanceScale"] = 1, + ["style"] = "3D", + }, + ["buffs"] = + { + ["enable"] = true, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "LEFT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "LEFT", + ["filterPlayer"] = + { + friendly = false, + enemy = false, + }, + ["filterRaid"] = + { + friendly = false, + enemy = false, + }, + ["filterBlocked"] = + { + friendly = false, + enemy = false, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "Shield", + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["xOffset"] = -8, + ["yOffset"] = 0, + ["sizeOverride"] = 40, + }, + ["debuffs"] = + { + ["enable"] = true, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "BUFFS", + ["anchorPoint"] = "LEFT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "LEFT", + ["filterPlayer"] = + { + friendly = false, + enemy = false, + }, + ["filterBlocked"] = + { + friendly = false, + enemy = false, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "CC", + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["xOffset"] = -8, + ["yOffset"] = 0, + ["sizeOverride"] = 40, + }, + ["castbar"] = + { + ["enable"] = true, + ["width"] = 215, + ["height"] = 18, + ["icon"] = true, + ["matchFrameWidth"] = true, + ["format"] = "REMAINING", + ["spark"] = true, + ["useCustomColor"] = false, + ["castingColor"] = {0.8, 0.8, 0}, + ["sparkColor"] = {1, 0.72, 0}, + }, + ["pvp"] = + { + ["enable"] = true, + ["trinketPosition"] = "LEFT", + ["trinketSize"] = 45, + ["trinketX"] = -2, + ["trinketY"] = 0, + ["specPosition"] = "RIGHT", + ["specSize"] = 45, + ["specX"] = 2, + ["specY"] = 0, + }, + }, + ["party"] = { + ["enable"] = true, + ["rangeCheck"] = true, + ["threatEnabled"] = true, + ["visibility"] = "[@raid6, exists][nogroup] hide;show", + ["showBy"] = "UP_RIGHT", + ["wrapXOffset"] = 9, + ["wrapYOffset"] = 13, + ["groupCount"] = 1, + ["gRowCol"] = 1, + ["customSorting"] = false, + ["sortMethod"] = "GROUP", + ["sortDir"] = "ASC", + ["invertGroupingOrder"] = false, + ["startFromCenter"] = false, + ["showPlayer"] = true, + ["predict"] = false, + ["colorOverride"] = "USE_DEFAULT", + ["width"] = 70, + ["height"] = 70, + ["gridAllowed"] = true, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "none", + ["name_colored"] = true, + ["name_length"] = 10, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "", + ["position"] = "BOTTOM", + ["orientation"] = "HORIZONTAL", + ["frequentUpdates"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 10, + }, + ["power"] = + { + ["enable"] = true, + ["tags"] = "", + ["frequentUpdates"] = false, + ["height"] = 7, + ["position"] = "BOTTOMRIGHT", + ["hideonnpc"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "INNERTOPLEFT", + ["tags"] = "[name:color][name:10]", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["font"] = "SVUI Narrator Font", + ["fontSize"] = 13, + ["fontOutline"] = "OUTLINE", + }, + ["buffs"] = + { + ["enable"] = false, + ["perrow"] = 2, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "RIGHTTOP", + ["verticalGrowth"] = "DOWN", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = true, + ["filterRaid"] = true, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = true, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 8, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = true, + ["perrow"] = 2, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "RIGHTTOP", + ["verticalGrowth"] = "DOWN", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = false, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = false, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 8, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["auraWatch"] = + { + ["enable"] = true, + ["size"] = 8, + ["fontSize"] = 11, + }, + ["petsGroup"] = + { + ["enable"] = false, + ["width"] = 30, + ["height"] = 30, + ["gridAllowed"] = true, + ["anchorPoint"] = "BOTTOMLEFT", + ["xOffset"] = - 1, + ["yOffset"] = 0, + ["name_length"] = 3, + ["tags"] = "[name:3]", + }, + ["targetsGroup"] = + { + ["enable"] = false, + ["width"] = 30, + ["height"] = 30, + ["gridAllowed"] = true, + ["anchorPoint"] = "TOPLEFT", + ["xOffset"] = - 1, + ["yOffset"] = 0, + ["name_length"] = 3, + ["tags"] = "[name:3]", + }, + ["icons"] = + { + ["raidicon"] = + { + ["enable"] = true, + ["size"] = 25, + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + ["roleIcon"] = + { + ["enable"] = true, + ["size"] = 18, + ["attachTo"] = "INNERBOTTOMRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + ["raidRoleIcons"] = + { + ["enable"] = true, + ["size"] = 18, + ["attachTo"] = "TOPLEFT", + ["xOffset"] = 0, + ["yOffset"] = -4, + }, + }, + ["portrait"] = + { + ["enable"] = true, + ["width"] = 45, + ["overlay"] = true, + ["rotation"] = 0, + ["camDistanceScale"] = 1, + ["style"] = "3D", + }, + }, + ["raid10"] = { + ["enable"] = true, + ["rangeCheck"] = true, + ["threatEnabled"] = true, + ["visibility"] = "[@raid6, noexists][@raid11, exists][nogroup] hide;show", + ["showBy"] = "RIGHT_DOWN", + ["wrapXOffset"] = 8, + ["wrapYOffset"] = 8, + ["groupCount"] = 2, + ["gRowCol"] = 1, + ["customSorting"] = false, + ["sortMethod"] = "GROUP", + ["sortDir"] = "ASC", + ["showPlayer"] = true, + ["predict"] = false, + ["colorOverride"] = "USE_DEFAULT", + ["width"] = 75, + ["height"] = 34, + ["gridAllowed"] = true, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "none", + ["name_colored"] = true, + ["name_length"] = 4, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "", + ["position"] = "BOTTOM", + ["orientation"] = "HORIZONTAL", + ["frequentUpdates"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 10, + }, + ["power"] = + { + ["enable"] = true, + ["tags"] = "", + ["frequentUpdates"] = false, + ["height"] = 4, + ["position"] = "BOTTOMRIGHT", + ["hideonnpc"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "INNERTOPLEFT", + ["tags"] = "[name:color][name:4]", + ["yOffset"] = 0, + ["xOffset"] = 8, + ["font"] = "SVUI Default Font", + ["fontSize"] = 10, + ["fontOutline"] = "OUTLINE", + }, + ["buffs"] = + { + ["enable"] = false, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "RIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = true, + ["filterRaid"] = true, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = true, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 8, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = false, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "RIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = false, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = false, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 8, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["auraWatch"] = + { + ["enable"] = true, + ["size"] = 8, + }, + ["rdebuffs"] = + { + ["enable"] = true, + ["size"] = 26, + ["xOffset"] = 0, + ["yOffset"] = 2, + }, + ["icons"] = + { + ["raidicon"] = + { + ["enable"] = true, + ["size"] = 15, + ["attachTo"] = "INNERBOTTOMRIGHT", + ["xOffset"] = -8, + ["yOffset"] = 0, + }, + ["roleIcon"] = + { + ["enable"] = true, + ["size"] = 12, + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + ["raidRoleIcons"] = + { + ["enable"] = true, + ["size"] = 18, + ["attachTo"] = "TOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = -4, + }, + }, + }, + ["raid25"] = { + ["enable"] = true, + ["rangeCheck"] = true, + ["threatEnabled"] = true, + ["visibility"] = "[@raid6, noexists][@raid11, noexists][@raid26, exists][nogroup] hide;show", + ["showBy"] = "RIGHT_DOWN", + ["wrapXOffset"] = 8, + ["wrapYOffset"] = 8, + ["groupCount"] = 5, + ["gRowCol"] = 1, + ["customSorting"] = false, + ["sortMethod"] = "GROUP", + ["sortDir"] = "ASC", + ["showPlayer"] = true, + ["predict"] = false, + ["colorOverride"] = "USE_DEFAULT", + ["width"] = 50, + ["height"] = 30, + ["gridAllowed"] = true, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "none", + ["name_colored"] = true, + ["name_length"] = 4, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "", + ["position"] = "BOTTOM", + ["orientation"] = "HORIZONTAL", + ["frequentUpdates"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 10, + }, + ["power"] = + { + ["enable"] = true, + ["tags"] = "", + ["height"] = 4, + ["position"] = "BOTTOMRIGHT", + ["hideonnpc"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "INNERTOPLEFT", + ["tags"] = "[name:color][name:4]", + ["yOffset"] = 0, + ["xOffset"] = 8, + ["font"] = "SVUI Default Font", + ["fontSize"] = 10, + ["fontOutline"] = "OUTLINE", + }, + ["buffs"] = + { + ["enable"] = false, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "RIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = true, + ["filterRaid"] = true, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = true, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 8, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = false, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "RIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = false, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = false, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 8, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["auraWatch"] = + { + ["enable"] = true, + ["size"] = 8, + }, + ["rdebuffs"] = + { + ["enable"] = true, + ["size"] = 26, + ["xOffset"] = 0, + ["yOffset"] = 2, + }, + ["icons"] = + { + ["raidicon"] = + { + ["enable"] = true, + ["size"] = 15, + ["attachTo"] = "INNERBOTTOMRIGHT", + ["xOffset"] = -8, + ["yOffset"] = 0, + }, + ["roleIcon"] = + { + ["enable"] = true, + ["size"] = 12, + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + ["raidRoleIcons"] = + { + ["enable"] = true, + ["size"] = 18, + ["attachTo"] = "TOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = -4, + }, + }, + }, + ["raid40"] = { + ["enable"] = true, + ["rangeCheck"] = true, + ["threatEnabled"] = true, + ["visibility"] = "[@raid6, noexists][@raid11, noexists][@raid26, noexists][nogroup] hide;show", + ["showBy"] = "RIGHT_DOWN", + ["wrapXOffset"] = 8, + ["wrapYOffset"] = 8, + ["groupCount"] = 8, + ["gRowCol"] = 1, + ["customSorting"] = false, + ["sortMethod"] = "GROUP", + ["sortDir"] = "ASC", + ["showPlayer"] = true, + ["predict"] = false, + ["colorOverride"] = "USE_DEFAULT", + ["width"] = 50, + ["height"] = 30, + ["gridAllowed"] = true, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "none", + ["name_colored"] = true, + ["name_length"] = 4, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "", + ["position"] = "BOTTOM", + ["orientation"] = "HORIZONTAL", + ["frequentUpdates"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 10, + }, + ["power"] = + { + ["enable"] = false, + ["tags"] = "", + ["frequentUpdates"] = false, + ["height"] = 4, + ["position"] = "BOTTOMRIGHT", + ["hideonnpc"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "INNERTOPLEFT", + ["tags"] = "[name:color][name:4]", + ["yOffset"] = 0, + ["xOffset"] = 8, + ["font"] = "SVUI Default Font", + ["fontSize"] = 10, + ["fontOutline"] = "OUTLINE", + }, + ["buffs"] = + { + ["enable"] = false, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "RIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = true, + ["filterRaid"] = true, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = true, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 8, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = false, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "RIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = false, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = false, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 8, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["rdebuffs"] = + { + ["enable"] = true, + ["size"] = 22, + ["xOffset"] = 0, + ["yOffset"] = 2, + }, + ["auraWatch"] = + { + ["enable"] = true, + ["size"] = 8, + }, + ["icons"] = + { + ["raidicon"] = + { + ["enable"] = true, + ["size"] = 15, + ["attachTo"] = "INNERBOTTOMRIGHT", + ["xOffset"] = -8, + ["yOffset"] = 0, + }, + ["roleIcon"] = + { + ["enable"] = true, + ["size"] = 12, + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + ["raidRoleIcons"] = + { + ["enable"] = true, + ["size"] = 18, + ["attachTo"] = "TOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = -4, + }, + }, + }, + ["raidpet"] = { + ["enable"] = false, + ["rangeCheck"] = true, + ["threatEnabled"] = true, + ["visibility"] = "[group:raid] show; hide", + ["showBy"] = "DOWN_RIGHT", + ["wrapXOffset"] = 3, + ["wrapYOffset"] = 3, + ["groupCount"] = 2, + ["gRowCol"] = 1, + ["customSorting"] = true, + ["sortMethod"] = "PETNAME", + ["sortDir"] = "ASC", + ["invertGroupingOrder"] = false, + ["startFromCenter"] = false, + ["predict"] = false, + ["colorOverride"] = "USE_DEFAULT", + ["width"] = 80, + ["height"] = 30, + ["gridAllowed"] = true, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "deficit", + ["name_colored"] = true, + ["name_length"] = 4, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "[health:color][health:deficit]", + ["position"] = "BOTTOM", + ["orientation"] = "HORIZONTAL", + ["frequentUpdates"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "INNERTOPLEFT", + ["tags"] = "[name:color][name:4]", + ["yOffset"] = 4, + ["xOffset"] = -4, + ["font"] = "SVUI Default Font", + ["fontSize"] = 10, + ["fontOutline"] = "OUTLINE", + }, + ["buffs"] = + { + ["enable"] = false, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "RIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = true, + ["filterRaid"] = true, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = true, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 8, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = false, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "RIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = false, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = false, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 8, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["auraWatch"] = + { + ["enable"] = true, + ["size"] = 8, + }, + ["rdebuffs"] = + { + ["enable"] = true, + ["size"] = 26, + ["xOffset"] = 0, + ["yOffset"] = 2, + }, + ["icons"] = + { + ["raidicon"] = + { + ["enable"] = true, + ["size"] = 18, + ["attachTo"] = "INNERTOPLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + }, + ["tank"] = { + ["enable"] = true, + ["threatEnabled"] = true, + ["rangeCheck"] = true, + ["width"] = 120, + ["height"] = 28, + ["gridAllowed"] = true, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "deficit", + ["name_colored"] = true, + ["name_length"] = 8, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "[health:color][health:deficit]", + ["position"] = "INNERRIGHT", + ["orientation"] = "HORIZONTAL", + ["frequentUpdates"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "INNERLEFT", + ["tags"] = "[name:color][name:8]", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["font"] = "SVUI Default Font", + ["fontSize"] = 10, + ["fontOutline"] = "OUTLINE", + }, + ["targetsGroup"] = + { + ["enable"] = false, + ["anchorPoint"] = "RIGHT", + ["xOffset"] = 1, + ["yOffset"] = 0, + ["width"] = 120, + ["height"] = 28, + }, + }, + ["assist"] = { + ["enable"] = true, + ["threatEnabled"] = true, + ["rangeCheck"] = true, + ["width"] = 120, + ["height"] = 28, + ["gridAllowed"] = true, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "deficit", + ["name_colored"] = true, + ["name_length"] = 8, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "[health:color][health:deficit]", + ["position"] = "INNERRIGHT", + ["orientation"] = "HORIZONTAL", + ["frequentUpdates"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "INNERLEFT", + ["tags"] = "[name:color][name:8]", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["font"] = "SVUI Default Font", + ["fontSize"] = 10, + ["fontOutline"] = "OUTLINE", + }, + ["targetsGroup"] = + { + ["enable"] = false, + ["anchorPoint"] = "RIGHT", + ["xOffset"] = 1, + ["yOffset"] = 0, + ["width"] = 120, + ["height"] = 28, + }, + } +} + +--[[ CACHE DATA ]]-- + +local BUFFWATCH_BY_CLASS = { + PRIEST = { + {-- Weakened Soul + ["enabled"] = true, + ["id"] = 6788, + ["point"] = "TOPRIGHT", + ["color"] = {["r"] = 1, ["g"] = 0, ["b"] = 0}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Prayer of Mending + ["enabled"] = true, + ["id"] = 41635, + ["point"] = "BOTTOMRIGHT", + ["color"] = {["r"] = 0.2, ["g"] = 0.7, ["b"] = 0.2}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Renew + ["enabled"] = true, + ["id"] = 139, + ["point"] = "BOTTOMLEFT", + ["color"] = {["r"] = 0.4, ["g"] = 0.7, ["b"] = 0.2}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Power Word: Shield + ["enabled"] = true, + ["id"] = 17, + ["point"] = "TOPLEFT", + ["color"] = {["r"] = 0.81, ["g"] = 0.85, ["b"] = 0.1}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Power Word: Shield Power Insight + ["enabled"] = true, + ["id"] = 123258, + ["point"] = "TOPLEFT", + ["color"] = {["r"] = 0.81, ["g"] = 0.85, ["b"] = 0.1}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Power Infusion + ["enabled"] = true, + ["id"] = 10060, + ["point"] = "RIGHT", + ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Guardian Spirit + ["enabled"] = true, + ["id"] = 47788, + ["point"] = "LEFT", + ["color"] = {["r"] = 0.86, ["g"] = 0.44, ["b"] = 0}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Pain Suppression + ["enabled"] = true, + ["id"] = 33206, + ["point"] = "LEFT", + ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + }, + DRUID = { + {-- Rejuvenation + ["enabled"] = true, + ["id"] = 774, + ["point"] = "TOPRIGHT", + ["color"] = {["r"] = 0.8, ["g"] = 0.4, ["b"] = 0.8}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Regrowth + ["enabled"] = true, + ["id"] = 8936, + ["point"] = "BOTTOMLEFT", + ["color"] = {["r"] = 0.2, ["g"] = 0.8, ["b"] = 0.2}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Lifebloom + ["enabled"] = true, + ["id"] = 33763, + ["point"] = "TOPLEFT", + ["color"] = {["r"] = 0.4, ["g"] = 0.8, ["b"] = 0.2}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Wild Growth + ["enabled"] = true, + ["id"] = 48438, + ["point"] = "BOTTOMRIGHT", + ["color"] = {["r"] = 0.8, ["g"] = 0.4, ["b"] = 0}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + }, + PALADIN = { + {-- Beacon of Light + ["enabled"] = true, + ["id"] = 53563, + ["point"] = "TOPRIGHT", + ["color"] = {["r"] = 0.7, ["g"] = 0.3, ["b"] = 0.7}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Hand of Protection + ["enabled"] = true, + ["id"] = 1022, + ["point"] = "BOTTOMRIGHT", + ["color"] = {["r"] = 0.2, ["g"] = 0.2, ["b"] = 1}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Hand of Freedom + ["enabled"] = true, + ["id"] = 1044, + ["point"] = "BOTTOMRIGHT", + ["color"] = {["r"] = 0.89, ["g"] = 0.45, ["b"] = 0}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Hand of Salvation + ["enabled"] = true, + ["id"] = 1038, + ["point"] = "BOTTOMRIGHT", + ["color"] = {["r"] = 0.93, ["g"] = 0.75, ["b"] = 0}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Hand of Sacrifice + ["enabled"] = true, + ["id"] = 6940, + ["point"] = "BOTTOMRIGHT", + ["color"] = {["r"] = 0.89, ["g"] = 0.1, ["b"] = 0.1}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Hand of Purity + ["enabled"] = true, + ["id"] = 114039, + ["point"] = "BOTTOMRIGHT", + ["color"] = {["r"] = 0.64, ["g"] = 0.41, ["b"] = 0.72}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Sacred Shield + ["enabled"] = true, + ["id"] = 20925, + ["point"] = "TOPLEFT", + ["color"] = {["r"] = 0.93, ["g"] = 0.75, ["b"] = 0}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Eternal Flame + ["enabled"] = true, + ["id"] = 114163, + ["point"] = "BOTTOMLEFT", + ["color"] = {["r"] = 0.87, ["g"] = 0.7, ["b"] = 0.03}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + }, + SHAMAN = { + {-- Riptide + ["enabled"] = true, + ["id"] = 61295, + ["point"] = "TOPRIGHT", + ["color"] = {["r"] = 0.7, ["g"] = 0.3, ["b"] = 0.7}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Earth Shield + ["enabled"] = true, + ["id"] = 974, + ["point"] = "BOTTOMLEFT", + ["color"] = {["r"] = 0.2, ["g"] = 0.7, ["b"] = 0.2}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Earthliving + ["enabled"] = true, + ["id"] = 51945, + ["point"] = "BOTTOMRIGHT", + ["color"] = {["r"] = 0.7, ["g"] = 0.4, ["b"] = 0.4}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + }, + MONK = { + {--Renewing Mist + ["enabled"] = true, + ["id"] = 119611, + ["point"] = "TOPLEFT", + ["color"] = {["r"] = 0.8, ["g"] = 0.4, ["b"] = 0.8}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Life Cocoon + ["enabled"] = true, + ["id"] = 116849, + ["point"] = "TOPRIGHT", + ["color"] = {["r"] = 0.2, ["g"] = 0.8, ["b"] = 0.2}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Enveloping Mist + ["enabled"] = true, + ["id"] = 132120, + ["point"] = "BOTTOMLEFT", + ["color"] = {["r"] = 0.4, ["g"] = 0.8, ["b"] = 0.2}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Zen Sphere + ["enabled"] = true, + ["id"] = 124081, + ["point"] = "BOTTOMRIGHT", + ["color"] = {["r"] = 0.7, ["g"] = 0.4, ["b"] = 0}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + }, + ROGUE = { + {-- Tricks of the Trade + ["enabled"] = true, + ["id"] = 57934, + ["point"] = "TOPRIGHT", + ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + }, + MAGE = { + {-- Ice Ward + ["enabled"] = true, + ["id"] = 111264, + ["point"] = "TOPLEFT", + ["color"] = {["r"] = 0.2, ["g"] = 0.2, ["b"] = 1}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + }, + WARRIOR = { + {-- Vigilance + ["enabled"] = true, + ["id"] = 114030, + ["point"] = "TOPLEFT", + ["color"] = {["r"] = 0.2, ["g"] = 0.2, ["b"] = 1}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Intervene + ["enabled"] = true, + ["id"] = 3411, + ["point"] = "TOPRIGHT", + ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Safe Guard + ["enabled"] = true, + ["id"] = 114029, + ["point"] = "TOPRIGHT", + ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + }, + DEATHKNIGHT = { + {-- Unholy Frenzy + ["enabled"] = true, + ["id"] = 49016, + ["point"] = "TOPRIGHT", + ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + }, + HUNTER = {}, + WARLOCK = {}, + NONE = {} +} + +local FilterIDs = { + ["Blocked"] = [[36900,36901,36893,114216,97821,36032,132365,8733,57724,25771,57723,36032,58539,26013,6788,71041,41425,55711,8326,23445,24755,25163,80354,95809,95223,124275,124274,124273,117870,123981,15007,113942,89140]], + ["Allowed"] = [[31821,2825,32182,80353,90355,47788,33206,116849,22812,1490,116202,123059,136431,137332,137375,144351,142863,142864,142865,143198]], + ["Strict"] = [[123059,136431,137332,137375,144351,142863,142864,142865,143198]], + ["CC"] = [[47476,91800,91807,91797,108194,115001,33786,2637,339,78675,22570,5211,9005,102359,99,127797,45334,102795,114238,113004,3355,1513,19503,34490,24394,64803,19386,117405,128405,50519,91644,90337,54706,4167,90327,56626,50245,50541,96201,96201,31661,118,55021,122,82691,118271,44572,33395,102051,20066,10326,853,105593,31935,105421,605,64044,8122,9484,15487,114404,88625,113792,87194,2094,1776,6770,1833,51722,1330,408,88611,115197,113953,51514,64695,63685,76780,118905,118345,710,6789,118699,5484,6358,30283,24259,115782,115268,118093,89766,137143,20511,7922,676,105771,107566,132168,107570,118895,18498,116706,117368,115078,122242,119392,119381,120086,116709,123407,140023,25046,20549,107079]], + ["Shield"] = [[17,47515,45243,45438,115610,48797,48792,49039,87256,55233,50461,33206,47788,62618,47585,104773,110913,108359,22812,102342,106922,61336,19263,53480,1966,31224,74001,5277,45182,98007,30823,108271,1022,6940,114039,31821,498,642,86659,31850,118038,55694,97463,12975,114029,871,114030,120954,131523,122783,122278,115213,116849,20594]], + ["Player"] = [[17,47515,45243,45438,45438,115610,110909,12051,12472,80353,12042,32612,110960,108839,111264,108843,48797,48792,49039,87256,49222,55233,50461,49016,51271,96268,33206,47788,62618,47585,6346,10060,114239,119032,27827,104773,110913,108359,113860,113861,113858,88448,22812,102342,106922,61336,117679,102543,102558,102560,16689,132158,106898,1850,106951,29166,52610,69369,112071,124974,19263,53480,51755,54216,34471,3045,3584,131894,90355,90361,31224,74001,5277,45182,51713,114018,2983,121471,11327,108212,57933,79140,13750,98007,30823,108271,16188,2825,79206,16191,8178,58875,108281,108271,16166,114896,1044,1022,1038,6940,114039,31821,498,642,86659,20925,31850,31884,53563,31842,54428,105809,85499,118038,55694,97463,12975,114029,871,114030,18499,1719,23920,114028,46924,3411,107574,120954,131523,122783,122278,115213,116849,125174,116841,20594,59545,20572,26297,68992]], + ["Raid"] = [[116281,116784,116417,116942,116161,117708,118303,118048,118135,117878,117949,116835,116778,116525,122761,122760,122740,123812,123180,123474,122835,123081,122125,121885,121949,117436,118091,117519,122752,123011,116161,123121,119985,119086,119775,122151,138349,137371,136767,137641,137359,137972,136903,136753,137633,137731,133767,133768,136050,138569,134691,137440,137408,137360,135000,143436,143579,147383,146124,144851,144358,144774,147207,144215,143990,144330,143494,142990,143919,143766,143773,146589,143777,143385,143974,145183]] +} + +local FilterOverrides = { + ["45438"] = 5, ["48797"] = 5, ["87256"] = 4, + ["33206"] = 3, ["47585"] = 5, ["22812"] = 2, + ["102342"] = 2, ["19263"] = 5, ["5277"] = 5, + ["1022"] = 5, ["31821"] = 3, ["498"] = 2, + ["642"] = 5, ["86659"] = 4, ["31850"] = 4, + ["118038"] = 5, ["114029"] = 2, ["871"] = 3, + ["120954"] = 2, ["131523"] = 5 +} + +SV.configs["filter"] = { + ["CC"] = {}, + ["Shield"] = {}, + ["Player"] = {}, + ["Blocked"] = {}, + ["Allowed"] = {}, + ["Strict"] = {}, + ["Raid"] = {}, + ["BuffWatch"] = BUFFWATCH_BY_CLASS[filterClass], + ["PetBuffWatch"] = { + {-- Frenzy + ["enabled"] = true, + ["id"] = 19615, + ["point"] = "TOPLEFT", + ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Mend Pet + ["enabled"] = true, + ["id"] = 136, + ["point"] = "TOPRIGHT", + ["color"] = {["r"] = 0.2, ["g"] = 0.8, ["b"] = 0.2}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + } +} + +for k, x in pairs(FilterIDs) do + local src = {}; + for id in x:gmatch("([^,]+)") do + if(id) then + local saved + local n = safename(id); + local p = FilterOverrides[tostring(id)] or 0; + if k == "Strict" then + saved = {['enable'] = true, ['spellID'] = id, ['priority'] = p} + else + saved = {['enable'] = true, ['priority'] = p} + end + src[n] = saved + end + end + SV.configs["filter"][k] = src +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/setup/installer.lua b/Interface/AddOns/SVUI/setup/installer.lua new file mode 100644 index 0000000..3ab0d4e --- /dev/null +++ b/Interface/AddOns/SVUI/setup/installer.lua @@ -0,0 +1,1136 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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 = select(2, ...) +local SVLib = LibSuperVillain; +local L = SV.L; +--[[ +########################################################## +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 PageData, OnClickData +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 +########################################################## +]]-- +SV.Setup = {}; +--[[ +########################################################## +LOCAL FUNCTIONS +########################################################## +]]-- +local function PlayThemeSong() + if(not musicIsPlaying) then + SetCVar("Sound_MusicVolume", 100) + SetCVar("Sound_EnableMusic", 1) + StopMusic() + PlayMusic([[Interface\AddOns\SVUI\assets\sounds\SuperVillain.mp3]]) + musicIsPlaying = true + end +end + +local function 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); + local anchors = SV.cache.Anchors + if not anchors then anchors = {} end + anchors.SVUI_SpecialAbility_MOVE = "BOTTOMSVUIParentBOTTOM0"..sph; + anchors.SVUI_ActionBar2_MOVE = "BOTTOMSVUI_ActionBar1TOP0"..(-bS); + anchors.SVUI_ActionBar3_MOVE = "BOTTOMLEFTSVUI_ActionBar1BOTTOMRIGHT40"; + anchors.SVUI_ActionBar5_MOVE = "BOTTOMRIGHTSVUI_ActionBar1BOTTOMLEFT-40"; + if bar2 then + anchors.SVUI_PetActionBar_MOVE = "BOTTOMLEFTSVUI_ActionBar2TOPLEFT04" + anchors.SVUI_StanceBar_MOVE = "BOTTOMRIGHTSVUI_ActionBar2TOPRIGHT04"; + else + anchors.SVUI_PetActionBar_MOVE = "BOTTOMLEFTSVUI_ActionBar1TOPLEFT04" + anchors.SVUI_StanceBar_MOVE = "BOTTOMRIGHTSVUI_ActionBar1TOPRIGHT04"; + end +end + +local function UFMoveBottomQuadrant(toggle) + local anchors = SV.cache.Anchors + if not toggle then + anchors.SVUI_Player_MOVE = "BOTTOMSVUIParentBOTTOM-278182" + anchors.SVUI_PlayerCastbar_MOVE = "BOTTOMSVUIParentBOTTOM-278122" + anchors.SVUI_Target_MOVE = "BOTTOMSVUIParentBOTTOM278182" + anchors.SVUI_TargetCastbar_MOVE = "BOTTOMSVUIParentBOTTOM278122" + anchors.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM0181" + anchors.SVUI_TargetTarget_MOVE = "BOTTOMSVUIParentBOTTOM0214" + anchors.SVUI_Focus_MOVE = "BOTTOMSVUIParentBOTTOM310432" + anchors.SVUI_ThreatBar_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-495182" + elseif toggle == "shift" then + anchors.SVUI_Player_MOVE = "BOTTOMSVUIParentBOTTOM-278210" + anchors.SVUI_PlayerCastbar_MOVE = "BOTTOMSVUIParentBOTTOM-278150" + anchors.SVUI_Target_MOVE = "BOTTOMSVUIParentBOTTOM278210" + anchors.SVUI_TargetCastbar_MOVE = "BOTTOMSVUIParentBOTTOM278150" + anchors.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM0209" + anchors.SVUI_TargetTarget_MOVE = "BOTTOMSVUIParentBOTTOM0242" + anchors.SVUI_Focus_MOVE = "BOTTOMSVUIParentBOTTOM310432" + anchors.SVUI_ThreatBar_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-495210" + else + local c = 136; + local d = 135; + local e = 80; + anchors.SVUI_Player_MOVE = "BOTTOMSVUIParentBOTTOM"..-c..""..d; + anchors.SVUI_PlayerCastbar_MOVE = "BOTTOMSVUIParentBOTTOM"..-c..""..(d-60); + anchors.SVUI_Target_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..d; + anchors.SVUI_TargetCastbar_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..(d-60); + anchors.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM"..-c..""..e; + anchors.SVUI_TargetTarget_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..e; + anchors.SVUI_Focus_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..(d + 150); + anchors.SVUI_ThreatBar_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-495"..d; + end +end + +local function UFMoveLeftQuadrant(toggle) + local anchors = SV.cache.Anchors + if not toggle then + anchors.SVUI_Assist_MOVE = "TOPLEFTSVUIParentTOPLEFT"..XOFF.."-250" + anchors.SVUI_Tank_MOVE = "TOPLEFTSVUIParentTOPLEFT"..XOFF.."-175" + anchors.SVUI_Raidpet_MOVE = "TOPLEFTSVUIParentTOPLEFT"..XOFF.."-325" + anchors.SVUI_Party_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" + anchors.SVUI_Raid10_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" + anchors.SVUI_Raid25_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" + anchors.SVUI_Raid40_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" + else + anchors.SVUI_Assist_MOVE = "TOPLEFTSVUIParentTOPLEFT4-250" + anchors.SVUI_Tank_MOVE = "TOPLEFTSVUIParentTOPLEFT4-175" + anchors.SVUI_Raidpet_MOVE = "TOPLEFTSVUIParentTOPLEFT4-325" + anchors.SVUI_Party_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" + anchors.SVUI_Raid40_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" + anchors.SVUI_Raid10_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" + anchors.SVUI_Raid25_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" + end +end + +local function UFMoveTopQuadrant(toggle) + local anchors = SV.cache.Anchors + if not toggle then + anchors.GM_MOVE = "TOPLEFTSVUIParentTOPLEFT250-25" + anchors.SVUI_LootFrame_MOVE = "BOTTOMSVUIParentBOTTOM0350" + anchors.SVUI_AltPowerBar_MOVE = "TOPSVUIParentTOP0-40" + anchors.LoC_MOVE = "BOTTOMSVUIParentBOTTOM0350" + anchors.BNET_MOVE = "TOPRIGHTSVUIParentTOPRIGHT-4-250" + else + anchors.GM_MOVE = "TOPLEFTSVUIParentTOPLEFT344-25" + anchors.SVUI_LootFrame_MOVE = "BOTTOMSVUIParentBOTTOM0254" + anchors.SVUI_AltPowerBar_MOVE = "TOPSVUIParentTOP0-39" + anchors.LoC_MOVE = "BOTTOMSVUIParentBOTTOM0443" + anchors.BNET_MOVE = "TOPRIGHTSVUIParentTOPRIGHT-4-248" + end +end + +local function UFMoveRightQuadrant(toggle) + local anchors = SV.cache.Anchors + local dH = SV.db.SVDock.dockRightHeight + 60 + if not toggle or toggle == "high" then + anchors.SVUI_BossHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" + anchors.SVUI_ArenaHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" + anchors.Tooltip_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-284"..dH; + else + anchors.SVUI_BossHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" + anchors.SVUI_ArenaHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" + anchors.Tooltip_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-284"..dH; + end +end +--[[ +########################################################## +GLOBAL/MODULE FUNCTIONS +########################################################## +]]-- +function SV.Setup:UserScreen(rez, preserve) + if not preserve then + if okToResetMOVE then + SV.Mentalo:Reset("") + okToResetMOVE = false; + end + SV:ResetData("SVUnit") + 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:ResetData("SVDock") + SV:ResetData("SVAura") + if not mungs then + UFMoveBottomQuadrant() + UFMoveLeftQuadrant() + UFMoveTopQuadrant() + UFMoveRightQuadrant() + end + SV.ghettoMonitor = nil + end + + if(not preserve and not mungs) then + BarShuffle() + SV.Mentalo:SetPositions() + SVLib:RefreshModule('SVDock') + SVLib:RefreshModule('SVAura') + SVLib:RefreshModule('SVBar') + SVLib:RefreshModule('SVUnit') + SV:SavedPopup() + end +end + +function SV.Setup:ChatConfigs(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("BOT