diff --git a/Interface/AddOns/SVUI/SVUI.lua b/Interface/AddOns/SVUI/SVUI.lua index ea2bf14..3abcc5a 100644 --- a/Interface/AddOns/SVUI/SVUI.lua +++ b/Interface/AddOns/SVUI/SVUI.lua @@ -38,10 +38,11 @@ local floor = math.floor local tsort, tconcat = table.sort, table.concat; --[[ ########################################################## -GET ADDON DATA +ADDON DATA ########################################################## ]]-- local SVUINameSpace, SVUICore = ...; +local version = GetAddOnMetadata(..., "Version"); --[[ ########################################################## CONSTANTS @@ -56,13 +57,6 @@ SlashCmdList.RELOADUI=ReloadUI LOCALS ########################################################## ]]-- -local bld = select(2,GetBuildInfo()); -local toonClass = select(2,UnitClass("player")); -local rez = GetCVar("gxResolution"); -local gxHeight = tonumber(match(rez,"%d+x(%d+)")); -local gxWidth = tonumber(match(rez,"(%d+)x%d+")); -local NewHook = hooksecurefunc; -local version = GetAddOnMetadata(..., "Version"); local callbacks = {}; local numCallbacks = 0; --[[ @@ -318,7 +312,7 @@ local addonEvent = function(self, event, addon) end end -local function SetPrototype(obj, name, parent) +local function SetNewPackage(obj, name, parent) local addonmeta = {} local oldmeta = getmetatable(obj) if oldmeta then @@ -356,7 +350,7 @@ local Registry_NewPackage = function(self, obj, name, priority) InitQueue[#InitQueue+1] = name end self.Packages[#self.Packages+1] = name - self.__owner[name] = SetPrototype(obj, name, self.__owner) + self.__owner[name] = SetNewPackage(obj, name, self.__owner) if(self.__owner.AddonLaunched) then if(self.__owner[name].Load) then @@ -484,7 +478,7 @@ local Registry_Load = function(self) PostLoadQueue = nil end -local AppendRegistry = function(obj, major, minor) +local function AppendRegistry(obj, major, minor) local methods = { __owner = obj, Packages = {}, @@ -506,32 +500,14 @@ local AppendRegistry = function(obj, major, minor) Update = Registry_Update, UpdateAll = Registry_UpdateAll, PreLoadPackages = Registry_PreLoad, - LoadPackages = Registry_Load + LoadPackages = Registry_Load, + Prototype = Registry_Prototype, } local mt = {__tostring = rootstring} setmetatable(methods, mt) return methods end -local function SetAddonObject(major, minor, obj) - obj = obj or {} - obj.__namekey = major - obj.version = minor - local mt = {} - local old = getmetatable(obj) - if old then - for k, v in pairs(old) do mt[k] = v end - end - mt.__tostring = rootstring - setmetatable(obj, mt) - obj.Registry = AppendRegistry(obj, major, minor) - return obj -end ---[[ -########################################################## -BUILD ADDON OBJECTS, CREATE GLOBAL NAMESPACE -########################################################## -]]-- local failsafe = function() assert(false) end local metaread = { @@ -541,52 +517,76 @@ local metaread = { end } -local localized = setmetatable({}, metaread) +local activeLocale -local core = { - db = {}, - snaps = {}, - Media = {}, - DisplayAudit = {}, - DynamicOptions = {}, - Dispellable = {}, -} - -core.fubar = function() return end -core.Options = { type = "group", name = "|cff339fffConfig-O-Matic|r", args = {} }; - -core.class = toonClass; -core.mult = 1; -core.ClassRole = ""; -core.name = UnitName("player"); -core.realm = GetRealmName(); -core.build = tonumber(bld); -core.guid = UnitGUID('player'); -core.ConfigurationMode = false; - -core.snaps[#core.snaps + 1] = core.UIParent; -core.UIParent = CreateFrame("Frame", "SVUIParent", UIParent); -core.UIParent:SetFrameLevel(UIParent:GetFrameLevel()); -core.UIParent:SetPoint("CENTER", UIParent, "CENTER"); -core.UIParent:SetSize(UIParent:GetSize()); -core.Cloaked = CreateFrame("Frame", nil, UIParent); -core.Cloaked:Hide(); - -SVUICore[1] = SetAddonObject(SVUINameSpace, version, core, true) - -SVUICore[2] = setmetatable({}, { +local defaultwrite = setmetatable({}, { __newindex = function(self, key, value) - if not rawget(localized, key) then - rawset(localized, key, value == true and key or value) + if not rawget(activeLocale, key) then + rawset(activeLocale, key, value == true and key or value) end end, __index = failsafe }) -SVUICore[3] = { +local metawrite = setmetatable({}, { + __newindex = function(self, key, value) + rawset(activeLocale, key, value == true and key or value) + end, + __index = failsafe +}) + +--[[ +########################################################## +BUILD ADDON OBJECTS, CREATE GLOBAL NAMESPACE +########################################################## +]]-- +local function SetPrototype() + local 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) + return obj +end + +local SuperVillain = SetPrototype() + +SuperVillain.__namekey = SVUINameSpace +SuperVillain.version = version +SuperVillain.Localization = setmetatable({}, metaread) +SuperVillain.Global = { Accountant = {}, profiles = {}, profileKeys = {}, } +SuperVillain.Registry = AppendRegistry(SuperVillain, SVUINameSpace, version) + +function SuperVillain:SetLocaleStrings(locale, isDefault) + local gameLocale = GetLocale() + if gameLocale == "enGB" then gameLocale = "enUS" end + + activeLocale = self.Localization + + if isDefault then + return defaultwrite + elseif(locale == GAME_LOCALE or locale == gameLocale) then + return metawrite + end +end + +function SuperVillain:Prototype(n, v) + local obj = SetPrototype() + obj.__namekey = n + obj.version = v + return obj +end + +SVUICore[1] = SuperVillain +SVUICore[2] = SuperVillain.Localization +SVUICore[3] = SuperVillain.Global + _G[SVUINameSpace] = SVUICore; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/SVUI.toc b/Interface/AddOns/SVUI/SVUI.toc index 7407852..08a5357 100644 --- a/Interface/AddOns/SVUI/SVUI.toc +++ b/Interface/AddOns/SVUI/SVUI.toc @@ -1,6 +1,6 @@ ## Interface: 50400 ## Author: Munglunch -## Version: 4.074 +## Version: 4.076 ## Title: |cffFF9900SVUI|r ## Notes: Supervillain UI [|cff9911FFCore Framework|r]. ## SavedVariables: SVUI_Global diff --git a/Interface/AddOns/SVUI/SVUI.xml b/Interface/AddOns/SVUI/SVUI.xml index 8859dfe..5292260 100644 --- a/Interface/AddOns/SVUI/SVUI.xml +++ b/Interface/AddOns/SVUI/SVUI.xml @@ -217,7 +217,6 @@ <Script file="system\system.lua"/> <Script file="system\database.lua"/> - <Script file="system\filters.lua"/> <Script file="system\screen.lua"/> <Script file="system\visibility.lua"/> <Script file="system\utilities.lua"/> diff --git a/Interface/AddOns/SVUI/language/chinese_ui.lua b/Interface/AddOns/SVUI/language/chinese_ui.lua index cab3c23..01848f6 100644 --- a/Interface/AddOns/SVUI/language/chinese_ui.lua +++ b/Interface/AddOns/SVUI/language/chinese_ui.lua @@ -1,5 +1,6 @@ -if not GetLocale() == "zhCN" then return; end -local SuperVillain, L, G = unpack(select(2, ...)); +local SuperVillain, L = unpack(select(2, ...)) +local L = SuperVillain:SetLocaleStrings("zhCN"); +if not L then return end --[[REACTION TEXTS]]-- L[" is drinking."] = true; L["Leeeeeroy!"] = true; diff --git a/Interface/AddOns/SVUI/language/english_ui.lua b/Interface/AddOns/SVUI/language/english_ui.lua index 3838fce..42f231c 100644 --- a/Interface/AddOns/SVUI/language/english_ui.lua +++ b/Interface/AddOns/SVUI/language/english_ui.lua @@ -1,5 +1,6 @@ -if not GetLocale() == "enUS" then return; end -local SuperVillain, L, G = unpack(select(2, ...)); +local SuperVillain, L = unpack(select(2, ...)) +local L = SuperVillain:SetLocaleStrings("enUS", true); +if not L then return; end --[[REACTION TEXTS]]-- L[" is drinking."] = true; L["Leeeeeroy!"] = true; diff --git a/Interface/AddOns/SVUI/language/french_ui.lua b/Interface/AddOns/SVUI/language/french_ui.lua index e633d1c..4a4b166 100644 --- a/Interface/AddOns/SVUI/language/french_ui.lua +++ b/Interface/AddOns/SVUI/language/french_ui.lua @@ -1,5 +1,6 @@ -if not GetLocale() == "frFR" then return; end -local SuperVillain, L, G = unpack(select(2, ...)); +local SuperVillain, L = unpack(select(2, ...)) +local L = SuperVillain:SetLocaleStrings("frFR"); +if not L then return; end --[[REACTION TEXTS]]-- L[" is drinking."] = true; L["Leeeeeroy!"] = true; diff --git a/Interface/AddOns/SVUI/language/german_ui.lua b/Interface/AddOns/SVUI/language/german_ui.lua index d05ffe8..b66787d 100644 --- a/Interface/AddOns/SVUI/language/german_ui.lua +++ b/Interface/AddOns/SVUI/language/german_ui.lua @@ -1,5 +1,6 @@ -if not GetLocale() == "deDE" then return; end -local SuperVillain, L, G = unpack(select(2, ...)); +local SuperVillain, L = unpack(select(2, ...)) +local L = SuperVillain:SetLocaleStrings("deDE"); +if not L then return end --[[REACTION TEXTS]]-- L[" is drinking."] = true; L["Leeeeeroy!"] = true; diff --git a/Interface/AddOns/SVUI/language/italian_ui.lua b/Interface/AddOns/SVUI/language/italian_ui.lua index 5538c25..c507a6d 100644 --- a/Interface/AddOns/SVUI/language/italian_ui.lua +++ b/Interface/AddOns/SVUI/language/italian_ui.lua @@ -1,5 +1,6 @@ -if not GetLocale() == "itIT" then return; end -local SuperVillain, L, G = unpack(select(2, ...)); +local SuperVillain, L = unpack(select(2, ...)) +local L = SuperVillain:SetLocaleStrings("itIT"); +if not L then return; end --[[REACTION TEXTS]]-- L[" is drinking."] = true; L["Leeeeeroy!"] = true; diff --git a/Interface/AddOns/SVUI/language/korean_ui.lua b/Interface/AddOns/SVUI/language/korean_ui.lua index d408741..03d21f5 100644 --- a/Interface/AddOns/SVUI/language/korean_ui.lua +++ b/Interface/AddOns/SVUI/language/korean_ui.lua @@ -1,5 +1,6 @@ -if not GetLocale() == "koKR" then return; end -local SuperVillain, L, G = unpack(select(2, ...)); +local SuperVillain, L = unpack(select(2, ...)) +local L = SuperVillain:SetLocaleStrings("koKR"); +if not L then return; end --[[REACTION TEXTS]]-- L[" is drinking."] = true; L["Leeeeeroy!"] = true; diff --git a/Interface/AddOns/SVUI/language/portuguese_ui.lua b/Interface/AddOns/SVUI/language/portuguese_ui.lua index d992e10..8d18575 100644 --- a/Interface/AddOns/SVUI/language/portuguese_ui.lua +++ b/Interface/AddOns/SVUI/language/portuguese_ui.lua @@ -1,5 +1,6 @@ -if not GetLocale() == "ptBR" then return; end -local SuperVillain, L, G = unpack(select(2, ...)); +local SuperVillain, L = unpack(select(2, ...)) +local L = SuperVillain:SetLocaleStrings("ptBR"); +if not L then return; end --[[REACTION TEXTS]]-- L[" is drinking."] = true; L["Leeeeeroy!"] = true; diff --git a/Interface/AddOns/SVUI/language/russian_ui.lua b/Interface/AddOns/SVUI/language/russian_ui.lua index 6d4d69e..feae31d 100644 --- a/Interface/AddOns/SVUI/language/russian_ui.lua +++ b/Interface/AddOns/SVUI/language/russian_ui.lua @@ -1,5 +1,6 @@ -if not GetLocale() == "ruRU" then return; end -local SuperVillain, L, G = unpack(select(2, ...)); +local SuperVillain, L = unpack(select(2, ...)) +local L = SuperVillain:SetLocaleStrings("ruRU"); +if not L then return; end --[[REACTION TEXTS]]-- L[" is drinking."] = true; L["Leeeeeroy!"] = true; diff --git a/Interface/AddOns/SVUI/language/spanish_ui.lua b/Interface/AddOns/SVUI/language/spanish_ui.lua index e23faeb..94b5d87 100644 --- a/Interface/AddOns/SVUI/language/spanish_ui.lua +++ b/Interface/AddOns/SVUI/language/spanish_ui.lua @@ -1,5 +1,9 @@ -if(not GetLocale() == "esES" and (not GetLocale() == "esMX")) then return; end -local SuperVillain, L, G = unpack(select(2, ...)); +local SuperVillain, L = unpack(select(2, ...)) +local L = SuperVillain:SetLocaleStrings("esES"); +if not L then + L = SuperVillain:SetLocaleStrings("esMX") +end +if not L then return; end --[[REACTION TEXTS]]-- L[" is drinking."] = true; L["Leeeeeroy!"] = true; diff --git a/Interface/AddOns/SVUI/language/taiwanese_ui.lua b/Interface/AddOns/SVUI/language/taiwanese_ui.lua index dedcb6e..67bd5d8 100644 --- a/Interface/AddOns/SVUI/language/taiwanese_ui.lua +++ b/Interface/AddOns/SVUI/language/taiwanese_ui.lua @@ -1,5 +1,6 @@ -if not GetLocale() == "zhTW" then return; end -local SuperVillain, L, G = unpack(select(2, ...)); +local SuperVillain, L = unpack(select(2, ...)) +local L = SuperVillain:SetLocaleStrings("zhTW"); +if not L then return; end --[[REACTION TEXTS]]-- L[" is drinking."] = true; L["Leeeeeroy!"] = true; diff --git a/Interface/AddOns/SVUI/packages/bag/SVBag.lua b/Interface/AddOns/SVUI/packages/bag/SVBag.lua index ab8ca8b..145b0c1 100644 --- a/Interface/AddOns/SVUI/packages/bag/SVBag.lua +++ b/Interface/AddOns/SVUI/packages/bag/SVBag.lua @@ -555,13 +555,19 @@ function MOD:VendorGrays(arg1, arg2, arg3) end function MOD:ModifyBags() - if self.BagFrame then + local docked = self.db.alignToChat + local anchor, x, y + if self.BagFrame then + local parent = docked and RightSuperDock or SuperVillain.UIParent + local anchor, x, y = self.db.bags.point, self.db.bags.xOffset, self.db.bags.yOffset self.BagFrame:ClearAllPoints() - self.BagFrame:Point("BOTTOMRIGHT", RightSuperDock, "BOTTOMRIGHT", 0-MOD.db.xOffset, 0 + MOD.db.yOffset) + self.BagFrame:Point(anchor, parent, anchor, x, y) end if self.BankFrame then + local parent = docked and LeftSuperDock or SuperVillain.UIParent + local anchor, x, y = self.db.bank.point, self.db.bank.xOffset, self.db.bank.yOffset self.BankFrame:ClearAllPoints() - self.BankFrame:Point("BOTTOMLEFT", LeftSuperDock, "BOTTOMLEFT", 0 + MOD.db.xOffset, 0 + MOD.db.yOffset) + self.BankFrame:Point(anchor, parent, anchor, x, y) end end @@ -676,70 +682,7 @@ do SVUI_BagBar:Width(MOD.db.bagBar.size + MOD.db.bagBar.spacing * 2) end end -end - -function MOD:RepositionBags() - local a9, xOffset, yOffset, aa, ab, ac, ad; - local ae = GetScreenWidth() - local af = 1; - local ag = 0; - if BankFrame:IsShown()then - ag = BankFrame:GetRight()-25 - end - while af>CONTAINER_SCALE do - aa = GetScreenHeight() / af; - xOffset = CONTAINER_OFFSET_X / af; - yOffset = CONTAINER_OFFSET_Y / af; - ab = aa-yOffset; - ac = ae-xOffset; - ad = 1; - local ah; - for ai, aj in ipairs(ContainerFrame1.bags)do - ah = _G[aj]:GetHeight() - if ab<ah then - ad = ad + 1; - ac = ae-ad * CONTAINER_WIDTH * af-xOffset; - ab = aa-yOffset - end - ab = ab-ah-VISIBLE_CONTAINER_SPACING - end - if ac<ag then - af = af-0.01 - else - break - end - end - if af<CONTAINER_SCALE then - af = CONTAINER_SCALE - end - aa = GetScreenHeight() / af; - xOffset = CONTAINER_OFFSET_X / af; - yOffset = CONTAINER_OFFSET_Y / af; - ab = aa-yOffset; - ad = 0; - local ak = 0; - for ai, aj in ipairs(ContainerFrame1.bags)do - a9 = _G[aj] - a9:SetScale(1) - if ai == 1 then - a9:SetPoint("BOTTOMRIGHT", RightSuperDock, "BOTTOMRIGHT", 2, 2) - ak = ak + 1 - elseif ab<a9:GetHeight()then - ad = ad + 1; - ab = aa-yOffset; - if ad>1 then - a9:SetPoint("BOTTOMRIGHT", ContainerFrame1.bags[ai-ak-1], "BOTTOMLEFT", -CONTAINER_SPACING, 0) - else - a9:SetPoint("BOTTOMRIGHT", ContainerFrame1.bags[ai-ak], "BOTTOMLEFT", -CONTAINER_SPACING, 0) - end - ak = 0 - else - a9:SetPoint("BOTTOMRIGHT", ContainerFrame1.bags[ai-1], "TOPRIGHT", 0, CONTAINER_SPACING) - ak = ak + 1 - end - ab = ab-a9:GetHeight()-VISIBLE_CONTAINER_SPACING - end -end +end --[[ ########################################################## BAG CONTAINER CREATION @@ -942,12 +885,11 @@ do end end - function MOD:MakeBags(parent, isBank) + function MOD:MakeBags(bagName, isBank) local uisCount = #UISpecialFrames + 1; local bagsCount = #self.BagFrames + 1; - local frame = NewFrame('Button', parent, SuperVillain.UIParent) + local frame = NewFrame('Button', bagName, SuperVillain.UIParent) frame:SetPanelTemplate("Container") - frame.Panel:SetAllPoints() frame:SetFrameStrata('HIGH') frame.RefreshSlot=MOD.RefreshSlot; frame.RefreshBagsSlots=MOD.RefreshBagsSlots; @@ -974,12 +916,12 @@ do frame.topOffset=isBank and 60 or 65; frame.BagIDs=isBank and {-1,5,6,7,8,9,10,11} or {0,1,2,3,4} frame.Bags={} - frame.closeButton=NewFrame('Button',parent..'CloseButton',frame,'UIPanelCloseButton') + frame.closeButton=NewFrame('Button',bagName..'CloseButton',frame,'UIPanelCloseButton') frame.closeButton:Point('TOPRIGHT',-4,-4) frame.holderFrame=NewFrame('Frame',nil,frame) frame.holderFrame:Point('TOP',frame,'TOP',0,-frame.topOffset) frame.holderFrame:Point('BOTTOM',frame,'BOTTOM',0,frame.bottomOffset) - frame.ContainerHolder=NewFrame('Button',parent..'ContainerHolder',frame) + frame.ContainerHolder=NewFrame('Button',bagName..'ContainerHolder',frame) frame.ContainerHolder:Point('BOTTOMLEFT',frame,'TOPLEFT',0,1) frame.ContainerHolder:SetFixedPanelTemplate('Transparent') frame.ContainerHolder:Hide() @@ -1062,7 +1004,7 @@ do frame.goldText:Point('BOTTOMRIGHT',frame.holderFrame,'TOPRIGHT',-2,4) frame.goldText:SetJustifyH("RIGHT") - frame.editBox = NewFrame('EditBox', parent..'EditBox', frame) + frame.editBox = NewFrame('EditBox', bagName..'EditBox', frame) frame.editBox:SetFrameLevel(frame.editBox:GetFrameLevel()+2) frame.editBox:SetEditboxTemplate() frame.editBox:Height(15) diff --git a/Interface/AddOns/SVUI/packages/chat/SVChat.lua b/Interface/AddOns/SVUI/packages/chat/SVChat.lua index 5248857..9dc3e73 100644 --- a/Interface/AddOns/SVUI/packages/chat/SVChat.lua +++ b/Interface/AddOns/SVUI/packages/chat/SVChat.lua @@ -596,7 +596,7 @@ do else tab:SetHeight(TAB_HEIGHT) tab:SetWidth(TAB_WIDTH) - tab.SetWidth = function()return end; + tab.SetWidth = SuperVillain.fubar; end ------------------------------------------- local ebPoint1, ebPoint2, ebPoint3 = select(6, editBox:GetRegions()) diff --git a/Interface/AddOns/SVUI/packages/dock/SVDock.lua b/Interface/AddOns/SVUI/packages/dock/SVDock.lua index bc62a77..3b5ce69 100644 --- a/Interface/AddOns/SVUI/packages/dock/SVDock.lua +++ b/Interface/AddOns/SVUI/packages/dock/SVDock.lua @@ -51,7 +51,7 @@ local TOOL_DATA = { [171] = {0,0.25,0,0.25}, -- PRO-ALCHEMY [794] = {0.25,0.5,0,0.25,"Survey"}, -- PRO-ARCHAELOGY [164] = {0.5,0.75,0,0.25}, -- PRO-BLACKSMITH - [184] = {0.75,1,0,0.25,"Cooking Fire"}, -- PRO-COOKING + [185] = {0.75,1,0,0.25,"Cooking Fire"}, -- PRO-COOKING [333] = {0,0.25,0.25,0.5,"Disenchant"}, -- PRO-ENCHANTING [202] = {0.25,0.5,0.25,0.5}, -- PRO-ENGINEERING [129] = {0.5,0.75,0.25,0.5}, -- PRO-FIRSTAID @@ -614,6 +614,25 @@ do local LastAddedMacro; local MacroCount = 0; + local Macro_OnEnter = function(self) + self:SetPanelColor("highlight") + self.icon:SetGradient(unpack(SuperVillain.Media.gradient.bizzaro)) + GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 2, 4) + GameTooltip:ClearLines() + if not self.TText2 then + GameTooltip:AddLine(self.TText, 1, 1, 1) + else + GameTooltip:AddDoubleLine(self.TText, self.TText2, 1, 1, 1) + end + GameTooltip:Show() + end + + local Macro_OnLeave = function(self) + self:SetPanelColor("special") + self.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + GameTooltip:Hide() + end + local function HearthTime() local start,duration = GetItemCooldown(6948) local expires = duration - (GetTime() - start) diff --git a/Interface/AddOns/SVUI/packages/tip/SVTip.lua b/Interface/AddOns/SVUI/packages/tip/SVTip.lua index eaded2b..cad39af 100644 --- a/Interface/AddOns/SVUI/packages/tip/SVTip.lua +++ b/Interface/AddOns/SVUI/packages/tip/SVTip.lua @@ -548,10 +548,12 @@ local _hook_GameTooltip_OnTooltipSetItem = function(self) if not self.itemCleared then self.SuperBorder:ClearMaskColors() local key,itemID = self:GetItem() - local quality = select(3, GetItemInfo(key)) - if(quality) then - local r,g,b = GetItemQualityColor(quality) - self.SuperBorder:SetToneColor(r,g,b) + if(key) then + local quality = select(3, GetItemInfo(key)) + if(quality) then + local r,g,b = GetItemQualityColor(quality) + self.SuperBorder:SetToneColor(r,g,b) + end end local left = ""; local right = ""; diff --git a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua index 4a1a4f9..ec07620 100644 --- a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua +++ b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua @@ -767,7 +767,7 @@ function MOD:RefreshUnitLayout(frame, template) castbar.Spark[1]:SetAllPoints(castbar.Spark) castbar.Spark[2]:FillInner(castbar.Spark, 4, 4) end - castbar.Spark.SetHeight = function()return end + castbar.Spark.SetHeight = SuperVillain.fubar end castbar:SetFrameStrata("HIGH") if castbar.Holder then @@ -1262,12 +1262,6 @@ function MOD:KillBlizzardRaidFrames() if crfmTest and crfmTest ~= "0" then CompactRaidFrameManager_SetSetting("IsShown","0") end - ShowPartyFrame = SuperVillain.fubar - HidePartyFrame = SuperVillain.fubar - CompactUnitFrame_UpdateAll = SuperVillain.fubar - CompactUnitFrameProfiles_ApplyProfile = SuperVillain.fubar - CompactRaidFrameManager_UpdateShown = SuperVillain.fubar - CompactRaidFrameManager_UpdateOptionsFlowContainer = SuperVillain.fubar end function MOD:PLAYER_REGEN_DISABLED() @@ -1290,11 +1284,11 @@ function MOD:PLAYER_REGEN_ENABLED() end function MOD:ADDON_LOADED(event, addon) - if(not self.db.enable or not self.db.disableBlizzard) then return end + self:KillBlizzardRaidFrames() if addon == 'Blizzard_ArenaUI' then oUF_SuperVillain:DisableBlizzard('arena') + self:UnregisterEvent("ADDON_LOADED") end - self:UnregisterEvent("ADDON_LOADED") end function MOD:PLAYER_ENTERING_WORLD() @@ -1326,7 +1320,7 @@ function MOD:Load() self:RegisterEvent("PLAYER_REGEN_DISABLED") if(self.db.disableBlizzard) then - --self:KillBlizzardRaidFrames() + self:KillBlizzardRaidFrames() NewHook("CompactUnitFrame_RegisterEvents", CompactUnitFrame_UnregisterEvents) NewHook("UnitFrameThreatIndicator_Initialize", UnitFrameThreatIndicator_Hook) @@ -1355,7 +1349,7 @@ function MOD:Load() oUF_SuperVillain:DisableBlizzard("arena") end - --self:RegisterEvent("GROUP_ROSTER_UPDATE", "KillBlizzardRaidFrames") + self:RegisterEvent("GROUP_ROSTER_UPDATE", "KillBlizzardRaidFrames") UIParent:UnregisterEvent("GROUP_ROSTER_UPDATE") else CompactUnitFrameProfiles:RegisterEvent("VARIABLES_LOADED") @@ -1368,11 +1362,4 @@ function MOD:Load() rDebuffs.MatchBySpellName = true; end -SuperVillain.Registry:NewPackage(MOD, "SVUnit", "pre") - -local frame = CreateFrame("Frame") -frame:RegisterEvent("ADDON_LOADED") -frame:SetScript("OnEvent", function(self, event, addon) - if(not MOD.db.enable or not MOD.db.disableBlizzard) then return end - MOD:KillBlizzardRaidFrames() -end) \ No newline at end of file +SuperVillain.Registry:NewPackage(MOD, "SVUnit", "pre") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/elements/auras.lua b/Interface/AddOns/SVUI/packages/unit/elements/auras.lua index 3cb606c..aafceae 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/auras.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/auras.lua @@ -330,14 +330,14 @@ do end pass = true end - if _test(auraDB.useBlocked, friendly) then + if _test(auraDB.filterBlocked, friendly) then local blackListSpell = SuperVillain.db.filter["Blocked"][name] if blackListSpell and blackListSpell.enable then filtered = false end pass = true end - if _test(auraDB.useAllowed, friendly) then + if _test(auraDB.filterAllowed, friendly) then local whiteListSpell = SuperVillain.db.filter["Allowed"][name] if whiteListSpell and whiteListSpell.enable then filtered = true; diff --git a/Interface/AddOns/SVUI/scripts/pvp.lua b/Interface/AddOns/SVUI/scripts/pvp.lua index 3276dd8..886461d 100644 --- a/Interface/AddOns/SVUI/scripts/pvp.lua +++ b/Interface/AddOns/SVUI/scripts/pvp.lua @@ -204,6 +204,7 @@ local function LoadPVPComm() local height = holder:GetHeight() local sectionWidth = (width / 6) - 2 local sectionHeight = (height / 5) - 2 + local iconSize = sectionHeight * 0.5 for i = 1, 5 do local yOffset = (sectionHeight * (i - 1)) + 2 @@ -221,7 +222,7 @@ local function LoadPVPComm() safe:SetPanelColor("green") local sicon = safe:CreateTexture(nil, "OVERLAY") sicon:SetPoint("CENTER", safe, "CENTER", 0, 0) - sicon:SetSize(sectionHeight,sectionHeight) + sicon:SetSize(iconSize,iconSize) sicon:SetTexCoord(0.1, 0.9, 0.1, 0.9) sicon:SetTexture(PVP_SAFE) safe:SetScript("OnEnter", Safe_OnEnter) @@ -237,7 +238,7 @@ local function LoadPVPComm() help:SetPanelColor("red") local hicon = help:CreateTexture(nil, "OVERLAY") hicon:SetPoint("CENTER", help, "CENTER", 0, 0) - hicon:SetSize(sectionHeight,sectionHeight) + hicon:SetSize(iconSize,iconSize) hicon:SetTexCoord(0.1, 0.9, 0.1, 0.9) hicon:SetTexture(PVP_HELP) help:SetScript("OnEnter", Help_OnEnter) diff --git a/Interface/AddOns/SVUI/scripts/questwatch.lua b/Interface/AddOns/SVUI/scripts/questwatch.lua index caa85c1..d18be09 100644 --- a/Interface/AddOns/SVUI/scripts/questwatch.lua +++ b/Interface/AddOns/SVUI/scripts/questwatch.lua @@ -332,12 +332,12 @@ local function CreateQuestDocklet() WatchFrame:SetParent(SVUI_QuestFrame) WatchFrame:SetAllPoints(SVUI_QuestFrame) WatchFrame:SetFrameLevel(SVUI_QuestFrame:GetFrameLevel() + 1) - WatchFrame.ClearAllPoints = function()return end; - WatchFrame.SetPoint = function()return end; - WatchFrame.SetAllPoints = function()return end; - WatchFrameLines.ClearAllPoints = function()return end; - WatchFrameLines.SetPoint = function()return end; - WatchFrameLines.SetAllPoints = function()return end; + WatchFrame.ClearAllPoints = SuperVillain.fubar; + WatchFrame.SetPoint = SuperVillain.fubar; + WatchFrame.SetAllPoints = SuperVillain.fubar; + WatchFrameLines.ClearAllPoints = SuperVillain.fubar; + WatchFrameLines.SetPoint = SuperVillain.fubar; + WatchFrameLines.SetAllPoints = SuperVillain.fubar; SuperVillain:SetSVMovable(frame, "Quest Watch"); else local bgTex = [[Interface\BUTTONS\WHITE8X8]] @@ -424,16 +424,16 @@ local function CreateQuestDocklet() WatchFrameLines:SetPoint("BOTTOMLEFT", WatchFrame, "BOTTOMLEFT", 87, 0) WatchFrameLines:SetWidth(WATCHFRAME_MAXLINEWIDTH - 100) --[[Lets murder some internals to prevent overriding]]-- - WatchFrame.ClearAllPoints = function()return end; - WatchFrame.SetPoint = function()return end; - WatchFrame.SetAllPoints = function()return end; - WatchFrameLines.ClearAllPoints = function()return end; - WatchFrameLines.SetPoint = function()return end; - WatchFrameLines.SetAllPoints = function()return end; - WatchFrameLines.SetWidth = function()return end; - WatchFrameCollapseExpandButton.ClearAllPoints = function()return end; - WatchFrameCollapseExpandButton.SetPoint = function()return end; - WatchFrameCollapseExpandButton.SetAllPoints = function()return end; + WatchFrame.ClearAllPoints = SuperVillain.fubar; + WatchFrame.SetPoint = SuperVillain.fubar; + WatchFrame.SetAllPoints = SuperVillain.fubar; + WatchFrameLines.ClearAllPoints = SuperVillain.fubar; + WatchFrameLines.SetPoint = SuperVillain.fubar; + WatchFrameLines.SetAllPoints = SuperVillain.fubar; + WatchFrameLines.SetWidth = SuperVillain.fubar; + WatchFrameCollapseExpandButton.ClearAllPoints = SuperVillain.fubar; + WatchFrameCollapseExpandButton.SetPoint = SuperVillain.fubar; + WatchFrameCollapseExpandButton.SetAllPoints = SuperVillain.fubar; SetQuestDockEvents() diff --git a/Interface/AddOns/SVUI/system/_load.xml b/Interface/AddOns/SVUI/system/_load.xml deleted file mode 100644 index a153d8c..0000000 --- a/Interface/AddOns/SVUI/system/_load.xml +++ /dev/null @@ -1,18 +0,0 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/"> - <Script file='system.lua'/> - <Script file='database.lua'/> - <!-- <Script file='filters.lua'/> --> - <Script file='screen.lua'/> - <Script file='visibility.lua'/> - <Script file='utilities.lua'/> - <Script file='templates.lua'/> - <Script file='timers.lua'/> - <Script file='updates.lua'/> - <Script file='slash.lua'/> - <Script file='alerts.lua'/> - <Script file='presets.lua'/> - <Script file='installer.lua'/> - <Script file='mentalo.lua'/> - <Include file='mentalo.xml'/> - <Script file='cartography.lua'/> -</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/alerts.lua b/Interface/AddOns/SVUI/system/alerts.lua index fa1f4bd..888739e 100644 --- a/Interface/AddOns/SVUI/system/alerts.lua +++ b/Interface/AddOns/SVUI/system/alerts.lua @@ -41,14 +41,13 @@ local assert = enforce; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SuperVillain, L, G = unpack(select(2, ...)); --[[ ########################################################## LOCAL VARS ########################################################## ]]-- local BUFFER = {}; -local NOOP = function() end; local function UpdateActionBarOptions() if InCombatLockdown() or not SuperVillain.db.SVBar.IsLoaded then return end; if (SuperVillain.db.SVBar.Bar2.enable ~= InterfaceOptionsActionBarsPanelBottomRight:GetChecked()) then @@ -72,13 +71,16 @@ DEFINITIONS ########################################################## ]]-- SuperVillain.SystemAlert = {}; + SuperVillain.ActiveAlerts = {}; + SuperVillain.SystemAlert["CLIENT_UPDATE_REQUEST"] = { text = L["Detected that your SVUI Config addon is out of date. Update as soon as possible."], button1 = OKAY, - OnAccept = NOOP, + OnAccept = function() return end, state1 = 1 }; + SuperVillain.SystemAlert["FAILED_UISCALE"] = { text = L["You have changed your UIScale, however you still have the AutoScale option enabled in SVUI. Press accept if you would like to disable the Auto Scale option."], button1 = ACCEPT, @@ -203,7 +205,7 @@ SuperVillain.SystemAlert["BAR6_CONFIRMATION"] = { UpdateActionBarOptions() end end, - OnCancel = NOOP, + OnCancel = function() return end, timeout = 0, whileDead = 1, state1 = 1 diff --git a/Interface/AddOns/SVUI/system/database.lua b/Interface/AddOns/SVUI/system/database.lua index 0080585..356320c 100644 --- a/Interface/AddOns/SVUI/system/database.lua +++ b/Interface/AddOns/SVUI/system/database.lua @@ -53,6 +53,7 @@ GET ADDON DATA ########################################################## ]]-- local SuperVillain, L, G = unpack(select(2, ...)); +SuperVillain.Shared = LibStub("LibSharedMedia-3.0") local realm = GetRealmName() local name = UnitName("player") local pkey = name .. " - " .. realm @@ -336,8 +337,16 @@ local DefaultSettings = { ["SVBag"] = { ["enable"] = true, ["sortInverted"] = false, - ["xOffset"] = 0, - ["yOffset"] = 0, + ["bags"] = { + ["xOffset"] = 0, + ["yOffset"] = 0, + ["point"] = "BOTTOMRIGHT", + }, + ["bank"] = { + ["xOffset"] = 0, + ["yOffset"] = 0, + ["point"] = "BOTTOMLEFT", + }, ["bagSize"] = 34, ["bankSize"] = 34, ["alignToChat"] = false, @@ -3218,6 +3227,88 @@ local DefaultSettings = { }, } }, + ["SVStyle"] = { + ["blizzard"] = { + ["enable"] = true, + ["bags"] = true, + ["bmah"] = true, + ["reforge"] = true, + ["calendar"] = true, + ["achievement"] = true, + ["lfguild"] = true, + ["inspect"] = true, + ["binding"] = true, + ["gbank"] = true, + ["archaeology"] = true, + ["guildcontrol"] = true, + ["gossip"] = true, + ["guild"] = true, + ["tradeskill"] = true, + ["raid"] = false, + ["talent"] = true, + ["auctionhouse"] = true, + ["barber"] = true, + ["macro"] = true, + ["debug"] = true, + ["trainer"] = true, + ["socket"] = true, + ["loot"] = true, + ["alertframes"] = true, + ["bgscore"] = true, + ["merchant"] = true, + ["mail"] = true, + ["help"] = true, + ["trade"] = true, + ["gossip"] = true, + ["greeting"] = true, + ["worldmap"] = true, + ["taxi"] = true, + ["quest"] = true, + ["petition"] = true, + ["dressingroom"] = true, + ["pvp"] = true, + ["lfg"] = true, + ["nonraid"] = true, + ["friends"] = true, + ["spellbook"] = true, + ["character"] = true, + ["misc"] = true, + ["tabard"] = true, + ["guildregistrar"] = true, + ["timemanager"] = true, + ["encounterjournal"] = true, + ["voidstorage"] = true, + ["transmogrify"] = true, + ["stable"] = true, + ["bgmap"] = true, + ["mounts"] = true, + ["petbattleui"] = true, + ["losscontrol"] = true, + ["itemUpgrade"] = true, + }, + ["addons"] = { + ["enable"] = true, + ["Skada"] = true, + ["Recount"] = true, + ["AuctionLite"] = true, + ["AtlasLoot"] = true, + ["SexyCooldown"] = true, + ["Lightheaded"] = true, + ["Outfitter"] = true, + ["WeakAuras"] = true, + ["Quartz"] = true, + ["TomTom"] = true, + ["TinyDPS"] = true, + ["Clique"] = true, + ["CoolLine"] = true, + ["ACP"] = true, + ["DXE"] = true, + ["MogIt"] = true, + ["alDamageMeter"] = true, + ["Omen"] = true, + ["TradeSkillDW"] = true, + } + }, ["filter"] = { ["CC"] = {}, ["Shield"] = {}, @@ -3226,7 +3317,7 @@ local DefaultSettings = { ["Allowed"] = {}, ["Strict"] = {}, ["Raid"] = {}, - } + }, } --[[ ########################################################## @@ -3947,7 +4038,6 @@ end local function insertdata(t, src) local sv = rawget(t, "profile") local dv = rawget(t, "defaults") - local src = dv and dv[k] for k,v in pairs(src) do if(not sv[k]) then sv[k] = {} end tablecopy(sv[k], src[k]) @@ -4053,6 +4143,20 @@ function SuperVillain:HexColor(arg1,arg2,arg3) return hexString end +function SuperVillain:TableSplice(targetTable, mergeTable) + if type(targetTable) ~= "table" then targetTable = {} end + + if type(mergeTable) == 'table' then + for key,val in pairs(mergeTable) do + if type(val) == "table" then + val = self:TableSplice(targetTable[key], val) + end + targetTable[key] = val + end + end + return targetTable +end + function SuperVillain:SetDatabaseObjects(init) if(init) then self.db = tcopy(DefaultSettings, true) @@ -4074,5 +4178,4 @@ function SuperVillain:SetDatabaseObjects(init) logoutListener:RegisterEvent("PLAYER_LOGOUT") logoutListener:SetScript("OnEvent", LogOut_OnEvent) end - self:SetFilterObjects(init) end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/filters.lua b/Interface/AddOns/SVUI/system/filters.lua deleted file mode 100644 index f2a5e95..0000000 --- a/Interface/AddOns/SVUI/system/filters.lua +++ /dev/null @@ -1,716 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local next = _G.next; -local type = _G.type; -local error = _G.error; -local rawset = _G.rawset; -local rawget = _G.rawget; -local string = _G.string; -local math = _G.math; -local bit = _G.bit; -local table = _G.table; ---[[ STRING METHODS ]]-- -local lower, upper = string.lower, string.upper; -local find, format, len, split = string.find, string.format, string.len, string.split; -local match, sub, join = string.match, string.sub, string.join; -local gmatch, gsub = string.gmatch, string.gsub; ---[[ MATH METHODS ]]-- -local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; -- Basic -local fmod, modf, sqrt = math.fmod, math.modf, math.sqrt; -- Algebra -local atan2, cos, deg, rad, sin = math.atan2, math.cos, math.deg, math.rad, math.sin; -- Trigonometry -local parsefloat, huge, random = math.parsefloat, math.huge, math.random; -- Uncommon ---[[ BINARY METHODS ]]-- -local band, bor = bit.band, bit.bor; ---[[ TABLE METHODS ]]-- -local tremove, tcopy, twipe, tsort, tconcat, tdump = table.remove, table.copy, table.wipe, table.sort, table.concat, table.dump; ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SuperVillain, L = unpack(select(2, ...)); - -local logoutListener = CreateFrame("Frame", nil) - -local CLASS_WATCH_INDEX = { - PRIEST = { - {-- Weakened Soul - ["enabled"] = true, - ["id"] = 6788, - ["point"] = "TOPRIGHT", - ["color"] = {["r"] = 1, ["g"] = 0, ["b"] = 0}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Prayer of Mending - ["enabled"] = true, - ["id"] = 41635, - ["point"] = "BOTTOMRIGHT", - ["color"] = {["r"] = 0.2, ["g"] = 0.7, ["b"] = 0.2}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Renew - ["enabled"] = true, - ["id"] = 139, - ["point"] = "BOTTOMLEFT", - ["color"] = {["r"] = 0.4, ["g"] = 0.7, ["b"] = 0.2}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Power Word: Shield - ["enabled"] = true, - ["id"] = 17, - ["point"] = "TOPLEFT", - ["color"] = {["r"] = 0.81, ["g"] = 0.85, ["b"] = 0.1}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Power Word: Shield Power Insight - ["enabled"] = true, - ["id"] = 123258, - ["point"] = "TOPLEFT", - ["color"] = {["r"] = 0.81, ["g"] = 0.85, ["b"] = 0.1}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Power Infusion - ["enabled"] = true, - ["id"] = 10060, - ["point"] = "RIGHT", - ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Guardian Spirit - ["enabled"] = true, - ["id"] = 47788, - ["point"] = "LEFT", - ["color"] = {["r"] = 0.86, ["g"] = 0.44, ["b"] = 0}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Pain Suppression - ["enabled"] = true, - ["id"] = 33206, - ["point"] = "LEFT", - ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - }, - DRUID = { - {-- Rejuvenation - ["enabled"] = true, - ["id"] = 774, - ["point"] = "TOPRIGHT", - ["color"] = {["r"] = 0.8, ["g"] = 0.4, ["b"] = 0.8}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Regrowth - ["enabled"] = true, - ["id"] = 8936, - ["point"] = "BOTTOMLEFT", - ["color"] = {["r"] = 0.2, ["g"] = 0.8, ["b"] = 0.2}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Lifebloom - ["enabled"] = true, - ["id"] = 33763, - ["point"] = "TOPLEFT", - ["color"] = {["r"] = 0.4, ["g"] = 0.8, ["b"] = 0.2}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Wild Growth - ["enabled"] = true, - ["id"] = 48438, - ["point"] = "BOTTOMRIGHT", - ["color"] = {["r"] = 0.8, ["g"] = 0.4, ["b"] = 0}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - }, - PALADIN = { - {-- Beacon of Light - ["enabled"] = true, - ["id"] = 53563, - ["point"] = "TOPRIGHT", - ["color"] = {["r"] = 0.7, ["g"] = 0.3, ["b"] = 0.7}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Hand of Protection - ["enabled"] = true, - ["id"] = 1022, - ["point"] = "BOTTOMRIGHT", - ["color"] = {["r"] = 0.2, ["g"] = 0.2, ["b"] = 1}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Hand of Freedom - ["enabled"] = true, - ["id"] = 1044, - ["point"] = "BOTTOMRIGHT", - ["color"] = {["r"] = 0.89, ["g"] = 0.45, ["b"] = 0}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Hand of Salvation - ["enabled"] = true, - ["id"] = 1038, - ["point"] = "BOTTOMRIGHT", - ["color"] = {["r"] = 0.93, ["g"] = 0.75, ["b"] = 0}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Hand of Sacrifice - ["enabled"] = true, - ["id"] = 6940, - ["point"] = "BOTTOMRIGHT", - ["color"] = {["r"] = 0.89, ["g"] = 0.1, ["b"] = 0.1}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Hand of Purity - ["enabled"] = true, - ["id"] = 114039, - ["point"] = "BOTTOMRIGHT", - ["color"] = {["r"] = 0.64, ["g"] = 0.41, ["b"] = 0.72}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Sacred Shield - ["enabled"] = true, - ["id"] = 20925, - ["point"] = "TOPLEFT", - ["color"] = {["r"] = 0.93, ["g"] = 0.75, ["b"] = 0}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Eternal Flame - ["enabled"] = true, - ["id"] = 114163, - ["point"] = "BOTTOMLEFT", - ["color"] = {["r"] = 0.87, ["g"] = 0.7, ["b"] = 0.03}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - }, - SHAMAN = { - {-- Riptide - ["enabled"] = true, - ["id"] = 61295, - ["point"] = "TOPRIGHT", - ["color"] = {["r"] = 0.7, ["g"] = 0.3, ["b"] = 0.7}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Earth Shield - ["enabled"] = true, - ["id"] = 974, - ["point"] = "BOTTOMLEFT", - ["color"] = {["r"] = 0.2, ["g"] = 0.7, ["b"] = 0.2}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Earthliving - ["enabled"] = true, - ["id"] = 51945, - ["point"] = "BOTTOMRIGHT", - ["color"] = {["r"] = 0.7, ["g"] = 0.4, ["b"] = 0.4}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - }, - MONK = { - {--Renewing Mist - ["enabled"] = true, - ["id"] = 119611, - ["point"] = "TOPLEFT", - ["color"] = {["r"] = 0.8, ["g"] = 0.4, ["b"] = 0.8}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Life Cocoon - ["enabled"] = true, - ["id"] = 116849, - ["point"] = "TOPRIGHT", - ["color"] = {["r"] = 0.2, ["g"] = 0.8, ["b"] = 0.2}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Enveloping Mist - ["enabled"] = true, - ["id"] = 132120, - ["point"] = "BOTTOMLEFT", - ["color"] = {["r"] = 0.4, ["g"] = 0.8, ["b"] = 0.2}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Zen Sphere - ["enabled"] = true, - ["id"] = 124081, - ["point"] = "BOTTOMRIGHT", - ["color"] = {["r"] = 0.7, ["g"] = 0.4, ["b"] = 0}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - }, - ROGUE = { - {-- Tricks of the Trade - ["enabled"] = true, - ["id"] = 57934, - ["point"] = "TOPRIGHT", - ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - }, - MAGE = { - {-- Ice Ward - ["enabled"] = true, - ["id"] = 111264, - ["point"] = "TOPLEFT", - ["color"] = {["r"] = 0.2, ["g"] = 0.2, ["b"] = 1}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - }, - WARRIOR = { - {-- Vigilance - ["enabled"] = true, - ["id"] = 114030, - ["point"] = "TOPLEFT", - ["color"] = {["r"] = 0.2, ["g"] = 0.2, ["b"] = 1}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Intervene - ["enabled"] = true, - ["id"] = 3411, - ["point"] = "TOPRIGHT", - ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Safe Guard - ["enabled"] = true, - ["id"] = 114029, - ["point"] = "TOPRIGHT", - ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - }, - DEATHKNIGHT = { - {-- Unholy Frenzy - ["enabled"] = true, - ["id"] = 49016, - ["point"] = "TOPRIGHT", - ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - }, -} - -local PET_WATCH = { - {-- Frenzy - ["enabled"] = true, - ["id"] = 19615, - ["point"] = "TOPLEFT", - ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Mend Pet - ["enabled"] = true, - ["id"] = 136, - ["point"] = "TOPRIGHT", - ["color"] = {["r"] = 0.2, ["g"] = 0.8, ["b"] = 0.2}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, -} - -local FilterIDs = { - ["Blocked"] = [[36900,36901,36893,114216,97821,36032,132365,8733,57724,25771,57723,36032,58539,26013,6788,71041,41425,55711,8326,23445,24755,25163,80354,95809,95223,124275,124274,124273,117870,123981,15007,113942,89140]], - - ["Allowed"] = [[31821,2825,32182,80353,90355,47788,33206,116849,22812,1490,116202,123059,136431,137332,137375,144351,142863,142864,142865,143198]], - - ["Strict"] = [[123059,136431,137332,137375,144351,142863,142864,142865,143198]], - - ["CC"] = [[47476,91800,91807,91797,108194,115001,33786,2637,339,78675,22570,5211,9005,102359,99,127797,45334,102795,114238,113004,3355,1513,19503,34490,24394,64803,19386,117405,128405,50519,91644,90337,54706,4167,90327,56626,50245,50541,96201,96201,31661,118,55021,122,82691,118271,44572,33395,102051,20066,10326,853,105593,31935,105421,605,64044,8122,9484,15487,114404,88625,113792,87194,2094,1776,6770,1833,51722,1330,408,88611,115197,113953,51514,64695,63685,76780,118905,118345,710,6789,118699,5484,6358,30283,24259,115782,115268,118093,89766,137143,20511,7922,676,105771,107566,132168,107570,118895,18498,116706,117368,115078,122242,119392,119381,120086,116709,123407,140023,25046,20549,107079]], - - ["Shield"] = [[17,47515,45243,45438,115610,48797,48792,49039,87256,55233,50461,33206,47788,62618,47585,104773,110913,108359,22812,102342,106922,61336,19263,53480,1966,31224,74001,5277,45182,98007,30823,108271,1022,6940,114039,31821,498,642,86659,31850,118038,55694,97463,12975,114029,871,114030,120954,131523,122783,122278,115213,116849,20594]], - - ["Player"] = [[17,47515,45243,45438,45438,115610,110909,12051,12472,80353,12042,32612,110960,108839,111264,108843,48797,48792,49039,87256,49222,55233,50461,49016,51271,96268,33206,47788,62618,47585,6346,10060,114239,119032,27827,104773,110913,108359,113860,113861,113858,88448,22812,102342,106922,61336,117679,102543,102558,102560,16689,132158,106898,1850,106951,29166,52610,69369,112071,124974,19263,53480,51755,54216,34471,3045,3584,131894,90355,90361,31224,74001,5277,45182,51713,114018,2983,121471,11327,108212,57933,79140,13750,98007,30823,108271,16188,2825,79206,16191,8178,58875,108281,108271,16166,114896,1044,1022,1038,6940,114039,31821,498,642,86659,20925,31850,31884,53563,31842,54428,105809,85499,118038,55694,97463,12975,114029,871,114030,18499,1719,23920,114028,46924,3411,107574,120954,131523,122783,122278,115213,116849,125174,116841,20594,59545,20572,26297,68992]], - - ["Raid"] = [[116281,116784,116417,116942,116161,117708,118303,118048,118135,117878,117949,116835,116778,116525,122761,122760,122740,123812,123180,123474,122835,123081,122125,121885,121949,117436,118091,117519,122752,123011,116161,123121,119985,119086,119775,122151,138349,137371,136767,137641,137359,137972,136903,136753,137633,137731,133767,133768,136050,138569,134691,137440,137408,137360,135000,143436,143579,147383,146124,144851,144358,144774,147207,144215,143990,144330,143494,142990,143919,143766,143773,146589,143777,143385,143974,145183]] -} - -local FilterOverrides = { - ["45438"] = 5, ["48797"] = 5, ["87256"] = 4, - ["33206"] = 3, ["47585"] = 5, ["22812"] = 2, - ["102342"] = 2, ["19263"] = 5, ["5277"] = 5, - ["1022"] = 5, ["31821"] = 3, ["498"] = 2, - ["642"] = 5, ["86659"] = 4, ["31850"] = 4, - ["118038"] = 5, ["114029"] = 2, ["871"] = 3, - ["120954"] = 2, ["131523"] = 5 -} - -local FilterDefaults = { - ["CC"] = {}, - ["Shield"] = {}, - ["Player"] = {}, - ["Blocked"] = {}, - ["Allowed"] = {}, - ["Strict"] = {}, - ["Raid"] = {}, -} - -local function safename(id) - local n = GetSpellInfo(id) - if not n then - if type(id) == "string" then - n = id - else - print('|cffFF9900SVUI:|r Spell not found: (#ID) '..id) - n = "Voodoo Doll"; - end - end - return n -end - -for k, x in pairs(FilterIDs) do - local src = {}; - for id in gmatch(x, '([^,]+)') do - if(id) then - local saved - local n = safename(id); - local p = FilterOverrides[tostring(id)] or 0; - if k == "Strict" then - saved = {['enable'] = true, ['spellID'] = id, ['priority'] = p} - else - saved = {['enable'] = true, ['priority'] = p} - end - src[n] = saved - end - end - FilterDefaults[k] = src -end - -FilterDefaults['BuffWatch'] = CLASS_WATCH_INDEX -FilterDefaults['PetBuffWatch'] = PET_WATCH - -local function removedefaults(db, src, nometa) - if(type(src) ~= "table") then return end - if(not nometa) then - setmetatable(db, nil) - end - for k,v in pairs(src) do - if type(v) == "table" and type(db[k]) == "table" then - removedefaults(db[k], v, nometa) - if next(db[k]) == nil then - db[k] = nil - end - else - if db[k] == src[k] then - db[k] = nil - end - end - end -end - -local function SanitizeDatabase() - local sv = _G["SVUI_AuraFilters"] - local dv = FilterDefaults - for k,v in pairs(sv) do - removedefaults(sv[k], dv[k]) - end -end - -local LogOut_OnEvent = function(self, event) - if event == "PLAYER_LOGOUT" then - SanitizeDatabase() - end -end - -local METAFILTERS = function(sv, db) - for k, x in pairs(FilterIDs) do - if (not sv[k]) then - sv[k] = {} - for id in gmatch(x, '([^,]+)') do - if(id) then - local saved - local n = safename(id); - local p = FilterOverrides[tostring(id)] or 0; - if k == "Strict" then - saved = {['enable'] = true, ['spellID'] = id, ['priority'] = p} - else - saved = {['enable'] = true, ['priority'] = p} - end - sv[k][n] = saved - end - end - end - end - sv['BuffWatch'] = db['BuffWatch'] or CLASS_WATCH_INDEX - sv['PetBuffWatch'] = db['PetBuffWatch'] or PET_WATCH - return sv -end - -function SuperVillain:ChangeFilter(k, id, v) - local name = safename(id) - if (not self.Filters[k]) then self.Filters[k] = {} end - self.Filters[k][name] = tcopy(v) -end - -function SuperVillain:SetFilterObjects(init) - if(init) then - self.Filters = FilterDefaults - else - local sv = _G["SVUI_AuraFilters"] - local db = _G["SVUI_AuraWatch"] - self.Filters = METAFILTERS(sv, db) - - logoutListener:RegisterEvent("PLAYER_LOGOUT") - logoutListener:SetScript("OnEvent", LogOut_OnEvent) - end -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/system.lua b/Interface/AddOns/SVUI/system/system.lua index 36f5f29..acd9077 100644 --- a/Interface/AddOns/SVUI/system/system.lua +++ b/Interface/AddOns/SVUI/system/system.lua @@ -51,8 +51,7 @@ local tremove, tcopy, twipe, tsort, tconcat, tdump = table.remove, table.copy, t GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L, G = unpack(select(2, ...)); -SuperVillain.Shared = LibStub("LibSharedMedia-3.0") +local SuperVillain, L, G = unpack(select(2, ...)) --[[ ########################################################## LOCALS @@ -64,11 +63,38 @@ local rez = GetCVar("gxResolution"); local gxHeight = tonumber(match(rez,"%d+x(%d+)")); local gxWidth = tonumber(match(rez,"(%d+)x%d+")); local NewHook = hooksecurefunc; +local version = GetAddOnMetadata(..., "Version"); --[[ ########################################################## SET MANY VARIABLES ########################################################## ]]-- +SuperVillain.db = {} +SuperVillain.snaps = {} +SuperVillain.Media = {} +SuperVillain.DisplayAudit = {} +SuperVillain.DynamicOptions = {} +SuperVillain.Dispellable = {} + +SuperVillain.fubar = function() return end +SuperVillain.Options = { type = "group", name = "|cff339fffConfig-O-Matic|r", args = {} }; + +SuperVillain.class = toonClass; +SuperVillain.mult = 1; +SuperVillain.ClassRole = ""; +SuperVillain.name = UnitName("player"); +SuperVillain.realm = GetRealmName(); +SuperVillain.build = tonumber(bld); +SuperVillain.guid = UnitGUID('player'); +SuperVillain.ConfigurationMode = false; + +SuperVillain.snaps[#SuperVillain.snaps + 1] = SuperVillain.UIParent; +SuperVillain.UIParent = CreateFrame("Frame", "SVUIParent", UIParent); +SuperVillain.UIParent:SetFrameLevel(UIParent:GetFrameLevel()); +SuperVillain.UIParent:SetPoint("CENTER", UIParent, "CENTER"); +SuperVillain.UIParent:SetSize(UIParent:GetSize()); +SuperVillain.Cloaked = CreateFrame("Frame", nil, UIParent); +SuperVillain.Cloaked:Hide(); local SVUISystemEventHandler = CreateFrame("Frame", "SVUISystemEventHandler") --[[ ########################################################## @@ -179,20 +205,6 @@ end SYSTEM FUNCTIONS ########################################################## ]]-- -function SuperVillain:TableSplice(targetTable, mergeTable) - if type(targetTable) ~= "table" then targetTable = {} end - - if type(mergeTable) == 'table' then - for key,val in pairs(mergeTable) do - if type(val) == "table" then - val = self:TableSplice(targetTable[key], val) - end - targetTable[key] = val - end - end - return targetTable -end - function SuperVillain:StaticPopup_Show(arg) if arg == "ADDON_ACTION_FORBIDDEN" then StaticPopup_Hide(arg) @@ -816,7 +828,7 @@ function SuperVillain:Launch() _G["SVUI_MentaloPrecision"]:SetPanelTemplate("Transparent") if self.db.system.loginmessage then - self:AddonMessage(format(L["LOGIN_MSG"], "|cffffcc1a", "|cffff801a", self.version)); + self:AddonMessage((L["LOGIN_MSG"]):format("|cffffcc1a", "|cffff801a", self.version)); end self.AddonLaunched = true @@ -897,7 +909,7 @@ SVUISystemEventHandler:SetScript("OnEvent", SVUISystem_OnEvent) -- Load/Creation Handling local LoadEventHandler = CreateFrame("Frame", nil) -local function LoadEventHandler_OnEvent(self, event, arg1) +local LoadEventHandler_OnEvent = function(self, event, arg1) if (event == "ADDON_LOADED" and arg1 ~= "Blizzard_DebugTools") or event == "PLAYER_LOGIN" then local actionsTaken = false if(not SuperVillain.AddonLoaded) then @@ -908,10 +920,10 @@ local function LoadEventHandler_OnEvent(self, event, arg1) SuperVillain:Launch() actionsTaken = true end - if(not actionsTaken) then - self:UnregisterEvent("ADDON_LOADED") - self:UnregisterEvent("PLAYER_LOGIN") - end + -- if(not actionsTaken) then + -- self:UnregisterEvent("ADDON_LOADED") + -- self:UnregisterEvent("PLAYER_LOGIN") + -- end end end diff --git a/Interface/AddOns/SVUI/system/templates.lua b/Interface/AddOns/SVUI/system/templates.lua index 19e205a..d0aa137 100644 --- a/Interface/AddOns/SVUI/system/templates.lua +++ b/Interface/AddOns/SVUI/system/templates.lua @@ -122,9 +122,9 @@ local function MUNG(self) self:UnregisterAllEvents() self:SetParent(MUNGFRAME) else + self:Hide() self.Show = SuperVillain.fubar end - self:Hide() end local function Formula409(self, option) diff --git a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc index 3c6276e..136fef4 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc +++ b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc @@ -1,6 +1,6 @@ ## Interface: 50400 ## Author: Munglunch, Elv -## Version: 4.074 +## Version: 4.076 ## Title: |cffFF9900SVUI |r|cffFFEF00Config O Matic|r ## Notes: Supervillain UI [|cff9911FFConfig Options|r] ## RequiredDeps: SVUI diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/bag.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/bag.lua index 8db9513..8743824 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/bag.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/bag.lua @@ -30,14 +30,23 @@ GET ADDON DATA ########################################################## ]]-- local SuperVillain, L = unpack(SVUI); + local MOD = SuperVillain.SVBag -SuperVillain.Options.args.SVBag={ - type='group', - name=L['Bags'], - childGroups="tab", - get=function(a)return SuperVillain.db.SVBag[a[#a]]end, - set=function(a,b)MOD:ChangeDBVar(b,a[#a]) end, - args={ + +local pointList = { + ["TOPLEFT"] = "TOPLEFT", + ["TOPRIGHT"] = "TOPRIGHT", + ["BOTTOMLEFT"] = "BOTTOMLEFT", + ["BOTTOMRIGHT"] = "BOTTOMRIGHT", +} + +SuperVillain.Options.args.SVBag = { + type = 'group', + name = L['Bags'], + childGroups = "tab", + get = function(a)return SuperVillain.db.SVBag[a[#a]]end, + set = function(a,b)MOD:ChangeDBVar(b,a[#a]) end, + args = { intro = { order = 1, type = "description", @@ -52,14 +61,15 @@ SuperVillain.Options.args.SVBag={ set = function(a,b)SuperVillain.db.SVBag.enable = b;SuperVillain:StaticPopup_Show("RL_CLIENT")end }, bagGroups={ - order=3, - type='group', - name=L['Bag Options'], - childGroups="tree", - args={ + order = 3, + type = 'group', + name = L['Bag Options'], + guiInline = true, + args = { common={ - order = 4, - type = "group", + order = 1, + type = "group", + guiInline = true, name = L["General"], disabled = function()return not SuperVillain.db.SVBag.enable end, args = { @@ -89,15 +99,8 @@ SuperVillain.Options.args.SVBag={ name = L["Sort Inverted"], desc = L["Direction the bag sorting will use to allocate the items."] }, - alignToChat = { - order = 4, - type = "toggle", - name = L["Align To Chat"], - desc = L["Align the width of the bag frame to fit inside the chat box."], - set = function(a,b)MOD:ChangeDBVar(b,a[#a])MOD:Layout()MOD:Layout(true)end - }, bagWidth = { - order = 5, + order = 4, type = "range", name = L["Panel Width (Bags)"], desc = L["Adjust the width of the bag frame."], @@ -108,7 +111,7 @@ SuperVillain.Options.args.SVBag={ disabled = function()return SuperVillain.db.SVBag.alignToChat end }, bankWidth = { - order = 6, + order = 5, type = "range", name = L["Panel Width (Bank)"], desc = L["Adjust the width of the bank frame."], @@ -118,26 +121,8 @@ SuperVillain.Options.args.SVBag={ set = function(a,b)MOD:ChangeDBVar(b,a[#a])MOD:Layout(true)end, disabled = function()return SuperVillain.db.SVBag.alignToChat end }, - xOffset = { - order = 7, - type = "range", - name = L["X Offset"], - min = -5, - max = 600, - step = 1, - set = function(a,b)MOD:ChangeDBVar(b,a[#a])MOD:ModifyBags()end - }, - yOffset = { - order = 8, - type = "range", - name = L["Y Offset"], - min = 0, - max = 600, - step = 1, - set = function(a,b)MOD:ChangeDBVar(b,a[#a])MOD:ModifyBags()end - }, currencyFormat = { - order = 9, + order = 6, type = "select", name = L["Currency Format"], desc = L["The display format of the currency icons that get displayed below the main bag. (You have to be watching a currency for this to display)"], @@ -148,7 +133,7 @@ SuperVillain.Options.args.SVBag={ set = function(a,b)MOD:ChangeDBVar(b,a[#a])MOD:RefreshTokens()end }, bagTools = { - order = 10, + order = 7, type = "toggle", name = L["Profession Tools"], desc = L["Enable/Disable Prospecting, Disenchanting and Milling buttons on the bag frame."], @@ -165,10 +150,98 @@ SuperVillain.Options.args.SVBag={ } } }, + position = { + order = 2, + type = "group", + guiInline = true, + name = L["Bag/Bank Positioning"], + disabled = function()return not SuperVillain.db.SVBag.enable end, + args = { + alignToChat = { + order = 1, + type = "toggle", + name = L["Align To Chat"], + desc = L["Align the width of the bag frame to fit inside the chat box."], + set = function(a,b)MOD:ChangeDBVar(b,a[#a])MOD:Layout()MOD:Layout(true)end + }, + bags = { + order = 2, + type = "group", + name = L["Bag Position"], + guiInline = true, + get = function(key) return SuperVillain.db.SVBag.bags[key[#key]] end, + set = function(key, value) MOD:ChangeDBVar(value, key[#key], "bags"); MOD:ModifyBags() end, + disabled = function() return not SuperVillain.db.SVBag.enable end, + args = { + point = { + order = 1, + name = L["Anchor Point"], + type = "select", + values = pointList, + }, + xOffset = { + order = 2, + type = "range", + name = L["X Offset"], + width = "full", + min = -600, + max = 600, + step = 1, + }, + yOffset = { + order = 3, + type = "range", + name = L["Y Offset"], + width = "full", + min = -600, + max = 600, + step = 1, + }, + } + }, + bank = { + order = 3, + type = "group", + name = L["Bank Position"], + guiInline = true, + get = function(key) return SuperVillain.db.SVBag.bank[key[#key]] end, + set = function(key, value) MOD:ChangeDBVar(value, key[#key], "bank"); MOD:ModifyBags() end, + disabled = function() return not SuperVillain.db.SVBag.enable end, + args = { + point = { + order = 1, + name = L["Anchor Point"], + type = "select", + values = pointList, + }, + xOffset = { + order = 2, + type = "range", + name = L["X Offset"], + width = "full", + min = -600, + max = 600, + step = 1, + }, + yOffset = { + order = 3, + type = "range", + name = L["Y Offset"], + width = "full", + min = -600, + max = 600, + step = 1, + }, + } + }, + } + }, + bagBar={ - order=5, + order=4, type="group", name=L["Bag-Bar"], + guiInline = true, get=function(a)return SuperVillain.db.SVBag.bagBar[a[#a]]end, set=function(a,b)SuperVillain.db.SVBag.bagBar[a[#a]]=b;MOD:ModifyBagBar()end, args={ diff --git a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua index de9121b..3b00f54 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua @@ -42,22 +42,8 @@ local SuperVillain, L = unpack(SVUI); local NewHook = hooksecurefunc; local SVUIAddonEventHandler = CreateFrame("Frame", "SVUIAddonEventHandler") local version = GetAddOnMetadata(..., "Version"); -local rootstring = function(self) return self.__namekey end -local function SetAddonObject() - local obj = {} - obj.__namekey = SVUIAddOnName - obj.version = version - 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 -StyleVillain = SetAddonObject() +StyleVillain = SuperVillain:Prototype(SVUIAddOnName, version) _G["StyleVillain"] = StyleVillain; --[[ @@ -561,92 +547,7 @@ function StyleVillain:SetConfigOptions() addons = StyleVillain.OptionsCache } } -end; - -local defaults = { - ["SVStyle"] = { - ["blizzard"] = { - ["enable"] = true, - ["bags"] = true, - ["bmah"] = true, - ["reforge"] = true, - ["calendar"] = true, - ["achievement"] = true, - ["lfguild"] = true, - ["inspect"] = true, - ["binding"] = true, - ["gbank"] = true, - ["archaeology"] = true, - ["guildcontrol"] = true, - ["gossip"] = true, - ["guild"] = true, - ["tradeskill"] = true, - ["raid"] = false, - ["talent"] = true, - ["auctionhouse"] = true, - ["barber"] = true, - ["macro"] = true, - ["debug"] = true, - ["trainer"] = true, - ["socket"] = true, - ["loot"] = true, - ["alertframes"] = true, - ["bgscore"] = true, - ["merchant"] = true, - ["mail"] = true, - ["help"] = true, - ["trade"] = true, - ["gossip"] = true, - ["greeting"] = true, - ["worldmap"] = true, - ["taxi"] = true, - ["quest"] = true, - ["petition"] = true, - ["dressingroom"] = true, - ["pvp"] = true, - ["lfg"] = true, - ["nonraid"] = true, - ["friends"] = true, - ["spellbook"] = true, - ["character"] = true, - ["misc"] = true, - ["tabard"] = true, - ["guildregistrar"] = true, - ["timemanager"] = true, - ["encounterjournal"] = true, - ["voidstorage"] = true, - ["transmogrify"] = true, - ["stable"] = true, - ["bgmap"] = true, - ["mounts"] = true, - ["petbattleui"] = true, - ["losscontrol"] = true, - ["itemUpgrade"] = true, - }, - ["addons"] = { - ["enable"] = true, - ["Skada"] = true, - ["Recount"] = true, - ["AuctionLite"] = true, - ["AtlasLoot"] = true, - ["SexyCooldown"] = true, - ["Lightheaded"] = true, - ["Outfitter"] = true, - ["WeakAuras"] = true, - ["Quartz"] = true, - ["TomTom"] = true, - ["TinyDPS"] = true, - ["Clique"] = true, - ["CoolLine"] = true, - ["ACP"] = true, - ["DXE"] = true, - ["MogIt"] = true, - ["alDamageMeter"] = true, - ["Omen"] = true, - ["TradeSkillDW"] = true, - } - }, -} +end local RegisterAddonDocklets = function() local MAIN = _G["SuperDockletMain"]; @@ -742,7 +643,6 @@ BUILD FUNCTION ########################################################## ]]-- local function LoadStyleOMatic() - SuperVillain.db:Append(defaults) local alert = CreateFrame('Frame', nil, UIParent); alert:SetFixedPanelTemplate('Transparent'); alert:SetSize(250, 70); diff --git a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc index b38efdc..8e2e24c 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc +++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc @@ -1,6 +1,6 @@ ## Interface: 50400 ## Author: Munglunch, Azilroka, Sortokk -## Version: 4.074 +## Version: 4.076 ## Title: |cffFF9900SVUI |r|cffFFEF00Style O Matic|r ## Notes: Supervillain UI [|cff9911FFAddon Skins|r]. ## RequiredDeps: SVUI diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/pvp.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/pvp.lua index 20c3297..f529b9a 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/pvp.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/pvp.lua @@ -23,7 +23,7 @@ PVP STYLER -- LoadAddOn("Blizzard_PVPUI") local function PVPFrameStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.pvp ~= true then + if (SuperVillain.db.SVStyle and (SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.pvp ~= true)) then return end; PVPUIFrame:Formula409() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/timemanager.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/timemanager.lua index 7317137..906cb8a 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/timemanager.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/timemanager.lua @@ -21,9 +21,9 @@ TIMEMANAGER STYLER ########################################################## ]]-- local function TimeManagerStyle() - if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.timemanager ~= true then - return - end; + -- if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.timemanager ~= true then + -- return + -- end; TimeManagerFrame:Formula409() TimeManagerFrame:SetPanelTemplate("Action", false) STYLE:ApplyCloseButtonStyle(TimeManagerFrameCloseButton) diff --git a/Interface/BUTTONS/Thumbs.db b/Interface/BUTTONS/Thumbs.db new file mode 100644 index 0000000..9a524d6 Binary files /dev/null and b/Interface/BUTTONS/Thumbs.db differ diff --git a/Interface/GLUES/COMMON/Thumbs.db b/Interface/GLUES/COMMON/Thumbs.db new file mode 100644 index 0000000..f45b1b0 Binary files /dev/null and b/Interface/GLUES/COMMON/Thumbs.db differ diff --git a/Interface/TAXIFRAME/Thumbs.db b/Interface/TAXIFRAME/Thumbs.db new file mode 100644 index 0000000..544aded Binary files /dev/null and b/Interface/TAXIFRAME/Thumbs.db differ diff --git a/Interface/Tooltips/Thumbs.db b/Interface/Tooltips/Thumbs.db new file mode 100644 index 0000000..60da366 Binary files /dev/null and b/Interface/Tooltips/Thumbs.db differ