diff --git a/Interface/AddOns/SVUI/SVUI.lua b/Interface/AddOns/SVUI/SVUI.lua index 3a650e0..262b6c3 100644 --- a/Interface/AddOns/SVUI/SVUI.lua +++ b/Interface/AddOns/SVUI/SVUI.lua @@ -172,13 +172,13 @@ local Core_StaticPopup_Show = function(self, arg) end local Core_Debugger = function(self, msg) - if(not self.___debugging) then return end - local outbound = (debugPattern):format(self.___addonName, "DEBUG") + if(not self.DebugMode) then return end + local outbound = (debugPattern):format(self.NameID, "DEBUG") _sendmessage(msg, outbound) end local Core_AddonMessage = function(self, msg) - local outbound = (messagePattern):format(self.___addonName) + local outbound = (messagePattern):format(self.NameID) _sendmessage(msg, outbound) end @@ -258,6 +258,8 @@ end --[[ INITIALIZE THE CORE OBJECT ]]-- +-- We have to send the names of our three SavedVariables files since the WoW API +-- has no method for parsing them in LUA. local SVUI = SVLib:NewCore("SVUI_Global", "SVUI_Profile", "SVUI_Cache") SVUI.Snap = {} diff --git a/Interface/AddOns/SVUI/configs/configs.lua b/Interface/AddOns/SVUI/configs/configs.lua index 3e2d252..ae73b11 100644 --- a/Interface/AddOns/SVUI/configs/configs.lua +++ b/Interface/AddOns/SVUI/configs/configs.lua @@ -17,18 +17,7 @@ GET ADDON DATA ########################################################## ]]-- local SVUI_ADDON_NAME, SV = ... ---[[ -##################################################################################### - /$$$$$$ /$$$$$$ /$$ /$$ /$$$$$$$$/$$$$$$ /$$$$$$ /$$$$$$ - /$$__ $$ /$$__ $$| $$$ | $$| $$_____/_ $$_/ /$$__ $$ /$$__ $$ -| $$ \__/| $$ \ $$| $$$$| $$| $$ | $$ | $$ \__/| $$ \__/ -| $$ | $$ | $$| $$ $$ $$| $$$$$ | $$ | $$ /$$$$| $$$$$$ -| $$ | $$ | $$| $$ $$$$| $$__/ | $$ | $$|_ $$ \____ $$ -| $$ $$| $$ | $$| $$\ $$$| $$ | $$ | $$ \ $$ /$$ \ $$ -| $$$$$$/| $$$$$$/| $$ \ $$| $$ /$$$$$$| $$$$$$/| $$$$$$/ - \______/ \______/ |__/ \__/|__/ |______/ \______/ \______/ -##################################################################################### -]]-- + local playerClass = select(2, UnitClass("player")); local filterClass = playerClass or "NONE" diff --git a/Interface/AddOns/SVUI/docs/configs.lua b/Interface/AddOns/SVUI/docs/configs.lua new file mode 100644 index 0000000..b2409d8 --- /dev/null +++ b/Interface/AddOns/SVUI/docs/configs.lua @@ -0,0 +1,66 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## + /$$$$$$ /$$$$$$ /$$ /$$ /$$$$$$$$/$$$$$$ /$$$$$$ /$$$$$$ # + /$$__ $$ /$$__ $$| $$$ | $$| $$_____/_ $$_/ /$$__ $$ /$$__ $$ # +| $$ \__/| $$ \ $$| $$$$| $$| $$ | $$ | $$ \__/| $$ \__/ # +| $$ | $$ | $$| $$ $$ $$| $$$$$ | $$ | $$ /$$$$| $$$$$$ # +| $$ | $$ | $$| $$ $$$$| $$__/ | $$ | $$|_ $$ \____ $$ # +| $$ $$| $$ | $$| $$\ $$$| $$ | $$ | $$ \ $$ /$$ \ $$ # +| $$$$$$/| $$$$$$/| $$ \ $$| $$ /$$$$$$| $$$$$$/| $$$$$$/ # + \______/ \______/ |__/ \__/|__/ |______/ \______/ \______/ # +############################################################################## +]]-- + +--[[ + + The "configs" property is the default (also the backup) of ALL usable database entries. + When the addon core is initialized, a "db" property is created using a copy of "configs". + + When configs are set under their own index (ie.. SV.configs["Shiznit"]) AND a module (package, plugin ...etc) + has a schema (see NOTE) of the same name, then that index is used to set + the module's own "db" property using a pointer reference linking to the core database location. + + Package configs should be set in the primary config file (configs/configs.lua) since they are + treated and loaded as internal entities. + + For new packages (not already defined in my default configs) you will need to know the + associated schema name specific to that package. + + Just add the new package configs to the BOTTOM of the config file like this: + +]]-- + +-- SV and SV.configs will have already been defined +local Schema = "SumFukinPackage" +SV.configs[Schema] = { SumFukinValue = true } + +--[[ + + When adding plugins to the collective, be sure to set respective entries BEFORE loading, + as the same process takes place for externally connected addons. + + Plugin configs can be set like this: + +]]-- + +local SV = _G["SVUI"] +local Schema = _G["SumFukinPlugin"].Schema -- Get the already assigned schema name +SV.configs[Schema] = { SumFukinValue = true } + +--[[ + + NOTE: Schema and Modules are explained in their respective documents + +]]-- \ No newline at end of file diff --git a/Interface/AddOns/SVUI/docs/schema.lua b/Interface/AddOns/SVUI/docs/schema.lua new file mode 100644 index 0000000..8b878db --- /dev/null +++ b/Interface/AddOns/SVUI/docs/schema.lua @@ -0,0 +1,116 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## + /$$$$$$ /$$$$$$ /$$ /$$ /$$$$$$$$ /$$ /$$ /$$$$$$ # + /$$__ $$ /$$__ $$| $$ | $$| $$_____/| $$$ /$$$ /$$__ $$ # +| $$ \__/| $$ \__/| $$ | $$| $$ | $$$$ /$$$$| $$ \ $$ # +| $$$$$$ | $$ | $$$$$$$$| $$$$$ | $$ $$/$$ $$| $$$$$$$$ # + \____ $$| $$ | $$__ $$| $$__/ | $$ $$$| $$| $$__ $$ # + /$$ \ $$| $$ $$| $$ | $$| $$ | $$\ $ | $$| $$ | $$ # +| $$$$$$/| $$$$$$/| $$ | $$| $$$$$$$$| $$ \/ | $$| $$ | $$ # + \______/ \______/ |__/ |__/|________/|__/ |__/|__/ |__/ # +############################################################################## +]]-- + +--[[ + + Schema is a property and concept used to help dynamically define database indexes. + The main purpose for its creation was to provide a way to generate useable config + variables for any plugin, including those that are LoadOnDemand! + + To the best of my knowledge, this has never been done before (/flex)! + + The schema convention is utilized by the "LibSuperVillain" library to ensure + proper organization of our various addon configs (see NOTE) + + For Packages: + + You have to define the modules schema when you send its object to the library + + Here is an example: + +]]-- + +local lib = LibStub("LibSuperVillain-1.0") +local PKG = {}; + +--Here you would build your package object, then... + +lib:NewPackage(PKG, "SumFukinPackage") + +--So now you can get the schema name like this: + +local Schema = PKG.Schema + +--[[ + + For Plugins: + + You will set the schema in the plugins .toc file using meta-data fields + prefixed with "X" to indicate its a custom entry, the SuperVillain indicator "SVUI", + and finally the type of entry it is + + (there are two possibilities at the time of this writing. "Header" and "Schema") + + so it will end up looking like this: + X-SVUI-Header + + or this: + X-SVUI-Schema + + Your toc should end up looking something like this: + + ~(SumFukinPlugin.toc) + + ## Interface: 60000 + ## Author: SumFukinDude + ## Version: 1.0 + ## X-SVUI-Header: Some Fukin Addon + ## X-SVUI-Schema: SumFukinSchema + + + Having defined and initialized all requirements at this point, your database will now + have named references linking to this object by schema. +]]-- + +--[[ + + LoadOnDemand: + + When schema is defined for plugins that are NOT loaded by default, the library will + be able to parse all toc files that contain an "X-SVUI-Schema" property and generate + a database entry as well as a config option so that we can manipulate that plugin and + save our changes. + + The benefit here is this: + + Let's use SVUI_Laborer for example. If by default this LOD addon is Disabled, we can't read + on any lua code inside the addon. This prevents the ability to set config variables and therefore + build config options. Before we would have had to add a button to allow the player to click and "Enable" it. + This is fine but what if we also want to make the choice to keep it enabled every time we log in? + That would not have worked since your options would not be loaded UNTIL you clicked the enable button! + Using schema however, we can still create our configs + AND set the data entry from saved variables (if they exist in the file) + which allows our core to not only detect its existence but also see if it was previously enabled + and if so then go ahead and load/enable the addon. + + BOOM!! + +]]-- + +--[[ + + NOTE: Configs and Modules are explained in their respective documents + +]]-- \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/LibSuperVillain-1.0.lua b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/LibSuperVillain-1.0.lua index ed31a2f..2d89317 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 @@ -84,17 +84,17 @@ if not lib then return end --[[ ADDON DATA ]]-- -local AddonName, AddonCore = ... +local CoreName, CoreObject = ... local AddonVersion = GetAddOnMetadata(..., "Version"); -local SchemaFromMeta = "X-" .. AddonName .. "-Schema"; -local HeaderFromMeta = "X-" .. AddonName .. "-Header"; +local SchemaFromMeta = "X-" .. CoreName .. "-Schema"; +local HeaderFromMeta = "X-" .. CoreName .. "-Header"; local InterfaceVersion = select(4, GetBuildInfo()); --[[ COMMON LOCAL VARS ]]-- -local GLOBAL_FILENAME = AddonName.."_Global"; -local PROFILE_FILENAME = AddonName.."_Profile"; -local CACHE_FILENAME = AddonName.."_Cache"; +local GLOBAL_FILENAME = CoreName.."_Global"; +local PROFILE_FILENAME = CoreName.."_Profile"; +local CACHE_FILENAME = CoreName.."_Cache"; local SOURCE_KEY = 1; local GLOBAL_SV, PROFILE_SV, CACHE_SV; local PluginString = "" @@ -115,7 +115,7 @@ lib.EventManager = CreateFrame("Frame", nil) --[[ COMMON META METHODS ]]-- -local rootstring = function(self) return self.___addonName end +local rootstring = function(self) return self.NameID end --[[ CUSTOM LUA METHODS ]]-- @@ -304,7 +304,7 @@ local function tablecopy(d, s) if type(v) == "table" then if not saved then rawset(d, k, {}) end tablecopy(d[k], v) - elseif(not saved or (saved and type(saved) ~= type(v))) then + elseif(saved == nil or (saved and type(saved) ~= type(v))) then rawset(d, k, v) end end @@ -390,12 +390,12 @@ local meta_database = { local src = dv and dv[k] --print(k .. " - " .. tostring(src)) - if(src) then + if(src ~= nil) then if(type(src) == "table") then - if(sv[k] == nil) then sv[k] = {} end + if(sv[k] == nil or (sv[k] ~= nil and type(sv[k]) ~= "table")) then sv[k] = {} end tablecopy(sv[k], src) else - if(sv[k] == nil or (sv[k] and type(sv[k]) ~= type(src))) then sv[k] = src end + if(sv[k] == nil or (sv[k] ~= nil and type(sv[k]) ~= type(src))) then sv[k] = src end end end @@ -431,7 +431,7 @@ end function lib:ImportDatabase(key) if(not GLOBAL_SV.profiles[key]) then GLOBAL_SV.profiles[key] = {} end; local import = GLOBAL_SV.profiles[key]; - local saved = rawget(AddonCore.db, "data"); + local saved = rawget(CoreObject.db, "data"); import.importTest = true; --Testing value, will be removed next time the UI is reloaded for k,v in pairs(import) do @@ -439,7 +439,7 @@ function lib:ImportDatabase(key) end --Ensure that import was successful - if(not AddonCore.db.importTest) then + if(not CoreObject.db.importTest) then --If no test value found, might need reloading --Not the most clever thing in the world but.... print("Profile Error") @@ -450,7 +450,7 @@ end function lib:ExportDatabase(key) if(not GLOBAL_SV.profiles[key]) then GLOBAL_SV.profiles[key] = {} end; - local export = rawget(AddonCore.db, "data"); + local export = rawget(CoreObject.db, "data"); local saved = GLOBAL_SV.profiles[key]; tablecopy(saved, export); @@ -461,7 +461,7 @@ function lib:ExportDatabase(key) end function lib:WipeDatabase() - local sv = rawget(AddonCore.db, "data") + local sv = rawget(CoreObject.db, "data") for k,v in pairs(sv) do sv[k] = nil end @@ -469,8 +469,8 @@ end function lib:UpdateDatabase(event) if event == "PLAYER_LOGOUT" then - local sv = rawget(AddonCore.db, "data") - local src = rawget(AddonCore.db, "defaults") + local sv = rawget(CoreObject.db, "data") + local src = rawget(CoreObject.db, "defaults") for k,v in pairs(sv) do if(not src[k]) then sv[k] = nil @@ -492,24 +492,12 @@ function lib:UpdateDatabase(event) self.EventManager:UnregisterEvent("ACTIVE_TALENT_GROUP_CHANGED") end - local BACKUP_DATA = rawget(AddonCore.db, "defaults") - local db = setmetatable({}, meta_database) - db.data = PROFILE_SV.STORED[SOURCE_KEY] - db.defaults = BACKUP_DATA - - AddonCore.db = db + local data = CoreObject.db + local source = PROFILE_SV.STORED[SOURCE_KEY] + rawset(data, "data", source) end end -function lib:GetSourceData(schema) - return PROFILE_SV.STORED[SOURCE_KEY][schema] -end - -function lib:SetSourceData(schema, key, value) - print(schema) - PROFILE_SV.STORED[SOURCE_KEY][schema][key] = value -end - function lib:GetSafeData(index) return PROFILE_SV.SAFEDATA[index] end @@ -534,13 +522,13 @@ function lib:CheckData(schema, key) end function lib:NewDatabase(obj) - local schema = obj.___schema - obj.db = AddonCore.db[schema] or {} + local schema = obj.Schema + obj.db = CoreObject.db[schema] or {} obj.ResetData = setDefault end function lib:NewCache(index) - index = index or AddonCore.___schema + index = index or CoreObject.Schema AllowedIndexes[index] = true if(not CACHE_SV[index]) then CACHE_SV[index] = {} @@ -625,7 +613,7 @@ local innerOnUpdate = function(self, elapsed) for name, fn in pairs(callbacks) do local _, error = pcall(fn, obj) - if(error and AddonCore.Debugging) then + if(error and CoreObject.Debugging) then print(error) end end @@ -664,38 +652,11 @@ local unregisterUpdate = function(self, updatefunc) end local appendOptions = function(self, index, data) - local addonName = self.___addonName - local schema = self.___schema + local addonName = self.NameID + local schema = self.Schema local header = GetAddOnMetadata(addonName, HeaderFromMeta) - AddonCore.Options.args.plugins.args.pluginOptions.args[schema].args[index] = data -end - -local function LoadMods() - if ModuleQueue then - for i=1,#ModuleQueue do - local schema = ModuleQueue[i] - local obj = AddonCore[schema] - if obj and not obj.initialized then - obj.initialized = true; - local halt = false - lib:NewDatabase(obj) - if(obj.db.incompatible) then - for addon,_ in pairs(obj.db.incompatible) do - if IsAddOnLoaded(addon) then halt = true end - end - end - if obj.Load then - if(not halt) then - obj:Load() - obj.Load = nil - end - end - end - end - - twipe(ModuleQueue) - end + CoreObject.Options.args.plugins.args.pluginOptions.args[schema].args[index] = data end local function SetPluginString(addonName) @@ -705,7 +666,7 @@ local function SetPluginString(addonName) return INFO_FORMAT:format(name, version, author) end -local function SetInternalModule(obj, schema) +local function SetInternalModule(obj, schema, header) local addonmeta = {} local oldmeta = getmetatable(obj) if oldmeta then @@ -716,9 +677,9 @@ local function SetInternalModule(obj, schema) local addonName = ("SVUI [%s]"):format(schema) - obj.___addonName = addonName - obj.___schema = schema - obj.___dbDebug = false + obj.NameID = addonName + obj.Schema = schema + obj.TitleID = header if not obj.db then obj.db = {} end @@ -742,14 +703,12 @@ local function SetExternalModule(obj, schema, addonName, header, lod) addonmeta.__tostring = rootstring setmetatable( obj, addonmeta ) - obj.___addonName = addonName - obj.___schema = schema - obj.___header = header - obj.___isPlugin = true - obj.___lod = lod + obj.NameID = addonName + obj.Schema = schema + obj.TitleID = header - if(AddonCore.configs[schema]) then - obj.db = AddonCore.configs[schema] + if(CoreObject.configs[schema]) then + obj.db = CoreObject.configs[schema] else obj.db = {} end @@ -764,7 +723,7 @@ local function SetExternalModule(obj, schema, addonName, header, lod) obj.AddOption = appendOptions if(IsAddOnLoaded(addonName) and not lod) then - AddonCore.Options.args.plugins.args.pluginOptions.args[schema] = { + CoreObject.Options.args.plugins.args.pluginOptions.args[schema] = { type = "group", name = header, childGroups = "tree", @@ -774,7 +733,7 @@ local function SetExternalModule(obj, schema, addonName, header, lod) type = "toggle", name = "Enable", get = function() return obj.db.enable end, - set = function(key, value) obj:ChangeDBVar(value, "enable"); AddonCore:StaticPopup_Show("RL_CLIENT") end, + set = function(key, value) obj:ChangeDBVar(value, "enable"); CoreObject:StaticPopup_Show("RL_CLIENT") end, } } } @@ -797,27 +756,26 @@ function lib:NewScript(fn) end function lib:NewPackage(obj, schema, defaults) - if(AddonCore[schema]) then return end + if(CoreObject[schema]) then return end ModuleQueue[#ModuleQueue+1] = schema Modules[#Modules+1] = schema AllowedIndexes[schema] = true - AddonCore[schema] = SetInternalModule(obj, schema) + CoreObject[schema] = SetInternalModule(obj, schema) - if(AddonCore.AddonLaunched and not AddonCore[schema].initialized) then - --print("NewPackage - " .. schema .. ": New Database") - self:NewDatabase(AddonCore[schema]) - if(AddonCore[schema].Load) then - AddonCore[schema]:Load() + if(CoreObject.AddonLaunched and not CoreObject[schema].initialized) then + self:NewDatabase(CoreObject[schema]) + if(CoreObject[schema].Load) then + CoreObject[schema]:Load() end - AddonCore[schema].initialized = true + CoreObject[schema].initialized = true end end function lib:NewPlugin(obj) - local coreName = AddonCore.___addonName - local addonName = obj.___addonName + local coreName = CoreObject.NameID + local addonName = obj.NameID if(addonName and addonName ~= coreName) then local header = GetAddOnMetadata(addonName, HeaderFromMeta) @@ -833,15 +791,15 @@ function lib:NewPlugin(obj) PluginString = ("%s%s\n"):format(oldString, infoString) - AddonCore[schema] = SetExternalModule(obj, schema, addonName, header, lod) + CoreObject[schema] = SetExternalModule(obj, schema, addonName, header, lod) - if(AddonCore.AddonLaunched and not AddonCore[schema].initialized) then + if(CoreObject.AddonLaunched and not CoreObject[schema].initialized) then --print("NewPlugin - " .. schema .. ": New Database") - self:NewDatabase(AddonCore[schema]) - if(AddonCore[schema].Load) then - AddonCore[schema]:Load() + self:NewDatabase(CoreObject[schema]) + if(CoreObject[schema].Load) then + CoreObject[schema]:Load() end - AddonCore[schema].initialized = true + CoreObject[schema].initialized = true end end end @@ -856,7 +814,7 @@ function lib:RunCallbacks() end function lib:Update(schema, dataOnly) - local obj = AddonCore[schema] + local obj = CoreObject[schema] if obj and obj.ReLoad and not dataOnly then obj:ReLoad() end @@ -864,7 +822,7 @@ end function lib:UpdateAll() for _,schema in pairs(Modules) do - local obj = AddonCore[schema] + local obj = CoreObject[schema] if obj and obj.ReLoad then obj:ReLoad() end @@ -876,9 +834,9 @@ function lib:NewPrototype(name) local schema = GetAddOnMetadata(name, SchemaFromMeta) local obj = { - ___addonName = name, - ___version = version, - ___schema = schema + NameID = name, + Version = version, + Schema = schema } local mt = {} @@ -891,7 +849,7 @@ function lib:NewPrototype(name) obj.db = {["enable"] = false} - AddonCore[schema] = obj + CoreObject[schema] = obj return obj end @@ -905,8 +863,7 @@ end local function NewLoadOnDemand(addonName, schema, header) LoadOnDemand[schema] = addonName; - - AddonCore.Options.args.plugins.args.pluginOptions.args[schema] = { + CoreObject.Options.args.plugins.args.pluginOptions.args[schema] = { type = "group", name = header, childGroups = "tree", @@ -923,18 +880,13 @@ local function NewLoadOnDemand(addonName, schema, header) return nameString end, func = function() - print(addonName) if(not IsAddOnLoaded(addonName)) then - print("Enabling") local loaded, reason = LoadAddOn(addonName) - lib:SetSourceData(schema, "enable", true) - print(loaded) - print(reason) - AddonCore:StaticPopup_Show("RL_CLIENT") + PROFILE_SV.STORED[SOURCE_KEY][schema].enable = true + CoreObject:StaticPopup_Show("RL_CLIENT") else - print("Disabling") - lib:SetSourceData(schema, "enable", false) - AddonCore:StaticPopup_Show("RL_CLIENT") + PROFILE_SV.STORED[SOURCE_KEY][schema].enable = false + CoreObject:StaticPopup_Show("RL_CLIENT") end end, } @@ -959,20 +911,21 @@ end function lib:NewCore(gfile, pfile, cfile) --internals - AddonCore.___addonName = AddonName; - AddonCore.___version = AddonVersion; - AddonCore.___interface = tonumber(InterfaceVersion); - AddonCore.___debugging = false; - AddonCore.___schema = GetAddOnMetadata(AddonName, SchemaFromMeta); - AddonCore.___header = GetAddOnMetadata(AddonName, HeaderFromMeta); + CoreObject.NameID = CoreName; + CoreObject.Version = AddonVersion; + CoreObject.GameVersion = tonumber(InterfaceVersion); + CoreObject.DebugMode = false; + CoreObject.Schema = GetAddOnMetadata(CoreName, SchemaFromMeta); + CoreObject.TitleID = GetAddOnMetadata(CoreName, HeaderFromMeta); + --meta assurance local mt = {}; - local old = getmetatable(AddonCore); + local old = getmetatable(CoreObject); if old then for k, v in pairs(old) do mt[k] = v end end mt.__tostring = rootstring; - setmetatable(AddonCore, mt); + setmetatable(CoreObject, mt); --database GLOBAL_FILENAME = gfile or GLOBAL_FILENAME PROFILE_FILENAME = pfile or PROFILE_FILENAME @@ -984,26 +937,29 @@ function lib:NewCore(gfile, pfile, cfile) self.EventManager.Initialized = true end - AddonCore.db = tablesplice(AddonCore.configs, {}) + CoreObject.db = tablesplice(CoreObject.configs, {}) --set global - _G[AddonName] = AddonCore; - return AddonCore + _G[CoreName] = CoreObject; + return CoreObject end function lib:Initialize() - local coreSchema = AddonCore.___schema + local coreSchema = CoreObject.Schema --GLOBAL SAVED VARIABLES if not _G[GLOBAL_FILENAME] then _G[GLOBAL_FILENAME] = {} end GLOBAL_SV = _G[GLOBAL_FILENAME] + if(GLOBAL_SV.profileKeys) then twipe(GLOBAL_SV.profileKeys) else GLOBAL_SV.profileKeys = {} end + GLOBAL_SV.profiles = GLOBAL_SV.profiles or {} + for k,v in pairs(GLOBAL_SV.profiles) do GLOBAL_SV.profileKeys[k] = k end @@ -1082,10 +1038,10 @@ function lib:Initialize() --construct core dataset local db = setmetatable({}, meta_database) db.data = PROFILE_SV.STORED[SOURCE_KEY] - db.defaults = AddonCore.configs + db.defaults = CoreObject.configs - AddonCore.ResetData = setDefault - AddonCore.db = db + CoreObject.ResetData = setDefault + CoreObject.db = db --check for LOD plugins local addonCount = GetNumAddOns() @@ -1105,7 +1061,7 @@ end function lib:Launch() if LoadOnDemand then for schema,name in pairs(LoadOnDemand) do - local db = AddonCore.db[schema] + local db = CoreObject.db[schema] if(db and (db.enable or db.enable ~= false)) then if(not IsAddOnLoaded(name)) then local loaded, reason = LoadAddOn(name) @@ -1115,7 +1071,30 @@ function lib:Launch() end end - LoadMods() + if ModuleQueue then + for i=1,#ModuleQueue do + local schema = ModuleQueue[i] + local obj = CoreObject[schema] + if obj and not obj.initialized then + obj.initialized = true; + local halt = false + self:NewDatabase(obj) + if(obj.db.incompatible) then + for addon,_ in pairs(obj.db.incompatible) do + if IsAddOnLoaded(addon) then halt = true end + end + end + if obj.Load then + if(not halt) then + obj:Load() + obj.Load = nil + end + end + end + end + + twipe(ModuleQueue) + end if ScriptQueue then for i=1, #ScriptQueue do diff --git a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/src/database.lua b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/src/database.lua deleted file mode 100644 index a77d5ff..0000000 --- a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/src/database.lua +++ /dev/null @@ -1,356 +0,0 @@ ---[[ - /$$$$$$$ /$$ /$$ -| $$__ $$ | $$ | $$ -| $$ \ $$ /$$$$$$ /$$$$$$ /$$$$$$ | $$$$$$$ /$$$$$$ /$$$$$$$ /$$$$$$ -| $$ | $$|____ $$|_ $$_/ |____ $$| $$__ $$|____ $$ /$$_____/ /$$__ $$ -| $$ | $$ /$$$$$$$ | $$ /$$$$$$$| $$ \ $$ /$$$$$$$| $$$$$$ | $$$$$$$$ -| $$ | $$/$$__ $$ | $$ /$$/$$__ $$| $$ | $$/$$__ $$ \____ $$| $$_____/ -| $$$$$$$/ $$$$$$$ | $$$$/ $$$$$$$| $$$$$$$/ $$$$$$$ /$$$$$$$/| $$$$$$$ -|_______/ \_______/ \___/ \_______/|_______/ \_______/|_______/ \_______/ - - -DataBase is a component used to create and manage SVUI data objects. - -It's main purpose is to keep all methods and logic needed to properly maintain -valid data outside of the core object. ---]] - ---LIB DB STORAGE -lib.ref = {}; -lib.globals = {}; -lib.source = {}; -lib.cache = {}; -lib.defaults = {}; -lib.dataset = {}; - ---LOCAL HELPERS -local function tablecopy(d, s) - if(type(s) ~= "table") then return end - if type(d) == "table" then - for k, v in pairs(s) do - if type(v) == "table" then - if not rawget(d, k) then rawset(d, k, {}) end - tablecopy(d[k], v) - else - if rawget(d, k) == nil then - rawset(d, k, v) - end - end - end - end -end - -local function tablesplice(targetTable, mergeTable) - if type(targetTable) ~= "table" then targetTable = {} end - - if type(mergeTable) == 'table' then - for key,val in pairs(mergeTable) do - if type(val) == "table" then - val = tablesplice(targetTable[key], val) - end - targetTable[key] = val - end - end - return targetTable -end - -local function importdata(s, d) - if type(d) ~= "table" then d = {} end - if type(s) == "table" then - for k,v in pairs(s) do - if type(v) == "table" then - v = importdata(v, d[k]) - end - d[k] = v - end - end - return d -end - -local function removedefaults(db, src, nometa) - if(type(src) ~= "table") then - if(db == src) then db = nil end - return - end - if(not nometa) then - setmetatable(db, nil) - end - for k,v in pairs(src) do - if type(v) == "table" and type(db[k]) == "table" then - removedefaults(db[k], v, nometa) - if next(db[k]) == nil then - db[k] = nil - end - else - if db[k] == v then - db[k] = nil - end - end - end -end - -local function setDefault(t, sub, sub2) - local data = t.db - local sv = rawget(data, "data") - local src = lib.defaults - local savedProfile - if(sub2 and sv and sv[sub]) then - savedProfile = sv[sub][sub2] - elseif(sub and sv) then - savedProfile = sv[sub] - else - savedProfile = sv - end - if(savedProfile) then - for k,v in pairs(savedProfile) do - savedProfile[k] = nil - end - else - sv = {} - end - tablecopy(sv, src) -end - -local meta_database = { - __index = function(t, k) - if(not k or k == "") then return end - local sv = rawget(t, "data") - local dv = lib.defaults - local src = dv and dv[k] - - --print(k .. " - " .. tostring(src)) - - if(sv[k] == nil) then sv[k] = {} end - - if(src) then - tablecopy(sv[k], src) - end - - rawset(t, k, sv[k]) - return rawget(t, k) - end, -} - -function lib:SetDatabaseObject() - local sourceKey = self.ref.key; - - twipe(self.dataset) - - self.dataset = setmetatable({}, meta_database) - self.dataset.data = self.source.STORED[sourceKey] -end - -function lib:Remove(key) - if(self.globals.profiles[key]) then self.globals.profiles[key] = nil end - if(self.globals.profileKeys[key]) then self.globals.profileKeys[key] = nil end - collectgarbage("collect") -end - -function lib:GetProfiles() - return self.globals.profileKeys or {} -end - -function lib:CheckProfiles() - local hasProfile = false - local list = self.globals.profileKeys or {} - for key,_ in pairs(list) do - hasProfile = true - end - return hasProfile -end - -function lib:ImportDatabase(key) - local reference = self.ref.active; - local sourceKey = self.ref.key; - local src = self.globals.profiles[key]; - if(not src) then return end - local import = self.source.STORED[sourceKey] - tablecopy(import, src) - - ReloadUI() -end - -function lib:ExportDatabase(key) - local reference = self.ref.active - local coreAddon = _G[self.ref.addon] - local export = {} - for schema, _ in pairs(reference) do - local obj = coreAddon[schema] - if(obj and obj.db) then - export[schema] = {} - local db = obj.db - local data = rawget(db, "data") - tablecopy(export[schema], data) - end - end - - if(not self.globals.profiles[key]) then self.globals.profiles[key] = {} end - local saved = self.globals.profiles[key] - tablecopy(saved, export) -end - -function lib:WipeDatabase() - local reference = self.ref.active - local coreAddon = _G[self.ref.addon] - for schema, _ in pairs(reference) do - local obj = coreAddon[schema] - if(obj and obj.db) then - local data = obj.db - local sv = rawget(data, "data") - for k,v in pairs(sv) do - sv[k] = nil - end - end - end -end - -function lib:SetSourceKey() - if(self.source.SAFEDATA and self.source.SAFEDATA.dualSpecEnabled) then - self.ref.key = GetSpecialization() or 1 - databaseListener:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") - else - self.ref.key = 1 - end -end - -function lib:UpdateDatabase() - self:SetSourceKey() - local reference = self.ref.active - local coreAddon = _G[self.ref.addon] - for schema, _ in pairs(reference) do - --self:SetDatabaseObject(coreAddon[schema]) - end -end - -function lib:SanitizeDatabase() - local sv = self.dataset - local src = self.defaults - for k,v in pairs(sv) do - if(src[k] ~= nil) then - removedefaults(sv[k], src[k]) - end - end -end - -function lib:ToggleSpecSwap(value) - if(value) then - databaseListener:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") - self:UpdateDatabase() - else - databaseListener:UnregisterEvent("ACTIVE_TALENT_GROUP_CHANGED") - end -end - -function lib:PrepareStorage() - local globalfile = self.ref.globalfile - self.globals = tablesplice(_G[globalfile], self.globals) - self.globals.profileKeys = {} - local gProfiles = self.globals.profiles - for k,v in pairs(gProfiles) do - self.globals.profileKeys[k] = k - end - - local cachefile = self.ref.cachefile - SVUI_Cache = tablesplice(_G[cachefile], SVUI_Cache) - - local sourcesfile = self.ref.sourcesfile - --_G[sourcesfile] = {} - if not _G[sourcesfile] then _G[sourcesfile] = {} end - - self.source = tablesplice(_G[sourcesfile], self.source) - - for k,v in pairs(self.source) do - if(k ~= "STORED" and k ~= "SAFEDATA") then - self.source[k] = nil - end - end - - self.source.SAFEDATA = self.source.SAFEDATA or {dualSpecEnabled = false} - - local coreSchema = self.ref.schema - - self.source.STORED = self.source.STORED or {} - - self.source.STORED[1] = self.source.STORED[1] or {} - self.source.STORED[1][coreSchema] = self.source.STORED[1][coreSchema] or {} - - for k,v in pairs(self.source.STORED[1]) do - if(k == "STORED" or k == "SAFEDATA" or k == "LAYOUT") then - self.source.STORED[1][k] = nil - end - end - - self.source.STORED[2] = self.source.STORED[2] or {} - self.source.STORED[2][coreSchema] = self.source.STORED[2][coreSchema] or {} - - self.source.STORED[3] = self.source.STORED[3] or {} - self.source.STORED[3][coreSchema] = self.source.STORED[3][coreSchema] or {} - - if playerClass == "DRUID" then - self.source.STORED[4] = self.source.STORED[4] or {} - self.source.STORED[4][coreSchema] = self.source.STORED[4][coreSchema] or {} - elseif self.source.STORED[4] then - self.source.STORED[4] = nil - end -end - -function lib:DefineCore(addon, gfile, pfile, cfile) - local coreAddon = _G[addon]; - local schema = coreAddon.___schema; - - self.ref = { - active = {}, - addon = addon, - schema = schema, - key = 1, - globalfile = gfile, - sourcesfile = pfile, - cachefile = cfile - } - - if(not databaseListener.Initialized) then - databaseListener:RegisterEvent("PLAYER_LOGOUT") - databaseListener:SetScript("OnEvent", DataBase_OnEvent) - databaseListener.Initialized = true - end -end - -function lib:Initialize() - local sourceKey = self.ref.key; - - self:SetSourceKey() - self:PrepareStorage() - - twipe(self.dataset) - - self.dataset = setmetatable({}, meta_database) - self.dataset.data = self.source.STORED[sourceKey] -end - -function lib:NewDatabase(obj) - local schema = obj.___schema - local sourceKey = self.ref.key - self.ref.active[schema] = true - self.defaults[schema] = self.defaults[schema] or {} - - if obj.db then - tablecopy(self.defaults[schema], obj.db) - twipe(obj.db) - end - - if(not self.source.STORED[sourceKey][schema]) then - self.source.STORED[sourceKey][schema] = {} - tablecopy(self.source.STORED[sourceKey][schema], self.defaults[schema]) - end - - obj.db = self.dataset[schema] - obj.ResetData = setDefault -end - -function lib:CheckData(schema, key) - local sourceKey = self.ref.key - local file = self.source.STORED[sourceKey][schema] - print("______" .. schema .. ".db[" .. key .. "]_____") - print(file[key]) - print("______SAVED_____") -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/src/librarian.lua b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/src/librarian.lua deleted file mode 100644 index 32b4f42..0000000 --- a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/src/librarian.lua +++ /dev/null @@ -1,61 +0,0 @@ ---[[ - /$$ /$$ /$$ /$$ -| $$ |__/| $$ |__/ -| $$ /$$| $$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$ /$$$$$$ /$$$$$$$ -| $$ | $$| $$__ $$ /$$__ $$|____ $$ /$$__ $$| $$ |____ $$| $$__ $$ -| $$ | $$| $$ \ $$| $$ \__/ /$$$$$$$| $$ \__/| $$ /$$$$$$$| $$ \ $$ -| $$ | $$| $$ | $$| $$ /$$__ $$| $$ | $$ /$$__ $$| $$ | $$ -| $$$$$$$$| $$| $$$$$$$/| $$ | $$$$$$$| $$ | $$| $$$$$$$| $$ | $$ -|________/|__/|_______/ |__/ \_______/|__/ |__/ \_______/|__/ |__/ - -Librarian is a clone of LibStub, meant for use only in SVUI Libraries. - -It's main purpose is to keep all SVUI libraries away from the commonly used -LibStub tables. This helps to keep custom code clean and isolated. - -Be aware that the meta '__call' points towards a 'Proxy' method -instead of the 'Get' method. This is simply due to the higher demand of -Proxy calls over lib loading. - -Librarian also ignores versioning since SVUI code will always be current -within itself. ---]] - -local _G = _G; -local type = _G.type; -local tostring = _G.tostring; -local error = _G.error; -local setmetatable = _G.setmetatable; - -local Librarian = _G["Librarian"] - -if not Librarian then - Librarian = Librarian or {libs = {}} - _G["Librarian"] = Librarian - - function LibStub:NewLibrary(libName) - assert(type(libName) == "string", "Bad argument #2 to `NewLibrary' (string expected)") - self.libs[libName] = self.libs[libName] or {} - return self.libs[libName] - end - - function LibStub(libName, silent) - if not self.libs[libName] and not silent then - error(("Cannot find a library instance of %q."):format(tostring(libName)), 2) - end - return self.libs[libName] - end - - function Librarian:Proxy(libName, ...) - local thisLib = self.libs[libName] - if(not thisLib) then - error(("Cannot find a library instance of %q."):format(tostring(libName)), 2) - elseif(thisLib and not thisLib.Proxy) then - error(("The library '%q' does not have a 'Proxy' method."):format(tostring(libName)), 2) - end - - return thisLib:Proxy(...) - end - - setmetatable(Librarian, { __call = Librarian.Proxy }) -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/src/linguist.lua b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/src/linguist.lua deleted file mode 100644 index 06a13da..0000000 --- a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/src/linguist.lua +++ /dev/null @@ -1,74 +0,0 @@ ---[[ - /$$ /$$ /$$ /$$ -| $$ |__/ |__/ | $$ -| $$ /$$ /$$$$$$$ /$$$$$$ /$$ /$$ /$$ /$$$$$$$/$$$$$$ -| $$ | $$| $$__ $$ /$$__ $$| $$ | $$| $$ /$$_____/_ $$_/ -| $$ | $$| $$ \ $$| $$ \ $$| $$ | $$| $$| $$$$$$ | $$ -| $$ | $$| $$ | $$| $$ | $$| $$ | $$| $$ \____ $$ | $$ /$$ -| $$$$$$$$| $$| $$ | $$| $$$$$$$| $$$$$$/| $$ /$$$$$$$/ | $$$$/ -|________/|__/|__/ |__/ \____ $$ \______/ |__/|_______/ \___/ - /$$ \ $$ - | $$$$$$/ - \______/ - -Linguist is a simple localization component. Seriously, thats it! ---]] -enforce(LibStub, "LibSuperVillain-1.0 requires LibStub") - -local _G = _G; -local rawset = _G.rawset; -local rawget = _G.rawget; -local getmetatable = _G.getmetatable; -local setmetatable = _G.setmetatable; - -local lib = LibStub("LibSuperVillain-1.0", 1) - -if not lib then return end - -local rootstring = function(self) return self.___addonName end - -local failsafe = function() enforce(false) end - -local metaread = { - __index = function(self, key) - rawset(self, key, key) - return key - end -} - -local activeLocale - -local defaultwrite = setmetatable({}, { - __newindex = function(self, key, value) - if not rawget(activeLocale, key) then - rawset(activeLocale, key, value == true and key or value) - end - end, - __index = failsafe -}) - -local metawrite = setmetatable({}, { - __newindex = function(self, key, value) - rawset(activeLocale, key, value == true and key or value) - end, - __index = failsafe -}) - -lib.Localization = setmetatable({}, metaread); - -function lib:Lang(locale, isDefault) - if(not locale) then - return self.Localization - else - local gameLocale = GetLocale() - if gameLocale == "enGB" then gameLocale = "enUS" end - - activeLocale = self.Localization - - if isDefault then - return defaultwrite - elseif(locale == GAME_LOCALE or locale == gameLocale) then - return metawrite - end - end -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/src/registry.lua b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/src/registry.lua deleted file mode 100644 index 3ea379c..0000000 --- a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/src/registry.lua +++ /dev/null @@ -1,527 +0,0 @@ ---[[ - /$$$$$$$ /$$ /$$ -| $$__ $$ |__/ | $$ -| $$ \ $$ /$$$$$$ /$$$$$$ /$$ /$$$$$$$/$$$$$$ /$$$$$$ /$$ /$$ -| $$$$$$$/ /$$__ $$ /$$__ $$| $$ /$$_____/_ $$_/ /$$__ $$| $$ | $$ -| $$__ $$| $$$$$$$$| $$ \ $$| $$| $$$$$$ | $$ | $$ \__/| $$ | $$ -| $$ \ $$| $$_____/| $$ | $$| $$ \____ $$ | $$ /$$| $$ | $$ | $$ -| $$ | $$| $$$$$$$| $$$$$$$| $$ /$$$$$$$/ | $$$$/| $$ | $$$$$$$ -|__/ |__/ \_______/ \____ $$|__/|_______/ \___/ |__/ \____ $$ - /$$ \ $$ /$$ | $$ - | $$$$$$/ | $$$$$$/ - \______/ \______/ - -LibSystemRegistry is a library used to manage packages and scripts embedded -into the SVUI core addon. - -It's main purpose is to keep all methods and logic needed to properly keep -core add-ins functioning outside of the core object. ---]] - ---REGISTRY LOCAL STORAGE -local PluginString = "" -local PluginList, Modules, LoadOnDemand, Callbacks, ModuleQueue, ScriptQueue = {},{},{},{},{},{}; - ---REGISTRY LOCAL HELPERS -local changeDBVar = function(self, value, key, sub1, sub2, sub3) - if((sub1 and sub2 and sub3) and (self.db[sub1] and self.db[sub1][sub2] and self.db[sub1][sub2][sub3])) then - self.db[sub1][sub2][sub3][key] = value - elseif((sub1 and sub2) and (self.db[sub1] and self.db[sub1][sub2])) then - self.db[sub1][sub2][key] = value - elseif(sub1 and self.db[sub1]) then - self.db[sub1][key] = value - else - self.db[key] = value - end - - if(self.UpdateLocals) then - self:UpdateLocals() - end -end - -local innerOnEvent = function(self, event, ...) - local obj = self.module - if self[event] and type(self[event]) == "function" then - self[event](obj, event, ...) - end -end - -local registerEvent = function(self, eventname, eventfunc) - if not self.___eventframe then - self.___eventframe = CreateFrame("Frame", nil) - self.___eventframe.module = self - self.___eventframe:SetScript("OnEvent", innerOnEvent) - end - - if(not self.___eventframe[eventname]) then - local fn = eventfunc - if type(eventfunc) == "string" then - fn = self[eventfunc] - elseif(not fn and self[eventname]) then - fn = self[eventname] - end - self.___eventframe[eventname] = fn - end - - self.___eventframe:RegisterEvent(eventname) -end - -local unregisterEvent = function(self, event, ...) - if(self.___eventframe) then - self.___eventframe:UnregisterEvent(event) - end -end - -local innerOnUpdate = function(self, elapsed) - if self.elapsed and self.elapsed > (self.throttle) then - local obj = self.module - local callbacks = self.callbacks - - for name, fn in pairs(callbacks) do - local _, error = pcall(fn, obj) - if(error and AddonCore.Debugging) then - print(error) - end - end - - self.elapsed = 0 - else - self.elapsed = (self.elapsed or 0) + elapsed - end -end - -local registerUpdate = function(self, updatefunc, throttle) - if not self.___updateframe then - self.___updateframe = CreateFrame("Frame", nil); - self.___updateframe.module = self; - self.___updateframe.callbacks = {}; - self.___updateframe.elapsed = 0; - self.___updateframe.throttle = throttle or 0.2; - end - - if(updatefunc and type(updatefunc) == "string" and self[updatefunc]) then - self.___updateframe.callbacks[updatefunc] = self[updatefunc] - end - - self.___updateframe:SetScript("OnUpdate", innerOnUpdate) -end - -local unregisterUpdate = function(self, updatefunc) - if(updatefunc and type(updatefunc) == "string" and self.___updateframe.callbacks[updatefunc]) then - self.___updateframe.callbacks[updatefunc] = nil - if(#self.___updateframe.callbacks == 0) then - self.___updateframe:SetScript("OnUpdate", nil) - end - else - self.___updateframe:SetScript("OnUpdate", nil) - end -end - -local add_OptionsIndex = function(self, index, data) - local addonName = self.___addonName - local schema = self.___schema - local header = GetAddOnMetadata(addonName, HeaderFromMeta) - - AddonCore.Options.args.plugins.args.pluginOptions.args[schema].args[index] = data -end - -local function SetPluginString(addonName) - local author = GetAddOnMetadata(addonName, "Author") or "Unknown" - local name = GetAddOnMetadata(addonName, "Title") or addonName - local version = GetAddOnMetadata(addonName, "Version") or "???" - return INFO_FORMAT:format(name, version, author) -end - -local function SetInternalModule(obj, schema) - local addonmeta = {} - local oldmeta = getmetatable(obj) - if oldmeta then - for k, v in pairs(oldmeta) do addonmeta[k] = v end - end - addonmeta.__tostring = rootstring - setmetatable( obj, addonmeta ) - - local addonName = ("SVUI [%s]"):format(schema) - - obj.___addonName = addonName - obj.___schema = schema - obj.___dbDebug = false - - obj.initialized = false - obj.CombatLocked = false - obj.ChangeDBVar = changeDBVar - obj.RegisterEvent = registerEvent - obj.UnregisterEvent = unregisterEvent - obj.RegisterUpdate = registerUpdate - obj.UnregisterUpdate = unregisterUpdate - - return obj -end - -local function SetExternalModule(obj, schema, addonName, header, lod) - local addonmeta = {} - local oldmeta = getmetatable(obj) - if oldmeta then - for k, v in pairs(oldmeta) do addonmeta[k] = v end - end - addonmeta.__tostring = rootstring - setmetatable( obj, addonmeta ) - - obj.___addonName = addonName - obj.___schema = schema - obj.___header = header - obj.___lod = lod - - obj.initialized = false - obj.CombatLocked = false - obj.ChangeDBVar = changeDBVar - obj.RegisterEvent = registerEvent - obj.UnregisterEvent = unregisterEvent - obj.RegisterUpdate = registerUpdate - obj.UnregisterUpdate = unregisterUpdate - obj.AddOption = add_OptionsIndex - - if(lod) then - -- print("PLUGIN: " .. addonName) - AddonCore.Options.args.plugins.args.pluginOptions.args[schema] = { - type = "group", - name = header, - childGroups = "tree", - args = { - enable = { - order = 1, - type = "execute", - width = "full", - name = function() - local nameString = "Disable" - if(not IsAddOnLoaded(addonName)) then - nameString = "Enable" - end - return nameString - end, - func = function() - if(not IsAddOnLoaded(addonName)) then - local loaded, reason = LoadAddOn(addonName) - obj:ChangeDBVar(true, "enable") - else - obj:ChangeDBVar(false, "enable") - AddonCore:StaticPopup_Show("RL_CLIENT") - end - end, - } - } - } - else - AddonCore.Options.args.plugins.args.pluginOptions.args[schema] = { - type = "group", - name = header, - childGroups = "tree", - args = { - enable = { - order = 1, - type = "toggle", - name = "Enable", - get = function() return obj.db.enable end, - set = function(key, value) obj:ChangeDBVar(value, "enable"); AddonCore:StaticPopup_Show("RL_CLIENT") end, - } - } - } - end - - return obj -end - - ---REGISTRY PUBLIC METHODS -function lib:NewCallback(fn) - if(fn and type(fn) == "function") then - Callbacks[#Callbacks+1] = fn - end -end - -function lib:NewScript(fn) - if(fn and type(fn) == "function") then - ScriptQueue[#ScriptQueue+1] = fn - end -end - -function lib:NewPackage(obj, schema, defaults) - if(AddonCore[schema]) then return end - - ModuleQueue[#ModuleQueue+1] = schema - Modules[#Modules+1] = schema - - AddonCore[schema] = SetInternalModule(obj, schema) - - if(AddonCore.AddonLaunched and not AddonCore[schema].initialized) then - --print("NewPackage - " .. schema .. ": New Database") - LDB:NewDatabase(AddonCore[schema]) - if(AddonCore[schema].Load) then - AddonCore[schema]:Load() - end - AddonCore[schema].initialized = true - end -end - -function lib:NewPlugin(obj) - local coreName = AddonCore.___addonName - local addonName = obj.___addonName - - if(addonName and addonName ~= coreName) then - local header = GetAddOnMetadata(addonName, HeaderFromMeta) - local schema = GetAddOnMetadata(addonName, SchemaFromMeta) - local lod = IsAddOnLoadOnDemand(addonName) - if(not schema) then return end - - ModuleQueue[#ModuleQueue+1] = schema - Modules[#Modules+1] = schema - - local infoString = SetPluginString(addonName) - local oldString = PluginString - - PluginList[addonName] = infoString - PluginString = ("%s%s\n"):format(oldString, infoString) - - AddonCore[schema] = SetExternalModule(obj, schema, addonName, header, lod) - - if(AddonCore.AddonLaunched and not AddonCore[schema].initialized) then - --print("NewPlugin - " .. schema .. ": New Database") - LDB:NewDatabase(AddonCore[schema]) - if(AddonCore[schema].Load) then - AddonCore[schema]:Load() - end - AddonCore[schema].initialized = true - end - end -end - -function lib:NewAddon(addonName, schema, header) - LoadOnDemand[addonName] = schema; - - AddonCore.Options.args.plugins.args.pluginOptions.args[schema] = { - type = "group", - name = header, - childGroups = "tree", - args = { - enable = { - order = 1, - type = "execute", - width = "full", - name = function() - local nameString = "Disable" - if(not IsAddOnLoaded(addonName)) then - nameString = "Enable" - end - return nameString - end, - func = function() - if(not IsAddOnLoaded(addonName)) then - local loaded, reason = LoadAddOn(addonName) - AddonCore[schema].db.enable = true - self:LoadPackages() - else - AddonCore[schema].db.enable = false - AddonCore:StaticPopup_Show("RL_CLIENT") - end - end, - } - } - } -end - -function lib:RunCallbacks() - for i=1, #Callbacks do - local fn = Callbacks[i] - if(fn and type(fn) == "function") then - fn() - end - end -end - -function lib:Update(schema, dataOnly) - local obj = AddonCore[schema] - if obj and obj.ReLoad and not dataOnly then - obj:ReLoad() - end -end - -function lib:UpdateAll() - for _,schema in pairs(Modules) do - local obj = AddonCore[schema] - if obj and obj.ReLoad then - obj:ReLoad() - end - end -end - -function lib:Launch() - if LoadOnDemand then - for name,schema in pairs(LoadOnDemand) do - local obj = AddonCore[schema] - if(obj and obj.db and (obj.db.enable or obj.db.enable ~= false)) then - if(not IsAddOnLoaded(name)) then - local loaded, reason = LoadAddOn(name) - end - EnableAddOn(name) - end - end - end - - if ModuleQueue then - for i=1,#ModuleQueue do - local schema = ModuleQueue[i] - local obj = AddonCore[schema] - if obj and not obj.initialized then - obj.initialized = true; - local halt = false - --print("ModuleLoad - " .. schema .. ": New Database") - LDB:NewDatabase(obj) - if(obj.db.incompatible) then - for addon,_ in pairs(obj.db.incompatible) do - if IsAddOnLoaded(addon) then halt = true end - end - end - if obj.Load then - if(not halt) then - obj:Load() - obj.Load = nil - --print(schema) - end - end - end - end - - twipe(ModuleQueue) - end - - if ScriptQueue then - for i=1, #ScriptQueue do - local fn = ScriptQueue[i] - if(fn and type(fn) == "function") then - fn() - end - end - - ScriptQueue = nil - end -end - -function lib:NewPrototype(name) - local version = GetAddOnMetadata(name, "Version") - local schema = GetAddOnMetadata(name, SchemaFromMeta) - - local obj = { - ___addonName = name, - ___version = version, - ___schema = schema, - db = {["enable"] = false} - } - - 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) - - AddonCore[schema] = obj - - return obj -end - -function lib:GetPlugins(tableList) - if(tableList and tableList ~= false) then - return PluginList - end - return PluginString -end - -function lib:Initialize() - --initialize database - LDB:Initialize() - - --set core storage - LDB:NewDatabase(AddonCore) - - local addonCount = GetNumAddOns() - for i = 1, addonCount do - local addonName, _, _, _, _, reason = GetAddOnInfo(i) - local lod = IsAddOnLoadOnDemand(i) - local header = GetAddOnMetadata(i, HeaderFromMeta) - local schema = GetAddOnMetadata(i, SchemaFromMeta) - - if(lod and schema) then - self:NewAddon(addonName, schema, header) - end - end -end - ---[[ CONSTRUCTORS ]]-- - -local Core_DeadFunction = function() return end - -local Core_StaticPopup_Show = function(self, arg) - if arg == "ADDON_ACTION_FORBIDDEN" then - StaticPopup_Hide(arg) - end -end - -local function _sendmessage(msg, prefix) - if(type(msg) == "table") then - msg = tostring(msg) - end - - if(not msg) then return end - - if(prefix) then - local outbound = ("%s %s"):format(prefix, msg); - print(outbound) - else - print(msg) - end -end - -local Core_Debugger = function(self, msg) - if(not self.___debugging) then return end - local outbound = (debugPattern):format(self.___addonName, "DEBUG") - _sendmessage(msg, outbound) -end - -local Core_AddonMessage = function(self, msg) - local outbound = (messagePattern):format(self.___addonName) - _sendmessage(msg, outbound) -end - -function lib:NewCore(gfile, pfile, cfile) - local obj = {}; - --internals - AddonCore.___addonName = AddonName; - AddonCore.___version = AddonVersion; - AddonCore.___interface = tonumber(uiVersion); - AddonCore.___debugging = false; - AddonCore.___schema = "SVSystem"; - --functions - AddonCore.fubar = Core_DeadFunction; - AddonCore.AddonMessage = Core_AddonMessage; - AddonCore.Debugger = Core_Debugger; - AddonCore.StaticPopup_Show = Core_StaticPopup_Show; - --storage - AddonCore.db = {}; - - local mt = {}; - local old = getmetatable(AddonCore); - if old then - for k, v in pairs(old) do mt[k] = v end - end - mt.__tostring = rootstring; - setmetatable(AddonCore, mt); - - --set global - _G[AddonName] = AddonCore; - - --database settings - LDB:DefineCore(AddonName, gfile, pfile, cfile) - - return AddonCore -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/libs.xml b/Interface/AddOns/SVUI/libs/libs.xml index 0715887..2939c19 100644 --- a/Interface/AddOns/SVUI/libs/libs.xml +++ b/Interface/AddOns/SVUI/libs/libs.xml @@ -4,6 +4,6 @@ <Script file="CallbackHandler-1.0\CallbackHandler-1.0.lua"/> <Script file="LibSharedMedia-3.0\LibSharedMedia-3.0.lua"/> <Script file="LibActionButton-1.0\LibActionButton-1.0.lua"/> - <Script file="LibDataBroker-1.1\LibDataBroker-1.1.lua"/> + <Script file="libdatabroker-1.1\LibDataBroker-1.1.lua"/> <Include file="oUF_Villain\oUF_Villain.xml"/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/bag/SVBag.lua b/Interface/AddOns/SVUI/packages/bag/SVBag.lua index 3d5ddb9..dfbccf2 100644 --- a/Interface/AddOns/SVUI/packages/bag/SVBag.lua +++ b/Interface/AddOns/SVUI/packages/bag/SVBag.lua @@ -1017,7 +1017,7 @@ do frame.sortButton.ttText = L["Sort Bags"] frame.sortButton:SetScript("OnEnter", Tooltip_Show) frame.sortButton:SetScript("OnLeave", Tooltip_Hide) - local Sort_OnClick = (SV.___interface >= 60000) and SortBankBags or MOD:RunSortingProcess(MOD.Sort, "bags") + local Sort_OnClick = (SV.GameVersion >= 60000) and SortBankBags or MOD:RunSortingProcess(MOD.Sort, "bags") frame.sortButton:SetScript("OnClick", Sort_OnClick) frame.stackButton = NewFrame("Button", nil, frame) @@ -1159,7 +1159,7 @@ do frame.sortButton.ttText = L["Sort Bags"] frame.sortButton:SetScript("OnEnter", Tooltip_Show) frame.sortButton:SetScript("OnLeave", Tooltip_Hide) - local Sort_OnClick = (SV.___interface >= 60000) and SortReagentBankBags or MOD:RunSortingProcess(MOD.Sort, "bank") + local Sort_OnClick = (SV.GameVersion >= 60000) and SortReagentBankBags or MOD:RunSortingProcess(MOD.Sort, "bank") frame.sortButton:SetScript("OnClick", Sort_OnClick) frame.stackButton = NewFrame("Button", nil, frame) @@ -1227,7 +1227,7 @@ do end frame.purchaseBagButton:SetScript("OnClick", PurchaseBtn_OnClick) - if(SV.___interface >= 60000) then + if(SV.GameVersion >= 60000) then frame.swapButton = NewFrame("Button", nil, frame) frame.swapButton:Point("TOPRIGHT", frame, "TOPRIGHT", -40, -10) frame.swapButton:Size(25, 25) @@ -1347,7 +1347,7 @@ do end function MOD:BANKFRAME_OPENED() - local hasReagent = (SV.___interface >= 60000) + local hasReagent = (SV.GameVersion >= 60000) if not MOD.BankFrame then MOD:MakeBankOrReagent() MOD:ModifyBags() @@ -1426,7 +1426,7 @@ function MOD:Load() self:RegisterEvent("PLAYER_ENTERING_WORLD") self:RegisterEvent("PLAYER_TRADE_MONEY", "UpdateGoldText") self:RegisterEvent("TRADE_MONEY_CHANGED", "UpdateGoldText") - if(SV.___interface >= 60000) then self:RegisterEvent("PLAYERBANKBAGSLOTS_CHANGED"); end + if(SV.GameVersion >= 60000) then self:RegisterEvent("PLAYERBANKBAGSLOTS_CHANGED"); end StackSplitFrame:SetFrameStrata("DIALOG") self.BagFrame:RefreshBagsSlots() end diff --git a/Interface/AddOns/SVUI/packages/map/SVMap.lua b/Interface/AddOns/SVUI/packages/map/SVMap.lua index fb7d719..6c1a82b 100644 --- a/Interface/AddOns/SVUI/packages/map/SVMap.lua +++ b/Interface/AddOns/SVUI/packages/map/SVMap.lua @@ -420,7 +420,7 @@ local function UpdateWorldMapConfig() if(not MOD.WorldMapHooked) then NewHook("WorldMap_ToggleSizeUp", AdjustMapSize) NewHook("WorldMap_ToggleSizeDown", SetSmallWorldMap) - if(SV.___interface < 60000) then + if(SV.GameVersion < 60000) then NewHook("WorldMapFrame_SetFullMapView", SetLargeWorldMap) NewHook("WorldMapFrame_SetQuestMapView", SetQuestWorldMap) end @@ -825,7 +825,7 @@ end local function LoadWorldMap() setfenv(WorldMapFrame_OnShow, setmetatable({ UpdateMicroButtons = SV.fubar }, { __index = _G })) - if(SV.___interface < 60000) then + if(SV.GameVersion < 60000) then WorldMapShowDropDown:Point('BOTTOMRIGHT',WorldMapPositioningGuide,'BOTTOMRIGHT',-2,-4) WorldMapZoomOutButton:Point("LEFT",WorldMapZoneDropDown,"RIGHT",0,4) WorldMapLevelUpButton:Point("TOPLEFT",WorldMapLevelDropDown,"TOPRIGHT",-2,8) diff --git a/Interface/AddOns/SVUI/packages/override/SVOverride.lua b/Interface/AddOns/SVUI/packages/override/SVOverride.lua index c899d2a..c1cf341 100644 --- a/Interface/AddOns/SVUI/packages/override/SVOverride.lua +++ b/Interface/AddOns/SVUI/packages/override/SVOverride.lua @@ -1062,7 +1062,7 @@ function MOD:Load() self:RegisterEvent("CONFIRM_LOOT_ROLL", AutoConfirmLoot) self:RegisterEvent("LOOT_BIND_CONFIRM", AutoConfirmLoot) - if(SV.___interface < 60000) then + if(SV.GameVersion < 60000) then self:RegisterEvent("LOOT_OPENED", OpenedLootHandler) else self:RegisterEvent("LOOT_READY", OpenedLootHandler) diff --git a/Interface/AddOns/SVUI/scripts/mounts.lua b/Interface/AddOns/SVUI/scripts/mounts.lua index d04f9c3..694d69a 100644 --- a/Interface/AddOns/SVUI/scripts/mounts.lua +++ b/Interface/AddOns/SVUI/scripts/mounts.lua @@ -348,7 +348,7 @@ local function SetMountCheckButtons() scrollBar:HookScript("OnValueChanged", Update_MountCheckButtons) UpdateCurrentMountSelection() - if(SV.___interface >= 60000) then + if(SV.GameVersion >= 60000) then MountListener:RegisterEvent("MOUNT_JOURNAL_USABILITY_CHANGED") end diff --git a/Interface/AddOns/SVUI/scripts/questwatch.lua b/Interface/AddOns/SVUI/scripts/questwatch.lua index a621c06..f06e467 100644 --- a/Interface/AddOns/SVUI/scripts/questwatch.lua +++ b/Interface/AddOns/SVUI/scripts/questwatch.lua @@ -324,7 +324,7 @@ end local function CreateQuestDocklet() SuperDockWindowRight = _G["SuperDockWindowRight"] - if(SV.___interface >= 60000) then + if(SV.GameVersion >= 60000) then ObjectiveTrackerFrame:RemoveTextures(true) diff --git a/Interface/AddOns/SVUI/system/load.lua b/Interface/AddOns/SVUI/system/load.lua index 6728f1d..4e1879b 100644 --- a/Interface/AddOns/SVUI/system/load.lua +++ b/Interface/AddOns/SVUI/system/load.lua @@ -171,7 +171,7 @@ function SV:Launch() _G["SVUI_MentaloPrecision"]:SetPanelTemplate("Transparent") if self.db.loginmessage then - local logMsg = (L["LOGIN_MSG"]):format("|cffFFFF1A", "|cffAA78FF", self.___version) + local logMsg = (L["LOGIN_MSG"]):format("|cffFFFF1A", "|cffAA78FF", self.Version) self:AddonMessage(logMsg); end diff --git a/Interface/AddOns/SVUI/system/setup.lua b/Interface/AddOns/SVUI/system/setup.lua index 841ca5c..08d5140 100644 --- a/Interface/AddOns/SVUI/system/setup.lua +++ b/Interface/AddOns/SVUI/system/setup.lua @@ -1664,7 +1664,7 @@ local function PlayThemeSong() end local function InstallComplete() - SVUI_Profile.SAFEDATA.install_version = SV.___version; + SVUI_Profile.SAFEDATA.install_version = SV.Version; StopMusic() SetCVar("Sound_MusicVolume",user_music_vol) okToResetMOVE = false; @@ -1683,7 +1683,7 @@ local function InstallMungsChoice() SV.db.LAYOUT.barstyle = nil; SetupBarLayout(); SetupAuralayout(); - SVUI_Profile.SAFEDATA.install_version = SV.___version; + SVUI_Profile.SAFEDATA.install_version = SV.Version; StopMusic() SetCVar("Sound_MusicVolume",user_music_vol) ReloadUI() @@ -1751,7 +1751,7 @@ local function SetPage(newPage) SVUI_InstallPrevButton:Disable() SVUI_InstallPrevButton:Hide() okToResetMOVE = true - setupFrame.SubTitle:SetText(format(L["This is Supervillain UI version %s!"], SV.___version)) + setupFrame.SubTitle:SetText(format(L["This is Supervillain UI version %s!"], SV.Version)) setupFrame.Desc1:SetText(L["Before I can turn you loose, persuing whatever villainy you feel will advance your professional career... I need to ask some questions and turn a few screws first."]) setupFrame.Desc2:SetText(L["At any time you can get to the config options by typing the command / sv. For quick changes to frame, bar or color sets, call your henchman by clicking the button on the bottom right of your screen. (Its the one with his stupid face on it)"]) setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) @@ -2067,7 +2067,7 @@ function Setup:Reset() SetupAuralayout() end - SVUI_Profile.SAFEDATA.install_version = SV.___version; + SVUI_Profile.SAFEDATA.install_version = SV.Version; ResetGlobalVariables() ReloadUI() end diff --git a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua index 573480d..e4b1cae 100644 --- a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua +++ b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua @@ -54,13 +54,13 @@ local L = SVLib:Lang() local NewHook = hooksecurefunc; PLUGIN = SVLib:NewPrototype(SVUIAddOnName) -local SCHEMA = PLUGIN.___schema; +local Schema = PLUGIN.Schema; _G["WhisperVillain"] = PLUGIN; local PlayersName = UnitName("player") -SV.configs[SCHEMA] = { +SV.configs[Schema] = { ["enable"] = true, ["autoAnswer"] = false, ["prefix"] = true diff --git a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua index da1dffa..d2d76bd 100644 --- a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua +++ b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua @@ -60,7 +60,7 @@ local L = SVLib:Lang() local NewHook = hooksecurefunc; PLUGIN = SVLib:NewPrototype(SVUIAddOnName) -local SCHEMA = PLUGIN.___schema; +local Schema = PLUGIN.Schema; _G["WarVillain"] = PLUGIN; --[[ @@ -193,7 +193,7 @@ end CORE FUNCTIONS ########################################################## ]]-- -SV.configs[SCHEMA] = { +SV.configs[Schema] = { ["enable"] = true } diff --git a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua index a7520d3..f373627 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua @@ -124,7 +124,7 @@ SET PACKAGE OPTIONS SV.Options.args.SVUI_Header = { order = 1, type = "header", - name = "You are using |cffff9900Super Villain UI|r - "..L["Version"]..format(": |cff99ff33%s|r", SV.___version), + name = "You are using |cffff9900Super Villain UI|r - "..L["Version"]..format(": |cff99ff33%s|r", SV.Version), width = "full" } diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/_load.xml b/Interface/AddOns/SVUI_ConfigOMatic/modules/_load.xml index 8e786b1..4d556b6 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/_load.xml +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/_load.xml @@ -9,10 +9,8 @@ <Script file='stat.lua'/> <Script file='filter.lua'/> <Script file='plate.lua'/> - <Script file='art.lua'/> <Script file='tip.lua'/> <Include file='units\_load.xml'/> - <!-- <Script file='ct.lua'/> --> <Script file='dynamic.lua'/> <Script file='profiles.lua'/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/art.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/art.lua deleted file mode 100644 index be801da..0000000 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/art.lua +++ /dev/null @@ -1,340 +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 pairs = _G.pairs; -local tinsert = _G.tinsert; -local table = _G.table; ---[[ TABLE METHODS ]]-- -local tsort = table.sort; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = SVUI; -local L = LibStub("LibSuperVillain-1.0"):Lang(); -SV.Options.args.SVStyle={ - type = "group", - name = L["UI Styling"], - childGroups = "tree", - args = { - intro = { - order = 1, - type = "description", - name = L["ART_DESC"] - }, - blizzardEnable = { - order = 2, - type = "toggle", - name = "Standard UI Styling", - get = function(a)return SV.SVStyle.db.blizzard.enable end, - set = function(a,b)SV.SVStyle.db.blizzard.enable = b;SV:StaticPopup_Show("RL_CLIENT")end - }, - addonEnable = { - order = 3, - type = "toggle", - name = "Addon Styling", - get = function(a)return SV.SVStyle.db.addons.enable end, - set = function(a,b)SV.SVStyle.db.addons.enable = b;SV:StaticPopup_Show("RL_CLIENT")end - }, - blizzard = { - order = 300, - type = "group", - name = "Individual Mods", - get = function(a)return SV.SVStyle.db.blizzard[a[#a]]end, - set = function(a,b)SV.SVStyle.db.blizzard[a[#a]] = b;SV:StaticPopup_Show("RL_CLIENT")end, - disabled = function()return not SV.SVStyle.db.blizzard.enable end, - guiInline = true, - args = { - bmah = { - type = "toggle", - name = L["Black Market AH"], - desc = L["TOGGLEART_DESC"] - }, - transmogrify = { - type = "toggle", - name = L["Transmogrify Frame"], - desc = L["TOGGLEART_DESC"] - }, - encounterjournal = { - type = "toggle", - name = L["Encounter Journal"], - desc = L["TOGGLEART_DESC"] - }, - reforge = { - type = "toggle", - name = L["Reforge Frame"], - desc = L["TOGGLEART_DESC"] - }, - calendar = { - type = "toggle", - name = L["Calendar Frame"], - desc = L["TOGGLEART_DESC"] - }, - achievement = { - type = "toggle", - name = L["Achievement Frame"], - desc = L["TOGGLEART_DESC"] - }, - lfguild = { - type = "toggle", - name = L["LF Guild Frame"], - desc = L["TOGGLEART_DESC"] - }, - inspect = { - type = "toggle", - name = L["Inspect Frame"], - desc = L["TOGGLEART_DESC"] - }, - binding = { - type = "toggle", - name = L["KeyBinding Frame"], - desc = L["TOGGLEART_DESC"] - }, - gbank = { - type = "toggle", - name = L["Guild Bank"], - desc = L["TOGGLEART_DESC"] - }, - archaeology = { - type = "toggle", - name = L["Archaeology Frame"], - desc = L["TOGGLEART_DESC"] - }, - guildcontrol = { - type = "toggle", - name = L["Guild Control Frame"], - desc = L["TOGGLEART_DESC"] - }, - guild = { - type = "toggle", - name = L["Guild Frame"], - desc = L["TOGGLEART_DESC"] - }, - tradeskill = { - type = "toggle", - name = L["TradeSkill Frame"], - desc = L["TOGGLEART_DESC"] - }, - raid = { - type = "toggle", - name = L["Raid Frame"], - desc = L["TOGGLEART_DESC"] - }, - talent = { - type = "toggle", - name = L["Talent Frame"], - desc = L["TOGGLEART_DESC"] - }, - auctionhouse = { - type = "toggle", - name = L["Auction Frame"], - desc = L["TOGGLEART_DESC"] - }, - timemanager = { - type = "toggle", - name = L["Time Manager"], - desc = L["TOGGLEART_DESC"] - }, - barber = { - type = "toggle", - name = L["Barbershop Frame"], - desc = L["TOGGLEART_DESC"] - }, - macro = { - type = "toggle", - name = L["Macro Frame"], - desc = L["TOGGLEART_DESC"] - }, - debug = { - type = "toggle", - name = L["Debug Tools"], - desc = L["TOGGLEART_DESC"] - }, - trainer = { - type = "toggle", - name = L["Trainer Frame"], - desc = L["TOGGLEART_DESC"] - }, - socket = { - type = "toggle", - name = L["Socket Frame"], - desc = L["TOGGLEART_DESC"] - }, - alertframes = { - type = "toggle", - name = L["Alert Frames"], - desc = L["TOGGLEART_DESC"] - }, - loot = { - type = "toggle", - name = L["Loot Frames"], - desc = L["TOGGLEART_DESC"] - }, - bgscore = { - type = "toggle", - name = L["BG Score"], - desc = L["TOGGLEART_DESC"] - }, - merchant = { - type = "toggle", - name = L["Merchant Frame"], - desc = L["TOGGLEART_DESC"] - }, - mail = { - type = "toggle", - name = L["Mail Frame"], - desc = L["TOGGLEART_DESC"] - }, - help = { - type = "toggle", - name = L["Help Frame"], - desc = L["TOGGLEART_DESC"] - }, - trade = { - type = "toggle", - name = L["Trade Frame"], - desc = L["TOGGLEART_DESC"] - }, - gossip = { - type = "toggle", - name = L["Gossip Frame"], - desc = L["TOGGLEART_DESC"] - }, - greeting = { - type = "toggle", - name = L["Greeting Frame"], - desc = L["TOGGLEART_DESC"] - }, - worldmap = { - type = "toggle", - name = L["World Map"], - desc = L["TOGGLEART_DESC"] - }, - taxi = { - type = "toggle", - name = L["Taxi Frame"], - desc = L["TOGGLEART_DESC"] - }, - lfg = { - type = "toggle", - name = L["LFG Frame"], - desc = L["TOGGLEART_DESC"] - }, - mounts = { - type = "toggle", - name = L["Mounts & Pets"], - desc = L["TOGGLEART_DESC"] - }, - quest = { - type = "toggle", - name = L["Quest Frames"], - desc = L["TOGGLEART_DESC"] - }, - petition = { - type = "toggle", - name = L["Petition Frame"], - desc = L["TOGGLEART_DESC"] - }, - dressingroom = { - type = "toggle", - name = L["Dressing Room"], - desc = L["TOGGLEART_DESC"] - }, - pvp = { - type = "toggle", - name = L["PvP Frames"], - desc = L["TOGGLEART_DESC"] - }, - nonraid = { - type = "toggle", - name = L["Non-Raid Frame"], - desc = L["TOGGLEART_DESC"] - }, - friends = { - type = "toggle", - name = L["Friends"], - desc = L["TOGGLEART_DESC"] - }, - spellbook = { - type = "toggle", - name = L["Spellbook"], - desc = L["TOGGLEART_DESC"] - }, - character = { - type = "toggle", - name = L["Character Frame"], - desc = L["TOGGLEART_DESC"] - }, - misc = { - type = "toggle", - name = L["Misc Frames"], - desc = L["TOGGLEART_DESC"] - }, - tabard = { - type = "toggle", - name = L["Tabard Frame"], - desc = L["TOGGLEART_DESC"] - }, - guildregistrar = { - type = "toggle", - name = L["Guild Registrar"], - desc = L["TOGGLEART_DESC"] - }, - bags = { - type = "toggle", - name = L["Bags"], - desc = L["TOGGLEART_DESC"] - }, - stable = { - type = "toggle", - name = L["Stable"], - desc = L["TOGGLEART_DESC"] - }, - bgmap = { - type = "toggle", - name = L["BG Map"], - desc = L["TOGGLEART_DESC"] - }, - petbattleui = { - type = "toggle", - name = L["Pet Battle"], - desc = L["TOGGLEART_DESC"] - }, - losscontrol = { - type = "toggle", - name = L["Loss Control"], - desc = L["TOGGLEART_DESC"] - }, - voidstorage = { - type = "toggle", - name = L["Void Storage"], - desc = L["TOGGLEART_DESC"] - }, - itemUpgrade = { - type = "toggle", - name = L["Item Upgrade"], - desc = L["TOGGLEART_DESC"] - } - } - } - } -} \ No newline at end of file diff --git a/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.lua b/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.lua index 8f4d1e7..97b3e02 100644 --- a/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.lua +++ b/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.lua @@ -52,7 +52,7 @@ local playerGUID = UnitGUID('player') local classColor = RAID_CLASS_COLORS PLUGIN = SVLib:NewPrototype(SVUIAddOnName) -local SCHEMA = PLUGIN.___schema; +local Schema = PLUGIN.Schema; _G["LaborVillain"] = PLUGIN; --[[ @@ -140,7 +140,7 @@ end CORE FUNCTIONS ########################################################## ]]-- -SV.configs[SCHEMA] = { +SV.configs[Schema] = { ["enable"] = true, ["fontSize"] = 12, ["farming"] = { diff --git a/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua index 18dc28a..03ee484 100644 --- a/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua +++ b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua @@ -44,7 +44,7 @@ local L = SVLib:Lang() local NewHook = hooksecurefunc; PLUGIN = SVLib:NewPrototype(SVUIAddOnName) -local SCHEMA = PLUGIN.___schema; +local Schema = PLUGIN.Schema; _G["LogVillain"] = PLUGIN; local CHAT = SV.SVChat; @@ -86,7 +86,7 @@ PLUGIN.stash = {}; PLUGIN.myStash = {}; PLUGIN.BagItemCache = {}; PLUGIN.HasAltInventory = false; -SV.configs[SCHEMA] = { +SV.configs[Schema] = { ["enable"] = true, ["saveChats"] = false } diff --git a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua index 46ecfa9..220f481 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua @@ -44,8 +44,8 @@ local L = SVLib:Lang() local NewHook = hooksecurefunc; PLUGIN = SVLib:NewPrototype(SVUIAddOnName) -local SCHEMA = PLUGIN.___schema; -local VERSION = PLUGIN.___version; +local Schema = PLUGIN.Schema; +local VERSION = PLUGIN.Version; _G["StyleVillain"] = PLUGIN; --[[ @@ -413,7 +413,7 @@ function PLUGIN:Load() NewHook(SV, "ReloadDocklets", RegisterAddonDocklets); SV:ReloadDocklets(); - SV.DynamicOptions[SCHEMA] = {key = "addons", data = self.OptionsCache}; + SV.DynamicOptions[Schema] = {key = "addons", data = self.OptionsCache}; local option = { order = 2, @@ -726,7 +726,7 @@ function PLUGIN:Load() self:RegisterEvent("ADDON_LOADED"); end -SV.configs[SCHEMA] = { +SV.configs[Schema] = { ["enable"] = true, ["blizzard"] = { ["enable"] = true, diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua index 7754161..a7b4f16 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua @@ -340,7 +340,7 @@ local function GuildFrameStyle() GuildFactionBar.Panel:Point("TOPLEFT", GuildFactionBar.progress, "TOPLEFT", -1, 1) GuildFactionBar.Panel:Point("BOTTOMRIGHT", GuildFactionBar, "BOTTOMRIGHT", 1, 1) - if(SV.___interface < 60000) then + if(SV.GameVersion < 60000) then GuildLevelFrame:Die() GuildXPFrame:ClearAllPoints() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/petjournal.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/petjournal.lua index 008203f..fe0603b 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/petjournal.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/petjournal.lua @@ -248,7 +248,7 @@ local function PetJournalStyle() PetJournalPetCardXPBar:SetPanelTemplate('Default') PetJournalPetCardXPBar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - if(SV.___interface >= 60000) then + if(SV.GameVersion >= 60000) then STYLE:ApplyTabStyle(PetJournalParentTab3) ToyBox:RemoveTextures() ToyBoxProgressBar:SetPanelTemplate("Bar", true) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/pvp.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/pvp.lua index 368008d..5835960 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/pvp.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/pvp.lua @@ -65,7 +65,7 @@ local function PVPFrameStyle() HonorFrame.BonusFrame.RandomBGButton.SelectedTexture:FillInner() HonorFrame.BonusFrame.RandomBGButton.SelectedTexture:SetTexture(1, 1, 0, 0.1) - if(SV.___interface < 60000) then + if(SV.GameVersion < 60000) then PVPUIFrame.Shadows:RemoveTextures() HonorFrame.BonusFrame.CallToArmsButton:RemoveTextures() HonorFrame.BonusFrame.CallToArmsButton:SetFixedPanelTemplate("Button") diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua index 10e11c1..0c88961 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua @@ -122,7 +122,7 @@ local function QuestFrameStyle() STYLE:ApplyWindowStyle(QuestFrame, true, true) --[[ THIS SECTION NOT WORKING IN WOD ]]-- - if(SV.___interface < 60000) then + if(SV.GameVersion < 60000) then QuestLogScrollFrame:RemoveTextures() QuestLogCount:RemoveTextures() EmptyQuestLogFrame:RemoveTextures() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/system.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/system.lua index a4b5519..2a9e2d0 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/system.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/system.lua @@ -569,7 +569,7 @@ local function SystemPanelQue() end end) - if(SV.___interface < 60000) then + if(SV.GameVersion < 60000) then GuildInviteFrame:RemoveTextures() GuildInviteFrame:SetFixedPanelTemplate('Transparent') GuildInviteFrameLevel:RemoveTextures() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/worldmap.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/worldmap.lua index 00edb0d..e5d0d70 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/worldmap.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/worldmap.lua @@ -39,7 +39,7 @@ end local function WorldMap_FullView() WorldMapFrame.Panel:ClearAllPoints() - if(SV.___interface >= 60000) then + if(SV.GameVersion >= 60000) then WorldMapFrame.Panel:Point("TOPLEFT", WorldMapDetailFrame, "TOPLEFT", -12, 74) WorldMapFrame.Panel:Point("BOTTOMRIGHT", WorldMapDetailFrame, "BOTTOMRIGHT", 12, -24) else @@ -137,7 +137,7 @@ end local function WorldMap_OnShow() - if(SV.___interface >= 60000) then + if(SV.GameVersion >= 60000) then --StripQuestMapFrame() if WORLDMAP_SETTINGS.size == WORLDMAP_FULLMAP_SIZE then WorldMap_FullView() @@ -208,7 +208,7 @@ local function WorldMapStyle() STYLE:ApplyDropdownStyle(WorldMapZoneDropDown) STYLE:ApplyDropdownStyle(WorldMapShowDropDown) - if(SV.___interface < 60000) then + if(SV.GameVersion < 60000) then WorldMapZoomOutButton:SetButtonTemplate() WorldMapTrackQuest:SetCheckboxTemplate(true) hooksecurefunc("WorldMapFrame_SetFullMapView", WorldMap_FullView) diff --git a/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.lua b/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.lua index e991657..d49348b 100644 --- a/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.lua +++ b/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.lua @@ -68,14 +68,14 @@ local classColor = RAID_CLASS_COLORS local radian90 = (3.141592653589793 / 2) * -1; local GetDistance, GetTarget, GetFromPlayer; -local SCHEMA = PLUGIN.___schema; -local VERSION = PLUGIN.___version; +local Schema = PLUGIN.Schema; +local VERSION = PLUGIN.Version; --[[ ########################################################## BUILD ########################################################## ]]-- -SV.configs[SCHEMA] = { +SV.configs[Schema] = { ["enable"] = true, ["size"] = 75, ["fontSize"] = 12,