diff --git a/Interface/AddOns/SVUI/SVUI.lua b/Interface/AddOns/SVUI/SVUI.lua index 5d55510..e043bf4 100644 --- a/Interface/AddOns/SVUI/SVUI.lua +++ b/Interface/AddOns/SVUI/SVUI.lua @@ -264,9 +264,6 @@ local SVUI = SVLib:NewCore("SVUI_Global", "SVUI_Profile", "SVUI_Cache") SVUI.ConfigID = "SVUI_ConfigOMatic"; SVUI.Media = {} -SVUI.DisplayAudit = {} -SVUI.DynamicOptions = {} -SVUI.Dispellable = {} SVUI.class = playerClass SVUI.ClassRole = "" 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 294908d..5b72ec7 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 @@ -630,14 +630,6 @@ local unregisterUpdate = function(self, updatefunc) end end -local appendOptions = function(self, index, data) - local addonName = self.NameID - local schema = self.Schema - local header = GetAddOnMetadata(addonName, HeaderFromMeta) - - CoreObject.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 @@ -781,7 +773,6 @@ function lib:NewPlugin(addonName, addonObject) addonObject.UnregisterEvent = unregisterEvent addonObject.RegisterUpdate = registerUpdate addonObject.UnregisterUpdate = unregisterUpdate - addonObject.AddOption = appendOptions if(IsAddOnLoaded(addonName) and not lod) then CoreObject.Options.args.plugins.args.pluginOptions.args[schema] = { diff --git a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua index 4b04436..81e418c 100644 --- a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua +++ b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua @@ -67,6 +67,7 @@ MODULE AND INNER CLASSES local MOD = SV:NewPackage("SVUnit", L["UnitFrames"]) MOD.Units = {} MOD.Headers = {} +MOD.Dispellable = {} oUF_Villain.SVConfigs = {} --[[ @@ -1436,6 +1437,62 @@ local UnitFrameThreatIndicator_Hook = function(unit, unitFrame) end --[[ ########################################################## +CLASS SPECIFIC INFO +########################################################## +]]-- +local RefMagicSpec; +local PlayerClass = select(2,UnitClass("player")); +local droodSpell1, droodSpell2 = GetSpellInfo(110309), GetSpellInfo(4987); + +if(PlayerClass == "PRIEST") then + MOD.Dispellable = {["Magic"] = true, ["Disease"] = true} +elseif(PlayerClass == "MAGE") then + MOD.Dispellable = {["Curse"] = true} +elseif(PlayerClass == "DRUID") then + RefMagicSpec = 4 + MOD.Dispellable = {["Curse"] = true, ["Poison"] = true} +elseif(PlayerClass == "SHAMAN") then + RefMagicSpec = 3 + MOD.Dispellable = {["Curse"] = true} +elseif(PlayerClass == "MONK") then + RefMagicSpec = 2 + MOD.Dispellable = {["Disease"] = true, ["Poison"] = true} +elseif(PlayerClass == "PALADIN") then + RefMagicSpec = 1 + MOD.Dispellable = {["Poison"] = true, ["Disease"] = true} +end + +local function GetTalentInfo(arg) + if type(arg) == "number" then + return arg == GetActiveSpecGroup(); + else + return false; + end +end + +function MOD:CanClassDispel() + if RefMagicSpec then + if(GetTalentInfo(RefMagicSpec)) then + self.Dispellable["Magic"] = true + elseif(self.Dispellable["Magic"]) then + self.Dispellable["Magic"] = nil + end + end +end + +function MOD:SPELLS_CHANGED() + if (PlayerClass ~= "DRUID") then + self:UnregisterEvent("SPELLS_CHANGED") + return + end + if GetSpellInfo(droodSpell1) == droodSpell2 then + self.Dispellable["Disease"] = true + elseif(SV.Dispellable["Disease"]) then + self.Dispellable["Disease"] = nil + end +end +--[[ +########################################################## BUILD FUNCTION / UPDATE ########################################################## ]]-- @@ -1451,9 +1508,18 @@ function MOD:Load() local SVUI_UnitFrameParent = CreateFrame("Frame", "SVUI_UnitFrameParent", SV.UIParent, "SecureHandlerStateTemplate") RegisterStateDriver(SVUI_UnitFrameParent, "visibility", "[petbattle] hide; show") + self:CanClassDispel() + self:FrameForge() self:RegisterEvent("PLAYER_ENTERING_WORLD") self:RegisterEvent("PLAYER_REGEN_DISABLED") + self:RegisterEvent("SPELLS_CHANGED") + + self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED", "CanClassDispel") + self:RegisterEvent("PLAYER_TALENT_UPDATE", "CanClassDispel") + self:RegisterEvent("CHARACTER_POINTS_CHANGED", "CanClassDispel") + self:RegisterEvent("UNIT_INVENTORY_CHANGED", "CanClassDispel") + self:RegisterEvent("UPDATE_BONUS_ACTIONBAR", "CanClassDispel") if(SV.db.SVUnit.disableBlizzard) then self:KillBlizzardRaidFrames() diff --git a/Interface/AddOns/SVUI/packages/unit/elements/auras.lua b/Interface/AddOns/SVUI/packages/unit/elements/auras.lua index 3d0fc2e..20d02f2 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/auras.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/auras.lua @@ -331,7 +331,7 @@ do pass = true end if _test(auraDB.filterDispellable, friendly) then - if (auraType == "buffs" and not isStealable) or (auraType == "debuffs" and debuffType and not SV.Dispellable[debuffType]) or debuffType == nil then + if (auraType == "buffs" and not isStealable) or (auraType == "debuffs" and debuffType and not MOD.Dispellable[debuffType]) or debuffType == nil then filtered = false end pass = true @@ -407,7 +407,7 @@ do pass = true end if _test(barDB.filterDispellable, friendly) then - if (debuffType and not SV.Dispellable[debuffType]) or debuffType == nil then + if (debuffType and not MOD.Dispellable[debuffType]) or debuffType == nil then filtered = false end pass = true diff --git a/Interface/AddOns/SVUI/system/load.lua b/Interface/AddOns/SVUI/system/load.lua index 78e6330..eea477c 100644 --- a/Interface/AddOns/SVUI/system/load.lua +++ b/Interface/AddOns/SVUI/system/load.lua @@ -127,18 +127,17 @@ function SV:Launch() NewHook("StaticPopup_Show", self.StaticPopup_Show) - self.UIParent:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED"); - self.UIParent:RegisterEvent("PLAYER_TALENT_UPDATE"); - self.UIParent:RegisterEvent("CHARACTER_POINTS_CHANGED"); - self.UIParent:RegisterEvent("UNIT_INVENTORY_CHANGED"); - self.UIParent:RegisterEvent("UPDATE_BONUS_ACTIONBAR"); - self.UIParent:RegisterEvent("UI_SCALE_CHANGED"); self.UIParent:RegisterEvent("PLAYER_ENTERING_WORLD"); + self.UIParent:RegisterEvent("UI_SCALE_CHANGED"); self.UIParent:RegisterEvent("PET_BATTLE_CLOSE"); self.UIParent:RegisterEvent("PET_BATTLE_OPENING_START"); self.UIParent:RegisterEvent("ADDON_ACTION_BLOCKED"); self.UIParent:RegisterEvent("ADDON_ACTION_FORBIDDEN"); - self.UIParent:RegisterEvent("SPELLS_CHANGED"); + self.UIParent:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED"); + self.UIParent:RegisterEvent("PLAYER_TALENT_UPDATE"); + self.UIParent:RegisterEvent("CHARACTER_POINTS_CHANGED"); + self.UIParent:RegisterEvent("UNIT_INVENTORY_CHANGED"); + self.UIParent:RegisterEvent("UPDATE_BONUS_ACTIONBAR"); SVLib:Update("SVMap"); @@ -156,9 +155,6 @@ end EVENT HANDLERS ########################################################## ]]-- -local PlayerClass = select(2,UnitClass("player")); -local droodSpell1, droodSpell2 = GetSpellInfo(110309), GetSpellInfo(4987); - local SVUISystem_OnEvent = function(self, event, arg, ...) if(event == "ADDON_LOADED" and arg == "SVUI") then if(not SV.AddonLoaded) then @@ -193,16 +189,6 @@ local SVUISystem_OnEvent = function(self, event, arg, ...) if(not InCombatLockdown()) then collectgarbage("collect") end - elseif(event == "SPELLS_CHANGED") then - if (PlayerClass ~= "DRUID") then - self:UnregisterEvent("SPELLS_CHANGED") - return - end - if GetSpellInfo(droodSpell1) == droodSpell2 then - SV.Dispellable["Disease"] = true - elseif(SV.Dispellable["Disease"]) then - SV.Dispellable["Disease"] = nil - end elseif(event == "PET_BATTLE_CLOSE") then SV:PushDisplayAudit() elseif(event == "PET_BATTLE_OPENING_START") then diff --git a/Interface/AddOns/SVUI/system/utilities.lua b/Interface/AddOns/SVUI/system/utilities.lua index 40c6df7..fe7abb1 100644 --- a/Interface/AddOns/SVUI/system/utilities.lua +++ b/Interface/AddOns/SVUI/system/utilities.lua @@ -45,13 +45,11 @@ MISC UTILITY FUNCTIONS ########################################################## ]]-- local RefClassRoles, RefUnitRoles; -local RefMagicSpec; local PlayerClass = select(2,UnitClass("player")); if(PlayerClass == "PRIEST") then RefClassRoles = {"C", "C", "C"} RefUnitRoles = {"HEALER", "HEALER", "DAMAGER"} - SV.Dispellable = {["Magic"] = true, ["Disease"] = true} elseif(PlayerClass == "WARLOCK") then RefClassRoles = {"C", "C", "C"} RefUnitRoles = {"DAMAGER", "DAMAGER", "DAMAGER"} @@ -67,38 +65,21 @@ elseif(PlayerClass == "ROGUE") then elseif(PlayerClass == "MAGE") then RefClassRoles = {"C", "C", "C"} RefUnitRoles = {"DAMAGER", "DAMAGER", "DAMAGER"} - SV.Dispellable = {["Curse"] = true} elseif(PlayerClass == "DEATHKNIGHT") then RefClassRoles = {"T", "M", "M"} RefUnitRoles = {"TANK", "DAMAGER", "DAMAGER"} elseif(PlayerClass == "DRUID") then - RefMagicSpec = 4 RefClassRoles = {"C", "M", "T", "C"} RefUnitRoles = {"DAMAGER", "DAMAGER", "TANK", "HEALER"} - SV.Dispellable = {["Curse"] = true, ["Poison"] = true} elseif(PlayerClass == "SHAMAN") then - RefMagicSpec = 3 RefClassRoles = {"C", "M", "C"} RefUnitRoles = {"DAMAGER", "DAMAGER", "HEALER"} - SV.Dispellable = {["Curse"] = true} elseif(PlayerClass == "MONK") then - RefMagicSpec = 2 RefClassRoles = {"T", "C", "M"} RefUnitRoles = {"TANK", "HEALER", "DAMAGER"} - SV.Dispellable = {["Disease"] = true, ["Poison"] = true} elseif(PlayerClass == "PALADIN") then - RefMagicSpec = 1 RefClassRoles = {"C", "T", "M"} RefUnitRoles = {"HEALER", "TANK", "DAMAGER"} - SV.Dispellable = {["Poison"] = true, ["Disease"] = true} -end - -local function GetTalentInfo(arg) - if type(arg) == "number" then - return arg == GetActiveSpecGroup(); - else - return false; - end end function SV:DefinePlayerRole() @@ -136,13 +117,6 @@ function SV:DefinePlayerRole() self.RoleChangedCallback() end end - if RefMagicSpec then - if(GetTalentInfo(RefMagicSpec)) then - self.Dispellable["Magic"] = true - elseif(self.Dispellable["Magic"]) then - self.Dispellable["Magic"] = nil - end - end end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI/system/visibility.lua b/Interface/AddOns/SVUI/system/visibility.lua index e8b0f91..3842d35 100644 --- a/Interface/AddOns/SVUI/system/visibility.lua +++ b/Interface/AddOns/SVUI/system/visibility.lua @@ -34,6 +34,7 @@ LOCALS ########################################################## ]]-- local DisplayEventHandler = CreateFrame("Frame"); +local DisplayFrames = {}; local SecureFadeManager = CreateFrame("Frame"); local SecureFadeFrames = {}; --[[ @@ -42,27 +43,24 @@ FRAME VISIBILITY MANAGEMENT ########################################################## ]]-- function SV:AddToDisplayAudit(frame) - if frame.IsVisible and frame:GetName() then - self.DisplayAudit[frame:GetName()] = true + if frame.IsVisible and frame.GetParent then + DisplayFrames[frame] = frame:GetParent() end end function SV:FlushDisplayAudit() if InCombatLockdown() then return end - for frame,_ in pairs(self.DisplayAudit)do - if _G[frame] then - _G[frame]:SetParent(SV.Cloaked) - end + for frame,_ in pairs(DisplayFrames)do + frame:SetParent(SV.Cloaked) end DisplayEventHandler:RegisterEvent("PLAYER_REGEN_DISABLED") end function SV:PushDisplayAudit() - if InCombatLockdown() then return end - for frame,_ in pairs(self.DisplayAudit)do - if _G[frame] then - _G[frame]:SetParent(UIParent) - end + if InCombatLockdown() then return end + local default = self.UIParent + for frame,parent in pairs(DisplayFrames)do + frame:SetParent(parent or default) end DisplayEventHandler:UnregisterEvent("PLAYER_REGEN_DISABLED") end diff --git a/Interface/AddOns/SVUI_ChatOMatic/Loader.lua b/Interface/AddOns/SVUI_ChatOMatic/Loader.lua index 5021d5b..8537d1c 100644 --- a/Interface/AddOns/SVUI_ChatOMatic/Loader.lua +++ b/Interface/AddOns/SVUI_ChatOMatic/Loader.lua @@ -24,9 +24,33 @@ local PLUGIN = LibSuperVillain:NewPlugin(AddonName, AddonObject) local Schema = PLUGIN.Schema; local SV = _G["SVUI"]; - +--[[ +########################################################## +CONFIG DATA +########################################################## +]]-- SV.configs[Schema] = { - ["enable"] = true, - ["autoAnswer"] = false, - ["prefix"] = true + ["enable"] = true, + ["autoAnswer"] = false, + ["prefix"] = true +} +--[[ +########################################################## +CONFIG OPTIONS +########################################################## +]]-- +SV.Options.args.plugins.args.pluginOptions.args[Schema].args["autoAnswer"] = { + order = 2, + name = "Auto Answer", + type = "toggle", + get = function(key) return SV.db[Schema][key[#key]] end, + set = function(key,value) SV.db[Schema][key[#key]] = value end +} + +SV.Options.args.plugins.args.pluginOptions.args[Schema].args["prefix"] = { + order = 3, + name = "Prefix Messages", + type = "toggle", + get = function(key) return SV.db[Schema][key[#key]] end, + set = function(key,value) SV.db[Schema][key[#key]] = value end } \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ChatOMatic/SVUI_ChatOMatic.lua b/Interface/AddOns/SVUI_ChatOMatic/SVUI_ChatOMatic.lua index fd09ef1..ec67c00 100644 --- a/Interface/AddOns/SVUI_ChatOMatic/SVUI_ChatOMatic.lua +++ b/Interface/AddOns/SVUI_ChatOMatic/SVUI_ChatOMatic.lua @@ -958,7 +958,6 @@ function PLUGIN:Load() self.Window = window self.Window:Hide() - local strMsg if SV.db[Schema].autoAnswer == true then strMsg = "The Henchmen Operators Are Screening Your Calls.." @@ -966,22 +965,4 @@ function PLUGIN:Load() strMsg = "The Henchmen Operators Are Standing By.." end SV:AddonMessage(strMsg) - - local option = { - order = 2, - type = "toggle", - name = "Auto Answer", - get = function(a) return SV.db[Schema].autoAnswer end, - set = function(a,b) SV.db[Schema].autoAnswer = b end - }; - self:AddOption("autoAnswer", option) - - option = { - order = 3, - type = "toggle", - name = "Prefix Messages", - get = function(a) return SV.db[Schema].prefix end, - set = function(a,b) SV.db[Schema].prefix = b end - }; - self:AddOption("prefix", option) end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/_load.xml b/Interface/AddOns/SVUI_ConfigOMatic/modules/_load.xml index 4d556b6..a350879 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/_load.xml +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/_load.xml @@ -11,6 +11,5 @@ <Script file='plate.lua'/> <Script file='tip.lua'/> <Include file='units\_load.xml'/> - <Script file='dynamic.lua'/> <Script file='profiles.lua'/> </Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/dynamic.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/dynamic.lua deleted file mode 100644 index 0d4b20b..0000000 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/dynamic.lua +++ /dev/null @@ -1,42 +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 = _G["SVUI"]; -local L = SV.L; -local queue = SV.DynamicOptions; - -do - for key,options in pairs(queue) do - if(SV.Options.args[key]) then - SV.Options.args[key].args[options.key] = options.data - end - end -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_CraftOMatic/Bindings.xml b/Interface/AddOns/SVUI_CraftOMatic/Bindings.xml index 2a3cd5f..85b7a1e 100644 --- a/Interface/AddOns/SVUI_CraftOMatic/Bindings.xml +++ b/Interface/AddOns/SVUI_CraftOMatic/Bindings.xml @@ -1,14 +1,14 @@ <Bindings> - <Binding name="SVUILABORER_FISH" category="ADDONS" header="SVUILABORER" runOnUp="false"> + <Binding name="SVUICRAFT_FISH" category="ADDONS" header="SVUICRAFT" runOnUp="false"> SVUIFishingMode() </Binding> - <Binding name="SVUILABORER_FARM" category="ADDONS" runOnUp="false"> + <Binding name="SVUICRAFT_FARM" category="ADDONS" runOnUp="false"> SVUIFarmingMode() </Binding> - <Binding name="SVUILABORER_ARCH" category="ADDONS" runOnUp="false"> + <Binding name="SVUICRAFT_ARCH" category="ADDONS" runOnUp="false"> SVUIArchaeologyMode() </Binding> - <Binding name="SVUILABORER_COOK" category="ADDONS" runOnUp="false"> + <Binding name="SVUICRAFT_COOK" category="ADDONS" runOnUp="false"> SVUICookingMode() </Binding> </Bindings> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_CraftOMatic/Loader.lua b/Interface/AddOns/SVUI_CraftOMatic/Loader.lua index c5d2f48..70cc9b7 100644 --- a/Interface/AddOns/SVUI_CraftOMatic/Loader.lua +++ b/Interface/AddOns/SVUI_CraftOMatic/Loader.lua @@ -24,7 +24,11 @@ local PLUGIN = LibSuperVillain:NewPlugin(AddonName, AddonObject) local Schema = PLUGIN.Schema; local SV = _G["SVUI"]; - +--[[ +########################################################## +CONFIG DATA +########################################################## +]]-- SV.configs[Schema] = { ["enable"] = true, ["fontSize"] = 12, @@ -41,4 +45,117 @@ SV.configs[Schema] = { ["cooking"] = { ["autoequip"] = true, }, +} +--[[ +########################################################## +CONFIG OPTIONS +########################################################## +]]-- +SV.Options.args.plugins.args.pluginOptions.args[Schema].args["fontSize"] = { + order = 2, + name = L["Font Size"], + desc = L["Set the font size of the log window."], + type = "range", + min = 6, + max = 22, + step = 1, + get = function(key) return SV.db[Schema][key[#key]] end, + set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); PLUGIN:UpdateLogWindow() end +} + +SV.Options.args.plugins.args.pluginOptions.args[Schema].args["fishing"] = { + order = 3, + type = "group", + name = L["Fishing Mode Settings"], + guiInline = true, + args = { + autoequip = { + type = "toggle", + order = 1, + name = L['AutoEquip'], + desc = L['Enable/Disable automatically equipping fishing gear.'], + get = function(key)return SV.db[Schema].fishing[key[#key]]end, + set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key], "fishing")end + } + } +} + +SV.Options.args.plugins.args.pluginOptions.args[Schema].args["cooking"] = { + order = 4, + type = "group", + name = L["Cooking Mode Settings"], + guiInline = true, + args = { + autoequip = { + type = "toggle", + order = 1, + name = L['AutoEquip'], + desc = L['Enable/Disable automatically equipping cooking gear.'], + get = function(key)return SV.db[Schema].cooking[key[#key]]end, + set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key], "cooking")end + } + } +} + +SV.Options.args.plugins.args.pluginOptions.args[Schema].args["farming"] = { + order = 5, + type = "group", + name = L["Farming Mode Settings"], + guiInline = true, + get = function(key)return SV.db[Schema].farming[key[#key]]end, + set = function(key, value)SV.db[Schema].farming[key[#key]] = value end, + args = { + buttonsize = { + type = 'range', + name = L['Button Size'], + desc = L['The size of the action buttons.'], + min = 15, + max = 60, + step = 1, + order = 1, + set = function(key, value) + PLUGIN:ChangeDBVar(value, key[#key], "farming"); + PLUGIN:RefreshFarmingTools() + end, + }, + buttonspacing = { + type = 'range', + name = L['Button Spacing'], + desc = L['The spacing between buttons.'], + min = 1, + max = 10, + step = 1, + order = 2, + set = function(key, value) + PLUGIN:ChangeDBVar(value, key[#key], "farming"); + PLUGIN:RefreshFarmingTools() + end, + }, + onlyactive = { + order = 3, + type = 'toggle', + name = L['Only active buttons'], + desc = L['Only show the buttons for the seeds, portals, tools you have in your bags.'], + set = function(key, value) + PLUGIN:ChangeDBVar(value, key[#key], "farming"); + PLUGIN:RefreshFarmingTools() + end, + }, + droptools = { + order = 4, + type = 'toggle', + name = L['Drop '], + desc = L['Automatically drop tools from your bags when leaving the farming area.'], + }, + toolbardirection = { + order = 5, + type = 'select', + name = L['Bar Direction'], + desc = L['The direction of the bar buttons (Horizontal or Vertical).'], + set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key],"farming"); PLUGIN:RefreshFarmingTools() end, + values = { + ['VERTICAL'] = L['Vertical'], ['HORIZONTAL'] = L['Horizontal'] + } + } + } } \ No newline at end of file diff --git a/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.lua b/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.lua index b98a11b..f8f0774 100644 --- a/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.lua +++ b/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.lua @@ -19,11 +19,11 @@ LOCALIZED LUA FUNCTIONS --[[ CONSTANTS ]]-- -BINDING_HEADER_SVUILABORER = "Supervillain UI: Crafting"; -BINDING_NAME_SVUILABORER_FISH = "Toggle Fishing Mode"; -BINDING_NAME_SVUILABORER_FARM = "Toggle Farming Mode"; -BINDING_NAME_SVUILABORER_COOK = "Toggle Cooking Mode"; -BINDING_NAME_SVUILABORER_ARCH = "Toggle Archaeology Mode"; +BINDING_HEADER_SVUICRAFT = "Supervillain UI: Craft-O-Matic"; +BINDING_NAME_SVUICRAFT_FISH = "Toggle Fishing Mode"; +BINDING_NAME_SVUICRAFT_FARM = "Toggle Farming Mode"; +BINDING_NAME_SVUICRAFT_COOK = "Toggle Cooking Mode"; +BINDING_NAME_SVUICRAFT_ARCH = "Toggle Archaeology Mode"; --[[ GLOBALS ]]-- @@ -337,7 +337,7 @@ function PLUGIN:MakeLogWindow() self.LogWindow = log self.ListenerEnabled = false; - SV:RegisterDocklet("SVUI_ModesDockFrame", "Crafting Modes", ICON_FILE, false) + SV:RegisterDocklet("SVUI_ModesDockFrame", self.TitleID, ICON_FILE, false) self:CraftingReset() end @@ -532,114 +532,4 @@ function PLUGIN:Load() self:LoadArchaeologyMode() self:PrepareFarmingTools() self:RegisterEvent("SKILL_LINES_CHANGED") - - local option = { - order = 2, - name = L["Font Size"], - desc = L["Set the font size of the log window."], - type = "range", - min = 6, - max = 22, - step = 1, - get = function(key)return SV.db[Schema][key[#key]] end, - set = function(j,value) PLUGIN:ChangeDBVar(value,j[#j]);PLUGIN:UpdateLogWindow()end - } - self:AddOption("fontSize", option) - option = { - order = 3, - type = "group", - name = L["Fishing Mode Settings"], - guiInline = true, - args = { - autoequip = { - type = "toggle", - order = 1, - name = L['AutoEquip'], - desc = L['Enable/Disable automatically equipping fishing gear.'], - get = function(key)return SV.db[Schema].fishing[key[#key]]end, - set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key], "fishing")end - } - } - } - self:AddOption("fishing", option) - option = { - order = 4, - type = "group", - name = L["Cooking Mode Settings"], - guiInline = true, - args = { - autoequip = { - type = "toggle", - order = 1, - name = L['AutoEquip'], - desc = L['Enable/Disable automatically equipping cooking gear.'], - get = function(key)return SV.db[Schema].cooking[key[#key]]end, - set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key], "cooking")end - } - } - } - self:AddOption("cooking", option) - option = { - order = 5, - type = "group", - name = L["Farming Mode Settings"], - guiInline = true, - get = function(key)return SV.db[Schema].farming[key[#key]]end, - set = function(key, value)SV.db[Schema].farming[key[#key]] = value end, - args = { - buttonsize = { - type = 'range', - name = L['Button Size'], - desc = L['The size of the action buttons.'], - min = 15, - max = 60, - step = 1, - order = 1, - set = function(key, value) - PLUGIN:ChangeDBVar(value, key[#key],"farming"); - PLUGIN:RefreshFarmingTools() - end, - }, - buttonspacing = { - type = 'range', - name = L['Button Spacing'], - desc = L['The spacing between buttons.'], - min = 1, - max = 10, - step = 1, - order = 2, - set = function(key, value) - PLUGIN:ChangeDBVar(value, key[#key],"farming"); - PLUGIN:RefreshFarmingTools() - end, - }, - onlyactive = { - order = 3, - type = 'toggle', - name = L['Only active buttons'], - desc = L['Only show the buttons for the seeds, portals, tools you have in your bags.'], - set = function(key, value) - PLUGIN:ChangeDBVar(value, key[#key],"farming"); - PLUGIN:RefreshFarmingTools() - end, - }, - droptools = { - order = 4, - type = 'toggle', - name = L['Drop '], - desc = L['Automatically drop tools from your bags when leaving the farming area.'], - }, - toolbardirection = { - order = 5, - type = 'select', - name = L['Bar Direction'], - desc = L['The direction of the bar buttons (Horizontal or Vertical).'], - set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key],"farming"); PLUGIN:RefreshFarmingTools() end, - values = { - ['VERTICAL'] = L['Vertical'], ['HORIZONTAL'] = L['Horizontal'] - } - } - } - } - self:AddOption("farming", option) end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_FightOMatic/Bindings.xml b/Interface/AddOns/SVUI_FightOMatic/Bindings.xml index 78f0b62..8f5a94e 100644 --- a/Interface/AddOns/SVUI_FightOMatic/Bindings.xml +++ b/Interface/AddOns/SVUI_FightOMatic/Bindings.xml @@ -1,5 +1,5 @@ <Bindings> - <Binding name="SVUIAOW_RADIO" category="ADDONS" header="SVUIAOW" runOnUp="false"> + <Binding name="SVUIFIGHT_RADIO" category="ADDONS" header="SVUIFIGHT" runOnUp="false"> SVUISayIncoming() </Binding> </Bindings> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_FightOMatic/Loader.lua b/Interface/AddOns/SVUI_FightOMatic/Loader.lua index 970c5cd..3356ee7 100644 --- a/Interface/AddOns/SVUI_FightOMatic/Loader.lua +++ b/Interface/AddOns/SVUI_FightOMatic/Loader.lua @@ -24,7 +24,24 @@ local PLUGIN = LibSuperVillain:NewPlugin(AddonName, AddonObject) local Schema = PLUGIN.Schema; local SV = _G["SVUI"]; - +--[[ +########################################################## +CONFIG DATA +########################################################## +]]-- SV.configs[Schema] = { ["enable"] = true, -} \ No newline at end of file +} +--[[ +########################################################## +CONFIG OPTIONS +########################################################## +]]-- +-- SV.Options.args.plugins.args.pluginOptions.args[Schema].args[""] = { +-- order = 2, +-- name = L[""], +-- desc = L[""], +-- type = "toggle", +-- get = function(key) return SV.db[Schema][key[#key]] end, +-- set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]) end +-- } \ No newline at end of file diff --git a/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua b/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua index a288ec2..684631e 100644 --- a/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua +++ b/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua @@ -18,8 +18,8 @@ LOCALIZED LUA FUNCTIONS ]]-- --[[ CONSTANTS ]]-- -BINDING_HEADER_SVUIAOW = "Supervillain UI: Fight-O-Matic"; -BINDING_NAME_SVUIAOW_RADIO = "Call Out Incoming"; +BINDING_HEADER_SVUIFIGHT = "Supervillain UI: Fight-O-Matic"; +BINDING_NAME_SVUIFIGHT_RADIO = "Call Out Incoming"; --[[ GLOBALS ]]-- @@ -1131,7 +1131,7 @@ function PLUGIN:Load() MakeUtilityWindow() MakeInfoWindow() - SV:RegisterDocklet("SVUI_FightOMaticDock", "Art of War", ICON_FILE) + SV:RegisterDocklet("SVUI_FightOMaticDock", self.TitleID, ICON_FILE) holder:Hide() diff --git a/Interface/AddOns/SVUI_LogOMatic/Loader.lua b/Interface/AddOns/SVUI_LogOMatic/Loader.lua index 611ee7f..10e2fda 100644 --- a/Interface/AddOns/SVUI_LogOMatic/Loader.lua +++ b/Interface/AddOns/SVUI_LogOMatic/Loader.lua @@ -24,8 +24,25 @@ local PLUGIN = LibSuperVillain:NewPlugin(AddonName, AddonObject) local Schema = PLUGIN.Schema; local SV = _G["SVUI"]; - +--[[ +########################################################## +CONFIG DATA +########################################################## +]]-- SV.configs[Schema] = { ["enable"] = true, ["saveChats"] = false +} +--[[ +########################################################## +CONFIG OPTIONS +########################################################## +]]-- +SV.Options.args.plugins.args.pluginOptions.args[Schema].args["saveChats"] = { + order = 2, + name = L["Save Chats"], + desc = L["Retain chat messages even after logging out."], + type = "toggle", + get = function(key) return SV.db[Schema][key[#key]] end, + set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); SV:StaticPopup_Show("RL_CLIENT") end } \ No newline at end of file diff --git a/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua index de0bd0e..a893f1d 100644 --- a/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua +++ b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua @@ -334,14 +334,4 @@ function PLUGIN:Load() --[[ APPLY HOOKS ]]-- self:AppendChatFunctions() NewHook(CHAT, "ReLoad", self.AppendChatFunctions) - - local saveChats = { - order = 2, - type = "toggle", - name = L["Save Chats"], - desc = L["Retain chat messages even after logging out."], - get = function(a)return SV.db[Schema].saveChats end, - set = function(a,b) SV.db[Schema].saveChats = b; SV:StaticPopup_Show("RL_CLIENT") end - } - self:AddOption("saveChats", saveChats) end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/Loader.lua b/Interface/AddOns/SVUI_StyleOMatic/Loader.lua index 1428f3f..7a66b5b 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/Loader.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/Loader.lua @@ -24,7 +24,11 @@ local PLUGIN = LibSuperVillain:NewPlugin(AddonName, AddonObject) local Schema = PLUGIN.Schema; local SV = _G["SVUI"]; - +--[[ +########################################################## +CONFIG DATA +########################################################## +]]-- SV.configs[Schema] = { ["enable"] = true, ["blizzard"] = { @@ -109,4 +113,325 @@ SV.configs[Schema] = { ["Omen"] = true, ["TradeSkillDW"] = true, } -}; \ No newline at end of file +}; +--[[ +########################################################## +CONFIG OPTIONS +########################################################## +]]-- +SV.Options.args.plugins.args.pluginOptions.args[Schema].args["blizzardEnable"] = { + order = 2, + name = "Standard UI Styling", + type = "toggle", + get = function(key) return SV.db[Schema].blizzard.enable end, + set = function(key,value) SV.db[Schema].blizzard.enable = value; SV:StaticPopup_Show("RL_CLIENT") end +} +SV.Options.args.plugins.args.pluginOptions.args[Schema].args["addonEnable"] = { + order = 3, + name = "Addon Styling", + type = "toggle", + get = function(key) return SV.db[Schema].addons.enable end, + set = function(key,value) SV.db[Schema].addons.enable = value; SV:StaticPopup_Show("RL_CLIENT") end +} +SV.Options.args.plugins.args.pluginOptions.args[Schema].args["addons"] = { + order = 4, + type = "group", + name = "Addon Styling", + get = function(key) return SV.db[Schema].addons[key[#key]] end, + set = function(key,value) SV.db[Schema].addons[key[#key]] = value; SV:StaticPopup_Show("RL_CLIENT")end, + disabled = function() return not SV.db[Schema].addons.enable end, + guiInline = true, + args = { + ace3 = { + type = "toggle", + order = 1, + name = "Ace3" + }, + } +} +SV.Options.args.plugins.args.pluginOptions.args[Schema].args["blizzard"] = { + order = 300, + type = "group", + name = "Individual Mods", + get = function(key) return SV.db[Schema].blizzard[key[#key]] end, + set = function(key,value) SV.db[Schema].blizzard[key[#key]] = value; SV:StaticPopup_Show("RL_CLIENT") end, + disabled = function() return not SV.db[Schema].blizzard.enable end, + guiInline = true, + args = { + bmah = { + type = "toggle", + name = L["Black Market AH"], + desc = L["TOGGLEART_DESC"] + }, + chat = { + type = "toggle", + name = L["Chat Menus"], + 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_StyleOMatic/SVUI_StyleOMatic.lua b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua index 3653c8f..29e2bf7 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua @@ -56,22 +56,6 @@ PLUGIN.CustomQueue = {}; PLUGIN.EventListeners = {}; PLUGIN.OnLoadAddons = {}; PLUGIN.StyledAddons = {}; -PLUGIN.OptionsCache = { - order = 4, - type = "group", - name = "Addon Styling", - get = function(a)return SV.db[Schema].addons[a[#a]] end, - set = function(a,b) SV.db[Schema].addons[a[#a]] = b; SV:StaticPopup_Show("RL_CLIENT")end, - disabled = function()return not SV.db[Schema].addons.enable end, - guiInline = true, - args = { - ace3 = { - type = "toggle", - order = 1, - name = "Ace3" - }, - } -} PLUGIN.Debugging = false --[[ ########################################################## @@ -212,33 +196,14 @@ function PLUGIN:RefreshAddonStyles() end end -function PLUGIN:AppendAddonOption(addon) - if(not self.OptionsCache.args[addon]) then - self.OptionsCache.args[addon] = { - type = "toggle", - name = addon, - desc = L["Addon Styling"], - get = function(key) return self:IsAddonReady(key[#key]) end, - set = function(key,value) self:ChangeDBVar(value, key[#key], "addons"); SV:StaticPopup_Show("RL_CLIENT") end, - disabled = function() - if addon then - return not IsAddOnLoaded(addon) - else - return false - end - end - } - end -end - function PLUGIN:PLAYER_ENTERING_WORLD(event, ...) - for name,fn in pairs(self.OnLoadAddons) do - if(SV.db[Schema].blizzard[name] == nil) then - SV.db[Schema].blizzard[name] = true + for addonName,fn in pairs(self.OnLoadAddons) do + if(SV.db[Schema].blizzard[addonName] == nil) then + SV.db[Schema].blizzard[addonName] = true end - if(IsAddOnLoaded(name) and (SV.db[Schema].blizzard[name] or SV.db[Schema].addons[name])) then - self:Style(name, fn, event, ...) - self.OnLoadAddons[name] = nil + if(IsAddOnLoaded(addonName) and (SV.db[Schema].blizzard[addonName] or SV.db[Schema].addons[addonName])) then + self:Style(addonName, fn, event, ...) + self.OnLoadAddons[addonName] = nil end end @@ -249,13 +214,28 @@ function PLUGIN:PLAYER_ENTERING_WORLD(event, ...) twipe(self.CustomQueue) local listener = self.EventListeners[event] - for name,fn in pairs(self.AddOnQueue)do - self:AppendAddonOption(name) - if(SV.db[Schema].addons[name] == nil) then - SV.db[Schema].addons[name] = true + for addonName,fn in pairs(self.AddOnQueue)do + if(not SV.Options.args.plugins.args.pluginOptions.args[Schema].args["addons"][addonName]) then + SV.Options.args.plugins.args.pluginOptions.args[Schema].args["addons"][addonName] = { + type = "toggle", + name = addonName, + desc = L["Addon Styling"], + get = function(key) return PLUGIN:IsAddonReady(key[#key]) end, + set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key], "addons"); SV:StaticPopup_Show("RL_CLIENT") end, + disabled = function() + if addonName then + return not IsAddOnLoaded(addonName) + else + return false + end + end + } + end + if(SV.db[Schema].addons[addonName] == nil) then + SV.db[Schema].addons[addonName] = true end - if(listener[name] and self:IsAddonReady(name)) then - self:Style(name, fn, event, ...) + if(listener[addonName] and self:IsAddonReady(addonName)) then + self:Style(addonName, fn, event, ...) end end end @@ -409,314 +389,6 @@ function PLUGIN:Load() NewHook(SV, "ReloadDocklets", RegisterAddonDocklets); SV:ReloadDocklets(); - SV.DynamicOptions[Schema] = {key = "addons", data = self.OptionsCache}; - - local option = { - order = 2, - type = "toggle", - name = "Standard UI Styling", - get = function(a)return SV.db[Schema].blizzard.enable end, - set = function(a,b) SV.db[Schema].blizzard.enable = b; SV:StaticPopup_Show("RL_CLIENT") end - } - self:AddOption("blizzardEnable", option) - - option = { - order = 3, - type = "toggle", - name = "Addon Styling", - get = function(a)return SV.db[Schema].addons.enable end, - set = function(a,b) SV.db[Schema].addons.enable = b; SV:StaticPopup_Show("RL_CLIENT") end - } - self:AddOption("addonEnable", option) - - option = { - order = 300, - type = "group", - name = "Individual Mods", - get = function(a)return SV.db[Schema].blizzard[a[#a]]end, - set = function(a,b) SV.db[Schema].blizzard[a[#a]] = b; SV:StaticPopup_Show("RL_CLIENT") end, - disabled = function() return not SV.db[Schema].blizzard.enable end, - guiInline = true, - args = { - bmah = { - type = "toggle", - name = L["Black Market AH"], - desc = L["TOGGLEART_DESC"] - }, - chat = { - type = "toggle", - name = L["Chat Menus"], - 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"] - } - } - } - self:AddOption("blizzard", option) - self:AddOption("addons", self.OptionsCache) self:RegisterEvent("PLAYER_ENTERING_WORLD"); self:RegisterEvent("ADDON_LOADED"); diff --git a/Interface/AddOns/SVUI_TrackOMatic/Bindings.xml b/Interface/AddOns/SVUI_TrackOMatic/Bindings.xml new file mode 100644 index 0000000..3295b0f --- /dev/null +++ b/Interface/AddOns/SVUI_TrackOMatic/Bindings.xml @@ -0,0 +1,5 @@ +<Bindings> + <Binding name="SVUITRACK_DOODAD" category="ADDONS" header="SVUITRACK" runOnUp="false"> + SVUIToggleTrackingDoodad() + </Binding> +</Bindings> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_TrackOMatic/Loader.lua b/Interface/AddOns/SVUI_TrackOMatic/Loader.lua index 6c2a78f..875bfae 100644 --- a/Interface/AddOns/SVUI_TrackOMatic/Loader.lua +++ b/Interface/AddOns/SVUI_TrackOMatic/Loader.lua @@ -24,11 +24,49 @@ local PLUGIN = LibSuperVillain:NewPlugin(AddonName, AddonObject) local Schema = PLUGIN.Schema; local SV = _G["SVUI"]; - +--[[ +########################################################## +CONFIG DATA +########################################################## +]]-- SV.configs[Schema] = { ["enable"] = true, ["size"] = 75, ["fontSize"] = 12, ["groups"] = true, ["proximity"] = false, +} +--[[ +########################################################## +CONFIG OPTIONS +########################################################## +]]-- +SV.Options.args.plugins.args.pluginOptions.args[Schema].args["groups"] = { + order = 3, + name = L["GPS"], + desc = L["Use group frame GPS elements"], + type = "toggle", + get = function(key) return SV.db[Schema][key[#key]] end, + set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); PLUGIN:UpdateLogWindow() end +} + +SV.Options.args.plugins.args.pluginOptions.args[Schema].args["proximity"] = { + order = 4, + name = L["GPS Proximity"], + desc = L["Only point to closest low health unit"], + type = "toggle", + get = function(key) return SV.db[Schema][key[#key]] end, + set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); PLUGIN:UpdateLogWindow() end +} + +SV.Options.args.plugins.args.pluginOptions.args[Schema].args["fontSize"] = { + order = 5, + name = L["Font Size"], + desc = L["Set the font size of the range text"], + type = "range", + min = 6, + max = 22, + step = 1, + get = function(key) return SV.db[Schema][key[#key]] end, + set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); PLUGIN:UpdateLogWindow() end } \ No newline at end of file diff --git a/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.lua b/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.lua index 8978fc6..79ea6a8 100644 --- a/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.lua +++ b/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.lua @@ -47,7 +47,7 @@ local band = bit.band; GET ADDON DATA ########################################################## ]]-- -local PLUGIN = LibSuperVillain:NewPlugin(...) +local PLUGIN = select(2, ...) local Schema = PLUGIN.Schema; local VERSION = PLUGIN.Version; @@ -58,12 +58,13 @@ local L = SV.L; LOCALS AND BINDING ########################################################## ]]-- -BINDING_HEADER_SVUITRACK = "Supervillain UI: Tracking Device"; +BINDING_HEADER_SVUITRACK = "Supervillain UI: Track-O-Matic"; +BINDING_NAME_SVUITRACK_DOODAD = "Toggle Tracking Device"; local NewHook = hooksecurefunc; local playerGUID = UnitGUID('player') local classColor = RAID_CLASS_COLORS -local radian90 = (3.141592653589793 / 2) * -1; +local radian90 = (3.141592653589793 / 2) * -1; local GetDistance, GetTarget, GetFromPlayer; --[[ ########################################################## @@ -72,7 +73,7 @@ BUILD ]]-- function SVUI_TrackingDoodad_OnLoad() local frame = _G["SVUI_TrackingDoodad"] - --frame.Border:SetGradient(unpack(SV.Media.gradient.dark)) + frame.Border:SetGradient(unpack(SV.Media.gradient.special)) frame.Arrow:SetVertexColor(0.1, 0.8, 0.8) frame.Range:SetFont(SV.Media.font.roboto, 14, "OUTLINE") frame.Range:SetTextColor(1, 1, 1, 0.75) @@ -81,6 +82,20 @@ function SVUI_TrackingDoodad_OnLoad() frame:Hide() end +function SVUIToggleTrackingDoodad() + if(not SVUI_TrackingDoodad.Trackable) then + SVUI_TrackingDoodad.Trackable = true + if((UnitInParty("target") or UnitInRaid("target")) and not UnitIsUnit("target", "player")) then + SVUI_TrackingDoodad:Show() + end + SV:AddonMessage("Tracking Device |cff00FF00Enabled|r") + else + SVUI_TrackingDoodad.Trackable = false + SVUI_TrackingDoodad:Hide() + SV:AddonMessage("Tracking Device |cffFF0000Disabled|r") + end +end + do local WORLDMAPAREA_DEFAULT_DUNGEON_FLOOR_IS_TERRAIN = 0x00000004 local WORLDMAPAREA_VIRTUAL_CONTINENT = 0x00000008 @@ -567,34 +582,30 @@ local Tracker_OnUpdate = function(self, elapsed) if self.elapsed and self.elapsed > (self.throttle or 0.02) then if(self.Trackable) then local distance, angle = Triangulate("target", true) - local _ARROW = self.Arrow - local _SPINNER = self.Radar - local _TEXT = self.Range - local _BG = self.BG if not angle then self.throttle = 4 - _ARROW:SetAlpha(0) - _SPINNER:SetVertexColor(0.8,0.1,0.1,0.15) - _BG:SetVertexColor(1,0,0,0.15) + self.Arrow:SetAlpha(0) + self.Radar:SetVertexColor(0.8,0.1,0.1,0.15) + self.BG:SetVertexColor(1,0,0,0.15) else self.throttle = 0.02 - local out = floor(tonumber(distance)) + local range = floor(tonumber(distance)) self:Spin(angle) - if(out > 100) then - _ARROW:SetVertexColor(1,0.1,0.1,0.4) - _SPINNER:SetVertexColor(0.8,0.1,0.1,0.25) - _BG:SetVertexColor(0.8,0.4,0.1,0.25) - elseif(out > 40) then - _ARROW:SetVertexColor(1,0.8,0.1,0.6) - _SPINNER:SetVertexColor(0.8,0.8,0.1,0.5) - _BG:SetVertexColor(0.4,0.8,0.1,0.5) - elseif(out > 5) then - _ARROW:SetVertexColor(0.1,1,0.8,0.9) - _SPINNER:SetVertexColor(0.1,0.8,0.8,0.75) - _BG:SetVertexColor(0.1,0.8,0.1,0.75) + if(range > 100) then + self.Arrow:SetVertexColor(1,0.1,0.1,0.4) + self.Radar:SetVertexColor(0.8,0.1,0.1,0.25) + self.BG:SetVertexColor(0.8,0.4,0.1,0.25) + elseif(range > 40) then + self.Arrow:SetVertexColor(1,0.8,0.1,0.6) + self.Radar:SetVertexColor(0.8,0.8,0.1,0.5) + self.BG:SetVertexColor(0.4,0.8,0.1,0.5) + elseif(range > 5) then + self.Arrow:SetVertexColor(0.1,1,0.8,0.9) + self.Radar:SetVertexColor(0.1,0.8,0.8,0.75) + self.BG:SetVertexColor(0.1,0.8,0.1,0.75) end - _ARROW:SetAlpha(1) - _TEXT:SetText(out) + self.Arrow:SetAlpha(1) + self.Range:SetText(range) end else self:Hide() @@ -698,40 +709,4 @@ function PLUGIN:Load() end NewHook(SV.SVUnit, "RefreshUnitLayout", RefreshGPS) - - local options = { - order = 3, - name = L["GPS"], - desc = L["Use group frame GPS elements"], - type = "toggle", - get = function() return SV.db[Schema].groups end, - set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); PLUGIN:UpdateLogWindow() end - } - - self:AddOption("groups", options) - - options = { - order = 4, - name = L["GPS Proximity"], - desc = L["Only point to closest low health unit"], - type = "toggle", - get = function() return SV.db[Schema].proximity end, - set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); PLUGIN:UpdateLogWindow() end - } - - self:AddOption("proximity", options) - - options = { - order = 5, - name = L["Font Size"], - desc = L["Set the font size of the range text"], - type = "range", - min = 6, - max = 22, - step = 1, - get = function() return SV.db[Schema].fontSize end, - set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); PLUGIN:UpdateLogWindow() end - } - - self:AddOption("fontSize", options) end \ No newline at end of file