diff --git a/SVUI_!Core/libs/_SVUI_Lib/Registry.lua b/SVUI_!Core/libs/_SVUI_Lib/Registry.lua index 9704c6e..7c61247 100644 --- a/SVUI_!Core/libs/_SVUI_Lib/Registry.lua +++ b/SVUI_!Core/libs/_SVUI_Lib/Registry.lua @@ -159,23 +159,25 @@ local function tablecopy(d, s, debug) end end -local function sharedcopy(d, s, debug) - if(debug) then - print(debug) - assert(type(s) == "table", "sharedcopy ERROR: source (" .. debug .. ") is not a table") - assert(type(d) == "table", "sharedcopy ERROR: destination (" .. debug .. ") is not a table") - end - if(type(s) ~= "table") then return end - if(type(d) ~= "table") then return end - for k, v in pairs(s) do - local saved = rawget(d, k) - if type(v) == "table" then - if not saved then rawset(d, k, {}) end - if(debug) then debug = k end - sharedcopy(d[k], v, debug) - elseif(saved == nil or (saved and type(saved) ~= type(v))) then - rawset(d, k, v) - end +local function sharedcopy(d, s) + if((type(d) == "table") and (type(s) == "table")) then + for k, v in pairs(s) do + local saved = rawget(d, k) + if(type(v) == "table") then + if(saved == nil) then + rawset(d, k, {}) + sharedcopy(d[k], v) + elseif(type(saved) == "table") then + sharedcopy(d[k], v) + else + rawset(d, k, false) + end + else + rawset(d, k, v) + end + end + else + d = s end end @@ -284,7 +286,7 @@ local meta_database = { __index = function(t, k) if(not k or k == "") then return end local sv = rawget(t, "data") - if(not sv[k]) then sv[k] = {} end + if(sv[k] == nil) then sv[k] = {} end rawset(t, k, sv[k]) return rawget(t, k) end, @@ -292,7 +294,50 @@ local meta_database = { --REGISTRY LOCAL HELPERS -local function LoadingProxy(schema, obj) +local function CopySharedData(key) + if((not key) or (not SHARED_SV.profiles[key])) then return end + local export = SHARED_SV.profiles[key]; + for schema,data in pairs(export) do + local obj = CoreObject[schema]; + if(obj and obj.private) then + sharedcopy(obj.private, data); + end + end +end + +local function SaveSharedData() + for schema,data in pairs(PRIVATE_SV.SAFEDATA.SHARED) do + local obj = CoreObject[schema]; + if(data.enabled and obj and obj.private) then + SHARED_SV.profiles[PROFILE_KEY][schema] = {}; + for k,v in pairs(obj.private) do + if(not data.ignored[k]) then + if(not SHARED_SV.profiles[PROFILE_KEY][schema][k]) then + SHARED_SV.profiles[PROFILE_KEY][schema][k] = {}; + end + local saved = SHARED_SV.profiles[PROFILE_KEY][schema][k]; + sharedcopy(saved, v); + end + end + end + end +end + +local function LoadSharedData(schema,datastore) + if((not schema) or (not datastore)) then return end + local data = PRIVATE_SV.SAFEDATA.SHARED[schema]; + if(data and data.enabled) then + local export = SHARED_SV.profiles[PROFILE_KEY][schema]; + if(not export) then return end + for k,v in pairs(export) do + if(not data.ignored[k]) then + sharedcopy(datastore[k], v); + end + end + end +end + +local function LoadingProxy(schema, obj, loadShared) if(not obj) then print(schema .. ' not found') return end lib.CURRENT_SCHEMA = schema; if(not obj.initialized) then @@ -302,6 +347,9 @@ local function LoadingProxy(schema, obj) CoreObject:HandleError(schema, "Load", catch) else obj.initialized = true + -- if(loadShared and obj.private) then + -- LoadSharedData(schema, obj.private); + -- end end end else @@ -330,42 +378,14 @@ local function OptionsProxy(schema, obj) end end -local function SaveSharedData() - for schema,data in pairs(PRIVATE_SV.SAFEDATA.SHARED) do - local obj = CoreObject[schema]; - if(data.enabled and obj) then - SHARED_SV.profiles[PROFILE_KEY][schema] = {}; - for k,v in pairs(obj.private) do - if(not data.ignored[k]) then - if(not SHARED_SV.profiles[PROFILE_KEY][schema][k]) then - SHARED_SV.profiles[PROFILE_KEY][schema][k] = {}; - end - local saved = SHARED_SV.profiles[PROFILE_KEY][schema][k]; - tablecopy(saved, v); - end - end - end - end -end - -local function LoadSharedData(schema,datastore) - if((not schema) or (not datastore)) then return end - local data = PRIVATE_SV.SAFEDATA.SHARED[schema]; - if(data and data.enabled) then - local export = SHARED_SV.profiles[PROFILE_KEY][schema]; - if(not export) then return end - for k,v in pairs(export) do - if(not data.ignored[k]) then - tablecopy(datastore[k], v); - end - end - end +--OBJECT INTERNALS +local makeSharable = function(self) + self.___canShare = true; end ---OBJECT INTERNALS local isSharingEnabled = function(self) local schema = self.Schema; - if(self.private) then + if(self.private and PRIVATE_SV.SAFEDATA.SHARED[schema]) then return PRIVATE_SV.SAFEDATA.SHARED[schema].enabled; end return false; @@ -381,11 +401,13 @@ local toggleSharedData = function(self, value) end end -local ignoreSharedKey = function(self, key) - if(not key) then return end +local ignoreSharedKeys = function(self, ...) local schema = self.Schema; - if(self.private and self.private[key]) then - PRIVATE_SV.SAFEDATA.SHARED[schema].ignored[key] = true; + if(self.private) then + for i=1,select("#",...) do + local key = select(i,...); + PRIVATE_SV.SAFEDATA.SHARED[schema].ignored[key] = true; + end end end @@ -916,9 +938,10 @@ local Core_NewPlugin = function(self, addonName, addonObject, gfile, pfile) addonObject.LoD = lod addonObject.initialized = false addonObject.CombatLocked = false + addonObject.MakeSharable = makeSharable addonObject.IsSharingEnabled = isSharingEnabled addonObject.ToggleSharedData = toggleSharedData - addonObject.IgnoreSharedKey = ignoreSharedKey + addonObject.IgnoreSharedKeys = ignoreSharedKeys addonObject.ClearPrivateData = clearPrivateDB addonObject.ChangeDBVar = changeDBVar addonObject.RegisterEvent = registerEvent @@ -930,6 +953,7 @@ local Core_NewPlugin = function(self, addonName, addonObject, gfile, pfile) addonObject.private = addonObject.private or {} addonObject.___svfiles = {["PUBLIC"] = gfile, ["PRIVATE"] = pfile} + addonObject.___canShare = false; _G[schema] = addonObject @@ -950,9 +974,10 @@ local Core_NewPackage = function(self, schema, header) Schema = schema, initialized = false, CombatLocked = false, + MakeSharable = makeSharable, IsSharingEnabled = isSharingEnabled, ToggleSharedData = toggleSharedData, - IgnoreSharedKey = ignoreSharedKey, + IgnoreSharedKeys = ignoreSharedKeys, ClearPrivateData = clearPrivateDB, ChangeDBVar = changeDBVar, RegisterEvent = registerEvent, @@ -1010,9 +1035,10 @@ local Core_NewModule = function(self, addonName, addonObject, gfile, pfile) addonObject.LoD = lod addonObject.initialized = false addonObject.CombatLocked = false + addonObject.MakeSharable = makeSharable addonObject.IsSharingEnabled = isSharingEnabled addonObject.ToggleSharedData = toggleSharedData - addonObject.IgnoreSharedKey = ignoreSharedKey + addonObject.IgnoreSharedKeys = ignoreSharedKeys addonObject.ClearPrivateData = clearPrivateDB addonObject.ChangeDBVar = changeDBVar addonObject.RegisterEvent = registerEvent @@ -1024,6 +1050,7 @@ local Core_NewModule = function(self, addonName, addonObject, gfile, pfile) addonObject.private = addonObject.private or {} addonObject.___svfiles = {["PUBLIC"] = gfile, ["PRIVATE"] = pfile} + addonObject.___canShare = false; self[schema] = addonObject @@ -1167,13 +1194,11 @@ end -- INITIALIZE AND LAUNCH -local function InitExternalDB(variableFile, schema) +local function InitExternalDB(variableFile) local mt = {}; if(not variableFile) then return mt; end if(not _G[variableFile]) then _G[variableFile] = {}; end if(not _G[variableFile].SAFEDATA) then _G[variableFile].SAFEDATA = {}; end - if(schema) then LoadSharedData(schema, _G[variableFile]); end - local db = setmetatable(mt, meta_database); db.data = _G[variableFile]; return db; @@ -1194,21 +1219,24 @@ function lib:Launch() end end if(not halt) then + if(not PRIVATE_SV.SAFEDATA.SHARED[schema]) then + PRIVATE_SV.SAFEDATA.SHARED[schema] = { + enabled = false, + ignored = {} + }; + end + PRIVATE_SV.SAFEDATA.SHARED[schema].ignored.SAFEDATA = true; + PRIVATE_SV.SAFEDATA.SHARED[schema].ignored.data = true; local files = obj.___svfiles; if(files) then if(not PRIVATE_SV.SAFEDATA.SAVED[schema]) then PRIVATE_SV.SAFEDATA.SAVED[schema] = true; end - if(not PRIVATE_SV.SAFEDATA.SHARED[schema]) then - PRIVATE_SV.SAFEDATA.SHARED[schema] = { - enabled = false, - ignored = {} - }; - end - obj.private = InitExternalDB(files.PRIVATE, schema); + + obj.private = InitExternalDB(files.PRIVATE); obj.public = InitExternalDB(files.PUBLIC); end - LoadingProxy(schema, obj) + LoadingProxy(schema, obj, true) end end end @@ -1230,7 +1258,9 @@ function lib:Launch() ignored = {} }; end - obj.private = InitExternalDB(files.PRIVATE, schema); + PRIVATE_SV.SAFEDATA.SHARED[schema].ignored.SAFEDATA = true; + PRIVATE_SV.SAFEDATA.SHARED[schema].ignored.data = true; + obj.private = InitExternalDB(files.PRIVATE); if(obj.private.incompatible) then for addon,_ in pairs(obj.private.incompatible) do if IsAddOnLoaded(addon) then halt = true end @@ -1241,7 +1271,7 @@ function lib:Launch() end end if(not halt) then - LoadingProxy(schema, obj) + LoadingProxy(schema, obj, true) end end end @@ -1310,7 +1340,7 @@ function lib:CopyDatabase(key, linked) tablecopy(saved, export); end - SaveSharedData(); + CopySharedData(key); ReloadUI() else @@ -1334,7 +1364,7 @@ function lib:CloneDatabase(key) tablecopy(saved, export); DirtyDataList[key] = THEME_KEY; - SaveSharedData(); + CopySharedData(key); UpdateProfileSources(key); end @@ -1385,6 +1415,12 @@ function lib:WipeDatabase() end end +function lib:WipeAllSharedData() + for k,v in pairs(SHARED_SV.profiles) do + SHARED_SV.profiles[k] = nil + end +end + function lib:GetSafeData(index) if(index) then return PRIVATE_SV.SAFEDATA[index] diff --git a/SVUI_!Core/system/core.lua b/SVUI_!Core/system/core.lua index 43f09c2..77c5176 100644 --- a/SVUI_!Core/system/core.lua +++ b/SVUI_!Core/system/core.lua @@ -631,7 +631,7 @@ function SV:ToggleConfig() return end end - local aceConfig = LibStub("AceConfigDialog-1.0", true) + local aceConfig = LibStub("AceConfigDialog-3.0", true) if(aceConfig) then local switch = not aceConfig.OpenFrames[self.NameID] and "Open" or "Close" aceConfig[switch](aceConfig, self.NameID) @@ -705,7 +705,7 @@ function SV:PLAYER_REGEN_DISABLED() local forceClosed = false; if(self.OptionsLoaded) then - local aceConfig = LibStub("AceConfigDialog-1.0") + local aceConfig = LibStub("AceConfigDialog-3.0") if aceConfig.OpenFrames[self.NameID] then self:RegisterEvent("PLAYER_REGEN_ENABLED") aceConfig:Close(self.NameID) diff --git a/SVUI_!Core/system/dock.lua b/SVUI_!Core/system/dock.lua index 3bba0d8..d7cc385 100644 --- a/SVUI_!Core/system/dock.lua +++ b/SVUI_!Core/system/dock.lua @@ -1970,6 +1970,9 @@ function MOD:Load() self.private.Active = {} end + self:MakeSharable(); + self:IgnoreSharedKeys('AllFaded','LeftFaded','RightFaded','LeftExpanded','RightExpanded'); + local buttonsize = SV.db.Dock.buttonSize; local spacing = SV.db.Dock.buttonSpacing; diff --git a/SVUI_!Core/system/layout.lua b/SVUI_!Core/system/layout.lua index 28e80ef..4e72390 100644 --- a/SVUI_!Core/system/layout.lua +++ b/SVUI_!Core/system/layout.lua @@ -803,7 +803,7 @@ end function Layout:Toggle(arg) if(InCombatLockdown()) then return end local enabled = false; - local aceConfig = LibStub("AceConfigDialog-1.0") + local aceConfig = LibStub("AceConfigDialog-3.0") if(aceConfig and SV.OptionsLoaded) then aceConfig:Close(SV.NameID) GameTooltip:Hide() @@ -934,7 +934,7 @@ local XML_LayoutLockButton_OnClick = function(self) Layout:Toggle() if(SV.OptionsLoaded and SV.OptionsStandby) then SV.OptionsStandby = nil - LibStub("AceConfigDialog-1.0"):Open(SV.NameID) + LibStub("AceConfigDialog-3.0"):Open(SV.NameID) end end diff --git a/SVUI_!Core/system/profile.lua b/SVUI_!Core/system/profile.lua index f563df0..b4e80c8 100644 --- a/SVUI_!Core/system/profile.lua +++ b/SVUI_!Core/system/profile.lua @@ -130,3 +130,32 @@ local function InitializeProfileInterface() end SV.Events:On("LOAD_ALL_ESSENTIALS", InitializeProfileInterface); + +function SV:GenerateSharedProfileOptions() + local sharedGroup = {}; + + sharedGroup.spacer1 = { + order = 1, + type = "description", + name = "Shared settings allow you to transfer even more options from enabled modules.".."\n", + width = "full", + } + + local currentCount = 2; + for schema,data in pairs(self.private.SAFEDATA.SHARED) do + local obj = self[schema]; + if(obj and obj.___canShare) then + sharedGroup[schema] = { + order = currentCount, + type = "toggle", + name = L["Shared " .. schema .. " Settings"], + desc = L["Do you want all " .. schema .. " settings available when copying the current profile?"], + get = function(a) return obj:IsSharingEnabled(); end, + set = function(a,b) obj:ToggleSharedData(b); end, + }; + currentCount = currentCount + 1; + end + end + + return sharedGroup; +end diff --git a/SVUI_!Core/system/slash.lua b/SVUI_!Core/system/slash.lua index 9684b0c..d1912f0 100644 --- a/SVUI_!Core/system/slash.lua +++ b/SVUI_!Core/system/slash.lua @@ -33,6 +33,7 @@ local GetAddOnMetadata = _G.GetAddOnMetadata; local SV = select(2, ...) local L = SV.L; +local SVUILib = Librarian("Registry"); --[[ ########################################################## LOCAL SLASH FUNCTIONS @@ -51,6 +52,7 @@ local SVUI_SLASH_COMMANDS = { ["move"] = SV.MoveAnchors, ["reset"] = SV.ResetAllUI, ["profile"] = SV.ProfileInterface.Toggle, + ["killshared"] = SVUILib.WipeAllSharedData, ["help"] = function() for cmd,desc in pairs(SVUI_SLASH_COMMAND_INFO) do local outbound = (msgPattern):format(cmd, desc); diff --git a/SVUI_!Options/SVUI_!Options.lua b/SVUI_!Options/SVUI_!Options.lua index f39e3a6..53a16ab 100644 --- a/SVUI_!Options/SVUI_!Options.lua +++ b/SVUI_!Options/SVUI_!Options.lua @@ -40,7 +40,7 @@ local _, SVUIOptions = ...; local SVUILib = Librarian("Registry"); local AceGUI = LibStub("AceGUI-3.0", true); local AceConfig = LibStub("AceConfig-3.0"); -local AceConfigDialog = LibStub("AceConfigDialog-1.0"); +local AceConfigDialog = LibStub("AceConfigDialog-3.0"); local AceVillainWidgets = AceVillainWidgets; local GameTooltip = GameTooltip; local GetNumEquipmentSets = GetNumEquipmentSets; @@ -81,6 +81,7 @@ local function RefreshProfileOptions() order = 1, type = "group", name = L["Profile Behavior"], + guiInline = true, args = { spacer1 = { order = 1, @@ -144,30 +145,23 @@ local function RefreshProfileOptions() order = 2, type = "group", name = L["Shared Settings"], - args = { - dockShare = { - order = 1, - type = "toggle", - name = L["Shared Dock Settings"], - desc = L["Do you want all dock settings (including docked order/placement) available when copying the current profile?"], - get = function(a) return SV.Dock:IsSharingEnabled(); end, - set = function(a,b) SV.Dock:ToggleSharedData(b); end, - }, - }, + guiInline = true, + args = SV:GenerateSharedProfileOptions(), } optionGroup.actions = { order = 3, type = "group", name = L["Profile Actions"], + guiInline = true, args = { importdesc = { order = 1, type = "description", name = function() if(SVUILib:CheckDualProfile()) then - return "\n" .. L["Can not Save, Copy or Change while dual spec swapping is enabled"] + return L["Can not Save, Copy or Change while dual spec swapping is enabled"] .. "\n"; else - return "\n" .. L["import_desc"] + return L["import_desc"] .. "\n"; end end, width = "full" @@ -219,15 +213,16 @@ local function RefreshProfileOptions() }, }, } - optionGroup.removal = { + optionGroup.resetting = { order = 4, type = "group", - name = L["Profile Removal"], + name = L["Profile Reset"], + guiInline = true, args = { spacer1 = { order = 1, type = "description", - name = L["reset_desc"], + name = L["reset_desc"] .. "\n", width = "full", }, reset = { @@ -238,20 +233,22 @@ local function RefreshProfileOptions() func = function() SV:StaticPopup_Show("RESET_PROFILE_PROMPT") end, width = 'full' }, - spacer2 = { - order = 3, - type = "description", - name = "", - width = "full", - }, - spacer3 = { - order = 4, + } + } + optionGroup.removal = { + order = 5, + type = "group", + name = L["Profile Removal"], + guiInline = true, + args = { + spacer1 = { + order = 1, type = "description", - name = L["delete_desc"], + name = L["delete_desc"] .. "\n", width = "full", }, delete = { - order = 5, + order = 2, type = "select", width = "full", name = L["delete"], @@ -326,7 +323,7 @@ end function SVUIOptions:SetToFilterConfig(newFilter) local filter = newFilter or "BuffWatch"; self:SetFilterOptions(filter); - _G.LibStub("AceConfigDialog-1.0"):SelectGroup(SV.NameID, "Filters"); + _G.LibStub("AceConfigDialog-3.0"):SelectGroup(SV.NameID, "Filters"); end local generalFonts = { diff --git a/SVUI_!Options/UnitFrames.lua b/SVUI_!Options/UnitFrames.lua index fb8e675..4f6450a 100644 --- a/SVUI_!Options/UnitFrames.lua +++ b/SVUI_!Options/UnitFrames.lua @@ -45,7 +45,7 @@ local MOD = SV.UnitFrames; if(not MOD) then return end; local _, SVUIOptions = ...; local Schema = MOD.Schema; -local ACD = LibStub("AceConfigDialog-1.0"); +local ACD = LibStub("AceConfigDialog-3.0"); local playerClass = select(2, UnitClass("player")); local DEFAULT_COLOR = {["r"] = 1, ["g"] = 0, ["b"] = 0}; local STYLE_SELECT = {["coloredIcon"] = L["Colored Icon"], ["texturedIcon"] = L["Textured Icon"], [""] = NONE}; diff --git a/SVUI_ActionBars/Loader.lua b/SVUI_ActionBars/Loader.lua index dd53387..5b5435d 100644 --- a/SVUI_ActionBars/Loader.lua +++ b/SVUI_ActionBars/Loader.lua @@ -410,17 +410,6 @@ function MOD:LoadOptions() MOD:RefreshActionBars() end, args = { - barCount = { - order = 2, - type = "range", - name = L["Total Bars"], - desc = L["The count of available bars."], - min = 6, - max = 10, - step = 1, - get = function(e)return SV.db[Schema][e[#e]]end, - set = function(e, f)SV.db[Schema][e[#e]] = f;SV:StaticPopup_Show("RL_CLIENT")end - }, barGroup = { order = 3, type = "group", @@ -431,43 +420,48 @@ function MOD:LoadOptions() order = 1, type = "group", name = L["General Settings"], - args = { - macrotext = { - type = "toggle", - name = L["Macro Text"], - desc = L["Display macro names on action buttons."], - order = 2 - }, + args = { hotkeytext = { type = "toggle", name = L["Keybind Text"], desc = L["Display bind names on action buttons."], - order = 3 + order = 1 }, keyDown = { type = "toggle", name = L["Key Down"], desc = OPTION_TOOLTIP_ACTION_BUTTON_USE_KEY_DOWN, - order = 4 - }, - showGrid = { - type = "toggle", - name = ALWAYS_SHOW_MULTIBARS_TEXT, - desc = OPTION_TOOLTIP_ALWAYS_SHOW_MULTIBARS, - order = 5 - }, + order = 2 + }, unlock = { type = "select", - width = "full", name = PICKUP_ACTION_KEY_TEXT, desc = L["The button you must hold down in order to drag an ability to another action button."], - order = 6, + order = 3, values = { ["SHIFT"] = SHIFT_KEY, ["ALT"] = ALT_KEY, ["CTRL"] = CTRL_KEY } + }, + macrotext = { + type = "toggle", + name = L["Macro Text"], + desc = L["Display macro names on action buttons."], + order = 4 + }, + rightClickSelf = { + type = "toggle", + name = L["Self Cast"], + desc = L["Right-click any action button to self cast"], + order = 5 }, + showGrid = { + type = "toggle", + name = ALWAYS_SHOW_MULTIBARS_TEXT, + desc = OPTION_TOOLTIP_ALWAYS_SHOW_MULTIBARS, + order = 6 + }, unc = { type = "color", order = 7, @@ -497,12 +491,18 @@ function MOD:LoadOptions() SV.db[Schema][key[#key]][4] = aValue MOD:RefreshActionBars() end, - }, - rightClickSelf = { - type = "toggle", - name = L["Self Cast"], - desc = L["Right-click any action button to self cast"], - order = 9 + }, + barCount = { + order = 9, + type = "range", + width = 'full', + name = L["Total Bars"], + desc = L["The count of available bars."], + min = 6, + max = 10, + step = 1, + get = function(e)return SV.db[Schema][e[#e]]end, + set = function(e, f)SV.db[Schema][e[#e]] = f;SV:StaticPopup_Show("RL_CLIENT")end }, cooldownSize = { order = 10, @@ -513,6 +513,7 @@ function MOD:LoadOptions() max = 22, step = 1 }, + } }, Pet = { @@ -528,6 +529,7 @@ function MOD:LoadOptions() args = { enable = { order = 1, + width = 'full', type = "toggle", name = L["Enable"] }, @@ -674,6 +676,7 @@ function MOD:LoadOptions() args = { enable = { order = 1, + width = 'full', type = "toggle", name = L["Enable"] }, @@ -845,6 +848,7 @@ function MOD:LoadOptions() order = 1, type = "toggle", name = L["Enable"], + width = 'full', set = function(key, value) MOD:ChangeDBVar(value, key[#key], "Totem"); SV:StaticPopup_Show("RL_CLIENT") @@ -909,6 +913,7 @@ function MOD:LoadOptions() enable = { order = 1, type = "toggle", + width = 'full', name = L["Enable"], set = function(key, value) MOD:ChangeDBVar(value, key[#key], "Micro"); @@ -968,6 +973,7 @@ function MOD:LoadOptions() enable = { order = 1, type = "toggle", + width = 'full', name = L["Enable"], }, backdrop = { @@ -982,9 +988,27 @@ function MOD:LoadOptions() desc = L["The frame is not shown unless you mouse over the frame."], type = "toggle", disabled = function()return not SV.db[Schema][barKey].enable end, - }, - restorePosition = { + }, + showVehicle = { order = 4, + type = "toggle", + name = L["Vehicle Bar"], + desc = L["Assign " .. barTitle .. " as the location for the vehicle bar. NOTE: Only one bar can have this assigned."], + get = function()return SV.db[Schema][barKey].showVehicle end, + set = function(e, f) + SV.db[Schema][barKey].showVehicle = f; + for z = 1, count do + if(z ~= barNumber) then + SV.db[Schema][L["Bar"] .. z].showVehicle = false; + end + end + MOD:UpdateBarPagingDefaults(); + MOD:RefreshActionBars(); + --SV:StaticPopup_Show("RL_CLIENT"); + end + }, + restorePosition = { + order = 5, type = "execute", name = L["Restore Bar"], desc = L["Restore the actionbars default settings"], @@ -998,7 +1022,7 @@ function MOD:LoadOptions() adjustGroup = { name = L["Bar Adjustments"], type = "group", - order = 5, + order = 6, guiInline = true, disabled = function()return not SV.db[Schema][barKey].enable end, args = { @@ -1059,29 +1083,12 @@ function MOD:LoadOptions() pagingGroup = { name = L["Bar Paging"], type = "group", - order = 6, + order = 7, guiInline = true, disabled = function()return not SV.db[Schema][barKey].enable end, args = { - showVehicle = { - order = 1, - type = "toggle", - name = L["Vehicle Bar"], - desc = L["Assign " .. barTitle .. " as the location for the vehicle bar. NOTE: Only one bar can have this assigned."], - get = function()return SV.db[Schema][barKey].showVehicle end, - set = function(e, f) - SV.db[Schema][barKey].showVehicle = f; - for z = 1, count do - if(z ~= barNumber) then - SV.db[Schema][L["Bar"] .. z].showVehicle = false; - end - end - MOD:UpdateBarPagingDefaults(); - MOD:RefreshBar(barKey) - end - }, useCustomPaging = { - order = 2, + order = 1, type = "toggle", name = L["Custom Paging"], desc = L["Allow the use of custom paging for this bar"], @@ -1093,10 +1100,10 @@ function MOD:LoadOptions() end }, resetStates = { - order = 3, + order = 2, type = "execute", name = L["Restore Defaults"], - desc = L["Restore default paging attributes for this bar"], + desc = L["Restore default paging conditions for this bar"], func = function() SV:ResetData("ActionBars", barKey, "customPaging") MOD:UpdateBarPagingDefaults(); @@ -1104,11 +1111,11 @@ function MOD:LoadOptions() end }, customPaging = { - order = 4, + order = 3, type = "input", width = "full", - name = L["Paging"], - desc = L["|cffFF0000ADVANCED:|r Set the paging attributes for this bar"], + name = L["Paging Conditions"], + desc = L["|cffFF0000ADVANCED:|r Set the paging conditions for this bar"], get = function(e)return SV.db[Schema][barKey].customPaging[SV.class] end, set = function(e, f) SV.db[Schema][barKey].customPaging[SV.class] = f; @@ -1116,12 +1123,21 @@ function MOD:LoadOptions() MOD:RefreshBar(barKey) end, disabled = function()return not SV.db[Schema][barKey].useCustomPaging end, - }, + }, + } + }, + visibilityGroup = { + name = L["Bar Visibility"], + type = "group", + order = 8, + guiInline = true, + disabled = function()return not SV.db[Schema][barKey].enable end, + args = { useCustomVisibility = { - order = 5, + order = 1, type = "toggle", - name = L["Enable"], - desc = L["Allow the use of custom paging for this bar"], + name = L["Custom Visibility"], + desc = L["Allow the use of custom visibility for this bar"], get = function()return SV.db[Schema][barKey].useCustomVisibility end, set = function(e, f) SV.db[Schema][barKey].useCustomVisibility = f; @@ -1130,10 +1146,10 @@ function MOD:LoadOptions() end }, resetVisibility = { - order = 6, + order = 2, type = "execute", name = L["Restore Defaults"], - desc = L["Restore default visibility attributes for this bar"], + desc = L["Restore default visibility conditions for this bar"], func = function() --SV:ResetData("ActionBars", barKey, "customVisibility") SV.db[Schema][barKey].customVisibility = SV.defaults[Schema][barKey].customVisibility; @@ -1142,11 +1158,11 @@ function MOD:LoadOptions() end }, customVisibility = { - order = 7, + order = 3, type = "input", width = "full", - name = L["Visibility"], - desc = L["|cffFF0000ADVANCED:|r Set the visibility attributes for this bar"], + name = L["Visibility Conditions"], + desc = L["|cffFF0000ADVANCED:|r Set the visibility conditions for this bar"], get = function(e)return SV.db[Schema][barKey].customVisibility end, set = function(e, f) SV.db[Schema][barKey].customVisibility = f; diff --git a/SVUI_ActionBars/SVUI_ActionBars.lua b/SVUI_ActionBars/SVUI_ActionBars.lua index dfd2281..a5fec0a 100644 --- a/SVUI_ActionBars/SVUI_ActionBars.lua +++ b/SVUI_ActionBars/SVUI_ActionBars.lua @@ -517,33 +517,32 @@ function MOD:UpdateBarPagingDefaults() if(SV.db.ActionBars[id].useCustomPaging) then parse = parse .. SV.db.ActionBars[id].customPaging[SV.class]; - --print('Bar '..i..': '..bar.conditions); end bar.conditions = parse; + --print('Bar '..i..': '..bar.conditions); end end local mainbar = _G["SVUI_ActionBar1"]; if(mainbar) then - local parse = BASE_PAGING; + local mainbar_parse = BASE_PAGING; if(SV.db.ActionBars.Bar1.showVehicle or (not vehicle_bar)) then - parse = parse .. " " .. PAGE_SHOW_VEHICLE; + mainbar_parse = mainbar_parse .. " " .. PAGE_SHOW_VEHICLE; else - parse = parse .. " " .. PAGE_HIDE_VEHICLE; + mainbar_parse = mainbar_parse .. " " .. PAGE_HIDE_VEHICLE; end - local parse = BASE_PAGING; for i=2, TOTAL_BARS do - parse = SEQUENCE_PATTERN:format(parse, i, i) + mainbar_parse = SEQUENCE_PATTERN:format(mainbar_parse, i, i) end if SV.db.ActionBars.Bar1.useCustomPaging then - parse = parse .. " " .. SV.db.ActionBars.Bar1.customPaging[SV.class]; + mainbar_parse = mainbar_parse .. " " .. SV.db.ActionBars.Bar1.customPaging[SV.class]; end - --print(parse) - mainbar.conditions = parse; + --print(mainbar_parse) + mainbar.conditions = mainbar_parse; end if((not SV.db.ActionBars.enable or InCombatLockdown()) or not self.isInitialized) then return end diff --git a/SVUI_Chat/Loader.lua b/SVUI_Chat/Loader.lua index b097c99..b40d4ce 100644 --- a/SVUI_Chat/Loader.lua +++ b/SVUI_Chat/Loader.lua @@ -199,13 +199,4 @@ function MOD:LoadOptions() }, } } - - SV.Options.args.profiles.args.sharing.args.chatSharing = { - order = 2, - type = "toggle", - name = L["Shared Chat Settings"], - desc = L["Do you want all chat settings (including channel and window placement) available when copying the current profile?"], - get = function(a) return MOD:IsSharingEnabled(); end, - set = function(a,b) MOD:ToggleSharedData(b); end, - }; end diff --git a/SVUI_Chat/SVUI_Chat.lua b/SVUI_Chat/SVUI_Chat.lua index 24cc869..e660f97 100644 --- a/SVUI_Chat/SVUI_Chat.lua +++ b/SVUI_Chat/SVUI_Chat.lua @@ -1790,7 +1790,8 @@ function MOD:Load() self.private.tabNames = self.private.tabNames or {}; self.ChatHistory = self.private.history; - self:IgnoreSharedKey('history'); + self:IgnoreSharedKeys('history'); + self:MakeSharable(); local baseDock = SV.Dock.BottomLeft;