diff --git a/Interface/AddOns/SVUI/SVUI.lua b/Interface/AddOns/SVUI/SVUI.lua index 0ffd426..0fd2bbc 100644 --- a/Interface/AddOns/SVUI/SVUI.lua +++ b/Interface/AddOns/SVUI/SVUI.lua @@ -204,7 +204,7 @@ local Core_ResetUI = function(self, confirmed) self:StaticPopup_Show('RESETMOVERS_CHECK') return end - self:ResetMovables() + self.Mentalo:Reset() end local Core_ImportProfile = function(self, key) diff --git a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/LibSuperVillain-1.0.lua b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/LibSuperVillain-1.0.lua index 0f9e497..b790c2e 100644 --- a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/LibSuperVillain-1.0.lua +++ b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/LibSuperVillain-1.0.lua @@ -101,6 +101,10 @@ local PluginString = "" local AllowedIndexes, Modules, LoadOnDemand = {},{},{}; local Callbacks, ModuleQueue, ScriptQueue = {},{},{}; +AllowedIndexes.G = {} +AllowedIndexes.C = {} +AllowedIndexes.P = {} + local playerClass = select(2,UnitClass("player")); local INFO_FORMAT = "|cffFFFF00%s|r\n |cff33FF00Version: %s|r |cff0099FFby %s|r"; @@ -490,10 +494,15 @@ function lib:UpdateDatabase(event) end end for k,v in pairs(CACHE_SV) do - if(not AllowedIndexes[k]) then + if(not AllowedIndexes.C[k]) then CACHE_SV[k] = nil end end + for k,v in pairs(GLOBAL_SV) do + if(not AllowedIndexes.G[k]) then + GLOBAL_SV[k] = nil + end + end elseif(event == "ACTIVE_TALENT_GROUP_CHANGED") then if(PROFILE_SV.SAFEDATA and PROFILE_SV.SAFEDATA.dualSpecEnabled) then SOURCE_KEY = GetSpecialization() or 1 @@ -535,13 +544,22 @@ end function lib:NewCache(index) index = index or CoreObject.Schema - AllowedIndexes[index] = true + AllowedIndexes.C[index] = true if(not CACHE_SV[index]) then CACHE_SV[index] = {} end return CACHE_SV[index] end +function lib:NewGlobal(index) + index = index or CoreObject.Schema + AllowedIndexes.G[index] = true + if(not GLOBAL_SV[index]) then + GLOBAL_SV[index] = {} + end + return GLOBAL_SV[index] +end + --[[ /$$$$$$$ /$$ /$$ | $$__ $$ |__/ | $$ @@ -766,7 +784,7 @@ function lib:NewPackage(obj, schema, defaults) ModuleQueue[#ModuleQueue+1] = schema Modules[#Modules+1] = schema - AllowedIndexes[schema] = true + AllowedIndexes.P[schema] = true CoreObject[schema] = SetInternalModule(obj, schema) @@ -983,6 +1001,9 @@ function lib:Initialize() GLOBAL_SV.profileKeys[k] = k end + AllowedIndexes.G["profileKeys"] = true + AllowedIndexes.G["profiles"] = true + --CACHE SAVED VARIABLES if not _G[CACHE_FILENAME] then _G[CACHE_FILENAME] = {} end CACHE_SV = _G[CACHE_FILENAME] @@ -1020,7 +1041,7 @@ function lib:Initialize() tablecopy(v, PROFILE_SV.STORED[1][coreSchema]) elseif(k == "media" or k == "filter") then PROFILE_SV.STORED[1][coreSchema][k] = v - elseif(AllowedIndexes[k]) then + elseif(AllowedIndexes.P[k]) then PROFILE_SV.STORED[1][k] = v end end diff --git a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua index 17e1654..d4760f7 100644 --- a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua +++ b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua @@ -298,7 +298,7 @@ function MOD:RestrictChildren(parentFrame, ...) end function MOD:ResetUnitOptions(unit) - self.db:Reset(unit) + SV:ResetData("SVUnit", unit) self:RefreshUnitFrames() end diff --git a/Interface/AddOns/SVUI/system/load.lua b/Interface/AddOns/SVUI/system/load.lua index e273a06..75432d1 100644 --- a/Interface/AddOns/SVUI/system/load.lua +++ b/Interface/AddOns/SVUI/system/load.lua @@ -97,7 +97,7 @@ function SV:Load() SVLib:Initialize() - self.DisplaySettings = SVLib:NewCache("Display") + self.DisplaySettings = SVLib:NewGlobal("Display") if(not self.DisplaySettings.screenheight or (self.DisplaySettings.screenheight and type(self.DisplaySettings.screenheight) ~= "number")) then self.DisplaySettings.screenheight = gxHeight end diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/bar.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/bar.lua index 056aabd..dfdb9f7 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/bar.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/bar.lua @@ -82,7 +82,7 @@ local function BarConfigLoader() name = L["Restore Bar"], desc = L["Restore the actionbars default settings"], func = function() - MOD.db:Reset("Bar"..d) + SV:ResetData("SVBar", "Bar"..d) SV.Mentalo:Reset("Bar "..d) MOD:RefreshBar("Bar"..d) end, @@ -175,7 +175,7 @@ local function BarConfigLoader() name = L["Restore Defaults"], desc = L["Restore default paging attributes for this bar"], func = function() - MOD.db:Reset("Bar"..d, "customPaging") + SV:ResetData("SVBar", "Bar"..d, "customPaging") MOD:UpdateBarPagingDefaults(); MOD:RefreshBar("Bar"..d) end @@ -214,7 +214,7 @@ local function BarConfigLoader() name = L["Restore Defaults"], desc = L["Restore default visibility attributes for this bar"], func = function() - MOD.db:Reset("Bar"..d, "customVisibility") + SV:ResetData("SVBar", "Bar"..d, "customVisibility") MOD:UpdateBarPagingDefaults(); MOD:RefreshBar("Bar"..d) end @@ -328,7 +328,7 @@ local function BarConfigLoader() name = L["Restore Bar"], desc = L["Restore the actionbars default settings"], func = function() - MOD.db:Reset("Pet") + SV:ResetData("SVBar", "Pet") SV.Mentalo:Reset("Pet Bar") MOD:RefreshBar("Pet") end, @@ -421,7 +421,7 @@ local function BarConfigLoader() name = L["Restore Defaults"], desc = L["Restore default visibility attributes for this bar"], func = function() - MOD.db:Reset("Pet", "customVisibility") + SV:ResetData("SVBar", "Pet", "customVisibility") MOD:RefreshBar("Pet") end }, @@ -593,7 +593,7 @@ local function BarConfigLoader() name = L["Restore Defaults"], desc = L["Restore default visibility attributes for this bar"], func = function() - MOD.db:Reset("Stance", "customVisibility") + SV:ResetData("SVBar", "Stance", "customVisibility") MOD:RefreshBar("Stance") end }, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua index 8a100f8..e863f9a 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua @@ -164,7 +164,8 @@ function ns:SetCastbarConfigGroup(updateFunction, unitName, count) width = "full", min = 50, max = 600, - step = 1 + step = 1, + disabled = function() return SV.db.SVUnit[unitName]["castbar"].matchFrameWidth end }, height = { order = 4,