diff --git a/Interface/AddOns/SVUI/SVUI.lua b/Interface/AddOns/SVUI/SVUI.lua new file mode 100644 index 0000000..609ce84 --- /dev/null +++ b/Interface/AddOns/SVUI/SVUI.lua @@ -0,0 +1,982 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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 type = _G.type; +local rawset = _G.rawset; +local rawget = _G.rawget; +local tinsert = _G.tinsert; +local tremove = _G.tremove; +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; +--[[ STRING METHODS ]]-- +local upper = string.upper; +local format, find, match, gsub = string.format, string.find, string.match, string.gsub; +--[[ MATH METHODS ]]-- +local floor = math.floor +--[[ TABLE METHODS ]]-- +local twipe, tsort, tconcat = table.wipe, table.sort, table.concat; + +--[[ LOCALS ]]-- + +local SVUINameSpace, SVUICore = ...; +local SVUIVersion = GetAddOnMetadata(..., "Version"); +local clientVersion, internalVersion, releaseDate, uiVersion = GetBuildInfo(); +local callbacks = {}; +local numCallbacks = 0; +local playerClass = select(2,UnitClass("player")); +local dumb = function() return end + +local messagePattern = "|cffFF2F00%s:|r" +local debugPattern = "|cffFF2F00%s|r [|cff992FFF%s|r]|cffFF2F00:|r" +local PLUGIN_LISTING = ""; +local ModuleQueue, ScriptQueue = {},{}; + +local INFO_BY = "%s |cff0099FFby %s|r"; +local INFO_VERSION = "%s%s |cff33FF00Version: %s|r"; +local INFO_NAME = "Plugins"; +local INFO_HEADER = "Supervillain UI (version %.3f): Plugins"; + +if GetLocale() == "ruRU" then + INFO_BY = "%s |cff0099FFот %s|r"; + INFO_VERSION = "%s%s |cff33FF00Версия: %s|r"; + INFO_NAME = "Плагины"; + INFO_HEADER = "Supervillain UI (устарела %.3f): Плагины"; +end + +--[[ CONSTANTS ]]-- + +BINDING_HEADER_SVUI = "Supervillain UI"; +SLASH_RELOADUI1 = "/rl" +SLASH_RELOADUI2 = "/reloadui" +SlashCmdList.RELOADUI = ReloadUI + +--[[ 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; + +--[[ META METHODS ]]-- + +local rootstring = function(self) return self.___addonName end + +--[[ ENSURE META METHODS ]]-- + +local function SaveMetaMethods(obj) + local mt = {} + local old = getmetatable(obj) + if old then + for k, v in pairs(old) do mt[k] = v end + end + mt.__tostring = rootstring + setmetatable(obj, mt) +end + +--[[ LOCALIZATION HELPERS ]]-- + +local failsafe = function() assert(false) end + +local metaread = { + __index = function(self, key) + rawset(self, key, key) + return key + end +} + +local activeLocale + +local defaultwrite = setmetatable({}, { + __newindex = function(self, key, value) + if not rawget(activeLocale, key) then + rawset(activeLocale, key, value == true and key or value) + end + end, + __index = failsafe +}) + +local metawrite = setmetatable({}, { + __newindex = function(self, key, value) + rawset(activeLocale, key, value == true and key or value) + end, + __index = failsafe +}) + +local Localization = setmetatable({}, metaread); + +--[[ CLASS COLOR LOCALS ]]-- + +local function formatValueString(text) + if "string" == type(text) then + text = gsub(text,"\n","\\n") + 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 + assert(type(h) == "table", "Bad argument #2 to :RegisterCallback (table expected)") + assert(type(h[m]) == "function", "Bad argument #1 to :RegisterCallback (m \"" .. m .. "\" not found)") + m = h[m] + end + callbacks[m] = h or true + numCallbacks = numCallbacks + 1 +end + +local function UnregisterCallback(self, m, h) + assert(type(m) == "string" or type(m) == "function", "Bad argument #1 to :UnregisterCallback (string or function expected)") + if type(m) == "string" then + assert(type(h) == "table", "Bad argument #2 to :UnregisterCallback (table expected)") + assert(type(h[m]) == "function", "Bad argument #1 to :UnregisterCallback (m \"" .. m .. "\" not found)") + m = h[m] + end + callbacks[m] = nil + numCallbacks = numCallbacks + 1 +end + +local function DispatchCallbacks() + if (numCallbacks < 1) then return end + for m, h in pairs(callbacks) do + local ok, err = pcall(m, h ~= true and h or nil) + if not ok then + print("ERROR:", err) + end + end +end + +--[[ BUILD CLASS COLOR GLOBAL ]]-- + +SVUI_CLASS_COLORS = {}; +do + local classes = {}; + local supercolors = { + ["HUNTER"] = { r = 0.454, g = 0.698, b = 0 }, + ["WARLOCK"] = { r = 0.286, g = 0, b = 0.788 }, + ["PRIEST"] = { r = 0.976, g = 1, b = 0.839 }, + ["PALADIN"] = { r = 0.956, g = 0.207, b = 0.733 }, + ["MAGE"] = { r = 0, g = 0.796, b = 1 }, + ["ROGUE"] = { r = 1, g = 0.894, b = 0.117 }, + ["DRUID"] = { r = 1, g = 0.513, b = 0 }, + ["SHAMAN"] = { r = 0, g = 0.38, b = 1 }, + ["WARRIOR"] = { r = 0.698, g = 0.36, b = 0.152 }, + ["DEATHKNIGHT"] = { r = 0.847, g = 0.117, b = 0.074 }, + ["MONK"] = { r = 0.015, g = 0.886, b = 0.38 }, + }; + for class in pairs(RAID_CLASS_COLORS) do + tinsert(classes, class) + end + tsort(classes) + setmetatable(SVUI_CLASS_COLORS,{ + __index = function(t, k) + if k == "RegisterCallback" then return RegisterCallback end + if k == "UnregisterCallback" then return UnregisterCallback end + if k == "DispatchCallbacks" then return DispatchCallbacks end + end + }); + for i, class in ipairs(classes) do + local color = supercolors[class] + local r, g, b = color.r, color.g, color.b + local hex = ("ff%02x%02x%02x"):format(r * 255, g * 255, b * 255) + if not SVUI_CLASS_COLORS[class] or not SVUI_CLASS_COLORS[class].r or not SVUI_CLASS_COLORS[class].g or not SVUI_CLASS_COLORS[class].b then + SVUI_CLASS_COLORS[class] = { + r = r, + g = g, + b = b, + colorStr = hex, + } + end + end + 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 + +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 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 this:find('^%s*$') and '' or this:match('^%s*(.*%S)') +end + +function string.color(this, color) + return ("|cff%s%s|r"):format(color, this) +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) +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 +end + +--[[ CORE ENGINE CONSTRUCT ]]-- + +local Core_StaticPopup_Show = function(self, arg) + if arg == "ADDON_ACTION_FORBIDDEN" then + StaticPopup_Hide(arg) + end +end + +local Core_ResetAllUI = function(self, confirmed) + if InCombatLockdown()then + SendAddonMessage(ERR_NOT_IN_COMBAT) + return + end + if(not confirmed) then + self:StaticPopup_Show('RESET_UI_CHECK') + return + end + self:ResetInstallation() +end + +local Core_ResetUI = function(self, confirmed) + if InCombatLockdown()then + SendAddonMessage(ERR_NOT_IN_COMBAT) + return + end + if(not confirmed) then + self:StaticPopup_Show('RESETMOVERS_CHECK') + return + end + self:ResetMovables() +end + +local Core_ToggleConfig = function(self) + if InCombatLockdown() then + SendAddonMessage(ERR_NOT_IN_COMBAT) + self.UIParent:RegisterEvent('PLAYER_REGEN_ENABLED') + return + end + if not IsAddOnLoaded("SVUI_ConfigOMatic") then + local _,_,_,_,_,state = GetAddOnInfo("SVUI_ConfigOMatic") + if state ~= "MISSING" and state ~= "DISABLED" then + LoadAddOn("SVUI_ConfigOMatic") + local config_version = GetAddOnMetadata("SVUI_ConfigOMatic", "Version") + if(tonumber(config_version) < 4) then + self:StaticPopup_Show("CLIENT_UPDATE_REQUEST") + end + else + self:AddonMessage("|cffff0000Error -- Addon 'SVUI_ConfigOMatic' not found or is disabled.|r") + return + end + end + local aceConfig = LibStub("AceConfigDialog-3.0") + local switch = not aceConfig.OpenFrames["SVUI"] and "Open" or "Close" + aceConfig[switch](aceConfig, "SVUI") + GameTooltip:Hide() +end + +--/script SVUI[1]:TaintHandler("SVUI", "Script", "Function") +local Core_TaintHandler = function(self, taint, sourceName, sourceFunc) + if GetCVarBool('scriptErrors') ~= 1 then return end + local errorString = ("Error Captured: %s->%s->{%s}"):format(taint, sourceName or "Unknown", sourceFunc or "Unknown") + self:AddonMessage(errorString) + self:StaticPopup_Show("TAINT_RL") +end + +local function _sendmessage(msg, prefix) + if(type(msg) == "table") then + msg = tostring(msg) + end + + if(not msg) then return end + + if(prefix) then + local outbound = ("%s %s"):format(prefix, msg); + print(outbound) + else + print(msg) + end +end + +local Core_Debugger = function(self, msg) + if(not self.DebuggingMode) then return end + local outbound = (debugPattern):format("SVUI", "DEBUG") + _sendmessage(msg, outbound) +end + +local Core_AddonMessage = function(self, msg) + local outbound = (messagePattern):format("SVUI") + _sendmessage(msg, outbound) +end + +local Core_SetLocaleStrings = function(self, locale, isDefault) + local gameLocale = GetLocale() + if gameLocale == "enGB" then gameLocale = "enUS" end + + activeLocale = Localization + + if isDefault then + return defaultwrite + elseif(locale == GAME_LOCALE or locale == gameLocale) then + return metawrite + end +end + +local Core_Prototype = function(self, name) + local version = GetAddOnMetadata(name, "Version") + local schema = GetAddOnMetadata(name, "X-SVUI-Schema") + + self.Configs[schema] = {["enable"] = false} + + local obj = { + ___addonName = name, + ___version = version, + ___schema = schema + } + + local mt = {} + local old = getmetatable(obj) + if old then + for k, v in pairs(old) do mt[k] = v end + end + mt.__tostring = rootstring + setmetatable(obj, mt) + return obj +end + +--[[ REGISTRY CONSTRUCT ]]-- + +local changeDBVar = function(self, value, key, sub1, sub2, sub3) + local core = self.___core + local schema = self.___schema + local config = core.db[schema] + + if((sub1 and sub2 and sub3) and (config[sub1] and config[sub1][sub2] and config[sub1][sub2][sub3])) then + core.db[schema][sub1][sub2][sub3][key] = value + elseif((sub1 and sub2) and (config[sub1] and config[sub1][sub2])) then + core.db[schema][sub1][sub2][key] = value + elseif(sub1 and config[sub1]) then + core.db[schema][sub1][key] = value + else + core.db[schema][key] = value + end + + self.db = core.db[schema] + + if(self.UpdateLocals) then + self:UpdateLocals() + end +end + +local innerOnEvent = function(self, event, ...) + local obj = self.module + if self[event] and type(self[event]) == "function" then + self[event](obj, event, ...) + end +end + +local registerEvent = function(self, eventname, eventfunc) + if not self.___eventframe then + self.___eventframe = CreateFrame("Frame", nil) + self.___eventframe.module = self + self.___eventframe:SetScript("OnEvent", innerOnEvent) + end + + if(not self.___eventframe[eventname]) then + local fn = eventfunc + if type(eventfunc) == "string" then + fn = self[eventfunc] + 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 core = obj.___core + local callbacks = self.callbacks + + for name, fn in pairs(callbacks) do + local _, error = pcall(fn, obj) + if(error and core.Debugging) then + print(error) + end + end + + self.elapsed = 0 + else + self.elapsed = (self.elapsed or 0) + elapsed + end +end + +local registerUpdate = function(self, updatefunc, throttle) + if not self.___updateframe then + self.___updateframe = CreateFrame("Frame", nil); + self.___updateframe.module = self; + self.___updateframe.callbacks = {}; + self.___updateframe.elapsed = 0; + self.___updateframe.throttle = throttle or 0.2; + end + + if(updatefunc and type(updatefunc) == "string" and self[updatefunc]) then + self.___updateframe.callbacks[updatefunc] = self[updatefunc] + end + + self.___updateframe:SetScript("OnUpdate", innerOnUpdate) +end + +local unregisterUpdate = function(self, updatefunc) + if(updatefunc and type(updatefunc) == "string" and self.___updateframe.callbacks[updatefunc]) then + self.___updateframe.callbacks[updatefunc] = nil + if(#self.___updateframe.callbacks == 0) then + self.___updateframe:SetScript("OnUpdate", nil) + end + else + self.___updateframe:SetScript("OnUpdate", nil) + end +end + +local add_OptionsIndex = function(self, index, data) + local addonName = self.___addonName + local schema = self.___schema + local core = self.___core + local header = GetAddOnMetadata(addonName, "X-SVUI-Header") + + core.Options.args.plugins.args.pluginOptions.args[schema].args[index] = data +end + +local function SetPluginString(addonName) + local pluginString = PLUGIN_LISTING or "" + local author = GetAddOnMetadata(addonName, "Author") or "Unknown" + local Pname = GetAddOnMetadata(addonName, "Title") or addonName + local version = GetAddOnMetadata(addonName, "Version") or "???" + pluginString = INFO_BY:format(pluginString, author) + pluginString = ("%s%s"):format(pluginString, Pname) + pluginString = INFO_VERSION:format(pluginString, "|cff00FF00", version) + pluginString = ("%s|r\n"):format(pluginString) + + PLUGIN_LISTING = pluginString +end + +local function SetInternalModule(obj, core, schema) + local addonmeta = {} + local oldmeta = getmetatable(obj) + if oldmeta then + for k, v in pairs(oldmeta) do addonmeta[k] = v end + end + addonmeta.__tostring = rootstring + setmetatable( obj, addonmeta ) + + local addonName = ("SVUI [%s]"):format(schema) + + obj.___addonName = addonName + obj.___schema = schema + obj.___core = core + + obj.initialized = false + obj.CombatLocked = false + obj.ChangeDBVar = changeDBVar + obj.RegisterEvent = registerEvent + obj.UnregisterEvent = unregisterEvent + obj.RegisterUpdate = registerUpdate + obj.UnregisterUpdate = unregisterUpdate + + return obj +end + +local function SetExternalModule(obj, core, schema, addonName, header, lod) + local addonmeta = {} + local oldmeta = getmetatable(obj) + if oldmeta then + for k, v in pairs(oldmeta) do addonmeta[k] = v end + end + addonmeta.__tostring = rootstring + setmetatable( obj, addonmeta ) + + obj.___addonName = addonName + obj.___schema = schema + obj.___header = header + obj.___core = core + obj.___lod = lod + + obj.initialized = false + obj.CombatLocked = false + obj.ChangeDBVar = changeDBVar + obj.RegisterEvent = registerEvent + obj.UnregisterEvent = unregisterEvent + obj.RegisterUpdate = registerUpdate + obj.UnregisterUpdate = unregisterUpdate + obj.AddOption = add_OptionsIndex + + if(lod) then + -- print("PLUGIN: " .. addonName) + core.Options.args.plugins.args.pluginOptions.args[schema] = { + type = "group", + name = header, + childGroups = "tree", + args = { + enable = { + order = 1, + type = "execute", + width = "full", + name = function() + local nameString = "Disable" + if(not IsAddOnLoaded(addonName)) then + nameString = "Enable" + end + return nameString + end, + func = function() + if(not IsAddOnLoaded(addonName)) then + local loaded, reason = LoadAddOn(addonName) + core:UpdateDatabase() + obj:ChangeDBVar(true, "enable") + else + obj:ChangeDBVar(false, "enable") + core:StaticPopup_Show("RL_CLIENT") + end + end, + } + } + } + else + core.Options.args.plugins.args.pluginOptions.args[schema] = { + type = "group", + name = header, + childGroups = "tree", + args = { + enable = { + order = 1, + type = "toggle", + name = "Enable", + get = function() return obj.db.enable end, + set = function(key, value) obj:ChangeDBVar(value, "enable") end, + } + } + } + end + + return obj +end + +local Registry_NewCallback = function(self, fn) + if(fn and type(fn) == "function") then + self.Callbacks[#self.Callbacks+1] = fn + end +end + +local Registry_NewScript = function(self, fn) + if(fn and type(fn) == "function") then + ScriptQueue[#ScriptQueue+1] = fn + end +end + +local Registry_NewPackage = function(self, obj, schema) + local core = self.___core + if(core[schema]) then return end + + ModuleQueue[#ModuleQueue+1] = schema + self.Modules[#self.Modules+1] = schema + + core[schema] = SetInternalModule(obj, core, schema) + + if(core.AddonLaunched) then + if(core[schema].Load) then + core[schema]:Load() + end + end +end + +local Registry_NewPlugin = function(self, obj) + local core = self.___core + local coreName = core.___addonName + local addonName = obj.___addonName + + if(addonName and addonName ~= coreName) then + local schema = GetAddOnMetadata(addonName, "X-SVUI-Schema"); + local header = GetAddOnMetadata(addonName, "X-SVUI-Header"); + local lod = IsAddOnLoadOnDemand(addonName) + if(not schema) then return end + + ModuleQueue[#ModuleQueue+1] = schema + self.Modules[#self.Modules+1] = schema + + SetPluginString(addonName) + + core[schema] = SetExternalModule(obj, core, schema, addonName, header, lod) + + if(core.AddonLaunched and core[schema].Load) then + core[schema]:Load() + --print(schema) + end + end +end + +local Registry_NewAddon = function(self, addonName, schema, header) + local core = self.___core + self.Addons[addonName] = schema; + + core.Options.args.plugins.args.pluginOptions.args[schema] = { + type = "group", + name = header, + childGroups = "tree", + args = { + enable = { + order = 1, + type = "execute", + width = "full", + name = function() + local nameString = "Disable" + if(not IsAddOnLoaded(addonName)) then + nameString = "Enable" + end + return nameString + end, + func = function() + if(not IsAddOnLoaded(addonName)) then + local loaded, reason = LoadAddOn(addonName) + core:UpdateDatabase() + core.db[schema].enable = true + self:LoadPackages() + else + core.db[schema].enable = false + core:StaticPopup_Show("RL_CLIENT") + end + end, + } + } + } +end + +local Registry_FetchAddons = function(self) + local addonCount = GetNumAddOns() + local core = self.___core + + for i = 1, addonCount do + local addonName, _, _, _, _, reason = GetAddOnInfo(i) + local lod = IsAddOnLoadOnDemand(i) + local header = GetAddOnMetadata(i, "X-SVUI-Header") + local schema = GetAddOnMetadata(i, "X-SVUI-Schema") + + if(lod and schema) then + self:NewAddon(addonName, schema, header) + end + end +end + +local Registry_RunCallbacks = function(self) + local callbacks = self.Callbacks + for i=1, #callbacks do + local fn = callbacks[i] + if(fn and type(fn) == "function") then + fn() + end + end +end + +local Registry_Update = function(self, name, dataOnly) + local core = self.___core + local obj = core[name] + if obj then + if core.db[name] then + obj.db = core.db[name] + end + if obj.ReLoad and not dataOnly then + obj:ReLoad() + end + end +end + +local Registry_UpdateAll = function(self) + local modules = self.Modules + local core = self.___core + for _,name in pairs(modules) do + local obj = core[name] + + if core.db[name] then + obj.db = core.db[name] + end + + if obj and obj.ReLoad then + obj:ReLoad() + end + end +end + +local Registry_LoadOnDemand = function(self) + local core = self.___core + local addons = self.Addons + for name,schema in pairs(addons) do + local config = core.db[schema] + if(config and (config.enable or config.enable ~= false)) then + if(not IsAddOnLoaded(name)) then + local loaded, reason = LoadAddOn(name) + end + EnableAddOn(name) + end + end +end + +local Registry_Load = function(self) + if not ModuleQueue then return end + local core = self.___core + + for i=1,#ModuleQueue do + local name = ModuleQueue[i] + local obj = core[name] + if obj and not obj.initialized then + if core.db[name] then + obj.db = core.db[name] + end + + if obj.Load then + local halt = false + if(obj.db.incompatible) then + for addon,_ in pairs(obj.db.incompatible) do + if IsAddOnLoaded(addon) then halt = true end + end + end + 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 +--[[ +##################################################################################### + /$$$$$$ /$$ /$$ /$$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$$$$$$$ + /$$__ $$| $$ | $$| $$ | $$|_ $$_/ /$$__ $$ /$$__ $$| $$__ $$| $$_____/ +| $$ \__/| $$ | $$| $$ | $$ | $$ | $$ \__/| $$ \ $$| $$ \ $$| $$ +| $$$$$$ | $$ / $$/| $$ | $$ | $$ | $$ | $$ | $$| $$$$$$$/| $$$$$ + \____ $$ \ $$ $$/ | $$ | $$ | $$ | $$ | $$ | $$| $$__ $$| $$__/ + /$$ \ $$ \ $$$/ | $$ | $$ | $$ | $$ $$| $$ | $$| $$ \ $$| $$ +| $$$$$$/ \ $/ | $$$$$$/ /$$$$$$ | $$$$$$/| $$$$$$/| $$ | $$| $$$$$$$$ + \______/ \_/ \______/ |______/ \______/ \______/ |__/ |__/|________/ +##################################################################################### +]]-- +local SVUI = { + ___addonName = SVUINameSpace, + ___version = GetAddOnMetadata(SVUINameSpace, "Version"), + ___interface = tonumber(uiVersion), + + db = {}, + Global = { Accountant = {}, profiles = {}, profileKeys = {} }, + Configs = {}, + Media = {}, + DisplayAudit = {}, + DynamicOptions = {}, + Dispellable = {}, + Snap = {}, + class = playerClass, + fubar = dumb, + ClassRole = "", + UnitRole = "NONE", + ConfigurationMode = false, + DebuggingMode = false, + SetLocaleStrings = Core_SetLocaleStrings, + Prototype = Core_Prototype, + AddonMessage = Core_AddonMessage, + Debugger = Core_Debugger, + StaticPopup_Show = Core_StaticPopup_Show, + ResetAllUI = Core_ResetAllUI, + ResetUI = Core_ResetUI, + ToggleConfig = Core_ToggleConfig, + TaintHandler = Core_TaintHandler, + Options = { + type = "group", + name = "|cff339fffConfig-O-Matic|r", + args = { + plugins = { + order = -2, + type = "group", + name = "Plugins", + childGroups = "tab", + args = { + pluginheader = { + order = 1, + type = "header", + name = "Supervillain Plugins", + }, + pluginOptions = { + order = 2, + type = "group", + name = "", + args = { + pluginlist = { + order = 1, + type = "group", + name = "Summary", + args = { + active = { + order = 1, + type = "description", + name = function() return PLUGIN_LISTING end + } + } + }, + } + } + } + } + } + } +} + +SaveMetaMethods(SVUI) + +--[[ UTILITY FRAMES ]]-- + +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(); + +local Registry = { + ___core = SVUI, + Modules = {}, + Addons = {}, + Callbacks = {}, + INFO_VERSION = INFO_VERSION, + INFO_NEW = INFO_NEW, + INFO_NAME = INFO_NAME, + INFO_HEADER = INFO_HEADER, + NewCallback = Registry_NewCallback, + NewScript = Registry_NewScript, + NewPackage = Registry_NewPackage, + NewPlugin = Registry_NewPlugin, + NewAddon = Registry_NewAddon, + FindAddons = Registry_FetchAddons, + LoadRegisteredAddons = Registry_LoadOnDemand, + RunCallbacks = Registry_RunCallbacks, + Update = Registry_Update, + UpdateAll = Registry_UpdateAll, + LoadPackages = Registry_Load, +} + +SaveMetaMethods(Registry) + +--[[ COMMON FUNCTIONS ]]-- + +SVUICore[1] = SVUI +SVUICore[2] = Localization +SVUICore[3] = Registry + +--[[ SET MASTER GLOBAL ]]-- + +_G[SVUINameSpace] = SVUICore; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/SVUI.xml b/Interface/AddOns/SVUI/SVUI.xml index b5ad17a..29d264d 100644 --- a/Interface/AddOns/SVUI/SVUI.xml +++ b/Interface/AddOns/SVUI/SVUI.xml @@ -1,5 +1,7 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Script file="SVUI.lua"/> + <Frame name="SVUI_PanelTemplate" virtual="true" toplevel="true"> <Layers> <Layer level="BACKGROUND"> @@ -94,9 +96,6 @@ </Button> </Frames> </Frame> - - <Script file="system\global.lua"/> - <Script file="system\registry.lua"/> <Script file="libs\LibStub\LibStub.lua"/> <Script file="libs\CallbackHandler-1.0\CallbackHandler-1.0.lua"/> @@ -126,8 +125,6 @@ <Script file="system\timers.lua"/> <Script file="system\slash.lua"/> <Script file="system\alerts.lua"/> - <Script file="system\presets.lua"/> - <Script file="system\installer.lua"/> <Include file="system\mentalo.xml"/> <Include file="packages\stats\SVStats.xml"/> @@ -153,5 +150,7 @@ <Script file="scripts\reactions.lua"/> <Script file="scripts\spellbind.lua"/> + <Script file="installer\setup.lua"/> + <Script file="system\load.lua"/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/installer/presets/auras.lua b/Interface/AddOns/SVUI/installer/presets/auras.lua new file mode 100644 index 0000000..5ee13c4 --- /dev/null +++ b/Interface/AddOns/SVUI/installer/presets/auras.lua @@ -0,0 +1,283 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +--[[ +########################################################## +LOCALIZED GLOBALS +########################################################## +]]-- +local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS +local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV, L = unpack(select(2, ...)); +local scc = SVUI_CLASS_COLORS[SV.class]; +local rcc = RAID_CLASS_COLORS[SV.class]; +local r2 = .1 + (rcc.r * .1) +local g2 = .1 + (rcc.g * .1) +local b2 = .1 + (rcc.b * .1) +--[[ +########################################################## +LAYOUT PRESETS +########################################################## +]]-- +local presets = { + ["auras"] = { + ["link"] = "SVUnit", + ["default"] = { + ["player"] = { + ["buffs"] = { + enable = false, + attachTo = "DEBUFFS", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["debuffs"] = { + enable = false, + attachTo = "FRAME", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["aurabar"] = { + enable = false + } + }, + ["target"] = { + ["smartAuraDisplay"] = "DISABLED", + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = false + } + }, + ["focus"] = { + ["smartAuraDisplay"] = "DISABLED", + ["buffs"] = { + enable = false, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = false + } + } + }, + ["icons"] = { + ["player"] = { + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["aurabar"] = { + enable = false + } + }, + ["target"] = { + ["smartAuraDisplay"] = "DISABLED", + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = false + } + }, + ["focus"] = { + ["smartAuraDisplay"] = "DISABLED", + ["buffs"] = { + enable = false, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = false + } + } + }, + ["bars"] = { + ["player"] = { + ["buffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["debuffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["aurabar"] = { + enable = true, + attachTo = "FRAME" + } + }, + ["target"] = { + ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", + ["buffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["debuffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["aurabar"] = { + enable = true, + attachTo = "FRAME" + } + }, + ["focus"] = { + ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", + ["buffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["debuffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["aurabar"] = { + enable = true, + attachTo = "FRAME" + } + } + }, + ["theworks"] = { + ["player"] = { + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["aurabar"] = { + enable = true, + attachTo = "DEBUFFS" + } + }, + ["target"] = { + ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = true, + attachTo = "DEBUFFS" + } + }, + ["focus"] = { + ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = true, + attachTo = "DEBUFFS" + } + } + }, + } +}; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/installer/presets/bars.lua b/Interface/AddOns/SVUI/installer/presets/bars.lua new file mode 100644 index 0000000..2e667df --- /dev/null +++ b/Interface/AddOns/SVUI/installer/presets/bars.lua @@ -0,0 +1,133 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +--[[ +########################################################## +LOCALIZED GLOBALS +########################################################## +]]-- +local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS +local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV, L = unpack(select(2, ...)); +local scc = SVUI_CLASS_COLORS[SV.class]; +local rcc = RAID_CLASS_COLORS[SV.class]; +local r2 = .1 + (rcc.r * .1) +local g2 = .1 + (rcc.g * .1) +local b2 = .1 + (rcc.b * .1) +--[[ +########################################################## +LAYOUT PRESETS +########################################################## +]]-- +local presets = { + ["bars"] = { + ["link"] = "SVBar", + ["default"] = { + ["Bar1"] = { + buttonsize = 32 + }, + ["Bar2"] = { + enable = false + }, + ["Bar3"] = { + buttons = 6, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 32 + }, + ["Bar5"] = { + buttons = 6, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 32 + } + }, + ["onebig"] = { + ["Bar1"] = { + buttonsize = 40 + }, + ["Bar2"] = { + enable = false + }, + ["Bar3"] = { + buttons = 6, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 40 + }, + ["Bar5"] = { + buttons = 6, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 40 + } + }, + ["twosmall"] = { + ["Bar1"] = { + buttonsize = 32 + }, + ["Bar2"] = { + enable = true, + buttonsize = 32 + }, + ["Bar3"] = { + buttons = 12, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 32 + }, + ["Bar5"] = { + buttons = 12, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 32 + } + }, + ["twobig"] = { + ["Bar1"] = { + buttonsize = 40 + }, + ["Bar2"] = { + enable = true, + buttonsize = 40 + }, + ["Bar3"] = { + buttons = 12, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 40 + }, + ["Bar5"] = { + buttons = 12, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 40 + } + }, + }, +}; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/installer/presets/layouts.lua b/Interface/AddOns/SVUI/installer/presets/layouts.lua new file mode 100644 index 0000000..63248ee --- /dev/null +++ b/Interface/AddOns/SVUI/installer/presets/layouts.lua @@ -0,0 +1,394 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +--[[ +########################################################## +LOCALIZED GLOBALS +########################################################## +]]-- +local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS +local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV, L = unpack(select(2, ...)); +local scc = SVUI_CLASS_COLORS[SV.class]; +local rcc = RAID_CLASS_COLORS[SV.class]; +local r2 = .1 + (rcc.r * .1) +local g2 = .1 + (rcc.g * .1) +local b2 = .1 + (rcc.b * .1) +--[[ +########################################################## +LAYOUT PRESETS +########################################################## +]]-- +local presets = { + ["layouts"] = { + ["link"] = "SVUnit", + ["default"] = { + ["grid"] = { + ["enable"] = false, + }, + ["party"] = { + width = 75, + height = 60, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + icons = { + roleIcon = { + ["attachTo"] = "INNERBOTTOMRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + name = { + ["font"] = "SVUI Default Font", + ["fontOutline"] = "OUTLINE", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + ["raid10"] = { + width = 50, + height = 30, + gRowCol = 1, + wrapXOffset = 9, + wrapYOffset = 13, + showBy = "RIGHT_DOWN", + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid25"] = { + width = 50, + height = 30, + gRowCol = 1, + wrapXOffset = 9, + wrapYOffset = 13, + showBy = "RIGHT_DOWN", + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid40"] = { + width = 50, + height = 30, + gRowCol = 1, + wrapXOffset = 9, + wrapYOffset = 13, + showBy = "RIGHT_DOWN", + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + }, + ["healer"] = { + ["grid"] = { + ["enable"] = false, + }, + ["party"] = { + width = 75, + height = 60, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["fontOutline"] = "OUTLINE", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + ["raid10"] = { + width = 50, + height = 30, + ["showBy"] = "DOWN_RIGHT", + ["gRowCol"] = 1, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = true, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid25"] = { + width = 50, + height = 30, + ["showBy"] = "DOWN_RIGHT", + ["gRowCol"] = 1, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = true, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid40"] = { + width = 50, + height = 30, + ["showBy"] = "DOWN_RIGHT", + ["gRowCol"] = 1, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = true, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + }, + ["dps"] = { + ["grid"] = { + ["enable"] = false, + }, + ["party"] = { + width = 115, + height = 25, + wrapXOffset = 9, + wrapYOffset = 13, + ["power"] = { + ["enable"] = false, + }, + portrait = { + enable = false, + overlay = false, + style = "2D", + width = 35, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "LEFT", + ["xOffset"] = -2, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["fontOutline"] = "NONE", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + }, + ["raid10"] = { + ["showBy"] = "UP_RIGHT", + ["gRowCol"] = 2, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 10, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + ["width"] = 80, + ["height"] = 20, + }, + ["raid25"] = { + ["showBy"] = "UP_RIGHT", + ["gRowCol"] = 3, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 10, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + ["width"] = 80, + ["height"] = 20, + }, + ["raid40"] = { + ["showBy"] = "UP_RIGHT", + ["gRowCol"] = 4, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 10, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + ["width"] = 80, + ["height"] = 20, + }, + }, + ["grid"] = { + ["grid"] = { + ["enable"] = true, + ["size"] = 34, + ["shownames"] = true, + }, + ["party"] = { + ["gridAllowed"] = true, + ["wrapXOffset"] = 1, + ["wrapYOffset"] = 1, + }, + ["raid10"] = { + ["gridAllowed"] = true, + ["wrapXOffset"] = 1, + ["wrapYOffset"] = 1, + ["gRowCol"] = 1, + ["showBy"] = "RIGHT_DOWN", + }, + ["raid25"] = { + ["gridAllowed"] = true, + ["wrapXOffset"] = 1, + ["wrapYOffset"] = 1, + ["gRowCol"] = 1, + ["showBy"] = "RIGHT_DOWN", + }, + ["raid40"] = { + ["gridAllowed"] = true, + ["wrapXOffset"] = 1, + ["wrapYOffset"] = 1, + ["gRowCol"] = 1, + ["showBy"] = "RIGHT_DOWN", + }, + }, + } +}; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/installer/presets/media.lua b/Interface/AddOns/SVUI/installer/presets/media.lua new file mode 100644 index 0000000..6724b9b --- /dev/null +++ b/Interface/AddOns/SVUI/installer/presets/media.lua @@ -0,0 +1,119 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +--[[ +########################################################## +LOCALIZED GLOBALS +########################################################## +]]-- +local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS +local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV, L = unpack(select(2, ...)); +local scc = SVUI_CLASS_COLORS[SV.class]; +local rcc = RAID_CLASS_COLORS[SV.class]; +local r2 = .1 + (rcc.r * .1) +local g2 = .1 + (rcc.g * .1) +local b2 = .1 + (rcc.b * .1) +--[[ +########################################################## +LAYOUT PRESETS +########################################################## +]]-- +local presets = { + ["media"] = { + ["link"] = "media", + ["default"] = { + ["colors"] = { + ["special"] = {.37, .32, .29, 1}, + }, + ["textures"] = { + ["pattern"] = "SVUI Backdrop 1", + ["comic"] = "SVUI Comic 1", + ["unitlarge"] = "SVUI Unit BG 1", + ["unitsmall"] = "SVUI Small BG 1", + }, + ["unitframes"] = { + ["buff_bars"] = {.91, .91, .31, 1}, + ["health"] = {.1, .6, .02, 1}, + ["casting"] = {.91, .91, .31, 1}, + ["spark"] = {1, .72, 0, 1}, + }, + }, + ["kaboom"] = { + ["colors"] = { + ["special"] = {.28, .31, .32, 1}, + }, + ["textures"] = { + ["pattern"] = "SVUI Backdrop 2", + ["comic"] = "SVUI Comic 2", + ["unitlarge"] = "SVUI Unit BG 2", + ["unitsmall"] = "SVUI Small BG 2", + }, + ["unitframes"] = { + ["buff_bars"] = {.51, .79, 0, 1}, + ["health"] = {.16, .86, .22, 1}, + ["casting"] = {.91, .91, 0, 1}, + ["spark"] = {1, .72, 0, 1}, + }, + }, + ["classy"] = { + ["colors"] = { + ["special"] = {r2, g2, b2, 1}, + }, + ["textures"] = { + ["pattern"] = "SVUI Backdrop 3", + ["comic"] = "SVUI Comic 3", + ["unitlarge"] = "SVUI Unit BG 3", + ["unitsmall"] = "SVUI Small BG 3", + }, + ["unitframes"] = { + ["buff_bars"] = {scc.r, scc.g, scc.b, 1}, + ["health"] = {.16, .86, .22, 1}, + ["casting"] = {.91, .91, 0, 1}, + ["spark"] = {1, .72, 0, 1}, + }, + }, + ["dark"] = { + ["colors"] = { + ["special"] = {.25, .26, .27, 1}, + }, + ["textures"] = { + ["pattern"] = "SVUI Backdrop 4", + ["comic"] = "SVUI Comic 4", + ["unitlarge"] = "SVUI Unit BG 4", + ["unitsmall"] = "SVUI Small BG 4", + }, + ["unitframes"] = { + ["buff_bars"] = {.45, .55, .15, 1}, + ["health"] = {.06, .06, .06, 1}, + ["casting"] = {.8, .8, 0, 1}, + ["spark"] = {1, .72, 0, 1}, + }, + }, + } +}; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/installer/presets/units.lua b/Interface/AddOns/SVUI/installer/presets/units.lua new file mode 100644 index 0000000..2e997ce --- /dev/null +++ b/Interface/AddOns/SVUI/installer/presets/units.lua @@ -0,0 +1,385 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +--[[ +########################################################## +LOCALIZED GLOBALS +########################################################## +]]-- +local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS +local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV, L = unpack(select(2, ...)); +local scc = SVUI_CLASS_COLORS[SV.class]; +local rcc = RAID_CLASS_COLORS[SV.class]; +local r2 = .1 + (rcc.r * .1) +local g2 = .1 + (rcc.g * .1) +local b2 = .1 + (rcc.b * .1) +--[[ +########################################################## +LAYOUT PRESETS +########################################################## +]]-- +local presets = { + ["units"] = { + ["link"] = "SVUnit", + ["default"] = { + ["player"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["target"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["pet"] = { + width = 130, + height = 30, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "CENTER" + }, + }, + ["targettarget"] = { + width = 130, + height = 30, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "CENTER" + }, + }, + ["boss"] = { + width = 200, + height = 45, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["party"] = { + width = 75, + height = 60, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "INNERTOPLEFT" + }, + }, + ["raid10"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid25"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid40"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + }, + ["super"] = { + ["player"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["target"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["pet"] = { + width = 150, + height = 30, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "CENTER" + }, + }, + ["targettarget"] = { + width = 150, + height = 30, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "CENTER" + }, + }, + ["boss"] = { + width = 200, + height = 45, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["party"] = { + width = 75, + height = 60, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "INNERTOPLEFT" + }, + }, + ["raid10"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid25"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid40"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + }, + ["simple"] = { + ["player"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 60, + } + }, + ["target"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 60, + } + }, + ["pet"] = { + width = 150, + height = 30, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 30, + }, + name = { + position = "INNERLEFT" + }, + }, + ["targettarget"] = { + width = 150, + height = 30, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 30, + }, + name = { + position = "INNERLEFT" + }, + }, + ["boss"] = { + width = 200, + height = 45, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 45, + } + }, + ["party"] = { + width = 100, + height = 35, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 35, + }, + name = { + position = "INNERRIGHT" + }, + }, + ["raid10"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid25"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid40"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + }, + ["compact"] = { + ["player"] = { + width = 215, + height = 50, + portrait = { + enable = false + } + }, + ["target"] = { + width = 215, + height = 50, + portrait = { + enable = false + } + }, + ["pet"] = { + width = 130, + height = 30, + portrait = { + enable = false + }, + name = { + position = "CENTER" + }, + }, + ["targettarget"] = { + width = 130, + height = 30, + portrait = { + enable = false + }, + name = { + position = "CENTER" + }, + }, + ["boss"] = { + width = 200, + height = 45, + portrait = { + enable = false + } + }, + ["party"] = { + width = 70, + height = 30, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = false + }, + name = { + position = "INNERTOPLEFT" + }, + }, + ["raid10"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid25"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid40"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + }, + } +}; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/installer/setup.lua b/Interface/AddOns/SVUI/installer/setup.lua new file mode 100644 index 0000000..73bbb6f --- /dev/null +++ b/Interface/AddOns/SVUI/installer/setup.lua @@ -0,0 +1,2393 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local type = _G.type; +local string = _G.string; +local table = _G.table; +local format = string.format; +local tcopy = table.copy; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SV, L, Registry = unpack(select(2, ...)); +--[[ +########################################################## +LOCAL VARS +########################################################## +]]-- +local CURRENT_PAGE, MAX_PAGE, XOFF = 0, 9, (GetScreenWidth() * 0.025) +local okToResetMOVE = false +local mungs = false; +local user_music_vol; +local musicIsPlaying; + +local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS +local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS +local scc = SVUI_CLASS_COLORS[SV.class]; +local rcc = RAID_CLASS_COLORS[SV.class]; +local r2 = .1 + (rcc.r * .1) +local g2 = .1 + (rcc.g * .1) +local b2 = .1 + (rcc.b * .1) +--[[ +########################################################## +LAYOUT PRESETS +########################################################## +]]-- +local PRESET_DATA; + +local function LoadPresetData() + PRESET_DATA = {} + + PRESET_DATA["media"] = { + ["link"] = "media", + ["default"] = { + ["colors"] = { + ["special"] = {.37, .32, .29, 1}, + }, + ["textures"] = { + ["pattern"] = "SVUI Backdrop 1", + ["comic"] = "SVUI Comic 1", + ["unitlarge"] = "SVUI Unit BG 1", + ["unitsmall"] = "SVUI Small BG 1", + }, + ["unitframes"] = { + ["buff_bars"] = {.91, .91, .31, 1}, + ["health"] = {.1, .6, .02, 1}, + ["casting"] = {.91, .91, .31, 1}, + ["spark"] = {1, .72, 0, 1}, + }, + }, + ["kaboom"] = { + ["colors"] = { + ["special"] = {.28, .31, .32, 1}, + }, + ["textures"] = { + ["pattern"] = "SVUI Backdrop 2", + ["comic"] = "SVUI Comic 2", + ["unitlarge"] = "SVUI Unit BG 2", + ["unitsmall"] = "SVUI Small BG 2", + }, + ["unitframes"] = { + ["buff_bars"] = {.51, .79, 0, 1}, + ["health"] = {.16, .86, .22, 1}, + ["casting"] = {.91, .91, 0, 1}, + ["spark"] = {1, .72, 0, 1}, + }, + }, + ["classy"] = { + ["colors"] = { + ["special"] = {r2, g2, b2, 1}, + }, + ["textures"] = { + ["pattern"] = "SVUI Backdrop 3", + ["comic"] = "SVUI Comic 3", + ["unitlarge"] = "SVUI Unit BG 3", + ["unitsmall"] = "SVUI Small BG 3", + }, + ["unitframes"] = { + ["buff_bars"] = {scc.r, scc.g, scc.b, 1}, + ["health"] = {.16, .86, .22, 1}, + ["casting"] = {.91, .91, 0, 1}, + ["spark"] = {1, .72, 0, 1}, + }, + }, + ["dark"] = { + ["colors"] = { + ["special"] = {.25, .26, .27, 1}, + }, + ["textures"] = { + ["pattern"] = "SVUI Backdrop 4", + ["comic"] = "SVUI Comic 4", + ["unitlarge"] = "SVUI Unit BG 4", + ["unitsmall"] = "SVUI Small BG 4", + }, + ["unitframes"] = { + ["buff_bars"] = {.45, .55, .15, 1}, + ["health"] = {.06, .06, .06, 1}, + ["casting"] = {.8, .8, 0, 1}, + ["spark"] = {1, .72, 0, 1}, + }, + }, + } + PRESET_DATA["auras"] = { + ["link"] = "SVUnit", + ["default"] = { + ["player"] = { + ["buffs"] = { + enable = false, + attachTo = "DEBUFFS", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["debuffs"] = { + enable = false, + attachTo = "FRAME", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["aurabar"] = { + enable = false + } + }, + ["target"] = { + ["smartAuraDisplay"] = "DISABLED", + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = false + } + }, + ["focus"] = { + ["smartAuraDisplay"] = "DISABLED", + ["buffs"] = { + enable = false, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = false + } + } + }, + ["icons"] = { + ["player"] = { + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["aurabar"] = { + enable = false + } + }, + ["target"] = { + ["smartAuraDisplay"] = "DISABLED", + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = false + } + }, + ["focus"] = { + ["smartAuraDisplay"] = "DISABLED", + ["buffs"] = { + enable = false, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = false + } + } + }, + ["bars"] = { + ["player"] = { + ["buffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["debuffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["aurabar"] = { + enable = true, + attachTo = "FRAME" + } + }, + ["target"] = { + ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", + ["buffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["debuffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["aurabar"] = { + enable = true, + attachTo = "FRAME" + } + }, + ["focus"] = { + ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", + ["buffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["debuffs"] = { + enable = false, + attachTo = "FRAME" + }, + ["aurabar"] = { + enable = true, + attachTo = "FRAME" + } + } + }, + ["theworks"] = { + ["player"] = { + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPLEFT', + verticalGrowth = 'UP', + horizontalGrowth = 'RIGHT', + }, + ["aurabar"] = { + enable = true, + attachTo = "DEBUFFS" + } + }, + ["target"] = { + ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = true, + attachTo = "DEBUFFS" + } + }, + ["focus"] = { + ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", + ["buffs"] = { + enable = true, + attachTo = "FRAME", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["debuffs"] = { + enable = true, + attachTo = "BUFFS", + anchorPoint = 'TOPRIGHT', + verticalGrowth = 'UP', + horizontalGrowth = 'LEFT', + }, + ["aurabar"] = { + enable = true, + attachTo = "DEBUFFS" + } + } + }, + } + PRESET_DATA["bars"] = { + ["link"] = "SVBar", + ["default"] = { + ["Bar1"] = { + buttonsize = 32 + }, + ["Bar2"] = { + enable = false + }, + ["Bar3"] = { + buttons = 6, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 32 + }, + ["Bar5"] = { + buttons = 6, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 32 + } + }, + ["onebig"] = { + ["Bar1"] = { + buttonsize = 40 + }, + ["Bar2"] = { + enable = false + }, + ["Bar3"] = { + buttons = 6, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 40 + }, + ["Bar5"] = { + buttons = 6, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 40 + } + }, + ["twosmall"] = { + ["Bar1"] = { + buttonsize = 32 + }, + ["Bar2"] = { + enable = true, + buttonsize = 32 + }, + ["Bar3"] = { + buttons = 12, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 32 + }, + ["Bar5"] = { + buttons = 12, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 32 + } + }, + ["twobig"] = { + ["Bar1"] = { + buttonsize = 40 + }, + ["Bar2"] = { + enable = true, + buttonsize = 40 + }, + ["Bar3"] = { + buttons = 12, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 40 + }, + ["Bar5"] = { + buttons = 12, + buttonspacing = 2, + buttonsPerRow = 6, + buttonsize = 40 + } + }, + } + PRESET_DATA["units"] = { + ["link"] = "SVUnit", + ["default"] = { + ["player"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["target"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["pet"] = { + width = 130, + height = 30, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "CENTER" + }, + }, + ["targettarget"] = { + width = 130, + height = 30, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "CENTER" + }, + }, + ["boss"] = { + width = 200, + height = 45, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["party"] = { + width = 75, + height = 60, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "INNERTOPLEFT" + }, + }, + ["raid10"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid25"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid40"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + }, + ["super"] = { + ["player"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["target"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["pet"] = { + width = 150, + height = 30, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "CENTER" + }, + }, + ["targettarget"] = { + width = 150, + height = 30, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "CENTER" + }, + }, + ["boss"] = { + width = 200, + height = 45, + portrait = { + enable = true, + overlay = true, + style = "3D", + } + }, + ["party"] = { + width = 75, + height = 60, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + name = { + position = "INNERTOPLEFT" + }, + }, + ["raid10"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid25"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid40"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + }, + ["simple"] = { + ["player"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 60, + } + }, + ["target"] = { + width = 215, + height = 60, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 60, + } + }, + ["pet"] = { + width = 150, + height = 30, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 30, + }, + name = { + position = "INNERLEFT" + }, + }, + ["targettarget"] = { + width = 150, + height = 30, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 30, + }, + name = { + position = "INNERLEFT" + }, + }, + ["boss"] = { + width = 200, + height = 45, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 45, + } + }, + ["party"] = { + width = 100, + height = 35, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = false, + style = "2D", + width = 35, + }, + name = { + position = "INNERRIGHT" + }, + }, + ["raid10"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid25"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid40"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + }, + ["compact"] = { + ["player"] = { + width = 215, + height = 50, + portrait = { + enable = false + } + }, + ["target"] = { + width = 215, + height = 50, + portrait = { + enable = false + } + }, + ["pet"] = { + width = 130, + height = 30, + portrait = { + enable = false + }, + name = { + position = "CENTER" + }, + }, + ["targettarget"] = { + width = 130, + height = 30, + portrait = { + enable = false + }, + name = { + position = "CENTER" + }, + }, + ["boss"] = { + width = 200, + height = 45, + portrait = { + enable = false + } + }, + ["party"] = { + width = 70, + height = 30, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = false + }, + name = { + position = "INNERTOPLEFT" + }, + }, + ["raid10"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid25"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + ["raid40"] = { + width = 50, + height = 30, + wrapXOffset = 6, + wrapYOffset = 6, + }, + }, + } + PRESET_DATA["layouts"] = { + ["link"] = "SVUnit", + ["default"] = { + ["grid"] = { + ["enable"] = false, + }, + ["party"] = { + width = 75, + height = 60, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + icons = { + roleIcon = { + ["attachTo"] = "INNERBOTTOMRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + name = { + ["font"] = "SVUI Default Font", + ["fontOutline"] = "OUTLINE", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + ["raid10"] = { + width = 50, + height = 30, + gRowCol = 1, + wrapXOffset = 9, + wrapYOffset = 13, + showBy = "RIGHT_DOWN", + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid25"] = { + width = 50, + height = 30, + gRowCol = 1, + wrapXOffset = 9, + wrapYOffset = 13, + showBy = "RIGHT_DOWN", + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid40"] = { + width = 50, + height = 30, + gRowCol = 1, + wrapXOffset = 9, + wrapYOffset = 13, + showBy = "RIGHT_DOWN", + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + }, + ["healer"] = { + ["grid"] = { + ["enable"] = false, + }, + ["party"] = { + width = 75, + height = 60, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["fontOutline"] = "OUTLINE", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + ["raid10"] = { + width = 50, + height = 30, + ["showBy"] = "DOWN_RIGHT", + ["gRowCol"] = 1, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = true, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid25"] = { + width = 50, + height = 30, + ["showBy"] = "DOWN_RIGHT", + ["gRowCol"] = 1, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = true, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid40"] = { + width = 50, + height = 30, + ["showBy"] = "DOWN_RIGHT", + ["gRowCol"] = 1, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = true, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + }, + ["dps"] = { + ["grid"] = { + ["enable"] = false, + }, + ["party"] = { + width = 115, + height = 25, + wrapXOffset = 9, + wrapYOffset = 13, + ["power"] = { + ["enable"] = false, + }, + portrait = { + enable = false, + overlay = false, + style = "2D", + width = 35, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "LEFT", + ["xOffset"] = -2, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["fontOutline"] = "NONE", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + }, + ["raid10"] = { + ["showBy"] = "UP_RIGHT", + ["gRowCol"] = 2, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 10, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + ["width"] = 80, + ["height"] = 20, + }, + ["raid25"] = { + ["showBy"] = "UP_RIGHT", + ["gRowCol"] = 3, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 10, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + ["width"] = 80, + ["height"] = 20, + }, + ["raid40"] = { + ["showBy"] = "UP_RIGHT", + ["gRowCol"] = 4, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 10, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + ["width"] = 80, + ["height"] = 20, + }, + }, + ["grid"] = { + ["grid"] = { + ["enable"] = true, + ["size"] = 34, + ["shownames"] = true, + }, + ["party"] = { + ["gridAllowed"] = true, + ["wrapXOffset"] = 1, + ["wrapYOffset"] = 1, + }, + ["raid10"] = { + ["gridAllowed"] = true, + ["wrapXOffset"] = 1, + ["wrapYOffset"] = 1, + ["gRowCol"] = 1, + ["showBy"] = "RIGHT_DOWN", + }, + ["raid25"] = { + ["gridAllowed"] = true, + ["wrapXOffset"] = 1, + ["wrapYOffset"] = 1, + ["gRowCol"] = 1, + ["showBy"] = "RIGHT_DOWN", + }, + ["raid40"] = { + ["gridAllowed"] = true, + ["wrapXOffset"] = 1, + ["wrapYOffset"] = 1, + ["gRowCol"] = 1, + ["showBy"] = "RIGHT_DOWN", + }, + }, + } +end + +local function _copyPresets(saved, preset) + if(type(preset) == 'table') then + for key,val in pairs(preset) do + if(not saved[key]) then saved[key] = {} end + if(type(val) == "table") then + _copyPresets(saved[key], val) + elseif(saved[key]) then + saved[key] = val + end + end + else + saved = preset + end +end + +local function LoadPresetData(category, theme) + if(not PRESET_DATA) then LoadPresetData() end + if(PRESET_DATA and PRESET_DATA[category] and PRESET_DATA[category]["link"]) then + theme = theme or "default" + local saved = PRESET_DATA[category]["link"] + local preset = PRESET_DATA[category][theme] + _copyPresets(SV.db[saved], preset) + end +end +--[[ +########################################################## +LOCAL FUNCTIONS +########################################################## +]]-- +local function SetInstallButton(button) + if(not button) then return end + button.Left:SetAlpha(0) + button.Middle:SetAlpha(0) + button.Right:SetAlpha(0) + button:SetNormalTexture("") + button:SetPushedTexture("") + button:SetPushedTexture("") + button:SetDisabledTexture("") + button:RemoveTextures() + button:SetFrameLevel(button:GetFrameLevel() + 1) +end + +local function forceCVars() + SetCVar("alternateResourceText",1) + SetCVar("statusTextDisplay","BOTH") + SetCVar("ShowClassColorInNameplate",1) + SetCVar("screenshotQuality",10) + SetCVar("chatMouseScroll",1) + SetCVar("chatStyle","classic") + SetCVar("WholeChatWindowClickable",0) + SetCVar("ConversationMode","inline") + SetCVar("showTutorials",0) + SetCVar("UberTooltips",1) + SetCVar("threatWarning",3) + SetCVar('alwaysShowActionBars',1) + SetCVar('lockActionBars',1) + SetCVar('SpamFilter',0) + InterfaceOptionsActionBarsPanelPickupActionKeyDropDown:SetValue('SHIFT') + InterfaceOptionsActionBarsPanelPickupActionKeyDropDown:RefreshValue() +end + +local function ShowLayout(show40) + if(not _G["SVUI_Raid40"] or (show40 and _G["SVUI_Raid40"].forceShow == true)) then return end + if(not show40 and _G["SVUI_Raid40"].forceShow ~= true) then return end + SV.SVUnit:UpdateGroupConfig(_G["SVUI_Raid40"], show40) +end + +local function BarShuffle() + local bar2 = SV.db.SVBar.Bar2.enable; + local base = 30; + local bS = SV.db.SVBar.Bar1.buttonspacing; + local tH = SV.db.SVBar.Bar1.buttonsize + (base - bS); + local b2h = bar2 and tH or base; + local sph = (400 - b2h); + if not SV.db.framelocations then SV.db.framelocations = {} end + SV.db.framelocations.SVUI_SpecialAbility_MOVE = "BOTTOMSVUIParentBOTTOM0"..sph; + SV.db.framelocations.SVUI_ActionBar2_MOVE = "BOTTOMSVUI_ActionBar1TOP0"..(-bS); + SV.db.framelocations.SVUI_ActionBar3_MOVE = "BOTTOMLEFTSVUI_ActionBar1BOTTOMRIGHT40"; + SV.db.framelocations.SVUI_ActionBar5_MOVE = "BOTTOMRIGHTSVUI_ActionBar1BOTTOMLEFT-40"; + if bar2 then + SV.db.framelocations.SVUI_PetActionBar_MOVE = "BOTTOMLEFTSVUI_ActionBar2TOPLEFT04" + SV.db.framelocations.SVUI_StanceBar_MOVE = "BOTTOMRIGHTSVUI_ActionBar2TOPRIGHT04"; + else + SV.db.framelocations.SVUI_PetActionBar_MOVE = "BOTTOMLEFTSVUI_ActionBar1TOPLEFT04" + SV.db.framelocations.SVUI_StanceBar_MOVE = "BOTTOMRIGHTSVUI_ActionBar1TOPRIGHT04"; + end +end + +local function UFMoveBottomQuadrant(toggle) + if not SV.db.framelocations then SV.db.framelocations = {} end + if not toggle then + SV.db.framelocations.SVUI_Player_MOVE = "BOTTOMSVUIParentBOTTOM-278182" + SV.db.framelocations.SVUI_PlayerCastbar_MOVE = "BOTTOMSVUIParentBOTTOM-278122" + SV.db.framelocations.SVUI_Target_MOVE = "BOTTOMSVUIParentBOTTOM278182" + SV.db.framelocations.SVUI_TargetCastbar_MOVE = "BOTTOMSVUIParentBOTTOM278122" + SV.db.framelocations.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM0181" + SV.db.framelocations.SVUI_TargetTarget_MOVE = "BOTTOMSVUIParentBOTTOM0214" + SV.db.framelocations.SVUI_Focus_MOVE = "BOTTOMSVUIParentBOTTOM310432" + SV.db.framelocations.SVUI_ThreatBar_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-495182" + elseif toggle == "shift" then + SV.db.framelocations.SVUI_Player_MOVE = "BOTTOMSVUIParentBOTTOM-278210" + SV.db.framelocations.SVUI_PlayerCastbar_MOVE = "BOTTOMSVUIParentBOTTOM-278150" + SV.db.framelocations.SVUI_Target_MOVE = "BOTTOMSVUIParentBOTTOM278210" + SV.db.framelocations.SVUI_TargetCastbar_MOVE = "BOTTOMSVUIParentBOTTOM278150" + SV.db.framelocations.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM0209" + SV.db.framelocations.SVUI_TargetTarget_MOVE = "BOTTOMSVUIParentBOTTOM0242" + SV.db.framelocations.SVUI_Focus_MOVE = "BOTTOMSVUIParentBOTTOM310432" + SV.db.framelocations.SVUI_ThreatBar_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-495210" + else + local c = 136; + local d = 135; + local e = 80; + SV.db.framelocations.SVUI_Player_MOVE = "BOTTOMSVUIParentBOTTOM"..-c..""..d; + SV.db.framelocations.SVUI_PlayerCastbar_MOVE = "BOTTOMSVUIParentBOTTOM"..-c..""..(d-60); + SV.db.framelocations.SVUI_Target_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..d; + SV.db.framelocations.SVUI_TargetCastbar_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..(d-60); + SV.db.framelocations.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM"..-c..""..e; + SV.db.framelocations.SVUI_TargetTarget_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..e; + SV.db.framelocations.SVUI_Focus_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..(d + 150); + SV.db.framelocations.SVUI_ThreatBar_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-495"..d; + end +end + +local function UFMoveLeftQuadrant(toggle) + if not SV.db.framelocations then SV.db.framelocations = {} end + if not toggle then + SV.db.framelocations.SVUI_Assist_MOVE = "TOPLEFTSVUIParentTOPLEFT"..XOFF.."-250" + SV.db.framelocations.SVUI_Tank_MOVE = "TOPLEFTSVUIParentTOPLEFT"..XOFF.."-175" + SV.db.framelocations.SVUI_Raidpet_MOVE = "TOPLEFTSVUIParentTOPLEFT"..XOFF.."-325" + SV.db.framelocations.SVUI_Party_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" + SV.db.framelocations.SVUI_Raid10_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" + SV.db.framelocations.SVUI_Raid25_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" + SV.db.framelocations.SVUI_Raid40_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" + else + SV.db.framelocations.SVUI_Assist_MOVE = "TOPLEFTSVUIParentTOPLEFT4-250" + SV.db.framelocations.SVUI_Tank_MOVE = "TOPLEFTSVUIParentTOPLEFT4-175" + SV.db.framelocations.SVUI_Raidpet_MOVE = "TOPLEFTSVUIParentTOPLEFT4-325" + SV.db.framelocations.SVUI_Party_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" + SV.db.framelocations.SVUI_Raid40_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" + SV.db.framelocations.SVUI_Raid10_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" + SV.db.framelocations.SVUI_Raid25_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" + end +end + +local function UFMoveTopQuadrant(toggle) + if not SV.db.framelocations then SV.db.framelocations = {} end + if not toggle then + SV.db.framelocations.GM_MOVE = "TOPLEFTSVUIParentTOPLEFT250-25" + SV.db.framelocations.SVUI_LootFrame_MOVE = "BOTTOMSVUIParentBOTTOM0350" + SV.db.framelocations.SVUI_AltPowerBar_MOVE = "TOPSVUIParentTOP0-40" + SV.db.framelocations.LoC_MOVE = "BOTTOMSVUIParentBOTTOM0350" + SV.db.framelocations.BNET_MOVE = "TOPRIGHTSVUIParentTOPRIGHT-4-250" + else + SV.db.framelocations.GM_MOVE = "TOPLEFTSVUIParentTOPLEFT344-25" + SV.db.framelocations.SVUI_LootFrame_MOVE = "BOTTOMSVUIParentBOTTOM0254" + SV.db.framelocations.SVUI_AltPowerBar_MOVE = "TOPSVUIParentTOP0-39" + SV.db.framelocations.LoC_MOVE = "BOTTOMSVUIParentBOTTOM0443" + SV.db.framelocations.BNET_MOVE = "TOPRIGHTSVUIParentTOPRIGHT-4-248" + end +end + +local function UFMoveRightQuadrant(toggle) + if not SV.db.framelocations then SV.db.framelocations = {} end + local dH = SV.db.SVDock.dockRightHeight + 60 + if not toggle or toggle == "high" then + SV.db.framelocations.SVUI_BossHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" + SV.db.framelocations.SVUI_ArenaHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" + SV.db.framelocations.Tooltip_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-284"..dH; + else + SV.db.framelocations.SVUI_BossHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" + SV.db.framelocations.SVUI_ArenaHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" + SV.db.framelocations.Tooltip_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-284"..dH; + end +end + +local function initChat(mungs) + forceCVars() + FCF_ResetChatWindows() + FCF_SetLocked(ChatFrame1, 1) + FCF_DockFrame(ChatFrame2) + FCF_SetLocked(ChatFrame2, 1) + FCF_OpenNewWindow(LOOT) + FCF_DockFrame(ChatFrame3) + FCF_SetLocked(ChatFrame3, 1) + for i = 1, NUM_CHAT_WINDOWS do + local chat = _G["ChatFrame"..i] + local chatID = chat:GetID() + if i == 1 then + chat:ClearAllPoints() + chat:Point("BOTTOMLEFT", LeftSuperDock, "BOTTOMLEFT", 5, 5) + chat:Point("TOPRIGHT", LeftSuperDock, "TOPRIGHT", -5, -10) + end + FCF_SavePositionAndDimensions(chat) + FCF_StopDragging(chat) + FCF_SetChatWindowFontSize(nil, chat, 12) + if i == 1 then + FCF_SetWindowName(chat, GENERAL) + elseif i == 2 then + FCF_SetWindowName(chat, GUILD_EVENT_LOG) + elseif i == 3 then + FCF_SetWindowName(chat, LOOT) + end + end + ChatFrame_RemoveAllMessageGroups(ChatFrame1) + ChatFrame_AddMessageGroup(ChatFrame1, "SAY") + ChatFrame_AddMessageGroup(ChatFrame1, "EMOTE") + ChatFrame_AddMessageGroup(ChatFrame1, "YELL") + ChatFrame_AddMessageGroup(ChatFrame1, "GUILD") + ChatFrame_AddMessageGroup(ChatFrame1, "OFFICER") + ChatFrame_AddMessageGroup(ChatFrame1, "GUILD_ACHIEVEMENT") + ChatFrame_AddMessageGroup(ChatFrame1, "WHISPER") + ChatFrame_AddMessageGroup(ChatFrame1, "MONSTER_SAY") + ChatFrame_AddMessageGroup(ChatFrame1, "MONSTER_EMOTE") + ChatFrame_AddMessageGroup(ChatFrame1, "MONSTER_YELL") + ChatFrame_AddMessageGroup(ChatFrame1, "MONSTER_BOSS_EMOTE") + ChatFrame_AddMessageGroup(ChatFrame1, "PARTY") + ChatFrame_AddMessageGroup(ChatFrame1, "PARTY_LEADER") + ChatFrame_AddMessageGroup(ChatFrame1, "RAID") + ChatFrame_AddMessageGroup(ChatFrame1, "RAID_LEADER") + ChatFrame_AddMessageGroup(ChatFrame1, "RAID_WARNING") + ChatFrame_AddMessageGroup(ChatFrame1, "INSTANCE_CHAT") + ChatFrame_AddMessageGroup(ChatFrame1, "INSTANCE_CHAT_LEADER") + ChatFrame_AddMessageGroup(ChatFrame1, "BATTLEGROUND") + ChatFrame_AddMessageGroup(ChatFrame1, "BATTLEGROUND_LEADER") + ChatFrame_AddMessageGroup(ChatFrame1, "BG_HORDE") + ChatFrame_AddMessageGroup(ChatFrame1, "BG_ALLIANCE") + ChatFrame_AddMessageGroup(ChatFrame1, "BG_NEUTRAL") + ChatFrame_AddMessageGroup(ChatFrame1, "SYSTEM") + ChatFrame_AddMessageGroup(ChatFrame1, "ERRORS") + ChatFrame_AddMessageGroup(ChatFrame1, "AFK") + ChatFrame_AddMessageGroup(ChatFrame1, "DND") + ChatFrame_AddMessageGroup(ChatFrame1, "IGNORED") + ChatFrame_AddMessageGroup(ChatFrame1, "ACHIEVEMENT") + ChatFrame_AddMessageGroup(ChatFrame1, "BN_WHISPER") + ChatFrame_AddMessageGroup(ChatFrame1, "BN_CONVERSATION") + ChatFrame_AddMessageGroup(ChatFrame1, "BN_INLINE_TOAST_ALERT") + ChatFrame_AddMessageGroup(ChatFrame1, "COMBAT_FACTION_CHANGE") + ChatFrame_AddMessageGroup(ChatFrame1, "SKILL") + ChatFrame_AddMessageGroup(ChatFrame1, "LOOT") + ChatFrame_AddMessageGroup(ChatFrame1, "MONEY") + ChatFrame_AddMessageGroup(ChatFrame1, "COMBAT_XP_GAIN") + ChatFrame_AddMessageGroup(ChatFrame1, "COMBAT_HONOR_GAIN") + ChatFrame_AddMessageGroup(ChatFrame1, "COMBAT_GUILD_XP_GAIN") + + ChatFrame_RemoveAllMessageGroups(ChatFrame3) + ChatFrame_AddMessageGroup(ChatFrame3, "COMBAT_FACTION_CHANGE") + ChatFrame_AddMessageGroup(ChatFrame3, "SKILL") + ChatFrame_AddMessageGroup(ChatFrame3, "LOOT") + ChatFrame_AddMessageGroup(ChatFrame3, "MONEY") + ChatFrame_AddMessageGroup(ChatFrame3, "COMBAT_XP_GAIN") + ChatFrame_AddMessageGroup(ChatFrame3, "COMBAT_HONOR_GAIN") + ChatFrame_AddMessageGroup(ChatFrame3, "COMBAT_GUILD_XP_GAIN") + + ChatFrame_AddChannel(ChatFrame1, GENERAL) + + ToggleChatColorNamesByClassGroup(true, "SAY") + ToggleChatColorNamesByClassGroup(true, "EMOTE") + ToggleChatColorNamesByClassGroup(true, "YELL") + ToggleChatColorNamesByClassGroup(true, "GUILD") + ToggleChatColorNamesByClassGroup(true, "OFFICER") + ToggleChatColorNamesByClassGroup(true, "GUILD_ACHIEVEMENT") + ToggleChatColorNamesByClassGroup(true, "ACHIEVEMENT") + ToggleChatColorNamesByClassGroup(true, "WHISPER") + ToggleChatColorNamesByClassGroup(true, "PARTY") + ToggleChatColorNamesByClassGroup(true, "PARTY_LEADER") + ToggleChatColorNamesByClassGroup(true, "RAID") + ToggleChatColorNamesByClassGroup(true, "RAID_LEADER") + ToggleChatColorNamesByClassGroup(true, "RAID_WARNING") + ToggleChatColorNamesByClassGroup(true, "BATTLEGROUND") + ToggleChatColorNamesByClassGroup(true, "BATTLEGROUND_LEADER") + ToggleChatColorNamesByClassGroup(true, "INSTANCE_CHAT") + ToggleChatColorNamesByClassGroup(true, "INSTANCE_CHAT_LEADER") + ToggleChatColorNamesByClassGroup(true, "CHANNEL1") + ToggleChatColorNamesByClassGroup(true, "CHANNEL2") + ToggleChatColorNamesByClassGroup(true, "CHANNEL3") + ToggleChatColorNamesByClassGroup(true, "CHANNEL4") + ToggleChatColorNamesByClassGroup(true, "CHANNEL5") + ToggleChatColorNamesByClassGroup(true, "CHANNEL6") + ToggleChatColorNamesByClassGroup(true, "CHANNEL7") + ToggleChatColorNamesByClassGroup(true, "CHANNEL8") + ToggleChatColorNamesByClassGroup(true, "CHANNEL9") + ToggleChatColorNamesByClassGroup(true, "CHANNEL10") + ToggleChatColorNamesByClassGroup(true, "CHANNEL11") + + ChangeChatColor("CHANNEL1", 195 / 255, 230 / 255, 232 / 255) + ChangeChatColor("CHANNEL2", 232 / 255, 158 / 255, 121 / 255) + ChangeChatColor("CHANNEL3", 232 / 255, 228 / 255, 121 / 255) + + if not mungs then + if SV.Chat then + SV.Chat:ReLoad(true) + if SVUI_Cache["Dock"].RightSuperDockFaded == true then RightSuperDockToggleButton:Click()end + if SVUI_Cache["Dock"].LeftSuperDockFaded == true then LeftSuperDockToggleButton:Click()end + end + SV:SavedPopup() + end +end +--[[ +########################################################## +GLOBAL/MODULE FUNCTIONS +########################################################## +]]-- +function SV:SetUserScreen(rez, preserve) + if not preserve then + if okToResetMOVE then + self:ResetMovables("") + okToResetMOVE = false; + end + self.db:SetDefault("SVUnit") + end + + if not SV.db.framelocations then SV.db.framelocations = {} end + if rez == "low" then + if not preserve then + self.db.SVDock.dockLeftWidth = 350; + self.db.SVDock.dockLeftHeight = 180; + self.db.SVDock.dockRightWidth = 350; + self.db.SVDock.dockRightHeight = 180; + self.db.SVAura.wrapAfter = 10 + self.db.SVUnit.fontSize = 10; + self.db.SVUnit.player.width = 200; + self.db.SVUnit.player.castbar.width = 200; + self.db.SVUnit.player.classbar.fill = "fill" + self.db.SVUnit.player.health.tags = "[health:color][health:current]" + self.db.SVUnit.target.width = 200; + self.db.SVUnit.target.castbar.width = 200; + self.db.SVUnit.target.health.tags = "[health:color][health:current]" + self.db.SVUnit.pet.power.enable = false; + self.db.SVUnit.pet.width = 200; + self.db.SVUnit.pet.height = 26; + self.db.SVUnit.targettarget.debuffs.enable = false; + self.db.SVUnit.targettarget.power.enable = false; + self.db.SVUnit.targettarget.width = 200; + self.db.SVUnit.targettarget.height = 26; + self.db.SVUnit.boss.width = 200; + self.db.SVUnit.boss.castbar.width = 200; + self.db.SVUnit.arena.width = 200; + self.db.SVUnit.arena.castbar.width = 200 + end + if not mungs then + UFMoveBottomQuadrant(true) + UFMoveLeftQuadrant(true) + UFMoveTopQuadrant(true) + UFMoveRightQuadrant(true) + end + self.ghettoMonitor = true + else + self.db:SetDefault("SVDock") + self.db:SetDefault("SVAura") + if not mungs then + UFMoveBottomQuadrant() + UFMoveLeftQuadrant() + UFMoveTopQuadrant() + UFMoveRightQuadrant() + end + self.ghettoMonitor = nil + end + + if(not preserve and not mungs) then + BarShuffle() + self:SetSVMovablesPositions() + Registry:Update('SVDock') + Registry:Update('SVAura') + Registry:Update('SVBar') + Registry:Update('SVUnit') + SV:SavedPopup() + end +end + +function SV:SetColorTheme(style, preserve) + style = style or "default"; + + if not preserve then + self.db:SetDefault("media") + end + + local presets = self:LoadPresetData("media", style) + self.db.LAYOUT.mediastyle = style; + + if(style == "default") then + self.db.SVUnit.healthclass = true; + else + self.db.SVUnit.healthclass = false; + end + + if(not mungs) then + self:MediaUpdate() + Registry:Update('SVStats') + Registry:Update('SVUnit') + if(not preserve) then + SV:SavedPopup() + end + end +end + +function SV:SetUnitframeLayout(style, preserve) + style = style or "default"; + + if not SV.db.framelocations then SV.db.framelocations = {} end + + if not preserve then + self.db:SetDefault("SVUnit") + self.db:SetDefault("SVStats") + if okToResetMOVE then + self:ResetMovables('') + okToResetMOVE = false + end + end + + local presets = self:LoadPresetData("units", style) + self.db.LAYOUT.unitstyle = style + + if(self.db.LAYOUT.mediastyle == "default") then + self.db.SVUnit.healthclass = true; + end + + if(not mungs) then + if(not preserve) then + if self.db.LAYOUT.barstyle and (self.db.LAYOUT.barstyle == "twosmall" or self.db.LAYOUT.barstyle == "twobig") then + UFMoveBottomQuadrant("shift") + else + UFMoveBottomQuadrant() + end + self:SetSVMovablesPositions() + end + Registry:Update('SVStats') + Registry:Update('SVUnit') + if(not preserve) then + SV:SavedPopup() + end + end +end + +function SV:SetGroupframeLayout(style, preserve) + style = style or "default"; + + local presets = self:LoadPresetData("layouts", style) + self.db.LAYOUT.groupstyle = style + + if(not mungs) then + Registry:Update('SVUnit') + if(not preserve) then + SV:SavedPopup() + end + end +end + +function SV:SetupBarLayout(style, preserve) + style = style or "default"; + + if not SV.db.framelocations then SV.db.framelocations={} end + if not preserve then + self.db:SetDefault("SVBar") + if okToResetMOVE then + self:ResetMovables('') + okToResetMOVE=false + end + end + + local presets = self:LoadPresetData("bars", style) + self.db.LAYOUT.barstyle = style; + + if(not mungs) then + if(not preserve) then + if(style == 'twosmall' or style == 'twobig') then + UFMoveBottomQuadrant("shift") + else + UFMoveBottomQuadrant() + end + end + if(not preserve) then + BarShuffle() + self:SetSVMovablesPositions() + end + Registry:Update('SVStats') + Registry:Update('SVBar') + if(not preserve) then + SV:SavedPopup() + end + end +end + +function SV:SetupAuralayout(style, preserve) + style = style or "default"; + local presets = self:LoadPresetData("auras", style) + self.db.LAYOUT.aurastyle = style; + + if(not mungs) then + Registry:Update('SVStats') + Registry:Update('SVAura') + Registry:Update('SVUnit') + if(not preserve) then + SV:SavedPopup() + end + end +end + +local function PlayThemeSong() + if(not musicIsPlaying) then + SetCVar("Sound_MusicVolume", 100) + SetCVar("Sound_EnableMusic", 1) + StopMusic() + PlayMusic([[Interface\AddOns\SVUI\assets\sounds\SV.mp3]]) + musicIsPlaying = true + end +end + +local function InstallComplete() + SVUI_Profile.SAFEDATA.install_version = SV.___version; + StopMusic() + SetCVar("Sound_MusicVolume",user_music_vol) + okToResetMOVE = false; + ReloadUI() +end + +local function InstallMungsChoice() + mungs = true; + okToResetMOVE = false; + initChat(true); + SV:SetUserScreen('high'); + SV:SetColorTheme(); + SV.db.LAYOUT.unitstyle = nil; + SV:SetUnitframeLayout(); + SV.db.LAYOUT.groupstyle = nil; + SV.db.LAYOUT.barstyle = nil; + SV:SetupBarLayout(); + SV:SetupAuralayout(); + SVUI_Profile.SAFEDATA.install_version = SV.___version; + StopMusic() + SetCVar("Sound_MusicVolume",user_music_vol) + ReloadUI() +end + +local function ResetAll() + SVUI_InstallNextButton:Disable() + SVUI_InstallPrevButton:Disable() + SVUI_InstallOption01Button:Hide() + SVUI_InstallOption01Button:SetScript("OnClick",nil) + SVUI_InstallOption01Button:SetText("") + SVUI_InstallOption02Button:Hide() + SVUI_InstallOption02Button:SetScript("OnClick",nil) + SVUI_InstallOption02Button:SetText("") + SVUI_InstallOption03Button:Hide() + SVUI_InstallOption03Button:SetScript("OnClick",nil) + SVUI_InstallOption03Button:SetText("") + SVUI_InstallOption1Button:Hide() + SVUI_InstallOption1Button:SetScript("OnClick",nil) + SVUI_InstallOption1Button:SetText("") + SVUI_InstallOption2Button:Hide() + SVUI_InstallOption2Button:SetScript('OnClick',nil) + SVUI_InstallOption2Button:SetText('') + SVUI_InstallOption3Button:Hide() + SVUI_InstallOption3Button:SetScript('OnClick',nil) + SVUI_InstallOption3Button:SetText('') + SVUI_InstallOption4Button:Hide() + SVUI_InstallOption4Button:SetScript('OnClick',nil) + SVUI_InstallOption4Button:SetText('') + SVUI_SetupHolder.SubTitle:SetText("") + SVUI_SetupHolder.Desc1:SetText("") + SVUI_SetupHolder.Desc2:SetText("") + SVUI_SetupHolder.Desc3:SetText("") + SVUI_SetupHolder:Size(550,400) +end + +local function SetPage(newPage) + CURRENT_PAGE = newPage; + ResetAll() + InstallStatus.text:SetText(CURRENT_PAGE.." / "..MAX_PAGE) + local setupFrame = SVUI_SetupHolder; + if newPage ~= MAX_PAGE then + SVUI_InstallNextButton:Enable() + SVUI_InstallNextButton:Show() + end + if newPage ~= 1 then + SVUI_InstallPrevButton:Enable() + SVUI_InstallPrevButton:Show() + end + --[[ + more useful globalstrings + + CUSTOM + SETTINGS + DEFAULT + DEFAULTS + USE + UIOPTIONS_MENU + LFGWIZARD_TITLE + CONTINUE + ]]-- + ShowLayout() + if newPage == 1 then + local hasOldConfig = SVUI_Profile.SAFEDATA.install_version + SVUI_InstallPrevButton:Disable() + SVUI_InstallPrevButton:Hide() + okToResetMOVE = true + setupFrame.SubTitle:SetText(format(L["This is Supervillain UI version %s!"], SV.___version)) + setupFrame.Desc1:SetText(L["Before I can turn you loose, persuing whatever villainy you feel will advance your professional career... I need to ask some questions and turn a few screws first."]) + setupFrame.Desc2:SetText(L["At any time you can get to the config options by typing the command / sv. For quick changes to frame, bar or color sets, call your henchman by clicking the button on the bottom right of your screen. (Its the one with his stupid face on it)"]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + SVUI_InstallOption01Button:Show() + SVUI_InstallOption01Button:SetScript("OnClick", InstallMungsChoice) + SVUI_InstallOption01Button:SetText(USE.."\n"..DEFAULT.."\n"..SETTINGS) + + SVUI_InstallOption02Button:Show() + SVUI_InstallOption02Button:SetScript("OnClick", InstallComplete) + SVUI_InstallOption02Button:SetText("PRETEND YOU\nDID THIS\nALREADY") + + if(hasOldConfig) then + SVUI_InstallOption03Button:Show() + SVUI_InstallOption03Button:SetScript("OnClick", InstallComplete) + SVUI_InstallOption03Button:SetText("Keep\nSaved\n"..SETTINGS) + end + + elseif newPage == 2 then + setupFrame.SubTitle:SetText(CHAT) + setupFrame.Desc1:SetText(L["Whether you want to or not, you will be needing a communicator so other villains can either update you on their doings-of-evil or inform you about the MANY abilities of Chuck Norris"]) + setupFrame.Desc2:SetText(L["The chat windows function the same as standard chat windows, you can right click the tabs and drag them, rename them, slap them around, you know... whatever. Clickity-click to setup your chat windows."]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", function() + initChat(false) + end) + SVUI_InstallOption1Button:SetText(CHAT_DEFAULTS) + + elseif newPage == 3 then + local rez = GetCVar("gxResolution") + setupFrame.SubTitle:SetText(RESOLUTION) + setupFrame.Desc1:SetText(format(L["Your current resolution is %s, this is considered a %s resolution."], rez, (SV.ghettoMonitor and LOW or HIGH))) + if SV.ghettoMonitor then + setupFrame.Desc2:SetText(L["This resolution requires that you change some settings to get everything to fit on your screen."].." "..L["Click the button below to resize your chat frames, unitframes, and reposition your actionbars."].." "..L["You may need to further alter these settings depending how low your resolution is."]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + else + setupFrame.Desc2:SetText(L["This resolution doesn't require that you change settings for the UI to fit on your screen."].." "..L["Click the button below to resize your chat frames, unitframes, and reposition your actionbars."].." "..L["This is completely optional."]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + end + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", function() + SV:SetUserScreen("high") + SVUI_SetupHolder.Desc1:SetText(L["|cffFF9F00"..HIGH.." "..RESOLUTION.."!|r"]) + SVUI_SetupHolder.Desc2:SetText(L["So what you think your better than me with your big monitor? HUH?!?!"]) + SVUI_SetupHolder.Desc3:SetText(L["Dont forget whos in charge here! But enjoy the incredible detail."]) + end) + SVUI_InstallOption1Button:SetText(HIGH) + SVUI_InstallOption2Button:Show() + SVUI_InstallOption2Button:SetScript("OnClick", function() + SV:SetUserScreen("low") + SVUI_SetupHolder.Desc1:SetText(L["|cffFF9F00"..LOW.." "..RESOLUTION.."|r"]) + SVUI_SetupHolder.Desc2:SetText(L["Why are you playing this on what I would assume is a calculator display?"]) + SVUI_SetupHolder.Desc3:SetText(L["Enjoy the ONE incredible pixel that fits on this screen."]) + end) + SVUI_InstallOption2Button:SetText(LOW) + + elseif newPage == 4 then + setupFrame.SubTitle:SetText(COLOR.." "..SETTINGS) + setupFrame.Desc1:SetText(L["Choose a theme layout you wish to use for your initial setup."]) + setupFrame.Desc2:SetText(L["You can always change fonts and colors of any element of Supervillain UI from the in-game configuration."]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", function() + SV:SetColorTheme("kaboom") + SVUI_SetupHolder.Desc1:SetText(L["|cffFF9F00KABOOOOM!|r"]) + SVUI_SetupHolder.Desc2:SetText(L["This theme tells the world that you are a villain who can put on a show"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["or better yet, you ARE the show!"]) + end) + SVUI_InstallOption1Button:SetText(L["Kaboom!"]) + SVUI_InstallOption2Button:Show() + SVUI_InstallOption2Button:SetScript("OnClick", function() + SV:SetColorTheme("dark") + SVUI_SetupHolder.Desc1:SetText(L["|cffAF30FFThe Darkest Night|r"]) + SVUI_SetupHolder.Desc2:SetText(L["This theme indicates that you have no interest in wasting time"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L[" the dying begins NOW!"]) + end) + SVUI_InstallOption2Button:SetText(L["Darkness"]) + SVUI_InstallOption3Button:Show() + SVUI_InstallOption3Button:SetScript("OnClick", function() + SV:SetColorTheme("classy") + SVUI_SetupHolder.Desc1:SetText(L["|cffFFFF00"..CLASS_COLORS.."|r"]) + SVUI_SetupHolder.Desc2:SetText(L["This theme is for villains who take pride in their class"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L[" villains know how to reprezent!"]) + end) + SVUI_InstallOption3Button:SetText(L["Class" .. "\n" .. "Colors"]) + SVUI_InstallOption4Button:Show() + SVUI_InstallOption4Button:SetScript("OnClick", function() + SV:SetColorTheme() + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFPlain and Simple|r"]) + SVUI_SetupHolder.Desc2:SetText(L["This theme is for any villain who sticks to their traditions"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["you don't need fancyness to kick some ass!"]) + end) + SVUI_InstallOption4Button:SetText(L["Vintage"]) + + elseif newPage == 5 then + ShowLayout(true) + setupFrame.SubTitle:SetText(UNITFRAME_LABEL.." "..SETTINGS) + setupFrame.Desc1:SetText(L["You can now choose what primary unitframe style you wish to use."]) + setupFrame.Desc2:SetText(L["This will change the layout of your unitframes (ie.. Player, Target, Pet, Party, Raid ...etc)."]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", function() + SV.db.LAYOUT.unitstyle = nil; + SV:SetUnitframeLayout("super") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFLets Do This|r"]) + SVUI_SetupHolder.Desc2:SetText(L["This layout is anything but minimal! Using this is like being at a rock concert"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["then annihilating the crowd with frickin lazer beams!"]) + end) + SVUI_InstallOption1Button:SetText(L["Super"]) + SVUI_InstallOption2Button:Show() + SVUI_InstallOption2Button:SetScript("OnClick", function() + SV.db.LAYOUT.unitstyle = nil; + SV:SetUnitframeLayout("simple") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFSimply Simple|r"]) + SVUI_SetupHolder.Desc2:SetText(L["This layout is for the villain who just wants to get things done!"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["but he still wants to see your face before he hits you!"]) + end) + SVUI_InstallOption2Button:SetText(L["Simple"]) + SVUI_InstallOption3Button:Show() + SVUI_InstallOption3Button:SetScript("OnClick", function() + SV.db.LAYOUT.unitstyle = nil; + SV:SetUnitframeLayout("compact") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFEl Compacto|r"]) + SVUI_SetupHolder.Desc2:SetText(L["Just the necessities so you can see more of the world around you"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["you dont need no fanciness getting in the way of world domination do you?"]) + end) + SVUI_InstallOption3Button:SetText(L["Compact"]) + + elseif newPage == 6 then + ShowLayout(true) + setupFrame.SubTitle:SetText("Group Layout") + setupFrame.Desc1:SetText(L["You can now choose what group layout you prefer."]) + setupFrame.Desc2:SetText(L["This will adjust various settings on group units, attempting to make certain roles more usable"]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", function() + SV.db.LAYOUT.groupstyle = "default"; + SV:SetGroupframeLayout("default") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFStandard|r"]) + SVUI_SetupHolder.Desc2:SetText(L["You are good to go with the default layout"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["frames schmames, lets kill some stuff!"]) + end) + SVUI_InstallOption1Button:SetText(L["Standard"]) + + SVUI_InstallOption2Button:Show() + SVUI_InstallOption2Button:SetScript("OnClick", function() + SV.db.LAYOUT.groupstyle = nil; + SV:SetGroupframeLayout("healer") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFMEDIC!!|r"]) + SVUI_SetupHolder.Desc2:SetText(L["You are pretty helpful.. for a VILLAIN!"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["Hey, even a super villain gets his ass kicked once in awhile. We need the likes of you!"]) + end) + SVUI_InstallOption2Button:SetText(L["Healer"]) + + SVUI_InstallOption3Button:Show() + SVUI_InstallOption3Button:SetScript("OnClick", function() + SV.db.LAYOUT.groupstyle = nil; + SV:SetGroupframeLayout("dps") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFDeath Dealer|r"]) + SVUI_SetupHolder.Desc2:SetText(L["You are the kings of our craft. Handing out pain like its halloween candy."]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["I will move and squeeze group frames out of your way so you have more room for BOOM!"]) + end) + SVUI_InstallOption3Button:SetText(L["DPS"]) + + SVUI_InstallOption4Button:Show() + SVUI_InstallOption4Button:SetScript("OnClick", function() + SV.db.LAYOUT.groupstyle = nil; + SV:SetGroupframeLayout("grid") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFCubed|r"]) + SVUI_SetupHolder.Desc2:SetText(L["You are cold and calculated, your frames should reflect as much."]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["I'm gonna make these frames so precise that you can cut your finger on them!"]) + end) + SVUI_InstallOption4Button:SetText(L["Grid"]) + + elseif newPage == 7 then + setupFrame.SubTitle:SetText(ACTIONBAR_LABEL.." "..SETTINGS) + setupFrame.Desc1:SetText(L["Choose a layout for your action bars."]) + setupFrame.Desc2:SetText(L["Sometimes you need big buttons, sometimes you don't. Your choice here."]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", function() + SV.db.LAYOUT.barstyle = nil; + SV:SetupBarLayout("default") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFLean And Clean|r"]) + SVUI_SetupHolder.Desc2:SetText(L["Lets keep it slim and deadly, not unlike a ninja sword."]) + SVUI_SetupHolder.Desc3:SetText(L["You dont ever even look at your bar hardly, so pick this one!"]) + end) + SVUI_InstallOption1Button:SetText(L["Small" .. "\n" .. "Row"]) + SVUI_InstallOption2Button:Show() + SVUI_InstallOption2Button:SetScript("OnClick", function() + SV.db.LAYOUT.barstyle = nil; + SV:SetupBarLayout("twosmall") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFMore For Less|r"]) + SVUI_SetupHolder.Desc2:SetText(L["Granted, you dont REALLY need the buttons due to your hotkey-leetness, you just like watching cooldowns!"]) + SVUI_SetupHolder.Desc3:SetText(L["Sure thing cowboy, your secret is safe with me!"]) + end) + SVUI_InstallOption2Button:SetText(L["2 Small" .. "\n" .. "Rows"]) + SVUI_InstallOption3Button:Show() + SVUI_InstallOption3Button:SetScript("OnClick", function() + SV.db.LAYOUT.barstyle = nil; + SV:SetupBarLayout("onebig") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFWhat Big Buttons You Have|r"]) + SVUI_SetupHolder.Desc2:SetText(L["The better to PEW-PEW you with my dear!"]) + SVUI_SetupHolder.Desc3:SetText(L["When you have little time for mouse accuracy, choose this set!"]) + end) + SVUI_InstallOption3Button:SetText(L["Big" .. "\n" .. "Row"]) + SVUI_InstallOption4Button:Show() + SVUI_InstallOption4Button:SetScript("OnClick", function() + SV.db.LAYOUT.barstyle = nil; + SV:SetupBarLayout("twobig") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFThe Double Down|r"]) + SVUI_SetupHolder.Desc2:SetText(L["Lets be honest for a moment. Who doesnt like a huge pair in their face?"]) + SVUI_SetupHolder.Desc3:SetText(L["Double your bars then double their size for maximum button goodness!"]) + end) + SVUI_InstallOption4Button:SetText(L["2 Big" .. "\n" .. "Rows"]) + + elseif newPage == 8 then + setupFrame.SubTitle:SetText(AURAS.." "..SETTINGS) + setupFrame.Desc1:SetText(L["Select an aura layout. \"Icons\" will display only icons and aurabars won't be used. \"Bars\" will display only aurabars and icons won't be used (duh). \"The Works!\" does just what it says.... icons, bars and awesomeness."]) + setupFrame.Desc2:SetText(L["If you have an aura that you don't want to display simply hold down shift and right click the icon for it to suffer a painful death."]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", function() + SV:SetupAuralayout() + end) + SVUI_InstallOption1Button:SetText(L["Vintage"]) + + SVUI_InstallOption2Button:Show() + SVUI_InstallOption2Button:SetScript("OnClick", function() + SV:SetupAuralayout("icons") + end) + SVUI_InstallOption2Button:SetText(L["Icons"]) + + SVUI_InstallOption3Button:Show() + SVUI_InstallOption3Button:SetScript("OnClick", function() + SV:SetupAuralayout("bars") + end) + SVUI_InstallOption3Button:SetText(L["Bars"]) + + SVUI_InstallOption4Button:Show() + SVUI_InstallOption4Button:SetScript("OnClick", function() + SV:SetupAuralayout("theworks") + end) + SVUI_InstallOption4Button:SetText(L["The" .. "\n" .. "Works!"]) + + elseif newPage == 9 then + SVUI_InstallNextButton:Disable() + SVUI_InstallNextButton:Hide() + setupFrame.SubTitle:SetText(BASIC_OPTIONS_TOOLTIP..CONTINUED..AUCTION_TIME_LEFT0) + setupFrame.Desc1:SetText(L["Thats it! All done! Now we just need to hand these choices off to the henchmen so they can get you ready to (..insert evil tasks here..)!"]) + setupFrame.Desc2:SetText(L["Click the button below to reload and get on your way! Good luck villain!"]) + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", InstallComplete) + SVUI_InstallOption1Button:SetText(L["THE_BUTTON_BELOW"]) + SVUI_SetupHolder:Size(550, 350) + end +end + +local function NextPage() + if CURRENT_PAGE ~= MAX_PAGE then + CURRENT_PAGE = CURRENT_PAGE + 1; + SetPage(CURRENT_PAGE) + end +end + +local function PreviousPage() + if CURRENT_PAGE ~= 1 then + CURRENT_PAGE = CURRENT_PAGE - 1; + SetPage(CURRENT_PAGE) + end +end + +local function ResetGlobalVariables() + for k,v in pairs(SVUI_Cache) do + SVUI_Cache[k] = nil + end +end + +function SV:ResetInstallation() + mungs = true; + okToResetMOVE = false; + initChat(true); + SV.db:Reset() + SV:SetUserScreen(); + + if SV.db.LAYOUT.mediastyle then + SV:SetColorTheme(SV.db.LAYOUT.mediastyle) + else + SV.db.LAYOUT.mediastyle = nil; + SV:SetColorTheme() + end + + if SV.db.LAYOUT.unitstyle then + SV:SetUnitframeLayout(SV.db.LAYOUT.unitstyle) + else + SV.db.LAYOUT.unitstyle = nil; + SV:SetUnitframeLayout() + end + + if SV.db.LAYOUT.barstyle then + SV:SetupBarLayout(SV.db.LAYOUT.barstyle) + else + SV.db.LAYOUT.barstyle = nil; + SV:SetupBarLayout() + end + + if SV.db.LAYOUT.aurastyle then + SV:SetupAuralayout(SV.db.LAYOUT.aurastyle) + else + SV.db.LAYOUT.aurastyle = nil; + SV:SetupAuralayout() + end + + SVUI_Profile.SAFEDATA.install_version = SV.___version; + ResetGlobalVariables() + ReloadUI() +end + +function SV:Install(autoLoaded) + if(not user_music_vol) then + user_music_vol = GetCVar("Sound_MusicVolume") + end + + -- frame + if not SVUI_SetupHolder then + local frame = CreateFrame("Button", "SVUI_SetupHolder", UIParent) + frame.SetPage = SetPage; + frame:Size(550, 400) + frame:SetPanelTemplate("Action") + frame:SetPoint("CENTER") + frame:SetFrameStrata("TOOLTIP") + frame.Title = frame:CreateFontString(nil, "OVERLAY") + frame.Title:SetFont(SV.Media.font.narrator, 22, "OUTLINE") + frame.Title:Point("TOP", 0, -5) + frame.Title:SetText(L["Supervillain UI Installation"]) + + frame.Next = CreateFrame("Button", "SVUI_InstallNextButton", frame, "UIPanelButtonTemplate") + frame.Next:RemoveTextures() + frame.Next:Size(110, 25) + frame.Next:Point("BOTTOMRIGHT", 50, 5) + SetInstallButton(frame.Next) + frame.Next.texture = frame.Next:CreateTexture(nil, "BORDER") + frame.Next.texture:Size(110, 75) + frame.Next.texture:Point("RIGHT") + frame.Next.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION-ARROW") + frame.Next.texture:SetVertexColor(1, 0.5, 0) + frame.Next.text = frame.Next:CreateFontString(nil, "OVERLAY") + frame.Next.text:SetFont(SV.Media.font.action, 18, "OUTLINE") + frame.Next.text:SetPoint("CENTER") + frame.Next.text:SetText(CONTINUE) + frame.Next:Disable() + frame.Next:SetScript("OnClick", NextPage) + frame.Next:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(1, 1, 0) + end) + frame.Next:SetScript("OnLeave", function(this) + this.texture:SetVertexColor(1, 0.5, 0) + end) + + frame.Prev = CreateFrame("Button", "SVUI_InstallPrevButton", frame, "UIPanelButtonTemplate") + frame.Prev:RemoveTextures() + frame.Prev:Size(110, 25) + frame.Prev:Point("BOTTOMLEFT", -50, 5) + SetInstallButton(frame.Prev) + frame.Prev.texture = frame.Prev:CreateTexture(nil, "BORDER") + frame.Prev.texture:Size(110, 75) + frame.Prev.texture:Point("LEFT") + frame.Prev.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION-ARROW") + frame.Prev.texture:SetTexCoord(1, 0, 1, 1, 0, 0, 0, 1) + frame.Prev.texture:SetVertexColor(1, 0.5, 0) + frame.Prev.text = frame.Prev:CreateFontString(nil, "OVERLAY") + frame.Prev.text:SetFont(SV.Media.font.action, 18, "OUTLINE") + frame.Prev.text:SetPoint("CENTER") + frame.Prev.text:SetText(PREVIOUS) + frame.Prev:Disable() + frame.Prev:SetScript("OnClick", PreviousPage) + frame.Prev:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(1, 1, 0) + end) + frame.Prev:SetScript("OnLeave", function(this) + this.texture:SetVertexColor(1, 0.5, 0) + end) + frame.Status = CreateFrame("Frame", "InstallStatus", frame) + frame.Status:SetFrameLevel(frame.Status:GetFrameLevel() + 2) + frame.Status:Size(150, 30) + frame.Status:Point("BOTTOM", frame, "TOP", 0, 2) + frame.Status.text = frame.Status:CreateFontString(nil, "OVERLAY") + frame.Status.text:SetFont(SV.Media.font.numbers, 22, "OUTLINE") + frame.Status.text:SetPoint("CENTER") + frame.Status.text:SetText(CURRENT_PAGE.." / "..MAX_PAGE) + + frame.Option01 = CreateFrame("Button", "SVUI_InstallOption01Button", frame, "UIPanelButtonTemplate") + frame.Option01:RemoveTextures() + frame.Option01:Size(160, 30) + frame.Option01:Point("BOTTOM", 0, 15) + frame.Option01:SetText("") + SetInstallButton(frame.Option01) + frame.Option01.texture = frame.Option01:CreateTexture(nil, "BORDER") + frame.Option01.texture:Size(160, 160) + frame.Option01.texture:Point("CENTER", frame.Option01, "BOTTOM", 0, -15) + frame.Option01.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") + frame.Option01.texture:SetGradient("VERTICAL", 0, 0.3, 0, 0, 0.7, 0) + frame.Option01:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(0.5, 1, 0.4) + end) + frame.Option01:SetScript("OnLeave", function(this) + this.texture:SetGradient("VERTICAL", 0, 0.3, 0, 0, 0.7, 0) + end) + hooksecurefunc(frame.Option01, "SetWidth", function(g, h) + g.texture:Size(h, h) + g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) + end) + frame.Option01:SetFrameLevel(frame.Option01:GetFrameLevel() + 10) + frame.Option01:Hide() + + frame.Option02 = CreateFrame("Button", "SVUI_InstallOption02Button", frame, "UIPanelButtonTemplate") + frame.Option02:RemoveTextures() + frame.Option02:Size(130, 30) + frame.Option02:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) + frame.Option02:SetText("") + SetInstallButton(frame.Option02) + frame.Option02.texture = frame.Option02:CreateTexture(nil, "BORDER") + frame.Option02.texture:Size(130, 110) + frame.Option02.texture:Point("CENTER", frame.Option02, "BOTTOM", 0, -15) + frame.Option02.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") + frame.Option02.texture:SetGradient("VERTICAL", 0.3, 0, 0, 0.7, 0, 0) + frame.Option02:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(0.5, 1, 0.4) + end) + frame.Option02:SetScript("OnLeave", function(this) + this.texture:SetGradient("VERTICAL", 0.3, 0, 0, 0.7, 0, 0) + end) + hooksecurefunc(frame.Option02, "SetWidth", function(g, h) + g.texture:Size(h, h) + g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) + end) + frame.Option02:SetScript("OnShow", function() + frame.Option01:SetWidth(130) + frame.Option01:ClearAllPoints() + frame.Option01:Point("BOTTOMRIGHT", frame, "BOTTOM", -4, 15) + end) + frame.Option02:SetScript("OnHide", function() + frame.Option01:SetWidth(160) + frame.Option01:ClearAllPoints() + frame.Option01:Point("BOTTOM", 0, 15) + end) + frame.Option02:SetFrameLevel(frame.Option01:GetFrameLevel() + 10) + frame.Option02:Hide() + + frame.Option03 = CreateFrame("Button", "SVUI_InstallOption03Button", frame, "UIPanelButtonTemplate") + frame.Option03:RemoveTextures() + frame.Option03:Size(130, 30) + frame.Option03:Point("BOTTOM", frame, "BOTTOM", 0, 15) + frame.Option03:SetText("") + SetInstallButton(frame.Option03) + frame.Option03.texture = frame.Option03:CreateTexture(nil, "BORDER") + frame.Option03.texture:Size(130, 110) + frame.Option03.texture:Point("CENTER", frame.Option03, "BOTTOM", 0, -15) + frame.Option03.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") + frame.Option03.texture:SetGradient("VERTICAL", 0, 0.1, 0.3, 0, 0.5, 0.7) + frame.Option03:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(0.2, 0.5, 1) + end) + frame.Option03:SetScript("OnLeave", function(this) + this.texture:SetGradient("VERTICAL", 0, 0.1, 0.3, 0, 0.5, 0.7) + end) + hooksecurefunc(frame.Option03, "SetWidth", function(g, h) + g.texture:Size(h, h) + g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) + end) + frame.Option03:SetScript("OnShow", function(self) + self:SetWidth(130) + frame.Option01:SetWidth(130) + frame.Option01:ClearAllPoints() + frame.Option01:Point("RIGHT", self, "LEFT", -8, 0) + frame.Option02:SetWidth(130) + frame.Option02:ClearAllPoints() + frame.Option02:Point("LEFT", self, "RIGHT", 8, 0) + end) + frame.Option03:SetScript("OnHide", function() + frame.Option01:SetWidth(160) + frame.Option01:ClearAllPoints() + frame.Option01:Point("BOTTOM", 0, 15) + frame.Option02:ClearAllPoints() + frame.Option02:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) + end) + frame.Option03:SetFrameLevel(frame.Option01:GetFrameLevel() + 10) + frame.Option03:Hide() + + frame.Option1 = CreateFrame("Button", "SVUI_InstallOption1Button", frame, "UIPanelButtonTemplate") + frame.Option1:RemoveTextures() + frame.Option1:Size(160, 30) + frame.Option1:Point("BOTTOM", 0, 15) + frame.Option1:SetText("") + SetInstallButton(frame.Option1) + frame.Option1.texture = frame.Option1:CreateTexture(nil, "BORDER") + frame.Option1.texture:Size(160, 160) + frame.Option1.texture:Point("CENTER", frame.Option1, "BOTTOM", 0, -15) + frame.Option1.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") + frame.Option1.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + frame.Option1:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(0.5, 1, 0.4) + end) + frame.Option1:SetScript("OnLeave", function(this) + this.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + end) + hooksecurefunc(frame.Option1, "SetWidth", function(g, h) + g.texture:Size(h, h) + g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) + end) + frame.Option1:SetFrameLevel(frame.Option1:GetFrameLevel() + 10) + frame.Option1:Hide() + + frame.Option2 = CreateFrame("Button", "SVUI_InstallOption2Button", frame, "UIPanelButtonTemplate") + frame.Option2:RemoveTextures() + frame.Option2:Size(120, 30) + frame.Option2:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) + frame.Option2:SetText("") + SetInstallButton(frame.Option2) + frame.Option2.texture = frame.Option2:CreateTexture(nil, "BORDER") + frame.Option2.texture:Size(120, 110) + frame.Option2.texture:Point("CENTER", frame.Option2, "BOTTOM", 0, -15) + frame.Option2.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") + frame.Option2.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + frame.Option2:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(0.5, 1, 0.4) + end) + frame.Option2:SetScript("OnLeave", function(this) + this.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + end) + hooksecurefunc(frame.Option2, "SetWidth", function(g, h) + g.texture:Size(h, h) + g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) + end) + frame.Option2:SetScript("OnShow", function() + frame.Option1:SetWidth(120) + frame.Option1:ClearAllPoints() + frame.Option1:Point("BOTTOMRIGHT", frame, "BOTTOM", -4, 15) + end) + frame.Option2:SetScript("OnHide", function() + frame.Option1:SetWidth(160) + frame.Option1:ClearAllPoints() + frame.Option1:Point("BOTTOM", 0, 15) + end) + frame.Option2:SetFrameLevel(frame.Option1:GetFrameLevel() + 10) + frame.Option2:Hide() + + frame.Option3 = CreateFrame("Button", "SVUI_InstallOption3Button", frame, "UIPanelButtonTemplate") + frame.Option3:RemoveTextures() + frame.Option3:Size(110, 30) + frame.Option3:Point("LEFT", frame.Option2, "RIGHT", 4, 0) + frame.Option3:SetText("") + SetInstallButton(frame.Option3) + frame.Option3.texture = frame.Option3:CreateTexture(nil, "BORDER") + frame.Option3.texture:Size(110, 100) + frame.Option3.texture:Point("CENTER", frame.Option3, "BOTTOM", 0, -9) + frame.Option3.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") + frame.Option3.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + frame.Option3:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(0.5, 1, 0.4) + end) + frame.Option3:SetScript("OnLeave", function(this) + this.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + end) + frame.Option3:SetScript("OnShow", function() + frame.Option1:SetWidth(110) + frame.Option1:ClearAllPoints() + frame.Option1:Point("RIGHT", frame.Option2, "LEFT", -4, 0) + frame.Option2:SetWidth(110) + frame.Option2:ClearAllPoints() + frame.Option2:Point("BOTTOM", frame, "BOTTOM", 0, 15) + end) + frame.Option3:SetScript("OnHide", function() + frame.Option1:SetWidth(160) + frame.Option1:ClearAllPoints() + frame.Option1:Point("BOTTOM", 0, 15) + frame.Option2:SetWidth(120) + frame.Option2:ClearAllPoints() + frame.Option2:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) + end) + frame.Option3:SetFrameLevel(frame.Option1:GetFrameLevel() + 10) + frame.Option3:Hide() + + frame.Option4 = CreateFrame("Button", "SVUI_InstallOption4Button", frame, "UIPanelButtonTemplate") + frame.Option4:RemoveTextures() + frame.Option4:Size(110, 30) + frame.Option4:Point("LEFT", frame.Option3, "RIGHT", 4, 0) + frame.Option4:SetText("") + SetInstallButton(frame.Option4) + frame.Option4.texture = frame.Option4:CreateTexture(nil, "BORDER") + frame.Option4.texture:Size(110, 100) + frame.Option4.texture:Point("CENTER", frame.Option4, "BOTTOM", 0, -9) + frame.Option4.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") + frame.Option4.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + frame.Option4:SetScript("OnEnter", function(this) + this.texture:SetVertexColor(0.5, 1, 0.4) + end) + frame.Option4:SetScript("OnLeave", function(this) + this.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) + end) + frame.Option4:SetScript("OnShow", function() + frame.Option1:Width(110) + frame.Option2:Width(110) + frame.Option1:ClearAllPoints() + frame.Option1:Point("RIGHT", frame.Option2, "LEFT", -4, 0) + frame.Option2:ClearAllPoints() + frame.Option2:Point("BOTTOMRIGHT", frame, "BOTTOM", -4, 15) + end) + frame.Option4:SetScript("OnHide", function() + frame.Option1:SetWidth(160) + frame.Option1:ClearAllPoints() + frame.Option1:Point("BOTTOM", 0, 15) + frame.Option2:SetWidth(120) + frame.Option2:ClearAllPoints() + frame.Option2:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) + end) + + frame.Option4:SetFrameLevel(frame.Option1:GetFrameLevel() + 10) + frame.Option4:Hide() + + frame.SubTitle = frame:CreateFontString(nil, "OVERLAY") + frame.SubTitle:SetFont(SV.Media.font.roboto, 16, "OUTLINE") + frame.SubTitle:Point("TOP", 0, -40) + frame.Desc1 = frame:CreateFontString(nil, "OVERLAY") + frame.Desc1:SetFont(SV.Media.font.roboto, 14, "OUTLINE") + frame.Desc1:Point("TOPLEFT", 20, -75) + frame.Desc1:Width(frame:GetWidth()-40) + frame.Desc2 = frame:CreateFontString(nil, "OVERLAY") + frame.Desc2:SetFont(SV.Media.font.roboto, 14, "OUTLINE") + frame.Desc2:Point("TOPLEFT", 20, -125) + frame.Desc2:Width(frame:GetWidth()-40) + frame.Desc3 = frame:CreateFontString(nil, "OVERLAY") + frame.Desc3:SetFont(SV.Media.font.roboto, 14, "OUTLINE") + frame.Desc3:Point("TOPLEFT", 20, -175) + frame.Desc3:Width(frame:GetWidth()-40) + local closeButton = CreateFrame("Button", "SVUI_InstallCloseButton", frame, "UIPanelCloseButton") + closeButton:SetPoint("TOPRIGHT", frame, "TOPRIGHT") + closeButton:SetScript("OnClick", function()frame:Hide()end) + frame.tutorialImage = frame:CreateTexture("InstallTutorialImage", "OVERLAY") + frame.tutorialImage:Size(256, 128) + frame.tutorialImage:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\SPLASH") + frame.tutorialImage:Point("BOTTOM", 0, 70) + end + + SVUI_SetupHolder:SetScript("OnHide", function() + StopMusic() + SetCVar("Sound_MusicVolume", user_music_vol) + musicIsPlaying = nil + end) + + SVUI_SetupHolder:Show() + NextPage() + if(not autoLoaded) then + PlayThemeSong() + else + SV.Timers:ExecuteTimer(PlayThemeSong, 5) + end +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua b/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua index e1e7e0d..f15e9bf 100644 --- a/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua +++ b/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua @@ -262,7 +262,7 @@ local function SaveActionButton(parent) cooldown.SizeOverride = MOD.db.cooldownSize MOD:FixKeybindText(parent) if not MOD.ButtonCache[parent] then - SV:AddCD(cooldown) + SV.Timers:AddCooldown(cooldown) MOD.ButtonCache[parent] = true end parent:SetSlotTemplate(true, 2, 0, 0) @@ -458,7 +458,7 @@ do function SetSpellFlyoutHook() SpellFlyout:HookScript("OnShow",SpellFlyout_OnShow); - SV:ExecuteTimer(QualifyFlyouts, 5) + SV.Timers:ExecuteTimer(QualifyFlyouts, 5) end end --[[ diff --git a/Interface/AddOns/SVUI/packages/bag/SVBag.lua b/Interface/AddOns/SVUI/packages/bag/SVBag.lua index 3a97a67..093b9d7 100644 --- a/Interface/AddOns/SVUI/packages/bag/SVBag.lua +++ b/Interface/AddOns/SVUI/packages/bag/SVBag.lua @@ -444,7 +444,7 @@ function MOD:Layout(isBank, isReagent) f.Bags[bagID][slotID].iconTexture:FillInner(f.Bags[bagID][slotID]); f.Bags[bagID][slotID].iconTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9 ); f.Bags[bagID][slotID].cooldown = _G[f.Bags[bagID][slotID]:GetName().."Cooldown"]; - SV:AddCD(f.Bags[bagID][slotID].cooldown) + SV.Timers:AddCooldown(f.Bags[bagID][slotID].cooldown) f.Bags[bagID][slotID].bagID = bagID f.Bags[bagID][slotID].slotID = slotID end @@ -1420,7 +1420,7 @@ function MOD:Load() self:ModifyBags() self:Layout(false) self:DisableBlizzard() - SV:ExecuteTimer(MOD.BreakStuffLoader, 5) + SV.Timers:ExecuteTimer(MOD.BreakStuffLoader, 5) self:RegisterEvent("INVENTORY_SEARCH_UPDATE") self:RegisterEvent("PLAYER_MONEY", "UpdateGoldText") self:RegisterEvent("PLAYER_ENTERING_WORLD") diff --git a/Interface/AddOns/SVUI/packages/dock/SVDock.lua b/Interface/AddOns/SVUI/packages/dock/SVDock.lua index 29d2e5a..acae141 100644 --- a/Interface/AddOns/SVUI/packages/dock/SVDock.lua +++ b/Interface/AddOns/SVUI/packages/dock/SVDock.lua @@ -1000,7 +1000,7 @@ function MOD:Load() SuperDockletMain:SetScript("OnShow", DockletFrame_OnShow) SuperDockletExtra:SetScript("OnShow", DockletFrame_OnShow) SV:ReloadDocklets(true) - SV:ExecuteTimer(self.LoadToolBarProfessions, 5) + SV.Timers:ExecuteTimer(self.LoadToolBarProfessions, 5) end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI/packages/gear/SVGear.lua b/Interface/AddOns/SVUI/packages/gear/SVGear.lua index 9274f13..496cfcf 100644 --- a/Interface/AddOns/SVUI/packages/gear/SVGear.lua +++ b/Interface/AddOns/SVUI/packages/gear/SVGear.lua @@ -229,7 +229,7 @@ local function RefreshGear() end local Gear_UpdateTabs = function() - SV:ExecuteTimer(RefreshInspectedGear, 0.2) + SV.Timers:ExecuteTimer(RefreshInspectedGear, 0.2) end local function GearSwap() @@ -262,7 +262,7 @@ function MOD:PLAYER_ENTERING_WORLD() SetDisplayStats("Character") SetDisplayStats("Inspect") NewHook('InspectFrame_UpdateTabs', Gear_UpdateTabs) - SV:ExecuteTimer(RefreshGear, 10) + SV.Timers:ExecuteTimer(RefreshGear, 10) GearSwap() self.PreBuildComplete = true end diff --git a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua index 19abf35..053e83b 100644 --- a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua +++ b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua @@ -141,7 +141,7 @@ end local Speech_OnEnter = function(self) SV:SecureFadeOut(self, 0.5, 1, 0) - local newTimer = SV:ExecuteTimer(Speech_OnTimeout, 0.5, speechTimer) + local newTimer = SV.Timers:ExecuteTimer(Speech_OnTimeout, 0.5, speechTimer) speechTimer = newTimer self:SetScript("OnEnter", nil) end @@ -149,7 +149,7 @@ end local Speech_OnShow = function(self) if self.message then self.txt:SetText(self.message) - local newTimer = SV:ExecuteTimer(Speech_OnTimeout, 5, speechTimer) + local newTimer = SV.Timers:ExecuteTimer(Speech_OnTimeout, 5, speechTimer) speechTimer = newTimer self.message = nil self:SetScript("OnEnter", Speech_OnEnter) diff --git a/Interface/AddOns/SVUI/packages/map/SVMap.lua b/Interface/AddOns/SVUI/packages/map/SVMap.lua index 2e19e19..33156e1 100644 --- a/Interface/AddOns/SVUI/packages/map/SVMap.lua +++ b/Interface/AddOns/SVUI/packages/map/SVMap.lua @@ -263,7 +263,7 @@ do function MOD:UpdateMinimapButtonSettings() if(not self.db.minimapbar.enable) then return end - SV:ExecuteTimer(StyleMinimapButtons, 4) + SV.Timers:ExecuteTimer(StyleMinimapButtons, 4) end end @@ -416,7 +416,7 @@ local function UpdateWorldMapConfig() if(not MOD.db.playercoords or MOD.db.playercoords == "HIDE") then if MOD.CoordTimer then - SV:RemoveLoop(MOD.CoordTimer) + SV.Timers:RemoveLoop(MOD.CoordTimer) MOD.CoordTimer = nil; end SVUI_MiniMapCoords.playerXCoords:SetText("") @@ -424,7 +424,7 @@ local function UpdateWorldMapConfig() SVUI_MiniMapCoords:Hide() else SVUI_MiniMapCoords:Show() - MOD.CoordTimer = SV:ExecuteLoop(UpdateMapCoords, 0.2) + MOD.CoordTimer = SV.Timers:ExecuteLoop(UpdateMapCoords, 0.2) UpdateMapCoords() end AdjustMapSize() diff --git a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua index 0836e3c..3ee1ed4 100644 --- a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua +++ b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua @@ -53,7 +53,6 @@ MODULE AND INNER CLASSES local MOD = {} MOD.Units = {} MOD.Headers = {} -MOD.Roster = {} oUF_Villain.SVConfigs = {} --[[ @@ -1271,7 +1270,7 @@ function MOD:UpdateGroupConfig(headerFrame, setForced) SetProxyEnv() local key = headerFrame.___groupkey - local db = MOD.db[key] + local db = self.db[key] headerFrame.forceShow = setForced; headerFrame.forceShowAuras = setForced; headerFrame.isForced = setForced; @@ -1314,7 +1313,7 @@ function MOD:UpdateGroupConfig(headerFrame, setForced) groupFrame:SetAttribute(attr, true) end - MOD:RestrictChildren(groupFrame, groupFrame:GetChildren()) + self:RestrictChildren(groupFrame, groupFrame:GetChildren()) groupFrame:SetAttribute("startingIndex", 1) groupFrame:Update() end diff --git a/Interface/AddOns/SVUI/packages/unit/frames.lua b/Interface/AddOns/SVUI/packages/unit/frames.lua index 68a3d94..970a268 100644 --- a/Interface/AddOns/SVUI/packages/unit/frames.lua +++ b/Interface/AddOns/SVUI/packages/unit/frames.lua @@ -42,7 +42,7 @@ local ceil,tinsert = math.ceil,table.insert LOCAL DATA ########################################################## ]]-- -local CONSTRUCTORS, UPDATERS = {}, {} +local CONSTRUCTORS = {} local lastArenaFrame, lastBossFrame local sortMapping = { ["DOWN_RIGHT"] = {[1]="TOP",[2]="TOPLEFT",[3]="LEFT",[4]="RIGHT",[5]="LEFT",[6]=1,[7]=-1,[8]=false}, @@ -288,9 +288,8 @@ local UpdatePlayerFrame = function(self) end self:UpdateAllElements() end -UPDATERS["player"] = UpdatePlayerFrame -local ConstructPlayer = function(self, unit) +CONSTRUCTORS["player"] = function(self, unit) local key = "player" self.unit = unit self.___key = key @@ -327,7 +326,6 @@ local ConstructPlayer = function(self, unit) return self end -CONSTRUCTORS["player"] = ConstructPlayer --[[ ########################################################## TARGET @@ -359,7 +357,7 @@ local UpdateTargetFrame = function(self) self.XRay:Hide() end - if not IsAddOnLoaded("Clique")then + if(not IsAddOnLoaded("Clique")) then if db.middleClickFocus then self:SetAttribute("type3", "focus") elseif self:GetAttribute("type3") == "focus"then @@ -393,7 +391,6 @@ local UpdateTargetFrame = function(self) self:UpdateAllElements() end -UPDATERS["target"] = UpdateTargetFrame CONSTRUCTORS["target"] = function(self, unit) local key = "target" @@ -461,7 +458,6 @@ local UpdateTargetTargetFrame = function(self) MOD:RefreshUnitLayout(self, "targettarget") self:UpdateAllElements() end -UPDATERS["targettarget"] = UpdateTargetTargetFrame CONSTRUCTORS["targettarget"] = function(self, unit) local key = "targettarget" @@ -510,7 +506,6 @@ local UpdatePetFrame = function(self) MOD:UpdateAuraWatch(self, "pet") self:UpdateAllElements() end -UPDATERS["pet"] = UpdatePetFrame CONSTRUCTORS["pet"] = function(self, unit) local key = "pet" @@ -560,7 +555,6 @@ local UpdatePetTargetFrame = function(self) end self:UpdateAllElements() end -UPDATERS["pettarget"] = UpdatePetTargetFrame CONSTRUCTORS["pettarget"] = function(self, unit) local key = "pettarget" @@ -609,7 +603,6 @@ local UpdateFocusFrame = function(self) MOD:UpdateAuraWatch(self, "focus") self:UpdateAllElements() end -UPDATERS["focus"] = UpdateFocusFrame CONSTRUCTORS["focus"] = function(self, unit) local key = "focus" @@ -666,7 +659,6 @@ local UpdateFocusTargetFrame = function(self) MOD:RefreshUnitLayout(self, "focustarget") self:UpdateAllElements() end -UPDATERS["focustarget"] = UpdateFocusTargetFrame CONSTRUCTORS["focustarget"] = function(self, unit) local key = "focustarget" @@ -708,6 +700,7 @@ local UpdateBossFrame = function(self) self.colors = oUF_Villain.colors; self:Size(UNIT_WIDTH, UNIT_HEIGHT) self:ClearAllPoints() + if(tonumber(INDEX) == 1) then holder:Width(UNIT_WIDTH) holder:Height(UNIT_HEIGHT + (UNIT_HEIGHT + 12 + db.castbar.height) * 4) @@ -724,11 +717,11 @@ local UpdateBossFrame = function(self) self:Point("TOPRIGHT", holder, "TOPRIGHT", 0, -yOffset) end end + self:RegisterForClicks(MOD.db.fastClickTarget and "AnyDown" or "AnyUp") MOD:RefreshUnitLayout(self, "boss") self:UpdateAllElements() end -UPDATERS["boss"] = UpdateBossFrame CONSTRUCTORS["boss"] = function(self, unit) local key = "boss" @@ -743,6 +736,7 @@ CONSTRUCTORS["boss"] = function(self, unit) MOD:SetActionPanel(self, key) self.Health = MOD:CreateHealthBar(self, true, true) + self.Health.frequentUpdates = true self.Power = MOD:CreatePowerBar(self, true, true) MOD:CreatePortrait(self) self.Buffs = MOD:CreateBuffs(self, key) @@ -891,8 +885,7 @@ local UpdateArenaFrame = function(self) end self:UpdateAllElements() -end -UPDATERS["arena"] = UpdateArenaFrame +end CONSTRUCTORS["arena"] = function(self, unit) local key = "arena" @@ -1024,7 +1017,6 @@ function MOD:SetUnitFrame(key) oUF_Villain:SetActiveStyle(styleName) frame = oUF_Villain:Spawn(unit, styleName) self.Units[unit] = frame - self.Roster[frame] = key else frame = self.Units[unit] end @@ -1052,7 +1044,6 @@ function MOD:SetEnemyFrames(key, maxCount) oUF_Villain:SetActiveStyle(styleName) frame = oUF_Villain:Spawn(unit, styleName) self.Units[unit] = frame - self.Roster[frame] = key else frame = self.Units[unit] end @@ -1240,7 +1231,6 @@ local Raid10Update = function(self) childFrame = self:GetAttribute("child"..index) end end -UPDATERS["raid10"] = Raid10Update local Raid25Update = function(self) local frame = self:GetParent() @@ -1270,7 +1260,6 @@ local Raid25Update = function(self) childFrame = self:GetAttribute("child"..index) end end -UPDATERS["raid25"] = Raid25Update local Raid40Update = function(self) local frame = self:GetParent() @@ -1300,7 +1289,6 @@ local Raid40Update = function(self) childFrame = self:GetAttribute("child"..index) end end -UPDATERS["raid40"] = Raid40Update local function SetRaidFrame(frame) frame:SetScript("OnEnter", UnitFrame_OnEnter) @@ -1352,7 +1340,7 @@ CONSTRUCTORS["raid10"] = function(self, unit) self.Buffs = MOD:CreateBuffs(self, key) self.Debuffs = MOD:CreateDebuffs(self, key) self.AuraWatch = MOD:CreateAuraWatch(self, key) - --self.GPS = MOD:CreateGPS(self, true) + self.GroupUpdate = Raid10Update return SetRaidFrame(self) end @@ -1367,7 +1355,7 @@ CONSTRUCTORS["raid25"] = function(self, unit) self.Buffs = MOD:CreateBuffs(self, key) self.Debuffs = MOD:CreateDebuffs(self, key) self.AuraWatch = MOD:CreateAuraWatch(self, key) - --self.GPS = MOD:CreateGPS(self, true) + self.GroupUpdate = Raid25Update return SetRaidFrame(self) end @@ -1382,7 +1370,7 @@ CONSTRUCTORS["raid40"] = function(self, unit) self.Buffs = MOD:CreateBuffs(self, key) self.Debuffs = MOD:CreateDebuffs(self, key) self.AuraWatch = MOD:CreateAuraWatch(self, key) - --self.GPS = MOD:CreateGPS(self, true) + self.GroupUpdate = Raid40Update return SetRaidFrame(self) end --[[ @@ -1437,7 +1425,6 @@ local UpdateRaidPetFrame = function(self) childFrame = self:GetAttribute("child"..index) end end -UPDATERS["raidpet"] = UpdateRaidPetFrame CONSTRUCTORS["raidpet"] = function(self, unit) local key = "raidpet" @@ -1473,6 +1460,9 @@ CONSTRUCTORS["raidpet"] = function(self, unit) shadow:Hide() self.TargetGlow = shadow tinsert(self.__elements, UpdateTargetGlow) + + self.GroupUpdate = UpdateRaidPetFrame + self:RegisterEvent("PLAYER_TARGET_CHANGED", UpdateTargetGlow) self:RegisterEvent("PLAYER_ENTERING_WORLD", UpdateTargetGlow) return self @@ -1581,7 +1571,6 @@ local UpdatePartyFrame = function(self) childFrame = self:GetAttribute("child"..index) end end -UPDATERS["party"] = UpdatePartyFrame CONSTRUCTORS["party"] = function(self, unit) local key = "party" @@ -1635,6 +1624,8 @@ CONSTRUCTORS["party"] = function(self, unit) self:RegisterEvent("GROUP_ROSTER_UPDATE", UpdateTargetGlow) end + self.GroupUpdate = UpdatePartyFrame + self.Range = { insideAlpha = 1, outsideAlpha = 1 } return self end @@ -1719,7 +1710,6 @@ local UpdateTankFrame = function(self) end end end -UPDATERS["tank"] = UpdateTankFrame CONSTRUCTORS["tank"] = function(self, unit) local key = "tank" @@ -1815,7 +1805,6 @@ local UpdateAssistFrame = function(self) end end end -UPDATERS["assist"] = UpdateAssistFrame CONSTRUCTORS["assist"] = function(self, unit) local key = "assist" @@ -1835,56 +1824,6 @@ CONSTRUCTORS["assist"] = function(self, unit) end --[[ ########################################################## -SUBUNIT CONSTRUCTORS -########################################################## -]]-- -local SecureHeaderClear = function(self) - self:Hide() - self:SetAttribute("showPlayer", true) - self:SetAttribute("showSolo", true) - self:SetAttribute("showParty", true) - self:SetAttribute("showRaid", true) - self:SetAttribute("columnSpacing", nil) - self:SetAttribute("columnAnchorPoint", nil) - self:SetAttribute("sortMethod", nil) - self:SetAttribute("groupFilter", nil) - self:SetAttribute("groupingOrder", nil) - self:SetAttribute("maxColumns", nil) - self:SetAttribute("nameList", nil) - self:SetAttribute("point", nil) - self:SetAttribute("sortDir", nil) - self:SetAttribute("sortMethod", "NAME") - self:SetAttribute("startingIndex", nil) - self:SetAttribute("strictFiltering", nil) - self:SetAttribute("unitsPerColumn", nil) - self:SetAttribute("xOffset", nil) - self:SetAttribute("yOffset", nil) -end - -function MOD:ConstructGroupHeader(parentFrame, filter, styleName, headerName, template1, groupName, template2) - local db = self.db[groupName] - local UNIT_WIDTH, UNIT_HEIGHT = self:GetActiveSize(db) - oUF_Villain:SetActiveStyle(styleName) - local groupHeader = oUF_Villain:SpawnHeader(headerName, template2, nil, - "oUF-initialConfigFunction", ("self:SetWidth(%d); self:SetHeight(%d); self:SetFrameLevel(5)"):format(UNIT_WIDTH, UNIT_HEIGHT), - "groupFilter", filter, - "showParty", true, - "showRaid", true, - "showSolo", true, - template1 and "template", template1 - ) - groupHeader.___groupkey = groupName - groupHeader:SetParent(parentFrame) - groupHeader:Show() - - groupHeader.Update = UPDATERS[groupName] - groupHeader.MediaUpdate = GroupMediaUpdate - groupHeader.ClearAllAttributes = SecureHeaderClear - - return groupHeader -end ---[[ -########################################################## GROUP HEADER METHODS ########################################################## ]]-- @@ -2038,6 +1977,59 @@ local GroupSetActiveState = function(self) end --[[ ########################################################## +SUBUNIT CONSTRUCTORS +########################################################## +]]-- +local SecureHeaderClear = function(self) + self:Hide() + self:SetAttribute("showPlayer", true) + self:SetAttribute("showSolo", true) + self:SetAttribute("showParty", true) + self:SetAttribute("showRaid", true) + self:SetAttribute("columnSpacing", nil) + self:SetAttribute("columnAnchorPoint", nil) + self:SetAttribute("sortMethod", nil) + self:SetAttribute("groupFilter", nil) + self:SetAttribute("groupingOrder", nil) + self:SetAttribute("maxColumns", nil) + self:SetAttribute("nameList", nil) + self:SetAttribute("point", nil) + self:SetAttribute("sortDir", nil) + self:SetAttribute("sortMethod", "NAME") + self:SetAttribute("startingIndex", nil) + self:SetAttribute("strictFiltering", nil) + self:SetAttribute("unitsPerColumn", nil) + self:SetAttribute("xOffset", nil) + self:SetAttribute("yOffset", nil) +end + +local function ConstructGroupHeader(parentFrame, filter, styleName, headerName, template1, groupName, template2, updateFunc) + local db = MOD.db[groupName] + local UNIT_WIDTH, UNIT_HEIGHT = MOD:GetActiveSize(db) + + updateFunc = updateFunc or parentFrame.GroupUpdate or SV.fubar + + oUF_Villain:SetActiveStyle(styleName) + local groupHeader = oUF_Villain:SpawnHeader(headerName, template2, nil, + "oUF-initialConfigFunction", ("self:SetWidth(%d); self:SetHeight(%d); self:SetFrameLevel(5)"):format(UNIT_WIDTH, UNIT_HEIGHT), + "groupFilter", filter, + "showParty", true, + "showRaid", true, + "showSolo", true, + template1 and "template", template1 + ) + groupHeader.___groupkey = groupName + groupHeader:SetParent(parentFrame) + groupHeader:Show() + + groupHeader.Update = updateFunc + groupHeader.MediaUpdate = GroupMediaUpdate + groupHeader.ClearAllAttributes = SecureHeaderClear + + return groupHeader +end +--[[ +########################################################## LOAD/UPDATE METHOD ########################################################## ]]-- @@ -2052,9 +2044,10 @@ function MOD:SetGroupFrame(key, filter, template1, forceUpdate, template2) oUF_Villain:RegisterStyle(styleName, CONSTRUCTORS[key]) oUF_Villain:SetActiveStyle(styleName) - if(key == "tank" or key == "assist") then - frame = self:ConstructGroupHeader(SVUI_UnitFrameParent, filter, styleName, styleName, template1, key, template2) - self.Roster[frame] = key + if(key == "tank") then + frame = ConstructGroupHeader(SVUI_UnitFrameParent, filter, styleName, styleName, template1, key, template2, UpdateTankFrame) + elseif(key == "assist") then + frame = ConstructGroupHeader(SVUI_UnitFrameParent, filter, styleName, styleName, template1, key, template2, UpdateAssistFrame) else frame = CreateFrame("Frame", styleName, SVUI_UnitFrameParent, "SecureHandlerStateTemplate") frame.groups = {} @@ -2082,17 +2075,15 @@ function MOD:SetGroupFrame(key, filter, template1, forceUpdate, template2) if(db.customSorting) then if(not frame.groups[1]) then groupName = styleName .. "Group1" - local subunit = self:ConstructGroupHeader(frame, 1, styleName, groupName, template1, key, template2) + local subunit = ConstructGroupHeader(frame, 1, styleName, groupName, template1, key, template2) frame.groups[1] = subunit - self.Roster[subunit] = key end else for i = 1, db.groupCount do if(not frame.groups[i]) then groupName = styleName .. "Group" .. i - local subunit = self:ConstructGroupHeader(frame, i, styleName, groupName, template1, key, template2) + local subunit = ConstructGroupHeader(frame, i, styleName, groupName, template1, key, template2) frame.groups[i] = subunit - self.Roster[subunit] = key end end end diff --git a/Interface/AddOns/SVUI/scripts/misc.lua b/Interface/AddOns/SVUI/scripts/misc.lua index 2ac6f75..d6f25e1 100644 --- a/Interface/AddOns/SVUI/scripts/misc.lua +++ b/Interface/AddOns/SVUI/scripts/misc.lua @@ -487,7 +487,7 @@ local function CreateTotemBar() totem.CD = CreateFrame("Cooldown", "TotemBarTotem"..id.."Cooldown", totem, "CooldownFrameTemplate") totem.CD:SetReverse(true) totem.CD:FillInner() - SV:AddCD(totem.CD) + SV.Timers:AddCooldown(totem.CD) totem.Anchor = CreateFrame("Frame", nil, totem) totem.Anchor:SetAllPoints() @@ -650,38 +650,4 @@ local function LoadThreatBar() end end -Registry:NewScript(LoadThreatBar); - --- local PVP_POI = { --- [401] = { --Alterac Valley (15) --- "Stormpike Aid Station", "Dun Baldar North Bunker", "Dun Baldar South Bunker", --- "Stormpike Graveyard", "Icewing Bunker", "Stonehearth Graveyard", --- "Stonehearth Bunker", "Snowfall Graveyard", "Iceblood Tower", --- "Iceblood Graveyard", "Tower Point", "Frostwolf Graveyard", --- "West Frostwolf Tower", "East Frostwolf Tower", "Frostwolf Relief Hut" --- }, --- [935] = { --Deepwind Gorge (2) --- "Horde Cart", "Alliance Cart" --- }, --- [482] = { --Eye of the Storm (1) --- "Flag" --- }, --- [860] = { --Silvershard Mines (1) --- "Cart" --- }, --- [512] = { --Strand of the Ancients (5) --- "Green Emerald", "Blue Sapphire", "Purple Amethyst", "Red Sun", "Yellow Moon" --- }, --- [540] = { --Isle of Conquest (5) --- "Quarry", "Hangar", "Workshop", "Docks", "Refinery" --- }, --- [856] = { --Temple of Kotmogu (4) --- "Red Orb", "Blue Orb", "Orange Orb", "Purple Orb" --- }, --- [626] = { --Twin Peaks (2) --- "Horde Flag", "Alliance Flag" --- }, --- [443] = { --Warsong Gulch (2) --- "Horde Flag", "Alliance Flag" --- }, --- } \ No newline at end of file +Registry:NewScript(LoadThreatBar); \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/questwatch.lua b/Interface/AddOns/SVUI/scripts/questwatch.lua index b4f7610..a34e572 100644 --- a/Interface/AddOns/SVUI/scripts/questwatch.lua +++ b/Interface/AddOns/SVUI/scripts/questwatch.lua @@ -111,7 +111,7 @@ local function QWQuestItems() _G["WatchFrameItem"..i.."NormalTexture"]:SetAlpha(0) _G["WatchFrameItem"..i.."IconTexture"]:FillInner() _G["WatchFrameItem"..i.."IconTexture"]:SetTexCoord(0.1,0.9,0.1,0.9) - SV:AddCD(_G["WatchFrameItem"..i.."Cooldown"]) + SV.Timers:AddCooldown(_G["WatchFrameItem"..i.."Cooldown"]) button.styled = true end end diff --git a/Interface/AddOns/SVUI/scripts/spellbind.lua b/Interface/AddOns/SVUI/scripts/spellbind.lua index 7e72daf..ebd2163 100644 --- a/Interface/AddOns/SVUI/scripts/spellbind.lua +++ b/Interface/AddOns/SVUI/scripts/spellbind.lua @@ -25,44 +25,69 @@ local ipairs = _G.ipairs; local type = _G.type; local tinsert = _G.tinsert; local string = _G.string; ---[[ STRING METHODS ]]-- -local format, gsub = string.format, string.gsub; --[[ ########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV, L, Registry = unpack(select(2, ...)); ---[[ -########################################################## -Simple click2cast spell binder(sBinder by Fernir) +Simple click2cast spell SpellBinder(sBinder by Fernir) ########################################################## ]]-- +ClickCastFrames = _G.ClickCastFrames or {} + +local UnitParseListing = { + "PlayerFrame", "PetFrame", + "TargetFrame", "TargetFrameToT", + "FocusFrame", "FocusFrameToT", + "Boss1TargetFrame", "Boss2TargetFrame", "Boss3TargetFrame", "Boss4TargetFrame", + "ArenaEnemyFrame1", "ArenaEnemyFrame2", "ArenaEnemyFrame3", "ArenaEnemyFrame4", "ArenaEnemyFrame5", + "PartyMemberFrame1", "PartyMemberFrame2", "PartyMemberFrame3", "PartyMemberFrame4", "PartyMemberFrame5", + "PartyMemberFrame1PetFrame", "PartyMemberFrame2PetFrame", "PartyMemberFrame3PetFrame", "PartyMemberFrame4PetFrame", "PartyMemberFrame5PetFrame", + "CompactPartyFrameMemberSelf", "CompactPartyFrameMemberSelfBuff1", "CompactPartyFrameMemberSelfBuff2", "CompactPartyFrameMemberSelfBuff3", + "CompactPartyFrameMemberSelfDebuff1", "CompactPartyFrameMemberSelfDebuff2", "CompactPartyFrameMemberSelfDebuff3", + "CompactPartyFrameMember1Buff1", "CompactPartyFrameMember1Buff2", "CompactPartyFrameMember1Buff3", + "CompactPartyFrameMember1Debuff1", "CompactPartyFrameMember1Debuff2", "CompactPartyFrameMember1Debuff3", + "CompactPartyFrameMember2Buff1", "CompactPartyFrameMember2Buff2", "CompactPartyFrameMember2Buff3", + "CompactPartyFrameMember2Debuff1", "CompactPartyFrameMember2Debuff2", "CompactPartyFrameMember2Debuff3", + "CompactPartyFrameMember3Buff1", "CompactPartyFrameMember3Buff2", "CompactPartyFrameMember3Buff3", + "CompactPartyFrameMember3Debuff1", "CompactPartyFrameMember3Debuff2", "CompactPartyFrameMember3Debuff3", + "CompactPartyFrameMember4Buff1", "CompactPartyFrameMember4Buff2", "CompactPartyFrameMember4Buff3", + "CompactPartyFrameMember4Debuff1", "CompactPartyFrameMember4Debuff2", "CompactPartyFrameMember4Debuff3", + "CompactPartyFrameMember5Buff1", "CompactPartyFrameMember5Buff2", "CompactPartyFrameMember5Buff3", + "CompactPartyFrameMember5Debuff1", "CompactPartyFrameMember5Debuff2", "CompactPartyFrameMember5Debuff3" +} + +for _, gName in pairs(UnitParseListing) do + local frame = _G[gName] + if(frame) then + ClickCastFrames[frame] = true + end +end + local DB = {}; DB.spells = DB.spells or {} DB.frames = DB.frames or {} DB.keys = DB.keys or {} -local binder = CreateFrame("Frame", "SVUI_SpellBinder", SpellBookFrame, "ButtonFrameTemplate") -binder:SetPoint("TOPLEFT", SpellBookFrame, "TOPRIGHT", 100, 0) -binder:SetSize(300, 400) -binder:Hide() - -binder.title = binder:CreateFontString(nil, "OVERLAY", "GameFontNormal") -binder.title:SetPoint("TOP", binder, "TOP", 0, -5) -binder.title:SetText("Click-Cast Bindings") - -binder.sbOpen = false -binder.spellbuttons = {} +local SpellBinder = CreateFrame("Frame", "SVUI_SpellBinder", SpellBookFrame, "ButtonFrameTemplate") +SpellBinder:SetPoint("TOPLEFT", SpellBookFrame, "TOPRIGHT", 100, 0) +SpellBinder:SetSize(300, 400) +SpellBinder:Hide() -binder.list = CreateFrame("ScrollFrame", "SVUI_SpellBinderSpellList", _G["SVUI_SpellBinderInset"], "UIPanelScrollFrameTemplate") -binder.list.child = CreateFrame("Frame", nil, binder.list) -binder.list:SetPoint("TOPLEFT", _G["SVUI_SpellBinderInset"], "TOPLEFT", 0, -5) -binder.list:SetPoint("BOTTOMRIGHT", _G["SVUI_SpellBinderInset"], "BOTTOMRIGHT", -30, 5) -binder.list:SetScrollChild(binder.list.child) +SpellBinder.title = SpellBinder:CreateFontString(nil, "OVERLAY", "GameFontNormal") +SpellBinder.title:SetPoint("TOP", SpellBinder, "TOP", 0, -5) +SpellBinder.title:SetText("Click-Cast Bindings") -binder.roster = {} +SpellBinder.sbOpen = false +SpellBinder.spellbuttons = {} +SpellBinder.list = CreateFrame("ScrollFrame", "SVUI_SpellBinderSpellList", _G["SVUI_SpellBinderInset"], "UIPanelScrollFrameTemplate") +SpellBinder.list.child = CreateFrame("Frame", nil, SpellBinder.list) +SpellBinder.list:SetPoint("TOPLEFT", _G["SVUI_SpellBinderInset"], "TOPLEFT", 0, -5) +SpellBinder.list:SetPoint("BOTTOMRIGHT", _G["SVUI_SpellBinderInset"], "BOTTOMRIGHT", -30, 5) +SpellBinder.list:SetScrollChild(SpellBinder.list.child) +--[[ +########################################################## +SCRIPT HANDLERS +########################################################## +]]-- local BoundSpell_OnEnter = function(self) self.delete:GetNormalTexture():SetVertexColor(1, 0, 0) self:SetBackdrop({bgFile = "Interface\\Buttons\\WHITE8x8"}) @@ -93,7 +118,7 @@ local SpellBindTab_OnLeave = function(self) end local SpellBindTab_OnShow = function(self) - if binder:IsVisible() then self:SetChecked(true) end + if SpellBinder:IsVisible() then self:SetChecked(true) end local num = GetNumSpellTabs() local lastTab = _G["SpellBookSkillLineTab"..num] @@ -105,35 +130,25 @@ local SpellBindTab_OnShow = function(self) end local SpellBindTab_OnClick = function(self) - if InCombatLockdown() then binder:Hide() return end - if binder:IsVisible() then - binder:Hide() - binder.sbOpen = false + if InCombatLockdown() then SpellBinder:Hide() return end + if SpellBinder:IsVisible() then + SpellBinder:Hide() + SpellBinder.sbOpen = false else - binder:Show() - binder.sbOpen = true + SpellBinder:Show() + SpellBinder.sbOpen = true end - binder:ToggleButtons() + SpellBinder:ToggleButtons() end local SpellBindClose_OnClick = function(self) - binder:Hide() - binder.sbOpen = false - binder:ToggleButtons() -end - -local _hook_SpellBookFrame_OnUpdate = function(self) - if binder.sbOpen then binder:ToggleButtons() end -end - -local _hook_SpellBookFrame_OnHide = function(self) - binder:Hide() - binder.sbOpen = false - binder:ToggleButtons() + SpellBinder:Hide() + SpellBinder.sbOpen = false + SpellBinder:ToggleButtons() end -local addSpell = function(self, button) - if binder.sbOpen then +local SpellBindMask_OnClick = function(self, button) + if SpellBinder.sbOpen then local slot = SpellBook_GetSpellBookSlot(self:GetParent()) local spellname, subtype = GetSpellBookItemName(slot, SpellBookFrame.bookType) local texture = GetSpellBookItemTexture(slot, SpellBookFrame.bookType) @@ -147,7 +162,7 @@ local addSpell = function(self, button) if IsAltKeyDown() then modifier = "Alt-"..modifier end if IsHarmfulSpell(slot, SpellBookFrame.bookType) then - button = format("%s%d", "harmbutton", SecureButton_GetButtonSuffix(button)) + button = ("%s%d"):format("harmbutton", SecureButton_GetButtonSuffix(button)) originalbutton = "|cffff2222(harm)|r "..originalbutton else button = SecureButton_GetButtonSuffix(button) @@ -156,19 +171,34 @@ local addSpell = function(self, button) for i, v in pairs(DB.spells) do if v.spell == spellname then return end end tinsert(DB.spells, {["id"] = slot, ["modifier"] = modifier, ["button"] = button, ["spell"] = spellname, ["rank"] = rank, ["texture"] = texture, ["origbutton"] = originalbutton,}) - binder:BuildSpells(false) + SpellBinder:BuildSpells(false) end end end +local SpellBindDelete_OnClick = function(self) + for j, k in ipairs(DB.spells) do + if k ~= spell then + k.checked = false + _G[j.."_cbs"]:SetBackdropColor(0, 0, 0, 0) + end + end + spell.checked = not spell.checked + SpellBinder:DeleteSpell() +end +--[[ +########################################################## +EVENT HANDLERS +########################################################## +]]-- local SpellBind_OnEvent = function(self, event, ...) if event == "PLAYER_LOGIN" then DB = SVUI_Cache["Bindings"] or {} DB.spells = DB.spells or {} DB.frames = DB.frames or {} DB.keys = DB.keys or {} - binder:BuildList() - binder:BuildSpells(true) + SpellBinder:BuildList() + SpellBinder:BuildSpells(true) for i = 1, SPELLS_PER_PAGE do local parent = _G["SpellButton"..i] @@ -176,7 +206,7 @@ local SpellBind_OnEvent = function(self, event, ...) button:SetID(parent:GetID()) button:RegisterForClicks("AnyDown") button:SetAllPoints(parent) - button:SetScript("OnClick", addSpell) + button:SetScript("OnClick", SpellBindMask_OnClick) button.shine = SpellBook_GetAutoCastShine() button.shine:Show() @@ -185,16 +215,20 @@ local SpellBind_OnEvent = function(self, event, ...) AutoCastShine_AutoCastStart(button.shine) button:Hide() - binder.spellbuttons[i] = button + SpellBinder.spellbuttons[i] = button end self:UnregisterEvent("PLAYER_LOGIN") elseif event == "PLAYER_ENTERING_WORLD" or event == "GROUP_ROSTER_UPDATE" or event == "ZONE_CHANGED" or event == "ZONE_CHANGED_NEW_AREA" then - binder:UpdateAll() + SpellBinder:UpdateAll() end end - -local function binder_BuildSpells(self, delete) +--[[ +########################################################## +METHODS +########################################################## +]]-- +function SpellBinder:BuildSpells(delete) local oldb local scroll = self.list.child scroll:SetPoint("TOPLEFT") @@ -241,16 +275,7 @@ local function binder_BuildSpells(self, delete) bf.delete:GetNormalTexture():SetVertexColor(0.8, 0, 0) bf.delete:SetPushedTexture("Interface\\BUTTONS\\UI-GroupLoot-Pass-Up") bf.delete:SetHighlightTexture("Interface\\BUTTONS\\UI-GroupLoot-Pass-Up") - bf.delete:SetScript("OnClick", function() - for j, k in ipairs(DB.spells) do - if k ~= spell then - k.checked = false - _G[j.."_cbs"]:SetBackdropColor(0, 0, 0, 0) - end - end - spell.checked = not spell.checked - binder:DeleteSpell() - end) + bf.delete:SetScript("OnClick", SpellBindDelete_OnClick) bf:SetScript("OnEnter", BoundSpell_OnEnter) bf:SetScript("OnLeave", BoundSpell_OnLeave) @@ -259,7 +284,7 @@ local function binder_BuildSpells(self, delete) bf.fs:SetText(spell.modifier..spell.origbutton) bf.fs:SetPoint("RIGHT", bf.delete, "LEFT", -4, 0) - for frame,_ in pairs(self.roster) do + for frame,_ in pairs(ClickCastFrames) do if frame and DB.frames[frame] then if frame:CanChangeAttribute() or frame:CanChangeProtectedState() then if frame:GetAttribute(spell.modifier.."type"..spell.button) ~= "menu" then @@ -290,37 +315,37 @@ local function binder_BuildSpells(self, delete) end end -local function binder_BuildList(self) - for frame,_ in pairs(self.roster) do +function SpellBinder:BuildList() + for frame,_ in pairs(ClickCastFrames) do DB.frames[frame] = DB.frames[frame] or true end end -local function binder_ToggleButtons(self) +function SpellBinder:ToggleButtons() for i = 1, SPELLS_PER_PAGE do - if(binder.spellbuttons[i]) then - binder.spellbuttons[i]:Hide() - if binder.sbOpen and SpellBookFrame.bookType ~= BOOKTYPE_PROFESSION then - local slot = SpellBook_GetSpellBookSlot(binder.spellbuttons[i]:GetParent()) + if(SpellBinder.spellbuttons[i]) then + SpellBinder.spellbuttons[i]:Hide() + if SpellBinder.sbOpen and SpellBookFrame.bookType ~= BOOKTYPE_PROFESSION then + local slot = SpellBook_GetSpellBookSlot(SpellBinder.spellbuttons[i]:GetParent()) if slot then local spellname, subtype = GetSpellBookItemName(slot, SpellBookFrame.bookType) if spellname then - binder.spellbuttons[i]:Show() + SpellBinder.spellbuttons[i]:Show() end end end end end - binder:BuildList() - binder:BuildSpells(true) - if binder:IsVisible() then binder.tab:SetChecked(true) else binder.tab:SetChecked(false) end + SpellBinder:BuildList() + SpellBinder:BuildSpells(true) + if SpellBinder:IsVisible() then SpellBinder.tab:SetChecked(true) else SpellBinder.tab:SetChecked(false) end end -local function binder_DeleteSpell(self) +function SpellBinder:DeleteSpell() local count = table.getn(DB.spells) for i, spell in ipairs(DB.spells) do if spell.checked then - for frame,_ in pairs(self.roster) do + for frame,_ in pairs(ClickCastFrames) do local f if frame and type(frame) == "table" then f = frame:GetName() end if f then @@ -344,7 +369,7 @@ local function binder_DeleteSpell(self) self:BuildSpells(true) end -local function binder_UpdateAll(self) +function SpellBinder:UpdateAll() if InCombatLockdown() then self:SheduleUpdate() return @@ -353,7 +378,7 @@ local function binder_UpdateAll(self) self:BuildSpells(true) end -local function binder_SheduleUpdate(self) +function SpellBinder:SheduleUpdate() self.updated = false if InCombatLockdown() then self:RegisterEvent("PLAYER_REGEN_ENABLED") @@ -364,70 +389,64 @@ local function binder_SheduleUpdate(self) end --[[ ########################################################## -LOADER +SET HOOKS ########################################################## ]]-- -local function enable(frame) - if type(frame) == "string" then - local frameName = frame - frame = _G[frameName] - end - - if frame then - binder.roster[frame] = true - end +local _hook_CreateFrame = function(self, name, parent, template) + if template and template:find("SecureUnitButtonTemplate") then ClickCastFrames[_G[name]] = true end end -local BindableFrames = SV.SVUnit.Roster -for frame,_ in pairs(BindableFrames) do - binder.roster[frame] = true +local _hook_CompactUnitFrame_SetUpFrame = function(self, ...) + ClickCastFrames[self] = true end - -binder.BuildSpells = binder_BuildSpells -binder.BuildList = binder_BuildList -binder.ToggleButtons = binder_ToggleButtons -binder.DeleteSpell = binder_DeleteSpell -binder.UpdateAll = binder_UpdateAll -binder.SheduleUpdate = binder_SheduleUpdate - -_G["SVUI_SpellBinderCloseButton"]:SetScript("OnClick", SpellBindClose_OnClick) -hooksecurefunc("SpellBookFrame_Update", _hook_SpellBookFrame_OnUpdate) -hooksecurefunc(SpellBookFrame, "Hide", _hook_SpellBookFrame_OnHide) -binder:RemoveTextures() -_G["SVUI_SpellBinderInset"]:RemoveTextures() - -binder:SetPanelTemplate("Action") -binder.Panel:SetPoint("TOPLEFT", -18, 0) -binder.Panel:SetPoint("BOTTOMRIGHT", 0, 0) - -binder.list:RemoveTextures() -binder.list:SetPanelTemplate("Inset") - -binder.tab = CreateFrame("CheckButton", nil, _G["SpellBookSkillLineTab1"], "SpellBookSkillLineTabTemplate") -binder.tab:RemoveTextures() -binder.tab:SetButtonTemplate() -binder.tab:SetNormalTexture("Interface\\ICONS\\Achievement_Guild_Doctorisin") -binder.tab:GetNormalTexture():ClearAllPoints() -binder.tab:GetNormalTexture():SetPoint("TOPLEFT", 2, -2) -binder.tab:GetNormalTexture():SetPoint("BOTTOMRIGHT", -2, 2) -binder.tab:GetNormalTexture():SetTexCoord(0.1, 0.9, 0.1, 0.9) -binder.tab:SetScript("OnShow", SpellBindTab_OnShow) -binder.tab:SetScript("OnClick", SpellBindTab_OnClick) -binder.tab:Show() - -binder:RegisterEvent("GROUP_ROSTER_UPDATE") -binder:RegisterEvent("PLAYER_ENTERING_WORLD") -binder:RegisterEvent("PLAYER_LOGIN") -binder:RegisterEvent("ZONE_CHANGED_NEW_AREA") -binder:RegisterEvent("ZONE_CHANGED") -binder:SetScript("OnEvent", SpellBind_OnEvent) - -local function LoadSpellBinder() - local BindableFrames = SV.SVUnit.Roster - for frame,_ in pairs(BindableFrames) do - binder.roster[frame] = true - end +local _hook_SpellBookFrame_OnUpdate = function(self) + if SpellBinder.sbOpen then SpellBinder:ToggleButtons() end +end + +local _hook_SpellBookFrame_OnHide = function(self) + SpellBinder:Hide() + SpellBinder.sbOpen = false + SpellBinder:ToggleButtons() end -Registry:NewScript(LoadSpellBinder) \ No newline at end of file +hooksecurefunc("CreateFrame", _hook_CreateFrame) +hooksecurefunc("CompactUnitFrame_SetUpFrame", _hook_CompactUnitFrame_SetUpFrame) +hooksecurefunc("SpellBookFrame_Update", _hook_SpellBookFrame_OnUpdate) +hooksecurefunc(SpellBookFrame, "Hide", _hook_SpellBookFrame_OnHide) +--[[ +########################################################## +LOADER +########################################################## +]]-- +SVUI_SpellBinderCloseButton:SetScript("OnClick", SpellBindClose_OnClick) + +SpellBinder:RemoveTextures() + +SVUI_SpellBinderInset:RemoveTextures() + +SpellBinder:SetPanelTemplate("Action") +SpellBinder.Panel:SetPoint("TOPLEFT", -18, 0) +SpellBinder.Panel:SetPoint("BOTTOMRIGHT", 0, 0) + +SpellBinder.list:RemoveTextures() +SpellBinder.list:SetPanelTemplate("Inset") + +SpellBinder.tab = CreateFrame("CheckButton", nil, _G["SpellBookSkillLineTab1"], "SpellBookSkillLineTabTemplate") +SpellBinder.tab:RemoveTextures() +SpellBinder.tab:SetButtonTemplate() +SpellBinder.tab:SetNormalTexture("Interface\\ICONS\\Achievement_Guild_Doctorisin") +SpellBinder.tab:GetNormalTexture():ClearAllPoints() +SpellBinder.tab:GetNormalTexture():SetPoint("TOPLEFT", 2, -2) +SpellBinder.tab:GetNormalTexture():SetPoint("BOTTOMRIGHT", -2, 2) +SpellBinder.tab:GetNormalTexture():SetTexCoord(0.1, 0.9, 0.1, 0.9) +SpellBinder.tab:SetScript("OnShow", SpellBindTab_OnShow) +SpellBinder.tab:SetScript("OnClick", SpellBindTab_OnClick) +SpellBinder.tab:Show() + +SpellBinder:RegisterEvent("GROUP_ROSTER_UPDATE") +SpellBinder:RegisterEvent("PLAYER_ENTERING_WORLD") +SpellBinder:RegisterEvent("PLAYER_LOGIN") +SpellBinder:RegisterEvent("ZONE_CHANGED_NEW_AREA") +SpellBinder:RegisterEvent("ZONE_CHANGED") +SpellBinder:SetScript("OnEvent", SpellBind_OnEvent) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/global.lua b/Interface/AddOns/SVUI/system/global.lua deleted file mode 100644 index ce33783..0000000 --- a/Interface/AddOns/SVUI/system/global.lua +++ /dev/null @@ -1,481 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -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 type = _G.type; -local rawset = _G.rawset; -local rawget = _G.rawget; -local tinsert = _G.tinsert; -local tremove = _G.tremove; -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; ---[[ STRING METHODS ]]-- -local upper = string.upper; -local format, find, match, gsub = string.format, string.find, string.match, string.gsub; ---[[ MATH METHODS ]]-- -local floor = math.floor ---[[ TABLE METHODS ]]-- -local twipe, tsort, tconcat = table.wipe, table.sort, table.concat; ---[[ -############################################################################## - /$$$$$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$ /$$ - /$$__ $$| $$ /$$__ $$| $$__ $$ /$$__ $$| $$ -| $$ \__/| $$ | $$ \ $$| $$ \ $$| $$ \ $$| $$ -| $$ /$$$$| $$ | $$ | $$| $$$$$$$ | $$$$$$$$| $$ -| $$|_ $$| $$ | $$ | $$| $$__ $$| $$__ $$| $$ -| $$ \ $$| $$ | $$ | $$| $$ \ $$| $$ | $$| $$ -| $$$$$$/| $$$$$$$$| $$$$$$/| $$$$$$$/| $$ | $$| $$$$$$$$ - \______/ |________/ \______/ |_______/ |__/ |__/|________/ -############################################################################## -]]-- - ---[[ LOCALS ]]-- - -local SVUINameSpace, SVUICore = ...; -local SVUIVersion = GetAddOnMetadata(..., "Version"); -local clientVersion, internalVersion, releaseDate, uiVersion = GetBuildInfo(); -local callbacks = {}; -local numCallbacks = 0; - -local messagePattern = "|cffFF2F00%s:|r" -local debugPattern = "|cffFF2F00%s|r [|cff992FFF%s|r]|cffFF2F00:|r" - ---[[ CONSTANTS ]]-- - -BINDING_HEADER_SVUI = "Supervillain UI"; -SLASH_RELOADUI1 = "/rl" -SLASH_RELOADUI2 = "/reloadui" -SlashCmdList.RELOADUI = ReloadUI - ---[[ 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; - ---[[ META METHODS ]]-- - -local rootstring = function(self) return self.___addonName end - ---[[ LOCALIZATION HELPERS ]]-- - -local failsafe = function() assert(false) end - -local metaread = { - __index = function(self, key) - rawset(self, key, key) - return key - end -} - -local activeLocale - -local defaultwrite = setmetatable({}, { - __newindex = function(self, key, value) - if not rawget(activeLocale, key) then - rawset(activeLocale, key, value == true and key or value) - end - end, - __index = failsafe -}) - -local metawrite = setmetatable({}, { - __newindex = function(self, key, value) - rawset(activeLocale, key, value == true and key or value) - end, - __index = failsafe -}) - ---[[ 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 - assert(type(h) == "table", "Bad argument #2 to :RegisterCallback (table expected)") - assert(type(h[m]) == "function", "Bad argument #1 to :RegisterCallback (m \"" .. m .. "\" not found)") - m = h[m] - end - callbacks[m] = h or true - numCallbacks = numCallbacks + 1 -end - -local function UnregisterCallback(self, m, h) - assert(type(m) == "string" or type(m) == "function", "Bad argument #1 to :UnregisterCallback (string or function expected)") - if type(m) == "string" then - assert(type(h) == "table", "Bad argument #2 to :UnregisterCallback (table expected)") - assert(type(h[m]) == "function", "Bad argument #1 to :UnregisterCallback (m \"" .. m .. "\" not found)") - m = h[m] - end - callbacks[m] = nil - numCallbacks = numCallbacks + 1 -end - -local function DispatchCallbacks() - if (numCallbacks < 1) then return end - for m, h in pairs(callbacks) do - local ok, err = pcall(m, h ~= true and h or nil) - if not ok then - print("ERROR:", err) - end - end -end - ---[[ BUILD CLASS COLOR GLOBAL ]]-- - -SVUI_CLASS_COLORS = {}; -do - local classes = {}; - local supercolors = { - ["HUNTER"] = { r = 0.454, g = 0.698, b = 0 }, - ["WARLOCK"] = { r = 0.286, g = 0, b = 0.788 }, - ["PRIEST"] = { r = 0.976, g = 1, b = 0.839 }, - ["PALADIN"] = { r = 0.956, g = 0.207, b = 0.733 }, - ["MAGE"] = { r = 0, g = 0.796, b = 1 }, - ["ROGUE"] = { r = 1, g = 0.894, b = 0.117 }, - ["DRUID"] = { r = 1, g = 0.513, b = 0 }, - ["SHAMAN"] = { r = 0, g = 0.38, b = 1 }, - ["WARRIOR"] = { r = 0.698, g = 0.36, b = 0.152 }, - ["DEATHKNIGHT"] = { r = 0.847, g = 0.117, b = 0.074 }, - ["MONK"] = { r = 0.015, g = 0.886, b = 0.38 }, - }; - for class in pairs(RAID_CLASS_COLORS) do - tinsert(classes, class) - end - tsort(classes) - setmetatable(SVUI_CLASS_COLORS,{ - __index = function(t, k) - if k == "RegisterCallback" then return RegisterCallback end - if k == "UnregisterCallback" then return UnregisterCallback end - if k == "DispatchCallbacks" then return DispatchCallbacks end - end - }); - for i, class in ipairs(classes) do - local color = supercolors[class] - local r, g, b = color.r, color.g, color.b - local hex = ("ff%02x%02x%02x"):format(r * 255, g * 255, b * 255) - if not SVUI_CLASS_COLORS[class] or not SVUI_CLASS_COLORS[class].r or not SVUI_CLASS_COLORS[class].g or not SVUI_CLASS_COLORS[class].b then - SVUI_CLASS_COLORS[class] = { - r = r, - g = g, - b = b, - colorStr = hex, - } - end - end - 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 - -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 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 this:find('^%s*$') and '' or this:match('^%s*(.*%S)') -end - -function string.color(this, color) - return ("|cff%s%s|r"):format(color, this) -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) -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 -end - ---[[ CORE ENGINE CONSTRUCT ]]-- - -local Core_StaticPopup_Show = function(self, arg) - if arg == "ADDON_ACTION_FORBIDDEN" then - StaticPopup_Hide(arg) - end -end - -local Core_ResetAllUI = function(self, confirmed) - if InCombatLockdown()then - SendAddonMessage(ERR_NOT_IN_COMBAT) - return - end - if(not confirmed) then - self:StaticPopup_Show('RESET_UI_CHECK') - return - end - self:ResetInstallation() -end - -local Core_ResetUI = function(self, confirmed) - if InCombatLockdown()then - SendAddonMessage(ERR_NOT_IN_COMBAT) - return - end - if(not confirmed) then - self:StaticPopup_Show('RESETMOVERS_CHECK') - return - end - self:ResetMovables() -end - -local Core_ToggleConfig = function(self) - if InCombatLockdown() then - SendAddonMessage(ERR_NOT_IN_COMBAT) - self.UIParent:RegisterEvent('PLAYER_REGEN_ENABLED') - return - end - if not IsAddOnLoaded("SVUI_ConfigOMatic") then - local _,_,_,_,_,state = GetAddOnInfo("SVUI_ConfigOMatic") - if state ~= "MISSING" and state ~= "DISABLED" then - LoadAddOn("SVUI_ConfigOMatic") - local config_version = GetAddOnMetadata("SVUI_ConfigOMatic", "Version") - if(tonumber(config_version) < 4) then - self:StaticPopup_Show("CLIENT_UPDATE_REQUEST") - end - else - self:AddonMessage("|cffff0000Error -- Addon 'SVUI_ConfigOMatic' not found or is disabled.|r") - return - end - end - local aceConfig = LibStub("AceConfigDialog-3.0") - local switch = not aceConfig.OpenFrames["SVUI"] and "Open" or "Close" - aceConfig[switch](aceConfig, "SVUI") - GameTooltip:Hide() -end - ---/script SVUI[1]:TaintHandler("SVUI", "Script", "Function") -local Core_TaintHandler = function(self, taint, sourceName, sourceFunc) - if GetCVarBool('scriptErrors') ~= 1 then return end - local errorString = ("Error Captured: %s->%s->{%s}"):format(taint, sourceName or "Unknown", sourceFunc or "Unknown") - self:AddonMessage(errorString) - self:StaticPopup_Show("TAINT_RL") -end - -local function _sendmessage(msg, prefix) - if(type(msg) == "table") then - msg = tostring(msg) - end - - if(not msg) then return end - - if(prefix) then - local outbound = ("%s %s"):format(prefix, msg); - print(outbound) - else - print(msg) - end -end - -local Core_Debugger = function(self, msg) - if(not self.DebuggingMode) then return end - local outbound = (debugPattern):format("SVUI", "DEBUG") - _sendmessage(msg, outbound) -end - -local Core_AddonMessage = function(self, msg) - local outbound = (messagePattern):format("SVUI") - _sendmessage(msg, outbound) -end - -local Core_SetLocaleStrings = function(self, locale, isDefault) - local gameLocale = GetLocale() - if gameLocale == "enGB" then gameLocale = "enUS" end - - activeLocale = self.Localization - - if isDefault then - return defaultwrite - elseif(locale == GAME_LOCALE or locale == gameLocale) then - return metawrite - end -end - -local Core_Prototype = function(self, name) - local version = GetAddOnMetadata(name, "Version") - local schema = GetAddOnMetadata(name, "X-SVUI-Schema") - - self.Configs[schema] = {["enable"] = false} - - local obj = { - ___addonName = name, - ___version = version, - ___schema = schema - } - - local mt = {} - local old = getmetatable(obj) - if old then - for k, v in pairs(old) do mt[k] = v end - end - mt.__tostring = rootstring - setmetatable(obj, mt) - return obj -end - -local SVUI = { - ___addonName = SVUINameSpace, - ___version = GetAddOnMetadata(SVUINameSpace, "Version"), - ___interface = tonumber(uiVersion), - db = {}, - Global = { - Accountant = {}, - profiles = {}, - profileKeys = {}, - }, - Configs = {}, - Media = {}, - DisplayAudit = {}, - DynamicOptions = {}, - Dispellable = {}, - Snap = {}, - SetLocaleStrings = Core_SetLocaleStrings, - Prototype = Core_Prototype, - AddonMessage = Core_AddonMessage, - Debugger = Core_Debugger, - StaticPopup_Show, - ResetAllUI = Core_ResetAllUI, - ResetUI = Core_ResetUI, - ToggleConfig = Core_ToggleConfig, - TaintHandler = Core_TaintHandler -} - -SVUI.Localization = setmetatable({}, metaread) -SVUI.Options = { type = "group", name = "|cff339fffConfig-O-Matic|r", args = {}} - ---[[ MISC ]]-- - -SVUI.fubar = function() return end -SVUI.class = select(2,UnitClass("player")); -SVUI.ClassRole = ""; -SVUI.UnitRole = "NONE"; -SVUI.ConfigurationMode = false; -SVUI.DebuggingMode = false - ---[[ UTILITY FRAMES ]]-- - -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(); - ---[[ ENSURE META METHODS ]]-- - -local mt = {} -local old = getmetatable(SVUI) -if old then - for k, v in pairs(old) do mt[k] = v end -end -mt.__tostring = rootstring -setmetatable(SVUI, mt) - ---[[ COMMON FUNCTIONS ]]-- - -SVUICore[1] = SVUI -SVUICore[2] = SVUI.Localization - ---[[ SET MASTER GLOBAL ]]-- - -_G[SVUINameSpace] = SVUICore; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/installer.lua b/Interface/AddOns/SVUI/system/installer.lua deleted file mode 100644 index c169aca..0000000 --- a/Interface/AddOns/SVUI/system/installer.lua +++ /dev/null @@ -1,1275 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local type = _G.type; -local string = _G.string; -local table = _G.table; -local format = string.format; -local tcopy = table.copy; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV, L, Registry = unpack(select(2, ...)); ---[[ -########################################################## -LOCAL VARS -########################################################## -]]-- -local CURRENT_PAGE, MAX_PAGE, XOFF = 0, 9, (GetScreenWidth() * 0.025) -local okToResetMOVE = false -local mungs = false; -local user_music_vol; -local musicIsPlaying; ---[[ -########################################################## -LOCAL FUNCTIONS -########################################################## -]]-- -local function SetInstallButton(button) - if(not button) then return end - button.Left:SetAlpha(0) - button.Middle:SetAlpha(0) - button.Right:SetAlpha(0) - button:SetNormalTexture("") - button:SetPushedTexture("") - button:SetPushedTexture("") - button:SetDisabledTexture("") - button:RemoveTextures() - button:SetFrameLevel(button:GetFrameLevel() + 1) -end - -local function forceCVars() - SetCVar("alternateResourceText",1) - SetCVar("statusTextDisplay","BOTH") - SetCVar("ShowClassColorInNameplate",1) - SetCVar("screenshotQuality",10) - SetCVar("chatMouseScroll",1) - SetCVar("chatStyle","classic") - SetCVar("WholeChatWindowClickable",0) - SetCVar("ConversationMode","inline") - SetCVar("showTutorials",0) - SetCVar("UberTooltips",1) - SetCVar("threatWarning",3) - SetCVar('alwaysShowActionBars',1) - SetCVar('lockActionBars',1) - SetCVar('SpamFilter',0) - InterfaceOptionsActionBarsPanelPickupActionKeyDropDown:SetValue('SHIFT') - InterfaceOptionsActionBarsPanelPickupActionKeyDropDown:RefreshValue() -end - -local function ShowLayout(show40) - if(not _G["SVUI_Raid40"] or (show40 and _G["SVUI_Raid40"].forceShow == true)) then return end - if(not show40 and _G["SVUI_Raid40"].forceShow ~= true) then return end - SV.SVUnit:UpdateGroupConfig(_G["SVUI_Raid40"], show40) -end - -local function BarShuffle() - local bar2 = SV.db.SVBar.Bar2.enable; - local base = 30; - local bS = SV.db.SVBar.Bar1.buttonspacing; - local tH = SV.db.SVBar.Bar1.buttonsize + (base - bS); - local b2h = bar2 and tH or base; - local sph = (400 - b2h); - if not SV.db.framelocations then SV.db.framelocations = {} end - SV.db.framelocations.SVUI_SpecialAbility_MOVE = "BOTTOMSVUIParentBOTTOM0"..sph; - SV.db.framelocations.SVUI_ActionBar2_MOVE = "BOTTOMSVUI_ActionBar1TOP0"..(-bS); - SV.db.framelocations.SVUI_ActionBar3_MOVE = "BOTTOMLEFTSVUI_ActionBar1BOTTOMRIGHT40"; - SV.db.framelocations.SVUI_ActionBar5_MOVE = "BOTTOMRIGHTSVUI_ActionBar1BOTTOMLEFT-40"; - if bar2 then - SV.db.framelocations.SVUI_PetActionBar_MOVE = "BOTTOMLEFTSVUI_ActionBar2TOPLEFT04" - SV.db.framelocations.SVUI_StanceBar_MOVE = "BOTTOMRIGHTSVUI_ActionBar2TOPRIGHT04"; - else - SV.db.framelocations.SVUI_PetActionBar_MOVE = "BOTTOMLEFTSVUI_ActionBar1TOPLEFT04" - SV.db.framelocations.SVUI_StanceBar_MOVE = "BOTTOMRIGHTSVUI_ActionBar1TOPRIGHT04"; - end -end - -local function UFMoveBottomQuadrant(toggle) - if not SV.db.framelocations then SV.db.framelocations = {} end - if not toggle then - SV.db.framelocations.SVUI_Player_MOVE = "BOTTOMSVUIParentBOTTOM-278182" - SV.db.framelocations.SVUI_PlayerCastbar_MOVE = "BOTTOMSVUIParentBOTTOM-278122" - SV.db.framelocations.SVUI_Target_MOVE = "BOTTOMSVUIParentBOTTOM278182" - SV.db.framelocations.SVUI_TargetCastbar_MOVE = "BOTTOMSVUIParentBOTTOM278122" - SV.db.framelocations.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM0181" - SV.db.framelocations.SVUI_TargetTarget_MOVE = "BOTTOMSVUIParentBOTTOM0214" - SV.db.framelocations.SVUI_Focus_MOVE = "BOTTOMSVUIParentBOTTOM310432" - SV.db.framelocations.SVUI_ThreatBar_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-495182" - elseif toggle == "shift" then - SV.db.framelocations.SVUI_Player_MOVE = "BOTTOMSVUIParentBOTTOM-278210" - SV.db.framelocations.SVUI_PlayerCastbar_MOVE = "BOTTOMSVUIParentBOTTOM-278150" - SV.db.framelocations.SVUI_Target_MOVE = "BOTTOMSVUIParentBOTTOM278210" - SV.db.framelocations.SVUI_TargetCastbar_MOVE = "BOTTOMSVUIParentBOTTOM278150" - SV.db.framelocations.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM0209" - SV.db.framelocations.SVUI_TargetTarget_MOVE = "BOTTOMSVUIParentBOTTOM0242" - SV.db.framelocations.SVUI_Focus_MOVE = "BOTTOMSVUIParentBOTTOM310432" - SV.db.framelocations.SVUI_ThreatBar_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-495210" - else - local c = 136; - local d = 135; - local e = 80; - SV.db.framelocations.SVUI_Player_MOVE = "BOTTOMSVUIParentBOTTOM"..-c..""..d; - SV.db.framelocations.SVUI_PlayerCastbar_MOVE = "BOTTOMSVUIParentBOTTOM"..-c..""..(d-60); - SV.db.framelocations.SVUI_Target_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..d; - SV.db.framelocations.SVUI_TargetCastbar_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..(d-60); - SV.db.framelocations.SVUI_Pet_MOVE = "BOTTOMSVUIParentBOTTOM"..-c..""..e; - SV.db.framelocations.SVUI_TargetTarget_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..e; - SV.db.framelocations.SVUI_Focus_MOVE = "BOTTOMSVUIParentBOTTOM"..c..""..(d + 150); - SV.db.framelocations.SVUI_ThreatBar_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-495"..d; - end -end - -local function UFMoveLeftQuadrant(toggle) - if not SV.db.framelocations then SV.db.framelocations = {} end - if not toggle then - SV.db.framelocations.SVUI_Assist_MOVE = "TOPLEFTSVUIParentTOPLEFT"..XOFF.."-250" - SV.db.framelocations.SVUI_Tank_MOVE = "TOPLEFTSVUIParentTOPLEFT"..XOFF.."-175" - SV.db.framelocations.SVUI_Raidpet_MOVE = "TOPLEFTSVUIParentTOPLEFT"..XOFF.."-325" - SV.db.framelocations.SVUI_Party_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" - SV.db.framelocations.SVUI_Raid10_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" - SV.db.framelocations.SVUI_Raid25_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" - SV.db.framelocations.SVUI_Raid40_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT"..XOFF.."400" - else - SV.db.framelocations.SVUI_Assist_MOVE = "TOPLEFTSVUIParentTOPLEFT4-250" - SV.db.framelocations.SVUI_Tank_MOVE = "TOPLEFTSVUIParentTOPLEFT4-175" - SV.db.framelocations.SVUI_Raidpet_MOVE = "TOPLEFTSVUIParentTOPLEFT4-325" - SV.db.framelocations.SVUI_Party_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" - SV.db.framelocations.SVUI_Raid40_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" - SV.db.framelocations.SVUI_Raid10_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" - SV.db.framelocations.SVUI_Raid25_MOVE = "BOTTOMLEFTSVUIParentBOTTOMLEFT4300" - end -end - -local function UFMoveTopQuadrant(toggle) - if not SV.db.framelocations then SV.db.framelocations = {} end - if not toggle then - SV.db.framelocations.GM_MOVE = "TOPLEFTSVUIParentTOPLEFT250-25" - SV.db.framelocations.SVUI_LootFrame_MOVE = "BOTTOMSVUIParentBOTTOM0350" - SV.db.framelocations.SVUI_AltPowerBar_MOVE = "TOPSVUIParentTOP0-40" - SV.db.framelocations.LoC_MOVE = "BOTTOMSVUIParentBOTTOM0350" - SV.db.framelocations.BNET_MOVE = "TOPRIGHTSVUIParentTOPRIGHT-4-250" - else - SV.db.framelocations.GM_MOVE = "TOPLEFTSVUIParentTOPLEFT344-25" - SV.db.framelocations.SVUI_LootFrame_MOVE = "BOTTOMSVUIParentBOTTOM0254" - SV.db.framelocations.SVUI_AltPowerBar_MOVE = "TOPSVUIParentTOP0-39" - SV.db.framelocations.LoC_MOVE = "BOTTOMSVUIParentBOTTOM0443" - SV.db.framelocations.BNET_MOVE = "TOPRIGHTSVUIParentTOPRIGHT-4-248" - end -end - -local function UFMoveRightQuadrant(toggle) - if not SV.db.framelocations then SV.db.framelocations = {} end - local dH = SV.db.SVDock.dockRightHeight + 60 - if not toggle or toggle == "high" then - SV.db.framelocations.SVUI_BossHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" - SV.db.framelocations.SVUI_ArenaHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" - SV.db.framelocations.Tooltip_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-284"..dH; - else - SV.db.framelocations.SVUI_BossHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" - SV.db.framelocations.SVUI_ArenaHolder_MOVE = "RIGHTSVUIParentRIGHT-1050" - SV.db.framelocations.Tooltip_MOVE = "BOTTOMRIGHTSVUIParentBOTTOMRIGHT-284"..dH; - end -end - -local function initChat(mungs) - forceCVars() - FCF_ResetChatWindows() - FCF_SetLocked(ChatFrame1, 1) - FCF_DockFrame(ChatFrame2) - FCF_SetLocked(ChatFrame2, 1) - FCF_OpenNewWindow(LOOT) - FCF_DockFrame(ChatFrame3) - FCF_SetLocked(ChatFrame3, 1) - for i = 1, NUM_CHAT_WINDOWS do - local chat = _G["ChatFrame"..i] - local chatID = chat:GetID() - if i == 1 then - chat:ClearAllPoints() - chat:Point("BOTTOMLEFT", LeftSuperDock, "BOTTOMLEFT", 5, 5) - chat:Point("TOPRIGHT", LeftSuperDock, "TOPRIGHT", -5, -10) - end - FCF_SavePositionAndDimensions(chat) - FCF_StopDragging(chat) - FCF_SetChatWindowFontSize(nil, chat, 12) - if i == 1 then - FCF_SetWindowName(chat, GENERAL) - elseif i == 2 then - FCF_SetWindowName(chat, GUILD_EVENT_LOG) - elseif i == 3 then - FCF_SetWindowName(chat, LOOT) - end - end - ChatFrame_RemoveAllMessageGroups(ChatFrame1) - ChatFrame_AddMessageGroup(ChatFrame1, "SAY") - ChatFrame_AddMessageGroup(ChatFrame1, "EMOTE") - ChatFrame_AddMessageGroup(ChatFrame1, "YELL") - ChatFrame_AddMessageGroup(ChatFrame1, "GUILD") - ChatFrame_AddMessageGroup(ChatFrame1, "OFFICER") - ChatFrame_AddMessageGroup(ChatFrame1, "GUILD_ACHIEVEMENT") - ChatFrame_AddMessageGroup(ChatFrame1, "WHISPER") - ChatFrame_AddMessageGroup(ChatFrame1, "MONSTER_SAY") - ChatFrame_AddMessageGroup(ChatFrame1, "MONSTER_EMOTE") - ChatFrame_AddMessageGroup(ChatFrame1, "MONSTER_YELL") - ChatFrame_AddMessageGroup(ChatFrame1, "MONSTER_BOSS_EMOTE") - ChatFrame_AddMessageGroup(ChatFrame1, "PARTY") - ChatFrame_AddMessageGroup(ChatFrame1, "PARTY_LEADER") - ChatFrame_AddMessageGroup(ChatFrame1, "RAID") - ChatFrame_AddMessageGroup(ChatFrame1, "RAID_LEADER") - ChatFrame_AddMessageGroup(ChatFrame1, "RAID_WARNING") - ChatFrame_AddMessageGroup(ChatFrame1, "INSTANCE_CHAT") - ChatFrame_AddMessageGroup(ChatFrame1, "INSTANCE_CHAT_LEADER") - ChatFrame_AddMessageGroup(ChatFrame1, "BATTLEGROUND") - ChatFrame_AddMessageGroup(ChatFrame1, "BATTLEGROUND_LEADER") - ChatFrame_AddMessageGroup(ChatFrame1, "BG_HORDE") - ChatFrame_AddMessageGroup(ChatFrame1, "BG_ALLIANCE") - ChatFrame_AddMessageGroup(ChatFrame1, "BG_NEUTRAL") - ChatFrame_AddMessageGroup(ChatFrame1, "SYSTEM") - ChatFrame_AddMessageGroup(ChatFrame1, "ERRORS") - ChatFrame_AddMessageGroup(ChatFrame1, "AFK") - ChatFrame_AddMessageGroup(ChatFrame1, "DND") - ChatFrame_AddMessageGroup(ChatFrame1, "IGNORED") - ChatFrame_AddMessageGroup(ChatFrame1, "ACHIEVEMENT") - ChatFrame_AddMessageGroup(ChatFrame1, "BN_WHISPER") - ChatFrame_AddMessageGroup(ChatFrame1, "BN_CONVERSATION") - ChatFrame_AddMessageGroup(ChatFrame1, "BN_INLINE_TOAST_ALERT") - ChatFrame_AddMessageGroup(ChatFrame1, "COMBAT_FACTION_CHANGE") - ChatFrame_AddMessageGroup(ChatFrame1, "SKILL") - ChatFrame_AddMessageGroup(ChatFrame1, "LOOT") - ChatFrame_AddMessageGroup(ChatFrame1, "MONEY") - ChatFrame_AddMessageGroup(ChatFrame1, "COMBAT_XP_GAIN") - ChatFrame_AddMessageGroup(ChatFrame1, "COMBAT_HONOR_GAIN") - ChatFrame_AddMessageGroup(ChatFrame1, "COMBAT_GUILD_XP_GAIN") - - ChatFrame_RemoveAllMessageGroups(ChatFrame3) - ChatFrame_AddMessageGroup(ChatFrame3, "COMBAT_FACTION_CHANGE") - ChatFrame_AddMessageGroup(ChatFrame3, "SKILL") - ChatFrame_AddMessageGroup(ChatFrame3, "LOOT") - ChatFrame_AddMessageGroup(ChatFrame3, "MONEY") - ChatFrame_AddMessageGroup(ChatFrame3, "COMBAT_XP_GAIN") - ChatFrame_AddMessageGroup(ChatFrame3, "COMBAT_HONOR_GAIN") - ChatFrame_AddMessageGroup(ChatFrame3, "COMBAT_GUILD_XP_GAIN") - - ChatFrame_AddChannel(ChatFrame1, GENERAL) - - ToggleChatColorNamesByClassGroup(true, "SAY") - ToggleChatColorNamesByClassGroup(true, "EMOTE") - ToggleChatColorNamesByClassGroup(true, "YELL") - ToggleChatColorNamesByClassGroup(true, "GUILD") - ToggleChatColorNamesByClassGroup(true, "OFFICER") - ToggleChatColorNamesByClassGroup(true, "GUILD_ACHIEVEMENT") - ToggleChatColorNamesByClassGroup(true, "ACHIEVEMENT") - ToggleChatColorNamesByClassGroup(true, "WHISPER") - ToggleChatColorNamesByClassGroup(true, "PARTY") - ToggleChatColorNamesByClassGroup(true, "PARTY_LEADER") - ToggleChatColorNamesByClassGroup(true, "RAID") - ToggleChatColorNamesByClassGroup(true, "RAID_LEADER") - ToggleChatColorNamesByClassGroup(true, "RAID_WARNING") - ToggleChatColorNamesByClassGroup(true, "BATTLEGROUND") - ToggleChatColorNamesByClassGroup(true, "BATTLEGROUND_LEADER") - ToggleChatColorNamesByClassGroup(true, "INSTANCE_CHAT") - ToggleChatColorNamesByClassGroup(true, "INSTANCE_CHAT_LEADER") - ToggleChatColorNamesByClassGroup(true, "CHANNEL1") - ToggleChatColorNamesByClassGroup(true, "CHANNEL2") - ToggleChatColorNamesByClassGroup(true, "CHANNEL3") - ToggleChatColorNamesByClassGroup(true, "CHANNEL4") - ToggleChatColorNamesByClassGroup(true, "CHANNEL5") - ToggleChatColorNamesByClassGroup(true, "CHANNEL6") - ToggleChatColorNamesByClassGroup(true, "CHANNEL7") - ToggleChatColorNamesByClassGroup(true, "CHANNEL8") - ToggleChatColorNamesByClassGroup(true, "CHANNEL9") - ToggleChatColorNamesByClassGroup(true, "CHANNEL10") - ToggleChatColorNamesByClassGroup(true, "CHANNEL11") - - ChangeChatColor("CHANNEL1", 195 / 255, 230 / 255, 232 / 255) - ChangeChatColor("CHANNEL2", 232 / 255, 158 / 255, 121 / 255) - ChangeChatColor("CHANNEL3", 232 / 255, 228 / 255, 121 / 255) - - if not mungs then - if SV.Chat then - SV.Chat:ReLoad(true) - if SVUI_Cache["Dock"].RightSuperDockFaded == true then RightSuperDockToggleButton:Click()end - if SVUI_Cache["Dock"].LeftSuperDockFaded == true then LeftSuperDockToggleButton:Click()end - end - SV:SavedPopup() - end -end ---[[ -########################################################## -GLOBAL/MODULE FUNCTIONS -########################################################## -]]-- -function SV:SetUserScreen(rez, preserve) - if not preserve then - if okToResetMOVE then - self:ResetMovables("") - okToResetMOVE = false; - end - self.db:SetDefault("SVUnit") - end - - if not SV.db.framelocations then SV.db.framelocations = {} end - if rez == "low" then - if not preserve then - self.db.SVDock.dockLeftWidth = 350; - self.db.SVDock.dockLeftHeight = 180; - self.db.SVDock.dockRightWidth = 350; - self.db.SVDock.dockRightHeight = 180; - self.db.SVAura.wrapAfter = 10 - self.db.SVUnit.fontSize = 10; - self.db.SVUnit.player.width = 200; - self.db.SVUnit.player.castbar.width = 200; - self.db.SVUnit.player.classbar.fill = "fill" - self.db.SVUnit.player.health.tags = "[health:color][health:current]" - self.db.SVUnit.target.width = 200; - self.db.SVUnit.target.castbar.width = 200; - self.db.SVUnit.target.health.tags = "[health:color][health:current]" - self.db.SVUnit.pet.power.enable = false; - self.db.SVUnit.pet.width = 200; - self.db.SVUnit.pet.height = 26; - self.db.SVUnit.targettarget.debuffs.enable = false; - self.db.SVUnit.targettarget.power.enable = false; - self.db.SVUnit.targettarget.width = 200; - self.db.SVUnit.targettarget.height = 26; - self.db.SVUnit.boss.width = 200; - self.db.SVUnit.boss.castbar.width = 200; - self.db.SVUnit.arena.width = 200; - self.db.SVUnit.arena.castbar.width = 200 - end - if not mungs then - UFMoveBottomQuadrant(true) - UFMoveLeftQuadrant(true) - UFMoveTopQuadrant(true) - UFMoveRightQuadrant(true) - end - self.ghettoMonitor = true - else - self.db:SetDefault("SVDock") - self.db:SetDefault("SVAura") - if not mungs then - UFMoveBottomQuadrant() - UFMoveLeftQuadrant() - UFMoveTopQuadrant() - UFMoveRightQuadrant() - end - self.ghettoMonitor = nil - end - - if(not preserve and not mungs) then - BarShuffle() - self:SetSVMovablesPositions() - Registry:Update('SVDock') - Registry:Update('SVAura') - Registry:Update('SVBar') - Registry:Update('SVUnit') - SV:SavedPopup() - end -end - -function SV:SetColorTheme(style, preserve) - style = style or "default"; - - if not preserve then - self.db:SetDefault("media") - end - - local presets = self:LoadPresetData("media", style) - self.db.LAYOUT.mediastyle = style; - - if(style == "default") then - self.db.SVUnit.healthclass = true; - else - self.db.SVUnit.healthclass = false; - end - - if(not mungs) then - self:MediaUpdate() - Registry:Update('SVStats') - Registry:Update('SVUnit') - if(not preserve) then - SV:SavedPopup() - end - end -end - -function SV:SetUnitframeLayout(style, preserve) - style = style or "default"; - - if not SV.db.framelocations then SV.db.framelocations = {} end - - if not preserve then - self.db:SetDefault("SVUnit") - self.db:SetDefault("SVStats") - if okToResetMOVE then - self:ResetMovables('') - okToResetMOVE = false - end - end - - local presets = self:LoadPresetData("units", style) - self.db.LAYOUT.unitstyle = style - - if(self.db.LAYOUT.mediastyle == "default") then - self.db.SVUnit.healthclass = true; - end - - if(not mungs) then - if(not preserve) then - if self.db.LAYOUT.barstyle and (self.db.LAYOUT.barstyle == "twosmall" or self.db.LAYOUT.barstyle == "twobig") then - UFMoveBottomQuadrant("shift") - else - UFMoveBottomQuadrant() - end - self:SetSVMovablesPositions() - end - Registry:Update('SVStats') - Registry:Update('SVUnit') - if(not preserve) then - SV:SavedPopup() - end - end -end - -function SV:SetGroupframeLayout(style, preserve) - style = style or "default"; - - local presets = self:LoadPresetData("layouts", style) - self.db.LAYOUT.groupstyle = style - - if(not mungs) then - Registry:Update('SVUnit') - if(not preserve) then - SV:SavedPopup() - end - end -end - -function SV:SetupBarLayout(style, preserve) - style = style or "default"; - - if not SV.db.framelocations then SV.db.framelocations={} end - if not preserve then - self.db:SetDefault("SVBar") - if okToResetMOVE then - self:ResetMovables('') - okToResetMOVE=false - end - end - - local presets = self:LoadPresetData("bars", style) - self.db.LAYOUT.barstyle = style; - - if(not mungs) then - if(not preserve) then - if(style == 'twosmall' or style == 'twobig') then - UFMoveBottomQuadrant("shift") - else - UFMoveBottomQuadrant() - end - end - if(not preserve) then - BarShuffle() - self:SetSVMovablesPositions() - end - Registry:Update('SVStats') - Registry:Update('SVBar') - if(not preserve) then - SV:SavedPopup() - end - end -end - -function SV:SetupAuralayout(style, preserve) - style = style or "default"; - local presets = self:LoadPresetData("auras", style) - self.db.LAYOUT.aurastyle = style; - - if(not mungs) then - Registry:Update('SVStats') - Registry:Update('SVAura') - Registry:Update('SVUnit') - if(not preserve) then - SV:SavedPopup() - end - end -end - -local function PlayThemeSong() - if(not musicIsPlaying) then - SetCVar("Sound_MusicVolume", 100) - SetCVar("Sound_EnableMusic", 1) - StopMusic() - PlayMusic([[Interface\AddOns\SVUI\assets\sounds\SV.mp3]]) - musicIsPlaying = true - end -end - -local function InstallComplete() - SVUI_Profile.SAFEDATA.install_version = SV.___version; - StopMusic() - SetCVar("Sound_MusicVolume",user_music_vol) - okToResetMOVE = false; - ReloadUI() -end - -local function InstallMungsChoice() - mungs = true; - okToResetMOVE = false; - initChat(true); - SV:SetUserScreen('high'); - SV:SetColorTheme(); - SV.db.LAYOUT.unitstyle = nil; - SV:SetUnitframeLayout(); - SV.db.LAYOUT.groupstyle = nil; - SV.db.LAYOUT.barstyle = nil; - SV:SetupBarLayout(); - SV:SetupAuralayout(); - SVUI_Profile.SAFEDATA.install_version = SV.___version; - StopMusic() - SetCVar("Sound_MusicVolume",user_music_vol) - ReloadUI() -end - -local function ResetAll() - SVUI_InstallNextButton:Disable() - SVUI_InstallPrevButton:Disable() - SVUI_InstallOption01Button:Hide() - SVUI_InstallOption01Button:SetScript("OnClick",nil) - SVUI_InstallOption01Button:SetText("") - SVUI_InstallOption02Button:Hide() - SVUI_InstallOption02Button:SetScript("OnClick",nil) - SVUI_InstallOption02Button:SetText("") - SVUI_InstallOption03Button:Hide() - SVUI_InstallOption03Button:SetScript("OnClick",nil) - SVUI_InstallOption03Button:SetText("") - SVUI_InstallOption1Button:Hide() - SVUI_InstallOption1Button:SetScript("OnClick",nil) - SVUI_InstallOption1Button:SetText("") - SVUI_InstallOption2Button:Hide() - SVUI_InstallOption2Button:SetScript('OnClick',nil) - SVUI_InstallOption2Button:SetText('') - SVUI_InstallOption3Button:Hide() - SVUI_InstallOption3Button:SetScript('OnClick',nil) - SVUI_InstallOption3Button:SetText('') - SVUI_InstallOption4Button:Hide() - SVUI_InstallOption4Button:SetScript('OnClick',nil) - SVUI_InstallOption4Button:SetText('') - SVUI_SetupHolder.SubTitle:SetText("") - SVUI_SetupHolder.Desc1:SetText("") - SVUI_SetupHolder.Desc2:SetText("") - SVUI_SetupHolder.Desc3:SetText("") - SVUI_SetupHolder:Size(550,400) -end - -local function SetPage(newPage) - CURRENT_PAGE = newPage; - ResetAll() - InstallStatus.text:SetText(CURRENT_PAGE.." / "..MAX_PAGE) - local setupFrame = SVUI_SetupHolder; - if newPage ~= MAX_PAGE then - SVUI_InstallNextButton:Enable() - SVUI_InstallNextButton:Show() - end - if newPage ~= 1 then - SVUI_InstallPrevButton:Enable() - SVUI_InstallPrevButton:Show() - end - --[[ - more useful globalstrings - - CUSTOM - SETTINGS - DEFAULT - DEFAULTS - USE - UIOPTIONS_MENU - LFGWIZARD_TITLE - CONTINUE - ]]-- - ShowLayout() - if newPage == 1 then - local hasOldConfig = SVUI_Profile.SAFEDATA.install_version - SVUI_InstallPrevButton:Disable() - SVUI_InstallPrevButton:Hide() - okToResetMOVE = true - setupFrame.SubTitle:SetText(format(L["This is Supervillain UI version %s!"], SV.___version)) - setupFrame.Desc1:SetText(L["Before I can turn you loose, persuing whatever villainy you feel will advance your professional career... I need to ask some questions and turn a few screws first."]) - setupFrame.Desc2:SetText(L["At any time you can get to the config options by typing the command / sv. For quick changes to frame, bar or color sets, call your henchman by clicking the button on the bottom right of your screen. (Its the one with his stupid face on it)"]) - setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) - SVUI_InstallOption01Button:Show() - SVUI_InstallOption01Button:SetScript("OnClick", InstallMungsChoice) - SVUI_InstallOption01Button:SetText(USE.."\n"..DEFAULT.."\n"..SETTINGS) - - SVUI_InstallOption02Button:Show() - SVUI_InstallOption02Button:SetScript("OnClick", InstallComplete) - SVUI_InstallOption02Button:SetText("PRETEND YOU\nDID THIS\nALREADY") - - if(hasOldConfig) then - SVUI_InstallOption03Button:Show() - SVUI_InstallOption03Button:SetScript("OnClick", InstallComplete) - SVUI_InstallOption03Button:SetText("Keep\nSaved\n"..SETTINGS) - end - - elseif newPage == 2 then - setupFrame.SubTitle:SetText(CHAT) - setupFrame.Desc1:SetText(L["Whether you want to or not, you will be needing a communicator so other villains can either update you on their doings-of-evil or inform you about the MANY abilities of Chuck Norris"]) - setupFrame.Desc2:SetText(L["The chat windows function the same as standard chat windows, you can right click the tabs and drag them, rename them, slap them around, you know... whatever. Clickity-click to setup your chat windows."]) - setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) - SVUI_InstallOption1Button:Show() - SVUI_InstallOption1Button:SetScript("OnClick", function() - initChat(false) - end) - SVUI_InstallOption1Button:SetText(CHAT_DEFAULTS) - - elseif newPage == 3 then - local rez = GetCVar("gxResolution") - setupFrame.SubTitle:SetText(RESOLUTION) - setupFrame.Desc1:SetText(format(L["Your current resolution is %s, this is considered a %s resolution."], rez, (SV.ghettoMonitor and LOW or HIGH))) - if SV.ghettoMonitor then - setupFrame.Desc2:SetText(L["This resolution requires that you change some settings to get everything to fit on your screen."].." "..L["Click the button below to resize your chat frames, unitframes, and reposition your actionbars."].." "..L["You may need to further alter these settings depending how low your resolution is."]) - setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) - else - setupFrame.Desc2:SetText(L["This resolution doesn't require that you change settings for the UI to fit on your screen."].." "..L["Click the button below to resize your chat frames, unitframes, and reposition your actionbars."].." "..L["This is completely optional."]) - setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) - end - SVUI_InstallOption1Button:Show() - SVUI_InstallOption1Button:SetScript("OnClick", function() - SV:SetUserScreen("high") - SVUI_SetupHolder.Desc1:SetText(L["|cffFF9F00"..HIGH.." "..RESOLUTION.."!|r"]) - SVUI_SetupHolder.Desc2:SetText(L["So what you think your better than me with your big monitor? HUH?!?!"]) - SVUI_SetupHolder.Desc3:SetText(L["Dont forget whos in charge here! But enjoy the incredible detail."]) - end) - SVUI_InstallOption1Button:SetText(HIGH) - SVUI_InstallOption2Button:Show() - SVUI_InstallOption2Button:SetScript("OnClick", function() - SV:SetUserScreen("low") - SVUI_SetupHolder.Desc1:SetText(L["|cffFF9F00"..LOW.." "..RESOLUTION.."|r"]) - SVUI_SetupHolder.Desc2:SetText(L["Why are you playing this on what I would assume is a calculator display?"]) - SVUI_SetupHolder.Desc3:SetText(L["Enjoy the ONE incredible pixel that fits on this screen."]) - end) - SVUI_InstallOption2Button:SetText(LOW) - - elseif newPage == 4 then - setupFrame.SubTitle:SetText(COLOR.." "..SETTINGS) - setupFrame.Desc1:SetText(L["Choose a theme layout you wish to use for your initial setup."]) - setupFrame.Desc2:SetText(L["You can always change fonts and colors of any element of Supervillain UI from the in-game configuration."]) - setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) - SVUI_InstallOption1Button:Show() - SVUI_InstallOption1Button:SetScript("OnClick", function() - SV:SetColorTheme("kaboom") - SVUI_SetupHolder.Desc1:SetText(L["|cffFF9F00KABOOOOM!|r"]) - SVUI_SetupHolder.Desc2:SetText(L["This theme tells the world that you are a villain who can put on a show"]..CONTINUED) - SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["or better yet, you ARE the show!"]) - end) - SVUI_InstallOption1Button:SetText(L["Kaboom!"]) - SVUI_InstallOption2Button:Show() - SVUI_InstallOption2Button:SetScript("OnClick", function() - SV:SetColorTheme("dark") - SVUI_SetupHolder.Desc1:SetText(L["|cffAF30FFThe Darkest Night|r"]) - SVUI_SetupHolder.Desc2:SetText(L["This theme indicates that you have no interest in wasting time"]..CONTINUED) - SVUI_SetupHolder.Desc3:SetText(CONTINUED..L[" the dying begins NOW!"]) - end) - SVUI_InstallOption2Button:SetText(L["Darkness"]) - SVUI_InstallOption3Button:Show() - SVUI_InstallOption3Button:SetScript("OnClick", function() - SV:SetColorTheme("classy") - SVUI_SetupHolder.Desc1:SetText(L["|cffFFFF00"..CLASS_COLORS.."|r"]) - SVUI_SetupHolder.Desc2:SetText(L["This theme is for villains who take pride in their class"]..CONTINUED) - SVUI_SetupHolder.Desc3:SetText(CONTINUED..L[" villains know how to reprezent!"]) - end) - SVUI_InstallOption3Button:SetText(L["Class" .. "\n" .. "Colors"]) - SVUI_InstallOption4Button:Show() - SVUI_InstallOption4Button:SetScript("OnClick", function() - SV:SetColorTheme() - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFPlain and Simple|r"]) - SVUI_SetupHolder.Desc2:SetText(L["This theme is for any villain who sticks to their traditions"]..CONTINUED) - SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["you don't need fancyness to kick some ass!"]) - end) - SVUI_InstallOption4Button:SetText(L["Vintage"]) - - elseif newPage == 5 then - ShowLayout(true) - setupFrame.SubTitle:SetText(UNITFRAME_LABEL.." "..SETTINGS) - setupFrame.Desc1:SetText(L["You can now choose what primary unitframe style you wish to use."]) - setupFrame.Desc2:SetText(L["This will change the layout of your unitframes (ie.. Player, Target, Pet, Party, Raid ...etc)."]) - setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) - SVUI_InstallOption1Button:Show() - SVUI_InstallOption1Button:SetScript("OnClick", function() - SV.db.LAYOUT.unitstyle = nil; - SV:SetUnitframeLayout("super") - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFLets Do This|r"]) - SVUI_SetupHolder.Desc2:SetText(L["This layout is anything but minimal! Using this is like being at a rock concert"]..CONTINUED) - SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["then annihilating the crowd with frickin lazer beams!"]) - end) - SVUI_InstallOption1Button:SetText(L["Super"]) - SVUI_InstallOption2Button:Show() - SVUI_InstallOption2Button:SetScript("OnClick", function() - SV.db.LAYOUT.unitstyle = nil; - SV:SetUnitframeLayout("simple") - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFSimply Simple|r"]) - SVUI_SetupHolder.Desc2:SetText(L["This layout is for the villain who just wants to get things done!"]..CONTINUED) - SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["but he still wants to see your face before he hits you!"]) - end) - SVUI_InstallOption2Button:SetText(L["Simple"]) - SVUI_InstallOption3Button:Show() - SVUI_InstallOption3Button:SetScript("OnClick", function() - SV.db.LAYOUT.unitstyle = nil; - SV:SetUnitframeLayout("compact") - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFEl Compacto|r"]) - SVUI_SetupHolder.Desc2:SetText(L["Just the necessities so you can see more of the world around you"]..CONTINUED) - SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["you dont need no fanciness getting in the way of world domination do you?"]) - end) - SVUI_InstallOption3Button:SetText(L["Compact"]) - - elseif newPage == 6 then - ShowLayout(true) - setupFrame.SubTitle:SetText("Group Layout") - setupFrame.Desc1:SetText(L["You can now choose what group layout you prefer."]) - setupFrame.Desc2:SetText(L["This will adjust various settings on group units, attempting to make certain roles more usable"]) - setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) - - SVUI_InstallOption1Button:Show() - SVUI_InstallOption1Button:SetScript("OnClick", function() - SV.db.LAYOUT.groupstyle = "default"; - SV:SetGroupframeLayout("default") - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFStandard|r"]) - SVUI_SetupHolder.Desc2:SetText(L["You are good to go with the default layout"]..CONTINUED) - SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["frames schmames, lets kill some stuff!"]) - end) - SVUI_InstallOption1Button:SetText(L["Standard"]) - - SVUI_InstallOption2Button:Show() - SVUI_InstallOption2Button:SetScript("OnClick", function() - SV.db.LAYOUT.groupstyle = nil; - SV:SetGroupframeLayout("healer") - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFMEDIC!!|r"]) - SVUI_SetupHolder.Desc2:SetText(L["You are pretty helpful.. for a VILLAIN!"]..CONTINUED) - SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["Hey, even a super villain gets his ass kicked once in awhile. We need the likes of you!"]) - end) - SVUI_InstallOption2Button:SetText(L["Healer"]) - - SVUI_InstallOption3Button:Show() - SVUI_InstallOption3Button:SetScript("OnClick", function() - SV.db.LAYOUT.groupstyle = nil; - SV:SetGroupframeLayout("dps") - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFDeath Dealer|r"]) - SVUI_SetupHolder.Desc2:SetText(L["You are the kings of our craft. Handing out pain like its halloween candy."]..CONTINUED) - SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["I will move and squeeze group frames out of your way so you have more room for BOOM!"]) - end) - SVUI_InstallOption3Button:SetText(L["DPS"]) - - SVUI_InstallOption4Button:Show() - SVUI_InstallOption4Button:SetScript("OnClick", function() - SV.db.LAYOUT.groupstyle = nil; - SV:SetGroupframeLayout("grid") - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFCubed|r"]) - SVUI_SetupHolder.Desc2:SetText(L["You are cold and calculated, your frames should reflect as much."]..CONTINUED) - SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["I'm gonna make these frames so precise that you can cut your finger on them!"]) - end) - SVUI_InstallOption4Button:SetText(L["Grid"]) - - elseif newPage == 7 then - setupFrame.SubTitle:SetText(ACTIONBAR_LABEL.." "..SETTINGS) - setupFrame.Desc1:SetText(L["Choose a layout for your action bars."]) - setupFrame.Desc2:SetText(L["Sometimes you need big buttons, sometimes you don't. Your choice here."]) - setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) - SVUI_InstallOption1Button:Show() - SVUI_InstallOption1Button:SetScript("OnClick", function() - SV.db.LAYOUT.barstyle = nil; - SV:SetupBarLayout("default") - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFLean And Clean|r"]) - SVUI_SetupHolder.Desc2:SetText(L["Lets keep it slim and deadly, not unlike a ninja sword."]) - SVUI_SetupHolder.Desc3:SetText(L["You dont ever even look at your bar hardly, so pick this one!"]) - end) - SVUI_InstallOption1Button:SetText(L["Small" .. "\n" .. "Row"]) - SVUI_InstallOption2Button:Show() - SVUI_InstallOption2Button:SetScript("OnClick", function() - SV.db.LAYOUT.barstyle = nil; - SV:SetupBarLayout("twosmall") - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFMore For Less|r"]) - SVUI_SetupHolder.Desc2:SetText(L["Granted, you dont REALLY need the buttons due to your hotkey-leetness, you just like watching cooldowns!"]) - SVUI_SetupHolder.Desc3:SetText(L["Sure thing cowboy, your secret is safe with me!"]) - end) - SVUI_InstallOption2Button:SetText(L["2 Small" .. "\n" .. "Rows"]) - SVUI_InstallOption3Button:Show() - SVUI_InstallOption3Button:SetScript("OnClick", function() - SV.db.LAYOUT.barstyle = nil; - SV:SetupBarLayout("onebig") - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFWhat Big Buttons You Have|r"]) - SVUI_SetupHolder.Desc2:SetText(L["The better to PEW-PEW you with my dear!"]) - SVUI_SetupHolder.Desc3:SetText(L["When you have little time for mouse accuracy, choose this set!"]) - end) - SVUI_InstallOption3Button:SetText(L["Big" .. "\n" .. "Row"]) - SVUI_InstallOption4Button:Show() - SVUI_InstallOption4Button:SetScript("OnClick", function() - SV.db.LAYOUT.barstyle = nil; - SV:SetupBarLayout("twobig") - SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFThe Double Down|r"]) - SVUI_SetupHolder.Desc2:SetText(L["Lets be honest for a moment. Who doesnt like a huge pair in their face?"]) - SVUI_SetupHolder.Desc3:SetText(L["Double your bars then double their size for maximum button goodness!"]) - end) - SVUI_InstallOption4Button:SetText(L["2 Big" .. "\n" .. "Rows"]) - - elseif newPage == 8 then - setupFrame.SubTitle:SetText(AURAS.." "..SETTINGS) - setupFrame.Desc1:SetText(L["Select an aura layout. \"Icons\" will display only icons and aurabars won't be used. \"Bars\" will display only aurabars and icons won't be used (duh). \"The Works!\" does just what it says.... icons, bars and awesomeness."]) - setupFrame.Desc2:SetText(L["If you have an aura that you don't want to display simply hold down shift and right click the icon for it to suffer a painful death."]) - setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) - - SVUI_InstallOption1Button:Show() - SVUI_InstallOption1Button:SetScript("OnClick", function() - SV:SetupAuralayout() - end) - SVUI_InstallOption1Button:SetText(L["Vintage"]) - - SVUI_InstallOption2Button:Show() - SVUI_InstallOption2Button:SetScript("OnClick", function() - SV:SetupAuralayout("icons") - end) - SVUI_InstallOption2Button:SetText(L["Icons"]) - - SVUI_InstallOption3Button:Show() - SVUI_InstallOption3Button:SetScript("OnClick", function() - SV:SetupAuralayout("bars") - end) - SVUI_InstallOption3Button:SetText(L["Bars"]) - - SVUI_InstallOption4Button:Show() - SVUI_InstallOption4Button:SetScript("OnClick", function() - SV:SetupAuralayout("theworks") - end) - SVUI_InstallOption4Button:SetText(L["The" .. "\n" .. "Works!"]) - - elseif newPage == 9 then - SVUI_InstallNextButton:Disable() - SVUI_InstallNextButton:Hide() - setupFrame.SubTitle:SetText(BASIC_OPTIONS_TOOLTIP..CONTINUED..AUCTION_TIME_LEFT0) - setupFrame.Desc1:SetText(L["Thats it! All done! Now we just need to hand these choices off to the henchmen so they can get you ready to (..insert evil tasks here..)!"]) - setupFrame.Desc2:SetText(L["Click the button below to reload and get on your way! Good luck villain!"]) - SVUI_InstallOption1Button:Show() - SVUI_InstallOption1Button:SetScript("OnClick", InstallComplete) - SVUI_InstallOption1Button:SetText(L["THE_BUTTON_BELOW"]) - SVUI_SetupHolder:Size(550, 350) - end -end - -local function NextPage() - if CURRENT_PAGE ~= MAX_PAGE then - CURRENT_PAGE = CURRENT_PAGE + 1; - SetPage(CURRENT_PAGE) - end -end - -local function PreviousPage() - if CURRENT_PAGE ~= 1 then - CURRENT_PAGE = CURRENT_PAGE - 1; - SetPage(CURRENT_PAGE) - end -end - -local function ResetGlobalVariables() - for k,v in pairs(SVUI_Cache) do - SVUI_Cache[k] = nil - end -end - -function SV:ResetInstallation() - mungs = true; - okToResetMOVE = false; - initChat(true); - SV.db:Reset() - SV:SetUserScreen(); - - if SV.db.LAYOUT.mediastyle then - SV:SetColorTheme(SV.db.LAYOUT.mediastyle) - else - SV.db.LAYOUT.mediastyle = nil; - SV:SetColorTheme() - end - - if SV.db.LAYOUT.unitstyle then - SV:SetUnitframeLayout(SV.db.LAYOUT.unitstyle) - else - SV.db.LAYOUT.unitstyle = nil; - SV:SetUnitframeLayout() - end - - if SV.db.LAYOUT.barstyle then - SV:SetupBarLayout(SV.db.LAYOUT.barstyle) - else - SV.db.LAYOUT.barstyle = nil; - SV:SetupBarLayout() - end - - if SV.db.LAYOUT.aurastyle then - SV:SetupAuralayout(SV.db.LAYOUT.aurastyle) - else - SV.db.LAYOUT.aurastyle = nil; - SV:SetupAuralayout() - end - - SVUI_Profile.SAFEDATA.install_version = SV.___version; - ResetGlobalVariables() - ReloadUI() -end - -function SV:Install(autoLoaded) - if(not user_music_vol) then - user_music_vol = GetCVar("Sound_MusicVolume") - end - - -- frame - if not SVUI_SetupHolder then - local frame = CreateFrame("Button", "SVUI_SetupHolder", UIParent) - frame.SetPage = SetPage; - frame:Size(550, 400) - frame:SetPanelTemplate("Action") - frame:SetPoint("CENTER") - frame:SetFrameStrata("TOOLTIP") - frame.Title = frame:CreateFontString(nil, "OVERLAY") - frame.Title:SetFont(SV.Media.font.narrator, 22, "OUTLINE") - frame.Title:Point("TOP", 0, -5) - frame.Title:SetText(L["Supervillain UI Installation"]) - - frame.Next = CreateFrame("Button", "SVUI_InstallNextButton", frame, "UIPanelButtonTemplate") - frame.Next:RemoveTextures() - frame.Next:Size(110, 25) - frame.Next:Point("BOTTOMRIGHT", 50, 5) - SetInstallButton(frame.Next) - frame.Next.texture = frame.Next:CreateTexture(nil, "BORDER") - frame.Next.texture:Size(110, 75) - frame.Next.texture:Point("RIGHT") - frame.Next.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION-ARROW") - frame.Next.texture:SetVertexColor(1, 0.5, 0) - frame.Next.text = frame.Next:CreateFontString(nil, "OVERLAY") - frame.Next.text:SetFont(SV.Media.font.action, 18, "OUTLINE") - frame.Next.text:SetPoint("CENTER") - frame.Next.text:SetText(CONTINUE) - frame.Next:Disable() - frame.Next:SetScript("OnClick", NextPage) - frame.Next:SetScript("OnEnter", function(this) - this.texture:SetVertexColor(1, 1, 0) - end) - frame.Next:SetScript("OnLeave", function(this) - this.texture:SetVertexColor(1, 0.5, 0) - end) - - frame.Prev = CreateFrame("Button", "SVUI_InstallPrevButton", frame, "UIPanelButtonTemplate") - frame.Prev:RemoveTextures() - frame.Prev:Size(110, 25) - frame.Prev:Point("BOTTOMLEFT", -50, 5) - SetInstallButton(frame.Prev) - frame.Prev.texture = frame.Prev:CreateTexture(nil, "BORDER") - frame.Prev.texture:Size(110, 75) - frame.Prev.texture:Point("LEFT") - frame.Prev.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION-ARROW") - frame.Prev.texture:SetTexCoord(1, 0, 1, 1, 0, 0, 0, 1) - frame.Prev.texture:SetVertexColor(1, 0.5, 0) - frame.Prev.text = frame.Prev:CreateFontString(nil, "OVERLAY") - frame.Prev.text:SetFont(SV.Media.font.action, 18, "OUTLINE") - frame.Prev.text:SetPoint("CENTER") - frame.Prev.text:SetText(PREVIOUS) - frame.Prev:Disable() - frame.Prev:SetScript("OnClick", PreviousPage) - frame.Prev:SetScript("OnEnter", function(this) - this.texture:SetVertexColor(1, 1, 0) - end) - frame.Prev:SetScript("OnLeave", function(this) - this.texture:SetVertexColor(1, 0.5, 0) - end) - frame.Status = CreateFrame("Frame", "InstallStatus", frame) - frame.Status:SetFrameLevel(frame.Status:GetFrameLevel() + 2) - frame.Status:Size(150, 30) - frame.Status:Point("BOTTOM", frame, "TOP", 0, 2) - frame.Status.text = frame.Status:CreateFontString(nil, "OVERLAY") - frame.Status.text:SetFont(SV.Media.font.numbers, 22, "OUTLINE") - frame.Status.text:SetPoint("CENTER") - frame.Status.text:SetText(CURRENT_PAGE.." / "..MAX_PAGE) - - frame.Option01 = CreateFrame("Button", "SVUI_InstallOption01Button", frame, "UIPanelButtonTemplate") - frame.Option01:RemoveTextures() - frame.Option01:Size(160, 30) - frame.Option01:Point("BOTTOM", 0, 15) - frame.Option01:SetText("") - SetInstallButton(frame.Option01) - frame.Option01.texture = frame.Option01:CreateTexture(nil, "BORDER") - frame.Option01.texture:Size(160, 160) - frame.Option01.texture:Point("CENTER", frame.Option01, "BOTTOM", 0, -15) - frame.Option01.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") - frame.Option01.texture:SetGradient("VERTICAL", 0, 0.3, 0, 0, 0.7, 0) - frame.Option01:SetScript("OnEnter", function(this) - this.texture:SetVertexColor(0.5, 1, 0.4) - end) - frame.Option01:SetScript("OnLeave", function(this) - this.texture:SetGradient("VERTICAL", 0, 0.3, 0, 0, 0.7, 0) - end) - hooksecurefunc(frame.Option01, "SetWidth", function(g, h) - g.texture:Size(h, h) - g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) - end) - frame.Option01:SetFrameLevel(frame.Option01:GetFrameLevel() + 10) - frame.Option01:Hide() - - frame.Option02 = CreateFrame("Button", "SVUI_InstallOption02Button", frame, "UIPanelButtonTemplate") - frame.Option02:RemoveTextures() - frame.Option02:Size(130, 30) - frame.Option02:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) - frame.Option02:SetText("") - SetInstallButton(frame.Option02) - frame.Option02.texture = frame.Option02:CreateTexture(nil, "BORDER") - frame.Option02.texture:Size(130, 110) - frame.Option02.texture:Point("CENTER", frame.Option02, "BOTTOM", 0, -15) - frame.Option02.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") - frame.Option02.texture:SetGradient("VERTICAL", 0.3, 0, 0, 0.7, 0, 0) - frame.Option02:SetScript("OnEnter", function(this) - this.texture:SetVertexColor(0.5, 1, 0.4) - end) - frame.Option02:SetScript("OnLeave", function(this) - this.texture:SetGradient("VERTICAL", 0.3, 0, 0, 0.7, 0, 0) - end) - hooksecurefunc(frame.Option02, "SetWidth", function(g, h) - g.texture:Size(h, h) - g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) - end) - frame.Option02:SetScript("OnShow", function() - frame.Option01:SetWidth(130) - frame.Option01:ClearAllPoints() - frame.Option01:Point("BOTTOMRIGHT", frame, "BOTTOM", -4, 15) - end) - frame.Option02:SetScript("OnHide", function() - frame.Option01:SetWidth(160) - frame.Option01:ClearAllPoints() - frame.Option01:Point("BOTTOM", 0, 15) - end) - frame.Option02:SetFrameLevel(frame.Option01:GetFrameLevel() + 10) - frame.Option02:Hide() - - frame.Option03 = CreateFrame("Button", "SVUI_InstallOption03Button", frame, "UIPanelButtonTemplate") - frame.Option03:RemoveTextures() - frame.Option03:Size(130, 30) - frame.Option03:Point("BOTTOM", frame, "BOTTOM", 0, 15) - frame.Option03:SetText("") - SetInstallButton(frame.Option03) - frame.Option03.texture = frame.Option03:CreateTexture(nil, "BORDER") - frame.Option03.texture:Size(130, 110) - frame.Option03.texture:Point("CENTER", frame.Option03, "BOTTOM", 0, -15) - frame.Option03.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") - frame.Option03.texture:SetGradient("VERTICAL", 0, 0.1, 0.3, 0, 0.5, 0.7) - frame.Option03:SetScript("OnEnter", function(this) - this.texture:SetVertexColor(0.2, 0.5, 1) - end) - frame.Option03:SetScript("OnLeave", function(this) - this.texture:SetGradient("VERTICAL", 0, 0.1, 0.3, 0, 0.5, 0.7) - end) - hooksecurefunc(frame.Option03, "SetWidth", function(g, h) - g.texture:Size(h, h) - g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) - end) - frame.Option03:SetScript("OnShow", function(self) - self:SetWidth(130) - frame.Option01:SetWidth(130) - frame.Option01:ClearAllPoints() - frame.Option01:Point("RIGHT", self, "LEFT", -8, 0) - frame.Option02:SetWidth(130) - frame.Option02:ClearAllPoints() - frame.Option02:Point("LEFT", self, "RIGHT", 8, 0) - end) - frame.Option03:SetScript("OnHide", function() - frame.Option01:SetWidth(160) - frame.Option01:ClearAllPoints() - frame.Option01:Point("BOTTOM", 0, 15) - frame.Option02:ClearAllPoints() - frame.Option02:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) - end) - frame.Option03:SetFrameLevel(frame.Option01:GetFrameLevel() + 10) - frame.Option03:Hide() - - frame.Option1 = CreateFrame("Button", "SVUI_InstallOption1Button", frame, "UIPanelButtonTemplate") - frame.Option1:RemoveTextures() - frame.Option1:Size(160, 30) - frame.Option1:Point("BOTTOM", 0, 15) - frame.Option1:SetText("") - SetInstallButton(frame.Option1) - frame.Option1.texture = frame.Option1:CreateTexture(nil, "BORDER") - frame.Option1.texture:Size(160, 160) - frame.Option1.texture:Point("CENTER", frame.Option1, "BOTTOM", 0, -15) - frame.Option1.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") - frame.Option1.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) - frame.Option1:SetScript("OnEnter", function(this) - this.texture:SetVertexColor(0.5, 1, 0.4) - end) - frame.Option1:SetScript("OnLeave", function(this) - this.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) - end) - hooksecurefunc(frame.Option1, "SetWidth", function(g, h) - g.texture:Size(h, h) - g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) - end) - frame.Option1:SetFrameLevel(frame.Option1:GetFrameLevel() + 10) - frame.Option1:Hide() - - frame.Option2 = CreateFrame("Button", "SVUI_InstallOption2Button", frame, "UIPanelButtonTemplate") - frame.Option2:RemoveTextures() - frame.Option2:Size(120, 30) - frame.Option2:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) - frame.Option2:SetText("") - SetInstallButton(frame.Option2) - frame.Option2.texture = frame.Option2:CreateTexture(nil, "BORDER") - frame.Option2.texture:Size(120, 110) - frame.Option2.texture:Point("CENTER", frame.Option2, "BOTTOM", 0, -15) - frame.Option2.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") - frame.Option2.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) - frame.Option2:SetScript("OnEnter", function(this) - this.texture:SetVertexColor(0.5, 1, 0.4) - end) - frame.Option2:SetScript("OnLeave", function(this) - this.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) - end) - hooksecurefunc(frame.Option2, "SetWidth", function(g, h) - g.texture:Size(h, h) - g.texture:Point("CENTER", g, "BOTTOM", 0, -(h * 0.09)) - end) - frame.Option2:SetScript("OnShow", function() - frame.Option1:SetWidth(120) - frame.Option1:ClearAllPoints() - frame.Option1:Point("BOTTOMRIGHT", frame, "BOTTOM", -4, 15) - end) - frame.Option2:SetScript("OnHide", function() - frame.Option1:SetWidth(160) - frame.Option1:ClearAllPoints() - frame.Option1:Point("BOTTOM", 0, 15) - end) - frame.Option2:SetFrameLevel(frame.Option1:GetFrameLevel() + 10) - frame.Option2:Hide() - - frame.Option3 = CreateFrame("Button", "SVUI_InstallOption3Button", frame, "UIPanelButtonTemplate") - frame.Option3:RemoveTextures() - frame.Option3:Size(110, 30) - frame.Option3:Point("LEFT", frame.Option2, "RIGHT", 4, 0) - frame.Option3:SetText("") - SetInstallButton(frame.Option3) - frame.Option3.texture = frame.Option3:CreateTexture(nil, "BORDER") - frame.Option3.texture:Size(110, 100) - frame.Option3.texture:Point("CENTER", frame.Option3, "BOTTOM", 0, -9) - frame.Option3.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") - frame.Option3.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) - frame.Option3:SetScript("OnEnter", function(this) - this.texture:SetVertexColor(0.5, 1, 0.4) - end) - frame.Option3:SetScript("OnLeave", function(this) - this.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) - end) - frame.Option3:SetScript("OnShow", function() - frame.Option1:SetWidth(110) - frame.Option1:ClearAllPoints() - frame.Option1:Point("RIGHT", frame.Option2, "LEFT", -4, 0) - frame.Option2:SetWidth(110) - frame.Option2:ClearAllPoints() - frame.Option2:Point("BOTTOM", frame, "BOTTOM", 0, 15) - end) - frame.Option3:SetScript("OnHide", function() - frame.Option1:SetWidth(160) - frame.Option1:ClearAllPoints() - frame.Option1:Point("BOTTOM", 0, 15) - frame.Option2:SetWidth(120) - frame.Option2:ClearAllPoints() - frame.Option2:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) - end) - frame.Option3:SetFrameLevel(frame.Option1:GetFrameLevel() + 10) - frame.Option3:Hide() - - frame.Option4 = CreateFrame("Button", "SVUI_InstallOption4Button", frame, "UIPanelButtonTemplate") - frame.Option4:RemoveTextures() - frame.Option4:Size(110, 30) - frame.Option4:Point("LEFT", frame.Option3, "RIGHT", 4, 0) - frame.Option4:SetText("") - SetInstallButton(frame.Option4) - frame.Option4.texture = frame.Option4:CreateTexture(nil, "BORDER") - frame.Option4.texture:Size(110, 100) - frame.Option4.texture:Point("CENTER", frame.Option4, "BOTTOM", 0, -9) - frame.Option4.texture:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\OPTION") - frame.Option4.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) - frame.Option4:SetScript("OnEnter", function(this) - this.texture:SetVertexColor(0.5, 1, 0.4) - end) - frame.Option4:SetScript("OnLeave", function(this) - this.texture:SetGradient("VERTICAL", 0.3, 0.3, 0.3, 0.7, 0.7, 0.7) - end) - frame.Option4:SetScript("OnShow", function() - frame.Option1:Width(110) - frame.Option2:Width(110) - frame.Option1:ClearAllPoints() - frame.Option1:Point("RIGHT", frame.Option2, "LEFT", -4, 0) - frame.Option2:ClearAllPoints() - frame.Option2:Point("BOTTOMRIGHT", frame, "BOTTOM", -4, 15) - end) - frame.Option4:SetScript("OnHide", function() - frame.Option1:SetWidth(160) - frame.Option1:ClearAllPoints() - frame.Option1:Point("BOTTOM", 0, 15) - frame.Option2:SetWidth(120) - frame.Option2:ClearAllPoints() - frame.Option2:Point("BOTTOMLEFT", frame, "BOTTOM", 4, 15) - end) - - frame.Option4:SetFrameLevel(frame.Option1:GetFrameLevel() + 10) - frame.Option4:Hide() - - frame.SubTitle = frame:CreateFontString(nil, "OVERLAY") - frame.SubTitle:SetFont(SV.Media.font.roboto, 16, "OUTLINE") - frame.SubTitle:Point("TOP", 0, -40) - frame.Desc1 = frame:CreateFontString(nil, "OVERLAY") - frame.Desc1:SetFont(SV.Media.font.roboto, 14, "OUTLINE") - frame.Desc1:Point("TOPLEFT", 20, -75) - frame.Desc1:Width(frame:GetWidth()-40) - frame.Desc2 = frame:CreateFontString(nil, "OVERLAY") - frame.Desc2:SetFont(SV.Media.font.roboto, 14, "OUTLINE") - frame.Desc2:Point("TOPLEFT", 20, -125) - frame.Desc2:Width(frame:GetWidth()-40) - frame.Desc3 = frame:CreateFontString(nil, "OVERLAY") - frame.Desc3:SetFont(SV.Media.font.roboto, 14, "OUTLINE") - frame.Desc3:Point("TOPLEFT", 20, -175) - frame.Desc3:Width(frame:GetWidth()-40) - local closeButton = CreateFrame("Button", "SVUI_InstallCloseButton", frame, "UIPanelCloseButton") - closeButton:SetPoint("TOPRIGHT", frame, "TOPRIGHT") - closeButton:SetScript("OnClick", function()frame:Hide()end) - frame.tutorialImage = frame:CreateTexture("InstallTutorialImage", "OVERLAY") - frame.tutorialImage:Size(256, 128) - frame.tutorialImage:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\SPLASH") - frame.tutorialImage:Point("BOTTOM", 0, 70) - end - - SVUI_SetupHolder:SetScript("OnHide", function() - StopMusic() - SetCVar("Sound_MusicVolume", user_music_vol) - musicIsPlaying = nil - end) - - SVUI_SetupHolder:Show() - NextPage() - if(not autoLoaded) then - PlayThemeSong() - else - SV:ExecuteTimer(PlayThemeSong, 5) - end -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/load.lua b/Interface/AddOns/SVUI/system/load.lua index 89299d2..1e36a18 100644 --- a/Interface/AddOns/SVUI/system/load.lua +++ b/Interface/AddOns/SVUI/system/load.lua @@ -131,7 +131,7 @@ local function PrepareStorage() end function SV:Load() - self:ClearAllTimers() + self.Timers:ClearAllTimers() local rez = GetCVar("gxResolution"); local gxHeight = tonumber(match(rez,"%d+x(%d+)")); @@ -257,11 +257,11 @@ local SVUISystem_OnEvent = function(self, event, arg, ...) if(not SV.MediaInitialized) then SV:RefreshAllSystemMedia() end - local a,b = IsInInstance() - if(b == "pvp") then - SV.BGTimer = SV:ExecuteLoop(RequestBattlefieldScoreData, 5) + local _,instanceType = IsInInstance() + if(instanceType == "pvp") then + SV.BGTimer = SV.Timers:ExecuteLoop(RequestBattlefieldScoreData, 5) elseif(SV.BGTimer) then - SV:RemoveLoop(SV.BGTimer) + SV.Timers:RemoveLoop(SV.BGTimer) SV.BGTimer = nil end elseif(event == "SPELLS_CHANGED") then diff --git a/Interface/AddOns/SVUI/system/presets.lua b/Interface/AddOns/SVUI/system/presets.lua deleted file mode 100644 index ec59c2d..0000000 --- a/Interface/AddOns/SVUI/system/presets.lua +++ /dev/null @@ -1,1146 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; ---[[ -########################################################## -LOCALIZED GLOBALS -########################################################## -]]-- -local SVUI_CLASS_COLORS = _G.SVUI_CLASS_COLORS -local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV, L = unpack(select(2, ...)); -local scc = SVUI_CLASS_COLORS[SV.class]; -local rcc = RAID_CLASS_COLORS[SV.class]; -local r2 = .1 + (rcc.r * .1) -local g2 = .1 + (rcc.g * .1) -local b2 = .1 + (rcc.b * .1) ---[[ -########################################################## -LAYOUT PRESETS -########################################################## -]]-- -local presets = { - ["media"] = { - ["link"] = "media", - ["default"] = { - ["colors"] = { - ["special"] = {.37, .32, .29, 1}, - }, - ["textures"] = { - ["pattern"] = "SVUI Backdrop 1", - ["comic"] = "SVUI Comic 1", - ["unitlarge"] = "SVUI Unit BG 1", - ["unitsmall"] = "SVUI Small BG 1", - }, - ["unitframes"] = { - ["buff_bars"] = {.91, .91, .31, 1}, - ["health"] = {.1, .6, .02, 1}, - ["casting"] = {.91, .91, .31, 1}, - ["spark"] = {1, .72, 0, 1}, - }, - }, - ["kaboom"] = { - ["colors"] = { - ["special"] = {.28, .31, .32, 1}, - }, - ["textures"] = { - ["pattern"] = "SVUI Backdrop 2", - ["comic"] = "SVUI Comic 2", - ["unitlarge"] = "SVUI Unit BG 2", - ["unitsmall"] = "SVUI Small BG 2", - }, - ["unitframes"] = { - ["buff_bars"] = {.51, .79, 0, 1}, - ["health"] = {.16, .86, .22, 1}, - ["casting"] = {.91, .91, 0, 1}, - ["spark"] = {1, .72, 0, 1}, - }, - }, - ["classy"] = { - ["colors"] = { - ["special"] = {r2, g2, b2, 1}, - }, - ["textures"] = { - ["pattern"] = "SVUI Backdrop 3", - ["comic"] = "SVUI Comic 3", - ["unitlarge"] = "SVUI Unit BG 3", - ["unitsmall"] = "SVUI Small BG 3", - }, - ["unitframes"] = { - ["buff_bars"] = {scc.r, scc.g, scc.b, 1}, - ["health"] = {.16, .86, .22, 1}, - ["casting"] = {.91, .91, 0, 1}, - ["spark"] = {1, .72, 0, 1}, - }, - }, - ["dark"] = { - ["colors"] = { - ["special"] = {.25, .26, .27, 1}, - }, - ["textures"] = { - ["pattern"] = "SVUI Backdrop 4", - ["comic"] = "SVUI Comic 4", - ["unitlarge"] = "SVUI Unit BG 4", - ["unitsmall"] = "SVUI Small BG 4", - }, - ["unitframes"] = { - ["buff_bars"] = {.45, .55, .15, 1}, - ["health"] = {.06, .06, .06, 1}, - ["casting"] = {.8, .8, 0, 1}, - ["spark"] = {1, .72, 0, 1}, - }, - }, - }, - ["auras"] = { - ["link"] = "SVUnit", - ["default"] = { - ["player"] = { - ["buffs"] = { - enable = false, - attachTo = "DEBUFFS", - anchorPoint = 'TOPLEFT', - verticalGrowth = 'UP', - horizontalGrowth = 'RIGHT', - }, - ["debuffs"] = { - enable = false, - attachTo = "FRAME", - anchorPoint = 'TOPLEFT', - verticalGrowth = 'UP', - horizontalGrowth = 'RIGHT', - }, - ["aurabar"] = { - enable = false - } - }, - ["target"] = { - ["smartAuraDisplay"] = "DISABLED", - ["buffs"] = { - enable = true, - attachTo = "FRAME", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["debuffs"] = { - enable = true, - attachTo = "BUFFS", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["aurabar"] = { - enable = false - } - }, - ["focus"] = { - ["smartAuraDisplay"] = "DISABLED", - ["buffs"] = { - enable = false, - attachTo = "FRAME", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["debuffs"] = { - enable = true, - attachTo = "FRAME", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["aurabar"] = { - enable = false - } - } - }, - ["icons"] = { - ["player"] = { - ["buffs"] = { - enable = true, - attachTo = "FRAME", - anchorPoint = 'TOPLEFT', - verticalGrowth = 'UP', - horizontalGrowth = 'RIGHT', - }, - ["debuffs"] = { - enable = true, - attachTo = "BUFFS", - anchorPoint = 'TOPLEFT', - verticalGrowth = 'UP', - horizontalGrowth = 'RIGHT', - }, - ["aurabar"] = { - enable = false - } - }, - ["target"] = { - ["smartAuraDisplay"] = "DISABLED", - ["buffs"] = { - enable = true, - attachTo = "FRAME", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["debuffs"] = { - enable = true, - attachTo = "BUFFS", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["aurabar"] = { - enable = false - } - }, - ["focus"] = { - ["smartAuraDisplay"] = "DISABLED", - ["buffs"] = { - enable = false, - attachTo = "FRAME", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["debuffs"] = { - enable = true, - attachTo = "FRAME", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["aurabar"] = { - enable = false - } - } - }, - ["bars"] = { - ["player"] = { - ["buffs"] = { - enable = false, - attachTo = "FRAME" - }, - ["debuffs"] = { - enable = false, - attachTo = "FRAME" - }, - ["aurabar"] = { - enable = true, - attachTo = "FRAME" - } - }, - ["target"] = { - ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", - ["buffs"] = { - enable = false, - attachTo = "FRAME" - }, - ["debuffs"] = { - enable = false, - attachTo = "FRAME" - }, - ["aurabar"] = { - enable = true, - attachTo = "FRAME" - } - }, - ["focus"] = { - ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", - ["buffs"] = { - enable = false, - attachTo = "FRAME" - }, - ["debuffs"] = { - enable = false, - attachTo = "FRAME" - }, - ["aurabar"] = { - enable = true, - attachTo = "FRAME" - } - } - }, - ["theworks"] = { - ["player"] = { - ["buffs"] = { - enable = true, - attachTo = "FRAME", - anchorPoint = 'TOPLEFT', - verticalGrowth = 'UP', - horizontalGrowth = 'RIGHT', - }, - ["debuffs"] = { - enable = true, - attachTo = "BUFFS", - anchorPoint = 'TOPLEFT', - verticalGrowth = 'UP', - horizontalGrowth = 'RIGHT', - }, - ["aurabar"] = { - enable = true, - attachTo = "DEBUFFS" - } - }, - ["target"] = { - ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", - ["buffs"] = { - enable = true, - attachTo = "FRAME", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["debuffs"] = { - enable = true, - attachTo = "BUFFS", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["aurabar"] = { - enable = true, - attachTo = "DEBUFFS" - } - }, - ["focus"] = { - ["smartAuraDisplay"] = "SHOW_DEBUFFS_ON_FRIENDLIES", - ["buffs"] = { - enable = true, - attachTo = "FRAME", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["debuffs"] = { - enable = true, - attachTo = "BUFFS", - anchorPoint = 'TOPRIGHT', - verticalGrowth = 'UP', - horizontalGrowth = 'LEFT', - }, - ["aurabar"] = { - enable = true, - attachTo = "DEBUFFS" - } - } - }, - }, - ["bars"] = { - ["link"] = "SVBar", - ["default"] = { - ["Bar1"] = { - buttonsize = 32 - }, - ["Bar2"] = { - enable = false - }, - ["Bar3"] = { - buttons = 6, - buttonspacing = 2, - buttonsPerRow = 6, - buttonsize = 32 - }, - ["Bar5"] = { - buttons = 6, - buttonspacing = 2, - buttonsPerRow = 6, - buttonsize = 32 - } - }, - ["onebig"] = { - ["Bar1"] = { - buttonsize = 40 - }, - ["Bar2"] = { - enable = false - }, - ["Bar3"] = { - buttons = 6, - buttonspacing = 2, - buttonsPerRow = 6, - buttonsize = 40 - }, - ["Bar5"] = { - buttons = 6, - buttonspacing = 2, - buttonsPerRow = 6, - buttonsize = 40 - } - }, - ["twosmall"] = { - ["Bar1"] = { - buttonsize = 32 - }, - ["Bar2"] = { - enable = true, - buttonsize = 32 - }, - ["Bar3"] = { - buttons = 12, - buttonspacing = 2, - buttonsPerRow = 6, - buttonsize = 32 - }, - ["Bar5"] = { - buttons = 12, - buttonspacing = 2, - buttonsPerRow = 6, - buttonsize = 32 - } - }, - ["twobig"] = { - ["Bar1"] = { - buttonsize = 40 - }, - ["Bar2"] = { - enable = true, - buttonsize = 40 - }, - ["Bar3"] = { - buttons = 12, - buttonspacing = 2, - buttonsPerRow = 6, - buttonsize = 40 - }, - ["Bar5"] = { - buttons = 12, - buttonspacing = 2, - buttonsPerRow = 6, - buttonsize = 40 - } - }, - }, - ["units"] = { - ["link"] = "SVUnit", - ["default"] = { - ["player"] = { - width = 215, - height = 60, - portrait = { - enable = true, - overlay = true, - style = "3D", - } - }, - ["target"] = { - width = 215, - height = 60, - portrait = { - enable = true, - overlay = true, - style = "3D", - } - }, - ["pet"] = { - width = 130, - height = 30, - portrait = { - enable = true, - overlay = true, - style = "3D", - }, - name = { - position = "CENTER" - }, - }, - ["targettarget"] = { - width = 130, - height = 30, - portrait = { - enable = true, - overlay = true, - style = "3D", - }, - name = { - position = "CENTER" - }, - }, - ["boss"] = { - width = 200, - height = 45, - portrait = { - enable = true, - overlay = true, - style = "3D", - } - }, - ["party"] = { - width = 75, - height = 60, - wrapXOffset = 9, - wrapYOffset = 13, - portrait = { - enable = true, - overlay = true, - style = "3D", - }, - name = { - position = "INNERTOPLEFT" - }, - }, - ["raid10"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid25"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid40"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - }, - ["super"] = { - ["player"] = { - width = 215, - height = 60, - portrait = { - enable = true, - overlay = true, - style = "3D", - } - }, - ["target"] = { - width = 215, - height = 60, - portrait = { - enable = true, - overlay = true, - style = "3D", - } - }, - ["pet"] = { - width = 150, - height = 30, - portrait = { - enable = true, - overlay = true, - style = "3D", - }, - name = { - position = "CENTER" - }, - }, - ["targettarget"] = { - width = 150, - height = 30, - portrait = { - enable = true, - overlay = true, - style = "3D", - }, - name = { - position = "CENTER" - }, - }, - ["boss"] = { - width = 200, - height = 45, - portrait = { - enable = true, - overlay = true, - style = "3D", - } - }, - ["party"] = { - width = 75, - height = 60, - wrapXOffset = 9, - wrapYOffset = 13, - portrait = { - enable = true, - overlay = true, - style = "3D", - }, - name = { - position = "INNERTOPLEFT" - }, - }, - ["raid10"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid25"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid40"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - }, - ["simple"] = { - ["player"] = { - width = 215, - height = 60, - portrait = { - enable = true, - overlay = false, - style = "2D", - width = 60, - } - }, - ["target"] = { - width = 215, - height = 60, - portrait = { - enable = true, - overlay = false, - style = "2D", - width = 60, - } - }, - ["pet"] = { - width = 150, - height = 30, - portrait = { - enable = true, - overlay = false, - style = "2D", - width = 30, - }, - name = { - position = "INNERLEFT" - }, - }, - ["targettarget"] = { - width = 150, - height = 30, - portrait = { - enable = true, - overlay = false, - style = "2D", - width = 30, - }, - name = { - position = "INNERLEFT" - }, - }, - ["boss"] = { - width = 200, - height = 45, - portrait = { - enable = true, - overlay = false, - style = "2D", - width = 45, - } - }, - ["party"] = { - width = 100, - height = 35, - wrapXOffset = 9, - wrapYOffset = 13, - portrait = { - enable = true, - overlay = false, - style = "2D", - width = 35, - }, - name = { - position = "INNERRIGHT" - }, - }, - ["raid10"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid25"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid40"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - }, - ["compact"] = { - ["player"] = { - width = 215, - height = 50, - portrait = { - enable = false - } - }, - ["target"] = { - width = 215, - height = 50, - portrait = { - enable = false - } - }, - ["pet"] = { - width = 130, - height = 30, - portrait = { - enable = false - }, - name = { - position = "CENTER" - }, - }, - ["targettarget"] = { - width = 130, - height = 30, - portrait = { - enable = false - }, - name = { - position = "CENTER" - }, - }, - ["boss"] = { - width = 200, - height = 45, - portrait = { - enable = false - } - }, - ["party"] = { - width = 70, - height = 30, - wrapXOffset = 9, - wrapYOffset = 13, - portrait = { - enable = false - }, - name = { - position = "INNERTOPLEFT" - }, - }, - ["raid10"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid25"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - ["raid40"] = { - width = 50, - height = 30, - wrapXOffset = 6, - wrapYOffset = 6, - }, - }, - }, - ["layouts"] = { - ["link"] = "SVUnit", - ["default"] = { - ["grid"] = { - ["enable"] = false, - }, - ["party"] = { - width = 75, - height = 60, - wrapXOffset = 9, - wrapYOffset = 13, - portrait = { - enable = true, - overlay = true, - style = "3D", - }, - icons = { - roleIcon = { - ["attachTo"] = "INNERBOTTOMRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - }, - name = { - ["font"] = "SVUI Default Font", - ["fontOutline"] = "OUTLINE", - ["position"] = "INNERTOPLEFT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - }, - ["raid10"] = { - width = 50, - height = 30, - gRowCol = 1, - wrapXOffset = 9, - wrapYOffset = 13, - showBy = "RIGHT_DOWN", - ["power"] = { - ["enable"] = false, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 1, - }, - }, - ["name"] = { - ["font"] = "SVUI Default Font", - ["position"] = "INNERTOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - ["raid25"] = { - width = 50, - height = 30, - gRowCol = 1, - wrapXOffset = 9, - wrapYOffset = 13, - showBy = "RIGHT_DOWN", - ["power"] = { - ["enable"] = false, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 1, - }, - }, - ["name"] = { - ["font"] = "SVUI Default Font", - ["position"] = "INNERTOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - ["raid40"] = { - width = 50, - height = 30, - gRowCol = 1, - wrapXOffset = 9, - wrapYOffset = 13, - showBy = "RIGHT_DOWN", - ["power"] = { - ["enable"] = false, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 1, - }, - }, - ["name"] = { - ["font"] = "SVUI Default Font", - ["position"] = "INNERTOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - }, - ["healer"] = { - ["grid"] = { - ["enable"] = false, - }, - ["party"] = { - width = 75, - height = 60, - wrapXOffset = 9, - wrapYOffset = 13, - portrait = { - enable = true, - overlay = true, - style = "3D", - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERBOTTOMRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - }, - ["name"] = { - ["font"] = "SVUI Default Font", - ["fontOutline"] = "OUTLINE", - ["position"] = "INNERTOPLEFT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - }, - ["raid10"] = { - width = 50, - height = 30, - ["showBy"] = "DOWN_RIGHT", - ["gRowCol"] = 1, - ["wrapXOffset"] = 4, - ["wrapYOffset"] = 4, - ["power"] = { - ["enable"] = true, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - ["name"] = { - ["font"] = "SVUI Default Font", - ["position"] = "INNERTOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - ["raid25"] = { - width = 50, - height = 30, - ["showBy"] = "DOWN_RIGHT", - ["gRowCol"] = 1, - ["wrapXOffset"] = 4, - ["wrapYOffset"] = 4, - ["power"] = { - ["enable"] = true, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - ["name"] = { - ["font"] = "SVUI Default Font", - ["position"] = "INNERTOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - ["raid40"] = { - width = 50, - height = 30, - ["showBy"] = "DOWN_RIGHT", - ["gRowCol"] = 1, - ["wrapXOffset"] = 4, - ["wrapYOffset"] = 4, - ["power"] = { - ["enable"] = true, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - ["name"] = { - ["font"] = "SVUI Default Font", - ["position"] = "INNERTOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - }, - }, - ["dps"] = { - ["grid"] = { - ["enable"] = false, - }, - ["party"] = { - width = 115, - height = 25, - wrapXOffset = 9, - wrapYOffset = 13, - ["power"] = { - ["enable"] = false, - }, - portrait = { - enable = false, - overlay = false, - style = "2D", - width = 35, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "LEFT", - ["xOffset"] = -2, - ["yOffset"] = 0, - }, - }, - ["name"] = { - ["font"] = "Roboto", - ["fontOutline"] = "NONE", - ["position"] = "CENTER", - ["xOffset"] = 0, - ["yOffset"] = 1, - }, - }, - ["raid10"] = { - ["showBy"] = "UP_RIGHT", - ["gRowCol"] = 2, - ["wrapXOffset"] = 4, - ["wrapYOffset"] = 4, - ["power"] = { - ["enable"] = false, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERLEFT", - ["xOffset"] = 10, - ["yOffset"] = 1, - }, - }, - ["name"] = { - ["font"] = "Roboto", - ["position"] = "CENTER", - ["xOffset"] = 0, - ["yOffset"] = 1, - }, - ["width"] = 80, - ["height"] = 20, - }, - ["raid25"] = { - ["showBy"] = "UP_RIGHT", - ["gRowCol"] = 3, - ["wrapXOffset"] = 4, - ["wrapYOffset"] = 4, - ["power"] = { - ["enable"] = false, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERLEFT", - ["xOffset"] = 10, - ["yOffset"] = 1, - }, - }, - ["name"] = { - ["font"] = "Roboto", - ["position"] = "CENTER", - ["xOffset"] = 0, - ["yOffset"] = 1, - }, - ["width"] = 80, - ["height"] = 20, - }, - ["raid40"] = { - ["showBy"] = "UP_RIGHT", - ["gRowCol"] = 4, - ["wrapXOffset"] = 4, - ["wrapYOffset"] = 4, - ["power"] = { - ["enable"] = false, - }, - ["icons"] = { - ["roleIcon"] = { - ["attachTo"] = "INNERLEFT", - ["xOffset"] = 10, - ["yOffset"] = 1, - }, - }, - ["name"] = { - ["font"] = "Roboto", - ["position"] = "CENTER", - ["xOffset"] = 0, - ["yOffset"] = 1, - }, - ["width"] = 80, - ["height"] = 20, - }, - }, - ["grid"] = { - ["grid"] = { - ["enable"] = true, - ["size"] = 34, - ["shownames"] = true, - }, - ["party"] = { - ["gridAllowed"] = true, - ["wrapXOffset"] = 1, - ["wrapYOffset"] = 1, - }, - ["raid10"] = { - ["gridAllowed"] = true, - ["wrapXOffset"] = 1, - ["wrapYOffset"] = 1, - ["gRowCol"] = 1, - ["showBy"] = "RIGHT_DOWN", - }, - ["raid25"] = { - ["gridAllowed"] = true, - ["wrapXOffset"] = 1, - ["wrapYOffset"] = 1, - ["gRowCol"] = 1, - ["showBy"] = "RIGHT_DOWN", - }, - ["raid40"] = { - ["gridAllowed"] = true, - ["wrapXOffset"] = 1, - ["wrapYOffset"] = 1, - ["gRowCol"] = 1, - ["showBy"] = "RIGHT_DOWN", - }, - }, - } -}; - -local function CopyLayout(saved, preset) - if(type(preset) == 'table') then - for key,val in pairs(preset) do - if(not saved[key]) then saved[key] = {} end - if(type(val) == "table") then - CopyLayout(saved[key], val) - elseif(saved[key]) then - saved[key] = val - end - end - else - saved = preset - end -end - -function SV:LoadPresetData(category, theme) - if(presets[category] and presets[category]["link"]) then - theme = theme or "default" - local saved = presets[category]["link"] - local preset = presets[category][theme] - CopyLayout(SV.db[saved], preset) - end -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/registry.lua b/Interface/AddOns/SVUI/system/registry.lua deleted file mode 100644 index d0a3ca4..0000000 --- a/Interface/AddOns/SVUI/system/registry.lua +++ /dev/null @@ -1,569 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -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 type = _G.type; -local rawset = _G.rawset; -local rawget = _G.rawget; -local tinsert = _G.tinsert; -local tremove = _G.tremove; -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; ---[[ STRING METHODS ]]-- -local upper = string.upper; -local format, find, match, gsub = string.format, string.find, string.match, string.gsub; ---[[ MATH METHODS ]]-- -local floor = math.floor ---[[ TABLE METHODS ]]-- -local twipe, tsort, tconcat = table.wipe, table.sort, table.concat; ---[[ -############################################################ - /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$ /$$$$$$ -| $$ /$$__ $$ /$$__ $$ /$$__ $$| $$ /$$__ $$ -| $$ | $$ \ $$| $$ \__/| $$ \ $$| $$ | $$ \__/ -| $$ | $$ | $$| $$ | $$$$$$$$| $$ | $$$$$$ -| $$ | $$ | $$| $$ | $$__ $$| $$ \____ $$ -| $$ | $$ | $$| $$ $$| $$ | $$| $$ /$$ \ $$ -| $$$$$$$$| $$$$$$/| $$$$$$/| $$ | $$| $$$$$$$$| $$$$$$/ -|________/ \______/ \______/ |__/ |__/|________/ \______/ -############################################################ -]]-- -local PLUGIN_LISTING = ""; -local ModuleQueue, ScriptQueue = {},{}; - -local INFO_BY = "%s |cff0099FFby %s|r"; -local INFO_VERSION = "%s%s |cff33FF00Version: %s|r"; -local INFO_NAME = "Plugins"; -local INFO_HEADER = "Supervillain UI (version %.3f): Plugins"; - -if GetLocale() == "ruRU" then - INFO_BY = "%s |cff0099FFот %s|r"; - INFO_VERSION = "%s%s |cff33FF00Версия: %s|r"; - INFO_NAME = "Плагины"; - INFO_HEADER = "Supervillain UI (устарела %.3f): Плагины"; -end - ---[[ APPENDED OPTIONS TABLE ]]-- -SVUI[1].Options.args.plugins = { - order = -2, - type = "group", - name = "Plugins", - childGroups = "tab", - args = { - pluginheader = { - order = 1, - type = "header", - name = "Supervillain Plugins", - }, - pluginOptions = { - order = 2, - type = "group", - name = "", - args = { - pluginlist = { - order = 1, - type = "group", - name = "Summary", - args = { - active = { - order = 1, - type = "description", - name = function() return PLUGIN_LISTING end - } - } - }, - } - } - } -} ---[[ -############################################################################### - /$$$$$$$ /$$$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$$/$$$$$$$ /$$ /$$ -| $$__ $$| $$_____/ /$$__ $$|_ $$_/ /$$__ $$|__ $$__/ $$__ $$| $$ /$$/ -| $$ \ $$| $$ | $$ \__/ | $$ | $$ \__/ | $$ | $$ \ $$ \ $$ /$$/ -| $$$$$$$/| $$$$$ | $$ /$$$$ | $$ | $$$$$$ | $$ | $$$$$$$/ \ $$$$/ -| $$__ $$| $$__/ | $$|_ $$ | $$ \____ $$ | $$ | $$__ $$ \ $$/ -| $$ \ $$| $$ | $$ \ $$ | $$ /$$ \ $$ | $$ | $$ \ $$ | $$ -| $$ | $$| $$$$$$$$| $$$$$$/ /$$$$$$| $$$$$$/ | $$ | $$ | $$ | $$ -|__/ |__/|________/ \______/ |______/ \______/ |__/ |__/ |__/ |__/ -############################################################################### -]]-- -local rootstring = function(self) return self.___addonName end - -local changeDBVar = function(self, value, key, sub1, sub2, sub3) - local core = self.___core - local schema = self.___schema - local config = core.db[schema] - - if((sub1 and sub2 and sub3) and (config[sub1] and config[sub1][sub2] and config[sub1][sub2][sub3])) then - core.db[schema][sub1][sub2][sub3][key] = value - elseif((sub1 and sub2) and (config[sub1] and config[sub1][sub2])) then - core.db[schema][sub1][sub2][key] = value - elseif(sub1 and config[sub1]) then - core.db[schema][sub1][key] = value - else - core.db[schema][key] = value - end - - self.db = core.db[schema] - - if(self.UpdateLocals) then - self:UpdateLocals() - end -end - -local innerOnEvent = function(self, event, ...) - local obj = self.module - if self[event] and type(self[event]) == "function" then - self[event](obj, event, ...) - end -end - -local registerEvent = function(self, eventname, eventfunc) - if not self.___eventframe then - self.___eventframe = CreateFrame("Frame", nil) - self.___eventframe.module = self - self.___eventframe:SetScript("OnEvent", innerOnEvent) - end - - if(not self.___eventframe[eventname]) then - local fn = eventfunc - if type(eventfunc) == "string" then - fn = self[eventfunc] - 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 core = obj.___core - local callbacks = self.callbacks - - for name, fn in pairs(callbacks) do - local _, error = pcall(fn, obj) - if(error and core.Debugging) then - print(error) - end - end - - self.elapsed = 0 - else - self.elapsed = (self.elapsed or 0) + elapsed - end -end - -local registerUpdate = function(self, updatefunc, throttle) - if not self.___updateframe then - self.___updateframe = CreateFrame("Frame", nil); - self.___updateframe.module = self; - self.___updateframe.callbacks = {}; - self.___updateframe.elapsed = 0; - self.___updateframe.throttle = throttle or 0.2; - end - - if(updatefunc and type(updatefunc) == "string" and self[updatefunc]) then - self.___updateframe.callbacks[updatefunc] = self[updatefunc] - end - - self.___updateframe:SetScript("OnUpdate", innerOnUpdate) -end - -local unregisterUpdate = function(self, updatefunc) - if(updatefunc and type(updatefunc) == "string" and self.___updateframe.callbacks[updatefunc]) then - self.___updateframe.callbacks[updatefunc] = nil - if(#self.___updateframe.callbacks == 0) then - self.___updateframe:SetScript("OnUpdate", nil) - end - else - self.___updateframe:SetScript("OnUpdate", nil) - end -end - -local add_OptionsIndex = function(self, index, data) - local addonName = self.___addonName - local schema = self.___schema - local core = self.___core - local header = GetAddOnMetadata(addonName, "X-SVUI-Header") - - core.Options.args.plugins.args.pluginOptions.args[schema].args[index] = data -end - -local function SetPluginString(addonName) - local pluginString = PLUGIN_LISTING or "" - local author = GetAddOnMetadata(addonName, "Author") or "Unknown" - local Pname = GetAddOnMetadata(addonName, "Title") or addonName - local version = GetAddOnMetadata(addonName, "Version") or "???" - pluginString = INFO_BY:format(pluginString, author) - pluginString = ("%s%s"):format(pluginString, Pname) - pluginString = INFO_VERSION:format(pluginString, "|cff00FF00", version) - pluginString = ("%s|r\n"):format(pluginString) - - PLUGIN_LISTING = pluginString -end - -local function SetInternalModule(obj, core, schema) - local addonmeta = {} - local oldmeta = getmetatable(obj) - if oldmeta then - for k, v in pairs(oldmeta) do addonmeta[k] = v end - end - addonmeta.__tostring = rootstring - setmetatable( obj, addonmeta ) - - local addonName = ("SVUI [%s]"):format(schema) - - obj.___addonName = addonName - obj.___schema = schema - obj.___core = core - - obj.initialized = false - obj.CombatLocked = false - obj.ChangeDBVar = changeDBVar - obj.RegisterEvent = registerEvent - obj.UnregisterEvent = unregisterEvent - obj.RegisterUpdate = registerUpdate - obj.UnregisterUpdate = unregisterUpdate - - return obj -end - -local function SetExternalModule(obj, core, schema, addonName, header, lod) - local addonmeta = {} - local oldmeta = getmetatable(obj) - if oldmeta then - for k, v in pairs(oldmeta) do addonmeta[k] = v end - end - addonmeta.__tostring = rootstring - setmetatable( obj, addonmeta ) - - obj.___addonName = addonName - obj.___schema = schema - obj.___header = header - obj.___core = core - obj.___lod = lod - - obj.initialized = false - obj.CombatLocked = false - obj.ChangeDBVar = changeDBVar - obj.RegisterEvent = registerEvent - obj.UnregisterEvent = unregisterEvent - obj.RegisterUpdate = registerUpdate - obj.UnregisterUpdate = unregisterUpdate - obj.AddOption = add_OptionsIndex - - if(lod) then - -- print("PLUGIN: " .. addonName) - core.Options.args.plugins.args.pluginOptions.args[schema] = { - type = "group", - name = header, - childGroups = "tree", - args = { - enable = { - order = 1, - type = "execute", - width = "full", - name = function() - local nameString = "Disable" - if(not IsAddOnLoaded(addonName)) then - nameString = "Enable" - end - return nameString - end, - func = function() - if(not IsAddOnLoaded(addonName)) then - local loaded, reason = LoadAddOn(addonName) - core:UpdateDatabase() - obj:ChangeDBVar(true, "enable") - else - obj:ChangeDBVar(false, "enable") - core:StaticPopup_Show("RL_CLIENT") - end - end, - } - } - } - else - core.Options.args.plugins.args.pluginOptions.args[schema] = { - type = "group", - name = header, - childGroups = "tree", - args = { - enable = { - order = 1, - type = "toggle", - name = "Enable", - get = function() return obj.db.enable end, - set = function(key, value) obj:ChangeDBVar(value, "enable") end, - } - } - } - end - - return obj -end - -local Registry_NewCallback = function(self, fn) - if(fn and type(fn) == "function") then - self.Callbacks[#self.Callbacks+1] = fn - end -end - -local Registry_NewScript = function(self, fn) - if(fn and type(fn) == "function") then - ScriptQueue[#ScriptQueue+1] = fn - end -end - -local Registry_NewPackage = function(self, obj, schema) - local core = self.___core - if(core[schema]) then return end - - ModuleQueue[#ModuleQueue+1] = schema - self.Modules[#self.Modules+1] = schema - - core[schema] = SetInternalModule(obj, core, schema) - - if(core.AddonLaunched) then - if(core[schema].Load) then - core[schema]:Load() - end - end -end - -local Registry_NewPlugin = function(self, obj) - local core = self.___core - local coreName = core.___addonName - local addonName = obj.___addonName - - if(addonName and addonName ~= coreName) then - local schema = GetAddOnMetadata(addonName, "X-SVUI-Schema"); - local header = GetAddOnMetadata(addonName, "X-SVUI-Header"); - local lod = IsAddOnLoadOnDemand(addonName) - if(not schema) then return end - - ModuleQueue[#ModuleQueue+1] = schema - self.Modules[#self.Modules+1] = schema - - SetPluginString(addonName) - - core[schema] = SetExternalModule(obj, core, schema, addonName, header, lod) - - if(core.AddonLaunched and core[schema].Load) then - core[schema]:Load() - --print(schema) - end - end -end - -local Registry_NewAddon = function(self, addonName, schema, header) - local core = self.___core - self.Addons[addonName] = schema; - - core.Options.args.plugins.args.pluginOptions.args[schema] = { - type = "group", - name = header, - childGroups = "tree", - args = { - enable = { - order = 1, - type = "execute", - width = "full", - name = function() - local nameString = "Disable" - if(not IsAddOnLoaded(addonName)) then - nameString = "Enable" - end - return nameString - end, - func = function() - if(not IsAddOnLoaded(addonName)) then - local loaded, reason = LoadAddOn(addonName) - core:UpdateDatabase() - core.db[schema].enable = true - self:LoadPackages() - else - core.db[schema].enable = false - core:StaticPopup_Show("RL_CLIENT") - end - end, - } - } - } -end - -local Registry_FetchAddons = function(self) - local addonCount = GetNumAddOns() - local core = self.___core - - for i = 1, addonCount do - local addonName, _, _, _, _, reason = GetAddOnInfo(i) - local lod = IsAddOnLoadOnDemand(i) - local header = GetAddOnMetadata(i, "X-SVUI-Header") - local schema = GetAddOnMetadata(i, "X-SVUI-Schema") - - if(lod and schema) then - self:NewAddon(addonName, schema, header) - end - end -end - -local Registry_RunCallbacks = function(self) - local callbacks = self.Callbacks - for i=1, #callbacks do - local fn = callbacks[i] - if(fn and type(fn) == "function") then - fn() - end - end -end - -local Registry_Update = function(self, name, dataOnly) - local core = self.___core - local obj = core[name] - if obj then - if core.db[name] then - obj.db = core.db[name] - end - if obj.ReLoad and not dataOnly then - obj:ReLoad() - end - end -end - -local Registry_UpdateAll = function(self) - local modules = self.Modules - local core = self.___core - for _,name in pairs(modules) do - local obj = core[name] - - if core.db[name] then - obj.db = core.db[name] - end - - if obj and obj.ReLoad then - obj:ReLoad() - end - end -end - -local Registry_LoadOnDemand = function(self) - local core = self.___core - local addons = self.Addons - for name,schema in pairs(addons) do - local config = core.db[schema] - if(config and (config.enable or config.enable ~= false)) then - if(not IsAddOnLoaded(name)) then - local loaded, reason = LoadAddOn(name) - end - EnableAddOn(name) - end - end -end - -local Registry_Load = function(self) - if not ModuleQueue then return end - local core = self.___core - - for i=1,#ModuleQueue do - local name = ModuleQueue[i] - local obj = core[name] - if obj and not obj.initialized then - if core.db[name] then - obj.db = core.db[name] - end - - if obj.Load then - local halt = false - if(obj.db.incompatible) then - for addon,_ in pairs(obj.db.incompatible) do - if IsAddOnLoaded(addon) then halt = true end - end - end - 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 - -local Registry = { - ___core = SVUI[1], - Modules = {}, - Addons = {}, - Callbacks = {}, - INFO_VERSION = INFO_VERSION, - INFO_NEW = INFO_NEW, - INFO_NAME = INFO_NAME, - INFO_HEADER = INFO_HEADER, - NewCallback = Registry_NewCallback, - NewScript = Registry_NewScript, - NewPackage = Registry_NewPackage, - NewPlugin = Registry_NewPlugin, - NewAddon = Registry_NewAddon, - FindAddons = Registry_FetchAddons, - LoadRegisteredAddons = Registry_LoadOnDemand, - RunCallbacks = Registry_RunCallbacks, - Update = Registry_Update, - UpdateAll = Registry_UpdateAll, - LoadPackages = Registry_Load, -} - ---[[ ENSURE META METHODS ]]-- - -local mt = {} -local old = getmetatable(Registry) -if old then - for k, v in pairs(old) do mt[k] = v end -end -mt.__tostring = rootstring -setmetatable(Registry, mt) - -SVUI[3] = Registry \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/timers.lua b/Interface/AddOns/SVUI/system/timers.lua index 042f170..7d164c2 100644 --- a/Interface/AddOns/SVUI/system/timers.lua +++ b/Interface/AddOns/SVUI/system/timers.lua @@ -45,81 +45,82 @@ LOCAL VARS local TIMERFONT = [[Interface\AddOns\SVUI\assets\fonts\Numbers.ttf]]; --[[ ########################################################## -GLOBAL TIMEOUT QUEUE +TIMERS ########################################################## ExecuteTimer: Create a timer that runs once and CANNOT be stopped ExecuteLoop: Create a timer that loops continuously and CAN be removed ]]-- -SV.TimerCount = 0; -local ExeTimerQueue = {}; -local ExeTimerManager = CreateFrame("Frame"); +local Timers = CreateFrame("Frame"); +Timers.TimerCount = 0; +Timers.Queue = {}; local ExeTimerManager_OnUpdate = function(self, elapsed) - if(SV.TimerCount > 0) then - for id,_ in pairs(ExeTimerQueue) do - local callback = ExeTimerQueue[id] + if(self.TimerCount > 0) then + for id,_ in pairs(self.Queue) do + local callback = self.Queue[id] if(callback.f) then if callback.t > elapsed then local newTime = callback.t - elapsed - ExeTimerQueue[id].t = newTime + self.Queue[id].t = newTime else callback.f() if(callback.x) then - ExeTimerQueue[id].t = callback.x + self.Queue[id].t = callback.x else - ExeTimerQueue[id] = nil - SV.TimerCount = SV.TimerCount - 1; + self.Queue[id] = nil + self.TimerCount = self.TimerCount - 1; end end end end end end -ExeTimerManager:SetScript("OnUpdate", ExeTimerManager_OnUpdate) -function SV:ExecuteTimer(timeOutFunction, duration, idCheck) +function Timers:ExecuteTimer(timeOutFunction, duration, idCheck) if(type(duration) == "number" and type(timeOutFunction) == "function") then - if(idCheck and ExeTimerQueue[idCheck]) then - ExeTimerQueue[idCheck].t = duration + if(idCheck and self.Queue[idCheck]) then + self.Queue[idCheck].t = duration return idCheck else self.TimerCount = self.TimerCount + 1 local id = "LOOP" .. self.TimerCount; - ExeTimerQueue[id] = {t = duration, f = timeOutFunction} + self.Queue[id] = {t = duration, f = timeOutFunction} return id end end return false end -function SV:ExecuteLoop(timeOutFunction, duration, idCheck) +function Timers:ExecuteLoop(timeOutFunction, duration, idCheck) if(type(duration) == "number" and type(timeOutFunction) == "function") then - if(idCheck and ExeTimerQueue[idCheck]) then - ExeTimerQueue[idCheck].x = duration - ExeTimerQueue[idCheck].t = duration + if(idCheck and self.Queue[idCheck]) then + self.Queue[idCheck].x = duration + self.Queue[idCheck].t = duration return idCheck else self.TimerCount = self.TimerCount + 1 local id = "LOOP" .. self.TimerCount; - ExeTimerQueue[id] = {x = duration, t = duration, f = timeOutFunction} + self.Queue[id] = {x = duration, t = duration, f = timeOutFunction} return id end end return false end -function SV:RemoveLoop(id) - if(ExeTimerQueue[id]) then - ExeTimerQueue[id] = nil +function Timers:RemoveLoop(id) + if(self.Queue[id]) then + self.Queue[id] = nil self.TimerCount = self.TimerCount - 1; end end -function SV:ClearAllTimers() - ExeTimerManager:SetScript("OnUpdate", nil) - ExeTimerQueue = {} - ExeTimerManager:SetScript("OnUpdate", ExeTimerManager_OnUpdate) +function Timers:ClearAllTimers() + self:SetScript("OnUpdate", nil) + self.Queue = {} + self:SetScript("OnUpdate", ExeTimerManager_OnUpdate) end + +Timers:SetScript("OnUpdate", ExeTimerManager_OnUpdate) --[[ ########################################################## TIMER FUNCTIONS @@ -246,7 +247,10 @@ local Cooldown_OnLoad = function(self, start, duration, elapsed) end end -function SV:AddCD(cooldown) - if not SV.db.system.cooldown then return end - hooksecurefunc(cooldown, "SetCooldown", Cooldown_OnLoad) -end \ No newline at end of file +function Timers:AddCooldown(origin) + if(origin.HookedCooldown or not SV.db.system.cooldown) then return end + hooksecurefunc(origin, "SetCooldown", Cooldown_OnLoad) + origin.HookedCooldown = true +end + +SV.Timers = Timers; \ No newline at end of file diff --git a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua index 993c34d..691e25d 100644 --- a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua +++ b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua @@ -71,6 +71,9 @@ local PhoneLines = {}; local ResponseQueue = {}; local ICON_FILE = [[Interface\AddOns\SVUI_AnsweringService\artwork\DOCK-CALL]] +local DEFAULT_GRADIENT = {"VERTICAL", 0.08, 0.08, 0.08, 0.22, 0.22, 0.22} +local GREEN_GRADIENT = {"VERTICAL", 0.08, 0.5, 0, 0.25, 0.9, 0.08} +local YELLOW_GRADIENT = {"VERTICAL", 1, 0.3, 0, 1, 1, 0} --[[ ########################################################## DIALOG TABLES @@ -722,7 +725,7 @@ function PLUGIN:AddCaller(caller) PhoneLines[caller].InUse = true; btn:SetPanelColor("green"); self.Docklet:SetPanelColor("green"); - self.Docklet.stateColor = SV.Media.gradient.green + self.Docklet.stateColor = GREEN_GRADIENT state_text = "on the line."; PlaySoundFile("Sound\\interface\\iQuestUpdate.wav") end @@ -753,16 +756,16 @@ function PLUGIN:GetServiceState() if inUse then if onHold then self.Docklet:SetPanelColor("yellow") - self.Docklet.icon:SetGradient(unpack(SV.Media.gradient.yellow)) - self.Docklet.stateColor = SV.Media.gradient.yellow + self.Docklet.icon:SetGradient(unpack(YELLOW_GRADIENT)) + self.Docklet.stateColor = YELLOW_GRADIENT else self.Docklet:SetPanelColor("green") - self.Docklet.icon:SetGradient(unpack(SV.Media.gradient.green)) - self.Docklet.stateColor = SV.Media.gradient.green + self.Docklet.icon:SetGradient(unpack(GREEN_GRADIENT)) + self.Docklet.stateColor = GREEN_GRADIENT end else self.Docklet:SetPanelColor("default") - self.Docklet.stateColor = SV.Media.gradient.default + self.Docklet.stateColor = DEFAULT_GRADIENT end return inUse,onHold end @@ -891,7 +894,7 @@ function PLUGIN:Load() local buttonsize = SuperDockToolBarLeft.currentSize - local docklet = CreateFrame("Button", nil, SV.UIParent) + local docklet = CreateFrame("Button", nil, UIParent) docklet:SetParent(SuperDockToolBarLeft) docklet:Point("LEFT", SuperDockToolBarLeft, "LEFT", 3, 0) docklet:Size(buttonsize, buttonsize) @@ -899,7 +902,7 @@ function PLUGIN:Load() docklet.icon = docklet:CreateTexture(nil, "OVERLAY") docklet.icon:FillInner(docklet,2,2) docklet.icon:SetTexture(ICON_FILE) - docklet.stateColor = SV.Media.gradient.special + docklet.stateColor = {"VERTICAL", 0.33, 0.25, 0.13, 0.47, 0.39, 0.27} docklet.TText = L["Show / Hide Phone Lines"] docklet:RegisterForClicks("AnyUp") @@ -909,7 +912,7 @@ function PLUGIN:Load() self.Docklet = docklet - local window = CreateFrame("Frame", nil, SV.UIParent) + local window = CreateFrame("Frame", nil, UIParent) window:SetFrameStrata("MEDIUM") window:SetWidth(128) window:SetHeight(145) diff --git a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua index 13a5d47..59084a7 100644 --- a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua +++ b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua @@ -223,6 +223,40 @@ local PVP_NODES = { }, } +-- local PVP_POI = { +-- [401] = { --Alterac Valley (15) +-- "Stormpike Aid Station", "Dun Baldar North Bunker", "Dun Baldar South Bunker", +-- "Stormpike Graveyard", "Icewing Bunker", "Stonehearth Graveyard", +-- "Stonehearth Bunker", "Snowfall Graveyard", "Iceblood Tower", +-- "Iceblood Graveyard", "Tower Point", "Frostwolf Graveyard", +-- "West Frostwolf Tower", "East Frostwolf Tower", "Frostwolf Relief Hut" +-- }, +-- [935] = { --Deepwind Gorge (2) +-- "Horde Cart", "Alliance Cart" +-- }, +-- [482] = { --Eye of the Storm (1) +-- "Flag" +-- }, +-- [860] = { --Silvershard Mines (1) +-- "Cart" +-- }, +-- [512] = { --Strand of the Ancients (5) +-- "Green Emerald", "Blue Sapphire", "Purple Amethyst", "Red Sun", "Yellow Moon" +-- }, +-- [540] = { --Isle of Conquest (5) +-- "Quarry", "Hangar", "Workshop", "Docks", "Refinery" +-- }, +-- [856] = { --Temple of Kotmogu (4) +-- "Red Orb", "Blue Orb", "Orange Orb", "Purple Orb" +-- }, +-- [626] = { --Twin Peaks (2) +-- "Horde Flag", "Alliance Flag" +-- }, +-- [443] = { --Warsong Gulch (2) +-- "Horde Flag", "Alliance Flag" +-- }, +-- } + local Safe_OnEnter = function(self) if InCombatLockdown() then return end local zone = self.name @@ -505,7 +539,7 @@ end function PLUGIN:UpdateZoneStatus() local zoneText = GetRealZoneText() or GetZoneText() if(not zoneText or zoneText == "") then - SV:ExecuteTimer(PLUGIN.UpdateZoneStatus, 5) + SV.Timers:ExecuteTimer(PLUGIN.UpdateZoneStatus, 5) return end if(zoneText ~= ACTIVE_ZONE) then @@ -1124,9 +1158,6 @@ function PLUGIN:Load() --SVUI_Target.Health.LowAlertFunc = LowHealth_TargetEmote end --- /tar Sinnisterr --- /tar Munglunch - CONFIGS[SCHEMA] = { ["enable"] = true } diff --git a/Interface/AddOns/SVUI_Laborer/modes/farming.lua b/Interface/AddOns/SVUI_Laborer/modes/farming.lua index 735fd4b..734bdc3 100644 --- a/Interface/AddOns/SVUI_Laborer/modes/farming.lua +++ b/Interface/AddOns/SVUI_Laborer/modes/farming.lua @@ -288,7 +288,7 @@ do end if InCombatLockdown() or itemError then MOD.TitleWindow:AddMessage("|cffffff11Loading Farm Tools...|r|cffff1111PLEASE WAIT|r") - SV:ExecuteTimer(LoadFarmingModeTools, 5) + SV.Timers:ExecuteTimer(LoadFarmingModeTools, 5) else local horizontal = MOD.db.farming.toolbardirection == 'HORIZONTAL' @@ -335,7 +335,7 @@ do end MOD.Farming.Loaded = true - SV:ExecuteTimer(MOD.Farming.Enable, 1.5) + SV.Timers:ExecuteTimer(MOD.Farming.Enable, 1.5) end end end diff --git a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua index d87bed5..c1bf7e6 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua @@ -419,8 +419,8 @@ function PLUGIN:Load() order = 2, type = "toggle", name = "Standard UI Styling", - get = function(a)return SV.db.SVStyle.blizzard.enable end, - set = function(a,b) SV.db.SVStyle.blizzard.enable = b; SV:StaticPopup_Show("RL_CLIENT") end + get = function(a)return SV.db[SCHEMA].blizzard.enable end, + set = function(a,b) SV.db[SCHEMA].blizzard.enable = b; SV:StaticPopup_Show("RL_CLIENT") end } self:AddOption("blizzardEnable", option) @@ -428,8 +428,8 @@ function PLUGIN:Load() order = 3, type = "toggle", name = "Addon Styling", - get = function(a)return SV.db.SVStyle.addons.enable end, - set = function(a,b) SV.db.SVStyle.addons.enable = b; SV:StaticPopup_Show("RL_CLIENT") end + get = function(a)return SV.db[SCHEMA].addons.enable end, + set = function(a,b) SV.db[SCHEMA].addons.enable = b; SV:StaticPopup_Show("RL_CLIENT") end } self:AddOption("addonEnable", option) @@ -437,9 +437,9 @@ function PLUGIN:Load() order = 300, type = "group", name = "Individual Mods", - get = function(a)return SV.db.SVStyle.blizzard[a[#a]]end, - set = function(a,b) SV.db.SVStyle.blizzard[a[#a]] = b; SV:StaticPopup_Show("RL_CLIENT") end, - disabled = function() return not SV.db.SVStyle.blizzard.enable end, + get = function(a)return SV.db[SCHEMA].blizzard[a[#a]]end, + set = function(a,b) SV.db[SCHEMA].blizzard[a[#a]] = b; SV:StaticPopup_Show("RL_CLIENT") end, + disabled = function() return not SV.db[SCHEMA].blizzard.enable end, guiInline = true, args = { bmah = { diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/character.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/character.lua index db72b3b..b227ee6 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/character.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/character.lua @@ -201,7 +201,7 @@ local function CharacterFrameStyle() iconTex:SetTexCoord(0.1, 0.9, 0.1, 0.9) iconTex:FillInner(charSlot, 0, 0) if cd then - SV:AddCD(cd) + SV.Timers:AddCooldown(cd) end end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua index c88d0c6..d7579ab 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua @@ -543,7 +543,7 @@ local function GuildControlStyle() hooksecurefunc("GuildControlUI_RankOrder_Update",RankOrder_OnUpdate) GuildControlUIRankOrderFrameNewButton:HookScript("OnClick", function() - SV:ExecuteTimer(1,RankOrder_OnUpdate) + SV.Timers:ExecuteTimer(1,RankOrder_OnUpdate) end) STYLE:ApplyDropdownStyle(GuildControlUINavigationDropDown) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua index c4779e4..901d1b2 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua @@ -55,7 +55,7 @@ local function QueuedWatchFrameItems() _G["WatchFrameItem"..i.."NormalTexture"]:SetAlpha(0) _G["WatchFrameItem"..i.."IconTexture"]:FillInner() _G["WatchFrameItem"..i.."IconTexture"]:SetTexCoord(0.1,0.9,0.1,0.9) - SV:AddCD(_G["WatchFrameItem"..i.."Cooldown"]) + SV.Timers:AddCooldown(_G["WatchFrameItem"..i.."Cooldown"]) button.styled = true end end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AdiBags.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AdiBags.lua index 9d3db07..c8caaf7 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AdiBags.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AdiBags.lua @@ -51,7 +51,7 @@ local function StyleAdiBags(event) end if event == 'PLAYER_ENTERING_WORLD' then - SV:ExecuteTimer(function() + SV.Timers:ExecuteTimer(function() if not AdiBagsContainer1 then ToggleBackpack() ToggleBackpack() end if AdiBagsContainer1 then SkinFrame(AdiBagsContainer1) @@ -60,7 +60,7 @@ local function StyleAdiBags(event) end end, 1) elseif event == 'BANKFRAME_OPENED' then - SV:ExecuteTimer(function() + SV.Timers:ExecuteTimer(function() if AdiBagsContainer2 then SkinFrame(AdiBagsContainer2) STYLE:SafeEventRemoval("AdiBags", event) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Clique.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Clique.lua index 2ae0959..bcd10d4 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Clique.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Clique.lua @@ -36,84 +36,115 @@ local STYLE = _G.StyleVillain; CLIQUE ########################################################## ]]-- +local CliqueFrames = { + "CliqueDialog", + "CliqueConfig", + "CliqueConfigPage1", + "CliqueConfigPage2", + "CliqueClickGrabber", + "CliqueScrollFrame" +} + +local CliqueButtons = { + "CliqueConfigPage1ButtonSpell", + "CliqueConfigPage1ButtonOther", + "CliqueConfigPage1ButtonOptions", + "CliqueConfigPage2ButtonBinding", + "CliqueDialogButtonAccept", + "CliqueDialogButtonBinding", + "CliqueConfigPage2ButtonSave", + "CliqueConfigPage2ButtonCancel", + "CliqueSpellTab", +} + +local CliqueStripped = { + "CliqueConfigPage1Column1", + "CliqueConfigPage1Column2", + "CliqueConfigPage1_VSlider", + "CliqueSpellTab", + "CliqueConfigPage1ButtonSpell", + "CliqueConfigPage1ButtonOther", + "CliqueConfigPage1ButtonOptions", + "CliqueConfigPage2ButtonBinding", + "CliqueDialogButtonAccept", + "CliqueDialogButtonBinding", + "CliqueConfigPage2ButtonSave", + "CliqueConfigPage2ButtonCancel", +} + +local CliqueConfigPage1_OnShow = function(self) + for i = 1, 12 do + if _G["CliqueRow"..i] then + _G["CliqueRow"..i.."Icon"]:SetTexCoord(0.1,0.9,0.1,0.9); + _G["CliqueRow"..i.."Bind"]:ClearAllPoints() + if _G["CliqueRow"..i] == CliqueRow1 then + _G["CliqueRow"..i.."Bind"]:SetPoint("RIGHT", _G["CliqueRow"..i], 8,0) + else + _G["CliqueRow"..i.."Bind"]:SetPoint("RIGHT", _G["CliqueRow"..i], -9,0) + end + _G["CliqueRow"..i]:GetHighlightTexture():SetDesaturated(1) + end + end + CliqueRow1:ClearAllPoints() + CliqueRow1:SetPoint("TOPLEFT",5,-(CliqueConfigPage1Column1:GetHeight() +3)) +end + local function StyleClique() assert(CliqueDialog, "AddOn Not Loaded") - - local Frames = { - "CliqueDialog", - "CliqueConfig", - "CliqueConfigPage1", - "CliqueConfigPage2", - "CliqueClickGrabber", - } - for _, object in pairs(Frames) do - STYLE:ApplyFrameStyle(_G[object],"Transparent") - if _G[object] == CliqueConfig then - _G[object].Panel:SetPoint("TOPLEFT",0,0) - _G[object].Panel:SetPoint("BOTTOMRIGHT",0,-5) - elseif _G[object] == CliqueClickGrabber or _G[object] == CliqueScrollFrame then - _G[object].Panel:SetPoint("TOPLEFT",4,0) - _G[object].Panel:SetPoint("BOTTOMRIGHT",-2,4) - else - _G[object]:SetFrameLevel(_G[object]:GetFrameLevel()+1) - _G[object].Panel:SetPoint("TOPLEFT",0,0) - _G[object].Panel:SetPoint("BOTTOMRIGHT",2,0) + + for _, gName in pairs(CliqueFrames) do + local frame = _G[gName] + if(frame) then + STYLE:ApplyFrameStyle(frame, "Transparent") + if(gName == "CliqueConfig") then + frame.Panel:SetPoint("TOPLEFT",0,0) + frame.Panel:SetPoint("BOTTOMRIGHT",0,-5) + elseif(gName == "CliqueClickGrabber" or gName == "CliqueScrollFrame") then + frame.Panel:SetPoint("TOPLEFT",4,0) + frame.Panel:SetPoint("BOTTOMRIGHT",-2,4) + else + frame.Panel:SetPoint("TOPLEFT",0,0) + frame.Panel:SetPoint("BOTTOMRIGHT",2,0) + end end end - local CliqueButtons = { - "CliqueConfigPage1ButtonSpell", - "CliqueConfigPage1ButtonOther", - "CliqueConfigPage1ButtonOptions", - "CliqueConfigPage2ButtonBinding", - "CliqueDialogButtonAccept", - "CliqueDialogButtonBinding", - "CliqueConfigPage2ButtonSave", - "CliqueConfigPage2ButtonCancel", - } - for _, object in pairs(CliqueButtons) do - _G[object]:SetButtonTemplate() - end - STYLE:ApplyCloseButtonStyle(CliqueDialog.CloseButton) - local CliqueTabs = { - "CliqueConfigPage1Column1", - "CliqueConfigPage1Column2", - } - for _, object in pairs(CliqueTabs) do - _G[object]:RemoveTextures(true) + + for _, gName in pairs(CliqueStripped) do + local frame = _G[gName] + if(frame) then + frame:RemoveTextures(true) + end end - CliqueConfigPage1:SetScript("OnShow", function(self) - for i = 1, 12 do - if _G["CliqueRow"..i] then - _G["CliqueRow"..i.."Icon"]:SetTexCoord(0.1,0.9,0.1,0.9); - _G["CliqueRow"..i.."Bind"]:ClearAllPoints() - if _G["CliqueRow"..i] == CliqueRow1 then - _G["CliqueRow"..i.."Bind"]:SetPoint("RIGHT", _G["CliqueRow"..i], 8,0) - else - _G["CliqueRow"..i.."Bind"]:SetPoint("RIGHT", _G["CliqueRow"..i], -9,0) - end - _G["CliqueRow"..i]:GetHighlightTexture():SetDesaturated(1) - end + + for _, gName in pairs(CliqueButtons) do + local button = _G[gName] + if(button) then + button:SetButtonTemplate() end - CliqueRow1:ClearAllPoints() - CliqueRow1:SetPoint("TOPLEFT",5,-(CliqueConfigPage1Column1:GetHeight() +3)) - end) - CliqueConfigPage1_VSlider:RemoveTextures(true) + end + + STYLE:ApplyCloseButtonStyle(CliqueDialog.CloseButton) + + CliqueConfigPage1:SetScript("OnShow", CliqueConfigPage1_OnShow) + CliqueDialog:SetSize(CliqueDialog:GetWidth()-1, CliqueDialog:GetHeight()-1) + CliqueConfigPage1ButtonSpell:ClearAllPoints() - CliqueConfigPage1ButtonOptions:ClearAllPoints() CliqueConfigPage1ButtonSpell:SetPoint("TOPLEFT", CliqueConfigPage1,"BOTTOMLEFT",0,-4) + + CliqueConfigPage1ButtonOptions:ClearAllPoints() CliqueConfigPage1ButtonOptions:SetPoint("TOPRIGHT", CliqueConfigPage1,"BOTTOMRIGHT",2,-4) + CliqueConfigPage2ButtonSave:ClearAllPoints() - CliqueConfigPage2ButtonCancel:ClearAllPoints() CliqueConfigPage2ButtonSave:SetPoint("TOPLEFT", CliqueConfigPage2,"BOTTOMLEFT",0,-4) + + CliqueConfigPage2ButtonCancel:ClearAllPoints() CliqueConfigPage2ButtonCancel:SetPoint("TOPRIGHT", CliqueConfigPage2,"BOTTOMRIGHT",2,-4) + CliqueSpellTab:GetRegions():SetSize(.1,.1) CliqueSpellTab:GetNormalTexture():SetTexCoord(0.1,0.9,0.1,0.9) CliqueSpellTab:GetNormalTexture():ClearAllPoints() CliqueSpellTab:GetNormalTexture():FillInner() - STYLE:ApplyFrameStyle(CliqueSpellTab,"Transparent") - CliqueSpellTab.Panel:SetAllPoints() - CliqueSpellTab:SetButtonTemplate() end STYLE:SaveAddonStyle("Clique", StyleClique) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.lua b/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.lua index c44cadc..e4eea51 100644 --- a/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.lua +++ b/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.lua @@ -701,15 +701,6 @@ function PLUGIN:Load() _TARGET:HookScript("OnShow", TargetFrame_OnChange) end - -- local BindableFrames = SV.SVUnit.Roster - -- for frame,key in pairs(BindableFrames) do - -- if(key:find("raid") or key:find("party")) then - -- CreateGPS(frame) - -- end - -- end - - -- SV.SVUnit:RefreshUnitFrames() - NewHook(SV.SVUnit, "RefreshUnitLayout", RefreshGPS) local options = { diff --git a/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-BORDER.blp b/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-BORDER.blp index 8bc4525..c69bd6a 100644 Binary files a/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-BORDER.blp and b/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-BORDER.blp differ