From 36087d0304791c162ce6f9935918d7b27cc5847c Mon Sep 17 00:00:00 2001 From: Munglunch Date: Fri, 5 Sep 2014 15:15:59 -0500 Subject: [PATCH] unstable testing version --- Interface/AddOns/SVUI/Bindings.xml | 6 +- Interface/AddOns/SVUI/SVUI.lua | 378 +++++++---- Interface/AddOns/SVUI/SVUI.toc | 5 +- .../oUF_ActionPanel/oUF_ActionPanel.lua | 2 +- .../oUF_ActionPanel/oUF_ActionPanel.toc | 2 +- .../oUF_Plugins/oUF_Afflicted/oUF_Afflicted.toc | 2 +- .../oUF_ArcaneCharge/oUF_ArcaneCharge.toc | 2 +- .../oUF_Plugins/oUF_Combatant/oUF_Combatant.toc | 2 +- .../oUF_Plugins/oUF_Friendship/oUF_Friendship.lua | 2 +- Interface/AddOns/SVUI/packages/actionbar/SVBar.lua | 107 ++-- Interface/AddOns/SVUI/packages/bag/SVBag.lua | 25 +- Interface/AddOns/SVUI/packages/chat/SVChat.lua | 18 +- Interface/AddOns/SVUI/packages/dock/SVDock.lua | 4 +- .../AddOns/SVUI/packages/henchmen/SVHenchmen.lua | 85 +-- Interface/AddOns/SVUI/packages/map/SVMap.lua | 4 +- .../AddOns/SVUI/packages/override/SVOverride.lua | 7 +- Interface/AddOns/SVUI/packages/plates/SVPlate.lua | 14 +- .../AddOns/SVUI/packages/stats/stats/bags.lua | 2 +- Interface/AddOns/SVUI/packages/stats/stats/cta.lua | 2 +- Interface/AddOns/SVUI/packages/stats/stats/dps.lua | 2 +- .../SVUI/packages/stats/stats/durability.lua | 2 +- .../AddOns/SVUI/packages/stats/stats/friends.lua | 2 +- .../AddOns/SVUI/packages/stats/stats/guild.lua | 88 +-- Interface/AddOns/SVUI/packages/stats/stats/hps.lua | 2 +- .../AddOns/SVUI/packages/stats/stats/time.lua | 2 +- Interface/AddOns/SVUI/packages/tip/SVTip.lua | 22 +- Interface/AddOns/SVUI/packages/unit/SVUnit.lua | 21 +- .../AddOns/SVUI/packages/unit/elements/auras.lua | 4 +- .../SVUI/packages/unit/elements/essentials.lua | 4 + .../AddOns/SVUI/packages/unit/elements/tags.lua | 7 +- .../SVUI/packages/unit/resources/warlock.lua | 16 +- Interface/AddOns/SVUI/scripts/misc.lua | 2 +- Interface/AddOns/SVUI/scripts/raid.lua | 18 +- Interface/AddOns/SVUI/scripts/spellbind.lua | 2 +- Interface/AddOns/SVUI/system/cartography.lua | 14 +- Interface/AddOns/SVUI/system/common.lua | 92 ++- Interface/AddOns/SVUI/system/installer.lua | 1 - Interface/AddOns/SVUI/system/mentalo.lua | 25 +- Interface/AddOns/SVUI/system/system.lua | 33 +- .../SVUI_AnsweringService.lua | 385 ++++++----- .../SVUI_AnsweringService.toc | 8 +- Interface/AddOns/SVUI_ArtOfWar/Bindings.xml | 2 +- Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua | 180 +++--- Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.toc | 5 +- .../AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc | 8 +- .../widgets/AceGUIContainer-TreeGroup.lua | 2 +- .../widgets/AceGUIWidget-InteractiveLabel.lua | 2 +- .../AceGUI-3.0-SharedMediaWidgets/prototypes.lua | 2 +- .../widgets/AceGUIContainer-TreeGroup.lua | 2 +- .../widgets/AceGUIWidget-InteractiveLabel.lua | 2 +- .../SVUI_ConfigOMatic/modules/units/core.lua | 1 + Interface/AddOns/SVUI_DebugOMatic/Bindings.xml | 5 + .../AddOns/SVUI_DebugOMatic/SVUI_DebugOMatic.toc | 9 + .../AddOns/SVUI_DebugOMatic/SVUI_DebugOMatic.xml | 116 ++++ Interface/AddOns/SVUI_DebugOMatic/debug.lua | 296 +++++++++ Interface/AddOns/SVUI_Laborer/Bindings.xml | 8 +- Interface/AddOns/SVUI_Laborer/SVUI_Laborer.lua | 56 +- Interface/AddOns/SVUI_Laborer/SVUI_Laborer.toc | 5 +- Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua | 48 +- Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.toc | 5 +- .../AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua | 168 ++--- .../AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc | 5 +- Interface/AddOns/SVUI_StyleOMatic/addons/_load.xml | 1 + .../AddOns/SVUI_StyleOMatic/addons/achievement.lua | 12 +- Interface/AddOns/SVUI_StyleOMatic/addons/alert.lua | 116 ++-- .../SVUI_StyleOMatic/addons/auctionhouse.lua | 9 +- .../AddOns/SVUI_StyleOMatic/addons/barbershop.lua | 2 +- .../AddOns/SVUI_StyleOMatic/addons/blackmarket.lua | 6 +- .../AddOns/SVUI_StyleOMatic/addons/calendar.lua | 12 +- .../AddOns/SVUI_StyleOMatic/addons/character.lua | 70 +- Interface/AddOns/SVUI_StyleOMatic/addons/chat.lua | 477 ++++++++++++++ .../SVUI_StyleOMatic/addons/encounterjournal.lua | 36 +- .../AddOns/SVUI_StyleOMatic/addons/friends.lua | 104 +-- .../AddOns/SVUI_StyleOMatic/addons/gossip.lua | 4 +- Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua | 54 +- Interface/AddOns/SVUI_StyleOMatic/addons/help.lua | 54 +- .../SVUI_StyleOMatic/addons/itemsocketing.lua | 2 +- .../AddOns/SVUI_StyleOMatic/addons/keybinding.lua | 56 +- Interface/AddOns/SVUI_StyleOMatic/addons/lfd.lua | 123 ++-- .../AddOns/SVUI_StyleOMatic/addons/loothistory.lua | 4 +- Interface/AddOns/SVUI_StyleOMatic/addons/macro.lua | 20 +- .../AddOns/SVUI_StyleOMatic/addons/mailbox.lua | 4 +- .../AddOns/SVUI_StyleOMatic/addons/petbattle.lua | 2 +- .../AddOns/SVUI_StyleOMatic/addons/petjournal.lua | 40 +- .../AddOns/SVUI_StyleOMatic/addons/petstable.lua | 4 +- Interface/AddOns/SVUI_StyleOMatic/addons/pvp.lua | 6 +- Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua | 231 +++---- Interface/AddOns/SVUI_StyleOMatic/addons/raid.lua | 8 +- .../AddOns/SVUI_StyleOMatic/addons/reforging.lua | 2 +- .../AddOns/SVUI_StyleOMatic/addons/spellbook.lua | 4 +- .../SVUI_StyleOMatic/addons/supervillain.lua | 450 +++++++------ .../AddOns/SVUI_StyleOMatic/addons/system.lua | 333 +--------- .../AddOns/SVUI_StyleOMatic/addons/tabard.lua | 6 +- .../AddOns/SVUI_StyleOMatic/addons/talents.lua | 62 +- Interface/AddOns/SVUI_StyleOMatic/addons/taxi.lua | 6 +- .../SVUI_StyleOMatic/addons/thirdparty/ACP.lua | 2 +- .../SVUI_StyleOMatic/addons/thirdparty/AdiBags.lua | 2 +- .../addons/thirdparty/Altoholic.lua | 34 +- .../addons/thirdparty/AtlasLoot.lua | 4 +- .../SVUI_StyleOMatic/addons/thirdparty/Bugsack.lua | 6 +- .../SVUI_StyleOMatic/addons/thirdparty/DBM.lua | 2 +- .../SVUI_StyleOMatic/addons/thirdparty/DXE.lua | 2 +- .../addons/thirdparty/LightHeaded.lua | 2 +- .../SVUI_StyleOMatic/addons/thirdparty/Mogit.lua | 6 +- .../addons/thirdparty/Outfitter.lua | 4 +- .../SVUI_StyleOMatic/addons/thirdparty/Recount.lua | 6 +- .../SVUI_StyleOMatic/addons/thirdparty/Skada.lua | 4 +- .../addons/thirdparty/TradeSkillDW.lua | 6 +- .../SVUI_StyleOMatic/addons/thirdparty/VEM.lua | 4 +- .../addons/thirdparty/WeakAuras.lua | 15 +- .../AddOns/SVUI_StyleOMatic/addons/timemanager.lua | 9 +- .../AddOns/SVUI_StyleOMatic/addons/tradeskill.lua | 4 +- .../AddOns/SVUI_StyleOMatic/addons/trainer.lua | 2 +- .../AddOns/SVUI_StyleOMatic/addons/transmog.lua | 4 +- .../AddOns/SVUI_StyleOMatic/addons/worldmap.lua | 21 +- .../AddOns/SVUI_StyleOMatic/addons/worldstate.lua | 2 +- .../AddOns/SVUI_StyleOMatic/common/methods.lua | 676 +++++++++++--------- .../SVUI_TrackingDevice/SVUI_TrackingDevice.lua | 660 +++++++++++++++++++ .../SVUI_TrackingDevice/SVUI_TrackingDevice.toc | 9 + .../SVUI_TrackingDevice/SVUI_TrackingDevice.xml | 50 ++ .../SVUI_TrackingDevice/artwork/DOODAD-ARROW.blp | Bin 0 -> 23060 bytes .../SVUI_TrackingDevice/artwork/DOODAD-BG.blp | Bin 0 -> 23060 bytes .../SVUI_TrackingDevice/artwork/DOODAD-BORDER.blp | Bin 0 -> 6676 bytes .../SVUI_TrackingDevice/artwork/DOODAD-RADAR.blp | Bin 0 -> 6676 bytes 124 files changed, 3903 insertions(+), 2301 deletions(-) create mode 100644 Interface/AddOns/SVUI_DebugOMatic/Bindings.xml create mode 100644 Interface/AddOns/SVUI_DebugOMatic/SVUI_DebugOMatic.toc create mode 100644 Interface/AddOns/SVUI_DebugOMatic/SVUI_DebugOMatic.xml create mode 100644 Interface/AddOns/SVUI_DebugOMatic/debug.lua create mode 100644 Interface/AddOns/SVUI_StyleOMatic/addons/chat.lua create mode 100644 Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.lua create mode 100644 Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.toc create mode 100644 Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.xml create mode 100644 Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-ARROW.blp create mode 100644 Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-BG.blp create mode 100644 Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-BORDER.blp create mode 100644 Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-RADAR.blp diff --git a/Interface/AddOns/SVUI/Bindings.xml b/Interface/AddOns/SVUI/Bindings.xml index 0293f5f..844e72f 100644 --- a/Interface/AddOns/SVUI/Bindings.xml +++ b/Interface/AddOns/SVUI/Bindings.xml @@ -1,11 +1,11 @@ - + RaidMark_HotkeyPressed(keystate) - + HideSuperDocks() - + SVUILetsRide() \ No newline at end of file diff --git a/Interface/AddOns/SVUI/SVUI.lua b/Interface/AddOns/SVUI/SVUI.lua index 7870806..8de74bd 100644 --- a/Interface/AddOns/SVUI/SVUI.lua +++ b/Interface/AddOns/SVUI/SVUI.lua @@ -37,9 +37,16 @@ local floor = math.floor --[[ TABLE METHODS ]]-- local tsort, tconcat = table.sort, table.concat; --[[ -########################################################## -ADDON DATA -########################################################## +############################################################ + /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$ /$$$$$$ +| $$ /$$__ $$ /$$__ $$ /$$__ $$| $$ /$$__ $$ +| $$ | $$ \ $$| $$ \__/| $$ \ $$| $$ | $$ \__/ +| $$ | $$ | $$| $$ | $$$$$$$$| $$ | $$$$$$ +| $$ | $$ | $$| $$ | $$__ $$| $$ \____ $$ +| $$ | $$ | $$| $$ $$| $$ | $$| $$ /$$ \ $$ +| $$$$$$$$| $$$$$$/| $$$$$$/| $$ | $$| $$$$$$$$| $$$$$$/ +|________/ \______/ \______/ |__/ |__/|________/ \______/ +############################################################ ]]-- local SVUI = {}; local SVUINameSpace, SVUICore = ...; @@ -50,20 +57,16 @@ local playerRealm = GetRealmName(); local SetAddonCore; local callbacks = {}; local numCallbacks = 0; ---[[ -########################################################## -CONSTANTS -########################################################## -]]-- + +--[[ CONSTANTS ]]-- + BINDING_HEADER_SVUI = "SuperVillain UI"; SLASH_RELOADUI1 = "/rl" SLASH_RELOADUI2 = "/reloadui" SlashCmdList.RELOADUI = ReloadUI ---[[ -########################################################## -MUNGLUNCH's FASTER ASSERT FUNCTION -########################################################## -]]-- + +--[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- + function enforce(condition, ...) if not condition then if next({...}) then @@ -78,10 +81,20 @@ function enforce(condition, ...) end local assert = enforce; --[[ -########################################################## -LOCAL FUNCTIONS -########################################################## +###################################################################### + /$$$$$$ /$$ /$$$$$$ /$$$$$$$ /$$$$$$ /$$ /$$$$$$ + /$$__ $$| $$ /$$__ $$| $$__ $$ /$$__ $$| $$ /$$__ $$ +| $$ \__/| $$ | $$ \ $$| $$ \ $$| $$ \ $$| $$ | $$ \__/ +| $$ /$$$$| $$ | $$ | $$| $$$$$$$ | $$$$$$$$| $$ | $$$$$$ +| $$|_ $$| $$ | $$ | $$| $$__ $$| $$__ $$| $$ \____ $$ +| $$ \ $$| $$ | $$ | $$| $$ \ $$| $$ | $$| $$ /$$ \ $$ +| $$$$$$/| $$$$$$$$| $$$$$$/| $$$$$$$/| $$ | $$| $$$$$$$$| $$$$$$/ + \______/ |________/ \______/ |_______/ |__/ |__/|________/ \______/ +###################################################################### ]]-- + +--[[ CLASS COLOR LOCALS ]]-- + local function formatValueString(text) if "string" == type(text) then text = gsub(text,"\n","\\n") @@ -129,12 +142,10 @@ local function DispatchCallbacks() print("ERROR:", err) end end -end ---[[ -########################################################## -BUILD CLASS COLOR GLOBAL -########################################################## -]]-- +end + +--[[ BUILD CLASS COLOR GLOBAL ]]-- + SVUI_CLASS_COLORS = {}; do local classes = {}; @@ -176,12 +187,10 @@ do end end classes = nil -end ---[[ -########################################################## -APPENDED GLOBAL FUNCTIONS -########################################################## -]]-- +end + +--[[ APPENDED LUA METHODS ]]-- + function math.parsefloat(value,decimal) if decimal and decimal > 0 then local calc1 = 10 ^ decimal; @@ -249,12 +258,19 @@ function string.explode(str, delim) return res end --[[ -########################################################## -DEFINE REGISTRY HELPERS -########################################################## +############################################################################### + /$$$$$$$ /$$$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$$/$$$$$$$ /$$ /$$ +| $$__ $$| $$_____/ /$$__ $$|_ $$_/ /$$__ $$|__ $$__/ $$__ $$| $$ /$$/ +| $$ \ $$| $$ | $$ \__/ | $$ | $$ \__/ | $$ | $$ \ $$ \ $$ /$$/ +| $$$$$$$/| $$$$$ | $$ /$$$$ | $$ | $$$$$$ | $$ | $$$$$$$/ \ $$$$/ +| $$__ $$| $$__/ | $$|_ $$ | $$ \____ $$ | $$ | $$__ $$ \ $$/ +| $$ \ $$| $$ | $$ \ $$ | $$ /$$ \ $$ | $$ | $$ \ $$ | $$ +| $$ | $$| $$$$$$$$| $$$$$$/ /$$$$$$| $$$$$$/ | $$ | $$ | $$ | $$ +|__/ |__/|________/ \______/ |______/ \______/ |__/ |__/ |__/ |__/ +############################################################################### ]]-- do - local PackageQueue, ScriptQueue = {},{}; + local PackageQueue, PluginQueue, ScriptQueue = {},{},{}; local INFO_BY = "%s |cff0099FFby %s|r"; local INFO_VERSION = "%s%s |cff33FF00Version: %s|r"; @@ -268,27 +284,34 @@ do INFO_HEADER = "SuperVillain UI (устарела %.3f): Плагины"; end - local rootstring = function(self) return self.___name end + local PLUGIN_LISTING = ""; + + local rootstring = function(self) return self.___addonName end local changeDBVar = function(self, value, key, sub1, sub2, sub3) - local config = self.__owner.db[self.___name] + local core = self.___core + local schema = self.___schema + local config = core.db[schema] + if((sub1 and sub2 and sub3) and (config[sub1] and config[sub1][sub2] and config[sub1][sub2][sub3])) then - self.__owner.db[self.___name][sub1][sub2][sub3][key] = value + core.db[schema][sub1][sub2][sub3][key] = value elseif((sub1 and sub2) and (config[sub1] and config[sub1][sub2])) then - self.__owner.db[self.___name][sub1][sub2][key] = value + core.db[schema][sub1][sub2][key] = value elseif(sub1 and config[sub1]) then - self.__owner.db[self.___name][sub1][key] = value + core.db[schema][sub1][key] = value else - self.__owner.db[self.___name][key] = value + core.db[schema][key] = value end - self.db = self.__owner.db[self.___name] + + self.db = core.db[schema] + if(self.UpdateLocals) then self:UpdateLocals() end end local innerOnEvent = function(self, event, ...) - local obj = self.__owner + local obj = self.module if self[event] and type(self[event]) == "function" then self[event](obj, event, ...) end @@ -297,16 +320,20 @@ do local registerEvent = function(self, eventname, eventfunc) if not self.___eventframe then self.___eventframe = CreateFrame("Frame", nil) - self.___eventframe.__owner = self + self.___eventframe.module = self self.___eventframe:SetScript("OnEvent", innerOnEvent) end - local fn = eventfunc - if type(eventfunc) == "string" then - fn = self[eventfunc] - elseif(not fn and self[eventname]) then - fn = self[eventname] + + 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[eventname] = fn + self.___eventframe:RegisterEvent(eventname) end @@ -316,18 +343,70 @@ do end end - local addonEvent = function(self, event, addon) - if addon == "SVUI_ConfigOMatic" then - local list = self.__owner.Plugins - for i, plugin in pairs(list) do - if(plugin.callback) then - plugin.callback() + local innerOnUpdate = function(self, elapsed) + if self.elapsed and self.elapsed > (self.throttle) then + local obj = self.module + local core = obj.___core + local callbacks = self.callbacks + + for name, fn in pairs(callbacks) do + local _, error = pcall(fn, obj) + if(error and core.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 function SetNewComponent(obj, name, parent, plugin) + local function SetPluginString(addonName) + local pluginString = PLUGIN_LISTING or "" + local author = GetAddOnMetadata(addonName, "Author") or "Unknown" + local Pname = GetAddOnMetadata(addonName, "Title") or addonName + local version = GetAddOnMetadata(addonName, "Version") or "???" + pluginString = INFO_BY:format(pluginString, author) + pluginString = ("%s%s"):format(pluginString, Pname) + pluginString = INFO_VERSION:format(pluginString, "|cff00FF00", version) + pluginString = ("%s|r\n"):format(pluginString) + + PLUGIN_LISTING = pluginString + end + + local function SetFoundAddon() + -- DO STUFF + end + + local function SetInternalModule(obj, schema, core) local addonmeta = {} local oldmeta = getmetatable(obj) if oldmeta then @@ -335,19 +414,49 @@ do end addonmeta.__tostring = rootstring setmetatable( obj, addonmeta ) - obj.___name = name - obj.__owner = parent + + local addonName = ("SVUI [%s]"):format(schema) + + obj.___addonName = addonName + obj.___schema = schema + obj.___core = core obj.initialized = false obj.CombatLocked = false obj.ChangeDBVar = changeDBVar obj.RegisterEvent = registerEvent obj.UnregisterEvent = unregisterEvent - if(not plugin) then - return obj + obj.RegisterUpdate = registerUpdate + obj.UnregisterUpdate = unregisterUpdate + + return obj + end + + local function SetExternalModule(obj, schema, core, addon) + 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 = ("%s [%s]"):format(addon, schema) + + obj.___addonName = addonName + obj.___schema = schema + obj.___core = core + 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 Registry_SetCallback = function(self, fn) + local Registry_NewCallback = function(self, fn) if(fn and type(fn) == "function") then self.Callbacks[#self.Callbacks+1] = fn end @@ -359,59 +468,52 @@ do end end - local Registry_NewPackage = function(self, obj, name) - if self.__owner[name] then return end - PackageQueue[#PackageQueue+1] = name - self.Packages[#self.Packages+1] = name + local Registry_NewPackage = function(self, obj, schema) + local core = self.___core + if(core[schema]) then return end + + PackageQueue[#PackageQueue+1] = schema + self.Modules[#self.Modules+1] = schema - self.__owner[name] = SetNewComponent(obj, name, self.__owner) + core[schema] = SetInternalModule(obj, schema, core) - if(self.__owner.AddonLaunched) then - if(self.__owner[name].Load) then - self.__owner[name]:Load() + if(core.AddonLaunched) then + if(core[schema].Load) then + core[schema]:Load() end end end - local Registry_FetchPlugins = function(self) - local list = ""; - for addon, plugin in pairs(self.Plugins) do - if addon ~= self.__owner.___name then - local author = GetAddOnMetadata(addon, "Author") - local Pname = GetAddOnMetadata(addon, "Title") or addon - list = ("%s%s"):format(list, Pname) - if author then - list = self.INFO_BY:format(list, author) - end - list = self.INFO_VERSION:format(list, "|cff00FF00", plugin.version) - list = ("%s|r\n"):format(list) - end - end - return list - end + local Registry_NewPlugin = function(self, obj) + local core = self.___core + local coreName = core.___addonName + local addonName = obj.___addonName - local Registry_NewPlugin = function(self, obj, name, callbackFunc) - if(callbackFunc and type(callbackFunc) == "function") then - local addon = obj.___name - local ver = obj.___ver or GetAddOnMetadata(addon, "Version") - local oldFlag = (ver < self.__owner.___ver) - self.Plugins[addon] = { - version = ver, - callback = callbackFunc - } - if addon ~= self.__owner.___name then - local fetch = self:FetchPlugins() or "" - self.__owner.Options.args.plugins.args.pluginOptions.args.pluginlist.args.active.name = fetch + if(addonName and addonName ~= coreName) then + local schema = GetAddOnMetadata(addonName, "X-SVUI"); + if(not schema or (schema and core[schema])) then return end + + PluginQueue[#PluginQueue+1] = schema + self.Modules[#self.Modules+1] = schema + + SetPluginString(addonName) + + core[schema] = SetExternalModule(obj, schema, core, addonName) + + if(core.AddonLaunched and core[schema].Load) then + core[schema]:Load() end - callbackFunc() end + end - SetNewComponent(obj, name, self.__owner, true) + local Registry_FetchPlugins = function(self) + -- DO STUFF end local Registry_RunCallbacks = function(self) - for i=1, #self.Callbacks do - local fn = self.Callbacks[i] + local callbacks = self.Callbacks + for i=1, #callbacks do + local fn = callbacks[i] if(fn and type(fn) == "function") then fn() end @@ -419,10 +521,11 @@ do end local Registry_Update = function(self, name, dataOnly) - local obj = self.__owner[name] + local core = self.___core + local obj = core[name] if obj then - if self.__owner.db[name] then - obj.db = self.__owner.db[name] + if core.db[name] then + obj.db = core.db[name] end if obj.ReLoad and not dataOnly then obj:ReLoad() @@ -431,12 +534,15 @@ do end local Registry_UpdateAll = function(self) - local list = self.Packages - for _,name in pairs(list) do - local obj = self.__owner[name] - if self.__owner.db[name] then - obj.db = self.__owner.db[name] + local modules = self.Modules + local core = self.___core + for _,name in pairs(modules) do + local obj = core[name] + + if core.db[name] then + obj.db = core.db[name] end + if obj and obj.ReLoad then obj:ReLoad() end @@ -445,12 +551,14 @@ do local Registry_Load = function(self) if not PackageQueue then return end + local core = self.___core + for i=1,#PackageQueue do local name = PackageQueue[i] - local obj = self.__owner[name] + local obj = core[name] if obj and not obj.initialized then - if self.__owner.db[name] then - obj.db = self.__owner.db[name] + if core.db[name] then + obj.db = core.db[name] end if obj.Load then local halt = false @@ -485,8 +593,8 @@ do function SetAddonCore(obj,n,v) obj = { - ___name = n, - ___ver = v, + ___addonName = n, + ___version = v, db = {}, Global = { Accountant = {}, @@ -527,7 +635,7 @@ do active = { order = 1, type = "description", - name = "" + name = function() return PLUGIN_LISTING end } } }, @@ -538,18 +646,16 @@ do } }, Registry = { - Packages = {}, + Modules = {}, Plugins = {}, Callbacks = {}, - INFO_BY = INFO_BY, INFO_VERSION = INFO_VERSION, INFO_NEW = INFO_NEW, INFO_NAME = INFO_NAME, INFO_HEADER = INFO_HEADER, - SetCallback = Registry_SetCallback, + NewCallback = Registry_NewCallback, NewScript = Registry_NewScript, NewPackage = Registry_NewPackage, - FetchPlugins = Registry_FetchPlugins, NewPlugin = Registry_NewPlugin, RunCallbacks = Registry_RunCallbacks, Update = Registry_Update, @@ -565,15 +671,14 @@ do mt.__tostring = rootstring setmetatable(obj, mt) - obj.Registry.__owner = obj + obj.Registry.___core = obj return obj end end -SVUI = SetAddonCore(SVUI, SVUINameSpace, version) - --[[ LOCALIZATION HELPERS ]]-- + local failsafe = function() assert(false) end local metaread = { @@ -600,18 +705,33 @@ local metawrite = setmetatable({}, { end, __index = failsafe }) +--[[ +########################################################## + /$$$$$$ /$$$$$$ /$$$$$$$ /$$$$$$$$ + /$$__ $$ /$$__ $$| $$__ $$| $$_____/ +| $$ \__/| $$ \ $$| $$ \ $$| $$ +| $$ | $$ | $$| $$$$$$$/| $$$$$ +| $$ | $$ | $$| $$__ $$| $$__/ +| $$ $$| $$ | $$| $$ \ $$| $$ +| $$$$$$/| $$$$$$/| $$ | $$| $$$$$$$$ + \______/ \______/ |__/ |__/|________/ +########################################################## +]]-- +SVUI = SetAddonCore(SVUI, SVUINameSpace, version) SVUI.Localization = setmetatable({}, metaread) --[[ MISC ]]-- + SVUI.fubar = function() return end SVUI.class = select(2,UnitClass("player")); SVUI.ClassRole = ""; +SVUI.UnitRole = "NONE"; SVUI.ConfigurationMode = false; SVUI.DebuggingMode = false ---[[ MISC ]]-- --[[ UTILITY FRAMES ]]-- + SVUI.UIParent = CreateFrame("Frame", "SVUIParent", UIParent); SVUI.UIParent:SetFrameLevel(UIParent:GetFrameLevel()); SVUI.UIParent:SetPoint("CENTER", UIParent, "CENTER"); @@ -620,7 +740,8 @@ SVUI.Snap[1] = SVUI.UIParent; SVUI.Cloaked = CreateFrame("Frame", nil, UIParent); SVUI.Cloaked:Hide(); ---[[ UTILITY FRAMES ]]-- + +--[[ COMMON FUNCTIONS ]]-- function SVUI:SetLocaleStrings(locale, isDefault) local gameLocale = GetLocale() @@ -635,11 +756,16 @@ function SVUI:SetLocaleStrings(locale, isDefault) end end -function SVUI:Prototype(n, v) +function SVUI:Prototype(name) + local version = GetAddOnMetadata(name, "Version") + local schema = GetAddOnMetadata(name, "X-SVUI") + local obj = { - ___name = n, - ___ver = v + ___addonName = name, + ___version = version, + ___schema = schema } + local mt = {} local old = getmetatable(obj) if old then @@ -684,4 +810,6 @@ end SVUICore[1] = SVUI SVUICore[2] = SVUI.Localization +--[[ SET MASTER GLOBAL ]]-- + _G[SVUINameSpace] = SVUICore; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/SVUI.toc b/Interface/AddOns/SVUI/SVUI.toc index 51d6220..8f02ede 100644 --- a/Interface/AddOns/SVUI/SVUI.toc +++ b/Interface/AddOns/SVUI/SVUI.toc @@ -1,6 +1,6 @@ -## Interface: 50400 +## Interface: 60000 ## Author: Munglunch -## Version: 4.084 +## Version: 5.02 ## Title: |cffFF9900SVUI|r ## Notes: Supervillain UI [|cff9911FFCore Framework|r]. ## SavedVariables: SVUI_Global @@ -9,5 +9,6 @@ ## X-oUF: oUF_SuperVillain ## X-Notes: Special thanks to Elv and Tukz for their incredible work. ## X-Email: munglunch@gmail.com +## X-SVUI: SuperVillain SVUI.xml diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ActionPanel/oUF_ActionPanel.lua b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ActionPanel/oUF_ActionPanel.lua index ac98666..8de49c9 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ActionPanel/oUF_ActionPanel.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ActionPanel/oUF_ActionPanel.lua @@ -53,7 +53,7 @@ local Update = function(self, event, unit) texture:SetTexture(media[3]) texture:SetGradient("VERTICAL",1,1,0,1,0,0) else - texture:SetTexture(0,0,0,0) + texture:SetTexture("") end end end diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ActionPanel/oUF_ActionPanel.toc b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ActionPanel/oUF_ActionPanel.toc index d9bd2a0..129e085 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ActionPanel/oUF_ActionPanel.toc +++ b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ActionPanel/oUF_ActionPanel.toc @@ -2,7 +2,7 @@ ## Title: oUF ActionPanel ## Notes: Adds a backing to all unit frames that provides many utilities. ## Author: Munglunch -## Version: 4.084 +## Version: 5.02 ## X-Category: oUF ## Dependencies: oUF diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Afflicted/oUF_Afflicted.toc b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Afflicted/oUF_Afflicted.toc index 19e041b..ee5034f 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Afflicted/oUF_Afflicted.toc +++ b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Afflicted/oUF_Afflicted.toc @@ -2,7 +2,7 @@ ## Title: oUF Afflicted ## Notes: Adds Custom Debuff Highlighting to oUF. ## Author: Munglunch -## Version: 4.084 +## Version: 5.02 ## X-Category: oUF ## Dependencies: oUF diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc index 3550d8a..021f782 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc +++ b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc @@ -2,7 +2,7 @@ ## Title: oUF Arcane Charge ## Notes: Adds support for arcane charge indicators to oUF. ## Author: Munglunch -## Version: 4.084 +## Version: 5.02 ## Dependencies: oUF oUF_ArcaneCharge.lua \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Combatant/oUF_Combatant.toc b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Combatant/oUF_Combatant.toc index 37634eb..2e2d68f 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Combatant/oUF_Combatant.toc +++ b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Combatant/oUF_Combatant.toc @@ -2,7 +2,7 @@ ## Title: oUF Combatant ## Notes: Adds PvP trinket status and spec icons to oUF frames. ## Author: Munglunch -## Version: 4.0840 +## Version: 5.020 ## X-Category: oUF ## Dependencies: oUF diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Friendship/oUF_Friendship.lua b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Friendship/oUF_Friendship.lua index f37e03f..f381dd2 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Friendship/oUF_Friendship.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_Friendship/oUF_Friendship.lua @@ -24,7 +24,7 @@ local friendships = { [GetFactionInfoByID(1281)] = 1281, [GetFactionInfoByID(1282)] = 1282, [GetFactionInfoByID(1283)] = 1283, - [GetFactionInfoByID(1357)] = 1357, + -- [GetFactionInfoByID(1357)] = 1357, [GetFactionInfoByID(1358)] = 1358, } diff --git a/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua b/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua index e4ddda8..54282bf 100644 --- a/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua +++ b/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua @@ -109,16 +109,18 @@ local function RefreshMicrobar() for i=1,13 do local data = ICON_DATA[i] local button = _G[data[1]] - button:ClearAllPoints() - button:Size(buttonSize, buttonSize + 28) - button._fade = MOD.db.Micro.mouseover - if lastParent == SVUI_MicroBar then - button:SetPoint("BOTTOMLEFT",lastParent,"BOTTOMLEFT",1,1) - else - button:SetPoint('LEFT',lastParent,'RIGHT',spacing,0) - end - lastParent = button; - button:Show() + if(button) then + button:ClearAllPoints() + button:Size(buttonSize, buttonSize + 28) + button._fade = MOD.db.Micro.mouseover + if lastParent == SVUI_MicroBar then + button:SetPoint("BOTTOMLEFT",lastParent,"BOTTOMLEFT",1,1) + else + button:SetPoint('LEFT',lastParent,'RIGHT',spacing,0) + end + lastParent = button; + button:Show() + end end end @@ -153,8 +155,11 @@ local SVUIMicroButtonsParent = function(self) self = SVUI_MicroBar end for i=1,13 do - local data = ICON_DATA[i] - _G[data[1]]:SetParent(SVUI_MicroBar) + local data = ICON_DATA[i] + if(data) then + local mButton = _G[data[1]] + if(mButton) then mButton:SetParent(SVUI_MicroBar) end + end end end @@ -343,15 +348,15 @@ local function ModifyActionButton(parent) checked:SetTexture(1,1,1,.2) end if flash then - flash:SetTexture(0,0,0,0) + flash:SetTexture("") end if normal then - normal:SetTexture(0,0,0,0) + normal:SetTexture("") normal:Hide() normal:SetAlpha(0) end if parentTex then - parentTex:SetTexture(0,0,0,0) + parentTex:SetTexture("") parentTex:Hide() parentTex:SetAlpha(0) end @@ -1312,40 +1317,44 @@ CreateMicroBar = function(self) SuperVillain:AddToDisplayAudit(microBar) for i=1,13 do - local data = ICON_DATA[i] - local button = _G[data[1]] - button:SetParent(SVUI_MicroBar) - button:Size(buttonSize, buttonSize + 28) - button.Flash:SetTexture(0,0,0,0) - if button.SetPushedTexture then - button:SetPushedTexture("") - end - if button.SetNormalTexture then - button:SetNormalTexture("") - end - if button.SetDisabledTexture then - button:SetDisabledTexture("") - end - if button.SetHighlightTexture then - button:SetHighlightTexture("") - end - button:Formula409() - - local buttonMask = NewFrame("Frame",nil,button) - buttonMask:SetPoint("TOPLEFT",button,"TOPLEFT",0,-28) - buttonMask:SetPoint("BOTTOMRIGHT",button,"BOTTOMRIGHT",0,0) - buttonMask:SetFramedButtonTemplate() - buttonMask:SetPanelColor() - buttonMask.icon = buttonMask:CreateTexture(nil,"OVERLAY",nil,2) - buttonMask.icon:FillInner(buttonMask,2,2) - buttonMask.icon:SetTexture(ICON_FILE) - buttonMask.icon:SetTexCoord(data[2],data[3],data[4],data[5]) - buttonMask.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - button.overlay = buttonMask; - button._fade = self.db.Micro.mouseover - button:HookScript('OnEnter', MicroButton_OnEnter) - button:HookScript('OnLeave', MicroButton_OnLeave) - button:Show() + local data = ICON_DATA[i] + if(data) then + local button = _G[data[1]] + if(button) then + button:SetParent(SVUI_MicroBar) + button:Size(buttonSize, buttonSize + 28) + button.Flash:SetTexture("") + if button.SetPushedTexture then + button:SetPushedTexture("") + end + if button.SetNormalTexture then + button:SetNormalTexture("") + end + if button.SetDisabledTexture then + button:SetDisabledTexture("") + end + if button.SetHighlightTexture then + button:SetHighlightTexture("") + end + button:Formula409() + + local buttonMask = NewFrame("Frame",nil,button) + buttonMask:SetPoint("TOPLEFT",button,"TOPLEFT",0,-28) + buttonMask:SetPoint("BOTTOMRIGHT",button,"BOTTOMRIGHT",0,0) + buttonMask:SetFramedButtonTemplate() + buttonMask:SetPanelColor() + buttonMask.icon = buttonMask:CreateTexture(nil,"OVERLAY",nil,2) + buttonMask.icon:FillInner(buttonMask,2,2) + buttonMask.icon:SetTexture(ICON_FILE) + buttonMask.icon:SetTexCoord(data[2],data[3],data[4],data[5]) + buttonMask.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + button.overlay = buttonMask; + button._fade = self.db.Micro.mouseover + button:HookScript('OnEnter', MicroButton_OnEnter) + button:HookScript('OnLeave', MicroButton_OnLeave) + button:Show() + end + end end MicroButtonPortrait:ClearAllPoints() diff --git a/Interface/AddOns/SVUI/packages/bag/SVBag.lua b/Interface/AddOns/SVUI/packages/bag/SVBag.lua index 402e653..d3c9d59 100644 --- a/Interface/AddOns/SVUI/packages/bag/SVBag.lua +++ b/Interface/AddOns/SVUI/packages/bag/SVBag.lua @@ -173,16 +173,18 @@ local function BuildEquipmentMap() gearSet = GetEquipmentSetLocations(set); if(gearSet) then for key, location in pairs(gearSet)do - player, bank, bags, _, index, bag = EquipmentManager_UnpackLocation(location); - if((bank or bags) and (index and bag)) then - loc = format("%d_%d", bag, index); - gearList[loc] = (gearList[loc] or {}); - tinsert(gearList[loc], set); + if(type(location) ~= "string") then + player, bank, bags, _, index, bag = EquipmentManager_UnpackLocation(location); + if((bank or bags) and (index and bag)) then + loc = format("%d_%d", bag, index); + gearList[loc] = (gearList[loc] or {}); + tinsert(gearList[loc], set); + end end end end end -end +end --[[ ########################################################## CORE FUNCTIONS @@ -238,7 +240,6 @@ function MOD:RefreshSlot(bag, slotID) local itemLink = GetContainerItemLink(bag, slotID); local key; slot:Show() - slot.questIcon:Hide() slot.name, slot.rarity = nil, nil; local start, duration, enable = GetContainerItemCooldown(bag, slotID) CooldownFrame_SetTimer(slot.cooldown, start, duration, enable) @@ -258,7 +259,6 @@ function MOD:RefreshSlot(bag, slotID) local z, A, C = GetContainerItemQuestInfo(bag, slotID) if A and not isActive then slot:SetBackdropBorderColor(1.0, 0.3, 0.3) - slot.questIcon:Show() elseif A or z then slot:SetBackdropBorderColor(1.0, 0.3, 0.3) elseif slot.rarity and slot.rarity>1 then @@ -436,16 +436,11 @@ function MOD:Layout(isBank) f.Bags[bagID][slotID]:SetNormalTexture(nil); f.Bags[bagID][slotID]:SetCheckedTexture(nil); f.Bags[bagID][slotID]:SetSlotTemplate(true, 2, 0, 0, true); + if(_G[f.Bags[bagID][slotID]:GetName().."NewItemTexture"]) then _G[f.Bags[bagID][slotID]:GetName().."NewItemTexture"]:Hide() end - f.Bags[bagID][slotID].count:ClearAllPoints(); - f.Bags[bagID][slotID].count:Point("BOTTOMRIGHT", 0, 2); - f.Bags[bagID][slotID].questIcon = _G[f.Bags[bagID][slotID]:GetName().."IconQuestTexture"]; - f.Bags[bagID][slotID].questIcon:SetTexture(TEXTURE_ITEM_QUEST_BANG); - f.Bags[bagID][slotID].questIcon:FillInner(f.Bags[bagID][slotID]); - f.Bags[bagID][slotID].questIcon:SetTexCoord(0.1, 0.9, 0.1, 0.9 ); - f.Bags[bagID][slotID].questIcon:Hide(); + f.Bags[bagID][slotID].iconTexture = _G[f.Bags[bagID][slotID]:GetName().."IconTexture"]; f.Bags[bagID][slotID].iconTexture:FillInner(f.Bags[bagID][slotID]); f.Bags[bagID][slotID].iconTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9 ); diff --git a/Interface/AddOns/SVUI/packages/chat/SVChat.lua b/Interface/AddOns/SVUI/packages/chat/SVChat.lua index 32de19d..ce1648c 100644 --- a/Interface/AddOns/SVUI/packages/chat/SVChat.lua +++ b/Interface/AddOns/SVUI/packages/chat/SVChat.lua @@ -578,15 +578,15 @@ do chat:Formula409(true) _G[chatName.."ButtonFrame"]:MUNG() ------------------------------------------- - _G[tabName .."Left"]:SetTexture(0,0,0,0) - _G[tabName .."Middle"]:SetTexture(0,0,0,0) - _G[tabName .."Right"]:SetTexture(0,0,0,0) - _G[tabName .."SelectedLeft"]:SetTexture(0,0,0,0) - _G[tabName .."SelectedMiddle"]:SetTexture(0,0,0,0) - _G[tabName .."SelectedRight"]:SetTexture(0,0,0,0) - _G[tabName .."HighlightLeft"]:SetTexture(0,0,0,0) - _G[tabName .."HighlightMiddle"]:SetTexture(0,0,0,0) - _G[tabName .."HighlightRight"]:SetTexture(0,0,0,0) + _G[tabName .."Left"]:SetTexture("") + _G[tabName .."Middle"]:SetTexture("") + _G[tabName .."Right"]:SetTexture("") + _G[tabName .."SelectedLeft"]:SetTexture("") + _G[tabName .."SelectedMiddle"]:SetTexture("") + _G[tabName .."SelectedRight"]:SetTexture("") + _G[tabName .."HighlightLeft"]:SetTexture("") + _G[tabName .."HighlightMiddle"]:SetTexture("") + _G[tabName .."HighlightRight"]:SetTexture("") tab.text = _G[chatName.."TabText"] tab.text:SetTextColor(1, 1, 1) diff --git a/Interface/AddOns/SVUI/packages/dock/SVDock.lua b/Interface/AddOns/SVUI/packages/dock/SVDock.lua index d0c945e..a54747f 100644 --- a/Interface/AddOns/SVUI/packages/dock/SVDock.lua +++ b/Interface/AddOns/SVUI/packages/dock/SVDock.lua @@ -292,7 +292,7 @@ local function SetSuperDockStyle(dock) backdrop.bottom:Point("BOTTOMRIGHT", -1, 1) backdrop.bottom:Height(4) backdrop.top = backdrop:CreateTexture(nil, "OVERLAY") - backdrop.top:SetTexture(0, 0, 0, 0) + backdrop.top:SetTexture("") backdrop.top:Point("TOPLEFT", 1, -1) backdrop.top:Point("TOPRIGHT", -1, 1) backdrop.top:SetAlpha(0) @@ -426,7 +426,7 @@ local function BorderColorUpdates() SVUIBottomPanel:SetBackdropBorderColor(0,0,0,1) end -SuperVillain.Registry:SetCallback(BorderColorUpdates) +SuperVillain.Registry:NewCallback(BorderColorUpdates) function MOD:CreateDockPanels() self.SuperDockFaded = SVUI_Cache["Dock"].SuperDockFaded diff --git a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua index dc2b981..a6598b5 100644 --- a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua +++ b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua @@ -691,51 +691,62 @@ end INVITE AUTOMATONS ########################################################## ]]-- -local function AutoGroupInvite(self, event, arg) +function MOD:PARTY_INVITE_REQUEST(event, arg) if not SuperVillain.db.SVHenchmen.autoAcceptInvite then return end - if IsInGroup() then return end - if event == "PARTY_INVITE_REQUEST" then - if QueueStatusMinimapButton:IsShown() then return end - hideStatic = true; - if GetNumFriends() > 0 then ShowFriends() end - if IsInGuild() then GuildRoster() end - local invited = false; - for i = 1, GetNumFriends()do - local friend = GetFriendInfo(i) + + if IsInGroup() or QueueStatusMinimapButton:IsShown() then return end + + if GetNumFriends() > 0 then ShowFriends() end + if IsInGuild() then GuildRoster() end + + hideStatic = true; + local invited = false; + for i = 1, GetNumFriends()do + local friend = GetFriendInfo(i) + if friend == arg then + AcceptGroup() + invited = true; + SuperVillain:AddonMessage("Accepted an Invite From Your Friends!") + break + end + end + if not invited then + for i = 1, BNGetNumFriends()do + local _, _, _, friend = BNGetFriendInfo(i) + arg = arg:match("(.+)%-.+") or arg; if friend == arg then AcceptGroup() invited = true; - SuperVillain:AddonMessage("Accepted an Invite From Your Friends!") + SuperVillain:AddonMessage("Accepted an Invite!") break end end - if not invited then - for i = 1, GetNumGuildMembers(true)do - local guildMate = GetGuildRosterInfo(i) - if guildMate == arg then - AcceptGroup() - invited = true; - SuperVillain:AddonMessage("Accepted an Invite From Your Guild!") - break - end - end - end - if not invited then - for i = 1, BNGetNumFriends()do - local _, _, _, friend = BNGetFriendInfo(i) - arg = arg:match("(.+)%-.+") or arg; - if friend == arg then - AcceptGroup() - SuperVillain:AddonMessage("Accepted an Invite!") - break - end + end + if not invited then + for i = 1, GetNumGuildMembers(true)do + local guildMate = GetGuildRosterInfo(i) + if guildMate == arg then + AcceptGroup() + invited = true; + SuperVillain:AddonMessage("Accepted an Invite From Your Guild!") + break end end - elseif event == "GROUP_ROSTER_UPDATE" and hideStatic == true then - StaticPopup_Hide("PARTY_INVITE") - hideStatic = false + end + if invited then + local popup = StaticPopup_FindVisible("PARTY_INVITE") + if(popup) then + popup.inviteAccepted = 1 + StaticPopup_Hide("PARTY_INVITE") + else + popup = StaticPopup_FindVisible("PARTY_INVITE_XREALM") + if(popup) then + popup.inviteAccepted = 1 + StaticPopup_Hide("PARTY_INVITE_XREALM") + end + end end -end +end --[[ ########################################################## REPAIR AUTOMATONS @@ -914,8 +925,8 @@ function MOD:Load() self:ToggleMailMinions() end - self:RegisterEvent('PARTY_INVITE_REQUEST', AutoGroupInvite) - self:RegisterEvent('GROUP_ROSTER_UPDATE', AutoGroupInvite) + self:RegisterEvent('PARTY_INVITE_REQUEST') + for _,event in pairs(AutomatedEvents) do self:RegisterEvent(event) end diff --git a/Interface/AddOns/SVUI/packages/map/SVMap.lua b/Interface/AddOns/SVUI/packages/map/SVMap.lua index 7f204cc..ff61fb6 100644 --- a/Interface/AddOns/SVUI/packages/map/SVMap.lua +++ b/Interface/AddOns/SVUI/packages/map/SVMap.lua @@ -220,7 +220,7 @@ do if frame:GetObjectType() == "Texture" then local iconFile = frame:GetTexture() if(iconFile ~= nil and (iconFile:find("Border") or iconFile:find("Background") or iconFile:find("AlphaMask"))) then - frame:SetTexture(0,0,0,0) + frame:SetTexture("") else frame:ClearAllPoints() frame:Point("TOPLEFT", btn, "TOPLEFT", 2, -2) @@ -328,7 +328,7 @@ local function AdjustMapSize() elseif WORLDMAP_SETTINGS.size == WORLDMAP_QUESTLIST_SIZE then SetQuestWorldMap() end - BlackoutWorld:SetTexture(0,0,0,0) + BlackoutWorld:SetTexture("") else if WORLDMAP_SETTINGS.size == WORLDMAP_FULLMAP_SIZE then WorldMapFrame_SetFullMapView() diff --git a/Interface/AddOns/SVUI/packages/override/SVOverride.lua b/Interface/AddOns/SVUI/packages/override/SVOverride.lua index 0edbff1..78c2fcb 100644 --- a/Interface/AddOns/SVUI/packages/override/SVOverride.lua +++ b/Interface/AddOns/SVUI/packages/override/SVOverride.lua @@ -404,7 +404,7 @@ local function SetTimerStyle(bar) for i=1, bar:GetNumRegions()do local child = select(i, bar:GetRegions()) if child:GetObjectType() == "Texture"then - child:SetTexture(0,0,0,0) + child:SetTexture("") elseif child:GetObjectType() == "FontString" then child:SetFontTemplate(SuperVillain.Media.font.roboto, 12, 'OUTLINE') end @@ -994,9 +994,9 @@ local GroupLootDropDown_GiveLoot = function(self) end local BailOut_OnEvent = function(self, event, ...) - if (event == "UNIT_ENTERED_VEHICLE" or CanExitVehicle()) then + if (event == "UNIT_ENTERED_VEHICLE" and CanExitVehicle()) then self:Show() - elseif(event == "UNIT_EXITED_VEHICLE") then + else self:Hide() end end @@ -1094,6 +1094,7 @@ function MOD:Load() exit:RegisterEvent("UNIT_ENTERED_VEHICLE") exit:RegisterEvent("UNIT_EXITED_VEHICLE") exit:RegisterEvent("VEHICLE_UPDATE") + exit:RegisterEvent("PLAYER_ENTERING_WORLD") exit:SetScript("OnEvent", BailOut_OnEvent) exit:Hide() diff --git a/Interface/AddOns/SVUI/packages/plates/SVPlate.lua b/Interface/AddOns/SVUI/packages/plates/SVPlate.lua index d581191..bec98bd 100644 --- a/Interface/AddOns/SVUI/packages/plates/SVPlate.lua +++ b/Interface/AddOns/SVUI/packages/plates/SVPlate.lua @@ -1167,22 +1167,22 @@ do health:Hide() fontRegions:Hide() - ref.threat:SetTexture(0,0,0,0) + ref.threat:SetTexture("") ref.border:Hide() - ref.highlight:SetTexture(0,0,0,0) + ref.highlight:SetTexture("") ref.level:SetWidth( 000.1 ) ref.level:Hide() - ref.skullicon:SetTexture(0,0,0,0) + ref.skullicon:SetTexture("") ref.raidicon:SetAlpha( 0 ) - ref.eliteicon:SetTexture(0,0,0,0) + ref.eliteicon:SetTexture("") plate.name:Hide() - cast.border:SetTexture(0,0,0,0) - cast.shield:SetTexture(0,0,0,0) + cast.border:SetTexture("") + cast.shield:SetTexture("") cast.icon:SetTexCoord( 0, 0, 0, 0 ) cast.icon:SetWidth(.001) - cast.shadow:SetTexture(0,0,0,0) + cast.shadow:SetTexture("") cast.shadow:Hide() cast.text:Hide() diff --git a/Interface/AddOns/SVUI/packages/stats/stats/bags.lua b/Interface/AddOns/SVUI/packages/stats/stats/bags.lua index 9156da3..d171898 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/bags.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/bags.lua @@ -98,5 +98,5 @@ local BagsColorUpdate = function() end end; -SuperVillain.Registry:SetCallback(BagsColorUpdate) +SuperVillain.Registry:NewCallback(BagsColorUpdate) MOD:Extend("Bags", StatEvents, bags_events, nil, bags_click, bags_focus); \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/cta.lua b/Interface/AddOns/SVUI/packages/stats/stats/cta.lua index e4f46c2..348baae 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/cta.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/cta.lua @@ -154,6 +154,6 @@ local CTAColorUpdate = function() CTA_OnEvent(currentObject) end end; -SuperVillain.Registry:SetCallback(CTAColorUpdate) +SuperVillain.Registry:NewCallback(CTAColorUpdate) MOD:Extend('Call to Arms', StatEvents, CTA_OnEvent, nil, CTA_OnClick, CTA_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/dps.lua b/Interface/AddOns/SVUI/packages/stats/stats/dps.lua index 780e31c..4f5b080 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/dps.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/dps.lua @@ -123,5 +123,5 @@ local DPSColorUpdate = function() end end -SuperVillain.Registry:SetCallback(DPSColorUpdate) +SuperVillain.Registry:NewCallback(DPSColorUpdate) MOD:Extend('DPS', StatEvents, DPS_OnEvent, nil, DPS_OnClick, DPS_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/durability.lua b/Interface/AddOns/SVUI/packages/stats/stats/durability.lua index f410471..962a8c5 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/durability.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/durability.lua @@ -142,7 +142,7 @@ local DurColorUpdate = function() Durability_OnEvent(currentObject) end end; -SuperVillain.Registry:SetCallback(DurColorUpdate) +SuperVillain.Registry:NewCallback(DurColorUpdate) MOD:Extend("Durability", StatEvents, Durability_OnEvent, nil, Durability_OnClick, Durability_OnEnter) MOD:Extend("Durability Bar", StatEvents, DurabilityBar_OnEvent, nil, Durability_OnClick, Durability_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/friends.lua b/Interface/AddOns/SVUI/packages/stats/stats/friends.lua index 8b364e4..96542ce 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/friends.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/friends.lua @@ -379,6 +379,6 @@ local FriendsColorUpdate = function() end end; -SuperVillain.Registry:SetCallback(FriendsColorUpdate) +SuperVillain.Registry:NewCallback(FriendsColorUpdate) MOD:Extend('Friends', StatEvents, OnEvent, nil, Click, OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/guild.lua b/Interface/AddOns/SVUI/packages/stats/stats/guild.lua index e7d2370..56b3c40 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/guild.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/guild.lua @@ -59,7 +59,7 @@ local guildFormattedFaction = join("|cff", patternColor, "%s:|r |cFFFFFFFF%s/%s local guildFormattedOnline = join("", "+ %d ", FRIENDS_LIST_ONLINE, "..."); local guildFormattedNote = join("", "|cff999999 ", LABEL_NOTE, ":|r %s"); local guildFormattedRank = join("", "|cff999999 ", GUILD_RANK1_DESC, ":|r %s"); -local GuildStatMembers,GuildStatXP,GuildStatMOTD = {},{},""; +local GuildStatMembers,GuildStatMOTD = {},""; local currentObject; local UnitFlagFormat = { @@ -104,7 +104,7 @@ local function SortGuildStatMembers(shift) end end end) -end; +end local function GetGuildStatMembers() twipe(GuildStatMembers) @@ -118,25 +118,12 @@ local function GetGuildStatMembers() GuildStatMembers[#GuildStatMembers + 1] = { name, rank, level, zone, note, officernote, online, statusFormat, classFileName, rankIndex, isMobile} end end -end; - -local function GetGuildStatXP() - local currentXP, nextLevelXP = UnitGetGuildXP("player") - local totalXP = currentXP + nextLevelXP; - local percent; - if currentXP > 0 and totalXP > 0 then - percent = ceil(currentXP / totalXP * 100) - else - percent = 0 - end; - GuildStatXP[0] = { currentXP, totalXP, percent } -end; +end local GuildStatEventHandler = { ["PLAYER_ENTERING_WORLD"] = function(arg1, arg2) if not GuildFrame and IsInGuild() then LoadAddOn("Blizzard_GuildUI") - GetGuildStatXP() GuildRoster() end end, @@ -151,9 +138,6 @@ local GuildStatEventHandler = { end end end, - ["GUILD_XP_UPDATE"] = function(arg1, arg2) - GetGuildStatXP() - end, ["PLAYER_GUILD_UPDATE"] = function(arg1, arg2) GuildRoster() end, @@ -167,29 +151,29 @@ local GuildStatEventHandler = { local function MenuInvite(self, unit) GuildDatatTextRightClickMenu:Hide() InviteUnit(unit) -end; +end local function MenuRightClick(self, unit) GuildDatatTextRightClickMenu:Hide() SetItemRef(("player:%s"):format(unit), ("|Hplayer:%1$s|h[%1$s]|h"):format(unit), "LeftButton") -end; +end local function MenuLeftClick() if IsInGuild() then if not GuildFrame then LoadAddOn("Blizzard_GuildUI") - end; + end GuildFrame_Toggle() GuildFrame_TabClicked(GuildFrameTab2) else if not LookingForGuildFrame then LoadAddOn("Blizzard_LookingForGuildUI") - end; + end if LookingForGuildFrame then LookingForGuildFrame_Toggle() end end -end; +end local function Guild_OnEvent(self, event, ...) currentObject = self; @@ -199,7 +183,7 @@ local function Guild_OnEvent(self, event, ...) else self.text:SetText(L['No Guild']) end -end; +end local function Guild_OnClick(self, button) if button == "RightButton" and IsInGuild() then @@ -228,11 +212,11 @@ local function Guild_OnClick(self, button) notCheckable = true, func = MenuInvite } - end; + end menuCountWhispers = menuCountWhispers + 1; if not grouped then grouped = "" - end; + end MenuMap[3].menuList[menuCountWhispers] = { text = ("|cff%02x%02x%02x%d|r |cff%02x%02x%02x%s|r %s"):format(levelc.r*255, levelc.g*255, levelc.b*255, info[3], classc.r*255, classc.g*255, classc.b*255, info[1], grouped), arg1 = info[1], @@ -240,46 +224,38 @@ local function Guild_OnClick(self, button) func = MenuRightClick } end - end; + end EasyMenu(MenuMap, GuildDatatTextRightClickMenu, "cursor", 0, 0, "MENU", 2) else MenuLeftClick() end -end; +end local function Guild_OnEnter(self, _, ap) if not IsInGuild() then return - end; + end MOD:Tip(self) local aq, ar = GetNumGuildMembers() - if #GuildStatMembers == 0 then GetGuildStatMembers() end; + if #GuildStatMembers == 0 then GetGuildStatMembers() end SortGuildStatMembers(IsShiftKeyDown()) - local as, at = GetGuildInfo('player') - local au = GetGuildLevel() - if as and at and au then - MOD.tooltip:AddDoubleLine(("%s [%d]"):format(as, au), guildFormattedName:format(GUILD, ar, aq), 0.4, 0.78, 1, 0.4, 0.78, 1) - MOD.tooltip:AddLine(at, 0.4, 0.78, 1) - end; + local guildName, guildRankName, guildRankIndex = GetGuildInfo('player') + if guildName and guildRankName then + MOD.tooltip:AddDoubleLine(("%s "):format(guildName), guildFormattedName:format(GUILD, ar, aq), 0.4, 0.78, 1, 0.4, 0.78, 1) + MOD.tooltip:AddLine(guildRankName, 0.4, 0.78, 1) + end if GuildStatMOTD ~= "" then MOD.tooltip:AddLine(' ') MOD.tooltip:AddLine(("%s |cffaaaaaa- |cffffffff%s"):format(GUILD_MOTD, GuildStatMOTD), 0.75, 0.9, 1, 1) - end; + end local av = SuperVillain:HexColor(0.75,0.9,1) - if GetGuildLevel() ~= 25 then - if GuildStatXP[0] then - local Z, a0, a1 = unpack(GuildStatXP[0]) - MOD.tooltip:AddLine(' ') - MOD.tooltip:AddLine(guildFormattedXP:format(TruncateString(Z), TruncateString(a0), a1)) - end - end; local _, _, standingID, barMin, barMax, barValue = GetGuildFactionInfo() if standingID ~= 8 then barMax = barMax - barMin; barValue = barValue - barMin; barMin = 0; MOD.tooltip:AddLine(guildFormattedFaction:format(COMBAT_FACTION_CHANGE, TruncateString(barValue), TruncateString(barMax), ceil(barValue / barMax * 100))) - end; + end local zoneColor, classColor, questColor, member, groupFormat; local counter = 0; MOD.tooltip:AddLine(' ') @@ -287,39 +263,39 @@ local function Guild_OnEnter(self, _, ap) if((30 - counter) <= 1) then if((ar - 30) > 1) then MOD.tooltip:AddLine(guildFormattedOnline:format(ar - 30), 0.75, 0.9, 1) - end; + end break - end; + end member = GuildStatMembers[X] if GetRealZoneText() == member[4]then zoneColor = {r=0.3,g=1.0,b=0.3} else zoneColor = {r=0.65,g=0.65,b=0.65} - end; + end classColor, questColor = RAID_CLASS_COLORS[member[9]], GetQuestDifficultyColor(member[3]) if UnitInParty(member[1]) or UnitInRaid(member[1]) then groupFormat = "|cffaaaaaa*|r" else groupFormat = "" - end; + end if IsShiftKeyDown() then MOD.tooltip:AddDoubleLine(("%s |cff999999-|cffffffff %s"):format(member[1], member[2]), member[4], classColor.r, classColor.g, classColor.b, zoneColor.r, zoneColor.g, zoneColor.b) if member[5] ~= ""then MOD.tooltip:AddLine(guildFormattedNote:format(member[5]), 0.75, 0.9, 1, 1) - end; + end if member[6] ~= ""then MOD.tooltip:AddLine(guildFormattedRank:format(member[6]), 0.3, 1, 0.3, 1) end else MOD.tooltip:AddDoubleLine(("|cff%02x%02x%02x%d|r %s%s %s"):format(questColor.r*255, questColor.g*255, questColor.b*255, member[3], member[1], groupFormat, member[8]), member[4], classColor.r, classColor.g, classColor.b, zoneColor.r, zoneColor.g, zoneColor.b) - end; + end counter = counter + 1 - end; + end MOD:ShowTip() if not ap then GuildRoster() end -end; +end local GuildColorUpdate = function() local hexColor = SuperVillain:HexColor("highlight"); @@ -327,7 +303,7 @@ local GuildColorUpdate = function() if currentObject ~= nil then Guild_OnEvent(currentObject, 'SVUI_COLOR_UPDATE') end -end; -SuperVillain.Registry:SetCallback(GuildColorUpdate) +end +SuperVillain.Registry:NewCallback(GuildColorUpdate) MOD:Extend('Guild', StatEvents, Guild_OnEvent, nil, Guild_OnClick, Guild_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/hps.lua b/Interface/AddOns/SVUI/packages/stats/stats/hps.lua index 46ba6d0..1a47746 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/hps.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/hps.lua @@ -130,5 +130,5 @@ local HPSColorUpdate = function() end end -SuperVillain.Registry:SetCallback(HPSColorUpdate) +SuperVillain.Registry:NewCallback(HPSColorUpdate) MOD:Extend('HPS', StatEvents, HPS_OnEvent, nil, HPS_OnClick, HPS_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/time.lua b/Interface/AddOns/SVUI/packages/stats/stats/time.lua index 3bec845..ffde932 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/time.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/time.lua @@ -231,6 +231,6 @@ local ColorUpdate = function() end end; -SuperVillain.Registry:SetCallback(ColorUpdate) +SuperVillain.Registry:NewCallback(ColorUpdate) MOD:Extend('Time', {"UPDATE_INSTANCE_INFO"}, OnEvent, Update, Click, OnEnter, OnLeave) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/tip/SVTip.lua b/Interface/AddOns/SVUI/packages/tip/SVTip.lua index cf45924..86c1ebe 100644 --- a/Interface/AddOns/SVUI/packages/tip/SVTip.lua +++ b/Interface/AddOns/SVUI/packages/tip/SVTip.lua @@ -875,44 +875,44 @@ local function ApplyTooltipSkins() tooltip.SuperBorder = mask if tooltip.Background then - tooltip.Background:SetTexture(0,0,0,0) + tooltip.Background:SetTexture("") end if tooltip.Delimiter1 then - tooltip.Delimiter1:SetTexture(0,0,0,0) - tooltip.Delimiter2:SetTexture(0,0,0,0) + tooltip.Delimiter1:SetTexture("") + tooltip.Delimiter2:SetTexture("") end if tooltip.BorderTop then - tooltip.BorderTop:SetTexture(0,0,0,0) + tooltip.BorderTop:SetTexture("") end if tooltip.BorderTopLeft then - tooltip.BorderTopLeft:SetTexture(0,0,0,0) + tooltip.BorderTopLeft:SetTexture("") end if tooltip.BorderTopRight then - tooltip.BorderTopRight:SetTexture(0,0,0,0) + tooltip.BorderTopRight:SetTexture("") end if tooltip.BorderLeft then - tooltip.BorderLeft:SetTexture(0,0,0,0) + tooltip.BorderLeft:SetTexture("") end if tooltip.BorderRight then - tooltip.BorderRight:SetTexture(0,0,0,0) + tooltip.BorderRight:SetTexture("") end if tooltip.BorderBottom then - tooltip.BorderBottom:SetTexture(0,0,0,0) + tooltip.BorderBottom:SetTexture("") end if tooltip.BorderBottomRight then - tooltip.BorderBottomRight:SetTexture(0,0,0,0) + tooltip.BorderBottomRight:SetTexture("") end if tooltip.BorderBottomLeft then - tooltip.BorderBottomLeft:SetTexture(0,0,0,0) + tooltip.BorderBottomLeft:SetTexture("") end tooltip:SetBackdrop({ diff --git a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua index 626e670..bcf0679 100644 --- a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua +++ b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua @@ -556,7 +556,9 @@ function MOD:RefreshUnitLayout(frame, template) if(GRID_MODE) then if(self.db.grid.shownames and self.db.grid.size >= 30) then if(not nametext:IsShown()) then nametext:Show() end - nametext:Point("CENTER", frame, "CENTER", 1, 0) + nametext:Point("CENTER", frame, "CENTER", 0, 0) + nametext:SetJustifyH("CENTER") + nametext:SetJustifyV("MIDDLE") frame:Tag(nametext, "[name:grid]") else nametext:Hide() @@ -567,6 +569,23 @@ function MOD:RefreshUnitLayout(frame, template) cY = db.name.yOffset nametext:ClearAllPoints() SuperVillain:ReversePoint(nametext, point, infoPanel, cX, cY) + + if(nametext.initialAnchor:find("RIGHT")) then + nametext:SetJustifyH("RIGHT") + elseif(nametext.initialAnchor:find("LEFT")) then + nametext:SetJustifyH("LEFT") + else + nametext:SetJustifyH("CENTER") + end + + if(nametext.initialAnchor:find("TOP")) then + nametext:SetJustifyV("TOP") + elseif(nametext.initialAnchor:find("BOTTOM")) then + nametext:SetJustifyV("BOTTOM") + else + nametext:SetJustifyV("MIDDLE") + end + frame:Tag(nametext, db.name.tags) end end diff --git a/Interface/AddOns/SVUI/packages/unit/elements/auras.lua b/Interface/AddOns/SVUI/packages/unit/elements/auras.lua index 32a36fe..9e1baec 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/auras.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/auras.lua @@ -108,8 +108,8 @@ local PostCreateAuraIcon = function(self, aura) aura.cd.noOCC = true; aura.cd.noCooldownCount = true; aura.cd:SetReverse() - aura.overlay:SetTexture(0,0,0,0) - aura.stealable:SetTexture(0,0,0,0) + aura.overlay:SetTexture("") + aura.stealable:SetTexture("") if aura.styled then return end if aura.SetNormalTexture then aura:SetNormalTexture("") end diff --git a/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua b/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua index 426dbbc..d1fac21 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua @@ -311,8 +311,12 @@ local function CreateNameText(frame, unitName) name:SetShadowColor(0, 0, 0, 1) if unitNmae == "target" then name:SetPoint("RIGHT", frame) + name:SetJustifyH("RIGHT") + name:SetJustifyV("MIDDLE") else name:SetPoint("CENTER", frame) + name:SetJustifyH("CENTER") + name:SetJustifyV("MIDDLE") end return name; end diff --git a/Interface/AddOns/SVUI/packages/unit/elements/tags.lua b/Interface/AddOns/SVUI/packages/unit/elements/tags.lua index c957aad..ff13651 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/tags.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/tags.lua @@ -88,7 +88,7 @@ local function SetTagStyle(style, min, max) result = format("%s%%", format("%.1f", min / max * 100)) result = result:gsub(".0%%", "%%") return result - elseif style == "CURRENT" or (style == "CURRENT_MAX" or style == "CURRENT_MAX_PERCENT" or style == "CURRENT_PERCENT") and min == max then + elseif style == "CURRENT" or ((style == "CURRENT_MAX" or style == "CURRENT_MAX_PERCENT" or style == "CURRENT_PERCENT") and min == max) then return format("%s", TruncateString(min)) elseif style == "CURRENT_MAX" then return format("%s - %s", TruncateString(min), TruncateString(max)) @@ -97,7 +97,7 @@ local function SetTagStyle(style, min, max) result = result:gsub(".0%%", "%%") return result elseif style == "CURRENT_MAX_PERCENT" then - result = format("%s - %s | %s%%", TruncateString(min), TruncateString(max), format("%.1f", min / max * 100)) + result = format("%s - %s - %s%%", TruncateString(min), TruncateString(max), format("%.1f", min / max * 100)) result = result:gsub(".0%%", "%%") return result end @@ -215,6 +215,7 @@ oUF_SuperVillain.Tags.Events["health:deficit"] = "UNIT_HEALTH_FREQUENT UNIT_MAXH oUF_SuperVillain.Tags.Events["health:current"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"; oUF_SuperVillain.Tags.Events["health:curmax"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"; oUF_SuperVillain.Tags.Events["health:curpercent"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"; +oUF_SuperVillain.Tags.Events["health:curmax-percent"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"; oUF_SuperVillain.Tags.Events["health:percent"] = "UNIT_HEALTH_FREQUENT UNIT_MAXHEALTH UNIT_CONNECTION PLAYER_FLAGS_CHANGED"; oUF_SuperVillain.Tags.Events["power:color"] = "UNIT_POWER_FREQUENT UNIT_MAXPOWER"; @@ -335,6 +336,8 @@ oUF_SuperVillain.Tags.Methods["health:curmax"] = function(f)local i = UnitIsDead oUF_SuperVillain.Tags.Methods["health:curpercent"] = function(f)local i = UnitIsDead(f)and DEAD or UnitIsGhost(f)and L["Ghost"]or not UnitIsConnected(f)and L["Offline"]if i then return i else return SetTagStyle("CURRENT_PERCENT", UnitHealth(f), UnitHealthMax(f))end end +oUF_SuperVillain.Tags.Methods["health:curmax-percent"] = function(f)local i = UnitIsDead(f)and DEAD or UnitIsGhost(f)and L["Ghost"]or not UnitIsConnected(f)and L["Offline"]if i then return i else return SetTagStyle("CURRENT_MAX_PERCENT", UnitHealth(f), UnitHealthMax(f))end end + oUF_SuperVillain.Tags.Methods["health:percent"] = function(f)local i = UnitIsDead(f)and DEAD or UnitIsGhost(f)and L["Ghost"]or not UnitIsConnected(f)and L["Offline"]if i then return i else return SetTagStyle("PERCENT", UnitHealth(f), UnitHealthMax(f))end end oUF_SuperVillain.Tags.Methods["health:deficit"] = function(f)local i = UnitIsDead(f)and DEAD or UnitIsGhost(f)and L["Ghost"]or not UnitIsConnected(f)and L["Offline"]if i then return i else return SetTagStyle("DEFICIT", UnitHealth(f), UnitHealthMax(f))end end diff --git a/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua b/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua index 15540ad..ba9d9d2 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua @@ -118,23 +118,23 @@ CUSTOM HANDLERS local UpdateTextures = function(bar, spec, max) if max == 0 then max = 4 end if spec == SPEC_WARLOCK_DEMONOLOGY then - bar[1].overlay:SetTexture(0,0,0,0) - bar[1].underlay:SetTexture(0,0,0,0) + bar[1].overlay:SetTexture("") + bar[1].underlay:SetTexture("") SuperVillain.Animate:StopFlash(bar[1].overlay) bar[1].underlay.anim:Finish() - bar[2].overlay:SetTexture(0,0,0,0) - bar[2].underlay:SetTexture(0,0,0,0) + bar[2].overlay:SetTexture("") + bar[2].underlay:SetTexture("") SuperVillain.Animate:StopFlash(bar[2].overlay) bar[2].underlay.anim:Finish() - bar[3].overlay:SetTexture(0,0,0,0) - bar[3].underlay:SetTexture(0,0,0,0) + bar[3].overlay:SetTexture("") + bar[3].underlay:SetTexture("") SuperVillain.Animate:StopFlash(bar[3].overlay) bar[3].underlay.anim:Finish() - bar[4].overlay:SetTexture(0,0,0,0) - bar[4].underlay:SetTexture(0,0,0,0) + bar[4].overlay:SetTexture("") + bar[4].underlay:SetTexture("") SuperVillain.Animate:StopFlash(bar[4].overlay) bar[4].underlay.anim:Finish() bar.CurrentSpec = spec diff --git a/Interface/AddOns/SVUI/scripts/misc.lua b/Interface/AddOns/SVUI/scripts/misc.lua index 1b60ba9..9628ecd 100644 --- a/Interface/AddOns/SVUI/scripts/misc.lua +++ b/Interface/AddOns/SVUI/scripts/misc.lua @@ -82,7 +82,7 @@ local function LoadStyledChatBubbles() region:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Chat\CHATBUBBLE-TAIL]]) needsUpdate = false else - region:SetTexture(0,0,0,0) + region:SetTexture("") end elseif(region:GetObjectType() == "FontString" and not frame.text) then frame.text = region diff --git a/Interface/AddOns/SVUI/scripts/raid.lua b/Interface/AddOns/SVUI/scripts/raid.lua index afd86e4..27e387c 100644 --- a/Interface/AddOns/SVUI/scripts/raid.lua +++ b/Interface/AddOns/SVUI/scripts/raid.lua @@ -236,6 +236,7 @@ local function LoadRaidUtility() CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateRolePoll:SetPoint("BOTTOMRIGHT", CompactRaidFrameManagerDisplayFrameLeaderOptionsInitiateReadyCheck, "TOPRIGHT", 0, 1) do + --[[NEEDS TESTING]]-- local buttons = { "CompactRaidFrameManagerDisplayFrameLeaderOptionsRaidWorldMarkerButton", "DisbandRaidButton", @@ -246,15 +247,14 @@ local function LoadRaidUtility() "RaidUtility_CloseButton" } - for i, button in pairs(buttons) do - local f = _G[button] - _G[button.."Left"]:SetAlpha(0) - _G[button.."Middle"]:SetAlpha(0) - _G[button.."Right"]:SetAlpha(0) - f:Formula409() - f:SetFramedButtonTemplate() - f:HookScript("OnEnter", ButtonEnter) - f:HookScript("OnLeave", ButtonLeave) + for i, gName in pairs(buttons) do + local button = _G[gName] + if(button) then + button:Formula409() + button:SetFramedButtonTemplate() + button:HookScript("OnEnter", ButtonEnter) + button:HookScript("OnLeave", ButtonLeave) + end end end end diff --git a/Interface/AddOns/SVUI/scripts/spellbind.lua b/Interface/AddOns/SVUI/scripts/spellbind.lua index 01f269b..5343c4e 100644 --- a/Interface/AddOns/SVUI/scripts/spellbind.lua +++ b/Interface/AddOns/SVUI/scripts/spellbind.lua @@ -204,7 +204,7 @@ local function binder_BuildSpells(self, delete) i = 1 while _G[i.."_cbs"] do _G[i.."_fs"]:SetText("") - _G[i.."_texture"]:SetTexture(0,0,0,0) + _G[i.."_texture"]:SetTexture("") _G[i.."_cbs"].checked = false _G[i.."_cbs"]:ClearAllPoints() _G[i.."_cbs"]:Hide() diff --git a/Interface/AddOns/SVUI/system/cartography.lua b/Interface/AddOns/SVUI/system/cartography.lua index 49f0573..631f8d4 100644 --- a/Interface/AddOns/SVUI/system/cartography.lua +++ b/Interface/AddOns/SVUI/system/cartography.lua @@ -153,13 +153,15 @@ do for C in pairs(continents) do local zones = { GetMapZones(C) }; continents[C] = zones; - SetMapZoom(C, 0); - zones[0] = GetCurrentMapAreaID(); - _getmapdata(_cache); - for Z in ipairs(zones) do - SetMapZoom(C, Z); - zones[Z] = GetCurrentMapAreaID(); + local pass, error = pcall(SetMapZoom, C, 0) + if(pass) then + zones[0] = GetCurrentMapAreaID(); _getmapdata(_cache); + for Z in ipairs(zones) do + SetMapZoom(C, Z); + zones[Z] = GetCurrentMapAreaID(); + _getmapdata(_cache); + end end end diff --git a/Interface/AddOns/SVUI/system/common.lua b/Interface/AddOns/SVUI/system/common.lua index 8ae228c..61f7e2d 100644 --- a/Interface/AddOns/SVUI/system/common.lua +++ b/Interface/AddOns/SVUI/system/common.lua @@ -261,11 +261,11 @@ local function Formula409(self, option) end target:Hide() elseif(target:GetDrawLayer() == option) then - target:SetTexture(0,0,0,0) + target:SetTexture("") elseif(option and (type(option) == "string") and (target:GetTexture() ~= option)) then - target:SetTexture(0,0,0,0) + target:SetTexture("") else - target:SetTexture(0,0,0,0) + target:SetTexture("") end end end @@ -322,7 +322,7 @@ function SuperVillain:UpdateFontTemplates() FontTemplateUpdates() end -SuperVillain.Registry:SetCallback(FontTemplateUpdates) +SuperVillain.Registry:NewCallback(FontTemplateUpdates) --[[ ########################################################## APPENDED TEMPLATING METHODS @@ -752,9 +752,10 @@ local function CreatePanelTemplate(frame, templateName, underlay, noupdate, padd frame._color = colorName; frame._gradient = gradientName; frame._texture = false; - frame._noupdate = bypass; + frame._noupdate = bypass; - local panel = NewFrame('Frame', nil, frame) + local panel; + if(not frame.Panel) then panel = NewFrame('Frame', nil, frame) else panel = frame.Panel end panel:Point('TOPLEFT', frame, 'TOPLEFT', (xOffset * -1), yOffset) panel:Point('BOTTOMRIGHT', frame, 'BOTTOMRIGHT', xOffset, (yOffset * -1)) @@ -906,11 +907,14 @@ local function CreatePanelTemplate(frame, templateName, underlay, noupdate, padd bottomLeft:SetPoint("TOPLEFT", frame.Panel, "LEFT", 0, 0) bottomLeft:SetVertexColor(0.1, 0.1, 0.1, 0.5) bottomLeft:SetNonBlocking(true) - end + end local level = frame:GetFrameLevel() - frame:SetFrameLevel(level + 1) + if(level > 0) then level = level - 1 end frame.Panel:SetFrameLevel(level) + if(level == 0 and not InCombatLockdown()) then + frame:SetFrameLevel(1) + end end local function HasCooldown(n) @@ -989,8 +993,68 @@ end TEMPLATE API ########################################################## ]]-- +local function SetBasicPanel(self, topX, topY, bottomX, bottomY, hasShadow) + if(not self or (self and self.Panel)) then return end + + local frame = self + + local currentLevel = self:GetFrameLevel() + if(currentLevel == 0) then + currentLevel = 1 + end + + if(not self.Panel) then self.Panel = CreateFrame("Frame", nil, frame) end + + if(hasShadow) then + self.Panel:SetPoint("TOPLEFT", frame, "TOPLEFT", -2, 2) + self.Panel:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", 2, -2) + self.Panel:SetFrameLevel(currentLevel - 1) + + self.Panel:SetBackdrop({ + bgFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], + edgeSize = 3, + insets = + { + left = 0, + right = 0, + top = 0, + bottom = 0, + }, + }) + self.Panel:SetBackdropColor(0,0,0,0) + self.Panel:SetBackdropBorderColor(0,0,0) + else + self.Panel:SetPoint("TOPLEFT", frame, "TOPLEFT", topX, topY) + self.Panel:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", bottomX, bottomY) + self.Panel:SetFrameLevel(currentLevel - 1) + + self.Panel:SetBackdrop({ + bgFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + edgeSize = 1, + insets = + { + left = 1, + right = 1, + top = 1, + bottom = 1, + }, + }) + self.Panel:SetBackdropColor(0,0,0,0.65) + self.Panel:SetBackdropBorderColor(0,0,0) + end + + NewHook(frame, "SetBackdrop", HookBackdrop) + NewHook(frame, "SetBackdropColor", HookBackdropColor) + NewHook(frame, "SetBackdropBorderColor", HookBackdropBorderColor) +end + local function SetPanelTemplate(self, templateName, noupdate, overridePadding, xOffset, yOffset) - if(self.Panel) then return; end if(not templateName or not _templates[templateName]) then templateName = 'Default' end local padding = false @@ -1006,8 +1070,7 @@ local function SetPanelTemplate(self, templateName, noupdate, overridePadding, x end local function SetFixedPanelTemplate(self, templateName, noupdate, overridePadding, xOffset, yOffset) - if(self.Panel) then return; end - if(not templateName or not _templates[templateName]) then templateName = 'Default' end + if(not templateName or not _templates[templateName]) then templateName = 'Default' end local padding = false if(overridePadding and type(overridePadding) == "number") then @@ -1130,7 +1193,7 @@ local function SetSlotTemplate(self, underlay, padding, x, y, noChecked) if self.styled then return end padding = padding or 1 CreatePanelTemplate(self, "Slot", underlay, true, padding, x, y) - CreateButtonPanel(self, noChecked) + --CreateButtonPanel(self, noChecked) self.styled = true end @@ -1167,7 +1230,7 @@ local function SetEditboxTemplate(self, x, y) if self.RightTex then MUNG(self.RightTex) end if self.MiddleTex then MUNG(self.MiddleTex) end - CreatePanelTemplate(self, "Inset", true, true, 1, x, y) + CreatePanelTemplate(self, "Inset", false, true, 1, x, y) local globalName = self:GetName(); if globalName then @@ -1298,7 +1361,7 @@ local function FrameTemplateUpdates() end end end -SuperVillain.Registry:SetCallback(FrameTemplateUpdates) +SuperVillain.Registry:NewCallback(FrameTemplateUpdates) --[[ ########################################################## ENUMERATION @@ -1314,6 +1377,7 @@ local function AppendMethods(OBJECT) if not OBJECT.FillInner then META.FillInner = FillInner end if not OBJECT.MUNG then META.MUNG = MUNG end if not OBJECT.Formula409 then META.Formula409 = Formula409 end + if not OBJECT.SetBasicPanel then META.SetBasicPanel = SetBasicPanel end if not OBJECT.SetPanelTemplate then META.SetPanelTemplate = SetPanelTemplate end if not OBJECT.SetFixedPanelTemplate then META.SetFixedPanelTemplate = SetFixedPanelTemplate end if not OBJECT.SetPanelColor then META.SetPanelColor = SetPanelColor end diff --git a/Interface/AddOns/SVUI/system/installer.lua b/Interface/AddOns/SVUI/system/installer.lua index 8dc4494..6ca8edd 100644 --- a/Interface/AddOns/SVUI/system/installer.lua +++ b/Interface/AddOns/SVUI/system/installer.lua @@ -62,7 +62,6 @@ end local function forceCVars() SetCVar("alternateResourceText",1) SetCVar("statusTextDisplay","BOTH") - SetCVar("mapQuestDifficulty",1) SetCVar("ShowClassColorInNameplate",1) SetCVar("screenshotQuality",10) SetCVar("chatMouseScroll",1) diff --git a/Interface/AddOns/SVUI/system/mentalo.lua b/Interface/AddOns/SVUI/system/mentalo.lua index 9a5e00e..e5c4575 100644 --- a/Interface/AddOns/SVUI/system/mentalo.lua +++ b/Interface/AddOns/SVUI/system/mentalo.lua @@ -236,6 +236,18 @@ theHand:SetFrameLevel(99) theHand:SetClampedToScreen(true) theHand:SetSize(128,128) theHand:SetPoint("CENTER") +theHand.bg = theHand:CreateTexture(nil, "OVERLAY") +theHand.bg:SetAllPoints(theHand) +theHand.bg:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-HAND-OFF]]) +theHand.energy = theHand:CreateTexture(nil, "OVERLAY") +theHand.energy:SetAllPoints(theHand) +theHand.energy:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-ENERGY]]) +SuperVillain.Animate:Orbit(theHand.energy, 10) +theHand.flash = theHand.energy.anim; +theHand.energy:Hide() +theHand.elapsedTime = 0; +theHand.flash:Stop() +theHand:Hide() --[[ ########################################################## LOCAL FUNCTIONS @@ -689,19 +701,6 @@ function SuperVillain:SetSVMovablesPositions() end function SuperVillain:LoadMovables() - theHand.bg = theHand:CreateTexture(nil, "OVERLAY") - theHand.bg:SetAllPoints(theHand) - theHand.bg:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-HAND-OFF]]) - theHand.energy = theHand:CreateTexture(nil, "OVERLAY") - theHand.energy:SetAllPoints(theHand) - theHand.energy:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Doodads\MENTALO-ENERGY]]) - self.Animate:Orbit(theHand.energy, 10) - theHand.flash = theHand.energy.anim; - theHand.energy:Hide() - theHand.elapsedTime = 0; - theHand.flash:Stop() - theHand:Hide() - for name, _ in pairs(self.MentaloFrames)do local parent, text, overlay, snapoffset, postdrag; for key, value in pairs(self.MentaloFrames[name])do diff --git a/Interface/AddOns/SVUI/system/system.lua b/Interface/AddOns/SVUI/system/system.lua index 2105d91..c6599f1 100644 --- a/Interface/AddOns/SVUI/system/system.lua +++ b/Interface/AddOns/SVUI/system/system.lua @@ -69,41 +69,52 @@ DISPEL MECHANICS ########################################################## ]]-- local droodSpell1, droodSpell2 = GetSpellInfo(110309), GetSpellInfo(4987); -local RefClassRoles; +local RefClassRoles, RefUnitRoles; local RefMagicSpec; -- canBeTank, canBeHealer, canBeDPS = UnitGetAvailableRoles("unit") do if(toonClass == "PRIEST") then RefClassRoles = {"C", "C", "C"} + RefUnitRoles = {"HEALER", "HEALER", "DAMAGER"} SuperVillain.Dispellable = {["Magic"] = true, ["Disease"] = true} elseif(toonClass == "WARLOCK") then RefClassRoles = {"C", "C", "C"} + RefUnitRoles = {"DAMAGER", "DAMAGER", "DAMAGER"} elseif(toonClass == "WARRIOR") then RefClassRoles = {"M", "M", "T"} + RefUnitRoles = {"DAMAGER", "DAMAGER", "TANK"} elseif(toonClass == "HUNTER") then RefClassRoles = {"M", "M", "M"} + RefUnitRoles = {"DAMAGER", "DAMAGER", "DAMAGER"} elseif(toonClass == "ROGUE") then RefClassRoles = {"M", "M", "M"} + RefUnitRoles = {"DAMAGER", "DAMAGER", "DAMAGER"} elseif(toonClass == "MAGE") then RefClassRoles = {"C", "C", "C"} + RefUnitRoles = {"DAMAGER", "DAMAGER", "DAMAGER"} SuperVillain.Dispellable = {["Curse"] = true} elseif(toonClass == "DEATHKNIGHT") then RefClassRoles = {"T", "M", "M"} + RefUnitRoles = {"TANK", "DAMAGER", "DAMAGER"} elseif(toonClass == "DRUID") then RefMagicSpec = 4 RefClassRoles = {"C", "M", "T", "C"} + RefUnitRoles = {"DAMAGER", "DAMAGER", "TANK", "HEALER"} SuperVillain.Dispellable = {["Curse"] = true, ["Poison"] = true} elseif(toonClass == "SHAMAN") then RefMagicSpec = 3 RefClassRoles = {"C", "M", "C"} + RefUnitRoles = {"DAMAGER", "DAMAGER", "HEALER"} SuperVillain.Dispellable = {["Curse"] = true} elseif(toonClass == "MONK") then RefMagicSpec = 2 RefClassRoles = {"T", "C", "M"} + RefUnitRoles = {"TANK", "HEALER", "DAMAGER"} SuperVillain.Dispellable = {["Disease"] = true, ["Poison"] = true} elseif(toonClass == "PALADIN") then RefMagicSpec = 1 RefClassRoles = {"C", "T", "M"} + RefUnitRoles = {"HEALER", "TANK", "DAMAGER"} SuperVillain.Dispellable = {["Poison"] = true, ["Disease"] = true} end end @@ -118,10 +129,11 @@ end function SuperVillain:DefinePlayerRole() local spec = GetSpecialization() - local role; + local role, unitRole; if spec then if(self.CurrentSpec == spec) then return end role = RefClassRoles[spec] + unitRole = RefUnitRoles[spec] if role == "T" and UnitLevel("player") == MAX_PLAYER_LEVEL then local bonus, pvp = GetCombatRatingBonus(COMBAT_RATING_RESILIENCE_PLAYER_DAMAGE_TAKEN), false; if bonus > GetDodgeChance() and bonus > GetParryChance() then @@ -129,6 +141,7 @@ function SuperVillain:DefinePlayerRole() end end self.CurrentSpec = spec + self.RoleIsSet = true else local intellect = select(2, UnitStat("player", 4)) local agility = select(2, UnitStat("player", 2)) @@ -139,11 +152,16 @@ function SuperVillain:DefinePlayerRole() else role = "C" end - end - if self.ClassRole ~= role and self.RoleChangedCallback then + end + if self.UnitRole ~= unitRole then + self.UnitRole = unitRole + end + if self.ClassRole ~= role then self.ClassRole = role; - self.RoleChangedCallback() - end + if self.RoleChangedCallback then + self.RoleChangedCallback() + end + end if RefMagicSpec then if(GetTalentInfo(RefMagicSpec)) then self.Dispellable["Magic"] = true @@ -151,7 +169,6 @@ function SuperVillain:DefinePlayerRole() self.Dispellable["Magic"] = nil end end - self.RoleIsSet = true end --[[ ########################################################## @@ -198,7 +215,7 @@ function SuperVillain:ToggleConfig() local _,_,_,_,_,state = GetAddOnInfo("SVUI_ConfigOMatic") if state ~= "MISSING" and state ~= "DISABLED" then LoadAddOn("SVUI_ConfigOMatic") - local config_version = GetAddOnMetadata("SVUI_ConfigOMatic","Version") + local config_version = GetAddOnMetadata("SVUI_ConfigOMatic", "Version") if(tonumber(config_version) < 4) then self:StaticPopup_Show("CLIENT_UPDATE_REQUEST") end diff --git a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua index 911f9fa..a2ae678 100644 --- a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua +++ b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua @@ -51,10 +51,9 @@ local SVUIAddOnName, PLUGIN = ...; local SuperVillain, L = unpack(SVUI); local CONFIGS = SuperVillain.Configs local NewHook = hooksecurefunc; -local SVUIAddonEventHandler = CreateFrame("Frame", nil) -local version = GetAddOnMetadata(..., "Version"); -PLUGIN = SuperVillain:Prototype(SVUIAddOnName, version) +PLUGIN = SuperVillain:Prototype(SVUIAddOnName) +local SCHEMA = PLUGIN.___schema; _G["WhisperVillain"] = PLUGIN; --[[ @@ -65,17 +64,12 @@ LOCAL VARS local playerName = UnitName("player"); local playerRealm = GetRealmName(); -local LeftToolBarButton = CreateFrame("Button", nil, UIParent) local ConjugationKeys = {[1]={[1]="are",[2]="am",[3]="were",[4]="was",[5]="I",[6]="me",[7]="you",[8]="my",[9]="your",[10]="mine",[11]="your's",[12]="I'm",[13]="you're",[14]="I've",[15]="you've",[16]="I'll",[17]="you'll",[18]="myself",[19]="yourself"},[2]={[1]="am",[2]="are",[3]="was",[4]="were",[5]="you",[6]="you",[7]="me",[8]="your",[9]="my",[10]="your's",[11]="mine",[12]="you're",[13]="I'm",[14]="you've",[15]="I've",[16]="you'll",[17]="I'll",[18]="yourself",[19]="myself"},[3]={[1]="me am",[2]="am me",[3]="mecan",[4]="can me",[5]="me have",[6]="me will",[7]="will me"},[4]={[1]="I am",[2]="am I",[3]="I can",[4]="can I",[5]="I have",[6]="I will",[7]="will I"}}; local punctuations = {[1]={pattern="%.",value="."},[2]={pattern=",",value=","},[3]={pattern="!",value="!"},[4]={pattern="%?",value="?"},[5]={pattern=":",value=":"},[6]={pattern=";",value=";"},[7]={pattern="&",value="&"},[8]={pattern="\"",value="\""},[9]={pattern="@",value="@"},[10]={pattern="#",value="#"},[11]={pattern="%(",value="("},[12]={pattern="%)",value=")"}}; -local AnsweringService = CreateFrame("Frame"); -local PhoneTimeHandler = CreateFrame("Frame") - local PhoneLines = {}; local ResponseQueue = {}; -local Events = {}; -local ElapsedUpdate = 0; + local ICON_FILE = [[Interface\AddOns\SVUI_AnsweringService\artwork\DOCK-CALL]] --[[ ########################################################## @@ -437,47 +431,10 @@ LOCAL FUNCTIONS ########################################################## ]]-- local function ServiceMessage(msg) - local msgFrom = SuperVillain.db.SVAnswer.prefix == true and "Minion Answering Service" or ""; + local msgFrom = SuperVillain.db[SCHEMA].prefix == true and "Minion Answering Service" or ""; print("|cffffcc1a" .. msgFrom .. ":|r", msg) end -local function AddCaller(caller) - local state_text = "now on hold."; - local call_answered = false - PhoneLines[caller] = { - Line = 1, - InUse = false, - FirstResponse = true, - Caller = caller, - InBound = "", - OutBound = "", - LastKey = 1, - TimeStamp = 0 - }; - for x = 1, 5, 1 do - local btn = _G["HenchmenPhoneLine"..x]; - if(btn.Text:GetText() ~= caller) then - btn.Text:SetText(caller); - PhoneLines[caller].Line = x - call_answered = true - if SuperVillain.db.SVAnswer.autoAnswer == true then - PhoneLines[caller].InUse = true; - btn:SetPanelColor("green"); - LeftToolBarButton:SetPanelColor("green"); - LeftToolBarButton.stateColor = SuperVillain.Media.gradient.green - state_text = "on the line."; - PlaySoundFile("Sound\\interface\\iQuestUpdate.wav") - end - break; - end - end - if(not call_answered) then - ServiceMessage("All lines are busy. New caller ("..caller..") was disconnected.") - else - ServiceMessage("New caller ("..caller..") is "..state_text) - end -end - local function ClearResponses(caller) for x = 1, #ResponseQueue, 1 do if ResponseQueue[x] then @@ -500,55 +457,6 @@ local function RemoveCaller(caller) ServiceMessage("Caller ("..caller..") was disconnected."); end end - -local function GetServiceState() - local inUse = false - local onHold = false - for x = 1, 5, 1 do - local btn = _G["HenchmenPhoneLine"..x]; - local caller = btn.Text:GetText() - if(PhoneLines[caller]) then - inUse = true - if(not PhoneLines[caller].InUse) then - onHold = true - end - end - end - - if inUse then - if onHold then - LeftToolBarButton:SetPanelColor("yellow") - LeftToolBarButton.icon:SetGradient(unpack(SuperVillain.Media.gradient.yellow)) - LeftToolBarButton.stateColor = SuperVillain.Media.gradient.yellow - else - LeftToolBarButton:SetPanelColor("green") - LeftToolBarButton.icon:SetGradient(unpack(SuperVillain.Media.gradient.green)) - LeftToolBarButton.stateColor = SuperVillain.Media.gradient.green - end - else - LeftToolBarButton:SetPanelColor("default") - LeftToolBarButton.stateColor = SuperVillain.Media.gradient.default - end - return inUse,onHold -end - -local function HangUp(caller,ignored) - RemoveCaller(caller) - local inUse,onHold = GetServiceState() - - if inUse == false then - _G["HenchmenOperator"]:Hide() - elseif onHold == true then - _G["HenchmenOperator"]:Show() - else - _G["HenchmenOperator"]:Show() - end - - if(ignored) then - ServiceMessage(caller.." is now ignoring you! MwaaHaHa!") - PlaySoundFile("Sound\\interface\\RaidWarning.wav") - end -end --[[ ########################################################## MESSAGE PROCESSING @@ -790,39 +698,146 @@ do end end end + +function PLUGIN:AddCaller(caller) + local state_text = "now on hold."; + local call_answered = false + PhoneLines[caller] = { + Line = 1, + InUse = false, + FirstResponse = true, + Caller = caller, + InBound = "", + OutBound = "", + LastKey = 1, + TimeStamp = 0 + }; + for x = 1, 5, 1 do + local btn = _G["HenchmenPhoneLine"..x]; + if(btn.Text:GetText() ~= caller) then + btn.Text:SetText(caller); + PhoneLines[caller].Line = x + call_answered = true + if self.db.autoAnswer == true then + PhoneLines[caller].InUse = true; + btn:SetPanelColor("green"); + self.Docklet:SetPanelColor("green"); + self.Docklet.stateColor = SuperVillain.Media.gradient.green + state_text = "on the line."; + PlaySoundFile("Sound\\interface\\iQuestUpdate.wav") + end + break; + end + end + if(not call_answered) then + ServiceMessage("All lines are busy. New caller ("..caller..") was disconnected.") + else + ServiceMessage("New caller ("..caller..") is "..state_text) + end +end + +function PLUGIN:GetServiceState() + local inUse = false + local onHold = false + for x = 1, 5, 1 do + local btn = _G["HenchmenPhoneLine"..x]; + local caller = btn.Text:GetText() + if(PhoneLines[caller]) then + inUse = true + if(not PhoneLines[caller].InUse) then + onHold = true + end + end + end + + if inUse then + if onHold then + self.Docklet:SetPanelColor("yellow") + self.Docklet.icon:SetGradient(unpack(SuperVillain.Media.gradient.yellow)) + self.Docklet.stateColor = SuperVillain.Media.gradient.yellow + else + self.Docklet:SetPanelColor("green") + self.Docklet.icon:SetGradient(unpack(SuperVillain.Media.gradient.green)) + self.Docklet.stateColor = SuperVillain.Media.gradient.green + end + else + self.Docklet:SetPanelColor("default") + self.Docklet.stateColor = SuperVillain.Media.gradient.default + end + return inUse,onHold +end + +function PLUGIN:HangUp(caller,ignored) + RemoveCaller(caller) + local inUse,onHold = self:GetServiceState() + + if inUse == false then + self.Window:Hide() + elseif onHold == true then + self.Window:Show() + else + self.Window:Show() + end + + if(ignored) then + ServiceMessage(caller.." is now ignoring you! MwaaHaHa!") + PlaySoundFile("Sound\\interface\\RaidWarning.wav") + end +end --[[ ########################################################## EVENTS ########################################################## ]]-- -local function AnsweringServiceEventHandler(self, event, ...) - local handler = Events[event] - if handler then handler(...) end +function PLUGIN:PhoneTimeUpdate() + local timer = 300; + local ttime = GetTime() + if #ResponseQueue > 0 then + for x = 1, #ResponseQueue, 1 do + if ResponseQueue[x] then + if ResponseQueue[x].ETA < ttime then + SendChatMessage(ResponseQueue[x].MSG, "WHISPER", nil, ResponseQueue[x].CID) + tremove(ResponseQueue, x) + end + end + end + end + if ttime > timer then + for x = 1, 5, 1 do + local btn = _G["HenchmenPhoneLine"..x]; + local caller = btn.Text:GetText() + if(PhoneLines[caller]) then + if PhoneLines[caller].TimeStamp < (ttime - timer) then + self:HangUp(caller) + end + end + end + end end -function Events.CHAT_MSG_IGNORED(inbound_message, caller, ...) +function PLUGIN:CHAT_MSG_IGNORED(inbound_message, caller, ...) if(PhoneLines[caller] and PhoneLines[caller].InUse) then - HangUp(caller,true) + self:HangUp(caller,true) end end -function Events.CHAT_MSG_WHISPER(inbound_message, caller) +function PLUGIN:CHAT_MSG_WHISPER(inbound_message, caller) if not UnitIsAFK("player") and not UnitIsDND("player") then if (not PhoneLines[caller]) then - AddCaller(caller) + self:AddCaller(caller) end - PLUGIN:TakeAMessage(caller, inbound_message) + self:TakeAMessage(caller, inbound_message) end end -function Events.CHAT_MSG_BN_WHISPER(inbound_message, sender, _, _, _, _, _, _, _, _, _, _, presenceID) +function PLUGIN:CHAT_MSG_BN_WHISPER(inbound_message, sender, _, _, _, _, _, _, _, _, _, _, presenceID) if not UnitIsAFK("player") and not UnitIsDND("player") then local _, bnToon = BNGetToonInfo(presenceID); local caller = bnToon or sender; if (not PhoneLines[caller]) then - AddCaller(caller) + self:AddCaller(caller) end - PLUGIN:TakeAMessage(caller, inbound_message) + self:TakeAMessage(caller, inbound_message) end end --[[ @@ -830,6 +845,15 @@ end OTHER HANDLERS ########################################################## ]]-- +local AnsweringOnClick = function() + if(not PLUGIN.Window) then return end + if(PLUGIN.Window:IsShown()) then + PLUGIN.Window:Hide() + else + PLUGIN.Window:Show() + end +end + local PhoneLineClick = function(self, button) local caller = self.Text:GetText() if((caller == "Empty Phone Line") or not PhoneLines[caller]) then return; end @@ -845,39 +869,9 @@ local PhoneLineClick = function(self, button) ServiceMessage(caller.." is now on hold") end elseif button == "RightButton" then - HangUp(caller) - end - GetServiceState() -end - -local PhoneTimeUpdate = function(self, elapsed) - ElapsedUpdate = ElapsedUpdate + elapsed - if ElapsedUpdate > 4 then - local timer = 300; - local ttime = GetTime() - ElapsedUpdate = 0 - if #ResponseQueue > 0 then - for x = 1, #ResponseQueue, 1 do - if ResponseQueue[x] then - if ResponseQueue[x].ETA < ttime then - SendChatMessage(ResponseQueue[x].MSG, "WHISPER", nil, ResponseQueue[x].CID) - tremove(ResponseQueue, x) - end - end - end - end - if ttime > timer then - for x = 1, 5, 1 do - local btn = _G["HenchmenPhoneLine"..x]; - local caller = btn.Text:GetText() - if(PhoneLines[caller]) then - if PhoneLines[caller].TimeStamp < (ttime - timer) then - HangUp(caller) - end - end - end - end + PLUGIN:HangUp(caller) end + PLUGIN:GetServiceState() end --[[ ########################################################## @@ -885,7 +879,7 @@ LOAD AND CONSTRUCT ########################################################## ]]-- local function LoadOptions() - SuperVillain.Options.args.plugins.args.pluginOptions.args.SVAnswer = { + SuperVillain.Options.args.plugins.args.pluginOptions.args[SCHEMA] = { type = "group", name = L["Answering Service"], childGroups = "tree", @@ -894,88 +888,85 @@ local function LoadOptions() order = 1, type = "toggle", name = "Enable", - get = function(a)return SuperVillain.db.SVAnswer.enable end, - set = function(a,b)SuperVillain.db.SVAnswer.enable = b;SuperVillain:StaticPopup_Show("RL_CLIENT")end + get = function(a)return SuperVillain.db[SCHEMA].enable end, + set = function(a,b)SuperVillain.db[SCHEMA].enable = b;SuperVillain:StaticPopup_Show("RL_CLIENT")end }, autoAnswer = { order = 2, type = "toggle", name = "Auto Answer", - get = function(a)return SuperVillain.db.SVAnswer.autoAnswer end, - set = function(a,b)SuperVillain.db.SVAnswer.autoAnswer = b end + get = function(a)return SuperVillain.db[SCHEMA].autoAnswer end, + set = function(a,b) SuperVillain.db[SCHEMA].autoAnswer = b end }, prefix = { order = 3, type = "toggle", name = "Prefix Messages", - get = function(a)return SuperVillain.db.SVAnswer.prefix end, - set = function(a,b)SuperVillain.db.SVAnswer.prefix = b end + get = function(a)return SuperVillain.db[SCHEMA].prefix end, + set = function(a,b) SuperVillain.db[SCHEMA].prefix = b end }, } } end -local AnsweringOnClick = function() - if HenchmenOperator:IsShown() then - HenchmenOperator:Hide() - else - HenchmenOperator:Show() - end -end +function PLUGIN:Load() + if(not SuperVillain.db[SCHEMA].enable) then return end -local function LoadAnsweringService() - if(not SuperVillain.db.SVAnswer.enable) then return end - - PLUGIN.db = SuperVillain.db.SVAnswer + self.db = SuperVillain.db[SCHEMA] - AnsweringService:SetScript("OnEvent", AnsweringServiceEventHandler) - AnsweringService:RegisterEvent("CHAT_MSG_WHISPER") - AnsweringService:RegisterEvent("CHAT_MSG_BN_WHISPER") - AnsweringService:RegisterEvent("CHAT_MSG_IGNORED") - PhoneTimeHandler:SetScript("OnUpdate", PhoneTimeUpdate) + self:RegisterEvent("CHAT_MSG_WHISPER") + self:RegisterEvent("CHAT_MSG_BN_WHISPER") + self:RegisterEvent("CHAT_MSG_IGNORED") + self:RegisterUpdate("PhoneTimeUpdate", 4) local buttonsize = SuperDockToolBarLeft.currentSize - LeftToolBarButton:SetParent(SuperDockToolBarLeft) - LeftToolBarButton:Point("LEFT", SuperDockToolBarLeft, "LEFT", 3, 0) - LeftToolBarButton:Size(buttonsize, buttonsize) - LeftToolBarButton:SetFramedButtonTemplate() - LeftToolBarButton.icon = LeftToolBarButton:CreateTexture(nil, "OVERLAY") - LeftToolBarButton.icon:FillInner(LeftToolBarButton,2,2) - LeftToolBarButton.icon:SetTexture(ICON_FILE) - LeftToolBarButton.stateColor = SuperVillain.Media.gradient.special - LeftToolBarButton.TText = L["Show / Hide Phone Lines"] - LeftToolBarButton:RegisterForClicks("AnyUp") - SuperVillain.SVDock:ActivateDockletButton(LeftToolBarButton, AnsweringOnClick) + + local docklet = CreateFrame("Button", nil, SuperVillain.UIParent) + docklet:SetParent(SuperDockToolBarLeft) + docklet:Point("LEFT", SuperDockToolBarLeft, "LEFT", 3, 0) + docklet:Size(buttonsize, buttonsize) + docklet:SetFramedButtonTemplate() + docklet.icon = docklet:CreateTexture(nil, "OVERLAY") + docklet.icon:FillInner(docklet,2,2) + docklet.icon:SetTexture(ICON_FILE) + docklet.stateColor = SuperVillain.Media.gradient.special + docklet.TText = L["Show / Hide Phone Lines"] + docklet:RegisterForClicks("AnyUp") + + SuperVillain.SVDock:ActivateDockletButton(docklet, AnsweringOnClick) SuperDockToolBarLeft:SetWidth(buttonsize + 4) - local f = CreateFrame("Frame", "HenchmenOperator", UIParent) - f:SetFrameStrata("MEDIUM") - f:SetWidth(128) - f:SetHeight(145) - f:SetScript("OnDragStart", function(self) self:StartMoving() end) - f:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() end) - f:SetPoint("BOTTOMRIGHT",LeftSuperDock,"TOPRIGHT",0,6) - f:SetFixedPanelTemplate("Transparent") - f:SetMovable(true) - f:EnableMouse(true) - f:SetClampedToScreen(true) - f:RegisterForDrag("LeftButton") - - local title = f:CreateFontString("HenchmenOperatorText") + self.Docklet = docklet + + local window = CreateFrame("Frame", nil, SuperVillain.UIParent) + window:SetFrameStrata("MEDIUM") + window:SetWidth(128) + window:SetHeight(145) + window:SetScript("OnDragStart", function(this) this:StartMoving() end) + window:SetScript("OnDragStop", function(this) this:StopMovingOrSizing() end) + window:SetPoint("BOTTOMRIGHT", LeftSuperDock, "TOPRIGHT", 0, 6) + window:SetFixedPanelTemplate("Transparent") + window:SetMovable(true) + window:EnableMouse(true) + window:SetClampedToScreen(true) + window:RegisterForDrag("LeftButton") + + local title = window:CreateFontString("HenchmenOperatorText") title:SetWidth(128) title:SetHeight(50) title:SetFontObject(GameFontNormal) title:SetTextColor(0.5, 0.5, 1, 1) title:SetJustifyH("CENTER") title:SetJustifyV("TOP") - title:SetPoint("TOP", "HenchmenOperator", "TOP", 0, -2) + title:SetPoint("TOP", window, "TOP", 0, -2) title:SetText("Henchman Answering Service") + for x = 1, 5, 1 do - local phLn = CreateFrame("Button", "HenchmenPhoneLine"..x, f) + local phLn = CreateFrame("Button", "HenchmenPhoneLine"..x, window) phLn:SetWidth(124) phLn:SetHeight(20) - phLn:SetPoint("TOPLEFT", "HenchmenOperator", "TOPLEFT", 2, ((-16) - (x * 21))) + phLn:SetPoint("TOPLEFT", window, "TOPLEFT", 2, ((-16) - (x * 21))) phLn:RegisterForClicks("AnyUp") phLn:SetScript("OnClick", PhoneLineClick) phLn:SetFixedPanelTemplate("Button") @@ -990,21 +981,25 @@ local function LoadAnsweringService() phLn.Text:SetText("Empty Phone Line") end - HenchmenOperator:Hide() + self.Window = window + self.Window:Hide() + + local strMsg - if SuperVillain.db.SVAnswer.autoAnswer == true then + if SuperVillain.db[SCHEMA].autoAnswer == true then strMsg = "The Henchmen Operators Are Screening Your Calls.." else strMsg = "The Henchmen Operators Are Standing By.." end SuperVillain:AddonMessage(strMsg) + + LoadOptions() end -CONFIGS["SVAnswer"] = { +CONFIGS[SCHEMA] = { ["enable"] = false, ["autoAnswer"] = false, ["prefix"] = true } -SuperVillain.Registry:NewScript(LoadAnsweringService) -SuperVillain.Registry:NewPlugin(PLUGIN, "SVAnswer", LoadOptions) \ No newline at end of file +SuperVillain.Registry:NewPlugin(PLUGIN) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.toc b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.toc index 790babd..874927d 100644 --- a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.toc +++ b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.toc @@ -1,8 +1,10 @@ -## Interface: 50400 +## Interface: 60000 ## Author: Munglunch -## Version: 4.084 +## Version: 5.02 ## Title: |cffFF9900SVUI |r|cffFFEF00Answering Service|r -## Notes: Supervillain UI [|cff9911FFAutomatic Whispers|r]. +## Notes: Supervillain UI [|cff9911FFAutomatic Whispers|r] +## LoadOnDemand: 1 ## RequiredDeps: SVUI +## X-SVUI: SVAnswer SVUI_AnsweringService.lua diff --git a/Interface/AddOns/SVUI_ArtOfWar/Bindings.xml b/Interface/AddOns/SVUI_ArtOfWar/Bindings.xml index f0778e8..05e6324 100644 --- a/Interface/AddOns/SVUI_ArtOfWar/Bindings.xml +++ b/Interface/AddOns/SVUI_ArtOfWar/Bindings.xml @@ -1,5 +1,5 @@ - + SVUISayIncoming() \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua index d4ce857..7a77a7a 100644 --- a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua +++ b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua @@ -50,10 +50,9 @@ local SVUIAddOnName, PLUGIN = ...; local SuperVillain, L = unpack(SVUI); local CONFIGS = SuperVillain.Configs local NewHook = hooksecurefunc; -local SVUIAddonEventHandler = CreateFrame("Frame", nil) -local version = GetAddOnMetadata(..., "Version") -PLUGIN = SuperVillain:Prototype(SVUIAddOnName, version) +PLUGIN = SuperVillain:Prototype(SVUIAddOnName) +local SCHEMA = PLUGIN.___schema; _G["WarVillain"] = PLUGIN; --[[ @@ -189,37 +188,37 @@ local function AddEnemyScan(guid, timestamp) end local function SaveEnemyScan(guid, timestamp) - local e = EnemyCache[guid] - if(not e) then e = AddEnemyScan(guid, timestamp) end + local enemy = EnemyCache[guid] + if(not enemy) then enemy = AddEnemyScan(guid, timestamp) end SVAOW_Cache[guid] = { - ["name"] = e.name, - ["realm"] = e.realm, - ["class"] = e.class, - ["race"] = e.race, - ["sex"] = e.sex, - ["colors"] = e.colors, - ["time"] = e.timestamp + ["name"] = enemy.name, + ["realm"] = enemy.realm, + ["class"] = enemy.class, + ["race"] = enemy.race, + ["sex"] = enemy.sex, + ["colors"] = enemy.colors, + ["time"] = enemy.timestamp } - local msg = ("Killed By: %s"):format(e.name); - HeadsUpAlarm(msg, CombatText_StandardScroll, e.colors.r, e.colors.g, e.colors.b, "sticky"); + local msg = ("Killed By: %s"):format(enemy.name); + HeadsUpAlarm(msg, CombatText_StandardScroll, enemy.colors.r, enemy.colors.g, enemy.colors.b, "sticky"); PLUGIN:UpdateSummary() end local function KilledEnemyHandler(guid) - local e = SVAOW_Cache[guid] - if(e) then - HeadsUpAlarm(("Killed Mortal Enemy: %s"):format(e.name), CombatText_StandardScroll, 0.2, 1, 0.1, "sticky"); + local enemy = SVAOW_Cache[guid] + if(enemy) then + HeadsUpAlarm(("Killed Mortal Enemy: %s"):format(enemy.name), CombatText_StandardScroll, 0.2, 1, 0.1, "sticky"); end - e = EnemyCache[guid] - if(e) then - HeadsUpAlarm(("Killed Enemy: %s"):format(e.name), CombatText_StandardScroll, 0.1, 0.8, 0); + enemy = EnemyCache[guid] + if(enemy) then + HeadsUpAlarm(("Killed Enemy: %s"):format(enemy.name), CombatText_StandardScroll, 0.1, 0.8, 0); end end local function ClearCacheScans() wipe(EnemyCache) wipe(AlertedCache) - PLUGIN.LOG.Output:Clear(); + if(PLUGIN.LOG and PLUGIN.LOG.Output) then PLUGIN.LOG.Output:Clear() end end local function ClearSavedScans() @@ -371,7 +370,7 @@ function PLUGIN:UpdateCommunicator() end end self.InPVP = true - SVUIAddonEventHandler:UnregisterEvent("UPDATE_BATTLEFIELD_SCORE") + self:UnregisterEvent("UPDATE_BATTLEFIELD_SCORE") self.Scanning = false self:PauseScanner() end @@ -389,7 +388,7 @@ function PLUGIN:UpdateCommunicator() node:Hide() end self.InPVP = nil - SVUIAddonEventHandler:RegisterEvent("UPDATE_BATTLEFIELD_SCORE") + self:RegisterEvent("UPDATE_BATTLEFIELD_SCORE") self.Scanning = true self:PopulateScans() @@ -460,6 +459,7 @@ local function ParseIncomingLog(timestamp, event, eGuid, eName, pGuid) end local function GetSourceType(guid) + if not guid then return end local subStr, binStr, bitVal, srcType subStr = guid:sub(3, 5) binStr = ("0x%s"):format(subStr) @@ -468,7 +468,8 @@ local function GetSourceType(guid) return srcType end -function PLUGIN:CombatLogScanner(timestamp, event, _, srcGUID, srcName, srcFlags, sourceRaidFlags, dstGUID, dstName, dstFlags, destRaidFlags, _, spellName) +function PLUGIN:COMBAT_LOG_EVENT_UNFILTERED(timestamp, event, _, srcGUID, srcName, srcFlags, sourceRaidFlags, dstGUID, dstName, dstFlags, destRaidFlags, _, spellName) + if not srcFlags then return end local flagParse = band(srcFlags, COMBATLOG_OBJECT_REACTION_HOSTILE) local flagged = flagParse == COMBATLOG_OBJECT_REACTION_HOSTILE @@ -476,7 +477,7 @@ function PLUGIN:CombatLogScanner(timestamp, event, _, srcGUID, srcName, srcFlags if(srcGUID and srcName) then local isHostile = CombatLog_Object_IsA(srcFlags, COMBATLOG_FILTER_HOSTILE_PLAYERS) local srcType = GetSourceType(srcGUID) - if((srcType == 0 or srcType == 8) and isHostile) then + if(srcType and (srcType == 0 or srcType == 8) and isHostile) then if(event == "SPELL_AURA_APPLIED" and (spellName == L["Stealth"] or spellName == L["Prowl"])) then StealthAlarm(spellName) end @@ -491,7 +492,7 @@ function PLUGIN:CombatLogScanner(timestamp, event, _, srcGUID, srcName, srcFlags if(PLUGIN.Scanning and dstGUID and dstName) then local isHostile = CombatLog_Object_IsA(dstFlags, COMBATLOG_FILTER_HOSTILE_PLAYERS) local srcType = GetSourceType(dstGUID) - if((srcType == 0 or srcType == 8) and isHostile) then + if(srcType and (srcType == 0 or srcType == 8) and isHostile) then ParseIncomingLog(timestamp, event, dstGUID, dstName, srcGUID) end end @@ -504,56 +505,38 @@ function PLUGIN:CombatLogScanner(timestamp, event, _, srcGUID, srcName, srcFlags end end -function PLUGIN:TargetChanged() - if(UnitIsPlayer("target") and UnitIsEnemy("target", "player")) then - local guid = UnitGUID("target") - if(not EnemyCache[guid]) then - local timestamp = time() - AddEnemyScan(guid, timestamp) - end - if(SVAOW_Cache[guid]) then - HeadsUpAlarm("Kill On Sight!", CombatText_StandardScroll, 1, 0, 0, "crit") - end - end -end - -function PLUGIN:TheyGotMe() - local guid = PLUGIN.HitBy - if(guid and guid ~= "") then - local stamp = time() - SaveEnemyScan(guid, stamp) - end -end +function PLUGIN:EventDistributor(event, ...) + local inInstance, instanceType = IsInInstance() -local Registry_OnEvent = function(self, event, ...) if(event == "PLAYER_REGEN_ENABLED") then - PLUGIN.HitBy = false; - elseif(event == "COMBAT_LOG_EVENT_UNFILTERED") then - PLUGIN:CombatLogScanner(...) + self.HitBy = false; + if(instanceType == "pvp") then self.Scanning = false end else - local inInstance, instanceType = IsInInstance() - if(instanceType == "pvp") then - PLUGIN.Scanning = false - end - - if(event == "PLAYER_ENTERING_WORLD" or event == "UPDATE_BATTLEFIELD_SCORE") then - PLUGIN:UpdateCommunicator() - elseif(event == "PLAYER_TARGET_CHANGED") then - if(instanceType ~= "pvp") then - PLUGIN:TargetChanged() - end - elseif(event == "PLAYER_DEAD") then - if(instanceType ~= "pvp") then - PLUGIN:TheyGotMe() + if(instanceType ~= "pvp") then + if(event == "PLAYER_TARGET_CHANGED") then + if(UnitIsPlayer("target") and UnitIsEnemy("target", "player")) then + local guid = UnitGUID("target") + if(not EnemyCache[guid]) then + local timestamp = time() + AddEnemyScan(guid, timestamp) + end + if(SVAOW_Cache[guid]) then + HeadsUpAlarm("Kill On Sight!", CombatText_StandardScroll, 1, 0, 0, "crit") + end + end + elseif(event == "PLAYER_DEAD") then + local guid = self.HitBy + if(guid and guid ~= "") then + local stamp = time() + SaveEnemyScan(guid, stamp) + end end else - PLUGIN:UpdateZoneStatus() + self.Scanning = false end end end -SVUIAddonEventHandler:SetScript("OnEvent", Registry_OnEvent) - local onMouseWheel = function(self, delta) if (delta > 0) then self:ScrollUp() @@ -598,16 +581,6 @@ local function MakeLogWindow() PLUGIN.LOG = frame _G["SVUI_ArtOfWarTool1"].Window = PLUGIN.LOG - - SVUIAddonEventHandler:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") - SVUIAddonEventHandler:RegisterEvent("ZONE_CHANGED") - SVUIAddonEventHandler:RegisterEvent("ZONE_CHANGED_NEW_AREA") - SVUIAddonEventHandler:RegisterEvent("PLAYER_ENTERING_WORLD") - SVUIAddonEventHandler:RegisterEvent("PLAYER_TARGET_CHANGED") - SVUIAddonEventHandler:RegisterEvent("PLAYER_REGEN_ENABLED") - SVUIAddonEventHandler:RegisterEvent("PLAYER_DEAD") - SVUIAddonEventHandler:RegisterEvent("UNIT_FACTION") - SVUIAddonEventHandler:RegisterEvent("UPDATE_BATTLEFIELD_SCORE") end local function MakeCommWindow() @@ -869,7 +842,7 @@ BUILD FUNCTION ########################################################## ]]-- local function LoadOptions() - SuperVillain.Options.args.plugins.args.pluginOptions.args.SVAOW = { + SuperVillain.Options.args.plugins.args.pluginOptions.args[SCHEMA] = { type = "group", name = L["Art of War"], childGroups = "tree", @@ -878,29 +851,29 @@ local function LoadOptions() order = 1, type = "toggle", name = "Enable", - get = function(a) return SuperVillain.db.SVAOW.enable end, - set = function(a,b)SuperVillain.db.SVAOW.enable = b; SuperVillain:StaticPopup_Show("RL_CLIENT") end + get = function(a) return SuperVillain.db[SCHEMA].enable end, + set = function(a,b)SuperVillain.db[SCHEMA].enable = b; SuperVillain:StaticPopup_Show("RL_CLIENT") end } } } end -local function LoadWarVillain() - if(not SuperVillain.db.SVAOW.enable) then return end +function PLUGIN:Load() + if(not SuperVillain.db[SCHEMA].enable) then return end local ALERT_HEIGHT = 60; local DOCK_WIDTH = SuperDockWindowRight:GetWidth(); local DOCK_HEIGHT = SuperDockWindowRight:GetHeight(); local BUTTON_SIZE = (DOCK_HEIGHT * 0.25) - 4; - PLUGIN.db = SuperVillain.db.SVAOW + self.db = SuperVillain.db[SCHEMA] if(not SVAOW_Data) then SVAOW_Data = {} end if(not SVAOW_Cache) then SVAOW_Cache = {} end - PLUGIN.HitBy = false; - PLUGIN.Scanning = false; - PLUGIN.InPVP = false + self.HitBy = false; + self.Scanning = false; + self.InPVP = false local holder = CreateFrame("Frame", "SVUI_ArtOfWarDock", SuperDockWindowRight) holder:SetFrameStrata("BACKGROUND") @@ -989,7 +962,7 @@ local function LoadWarVillain() divider1:SetPoint("BOTTOMRIGHT") divider1:SetHeight(1) - PLUGIN.Title = title + self.Title = title local listbutton = CreateFrame("Button", nil, holder) listbutton:SetPoint("TOPLEFT", title, "BOTTOMLEFT",0,0) @@ -1000,7 +973,7 @@ local function LoadWarVillain() listbutton:SetScript("OnLeave", Switch_OnLeave) listbutton:SetScript("OnClick", Switch_OnClick) - PLUGIN.Switch = listbutton + self.Switch = listbutton local summary = CreateFrame("ScrollingMessageFrame", nil, holder) summary:SetSpacing(4) @@ -1014,7 +987,7 @@ local function LoadWarVillain() summary:SetFading(false) summary:SetInsertMode('TOP') - PLUGIN.Summary = summary + self.Summary = summary local divider2 = summary:CreateTexture(nil,"OVERLAY") divider2:SetTexture(0,0,0,0.5) @@ -1031,23 +1004,38 @@ local function LoadWarVillain() holder:Hide() - PLUGIN:ResetLogs() + self:ResetLogs() local targetButton = CreateFrame("Button", "SVUI_TargetScanButton", UIParent, "SecureActionButtonTemplate") - targetButton:SetAllPoints(PLUGIN.LOG) + targetButton:SetAllPoints(self.LOG) targetButton:SetFrameLevel(99) targetButton:RegisterForClicks("AnyUp") targetButton:SetAttribute("type1", "macro") targetButton:SetAttribute("macrotext", "/tar") targetButton:EnableMouse(false) - targetButton:HookScript("OnClick", function(self) self:EnableMouse(false) end) + targetButton:HookScript("OnClick", function(this) this:EnableMouse(false) end) + + self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") + + self:RegisterEvent("PLAYER_TARGET_CHANGED", "EventDistributor") + self:RegisterEvent("PLAYER_REGEN_ENABLED", "EventDistributor") + self:RegisterEvent("PLAYER_DEAD", "EventDistributor") + + self:RegisterEvent("ZONE_CHANGED", "UpdateZoneStatus") + self:RegisterEvent("ZONE_CHANGED_NEW_AREA", "UpdateZoneStatus") + self:RegisterEvent("UNIT_FACTION", "UpdateZoneStatus") + + self:RegisterEvent("PLAYER_ENTERING_WORLD", "UpdateCommunicator") + self:RegisterEvent("UPDATE_BATTLEFIELD_SCORE", "UpdateCommunicator") + + LoadOptions() end ---/tar Munglunch +-- /tar Sinnisterr +-- /tar Munglunch -CONFIGS["SVAOW"] = { +CONFIGS[SCHEMA] = { ["enable"] = true } -SuperVillain.Registry:NewScript(LoadWarVillain) -SuperVillain.Registry:NewPlugin(PLUGIN, "SVAOW", LoadOptions) \ No newline at end of file +SuperVillain.Registry:NewPlugin(PLUGIN) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.toc b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.toc index 9d5aad5..1ac9e65 100644 --- a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.toc +++ b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.toc @@ -1,10 +1,11 @@ -## Interface: 50400 +## Interface: 60000 ## Author: Munglunch -## Version: 4.084 +## Version: 5.02 ## Title: |cffFF9900SVUI |r|cffFFEF00Art of War|r ## Notes: Supervillain UI [|cff9911FFPvP Tools|r]. ## SavedVariables: SVAOW_Data ## SavedVariablesPerCharacter: SVAOW_Cache ## RequiredDeps: SVUI +## X-SVUI: SVAOW SVUI_ArtOfWar.lua diff --git a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc index 81e44c3..b75cd33 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc +++ b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc @@ -1,9 +1,11 @@ -## Interface: 50400 -## Author: Munglunch, Elv -## Version: 4.084 +## Interface: 60000 +## Author: Munglunch +## Version: 5.02 ## Title: |cffFF9900SVUI |r|cffFFEF00Config O Matic|r ## Notes: Supervillain UI [|cff9911FFConfig Options|r] ## RequiredDeps: SVUI ## LoadOnDemand: 1 +## X-Notes: Special thanks to Elv and Tukz for their incredible work. +## X-Email: munglunch@gmail.com _load.xml diff --git a/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua b/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua index 01c1808..7e5052a 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua @@ -101,7 +101,7 @@ local function UpdateButton(button, treeline, selected, canExpand, isExpanded) button.icon:SetTexture(icon) button.icon:SetPoint("LEFT", 8 * level, (level == 1) and 0 or 1) else - button.icon:SetTexture(0,0,0,0) + button.icon:SetTexture("") end if iconCoords then diff --git a/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua b/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua index f8411b4..a63260c 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/Libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua @@ -83,7 +83,7 @@ local function Constructor() frame:SetScript("OnMouseDown", Label_OnClick) local highlight = frame:CreateTexture(nil, "HIGHLIGHT") - highlight:SetTexture(0,0,0,0) + highlight:SetTexture("") highlight:SetAllPoints() highlight:SetBlendMode("ADD") diff --git a/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/prototypes.lua b/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/prototypes.lua index 6d304c7..7347931 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/prototypes.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0-SharedMediaWidgets/prototypes.lua @@ -268,7 +268,7 @@ do frame:ClearAllPoints() frame:Hide() frame:SetBackdrop(frameBackdrop) - frame.bgTex:SetTexture(0,0,0,0) + frame.bgTex:SetTexture("") table.insert(DropDownCache, frame) return nil end diff --git a/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua b/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua index 0e6236d..f54cce4 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua @@ -101,7 +101,7 @@ local function UpdateButton(button, treeline, selected, canExpand, isExpanded) button.icon:SetTexture(icon) button.icon:SetPoint("LEFT", 8 * level, (level == 1) and 0 or 1) else - button.icon:SetTexture(0,0,0,0) + button.icon:SetTexture("") end if iconCoords then diff --git a/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua b/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua index f8411b4..a63260c 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua @@ -83,7 +83,7 @@ local function Constructor() frame:SetScript("OnMouseDown", Label_OnClick) local highlight = frame:CreateTexture(nil, "HIGHLIGHT") - highlight:SetTexture(0,0,0,0) + highlight:SetTexture("") highlight:SetAllPoints() highlight:SetBlendMode("ADD") diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua index 008d80d..1d4bef2 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua @@ -49,6 +49,7 @@ local textStringFormats = { ["percent"] = "Percent", ["curpercent"] = "Current - Percent", ["curmax"] = "Current - Maximum", + ["curmax-percent"] = "Current - Maximum | %", } --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_DebugOMatic/Bindings.xml b/Interface/AddOns/SVUI_DebugOMatic/Bindings.xml new file mode 100644 index 0000000..0aece78 --- /dev/null +++ b/Interface/AddOns/SVUI_DebugOMatic/Bindings.xml @@ -0,0 +1,5 @@ + + + DebugThisFrame() + + \ No newline at end of file diff --git a/Interface/AddOns/SVUI_DebugOMatic/SVUI_DebugOMatic.toc b/Interface/AddOns/SVUI_DebugOMatic/SVUI_DebugOMatic.toc new file mode 100644 index 0000000..47da00f --- /dev/null +++ b/Interface/AddOns/SVUI_DebugOMatic/SVUI_DebugOMatic.toc @@ -0,0 +1,9 @@ +## Interface: 50400 +## Author: Munglunch, Azilroka, Sortokk +## Version: 1.6 +## Title: |cffFF9900SVUI |r|cffFFEF00Debug O Matic|r +## Notes: Supervillain UI Debugging. +## RequiredDeps: SVUI +## OptionalDeps: Blizzard_DebugTools + +SVUI_DebugOMatic.xml diff --git a/Interface/AddOns/SVUI_DebugOMatic/SVUI_DebugOMatic.xml b/Interface/AddOns/SVUI_DebugOMatic/SVUI_DebugOMatic.xml new file mode 100644 index 0000000..a3f97ba --- /dev/null +++ b/Interface/AddOns/SVUI_DebugOMatic/SVUI_DebugOMatic.xml @@ -0,0 +1,116 @@ + +