diff --git a/Interface/AddOns/SVUI/Bindings.xml b/Interface/AddOns/SVUI/Bindings.xml index 4071d30..0293f5f 100644 --- a/Interface/AddOns/SVUI/Bindings.xml +++ b/Interface/AddOns/SVUI/Bindings.xml @@ -2,25 +2,10 @@ <Binding name="Raid Marker" header="SVUI" runOnUp="true"> RaidMark_HotkeyPressed(keystate) </Binding> - <Binding name="Fishing Mode" runOnUp="false"> - SVUIFishingMode() - </Binding> - <Binding name="Farming Mode" runOnUp="false"> - SVUIFarmingMode() - </Binding> - <Binding name="Archaeology Mode" runOnUp="false"> - SVUIArchaeologyMode() - </Binding> - <Binding name="Cooking Mode" runOnUp="false"> - SVUICookingMode() - </Binding> <Binding name="Toggle Docks" runOnUp="false"> HideSuperDocks() </Binding> <Binding name="Lets Ride" runOnUp="false"> SVUILetsRide() </Binding> - <Binding name="Call Out Incoming" runOnUp="false"> - SVUISayIncoming() - </Binding> </Bindings> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/SVUI.lua b/Interface/AddOns/SVUI/SVUI.lua index 717c741..3208c96 100644 --- a/Interface/AddOns/SVUI/SVUI.lua +++ b/Interface/AddOns/SVUI/SVUI.lua @@ -41,26 +41,24 @@ local tsort, tconcat = table.sort, table.concat; ADDON DATA ########################################################## ]]-- +local SVUI = {}; local SVUINameSpace, SVUICore = ...; local version = GetAddOnMetadata(..., "Version"); +local build = select(2, GetBuildInfo()); +local SetAddonCore; +local callbacks = {}; +local numCallbacks = 0; --[[ ########################################################## CONSTANTS ########################################################## ]]-- -BINDING_HEADER_SVUI = GetAddOnMetadata(..., "Title"); +BINDING_HEADER_SVUI = "SuperVillain UI"; SLASH_RELOADUI1="/rl" SLASH_RELOADUI2="/reloadui" SlashCmdList.RELOADUI=ReloadUI --[[ ########################################################## -LOCALS -########################################################## -]]-- -local callbacks = {}; -local numCallbacks = 0; ---[[ -########################################################## MUNGLUNCH's FASTER ASSERT FUNCTION ########################################################## ]]-- @@ -165,7 +163,7 @@ do for i, class in ipairs(classes) do local color = supercolors[class] local r, g, b = color.r, color.g, color.b - local hex = format("ff%02x%02x%02x", r * 255, g * 255, b * 255) + local hex = ("ff%02x%02x%02x"):format(r * 255, g * 255, b * 255) if not SVUI_CLASS_COLORS[class] or not SVUI_CLASS_COLORS[class].r or not SVUI_CLASS_COLORS[class].g or not SVUI_CLASS_COLORS[class].b then SVUI_CLASS_COLORS[class] = { r = r, @@ -239,277 +237,344 @@ function string.link(this, prefix, text, color) end --[[ ########################################################## -OBJECT CONSTRUCTOR GLOBAL +DEFINE REGISTRY HELPERS ########################################################## ]]-- -local PreLoadQueue, InitQueue, PostLoadQueue = {},{},{}; - -local INFO_BY = "%s by %s"; -local INFO_VERSION = "%s%s - Version: %d"; -local INFO_NEW = "%s (Newest: %d)"; -local INFO_NAME = "Plugins"; -local INFO_HEADER = "SuperVillain UI (version %.3f): Plugins"; - -if GetLocale() == "ruRU" then - INFO_BY = "%s от %s"; - INFO_VERSION = "%s%s - Версия: %d"; - INFO_NEW = "%s (Последняя: %d)"; - INFO_NAME = "Плагины"; - INFO_HEADER = "SuperVillain UI (устарела %.3f): Плагины"; -end - -local rootstring = function(self) return self.__namekey end - -local changeDBVar = function(self, value, key, sub1, sub2, sub3) - local config = self.__owner.db[self.__namekey] - if((sub1 and sub2 and sub3) and (config[sub1] and config[sub1][sub2] and config[sub1][sub2][sub3])) then - self.__owner.db[self.__namekey][sub1][sub2][sub3][key] = value - elseif((sub1 and sub2) and (config[sub1] and config[sub1][sub2])) then - self.__owner.db[self.__namekey][sub1][sub2][key] = value - elseif(sub1 and config[sub1]) then - self.__owner.db[self.__namekey][sub1][key] = value - else - self.__owner.db[self.__namekey][key] = value +do + local PackageQueue, ScriptQueue = {},{}; + + local INFO_BY = "%s by %s"; + local INFO_VERSION = "%s%s - Version: %d"; + local INFO_NEW = "%s (Newest: %d)"; + local INFO_NAME = "Plugins"; + local INFO_HEADER = "SuperVillain UI (version %.3f): Plugins"; + + if GetLocale() == "ruRU" then + INFO_BY = "%s от %s"; + INFO_VERSION = "%s%s - Версия: %d"; + INFO_NEW = "%s (Последняя: %d)"; + INFO_NAME = "Плагины"; + INFO_HEADER = "SuperVillain UI (устарела %.3f): Плагины"; end - self.db = self.__owner.db[self.__namekey] -end -local innerOnEvent = function(self, event, ...) - local obj = self.__owner - if self[event] and type(self[event]) == "function" then - self[event](obj, event, ...) + local rootstring = function(self) return self.___name end + + local changeDBVar = function(self, value, key, sub1, sub2, sub3) + local config = self.__owner.db[self.___name] + 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 + elseif((sub1 and sub2) and (config[sub1] and config[sub1][sub2])) then + self.__owner.db[self.___name][sub1][sub2][key] = value + elseif(sub1 and config[sub1]) then + self.__owner.db[self.___name][sub1][key] = value + else + self.__owner.db[self.___name][key] = value + end + self.db = self.__owner.db[self.___name] + if(self.UpdateLocals) then + self:UpdateLocals() + end end -end -local registerEvent = function(self, eventname, eventfunc) - if not self.___eventframe then - self.___eventframe = CreateFrame("Frame", nil) - self.___eventframe.__owner = self - self.___eventframe:SetScript("OnEvent", innerOnEvent) + local innerOnEvent = function(self, event, ...) + local obj = self.__owner + if self[event] and type(self[event]) == "function" then + self[event](obj, event, ...) + end end - local fn = eventfunc - if type(eventfunc) == "string" then - fn = self[eventfunc] - elseif(not fn and self[eventname]) then - fn = self[eventname] + + local registerEvent = function(self, eventname, eventfunc) + if not self.___eventframe then + self.___eventframe = CreateFrame("Frame", nil) + self.___eventframe.__owner = 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] + end + self.___eventframe[eventname] = fn + self.___eventframe:RegisterEvent(eventname) end - self.___eventframe[eventname] = fn - self.___eventframe:RegisterEvent(eventname) -end -local unregisterEvent = function(self, event, ...) - if(self.___eventframe) then - self.___eventframe:UnregisterEvent(event) + local unregisterEvent = function(self, event, ...) + if(self.___eventframe) then + self.___eventframe:UnregisterEvent(event) + end 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 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() + end end end end -end -local function SetNewPackage(obj, name, parent) - local addonmeta = {} - local oldmeta = getmetatable(obj) - if oldmeta then - for k, v in pairs(oldmeta) do addonmeta[k] = v end + local function SetNewComponent(obj, name, parent, plugin) + local addonmeta = {} + local oldmeta = getmetatable(obj) + if oldmeta then + for k, v in pairs(oldmeta) do addonmeta[k] = v end + end + addonmeta.__tostring = rootstring + setmetatable( obj, addonmeta ) + obj.___name = name + obj.__owner = parent + obj.initialized = false + obj.CombatLocked = false + obj.ChangeDBVar = changeDBVar + obj.RegisterEvent = registerEvent + obj.UnregisterEvent = unregisterEvent + if(not plugin) then + return obj + end end - addonmeta.__tostring = rootstring - setmetatable( obj, addonmeta ) - obj.__namekey = name - obj.__owner = parent - obj.initialized = false - obj.CombatLocked = false - obj.ChangeDBVar = changeDBVar - obj.RegisterEvent = registerEvent - obj.UnregisterEvent = unregisterEvent - return obj -end -local Registry_SetCallback = function(self, fn) - if(fn and type(fn) == "function") then - self.Callbacks[#self.Callbacks+1] = fn - end -end - -local Registry_NewScript = function(self, fn) - if(fn and type(fn) == "function") then - PostLoadQueue[#PostLoadQueue+1] = fn - end -end - -local Registry_NewPackage = function(self, obj, name, priority) - if self.__owner[name] then return end - if(priority == "pre") then - PreLoadQueue[#PreLoadQueue+1] = name - else - InitQueue[#InitQueue+1] = name + local Registry_SetCallback = function(self, fn) + if(fn and type(fn) == "function") then + self.Callbacks[#self.Callbacks+1] = fn + end end - self.Packages[#self.Packages+1] = name - self.__owner[name] = SetNewPackage(obj, name, self.__owner) - - if(self.__owner.AddonLaunched) then - if(self.__owner[name].Load) then - self.__owner[name]:Load() - end + + local Registry_NewScript = function(self, fn) + if(fn and type(fn) == "function") then + ScriptQueue[#ScriptQueue+1] = fn + end end -end -local Registry_FetchPlugins = function(self) - local list = ""; - for name, plugin in pairs(self.Plugins) do - if name ~= self.MAJOR then - local author = GetAddOnMetadata(name, "Author") - local Pname = GetAddOnMetadata(name, "Title") or name - local color = plugin.old and "|cffFF0000" or "|cff00FF00" - list = ("%s%s"):format(list, Pname) - if author then - list = self.INFO_BY:format(list, author) - end - list = self.INFO_VERSION:format(list, color, plugin.version) - if plugin.old then - list = self.INFO_NEW:format(list, plugin.newversion) + local Registry_NewPackage = function(self, obj, name) + if self.__owner[name] then return end + PackageQueue[#PackageQueue+1] = name + self.Packages[#self.Packages+1] = name + + self.__owner[name] = SetNewComponent(obj, name, self.__owner) + + if(self.__owner.AddonLaunched) then + if(self.__owner[name].Load) then + self.__owner[name]:Load() end - list = ("%s|r\n"):format(list) end end - return list -end -local Registry_NewPlugin = function(self, name, func) - local ver = name == self.MAJOR and self.MINOR or GetAddOnMetadata(name, "Version") - self.Plugins[name] = { - version = ver, - callback = func - } - local enable, loadable = select(4,GetAddOnInfo("SVUI_ConfigOMatic")) - if(enable and loadable and IsAddOnLoaded("SVUI_ConfigOMatic")) then - if name ~= self.MAJOR then - self.__owner.Options.args.plugins.args.pluginlist.name = self:FetchPlugins() - end - if(func) then - func() + 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 + local color = plugin.old and "|cffFF0000" or "|cff00FF00" + list = ("%s%s"):format(list, Pname) + if author then + list = self.INFO_BY:format(list, author) + end + list = self.INFO_VERSION:format(list, color, plugin.___ver) + if plugin.old then + list = self.INFO_NEW:format(list, plugin.newversion) + end + list = ("%s|r\n"):format(list) + end end + return list end -end -local Registry_RunCallbacks = function(self) - for i=1, #self.Callbacks do - local fn = self.Callbacks[i] - if(fn and type(fn) == "function") then - fn() + 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") + 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 + end + callbackFunc() end - end -end -local Registry_Update = function(self, name, dataOnly) - local obj = self.__owner[name] - if obj then - if self.__owner.db[name] then - obj.db = self.__owner.db[name] - end - if obj.ReLoad and not dataOnly then - obj:ReLoad() - end + SetNewComponent(obj, name, self.__owner, true) end -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] - end - if obj and obj.ReLoad then - obj:ReLoad() + local Registry_RunCallbacks = function(self) + for i=1, #self.Callbacks do + local fn = self.Callbacks[i] + if(fn and type(fn) == "function") then + fn() + end end end -end -local Registry_PreLoad = function(self) - if not PreLoadQueue then return end - for i=1,#PreLoadQueue do - local name = PreLoadQueue[i] + local Registry_Update = function(self, name, dataOnly) local obj = self.__owner[name] - if obj and not obj.initialized then + if obj then if self.__owner.db[name] then obj.db = self.__owner.db[name] end - if obj.Load then - obj:Load() - obj.Load = nil + if obj.ReLoad and not dataOnly then + obj:ReLoad() end - obj.initialized = true; - end + end end - PreLoadQueue = nil -end -local Registry_Load = function(self) - if not InitQueue then return end - for i=1,#InitQueue do - local name = InitQueue[i] - local obj = self.__owner[name] - if obj and not obj.initialized then + 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] end - if obj.Load then - obj:Load() - obj.Load = nil + if obj and obj.ReLoad then + obj:ReLoad() end - obj.initialized = true; - end + end end - InitQueue = nil - if not PostLoadQueue then return end - for i=1, #PostLoadQueue do - local fn = PostLoadQueue[i] - if(fn and type(fn) == "function") then - fn() - end + local Registry_PreLoad = function(self) + if not PackageQueue then return end + for i=1,#PackageQueue do + local name = PackageQueue[i] + local obj = self.__owner[name] + if(obj and obj.PriorityLoad and (not obj.initialized)) then + if self.__owner.db[name] then + obj.db = self.__owner.db[name] + end + obj:PriorityLoad() + obj.PriorityLoad = nil + obj.initialized = true; + end + end end - PostLoadQueue = nil -end -local function AppendRegistry(obj, major, minor) - local methods = { - __owner = obj, - Packages = {}, - Plugins = {}, - Callbacks = {}, - MAJOR = major, - MINOR = minor, - INFO_BY = INFO_BY, - INFO_VERSION = INFO_VERSION, - INFO_NEW = INFO_NEW, - INFO_NAME = INFO_NAME, - INFO_HEADER = INFO_HEADER, - SetCallback = Registry_SetCallback, - NewScript = Registry_NewScript, - NewPackage = Registry_NewPackage, - FetchPlugins = Registry_FetchPlugins, - NewPlugin = Registry_NewPlugin, - RunCallbacks = Registry_RunCallbacks, - Update = Registry_Update, - UpdateAll = Registry_UpdateAll, - PreLoadPackages = Registry_PreLoad, - LoadPackages = Registry_Load, - Prototype = Registry_Prototype, - } - local mt = {__tostring = rootstring} - setmetatable(methods, mt) - return methods + local Registry_Load = function(self) + if not PackageQueue then return end + for i=1,#PackageQueue do + local name = PackageQueue[i] + local obj = self.__owner[name] + if obj and not obj.initialized then + if self.__owner.db[name] then + obj.db = self.__owner.db[name] + end + if obj.Load then + obj:Load() + obj.Load = nil + end + obj.initialized = true; + end + end + + PackageQueue = nil + + if not ScriptQueue then return end + for i=1, #ScriptQueue do + local fn = ScriptQueue[i] + if(fn and type(fn) == "function") then + fn() + end + end + + ScriptQueue = nil + end + + --[[ GLOBAL NAMESPACE ]]-- + + function SetAddonCore(obj,n,v) + obj = { + ___name = n, + ___ver = v, + db = {}, + Global = { + Accountant = {}, + profiles = {}, + profileKeys = {}, + }, + Configs = {}, + Media = {}, + DisplayAudit = {}, + DynamicOptions = {}, + Dispellable = {}, + Snap = {}, + Options = { + type = "group", + name = "|cff339fffConfig-O-Matic|r", + args = { + plugins = { + order = -2, + type = "group", + name = "Plugins", + childGroups = "tab", + args = { + pluginheader = { + order = 1, + type = "header", + name = "SuperVillain Plugins", + }, + pluginOptions = { + order = 2, + type = "group", + name = "", + args = { + pluginlist = { + order = 1, + type = "group", + name = "Summary", + args = { + active = { + order = 1, + type = "description", + name = "" + } + } + }, + } + } + } + } + } + }, + Registry = { + Packages = {}, + 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, + NewScript = Registry_NewScript, + NewPackage = Registry_NewPackage, + FetchPlugins = Registry_FetchPlugins, + NewPlugin = Registry_NewPlugin, + RunCallbacks = Registry_RunCallbacks, + Update = Registry_Update, + UpdateAll = Registry_UpdateAll, + PreLoadPackages = Registry_PreLoad, + LoadPackages = Registry_Load, + } + } + local mt = {} + local old = getmetatable(obj) + if old then + for k, v in pairs(old) do mt[k] = v end + end + mt.__tostring = rootstring + setmetatable(obj, mt) + + obj.Registry.__owner = obj + + return obj + end end +SVUI = SetAddonCore(SVUI, SVUINameSpace, version) + +--[[ LOCALIZATION HELPERS ]]-- local failsafe = function() assert(false) end local metaread = { @@ -537,37 +602,27 @@ local metawrite = setmetatable({}, { __index = failsafe }) ---[[ -########################################################## -BUILD ADDON OBJECTS, CREATE GLOBAL NAMESPACE -########################################################## -]]-- -local function SetPrototype() - local obj = {} - local mt = {} - local old = getmetatable(obj) - if old then - for k, v in pairs(old) do mt[k] = v end - end - mt.__tostring = rootstring - setmetatable(obj, mt) - return obj -end +SVUI.Localization = setmetatable({}, metaread) -local SuperVillain = SetPrototype() +--[[ MISC ]]-- +SVUI.fubar = function() return end +SVUI.class = select(2,UnitClass("player")); +SVUI.ClassRole = ""; +SVUI.ConfigurationMode = false; +--[[ MISC ]]-- -SuperVillain.__namekey = SVUINameSpace -SuperVillain.version = version -SuperVillain.Localization = setmetatable({}, metaread) -SuperVillain.Global = { - Accountant = {}, - profiles = {}, - profileKeys = {}, -} +--[[ UTILITY FRAMES ]]-- +SVUI.UIParent = CreateFrame("Frame", "SVUIParent", UIParent); +SVUI.UIParent:SetFrameLevel(UIParent:GetFrameLevel()); +SVUI.UIParent:SetPoint("CENTER", UIParent, "CENTER"); +SVUI.UIParent:SetSize(UIParent:GetSize()); +SVUI.Snap[1] = SVUI.UIParent; -SuperVillain.Registry = AppendRegistry(SuperVillain, SVUINameSpace, version) +SVUI.Cloaked = CreateFrame("Frame", nil, UIParent); +SVUI.Cloaked:Hide(); +--[[ UTILITY FRAMES ]]-- -function SuperVillain:SetLocaleStrings(locale, isDefault) +function SVUI:SetLocaleStrings(locale, isDefault) local gameLocale = GetLocale() if gameLocale == "enGB" then gameLocale = "enUS" end @@ -580,15 +635,24 @@ function SuperVillain:SetLocaleStrings(locale, isDefault) end end -function SuperVillain:Prototype(n, v) - local obj = SetPrototype() - obj.__namekey = n - obj.version = v +function SVUI:Prototype(n, v) + local obj = { + ___name = n, + ___ver = v + } + local mt = {} + local old = getmetatable(obj) + if old then + for k, v in pairs(old) do mt[k] = v end + end + mt.__tostring = rootstring + setmetatable(obj, mt) return obj end -SVUICore[1] = SuperVillain -SVUICore[2] = SuperVillain.Localization -SVUICore[3] = SuperVillain.Global +SVUICore[1] = SVUI +SVUICore[2] = SVUI.Localization +SVUICore[3] = SVUI.Global +SVUICore[4] = SVUI.Configs _G[SVUINameSpace] = SVUICore; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/SVUI.toc b/Interface/AddOns/SVUI/SVUI.toc index 08a5357..c6a7b15 100644 --- a/Interface/AddOns/SVUI/SVUI.toc +++ b/Interface/AddOns/SVUI/SVUI.toc @@ -1,6 +1,6 @@ ## Interface: 50400 ## Author: Munglunch -## Version: 4.076 +## Version: 4.08 ## Title: |cffFF9900SVUI|r ## Notes: Supervillain UI [|cff9911FFCore Framework|r]. ## SavedVariables: SVUI_Global diff --git a/Interface/AddOns/SVUI/SVUI.xml b/Interface/AddOns/SVUI/SVUI.xml index 896020d..a162118 100644 --- a/Interface/AddOns/SVUI/SVUI.xml +++ b/Interface/AddOns/SVUI/SVUI.xml @@ -116,12 +116,11 @@ <Script file="language\chinese_ui.lua"/> <Script file="language\portuguese_ui.lua"/> - <Script file="system\system.lua"/> <Script file="system\database.lua"/> - <Script file="system\screen.lua"/> + <Script file="system\system.lua"/> + <Script file="system\common.lua"/> <Script file="system\visibility.lua"/> <Script file="system\utilities.lua"/> - <Script file="system\templates.lua"/> <Script file="system\timers.lua"/> <Script file="system\updates.lua"/> <Script file="system\slash.lua"/> @@ -146,7 +145,6 @@ <Script file="packages\override\SVOverride.lua"/> <Script file="packages\gear\SVGear.lua"/> <Script file="packages\henchmen\SVHenchmen.lua"/> - <Include file="packages\laborer\SVLaborer.xml"/> <Script file="scripts\misc.lua"/> <Script file="scripts\mounts.lua"/> diff --git a/Interface/AddOns/SVUI/assets/artwork/Icons/DOCK-CALL.blp b/Interface/AddOns/SVUI/assets/artwork/Icons/DOCK-CALL.blp deleted file mode 100644 index de23af0..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Icons/DOCK-CALL.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Icons/DOCK-LABORER.blp b/Interface/AddOns/SVUI/assets/artwork/Icons/DOCK-LABORER.blp deleted file mode 100644 index 9397f22..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Icons/DOCK-LABORER.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Icons/DOCK-PVP.blp b/Interface/AddOns/SVUI/assets/artwork/Icons/DOCK-PVP.blp deleted file mode 100644 index a51de9a..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Icons/DOCK-PVP.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Icons/LABORER-COOKING.blp b/Interface/AddOns/SVUI/assets/artwork/Icons/LABORER-COOKING.blp deleted file mode 100644 index fe824f0..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Icons/LABORER-COOKING.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Icons/LABORER-FARMING.blp b/Interface/AddOns/SVUI/assets/artwork/Icons/LABORER-FARMING.blp deleted file mode 100644 index 7127055..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Icons/LABORER-FARMING.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Icons/LABORER-FISHING.blp b/Interface/AddOns/SVUI/assets/artwork/Icons/LABORER-FISHING.blp deleted file mode 100644 index 76474d1..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Icons/LABORER-FISHING.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Icons/LABORER-SURVEY.blp b/Interface/AddOns/SVUI/assets/artwork/Icons/LABORER-SURVEY.blp deleted file mode 100644 index 40f68ae..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Icons/LABORER-SURVEY.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Icons/PVP-INCOMING.blp b/Interface/AddOns/SVUI/assets/artwork/Icons/PVP-INCOMING.blp deleted file mode 100644 index f72c045..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Icons/PVP-INCOMING.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/assets/artwork/Icons/PVP-SAFE.blp b/Interface/AddOns/SVUI/assets/artwork/Icons/PVP-SAFE.blp deleted file mode 100644 index 4c84f3e..0000000 Binary files a/Interface/AddOns/SVUI/assets/artwork/Icons/PVP-SAFE.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI/libs/oUF/elements/health.lua b/Interface/AddOns/SVUI/libs/oUF/elements/health.lua index cf1e3a5..b885e78 100644 --- a/Interface/AddOns/SVUI/libs/oUF/elements/health.lua +++ b/Interface/AddOns/SVUI/libs/oUF/elements/health.lua @@ -1,91 +1,12 @@ --[[ Element: Health Bar + + THIS FILE HEAVILY MODIFIED FOR USE WITH SUPERVILLAIN UI - Handles updating of `self.Health` based on the units health. - - Widget - - Health - A StatusBar used to represent current unit health. - - Sub-Widgets - - .bg - A Texture which functions as a background. It will inherit the color of - the main StatusBar. - - Notes - - The default StatusBar texture will be applied if the UI widget doesn't have a - status bar texture or color defined. - - Options - - The following options are listed by priority. The first check that returns - true decides the color of the bar. - - .colorTapping - Use `self.colors.tapping` to color the bar if the unit - isn't tapped by the player. - .colorDisconnected - Use `self.colors.disconnected` to color the bar if the - unit is offline. - .colorClass - Use `self.colors.class[class]` to color the bar based on - unit class. `class` is defined by the second return of - [UnitClass](http://wowprogramming.com/docs/api/UnitClass). - .colorClassNPC - Use `self.colors.class[class]` to color the bar if the - unit is a NPC. - .colorClassPet - Use `self.colors.class[class]` to color the bar if the - unit is player controlled, but not a player. - .colorReaction - Use `self.colors.reaction[reaction]` to color the bar - based on the player's reaction towards the unit. - `reaction` is defined by the return value of - [UnitReaction](http://wowprogramming.com/docs/api/UnitReaction). - .colorSmooth - Use `self.colors.smooth` to color the bar with a smooth - gradient based on the player's current health percentage. - .colorHealth - Use `self.colors.health` to color the bar. This flag is - used to reset the bar color back to default if none of the - above conditions are met. - - Sub-Widgets Options - - .multiplier - Defines a multiplier, which is used to tint the background based - on the main widgets R, G and B values. Defaults to 1 if not - present. - - Examples - - -- Position and size - local Health = CreateFrame("StatusBar", nil, self) - Health:SetHeight(20) - Health:SetPoint('TOP') - Health:SetPoint('LEFT') - Health:SetPoint('RIGHT') - - -- Add a background - local Background = Health:CreateTexture(nil, 'BACKGROUND') - Background:SetAllPoints(Health) - Background:SetTexture(1, 1, 1, .5) - - -- Options - Health.frequentUpdates = true - Health.colorTapping = true - Health.colorDisconnected = true - Health.colorClass = true - Health.colorReaction = true - Health.colorHealth = true - - -- Make the background darker. - Background.multiplier = .5 - - -- Register it with oUF - self.Health = Health - self.Health.bg = Background - - Hooks - - Override(self) - Used to completely override the internal update function. - Removing the table key entry will make the element fall-back - to its internal function again. ]] local parent, ns = ... local oUF = ns.oUF local updateFrequentUpdates +local random = math.random oUF.colors.health = {49/255, 207/255, 37/255} @@ -93,18 +14,13 @@ local Update = function(self, event, unit) if(self.unit ~= unit) or not unit then return end local health = self.Health - if(health.PreUpdate) then health:PreUpdate(unit) end - local min, max = UnitHealth(unit), UnitHealthMax(unit) local disconnected = not UnitIsConnected(unit) if health.fillInverted then health:SetReverseFill(true) end - if health.fillReverse then - health:SetMinMaxValues(max, 0) - else - health:SetMinMaxValues(0, max) - end + + health:SetMinMaxValues(0, max) if(disconnected) then health:SetValue(max) @@ -119,22 +35,32 @@ local Update = function(self, event, unit) updateFrequentUpdates(self) end - local r, g, b, t + local bg = health.bg; + local db = oUF.SVConfigs; + local r, g, b, t, t2; + if(health.colorTapping and not UnitPlayerControlled(unit) and UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit) and not UnitIsTappedByAllThreatList(unit)) then - t = self.colors.tapped + t = oUF.colors.tapped elseif(health.colorDisconnected and not UnitIsConnected(unit)) then - t = self.colors.disconnected + t = oUF.colors.disconnected elseif(health.colorClass and UnitIsPlayer(unit)) or (health.colorClassNPC and not UnitIsPlayer(unit)) or (health.colorClassPet and UnitPlayerControlled(unit) and not UnitIsPlayer(unit)) then local _, class = UnitClass(unit) - t = self.colors.class[class] + local tmp = oUF.colors.class[class] or oUF.colors.health + t = {(tmp[1] * 0.75),(tmp[2] * 0.75),(tmp[3] * 0.75)} + if(bg and (db and db.classbackdrop) and UnitIsPlayer(unit)) then + t2 = t + end elseif(health.colorReaction and UnitReaction(unit, 'player')) then - t = self.colors.reaction[UnitReaction(unit, "player")] + t = oUF.colors.reaction[UnitReaction(unit, "player")] + if(bg and (db and db.classbackdrop) and not UnitIsPlayer(unit) and UnitReaction(unit, "player")) then + t2 = t + end elseif(health.colorSmooth) then - r, g, b = self.ColorGradient(min, max, unpack(health.smoothGradient or self.colors.smooth)) + r, g, b = oUF.ColorGradient(min, max, unpack(health.smoothGradient or oUF.colors.smooth)) elseif(health.colorHealth) then - t = self.colors.health + t = oUF.colors.health end if(t) then @@ -142,20 +68,103 @@ local Update = function(self, event, unit) end if(b) then + if(db and db.healthclass == true and db.colorhealthbyvalue == true or db.colorhealthbyvalue and self.isForced and not(UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit))) then + r, g, b = self.ColorGradient(min,max,1,0,0,1,1,0,r,g,b) + end health:SetStatusBarColor(r, g, b) - local bg = health.bg - if(bg) then local mu = bg.multiplier or 1 + if(bg) then + local mu = bg.multiplier or 1 + if(t2) then + r, g, b = t2[1], t2[2], t2[3] + end bg:SetVertexColor(r * mu, g * mu, b * mu) end end - if(health.PostUpdate) then - return health:PostUpdate(unit, min, max) + if self.ResurrectIcon then + self.ResurrectIcon:SetAlpha(min == 0 and 1 or 0) + end + if self.isForced then + min = random(1,max) + health:SetValue(min) + end + if(db and db.gridMode) then + health:SetOrientation("VERTICAL") end end +local CustomUpdate = function(self, event, unit) + if(self.unit ~= unit) or not unit then return end + local health = self.Health + + local min, max = UnitHealth(unit), UnitHealthMax(unit) + local disconnected = not UnitIsConnected(unit) + local invisible = ((min == max) or UnitIsDeadOrGhost(unit) or disconnected); + local tapped = (UnitIsTapped(unit) and (not UnitIsTappedByPlayer(unit))); + + if health.fillInverted then + health:SetReverseFill(true) + end + + health:SetMinMaxValues(-max, 0) + health:SetValue(-min) + + health.disconnected = disconnected + + if health.frequentUpdates ~= health.__frequentUpdates then + health.__frequentUpdates = health.frequentUpdates + updateFrequentUpdates(self) + end + + local bg = health.bg; + local mu + if(max == 0) then + mu = 0 + else + mu = (min / max) + end + + if(invisible or not health.overlayAnimation) then + health.animation[1].anim:Stop() + health.animation[1]:SetAlpha(0) + end + + if(invisible) then + health:SetStatusBarColor(0.6,0.4,1,0.5) + health.animation[1]:SetVertexColor(0.8,0.3,1,0.4) + elseif(health.colorOverlay) then + local t = oUF_SuperVillain.colors.health + health:SetStatusBarColor(t[1], t[2], t[3], 0.9) + else + health:SetStatusBarColor(1, 0.25 * mu, 0, 0.85) + health.animation[1]:SetVertexColor(1, 0.1 * mu, 0, 0.5) + end + + if(bg) then + bg:SetVertexColor(0,0,0,0) + end + + if(health.overlayAnimation and not invisible) then + if(mu <= 0.25) then + health.animation[1]:SetAlpha(1) + health.animation[1].anim:Play() + else + health.animation[1].anim:Stop() + health.animation[1]:SetAlpha(0) + end + end + + if self.ResurrectIcon then + self.ResurrectIcon:SetAlpha(min == 0 and 1 or 0) + end + if self.isForced then + local current = random(1,max) + health:SetValue(-current) + end +end + local Path = function(self, ...) - return (self.Health.Override or Update) (self, ...) + return (self.Health.Override and CustomUpdate or Update) (self, ...) end local ForceUpdate = function(element) diff --git a/Interface/AddOns/SVUI/libs/oUF/elements/portraits.lua b/Interface/AddOns/SVUI/libs/oUF/elements/portraits.lua index c714be4..b4e7402 100644 --- a/Interface/AddOns/SVUI/libs/oUF/elements/portraits.lua +++ b/Interface/AddOns/SVUI/libs/oUF/elements/portraits.lua @@ -1,3 +1,8 @@ +--[[ Element: Portraits + + THIS FILE HEAVILY MODIFIED FOR USE WITH SUPERVILLAIN UI + +]] local parent, ns = ... local oUF = ns.oUF @@ -9,20 +14,48 @@ local Update = function(self, event, unit) if(portrait:IsObjectType'Model') then local guid = UnitGUID(unit) + local camera = portrait.UserCamDistance or 1 + local rotate = portrait.UserRotation if(not UnitExists(unit) or not UnitIsConnected(unit) or not UnitIsVisible(unit)) then - portrait:SetCamDistanceScale(0.25) + portrait:SetCamDistanceScale(1) portrait:SetPortraitZoom(0) - portrait:SetPosition(0,0,0.5) + portrait:SetPosition(4,-1,1) portrait:ClearModel() - portrait:SetModel('interface\\buttons\\talktomequestionmark.m2') + portrait:SetModel([[Spells\Monk_travelingmist_missile.m2]]) portrait.guid = nil + portrait:SetBackdropColor(0.25,0.25,0.25) + if portrait.UpdateColor then + portrait:UpdateColor(0.25,0.25,0.25) + end elseif(portrait.guid ~= guid or event == 'UNIT_MODEL_CHANGED') then - portrait:SetCamDistanceScale(1) + portrait:SetCamDistanceScale(camera) portrait:SetPortraitZoom(1) portrait:SetPosition(0,0,0) portrait:ClearModel() portrait:SetUnit(unit) portrait.guid = guid + + if(rotate and portrait:GetFacing() ~= rotate / 60) then + portrait:SetFacing(rotate / 60) + end + + local r, g, b, color = 0.25, 0.25, 0.25 + if not UnitIsPlayer(unit)then + color = self.colors.reaction[UnitReaction(unit,"player")] + if(color ~= nil) then + r,g,b = color[1], color[2], color[3] + end; + else + local _,unitClass = UnitClass(unit) + if unitClass then + color = self.colors.class[unitClass] + r,g,b = color[1], color[2], color[3] + end + end + portrait:SetBackdropColor(r,g,b) + if portrait.UpdateColor then + portrait:UpdateColor(r,g,b) + end end else SetPortraitTexture(portrait, unit) 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 c67e91b..ac98666 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 @@ -48,12 +48,12 @@ local Update = function(self, event, unit) texture:SetAlpha(1) texture:SetTexture(media[2]) texture:SetGradient("VERTICAL",0,0,1,0,1,0) - elseif(unit ~= "vehicle" and UnitIsTapped(unit) and (not UnitIsTappedByPlayer(unit))) then + elseif(unit ~= "player" and (unit ~= "vehicle" and (not UnitIsFriend(unit, "player")) and (not UnitIsPlayer(unit)) and UnitIsTapped(unit) and (not UnitIsTappedByPlayer(unit)))) then texture:SetAlpha(1) texture:SetTexture(media[3]) texture:SetGradient("VERTICAL",1,1,0,1,0,0) else - texture:SetAlpha(0) + texture:SetTexture(0,0,0,0) end end end diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_AuraWatch/oUF_AuraWatch.lua b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_AuraWatch/oUF_AuraWatch.lua index a647d98..b011926 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_AuraWatch/oUF_AuraWatch.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_AuraWatch/oUF_AuraWatch.lua @@ -231,7 +231,7 @@ end local found = {} local function Update(frame, event, unit) - if frame.unit ~= unit or not unit then return end + if frame.unit ~= unit or not unit then return end local watch = frame.AuraWatch local index, icons = 1, watch.watched local _, name, texture, count, duration, remaining, caster, key, icon, spellID diff --git a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_GPS/oUF_GPS.lua b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_GPS/oUF_GPS.lua index 07d3875..4ae34f1 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_GPS/oUF_GPS.lua +++ b/Interface/AddOns/SVUI/libs/oUF_Plugins/oUF_GPS/oUF_GPS.lua @@ -5,7 +5,7 @@ assert(oUF, 'oUF not loaded') local cos, sin, sqrt2, max, atan2, floor = math.cos, math.sin, math.sqrt(2), math.max, math.atan2, math.floor; local tinsert, tremove = table.insert, table.remove; local _FRAME, _GPS, _TRACKER, _SWITCH, _ARROW, _SPINNER, _TEXT, _HANDLER; -local spin, unit, angle, distance; +local spin, unit; local SuperVillain; do @@ -35,8 +35,8 @@ local Update = function(self, elapsed) if(_TRACKER:IsShown()) then _SWITCH:Hide() if(not SuperVillain) then SuperVillain = SVUI[1] end - distance, angle = SuperVillain:Triangulate("player", unit, true) - if not angle then + local distance, angle = SuperVillain:Triangulate("player", unit, true) + if((not distance) or (not angle)) then _TRACKER:Hide() _SWITCH:Show() else diff --git a/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua b/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua index 4540f70..2015717 100644 --- a/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua +++ b/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua @@ -38,7 +38,6 @@ GET ADDON DATA ]]-- local SuperVillain, L = unpack(select(2, ...)); local MOD = SuperVillain.SVBar; -local LibAB = LibStub("LibActionButton-1.0") local _G = getfenv(0); @@ -89,7 +88,7 @@ do local keyBindID, keyBindName, keyBindString; if bindType == "FLYOUT" then keyBindName = GetSpellInfo(bindTarget.spellID); - keyBindString = "SPELL " .. keyBindName; + keyBindString = ("SPELL %s"):format(keyBindName); Binder.button.name = keyBindName Binder.button.bindstring = keyBindString; GameTooltip:AddLine(L["Trigger"]) @@ -98,7 +97,7 @@ do elseif bindType == "SPELL" then keyBindID = SpellBook_GetSpellBookSlot(bindTarget) keyBindName = GetSpellBookItemName(keyBindID, SpellBookFrame.bookType); - keyBindString = "SPELL " .. keyBindName; + keyBindString = ("SPELL %s"):format(keyBindName); Binder.button.id = keyBindID Binder.button.name = keyBindName Binder.button.bindstring = keyBindString; @@ -111,7 +110,7 @@ do keyBindID = keyBindID + 36 end; keyBindName = GetMacroInfo(keyBindID) - keyBindString = "MACRO " .. keyBindName; + keyBindString = ("MACRO %s"):format(keyBindName); Binder.button.id = keyBindID Binder.button.name = keyBindName Binder.button.bindstring = keyBindString; @@ -123,8 +122,9 @@ do GameTooltip:AddLine(L["No bindings set."], .6, .6, .6) else GameTooltip:AddDoubleLine(L["Binding"], L["Key"], .6, .6, .6, .6, .6, .6) - for i = 1, #Binder.button.bindings do - GameTooltip:AddDoubleLine(L["Binding"]..i, Binder.button.bindings[i], 1, 1, 1) + for i = 1, #Binder.button.bindings do + local lineName = ("%s%d"):format(L["Binding"], i) + GameTooltip:AddDoubleLine(lineName, Binder.button.bindings[i], 1, 1, 1) end end; GameTooltip:Show() @@ -133,9 +133,10 @@ do keyBindName = bindTarget:GetName() if(not keyBindName) then return end; if ((not keyBindID) or (keyBindID < 1) or (keyBindID > (bindType == "STANCE" and 10 or 12))) then - keyBindString = "CLICK "..keyBindName..":LeftButton" + keyBindString = ("CLICK %s: LeftButton"):format(keyBindName); else - keyBindString = (bindType == "STANCE" and "StanceButton" or "BONUSACTIONBUTTON")..keyBindID + local tmpStr = bindType == "STANCE" and "StanceButton" or "BONUSACTIONBUTTON" + keyBindString = ("%s%d"):format(tmpStr, keyBindID); end; Binder.button.id = keyBindID Binder.button.name = keyBindName @@ -148,21 +149,21 @@ do keyBindName = bindTarget:GetName() if(not keyBindName) then return end; if(not bindTarget.keyBoundTarget and ((not keyBindID) or (keyBindID < 1) or (keyBindID > 132))) then - keyBindString = "CLICK "..keyBindName..":LeftButton" + keyBindString = ("CLICK %s: LeftButton"):format(keyBindName); elseif(bindTarget.keyBoundTarget) then keyBindString = bindTarget.keyBoundTarget else local slotID = 1 + (keyBindID - 1) % 12; if((keyBindID < 25) or (keyBindID > 72)) then - keyBindString = "ACTIONBUTTON"..slotID; + keyBindString = ("ACTIONBUTTON%s"):format(slotID); elseif((keyBindID < 73) and (keyBindID > 60)) then - keyBindString = "MULTIACTIONBAR1BUTTON"..slotID; + keyBindString = ("MULTIACTIONBAR1BUTTON%s"):format(slotID); elseif(keyBindID < 61 and keyBindID > 48) then - keyBindString = "MULTIACTIONBAR2BUTTON"..slotID; + keyBindString = ("MULTIACTIONBAR2BUTTON%s"):format(slotID); elseif(keyBindID < 49 and keyBindID > 36) then - keyBindString = "MULTIACTIONBAR4BUTTON"..slotID; + keyBindString = ("MULTIACTIONBAR4BUTTON%s"):format(slotID); elseif(keyBindID < 37 and keyBindID > 24) then - keyBindString = "MULTIACTIONBAR3BUTTON"..slotID; + keyBindString = ("MULTIACTIONBAR3BUTTON%s"):format(slotID); end end; Binder.button.action = keyBindID @@ -280,7 +281,9 @@ local Binder_OnBinding = function(self, event) for i=1, count do SetBinding(Binder.button.bindings[i]) end; - SuperVillain:AddonMessage(format(L["All keybindings cleared for |cff00ff00%s|r."], Binder.button.name)) + local prefix = L["All keybindings cleared for |cff00ff00%s|r."] + local strMsg = prefix:format(Binder.button.name) + SuperVillain:AddonMessage(strMsg) RefreshBindings(Binder.button, Binder.spellmacro) if(Binder.spellmacro ~= "MACRO") then GameTooltip:Hide() @@ -299,17 +302,21 @@ local Binder_OnBinding = function(self, event) local altText = IsAltKeyDown() and "ALT-" or ""; local ctrlText = IsControlKeyDown() and "CTRL-" or ""; local shiftText = IsShiftKeyDown() and "SHIFT-" or ""; + local strBind = ("%s%s%s%s"):format(altText, ctrlText, shiftText, event) if(not Binder.spellmacro or Binder.spellmacro == "PET" or Binder.spellmacro == "STANCE" or Binder.spellmacro == "FLYOUT") then - SetBinding(altText..ctrlText..shiftText..event, Binder.button.bindstring) - else - SetBinding(altText..ctrlText..shiftText..event, Binder.spellmacro.." "..Binder.button.name) + SetBinding(strBind, Binder.button.bindstring) + else + local strMacro = ("%s %s"):format(Binder.spellmacro, Binder.button.name) + SetBinding(strBind, strMacro) end; - SuperVillain:AddonMessage(altText..ctrlText..shiftText..event..L[" |cff00ff00bound to |r"]..Binder.button.name..".") + local glue = L[" |cff00ff00bound to |r"] + local addMsg = ("%s%s%s."):format(strBind, glue, Binder.button.name) + SuperVillain:AddonMessage(addMsg) RefreshBindings(Binder.button, Binder.spellmacro) - if Binder.spellmacro~="MACRO" then + if Binder.spellmacro ~= "MACRO" then GameTooltip:Hide() end end; @@ -324,8 +331,9 @@ end; local SetBindingMacro = function(self, arg) if(arg == "Blizzard_MacroUI") then - for i=1,36 do - local btn = _G["MacroButton"..i] + for i=1,36 do + local btnName = ("MacroButton%d"):format(i) + local btn = _G[btnName] btn:HookScript("OnEnter", MacroBinding_OnEnter) end end @@ -383,8 +391,9 @@ local function RefreshAllFlyouts() local id = GetFlyoutID(i) local _,_,numSlots,isKnown = GetFlyoutInfo(id) if isKnown then - for x = 1, numSlots do - local btn = _G["SpellFlyoutButton"..x] + for x = 1, numSlots do + local btnName = ("SpellFlyoutButton%d"):format(x) + local btn = _G[btnName] if(SpellFlyout:IsShown() and btn and btn:IsShown()) then if(not btn.hookedFlyout) then btn:HookScript("OnEnter", Flyout_Proxy) @@ -426,22 +435,24 @@ function MOD:LoadKeyBinder() OBJECT = EnumerateFrames(OBJECT) end; - for OBJECT, _ in pairs(self.Storage.Cache)do + for OBJECT, _ in pairs(self.ButtonCache)do if(OBJECT.IsProtected and OBJECT:IsProtected() and OBJECT.GetObjectType and OBJECT:GetObjectType() == "CheckButton" and OBJECT.GetScript) then SetBindingButton(OBJECT, true) end end; - for l = 1, 12 do - local spellButton = _G["SpellButton"..l] + for i = 1, 12 do + local btnName = ("SpellButton%d"):format(i) + local spellButton = _G[btnName] spellButton:HookScript("OnEnter", SpellButton_OnEnter) end; if not IsAddOnLoaded("Blizzard_MacroUI")then NewHook("LoadAddOn", SetBindingMacro) else - for i=1,36 do - local btn = _G["MacroButton"..i] + for i=1,36 do + local btnName = ("MacroButton%d"):format(i) + local btn = _G[btnName] btn:HookScript("OnEnter", Macro_Proxy) end end; diff --git a/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua b/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua index 8a3d56e..9442ad0 100644 --- a/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua +++ b/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua @@ -33,207 +33,19 @@ local ceil = math.ceil; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SuperVillain, L, G, CONFIGS = unpack(select(2, ...)); local MOD = {}; -local LibAB = LibStub("LibActionButton-1.0"); -local NUM_ACTIONBAR_BUTTONS = NUM_ACTIONBAR_BUTTONS - -MOD.Storage = {}; -MOD.Storage["Cache"] = {}; -MOD.Storage["Bar1"] = {}; -MOD.Storage["Bar1"]["bar"] = {}; -MOD.Storage["Bar1"]["buttons"] = {}; -MOD.Storage["Bar1"]["config"] = { - outOfRangeColoring = "button", - tooltip = "enable", - showGrid = true, - colors = { - range = {0.8, 0.1, 0.1}, - mana = {0.5, 0.5, 1.0}, - hp = {0.5, 0.5, 1.0} - }, - hideElements = { - macro = false, - hotkey = false, - equipped = false - }, - keyBoundTarget = false, - clickOnDown = false -} -MOD.Storage["Bar2"] = {}; -MOD.Storage["Bar2"]["bar"] = {}; -MOD.Storage["Bar2"]["buttons"] = {}; -MOD.Storage["Bar2"]["config"] = { - outOfRangeColoring = "button", - tooltip = "enable", - showGrid = true, - colors = { - range = {0.8, 0.1, 0.1}, - mana = {0.5, 0.5, 1.0}, - hp = {0.5, 0.5, 1.0} - }, - hideElements = { - macro = false, - hotkey = false, - equipped = false - }, - keyBoundTarget = false, - clickOnDown = false -} -MOD.Storage["Bar3"] = {}; -MOD.Storage["Bar3"]["bar"] = {}; -MOD.Storage["Bar3"]["buttons"] = {}; -MOD.Storage["Bar3"]["config"] = { - outOfRangeColoring = "button", - tooltip = "enable", - showGrid = true, - colors = { - range = {0.8, 0.1, 0.1}, - mana = {0.5, 0.5, 1.0}, - hp = {0.5, 0.5, 1.0} - }, - hideElements = { - macro = false, - hotkey = false, - equipped = false - }, - keyBoundTarget = false, - clickOnDown = false -} -MOD.Storage["Bar4"] = {}; -MOD.Storage["Bar4"]["bar"] = {}; -MOD.Storage["Bar4"]["buttons"] = {}; -MOD.Storage["Bar4"]["config"] = { - outOfRangeColoring = "button", - tooltip = "enable", - showGrid = true, - colors = { - range = {0.8, 0.1, 0.1}, - mana = {0.5, 0.5, 1.0}, - hp = {0.5, 0.5, 1.0} - }, - hideElements = { - macro = false, - hotkey = false, - equipped = false - }, - keyBoundTarget = false, - clickOnDown = false -} -MOD.Storage["Bar5"] = {}; -MOD.Storage["Bar5"]["bar"] = {}; -MOD.Storage["Bar5"]["buttons"] = {}; -MOD.Storage["Bar5"]["config"] = { - outOfRangeColoring = "button", - tooltip = "enable", - showGrid = true, - colors = { - range = {0.8, 0.1, 0.1}, - mana = {0.5, 0.5, 1.0}, - hp = {0.5, 0.5, 1.0} - }, - hideElements = { - macro = false, - hotkey = false, - equipped = false - }, - keyBoundTarget = false, - clickOnDown = false -} -MOD.Storage["Bar6"] = {}; -MOD.Storage["Bar6"]["bar"] = {}; -MOD.Storage["Bar6"]["buttons"] = {}; -MOD.Storage["Bar6"]["config"] = { - outOfRangeColoring = "button", - tooltip = "enable", - showGrid = true, - colors = { - range = {0.8, 0.1, 0.1}, - mana = {0.5, 0.5, 1.0}, - hp = {0.5, 0.5, 1.0} - }, - hideElements = { - macro = false, - hotkey = false, - equipped = false - }, - keyBoundTarget = false, - clickOnDown = false -} -MOD.Storage["Pet"] = {}; -MOD.Storage["Pet"]["bar"] = {}; -MOD.Storage["Pet"]["buttons"] = {}; -MOD.Storage["Pet"]["config"] = { - outOfRangeColoring = "button", - tooltip = "enable", - showGrid = true, - colors = { - range = {0.8, 0.1, 0.1}, - mana = {0.5, 0.5, 1.0}, - hp = {0.5, 0.5, 1.0} - }, - hideElements = { - macro = false, - hotkey = false, - equipped = false - }, - keyBoundTarget = false, - clickOnDown = false -} -MOD.Storage["Stance"] = {}; -MOD.Storage["Stance"]["bar"] = {}; -MOD.Storage["Stance"]["buttons"] = {}; -MOD.Storage["Stance"]["binding"] = "CLICK SVUI_StanceBarButton%d:LeftButton" -MOD.Storage["Stance"]["config"] = { - outOfRangeColoring = "button", - tooltip = "enable", - showGrid = true, - colors = { - range = {0.8, 0.1, 0.1}, - mana = {0.5, 0.5, 1.0}, - hp = {0.5, 0.5, 1.0} - }, - hideElements = { - macro = false, - hotkey = false, - equipped = false - }, - keyBoundTarget = false, - clickOnDown = false -} - -MOD.Storage['Bar1']["binding"] = "ACTIONBUTTON%d" -MOD.Storage['Bar2']["binding"] = "MULTIACTIONBAR2BUTTON%d" -MOD.Storage['Bar3']["binding"] = "MULTIACTIONBAR1BUTTON%d" -MOD.Storage['Bar4']["binding"] = "MULTIACTIONBAR4BUTTON%d" -MOD.Storage['Bar5']["binding"] = "MULTIACTIONBAR3BUTTON%d" -MOD.Storage['Bar6']["binding"] = "SVUIACTIONBAR6BUTTON%d" -MOD.Storage['Pet']["binding"] = "BONUSACTIONBUTTON%d" -MOD.Storage['Stance']["binding"] = "CLICK SVUI_StanceBarButton%d:LeftButton" - -MOD.Storage['Bar1']["page"] = 1 -MOD.Storage['Bar2']["page"] = 5 -MOD.Storage['Bar3']["page"] = 6 -MOD.Storage['Bar4']["page"] = 4 -MOD.Storage['Bar5']["page"] = 3 -MOD.Storage['Bar6']["page"] = 2 - -MOD.Storage['Bar1']["conditions"] = "" -MOD.Storage['Bar2']["conditions"] = "" -MOD.Storage['Bar3']["conditions"] = "" -MOD.Storage['Bar4']["conditions"] = "" -MOD.Storage['Bar5']["conditions"] = "" -MOD.Storage['Bar6']["conditions"] = "" +MOD.ButtonCache = {}; --[[ ########################################################## LOCAL VARS ########################################################## ]]-- -local maxFlyoutCount = 0; -local CLEANFONT = SuperVillain.Media.font.roboto; -local SetSpellFlyoutHook; -local NewFrame = CreateFrame; -local NewHook = hooksecurefunc; +local maxFlyoutCount = 0 +local SetSpellFlyoutHook +local NewFrame = CreateFrame +local NewHook = hooksecurefunc +local NUM_ACTIONBAR_BUTTONS = NUM_ACTIONBAR_BUTTONS local ICON_FILE = [[Interface\AddOns\SVUI\assets\artwork\Icons\MICROMENU]] local ICON_DATA = { {"CharacterMicroButton",0,0.25,0,0.25}, -- MICRO-CHARACTER @@ -249,22 +61,40 @@ local ICON_DATA = { {"CompanionsMicroButton",0.5,0.75,0.5,0.75},-- MICRO-COMPANION {"MainMenuMicroButton",0.75,1,0.5,0.75}, -- MICRO-SYSTEM {"HelpMicroButton",0,0.25,0.75,1}, -- MICRO-HELP -}; +} --[[ ########################################################## LOCAL FUNCTIONS ########################################################## ]]-- -local Bar_OnEnter = function(self) - if(self._fade) then - SuperVillain:SecureFadeIn(self, 0.2, self:GetAlpha(), self._alpha) - end -end +local LibAB = LibStub("LibActionButton-1.0"); -local Bar_OnLeave = function(self) - if(self._fade) then - SuperVillain:SecureFadeOut(self, 1, self:GetAlpha(), 0) - end +local function NewActionBar(barName) + local bar = CreateFrame("Frame", barName, SuperVillain.UIParent, "SecureHandlerStateTemplate") + bar.buttons = {} + bar.conditions = "" + bar.config = { + outOfRangeColoring = "button", + tooltip = "enable", + showGrid = true, + colors = { + range = {0.8, 0.1, 0.1}, + mana = {0.5, 0.5, 1.0}, + hp = {0.5, 0.5, 1.0} + }, + hideElements = { + macro = false, + hotkey = false, + equipped = false + }, + keyBoundTarget = false, + clickOnDown = false + } + return bar +end + +local function NewActionButton(parent, index, name) + return LibAB:CreateButton(index, name, parent, nil) end local function RefreshMicrobar() @@ -289,8 +119,20 @@ local function RefreshMicrobar() lastParent = button; button:Show() end +end + +local Bar_OnEnter = function(self) + if(self._fade) then + SuperVillain:SecureFadeIn(self, 0.2, self:GetAlpha(), self._alpha) + end end +local Bar_OnLeave = function(self) + if(self._fade) then + SuperVillain:SecureFadeOut(self, 1, self:GetAlpha(), 0) + end +end + local SVUIMicroButton_SetNormal = function() local level = MainMenuMicroButton:GetFrameLevel() if(level > 0) then @@ -413,9 +255,9 @@ local function SaveActionButton(parent) local cooldown = _G[button.."Cooldown"] cooldown.SizeOverride = MOD.db.cooldownSize MOD:FixKeybindText(parent) - if not MOD.Storage.Cache[parent] then + if not MOD.ButtonCache[parent] then SuperVillain:AddCD(cooldown) - MOD.Storage.Cache[parent] = true + MOD.ButtonCache[parent] = true end parent:SetSlotTemplate(true, 2, 0, 0) end @@ -500,15 +342,15 @@ local function ModifyActionButton(parent) checked:SetTexture(1,1,1,.2) end if flash then - flash:SetTexture(nil) + flash:SetTexture(0,0,0,0) end if normal then - normal:SetTexture(nil) + normal:SetTexture(0,0,0,0) normal:Hide() normal:SetAlpha(0) end if parentTex then - parentTex:SetTexture(nil) + parentTex:SetTexture(0,0,0,0) parentTex:Hide() parentTex:SetAlpha(0) end @@ -544,7 +386,7 @@ do local SpellFlyoutButton_OnEnter = function(self) local parent = self:GetParent() local anchor = select(2, parent:GetPoint()) - if not MOD.Storage.Cache[anchor] then return end + if not MOD.ButtonCache[anchor] then return end local anchorParent = anchor:GetParent() if anchorParent._fade then local alpha = anchorParent._alpha @@ -556,7 +398,7 @@ do local SpellFlyoutButton_OnLeave = function(self) local parent = self:GetParent() local anchor = select(2, parent:GetPoint()) - if not MOD.Storage.Cache[anchor] then return end + if not MOD.ButtonCache[anchor] then return end local anchorParent = anchor:GetParent() if anchorParent._fade then local actual = anchorParent:GetAlpha() @@ -566,7 +408,7 @@ do local SpellFlyout_OnEnter = function(self) local anchor = select(2,self:GetPoint()) - if not MOD.Storage.Cache[anchor] then return end + if not MOD.ButtonCache[anchor] then return end local anchorParent = anchor:GetParent() if anchorParent._fade then Bar_OnEnter(anchorParent) @@ -575,7 +417,7 @@ do local SpellFlyout_OnLeave = function(self) local anchor = select(2, self:GetPoint()) - if not MOD.Storage.Cache[anchor] then return end + if not MOD.ButtonCache[anchor] then return end local anchorParent=anchor:GetParent() if anchorParent._fade then Bar_OnLeave(anchorParent) @@ -601,7 +443,7 @@ do local QualifyFlyouts = function() if InCombatLockdown() then return end - for button,_ in pairs(MOD.Storage.Cache)do + for button,_ in pairs(MOD.ButtonCache)do if(button and button.FlyoutArrow) then SetFlyoutButton(button) end @@ -618,10 +460,11 @@ end CORE FUNCTIONS ########################################################## ]]-- -function MOD:UpdateBarBindings(pet,stance) +function MOD:UpdateBarBindings(pet, stance) if stance == true then - local preset = self.Storage['Stance']; - local bindText = preset.binding; + local bar = _G["SVUI_StanceBar"] + local bindText = bar.binding + for i=1,NUM_STANCE_SLOTS do local name = ("SVUI_StanceBarButton%s"):format(i) local hkname = ("SVUI_StanceBarButton%sHotKey"):format(i) @@ -638,8 +481,9 @@ function MOD:UpdateBarBindings(pet,stance) end end if pet == true then - local preset = self.Storage['Pet']; - local bindText = preset.binding; + local bar = _G["SVUI_PetActionBar"] + local bindText = bar.binding + for i=1,NUM_PET_ACTION_SLOTS do local name = ("PetActionButton%s"):format(i) local hkname = ("PetActionButton%sHotKey"):format(i) @@ -662,51 +506,52 @@ function MOD:UpdateAllBindings(event) MOD:UpdateBarBindings(true,true) end MOD:UnregisterEvent("PLAYER_REGEN_DISABLED") - if InCombatLockdown()then return end - for barID,stored in pairs(MOD.Storage)do - if (type(stored) == "table" and (barID ~= "Pet" and barID ~= "Stance" and barID ~= "Cache")) then - local bar = stored.bar; - local buttons = stored.buttons; - if not bar or not buttons then return end - ClearOverrideBindings(bar); - local nameMod = bar:GetName(); - local thisBinding = stored.binding; - for i=1,#buttons do - local binding = thisBinding:format(i); - local btn = ("%sButton%d"):format(nameMod,i); - for x=1,select('#',GetBindingKey(binding)) do - local key = select(x,GetBindingKey(binding)) + if InCombatLockdown() then return end + for i = 1, 6 do + local barName = ("SVUI_ActionBar%d"):format(i) + local bar = _G[barName] + if(bar and bar.buttons) then + local thisBinding = bar.binding + + ClearOverrideBindings(bar) + + for k = 1,#bar.buttons do + local binding = thisBinding:format(k); + local btn = ("%sButton%d"):format(barName, k); + for x = 1,select('#',GetBindingKey(binding)) do + local key = select(x, GetBindingKey(binding)) if (key and key ~= "") then - SetOverrideBindingClick(bar,false,key,btn) + SetOverrideBindingClick(bar, false, key, btn) end end - end + end end end end -function MOD:SetBarConfigData(barID) - local data = self.Storage[barID] - local thisBinding = data.binding; - local buttonList = data.buttons; - data.config.hideElements.macro = self.db.macrotext; - data.config.hideElements.hotkey = self.db.hotkeytext; - data.config.showGrid = self.db.showGrid; - data.config.clickOnDown = self.db.keyDown; - data.config.colors.range = self.db.unc - data.config.colors.mana = self.db.unpc - data.config.colors.hp = self.db.unpc - SetModifiedClick("PICKUPACTION", self.db.unlock) +function MOD:SetBarConfigData(bar) + local db = self.db + local thisBinding = bar.binding; + local buttonList = bar.buttons; + local config = bar.config + config.hideElements.macro = db.macrotext; + config.hideElements.hotkey = db.hotkeytext; + config.showGrid = db.showGrid; + config.clickOnDown = db.keyDown; + config.colors.range = db.unc + config.colors.mana = db.unpc + config.colors.hp = db.unpc + SetModifiedClick("PICKUPACTION", db.unlock) for i,button in pairs(buttonList)do if thisBinding then - data.config.keyBoundTarget = thisBinding:format(i) + config.keyBoundTarget = thisBinding:format(i) end - button.keyBoundTarget = data.config.keyBoundTarget; + button.keyBoundTarget = config.keyBoundTarget; button.postKeybind = self.FixKeybindText; button:SetAttribute("buttonlock",true) button:SetAttribute("checkselfcast",true) button:SetAttribute("checkfocuscast",true) - button:UpdateConfig(data.config) + button:UpdateConfig(config) end end @@ -716,19 +561,24 @@ function MOD:UpdateBarPagingDefaults() parse = "[vehicleui,mod:alt,mod:ctrl] %d; [possessbar] %d; [overridebar] %d; [form,noform] 0; [shapeshift] 13; [bar:3] 3; [bar:4] 4; [bar:5] 5; [bar:6] 6; %s"; else parse = "[vehicleui,mod:alt,mod:ctrl] %d; [possessbar] %d; [overridebar] %d; [form,noform] 0; [shapeshift] 13; [bar:2] 2; [bar:3] 3; [bar:4] 4; [bar:5] 5; [bar:6] 6; %s"; - end - if self.db.Bar1.useCustomPaging then - custom = self.db.Bar1.customPaging[SuperVillain.class]; - else - custom = "" end + + local mainbar = _G["SVUI_ActionBar1"] + if(mainbar) then + if self.db.Bar1.useCustomPaging then + custom = self.db.Bar1.customPaging[SuperVillain.class]; + else + custom = "" + end - self.Storage['Bar1'].conditions = parse:format(GetVehicleBarIndex(), GetVehicleBarIndex(), GetOverrideBarIndex(), custom); + mainbar.conditions = parse:format(GetVehicleBarIndex(), GetVehicleBarIndex(), GetOverrideBarIndex(), custom); + end for i=2, 6 do local id = ("Bar%d"):format(i) - if self.db[id].useCustomPaging then - self.Storage[id].conditions = self.db[id].customPaging[SuperVillain.class]; + local bar = _G["SVUI_Action" .. id] + if(bar and self.db[id].useCustomPaging) then + bar.conditions = self.db[id].customPaging[SuperVillain.class]; end end @@ -796,9 +646,9 @@ do local isStance = id == "Stance" and true or false; local button,lastButton,lastRow; for i=1, max do - button = MOD.Storage[id].buttons[i] - lastButton = MOD.Storage[id].buttons[i - 1] - lastRow = MOD.Storage[id].buttons[i - cols] + button = bar.buttons[i] + lastButton = bar.buttons[i - 1] + lastRow = bar.buttons[i - cols] button:SetParent(bar) button:ClearAllPoints() button:Size(size) @@ -887,24 +737,37 @@ do end function MOD:RefreshBar(id) - if(InCombatLockdown() or (not self.Storage[id] or not self.Storage[id].bar or not self.db[id])) then return end - local db = self.db[id]; - local data = self.Storage[id] - local selfcast = self.db.rightClickSelf - local bar = data.bar; + if(InCombatLockdown()) then return end + + local bar + local isPet, isStance = false, false + local db = self.db[id] + + if(id == "Pet") then + bar = _G["SVUI_PetActionBar"] + isPet = true + elseif(id == "Stance") then + bar = _G["SVUI_StanceBar"] + isStance = true + else + bar = _G[("SVUI_Action%s"):format(id)] + end + + if(not bar or not db) then return end + + local selfcast = db.rightClickSelf local space = db.buttonspacing; local cols = db.buttonsPerRow; local size = db.buttonsize; local point = db.point; local barVisibility = db.customVisibility; - local isPet = id == "Pet" and true or false; - local isStance = id == "Stance" and true or false; local totalButtons = db.buttons; - local max = isStance and GetNumShapeshiftForms() or totalButtons; + local max = (isStance and GetNumShapeshiftForms()) or (isPet and 10) or NUM_ACTIONBAR_BUTTONS; local rows = ceil(max / cols); if max < cols then cols = max end - if rows < 1 then rows = 1 end + if rows < 1 then rows = 1 end + bar:Width(space + (size * cols) + ((space * (cols - 1)) + space)); bar:Height((space + (size * rows)) + ((space * (rows - 1)) + space)); bar.backdrop:ClearAllPoints() @@ -951,7 +814,7 @@ do end --RegisterStateDriver(bar, "show", barVisibility) else - local p,c = data.page, data.conditions + local p,c = bar.page, bar.conditions local page = _getPage(id, p, c) if c:find("[form, noform]") then bar:SetAttribute("hasTempBar", true) @@ -983,7 +846,7 @@ end function MOD:RefreshActionBars() if(InCombatLockdown()) then self:RegisterEvent("PLAYER_REGEN_ENABLED"); return end self:UpdateBarPagingDefaults() - for button, _ in pairs(self.Storage.Cache)do + for button, _ in pairs(self.ButtonCache)do if button then ModifyActionButton(button) SaveActionButton(button) @@ -991,29 +854,29 @@ function MOD:RefreshActionBars() SetFlyoutButton(button) end else - self.Storage.Cache[button] = nil + self.ButtonCache[button] = nil end - end + end + + local id, bar for i = 1, 6 do - local id = ("Bar%d"):format(i) + id = ("Bar%d"):format(i) + bar = _G[("SVUI_Action%s"):format(id)] self:RefreshBar(id) - end + self:SetBarConfigData(bar) + end + self:RefreshBar("Pet") self:RefreshBar("Stance") self:UpdateBarBindings(true, true) - for barID, stored in pairs(self.Storage)do - if(barID ~= "Pet" and barID ~= "Stance" and barID ~= "Cache") then - self:SetBarConfigData(barID) - end - end end local Vehicle_Updater = function() - local bar = MOD.Storage["Bar1"].bar - local space = SuperVillain:Scale(MOD.db["Bar1"].buttonspacing) + local bar = _G["SVUI_ActionBar1"] + local space = MOD.db["Bar1"].buttonspacing local total = MOD.db["Bar1"].buttons; local rows = MOD.db["Bar1"].buttonsPerRow; - local size = SuperVillain:Scale(MOD.db["Bar1"].buttonsize) + local size = MOD.db["Bar1"].buttonsize local point = MOD.db["Bar1"].point; local columns = ceil(total / rows) if (HasOverrideActionBar() or HasVehicleActionBar()) and total == 12 then @@ -1051,12 +914,19 @@ local SVUIButton_ShowOverlayGlow = function(self) end local ResetAllBindings = function(self) - if InCombatLockdown()then return end - for barID,stored in pairs(self.Storage)do - local bar = stored.bar; - if not bar then return end - ClearOverrideBindings(bar); - end + if InCombatLockdown() then return end + + local bar + for i = 1, 6 do + bar = _G[("SVUI_ActionBar%d"):format(i)] + if(bar) then + ClearOverrideBindings(bar) + end + end + + ClearOverrideBindings(_G["SVUI_PetActionBar"]) + ClearOverrideBindings(_G["SVUI_StanceBar"]) + self:RegisterEvent("PLAYER_REGEN_DISABLED", "UpdateAllBindings") end --[[ @@ -1065,6 +935,15 @@ BAR CREATION ########################################################## ]]-- local CreateActionBars, CreateStanceBar, CreatePetBar, CreateMicroBar; +local barBindingIndex = { + "ACTIONBUTTON%d", + "MULTIACTIONBAR2BUTTON%d", + "MULTIACTIONBAR1BUTTON%d", + "MULTIACTIONBAR4BUTTON%d", + "MULTIACTIONBAR3BUTTON%d", + "SVUIACTIONBAR6BUTTON%d" +} +local barPageIndex = {1, 5, 6, 4, 3, 2} CreateActionBars = function(self) for i = 1, 6 do @@ -1072,7 +951,9 @@ CreateActionBars = function(self) local barName = ("SVUI_Action%s"):format(barID) local buttonMax = NUM_ACTIONBAR_BUTTONS - local thisBar = CreateFrame("Frame", barName, SuperVillain.UIParent, "SecureHandlerStateTemplate") + local thisBar = NewActionBar(barName) + thisBar.binding = barBindingIndex[i] + thisBar.page = barPageIndex[i] if(i == 1) then thisBar:Point("BOTTOM", SuperVillain.UIParent, "BOTTOM", 0, 28) @@ -1096,18 +977,16 @@ CreateActionBars = function(self) bg:SetPanelColor("dark") thisBar.backdrop = bg - self.Storage[barID].buttons = {} - for k = 1, buttonMax do local buttonName = ("%sButton%d"):format(barName, k) - self.Storage[barID].buttons[k] = LibAB:CreateButton(k, buttonName, thisBar, nil) - self.Storage[barID].buttons[k]:SetState(0, "action", k) + thisBar.buttons[k] = NewActionButton(thisBar, k, buttonName) + thisBar.buttons[k]:SetState(0, "action", k) for x = 1, 14 do local calc = (x - 1) * buttonMax + k; - self.Storage[barID].buttons[k]:SetState(x, "action", calc) + thisBar.buttons[k]:SetState(x, "action", calc) end; if k == 12 then - self.Storage[barID].buttons[k]:SetState(12, "custom", { + thisBar.buttons[k]:SetState(12, "custom", { func = function(...) if UnitExists("vehicle") then VehicleExit() @@ -1119,13 +998,16 @@ CreateActionBars = function(self) tooltip = LEAVE_VEHICLE }); end - end; - self:SetBarConfigData(barID) + end + + self:SetBarConfigData(thisBar) + if i == 1 then thisBar:SetAttribute("hasTempBar", true) else thisBar:SetAttribute("hasTempBar", false) - end; + end + thisBar:SetAttribute("_onstate-page", [[ if HasTempShapeshiftActionBar() and self:GetAttribute("hasTempBar") then newstate = GetTempShapeshiftBarIndex() or newstate @@ -1142,8 +1024,8 @@ CreateActionBars = function(self) control:ChildUpdate("state", newstate) end end - ]]); - self.Storage[barID].bar = thisBar; + ]]) + self:RefreshBar(barID) SuperVillain:SetSVMovable(thisBar, L[barID], nil, nil, nil, "ALL, ACTIONBARS") end @@ -1206,35 +1088,41 @@ do local function UpdateShapeshiftForms(self, event) if InCombatLockdown() or not _G["SVUI_StanceBar"] then return end - local bar = _G["SVUI_StanceBar"]; - for i = 1, #MOD.Storage["Stance"].buttons do - MOD.Storage["Stance"].buttons[i]:Hide() + + local stanceBar = _G["SVUI_StanceBar"]; + + for i = 1, #stanceBar.buttons do + stanceBar.buttons[i]:Hide() end + local ready = false; local maxForms = GetNumShapeshiftForms() + for i = 1, NUM_STANCE_SLOTS do - if not MOD.Storage["Stance"].buttons[i]then - MOD.Storage["Stance"].buttons[i] = CreateFrame("CheckButton", format("SVUI_StanceBarButton%d", i), bar, "StanceButtonTemplate") - MOD.Storage["Stance"].buttons[i]:SetID(i) + if(not stanceBar.buttons[i]) then + stanceBar.buttons[i] = CreateFrame("CheckButton", format("SVUI_StanceBarButton%d", i), stanceBar, "StanceButtonTemplate") + stanceBar.buttons[i]:SetID(i) ready = true end - if i <= maxForms then - MOD.Storage["Stance"].buttons[i]:Show() + if(i <= maxForms) then + stanceBar.buttons[i]:Show() else - MOD.Storage["Stance"].buttons[i]:Hide() + stanceBar.buttons[i]:Hide() end end + MOD:RefreshBar("Stance") + if event == "UPDATE_SHAPESHIFT_FORMS" then SetStanceBarButtons() end if not C_PetBattles.IsInBattle() or ready then if maxForms == 0 then - UnregisterStateDriver(bar, "show") - bar:Hide() + UnregisterStateDriver(stanceBar, "show") + stanceBar:Hide() else - bar:Show() - RegisterStateDriver(bar, "show", "[petbattle] hide;show") + stanceBar:Show() + RegisterStateDriver(stanceBar, "show", "[petbattle] hide;show") end end end @@ -1256,19 +1144,25 @@ do local maxForms = GetNumShapeshiftForms(); if self.db["Bar2"].enable then parent = _G["SVUI_ActionBar2"] - end - local stanceBar = CreateFrame("Frame", "SVUI_StanceBar", SuperVillain.UIParent, "SecureHandlerStateTemplate") + end + + local stanceBar = NewActionBar("SVUI_StanceBar") + stanceBar.binding = "CLICK SVUI_StanceBarButton%d:LeftButton" + stanceBar:Point("BOTTOMRIGHT",parent,"TOPRIGHT",0,2); stanceBar:SetFrameLevel(5); + local bg = CreateFrame("Frame", nil, stanceBar) bg:SetAllPoints(); bg:SetFrameLevel(0); bg:SetPanelTemplate("Component") bg:SetPanelColor("dark") stanceBar.backdrop = bg; + for i = 1, NUM_STANCE_SLOTS do - self.Storage[barID].buttons[i] = _G["SVUI_StanceBarButton"..i] + stanceBar.buttons[i] = _G["SVUI_StanceBarButton"..i] end + stanceBar:SetAttribute("_onstate-show", [[ if newstate == "hide" then self:Hide(); @@ -1276,7 +1170,7 @@ do self:Show(); end ]]); - self.Storage[barID].bar = stanceBar; + self:RegisterEvent("UPDATE_SHAPESHIFT_FORMS", UpdateShapeshiftForms) self:RegisterEvent("UPDATE_SHAPESHIFT_COOLDOWN", UpdateShapeshiftCD) self:RegisterEvent("UPDATE_SHAPESHIFT_USABLE", SetStanceBarButtons) @@ -1361,8 +1255,11 @@ do local parent = _G["SVUI_ActionBar1"] if self.db["Bar2"].enable then parent = _G["SVUI_ActionBar2"] - end - local petBar = CreateFrame("Frame", "SVUI_PetActionBar", SuperVillain.UIParent, "SecureHandlerStateTemplate") + end + + local petBar = NewActionBar("SVUI_PetActionBar") + petBar.binding = "BONUSACTIONBUTTON%d" + petBar:Point("BOTTOMLEFT",parent,"TOPLEFT",0,2); petBar:SetFrameLevel(5); local bg = CreateFrame("Frame", nil, petBar) @@ -1372,7 +1269,7 @@ do bg:SetPanelColor("dark") petBar.backdrop = bg; for i = 1, NUM_PET_ACTION_SLOTS do - self.Storage[barID].buttons[i] = _G["PetActionButton"..i] + petBar.buttons[i] = _G["PetActionButton"..i] end petBar:SetAttribute("_onstate-show", [[ if newstate == "hide" then @@ -1381,11 +1278,13 @@ do self:Show(); end ]]); - self.Storage[barID].bar = petBar; + PetActionBarFrame.showgrid = 1; PetActionBar_ShowGrid(); + self:RefreshBar("Pet") self:UpdateBarBindings(true, false) + self:RegisterEvent("PLAYER_CONTROL_GAINED", RefreshPet) self:RegisterEvent("PLAYER_ENTERING_WORLD", RefreshPet) self:RegisterEvent("PLAYER_CONTROL_LOST", RefreshPet) @@ -1416,7 +1315,7 @@ CreateMicroBar = function(self) local button = _G[data[1]] button:SetParent(SVUI_MicroBar) button:Size(buttonSize, buttonSize + 28) - button.Flash:SetTexture("") + button.Flash:SetTexture(0,0,0,0) if button.SetPushedTexture then button:SetPushedTexture("") end @@ -1668,5 +1567,226 @@ function MOD:Load() self.IsLoaded = true end +--[[ +########################################################## +DEFINE CONFIG AND REGISTER +########################################################## +]]-- +CONFIGS["SVBar"] = { + ["enable"] = true, + ["font"] = "Roboto", + ["fontSize"] = 11, + ["fontOutline"] = "OUTLINE", + ["countFont"] = "SVUI Number Font", + ["countFontSize"] = 11, + ["countFontOutline"] = "OUTLINE", + ["cooldownSize"] = 18, + ["rightClickSelf"] = false, + ["macrotext"] = false, + ["hotkeytext"] = false, + ["hotkeyAbbrev"] = true, + ["showGrid"] = true, + ["unc"] = {0.8, 0.1, 0.1, 0.7}, + ["unpc"] = {0.5, 0.5, 1, 0.7}, + ["keyDown"] = false, + ["unlock"] = "SHIFT", + ["Micro"] = { + ["enable"] = true, + ["mouseover"] = true, + ["alpha"] = 1, + ["buttonsize"] = 30, + ["buttonspacing"] = 4, + ["yOffset"] = 4 + }, + ["Bar1"] = { + ["enable"] = true, + ["buttons"] = 12, + ["mouseover"] = false, + ["buttonsPerRow"] = 12, + ["point"] = "BOTTOMLEFT", + ["backdrop"] = false, + ["buttonsize"] = 32, + ["buttonspacing"] = 2, + ["useCustomPaging"] = true, + ["useCustomVisibility"] = false, + ["customVisibility"] = "[petbattle] hide; show", + ["customPaging"] = { + ["HUNTER"] = "", + ["WARLOCK"] = "[form:2] 10;", + ["PRIEST"] = "[bonusbar:1] 7;", + ["PALADIN"] = "", + ["MAGE"] = "", + ["ROGUE"] = "[stance:1] 7; [stance:2] 7; [stance:3] 7; [bonusbar:1] 7; [form:3] 7;", + ["DRUID"] = "[bonusbar:1, nostealth] 7; [bonusbar:1, stealth] 8; [bonusbar:2] 8; [bonusbar:3] 9; [bonusbar:4] 10;", + ["SHAMAN"] = "", + ["WARRIOR"] = "", + ["DEATHKNIGHT"] = "", + ["MONK"] = "[bonusbar:1] 7; [bonusbar:2] 8; [bonusbar:3] 9;", + }, + ["alpha"] = 1 + }, + ["Bar2"] = { + ["enable"] = false, + ["mouseover"] = false, + ["buttons"] = 12, + ["buttonsPerRow"] = 12, + ["point"] = "BOTTOMLEFT", + ["backdrop"] = false, + ["buttonsize"] = 32, + ["buttonspacing"] = 2, + ["useCustomPaging"] = false, + ["useCustomVisibility"] = false, + ["customVisibility"] = "[vehicleui] hide; [overridebar] hide; [petbattle] hide; show", + ["customPaging"] = { + ["HUNTER"] = "", + ["WARLOCK"] = "", + ["PRIEST"] = "", + ["PALADIN"] = "", + ["MAGE"] = "", + ["ROGUE"] = "", + ["DRUID"] = "", + ["SHAMAN"] = "", + ["WARRIOR"] = "", + ["DEATHKNIGHT"] = "", + ["MONK"] = "", + }, + ["alpha"] = 1 + }, + ["Bar3"] = { + ["enable"] = true, + ["mouseover"] = false, + ["buttons"] = 6, + ["buttonsPerRow"] = 6, + ["point"] = "BOTTOMLEFT", + ["backdrop"] = false, + ["buttonsize"] = 32, + ["buttonspacing"] = 2, + ["useCustomPaging"] = false, + ["useCustomVisibility"] = false, + ["customVisibility"] = "[vehicleui] hide; [overridebar] hide; [petbattle] hide; show", + ["customPaging"] = { + ["HUNTER"] = "", + ["WARLOCK"] = "", + ["PRIEST"] = "", + ["PALADIN"] = "", + ["MAGE"] = "", + ["ROGUE"] = "", + ["DRUID"] = "", + ["SHAMAN"] = "", + ["WARRIOR"] = "", + ["DEATHKNIGHT"] = "", + ["MONK"] = "", + }, + ["alpha"] = 1 + }, + ["Bar4"] = { + ["enable"] = true, + ["mouseover"] = true, + ["buttons"] = 12, + ["buttonsPerRow"] = 1, + ["point"] = "TOPRIGHT", + ["backdrop"] = false, + ["buttonsize"] = 32, + ["buttonspacing"] = 2, + ["useCustomPaging"] = false, + ["useCustomVisibility"] = false, + ["customVisibility"] = "[vehicleui] hide; [overridebar] hide; [petbattle] hide; show", + ["customPaging"] = { + ["HUNTER"] = "", + ["WARLOCK"] = "", + ["PRIEST"] = "", + ["PALADIN"] = "", + ["MAGE"] = "", + ["ROGUE"] = "", + ["DRUID"] = "", + ["SHAMAN"] = "", + ["WARRIOR"] = "", + ["DEATHKNIGHT"] = "", + ["MONK"] = "", + }, + ["alpha"] = 1 + }, + ["Bar5"] = { + ["enable"] = true, + ["mouseover"] = false, + ["buttons"] = 6, + ["buttonsPerRow"] = 6, + ["point"] = "BOTTOMLEFT", + ["backdrop"] = false, + ["buttonsize"] = 32, + ["buttonspacing"] = 2, + ["useCustomPaging"] = false, + ["useCustomVisibility"] = false, + ["customVisibility"] = "[vehicleui] hide; [overridebar] hide; [petbattle] hide; show", + ["customPaging"] = { + ["HUNTER"] = "", + ["WARLOCK"] = "", + ["PRIEST"] = "", + ["PALADIN"] = "", + ["MAGE"] = "", + ["ROGUE"] = "", + ["DRUID"] = "", + ["SHAMAN"] = "", + ["WARRIOR"] = "", + ["DEATHKNIGHT"] = "", + ["MONK"] = "", + }, + ["alpha"] = 1 + }, + ["Bar6"] = { + ["enable"] = false, + ["mouseover"] = false, + ["buttons"] = 12, + ["buttonsPerRow"] = 12, + ["point"] = "BOTTOMLEFT", + ["backdrop"] = false, + ["buttonsize"] = 32, + ["buttonspacing"] = 2, + ["useCustomPaging"] = false, + ["useCustomVisibility"] = false, + ["customVisibility"] = "[vehicleui] hide; [overridebar] hide; [petbattle] hide; show", + ["customPaging"] = { + ["HUNTER"] = "", + ["WARLOCK"] = "", + ["PRIEST"] = "", + ["PALADIN"] = "", + ["MAGE"] = "", + ["ROGUE"] = "", + ["DRUID"] = "", + ["SHAMAN"] = "", + ["WARRIOR"] = "", + ["DEATHKNIGHT"] = "", + ["MONK"] = "", + }, + ["alpha"] = 1 + }, + ["Pet"] = { + ["enable"] = true, + ["mouseover"] = false, + ["buttons"] = NUM_PET_ACTION_SLOTS, + ["buttonsPerRow"] = NUM_PET_ACTION_SLOTS, + ["point"] = "TOPLEFT", + ["backdrop"] = false, + ["buttonsize"] = 24, + ["buttonspacing"] = 3, + ["useCustomVisibility"] = false, + ["customVisibility"] = "[petbattle] hide; [pet, novehicleui, nooverridebar, nopossessbar] show; hide", + ["alpha"] = 1 + }, + ["Stance"] = { + ["enable"] = true, + ["style"] = "darkenInactive", + ["mouseover"] = false, + ["buttons"] = NUM_STANCE_SLOTS, + ["buttonsPerRow"] = NUM_STANCE_SLOTS, + ["point"] = "BOTTOMRIGHT", + ["backdrop"] = false, + ["buttonsize"] = 24, + ["buttonspacing"] = 5, + ["useCustomVisibility"] = false, + ["customVisibility"] = "[petbattle] hide; show", + ["alpha"] = 1 + }, +} SuperVillain.Registry:NewPackage(MOD, "SVBar") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/aura/SVAura.lua b/Interface/AddOns/SVUI/packages/aura/SVAura.lua index 97569bf..b90686a 100644 --- a/Interface/AddOns/SVUI/packages/aura/SVAura.lua +++ b/Interface/AddOns/SVUI/packages/aura/SVAura.lua @@ -42,7 +42,7 @@ local tremove, twipe = table.remove, table.wipe; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SuperVillain, L, G, CONFIGS = unpack(select(2, ...)); local MOD = {}; --[[ ########################################################## @@ -211,7 +211,7 @@ do local enchantInfo = select(offset, GetWeaponEnchantInfo()) if enchantInfo then self.offset = offset; - self:SetScript("OnUpdate", MOD. RefreshAuraTime) + self:SetScript("OnUpdate", RefreshAuraTime) self.nextUpdate = -1; RefreshAuraTime(self, 0) else @@ -223,7 +223,7 @@ do end end - function SVAura_CreateIcon(aura) + function MOD:CreateIcon(aura) if(not aura.Skinned) then if aura.SetNormalTexture then aura:SetNormalTexture("") end if aura.SetHighlightTexture then aura:SetHighlightTexture("") end @@ -305,8 +305,15 @@ do local UpdateConsolidatedReminder = function(self, event, arg) if(event == "UNIT_AURA" and arg ~= "player") then return end for i = 1, NUM_LE_RAID_BUFF_TYPES do - local name, _, _, duration, expiration = GetRaidBuffTrayAuraInfo(i) + local name, _, _, duration, expiration, _, slot = GetRaidBuffTrayAuraInfo(i) local buff = SVUI_ConsolidatedBuffs[i] + + --[[ EXPERIMENTAL ]]-- + if(not name and slot) then + name, _, _, _, _, duration, expiration = UnitBuff(slot) + end + --[[ ____________ ]]-- + if name then local timeLeft = expiration - GetTime() buff.expiration = timeLeft; @@ -367,9 +374,9 @@ do local id = parent:GetID() if parent.spellName then GameTooltip:SetUnitConsolidatedBuff("player",id) - GameTooltip:AddLine("________________________") + GameTooltip:AddLine("|cff555555________________________|r") end - GameTooltip:AddLine("Consolidated Buff: ".._G[("RAID_BUFF_%d"):format(id)]) + GameTooltip:AddLine("|cff00FFFFConsolidated Buff:|r ".._G[("RAID_BUFF_%d"):format(id)]) GameTooltip:Show() end @@ -541,5 +548,49 @@ function MOD:Load() self:Update_ConsolidatedBuffsSettings() SuperVillain:SetSVMovable(auras, L["Auras Frame"]) -end +end +--[[ +########################################################## +DEFINE CONFIG AND REGISTER +########################################################## +]]-- +CONFIGS["SVAura"] = { + ["enable"] = true, + ["disableBlizzard"] = true, + ["font"] = "SVUI Number Font", + ["fontSize"] = 12, + ["fontOutline"] = "THINOUTLINE", + ["countOffsetV"] = 0, + ["countOffsetH"] = 0, + ["timeOffsetV"] = -4, + ["timeOffsetH"] = 0, + ["hyperBuffs"] = { + ["enable"] = true, + ["filter"] = true, + }, + ["fadeBy"] = 5, + ["buffs"] = { + ["showBy"] = "LEFT_DOWN", + ["wrapAfter"] = 12, + ["maxWraps"] = 3, + ["wrapXOffset"] = 6, + ["wrapYOffset"] = 16, + ["sortMethod"] = "TIME", + ["sortDir"] = "-", + ["isolate"] = 1, + ["size"] = 32, + }, + ["debuffs"] = { + ["showBy"] = "LEFT_DOWN", + ["wrapAfter"] = 12, + ["maxWraps"] = 1, + ["wrapXOffset"] = 6, + ["wrapYOffset"] = 16, + ["sortMethod"] = "TIME", + ["sortDir"] = "-", + ["isolate"] = 1, + ["size"] = 32, + }, +} + SuperVillain.Registry:NewPackage(MOD, "SVAura") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/aura/SVAura.xml b/Interface/AddOns/SVUI/packages/aura/SVAura.xml index cc98410..236367a 100644 --- a/Interface/AddOns/SVUI/packages/aura/SVAura.xml +++ b/Interface/AddOns/SVUI/packages/aura/SVAura.xml @@ -8,7 +8,7 @@ </Attributes> <Scripts> <OnLoad> - SVAura_CreateIcon(self) + SVUI[1].SVAura:CreateIcon(self) self:RegisterForClicks('RightButtonUp') </OnLoad> <OnEnter> diff --git a/Interface/AddOns/SVUI/packages/bag/SVBag.lua b/Interface/AddOns/SVUI/packages/bag/SVBag.lua index da48a2e..cd6dbc0 100644 --- a/Interface/AddOns/SVUI/packages/bag/SVBag.lua +++ b/Interface/AddOns/SVUI/packages/bag/SVBag.lua @@ -40,7 +40,7 @@ local twipe = table.wipe; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SuperVillain, L, G, CONFIGS = unpack(select(2, ...)); local MOD = {}; local TTIP = SuperVillain.SVTip; --[[ @@ -71,7 +71,7 @@ local RefProfessionColors = { [0x0400] = {105/255,79/255,7/255}, [0x10000] = {222/255,13/255,65/255}, [0x100000] = {18/255,224/255,180/255} -}; +} --[[ ########################################################## LOCAL FUNCTIONS @@ -540,18 +540,21 @@ function MOD:VendorGrays(arg1, arg2, arg3) end end end - if arg3 then return copper end + if arg3 then return copper end + local strMsg if copper > 0 and not arg1 then local gold, silver, copper = floor(copper / 10000) or 0, floor(copper%10000 / 100) or 0, copper%100; - SuperVillain:AddonMessage(L["Vendored gray items for:"].." |cffffffff"..gold..L.goldabbrev.." |cffffffff"..silver ..L.silverabbrev.." |cffffffff"..copper ..L.copperabbrev..".") + strMsg = ("%s |cffffffff%s%s%s%s%s%s|r"):format(L["Vendored gray items for:"], gold, L["goldabbrev"], silver, L["silverabbrev"], copper, L["copperabbrev"]) elseif not arg1 and not arg2 then - SuperVillain:AddonMessage(L["No gray items to sell."]) + strMsg = L["No gray items to sell."] elseif deleted > 0 then local gold, silver, copper = floor(copper / 10000) or 0, floor(copper%10000 / 100) or 0, copper%100; - SuperVillain:AddonMessage(format(L["Deleted %d gray items. Total Worth: %s"], deleted, " |cffffffff"..gold..L.goldabbrev.." |cffffffff"..silver ..L.silverabbrev.." |cffffffff"..copper ..L.copperabbrev..".")) - elseif not arg2 then - SuperVillain:AddonMessage(L["No gray items to delete."]) - end + local prefix = ("|cffffffff%s%s%s%s%s%s|r"):format(gold, L["goldabbrev"], silver, L["silverabbrev"], copper, L["copperabbrev"]) + strMsg = (L["Deleted %d gray items. Total Worth: %s"]):format(deleted, prefix) + elseif not arg2 then + strMsg = L["No gray items to delete."] + end + SuperVillain:AddonMessage(strMsg) end function MOD:ModifyBags() @@ -1329,5 +1332,41 @@ function MOD:Load() StackSplitFrame:SetFrameStrata("DIALOG") self.BagFrame:RefreshBagsSlots() end +--[[ +########################################################## +DEFINE CONFIG AND REGISTER +########################################################## +]]-- +CONFIGS["SVBag"] = { + ["enable"] = true, + ["sortInverted"] = false, + ["bags"] = { + ["xOffset"] = 0, + ["yOffset"] = 0, + ["point"] = "BOTTOMRIGHT", + }, + ["bank"] = { + ["xOffset"] = 0, + ["yOffset"] = 0, + ["point"] = "BOTTOMLEFT", + }, + ["bagSize"] = 34, + ["bankSize"] = 34, + ["alignToChat"] = false, + ["bagWidth"] = 450, + ["bankWidth"] = 450, + ["currencyFormat"] = "ICON", + ["ignoreItems"] = "", + ["bagTools"] = true, + ["bagBar"] = { + ["enable"] = false, + ["showBy"] = "VERTICAL", + ["sortDirection"] = "ASCENDING", + ["size"] = 30, + ["spacing"] = 4, + ["showBackdrop"] = false, + ["mouseover"] = false, + }, +} SuperVillain.Registry:NewPackage(MOD, "SVBag"); \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/bag/tools/breakstuff.lua b/Interface/AddOns/SVUI/packages/bag/tools/breakstuff.lua index cdb3cfe..b6335e9 100644 --- a/Interface/AddOns/SVUI/packages/bag/tools/breakstuff.lua +++ b/Interface/AddOns/SVUI/packages/bag/tools/breakstuff.lua @@ -247,7 +247,7 @@ local SetClonedTip = function(self) end function MOD:BreakStuffLoader() - if(InCombatLockdown()) then self:RegisterEvent("PLAYER_REGEN_ENABLED"); return end + if(InCombatLockdown()) then MOD:RegisterEvent("PLAYER_REGEN_ENABLED"); return end local allowed, spellListing, spellName, _ = false, {}; if(IsSpellKnown(51005)) then diff --git a/Interface/AddOns/SVUI/packages/chat/SVChat.lua b/Interface/AddOns/SVUI/packages/chat/SVChat.lua index 3886ed1..37c5421 100644 --- a/Interface/AddOns/SVUI/packages/chat/SVChat.lua +++ b/Interface/AddOns/SVUI/packages/chat/SVChat.lua @@ -21,28 +21,20 @@ local _G = _G; local unpack = _G.unpack; local select = _G.select; local pairs = _G.pairs; -local tostring = _G.tostring; local tonumber = _G.tonumber; -local tinsert = _G.tinsert; local string = _G.string; -local math = _G.math; local table = _G.table; --[[ STRING METHODS ]]-- -local lower, upper = string.lower, string.upper; -local find, format, len, split = string.find, string.format, string.len, string.split; -local match, sub, join = string.match, string.sub, string.join; -local gmatch, gsub = string.gmatch, string.gsub; ---[[ MATH METHODS ]]-- -local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; -- Basic -local parsefloat, random = math.parsefloat, math.random; -- Uncommon +local find, format, len, upper = string.find, string.format, string.len, string.upper; +local match, sub, gsub = string.match, string.sub, string.gsub; --[[ TABLE METHODS ]]-- -local tremove, tcopy, twipe, tsort, tconcat = table.remove, table.copy, table.wipe, table.sort, table.concat; +local twipe = table.wipe; --[[ ########################################################## GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SuperVillain, L, G, CONFIGS = unpack(select(2, ...)); local MOD = {}; --[[ ########################################################## @@ -53,10 +45,14 @@ local SetAllChatHooks, SetParseHandlers; local internalTest = false local locale = GetLocale() local NewHook = hooksecurefunc; ---[[ -########################################################## -LOCALIZED DB UPVALUES -########################################################## +--[[ + Quick explaination of what Im doing with all of these locals... + Unlike many of the other modules, SVChat has to continuously + reference config settings which can start to get sluggish. What + I have done is set local variables for every database value + that the module can read efficiently. The function "UpdateLocals" + is used to refresh these any time a change is made to configs + and once when the mod is loaded. ]]-- local CHAT_WIDTH = 350; local CHAT_HEIGHT = 180; @@ -79,7 +75,7 @@ local TIME_STAMP_MASK = "NONE"; local ICONARTFILE = [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-CHAT]] local SCROLL_ALERT = [[Interface\AddOns\SVUI\assets\artwork\Chat\CHAT-SCROLL]] local WHISPER_ALERT = [[Interface\AddOns\SVUI\assets\artwork\Chat\CHAT-WHISPER]] -local THROTTLE_CACHE = {}; +local THROTTLE_CACHE = {} --[[ ########################################################## INIT SETTINGS @@ -372,14 +368,14 @@ do self:SetPanelColor("highlight") end GameTooltip:Show() - end; + end local Tab_OnLeave = function(self) if not self.IsOpen then self:SetPanelColor("default") end GameTooltip:Hide() - end; + end local Tab_OnClick = function(self,button) FCF_Tab_OnClick(self,button); @@ -391,7 +387,7 @@ do self.IsOpen = false self:SetPanelColor("default") end - end; + end local EditBox_OnEditFocusGained = function(self) self:Show() @@ -537,8 +533,9 @@ do tab:SetScript("OnEnter", Tab_OnEnter); tab:SetScript("OnLeave", Tab_OnLeave); tab:SetScript("OnClick", Tab_OnClick); - tab.IsStyled = true; tab.Holder = holder + tab.Holder.link = tab + tab.IsStyled = true; end local function _modifyChat(chat) @@ -573,15 +570,15 @@ do chat:Formula409(true) _G[chatName.."ButtonFrame"]:MUNG() ------------------------------------------- - _G[tabName .."Left"]:SetTexture(nil) - _G[tabName .."Middle"]:SetTexture(nil) - _G[tabName .."Right"]:SetTexture(nil) - _G[tabName .."SelectedLeft"]:SetTexture(nil) - _G[tabName .."SelectedMiddle"]:SetTexture(nil) - _G[tabName .."SelectedRight"]:SetTexture(nil) - _G[tabName .."HighlightLeft"]:SetTexture(nil) - _G[tabName .."HighlightMiddle"]:SetTexture(nil) - _G[tabName .."HighlightRight"]:SetTexture(nil) + _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) tab.text = _G[chatName.."TabText"] tab.text:SetTextColor(1, 1, 1) @@ -657,36 +654,10 @@ do end end - function MOD:UpdateUpvalues(throttle) - CHAT_WIDTH = (SuperVillain.db.SVDock.dockLeftWidth or 350) - 10; - CHAT_HEIGHT = (SuperVillain.db.SVDock.dockLeftHeight or 180) - 15; - CHAT_THROTTLE = MOD.db.throttleInterval; - CHAT_ALLOW_URL = MOD.db.url; - CHAT_HOVER_URL = MOD.db.hyperlinkHover; - CHAT_STICKY = MOD.db.sticky; - CHAT_FONT = SuperVillain.Shared:Fetch("font", MOD.db.font); - CHAT_FONTSIZE = SuperVillain.db.media.fonts.size or 12; - CHAT_FONTOUTLINE = MOD.db.fontOutline; - TAB_WIDTH = MOD.db.tabWidth; - TAB_HEIGHT = MOD.db.tabHeight; - TAB_SKINS = MOD.db.tabStyled; - TAB_FONT = SuperVillain.Shared:Fetch("font", MOD.db.tabFont); - TAB_FONTSIZE = MOD.db.tabFontSize; - TAB_FONTOUTLINE = MOD.db.tabFontOutline; - CHAT_FADING = MOD.db.fade; - CHAT_PSST = SuperVillain.Shared:Fetch("sound", MOD.db.psst); - TIME_STAMP_MASK = MOD.db.timeStampFormat; - if(throttle and throttle == 0) then - twipe(THROTTLE_CACHE) - end - end - function MOD:RefreshChatFrames(forced) if (not SuperVillain.db.SVChat.enable) then return; end if ((not forced) and refreshLocked and (IsMouseButtonDown("LeftButton") or InCombatLockdown())) then return; end - MOD:UpdateUpvalues() - for i,name in pairs(CHAT_FRAMES)do local chat = _G[name] local id = chat:GetID() @@ -919,11 +890,35 @@ do end NewHook("ChatEdit_UpdateHeader", _hook_OnUpdateHeader) end -end; +end + +function MOD:UpdateLocals() + CHAT_WIDTH = (SuperVillain.db.SVDock.dockLeftWidth or 350) - 10; + CHAT_HEIGHT = (SuperVillain.db.SVDock.dockLeftHeight or 180) - 15; + CHAT_THROTTLE = self.db.throttleInterval; + CHAT_ALLOW_URL = self.db.url; + CHAT_HOVER_URL = self.db.hyperlinkHover; + CHAT_STICKY = self.db.sticky; + CHAT_FONT = SuperVillain.Shared:Fetch("font", self.db.font); + CHAT_FONTSIZE = SuperVillain.db.media.fonts.size or 12; + CHAT_FONTOUTLINE = self.db.fontOutline; + TAB_WIDTH = self.db.tabWidth; + TAB_HEIGHT = self.db.tabHeight; + TAB_SKINS = self.db.tabStyled; + TAB_FONT = SuperVillain.Shared:Fetch("font", self.db.tabFont); + TAB_FONTSIZE = self.db.tabFontSize; + TAB_FONTOUTLINE = self.db.tabFontOutline; + CHAT_FADING = self.db.fade; + CHAT_PSST = SuperVillain.Shared:Fetch("sound", self.db.psst); + TIME_STAMP_MASK = self.db.timeStampFormat; + if(CHAT_THROTTLE and CHAT_THROTTLE == 0) then + twipe(THROTTLE_CACHE) + end +end function MOD:ReLoad() self:RefreshChatFrames(true) -end; +end function MOD:Load() if(not SuperVillain.db.SVChat.enable) then return end @@ -944,6 +939,7 @@ function MOD:Load() self:RegisterEvent('PET_BATTLE_CLOSE') SetParseHandlers() + self:UpdateLocals() self:RefreshChatFrames(true) _G.GeneralDockManagerOverflowButton:ClearAllPoints() _G.GeneralDockManagerOverflowButton:SetPoint('BOTTOMRIGHT', SuperDockChatTabBar, 'BOTTOMRIGHT', -2, 2) @@ -959,5 +955,35 @@ function MOD:Load() _G.InterfaceOptionsSocialPanelChatStyle:EnableMouse(false) _G.InterfaceOptionsSocialPanelChatStyleButton:Hide() _G.InterfaceOptionsSocialPanelChatStyle:SetAlpha(0) -end; +end +--[[ +########################################################## +DEFINE CONFIG AND REGISTER +########################################################## +]]-- +CONFIGS["SVChat"] = { + ["enable"] = true, + ["tabHeight"] = 20, + ["tabWidth"] = 75, + ["tabStyled"] = true, + ["font"] = "Roboto", + ["fontOutline"] = "OUTLINE", + ["tabFont"] = "SVUI Alert Font", + ["tabFontSize"] = 10, + ["tabFontOutline"] = "OUTLINE", + ["url"] = true, + ["shortChannels"] = true, + ["hyperlinkHover"] = true, + ["throttleInterval"] = 45, + ["fade"] = false, + ["sticky"] = true, + ["smileys"] = true, + ["secretWordTone"] = "None", + ["psst"] = "Whisper Alert", + ["noWipe"] = false, + ["timeStampFormat"] = "NONE", + ["secretWords"] = "%MYNAME%, SVUI", + ["basicTools"] = true, +} + SuperVillain.Registry:NewPackage(MOD, "SVChat") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/dock/SVDock.lua b/Interface/AddOns/SVUI/packages/dock/SVDock.lua index 274f0b4..ca5290e 100644 --- a/Interface/AddOns/SVUI/packages/dock/SVDock.lua +++ b/Interface/AddOns/SVUI/packages/dock/SVDock.lua @@ -33,7 +33,7 @@ local format, gsub, strfind, strmatch, tonumber = format, gsub, strfind, strmatc GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SuperVillain, L, G, CONFIGS = unpack(select(2, ...)); local MOD, DOCKLET_CACHE, TOOL_CACHE, SAFETY_CACHE = {}, {}, {}, {}; local PREV_TOOL, DEFAULT_DOCKLET; --[[ @@ -62,11 +62,29 @@ local TOOL_DATA = { [197] = {0.25,0.5,0.75,1}, -- PRO-TAILORING } local HEARTH_SPELLS = {556,50977,18960,126892} + +local rez = GetCVar("gxResolution"); +local gxWidth = tonumber(rez:match("(%d+)x%d+")); +local bw = gxWidth * 0.5 +local defaultStatBarWidth = min(bw, 800) --[[ ########################################################## PRE VARS/FUNCTIONS ########################################################## ]]-- +local function CycleDocklets() + for i=1, #DOCKLET_CACHE do + local f = DOCKLET_CACHE[i] + if(not InCombatLockdown() or (InCombatLockdown() and (f.IsProtected and not f:IsProtected()))) then + local b = _G[f.ToggleName] + b:Deactivate() + if f.Hide then + f:Hide() + end + end + end +end + local AlertActivate = function(self, child) local size = MOD.db.buttonSize or 22; self:Height(size) @@ -92,32 +110,7 @@ local rightDockSizeHook = function(self,width,height) SuperDockWindowRight:SetPoint("BOTTOMLEFT", SuperDockAlertRight, "TOPLEFT", 0, 0) end -local Dock_OnEnter = function(self, ...) - if InCombatLockdown() then return end - self:SetPanelColor("highlight") - if MOD.SuperDockFaded then - LeftSuperDock:Show() - SuperVillain:SecureFadeIn(LeftSuperDock, 0.2, LeftSuperDock:GetAlpha(), 1) - RightSuperDock:Show() - SuperVillain:SecureFadeIn(RightSuperDock, 0.2, RightSuperDock:GetAlpha(), 1) - end - GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) - GameTooltip:ClearLines() - GameTooltip:AddLine(L["Toggle Docks"], 1, 1, 1) - GameTooltip:Show() -end - -local Dock_OnLeave = function(self, ...) - if InCombatLockdown() then return end - self:SetPanelColor("special") - if MOD.SuperDockFaded then - SuperVillain:SecureFadeOut(LeftSuperDock, 0.2, LeftSuperDock:GetAlpha(), 0, true) - SuperVillain:SecureFadeOut(RightSuperDock, 0.2, RightSuperDock:GetAlpha(), 0, true) - end - GameTooltip:Hide() -end - -local Dock_OnClick = function(self) +local ToggleDocks = function(self) GameTooltip:Hide() if MOD.SuperDockFaded then MOD.SuperDockFaded = nil; @@ -142,36 +135,77 @@ local Docklet_OnShow = function(self) end end -function SuperVillain:CycleDocklets() - for i=1, #DOCKLET_CACHE do - local f = DOCKLET_CACHE[i] - if(not InCombatLockdown() or (InCombatLockdown() and (f.IsProtected and not f:IsProtected()))) then - f.IsOpen = false; - local b = _G[f.ToggleName] - b:SetPanelColor("special") - b.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - if f.Hide then - f:Hide() - end - end - end +local DockletButton_SaveColors = function(self, pG, iG, locked) + if(locked and (locked ~= nil) and self._colorLocked) then return end + self._panelGradient = pG + self._iconGradient = iG + self._colorLocked = locked + self:SetPanelColor(pG) + self.icon:SetGradient(unpack(SuperVillain.Media.gradient[iG])) end -local Button_OnEnter = function(self, ...) +local DockButtonActivate = function(self) + self.IsOpen = true; + self:SaveColors("green", "green") +end + +local DockButtonDeactivate = function(self) + self.IsOpen = false; + self:SaveColors("default", "icon") +end + +local DockletButton_OnEnter = function(self, ...) + if MOD.SuperDockFaded then + LeftSuperDock:Show() + SuperVillain:SecureFadeIn(LeftSuperDock, 0.2, LeftSuperDock:GetAlpha(), 1) + RightSuperDock:Show() + SuperVillain:SecureFadeIn(RightSuperDock, 0.2, RightSuperDock:GetAlpha(), 1) + end + self:SetPanelColor("highlight") self.icon:SetGradient(unpack(SuperVillain.Media.gradient.bizzaro)) + GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) GameTooltip:ClearLines() - GameTooltip:AddLine(self.TText, 1, 1, 1) + if(self.CustomTooltip) then + self:CustomTooltip() + else + GameTooltip:AddLine(self.TText, 1, 1, 1) + end GameTooltip:Show() end -local Button_OnLeave = function(self, ...) - self:SetPanelColor("special") - self.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) +local DockletButton_OnLeave = function(self, ...) + if MOD.SuperDockFaded then + SuperVillain:SecureFadeOut(LeftSuperDock, 0.2, LeftSuperDock:GetAlpha(), 0, true) + SuperVillain:SecureFadeOut(RightSuperDock, 0.2, RightSuperDock:GetAlpha(), 0, true) + end + + self:SetPanelColor(self._panelGradient) + self.icon:SetGradient(unpack(SuperVillain.Media.gradient[self._iconGradient])) + GameTooltip:Hide() end +local DockletButton_OnClick = function(self) + if InCombatLockdown() then return end + local linkedFrame = self.FrameName + if linkedFrame and _G[linkedFrame] then + SuperDockWindowRight.FrameName = linkedFrame + if not _G[linkedFrame]:IsShown() then + CycleDocklets() + end + if not SuperDockWindowRight:IsShown()then + SuperDockWindowRight:Show() + end + _G[linkedFrame]:Show() + self:Activate() + else + self:Deactivate() + GetDefaultWindow() + end +end + local DockletFrame_OnShow = function(self) local frameName = self.FrameName; if (frameName and _G[frameName]) then @@ -179,42 +213,19 @@ local DockletFrame_OnShow = function(self) end end -local Addon_OnEnter = function(self) - if not self.IsOpen then - self:SetPanelColor("highlight") - self.icon:SetGradient(unpack(SuperVillain.Media.gradient.bizzaro)) - end - GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) - GameTooltip:ClearLines() - GameTooltip:AddLine(self.TText, 1, 1, 1) - GameTooltip:Show() -end - -local Addon_OnLeave = function(self) - if not self.IsOpen then - self:SetPanelColor("special") - self.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - end - GameTooltip:Hide() -end - -local Addon_OnClick = function(self) +local AddonDockletToggle = function(self) if SuperDockletMain.FrameName and _G[SuperDockletMain.FrameName] then if not _G[SuperDockletMain.FrameName]:IsShown() then - SuperVillain:CycleDocklets() + CycleDocklets() if not InCombatLockdown() and not SuperDockletMain:IsShown()then SuperDockletMain:Show() end _G[SuperDockletMain.FrameName]:Show() - self.IsOpen = true; - self:SetPanelColor("green") - self.icon:SetGradient(unpack(SuperVillain.Media.gradient.green)) + self:Activate() elseif not SuperDockletMain:IsShown()then if not InCombatLockdown() then SuperDockletMain:Show() end _G[SuperDockletMain.FrameName]:Show() - self.IsOpen = true; - self:SetPanelColor("green") - self.icon:SetGradient(unpack(SuperVillain.Media.gradient.green)) + self:Activate() end else SuperDockletMain.FrameName = "None" @@ -224,8 +235,7 @@ local Addon_OnClick = function(self) else SuperDockletMain:Show() end - self:SetPanelColor("special") - self.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + self:Deactivate() end if MOD.db.docklets.enableExtra and SuperDockletExtra.FrameName and _G[SuperDockletExtra.FrameName] then if not _G[SuperDockletExtra.FrameName]:IsShown() then @@ -234,30 +244,25 @@ local Addon_OnClick = function(self) SuperDockletMain:Show() end _G[SuperDockletExtra.FrameName]:Show() - self.IsOpen = true; - self:SetPanelColor("green") - self.icon:SetGradient(unpack(SuperVillain.Media.gradient.green)) + self:Activate() elseif not SuperDockletExtra:IsShown() then if not InCombatLockdown() then SuperDockletExtra:Show() SuperDockletMain:Show() end _G[SuperDockletExtra.FrameName]:Show() - self.IsOpen = true; - self:SetPanelColor("green") - self.icon:SetGradient(unpack(SuperVillain.Media.gradient.green)) + self:Activate() else if not InCombatLockdown() then SuperDockletExtra:Hide() SuperDockletMain:Hide() end - self:SetPanelColor("special") - self.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + self:Deactivate() end else SuperDockletExtra.FrameName = "None" end -end +end local function SetSuperDockStyle(dock) if dock.backdrop then return end @@ -293,110 +298,70 @@ local function SetSuperDockStyle(dock) backdrop.top:Height(1) return backdrop end + +SuperVillain.CycleDocklets = CycleDocklets --[[ ########################################################## CORE FUNCTIONS ########################################################## ]]-- function HideSuperDocks() - Dock_OnClick(LeftDockToggleButton) + ToggleDocks(LeftDockToggleButton) end --[[ ########################################################## DOCKLET HELPERS ########################################################## ]]-- -do - local function GetDefaultWindow() - local window = DEFAULT_DOCKLET - if window and _G[window] and not _G[window]:IsShown() then - SuperDockWindowRight.FrameName = window - SuperDockWindowRight:Show() - end +local function GetDefaultWindow() + local window = DEFAULT_DOCKLET + if window and _G[window] then + SuperDockWindowRight.FrameName = window + SuperDockWindowRight:Show() end +end - local Button_OnEnter = function(b) - if not b.IsOpen then - b:SetPanelColor("highlight") - b.icon:SetGradient(unpack(SuperVillain.Media.gradient.bizzaro)) - end - GameTooltip:SetOwner(b, "ANCHOR_TOPLEFT", 0, 4) - GameTooltip:ClearLines() - GameTooltip:AddLine(b.TText, 1, 1, 1) - GameTooltip:Show() - end +function MOD:ActivateDockletButton(button, clickFunction, tipFunction) + button._panelGradient = "default" + button._iconGradient = "icon" + button.SaveColors = DockletButton_SaveColors + button:SaveColors("default", "icon") - local Button_OnLeave = function(b) - if not b.IsOpen then - b:SetPanelColor("special") - b.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - end - GameTooltip:Hide() - end + button.Activate = DockButtonActivate + button.Deactivate = DockButtonDeactivate - local Button_OnClick = function(self) - if InCombatLockdown() then return end - local linkedFrame = self.FrameName - if linkedFrame and _G[linkedFrame] then - SuperDockWindowRight.FrameName = linkedFrame - if not _G[linkedFrame]:IsShown() then - if not SuperDockWindowRight:IsShown()then - SuperDockWindowRight:Show() - end - SuperVillain:CycleDocklets() - _G[linkedFrame]:Show() - self.IsOpen = true; - self:SetPanelColor("green") - self.icon:SetGradient(unpack(SuperVillain.Media.gradient.green)) - elseif not SuperDockWindowRight:IsShown()then - SuperDockWindowRight:Show() - _G[linkedFrame]:Show() - self.IsOpen = true; - self:SetPanelColor("green") - self.icon:SetGradient(unpack(SuperVillain.Media.gradient.green)) - end - else - if SuperDockWindowRight:IsShown()then - SuperDockWindowRight:Hide() - else - SuperDockWindowRight:Show() - end - self.IsOpen = false; - self:SetPanelColor("special") - self.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - GetDefaultWindow() - end + if(tipFunction and type(tipFunction) == "function") then + button.CustomTooltip = tipFunction end - function MOD:CreateBasicToolButton(name,texture,onclick,frameName,isdefault) - local fName = frameName or name; - local dockIcon = texture or [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-ADDON]]; - local clickFunction = (type(onclick)=="function") and onclick or Button_OnClick; - local size = SuperDockToolBarRight.currentSize; - local button = _G[fName .. "_ToolBarButton"] or CreateFrame("Button", ("%s_ToolBarButton"):format(fName), SuperDockToolBarRight) - SuperVillain.AddTool(button) - button:Size(size,size) - button:SetFramedButtonTemplate() - button.icon = button:CreateTexture(nil,"OVERLAY") - button.icon:FillInner(button,2,2) - button.icon:SetTexture(dockIcon) - button.TText = "Open " .. name; - button.FrameName = fName; - if isdefault == true then - DEFAULT_DOCKLET = fName; - end - button.IsOpen = isdefault and true or false; - button:SetScript("OnEnter",Button_OnEnter) - button:SetScript("OnLeave",Button_OnLeave) - button:SetScript("OnClick",clickFunction) - _G[fName].ToggleName = fName.."_ToolBarButton"; - if(isdefault) then - button:SetPanelColor("green") - button.icon:SetGradient(unpack(SuperVillain.Media.gradient.green)) - else - button.icon:SetGradient(unpack(SuperVillain.Media.gradient.light)) - end - end + button:SetScript("OnEnter", DockletButton_OnEnter) + button:SetScript("OnLeave", DockletButton_OnLeave) + + if(clickFunction and type(clickFunction) == "function") then + button:SetScript("OnClick", clickFunction) + end +end + +function MOD:CreateBasicToolButton(name,texture,onclick,frameName,isdefault) + local fName = frameName or name; + local dockIcon = texture or [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-ADDON]]; + local clickFunction = (type(onclick)=="function") and onclick or DockletButton_OnClick; + local size = SuperDockToolBarRight.currentSize; + local button = _G[fName .. "_ToolBarButton"] or CreateFrame("Button", ("%s_ToolBarButton"):format(fName), SuperDockToolBarRight) + SuperVillain.AddTool(button) + button:Size(size,size) + button:SetFramedButtonTemplate() + button.icon = button:CreateTexture(nil,"OVERLAY") + button.icon:FillInner(button,2,2) + button.icon:SetTexture(dockIcon) + button.TText = "Open " .. name; + button.FrameName = fName + MOD:ActivateDockletButton(button, clickFunction) + _G[fName].ToggleName = fName.."_ToolBarButton"; + if(isdefault and isdefault == true) then + DEFAULT_DOCKLET = fName + button:SaveColors("green", "green") + end end --[[ ########################################################## @@ -483,11 +448,9 @@ function MOD:CreateDockPanels() leftbutton.icon = leftbutton:CreateTexture(nil, "OVERLAY", nil, 0) leftbutton.icon:FillInner(leftbutton,2,2) leftbutton.icon:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Icons\\SVUI-EMBLEM") + leftbutton.TText = L["Toggle Docks"] leftbutton:RegisterForClicks("AnyUp") - leftbutton:SetScript("OnEnter", Dock_OnEnter) - leftbutton:SetScript("OnLeave", Dock_OnLeave) - leftbutton:SetScript("OnClick", Dock_OnClick) - + MOD:ActivateDockletButton(leftbutton, ToggleDocks) -- [[ TOOLBARS AND OTHER NONSENSE ]] -- local toolbarLeft = CreateFrame("Frame", "SuperDockToolBarLeft", SuperVillain.UIParent) @@ -532,13 +495,9 @@ function MOD:CreateDockPanels() rightbutton.icon = rightbutton:CreateTexture(nil, "OVERLAY") rightbutton.icon:FillInner(rightbutton,2,2) rightbutton.icon:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-HENCHMAN]]) - rightbutton.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) rightbutton.TText = "Call Henchman!" rightbutton:RegisterForClicks("AnyUp") - rightbutton:SetScript("OnEnter", Button_OnEnter) - rightbutton:SetScript("OnLeave", Button_OnLeave) - rightbutton:SetScript("OnClick", function()SuperVillain:ToggleHenchman()end) - + MOD:ActivateDockletButton(rightbutton, SuperVillain.ToggleHenchman) -- [[ TOOLBARS AND OTHER NONSENSE ]] -- local toolbarRight = CreateFrame("Frame", "SuperDockToolBarRight", SuperVillain.UIParent) @@ -643,53 +602,31 @@ do end end - local Macro_OnEnter = function(self) - self:SetPanelColor("highlight") - self.icon:SetGradient(unpack(SuperVillain.Media.gradient.bizzaro)) - GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 2, 4) - GameTooltip:ClearLines() + local SetMacroTooltip = function(self) if not self.TText2 then GameTooltip:AddLine("Open " .. self.TText, 1, 1, 1) else GameTooltip:AddDoubleLine("[Left-Click]", "Open " .. self.TText, 0, 1, 0, 1, 1, 1) GameTooltip:AddDoubleLine("[Right-Click]", "Use " .. self.TText2, 0, 1, 0, 1, 1, 1) + if InCombatLockdown() then return end if(self.IsItem) then GameTooltip:AddLine(" ", 1, 1, 1) local remaining = GetMacroCooldown(self.IsItem) GameTooltip:AddDoubleLine(self.TText2, remaining, 1, 0.5, 0, 0, 1, 1) end - end - GameTooltip:Show() - end - - local Macro_OnLeave = function(self) - self:SetPanelColor("special") - self.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - GameTooltip:Hide() + end end - local Hearth_OnEnter = function(self) - if InCombatLockdown() then return end - self.glow:Show() - self:SetPanelColor("highlight") - GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) - GameTooltip:ClearLines() + local SetHearthTooltip = function(self) GameTooltip:AddLine(L["Hearthstone"], 1, 1, 1) + if InCombatLockdown() then return end local remaining = GetMacroCooldown(6948) GameTooltip:AddDoubleLine(L["Time Remaining"], remaining, 1, 1, 1, 0, 1, 1) if(self.ExtraSpell) then GameTooltip:AddLine(" ", 1, 1, 1) GameTooltip:AddDoubleLine(self.ExtraSpell, "[Right Click]", 1, 1, 1, 0, 1, 0) end - GameTooltip:Show() - end - - local Hearth_OnLeave = function(self) - if InCombatLockdown() then return end - self.glow:Hide() - self:SetPanelColor("special") - GameTooltip:Hide() - end + end local function AddMacroTool(frame) local width; @@ -739,8 +676,7 @@ do button:SetAttribute("macrotext", "/cast " .. proName) end - button:SetScript("OnEnter", Macro_OnEnter) - button:SetScript("OnLeave", Macro_OnLeave) + MOD:ActivateDockletButton(button, nil, SetMacroTooltip) end function MOD:LoadToolBarProfessions() @@ -755,19 +691,13 @@ do hearth.icon:FillInner(hearth,2,2) hearth.icon:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Icons\\DOCK-HEARTH") hearth.icon:SetTexCoord(0,0.5,0,1) - hearth.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - hearth.glow = hearth:CreateTexture(nil, "OVERLAY", nil, 2) - hearth.glow:FillInner(hearth,2,2) - hearth.glow:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Icons\\DOCK-HEARTH") - hearth.glow:SetTexCoord(0.5,1,0,1) - hearth.glow:Hide() - hearth:SetScript("OnEnter", Hearth_OnEnter) - hearth:SetScript("OnLeave", Hearth_OnLeave) hearth:RegisterForClicks("AnyUp") hearth:SetAttribute("type", "item") hearth:SetAttribute("item", "Hearthstone") + MOD:ActivateDockletButton(hearth, nil, SetHearthTooltip) + for i = 1, #HEARTH_SPELLS do if(IsSpellKnown(HEARTH_SPELLS[i])) then local rightClickSpell = GetSpellInfo(HEARTH_SPELLS[i]) @@ -879,7 +809,6 @@ do elseif AddOnButton.IsRegistered then SuperVillain.RemoveTool(AddOnButton) AddOnButton.TText = ""; - AddOnButton.IsOpen = false; AddOnButton.IsRegistered = false; end if SuperVillain:IsDockletReady("DockletExtra") then @@ -1035,42 +964,68 @@ end function MOD:Load() self:CreateSuperBorders() self:CreateDockPanels() - local width = RightSuperDock:GetWidth(); local height = RightSuperDock:GetHeight() - 22 SuperDockWindowRight:Size(width, height) SuperDockWindowRight:SetPoint("BOTTOMLEFT", SuperDockAlertRight, "TOPLEFT", 0, 0) - SuperDockWindowRight:SetScript('OnShow', Docklet_OnShow) - --SuperDockWindowRight:SetScript('OnHide', SuperVillain:CycleDocklets) + SuperDockWindowRight:SetScript("OnShow", Docklet_OnShow) + --SuperDockWindowRight:SetScript("OnHide", CycleDocklets) + if not InCombatLockdown()then - SuperVillain:CycleDocklets() + CycleDocklets() end - hooksecurefunc(RightSuperDock, 'SetSize', rightDockSizeHook) + + hooksecurefunc(RightSuperDock, "SetSize", rightDockSizeHook) self:UpdateDockBackdrops() - SuperDockletMain:SetFrameLevel(SuperDockWindowRight:GetFrameLevel() + 50) SuperDockletExtra:SetFrameLevel(SuperDockWindowRight:GetFrameLevel() + 50) + local size = SuperDockToolBarRight.currentSize; + AddOnButton:SetParent(SuperDockToolBarRight) - AddOnButton:Size(size,size) + AddOnButton:Size(size, size) AddOnButton:SetFramedButtonTemplate() - AddOnButton.icon = AddOnButton:CreateTexture(nil,"OVERLAY") + AddOnButton.icon = AddOnButton:CreateTexture(nil, "OVERLAY") AddOnButton.icon:FillInner() AddOnButton.icon:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-ADDON]]) - AddOnButton.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - AddOnButton.TText=""; - AddOnButton.IsOpen=false; - AddOnButton.IsRegistered=false; - AddOnButton:SetScript("OnEnter",Addon_OnEnter) - AddOnButton:SetScript("OnLeave",Addon_OnLeave) - AddOnButton:SetScript("OnClick",Addon_OnClick) - AddOnButton:Hide() + AddOnButton.TText = ""; + AddOnButton.IsRegistered = false; + + MOD:ActivateDockletButton(AddOnButton, AddonDockletToggle) - SuperDockletMain:SetScript('OnShow', DockletFrame_OnShow) - SuperDockletExtra:SetScript('OnShow', DockletFrame_OnShow) + AddOnButton:Hide() + SuperDockletMain:SetScript("OnShow", DockletFrame_OnShow) + SuperDockletExtra:SetScript("OnShow", DockletFrame_OnShow) SuperVillain:ReloadDocklets(true) SuperVillain:ExecuteTimer(self.LoadToolBarProfessions, 5) end +--[[ +########################################################## +DEFINE CONFIG AND REGISTER +########################################################## +]]-- +CONFIGS["SVDock"] = { + ["enable"] = true, + ["dockLeftWidth"] = 412, + ["dockLeftHeight"] = 224, + ["dockRightWidth"] = 412, + ["dockRightHeight"] = 224, + ["dockStatWidth"] = defaultStatBarWidth, + ["buttonSize"] = 30, + ["buttonSpacing"] = 4, + ["leftDockBackdrop"] = true, + ["rightDockBackdrop"] = true, + ["topPanel"] = true, + ["bottomPanel"] = true, + ["docklets"] = { + ["DockletMain"] = "None", + ["MainWindow"] = "None", + ["DockletExtra"] = "None", + ["ExtraWindow"] = "None", + ["enableExtra"] = false, + ["DockletCombatFade"] = true + }, +} SuperVillain.Registry:NewPackage(MOD, "SVDock") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/gear/SVGear.lua b/Interface/AddOns/SVUI/packages/gear/SVGear.lua index 8994757..cad489f 100644 --- a/Interface/AddOns/SVUI/packages/gear/SVGear.lua +++ b/Interface/AddOns/SVUI/packages/gear/SVGear.lua @@ -32,7 +32,7 @@ local ceil, floor, round = math.ceil, math.floor, math.round; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SuperVillain, L, G, CONFIGS = unpack(select(2, ...)); local MOD = {}; --[[ ########################################################## @@ -40,10 +40,17 @@ LOCAL VARS ########################################################## ]]-- local NewHook = hooksecurefunc; -local UPDATE_TIMER = 0; -local REGEX_HEIRLOOM = "|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*):?(%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?"; +--[[ + Quick explaination of what Im doing with all of these locals... + Unlike many of the other modules, SVGear has to continuously + reference config settings which can start to get sluggish. What + I have done is set local variables for every database value + that the module can read efficiently. The function "UpdateLocals" + is used to refresh these any time a change is made to configs + and once when the mod is loaded. +]]-- local COLOR_KEYS = { [0] = "|cffff0000", [1] = "|cff00ff00", [2] = "|cffffff88" }; -local LIVESET, EQUIP_SET, SPEC_SET, SHOW_LEVEL, SHOW_DURABILITY, ONLY_DAMAGED, AVG_LEVEL, _; +local LIVESET, EQUIP_SET, SPEC_SET, SHOW_LEVEL, SHOW_DURABILITY, ONLY_DAMAGED, AVG_LEVEL, MAX_LEVEL; local EquipmentSlots = { ["HeadSlot"] = {true,true}, ["NeckSlot"] = {true,false}, @@ -61,19 +68,12 @@ local EquipmentSlots = { ["Finger1Slot"] = {true,false,true}, ["Trinket0Slot"] = {true,false,true}, ["Trinket1Slot"] = {true,false,true} -}; +} --[[ ########################################################## LOCAL FUNCTIONS ########################################################## ]]-- -local function UpdateUpvalues() - SHOW_LEVEL = MOD.db.itemlevel.enable - SHOW_DURABILITY = MOD.db.durability.enable - ONLY_DAMAGED = MOD.db.durability.onlydamaged - _, AVG_LEVEL = GetAverageItemLevel() -end - local function SetItemLevelDisplay(globalName, iLevel) local frame = _G[globalName] if(not frame) then return; end @@ -204,8 +204,6 @@ local function RefreshInspectedGear() local unit = InspectFrame and InspectFrame.unit or "player"; if(not unit or (unit and not CanInspect(unit,false))) then return end; - UpdateUpvalues() - if(SHOW_LEVEL) then SuperVillain:ParseGearSlots(unit, true, SetItemLevelDisplay) else @@ -221,8 +219,7 @@ local function RefreshGear() else MOD:UnregisterEvent("PLAYER_REGEN_ENABLED") end; - - UpdateUpvalues() + MOD:UpdateLocals() if(SHOW_LEVEL) then SuperVillain:ParseGearSlots("player", false, SetItemLevelDisplay, SetItemDurabilityDisplay) else @@ -254,29 +251,43 @@ local function GearSwap() end end -local function GearPreBuild() - MOD:UnregisterEvent("PLAYER_ENTERING_WORLD") +function MOD:PLAYER_ENTERING_WORLD() + self:UnregisterEvent("PLAYER_ENTERING_WORLD") + SHOW_LEVEL = self.db.itemlevel.enable + SHOW_DURABILITY = self.db.durability.enable + ONLY_DAMAGED = self.db.durability.onlydamaged + MAX_LEVEL, AVG_LEVEL = GetAverageItemLevel() LoadAddOn("Blizzard_InspectUI") SetDisplayStats("Character") SetDisplayStats("Inspect") NewHook('InspectFrame_UpdateTabs', Gear_UpdateTabs) SuperVillain:ExecuteTimer(RefreshGear, 10) GearSwap() - MOD.PreBuildComplete = true + self.PreBuildComplete = true end +local MSG_PREFIX = "You have equipped equipment set: " local GearSwapComplete = function() - if LIVESET then - SuperVillain:AddonMessage(join('',L["You have equipped equipment set: "],LIVESET)) + if LIVESET then + local strMsg = ("%s%s"):format(MSG_PREFIX, LIVESET) + SuperVillain:AddonMessage(strMsg) LIVESET = nil end -end; +end + +function MOD:UpdateLocals() + SHOW_LEVEL = self.db.itemlevel.enable + SHOW_DURABILITY = self.db.durability.enable + ONLY_DAMAGED = self.db.durability.onlydamaged + MAX_LEVEL, AVG_LEVEL = GetAverageItemLevel() +end function MOD:ReLoad() RefreshGear() -end; +end function MOD:Load() + MSG_PREFIX = L["You have equipped equipment set: "] self.PreBuildComplete = false self:RegisterEvent("UPDATE_INVENTORY_DURABILITY", RefreshGear) self:RegisterEvent("PLAYER_EQUIPMENT_CHANGED", RefreshGear) @@ -285,6 +296,33 @@ function MOD:Load() self:RegisterEvent("MASTERY_UPDATE", RefreshGear) self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED", GearSwap) self:RegisterEvent("EQUIPMENT_SWAP_FINISHED", GearSwapComplete) - self:RegisterEvent("PLAYER_ENTERING_WORLD", GearPreBuild) -end; + self:RegisterEvent("PLAYER_ENTERING_WORLD") +end +--[[ +########################################################## +DEFINE CONFIG AND REGISTER +########################################################## +]]-- +CONFIGS["SVGear"] = { + ["enable"] = true, + ["specialization"] = { + ["enable"] = false, + }, + ["battleground"] = { + ["enable"] = false, + }, + ["primary"] = "none", + ["secondary"] = "none", + ["equipmentset"] = "none", + ["durability"] = { + ["enable"] = true, + ["onlydamaged"] = true, + }, + ["itemlevel"] = { + ["enable"] = true, + }, + ["misc"] = { + setoverlay = true, + } +} SuperVillain.Registry:NewPackage(MOD, "SVGear"); \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua index 3358a19..96cffd0 100644 --- a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua +++ b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua @@ -13,9 +13,8 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SuperVillain, L = unpack(select(2, ...)); -local MOD = {}; -SuperVillain.Henchmen = MOD; +local SuperVillain, L, G, CONFIGS = unpack(select(2, ...)); +local MOD = {} --[[ ########################################################## LOCAL VARS @@ -53,7 +52,8 @@ local HENCHMEN_DATA = { {37339,60,60,60,60,60,60}, --Augh {2323,67,113,69,70,73,75}, --Defias Henchman } -}; +} + local takingOnlyCash,deletedelay,mailElapsed,childCount=false,0.5,0,-1; local GetAllMail, GetAllMailCash, OpenMailItem, WaitForMail, StopOpeningMail, FancifyMoneys, lastopened, needsToWait, total_cash, baseInboxFrame_OnClick; local incpat = gsub(gsub(FACTION_STANDING_INCREASED, "(%%s)", "(.+)"), "(%%d)", "(.+)"); @@ -71,7 +71,7 @@ local AutomatedEvents = { "QUEST_DETAIL", "QUEST_ACCEPT_CONFIRM", "QUEST_PROGRESS" -}; +} --[[ ########################################################## SCRIPT HANDLERS @@ -631,7 +631,7 @@ MAIL HELPER ########################################################## ]]-- function MOD:ToggleMailMinions() - if not self.db.mailOpener then + if not MOD.db.mailOpener then SVUI_MailMinion:Hide() else SVUI_MailMinion:Show() @@ -775,8 +775,9 @@ function MOD:CHAT_MSG_COMBAT_FACTION_CHANGE(event, msg) for factionIndex = 1, GetNumFactions() do local name = GetFactionInfo(factionIndex) if name == faction and name ~= active then - local inactive = IsFactionInactive(factionIndex) or SetWatchedFactionIndex(factionIndex) - SuperVillain:AddonMessage("Now Tracking: "..name.." Reputation") + -- local inactive = IsFactionInactive(factionIndex) or SetWatchedFactionIndex(factionIndex) + local strMsg = ("Watching Faction: %s"):format(name) + SuperVillain:AddonMessage(strMsg) break end end @@ -873,7 +874,7 @@ function MOD:QUEST_COMPLETE() GetQuestReward(auto_select) end else - if(self.db.autoquestreward == true and self.db.autoquestcomplete == true) then + if(self.db.autoquestcomplete == true) then GetQuestReward(GetNumQuestChoices()) end end @@ -952,5 +953,26 @@ function MOD:Load() end end end +--[[ +########################################################## +DEFINE CONFIG AND REGISTER +########################################################## +]]-- +CONFIGS["SVHenchmen"] = { + ["enable"] = true, + ["autoRoll"] = false, + ["vendorGrays"] = true, + ["autoAcceptInvite"] = false, + ["autorepchange"] = false, + ["pvpautorelease"] = false, + ["autoquestcomplete"] = false, + ["autoquestreward"] = false, + ["autoquestaccept"] = false, + ["autodailyquests"] = false, + ["autopvpquests"] = false, + ["skipcinematics"] = false, + ["mailOpener"] = true, + ["autoRepair"] = "PLAYER", +} SuperVillain.Registry:NewPackage(MOD, "SVHenchmen") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/laborer/SVLaborer.lua b/Interface/AddOns/SVUI/packages/laborer/SVLaborer.lua deleted file mode 100644 index bf6335c..0000000 --- a/Interface/AddOns/SVUI/packages/laborer/SVLaborer.lua +++ /dev/null @@ -1,504 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local type = _G.type; -local string = _G.string; -local math = _G.math; -local table = _G.table; -local rept = string.rep; -local tsort,twipe = table.sort,table.wipe; -local floor,ceil = math.floor, math.ceil; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = {}; -SuperVillain.Modes = MOD; ---[[ -########################################################## -LOCALIZED GLOBALS -########################################################## -]]-- -local LOOT_ITEM_SELF = _G.LOOT_ITEM_SELF; -local LOOT_ITEM_CREATED_SELF = _G.LOOT_ITEM_CREATED_SELF; -local LOOT_ITEM_SELF_MULTIPLE = _G.LOOT_ITEM_SELF_MULTIPLE -local LOOT_ITEM_PUSHED_SELF_MULTIPLE = _G.LOOT_ITEM_PUSHED_SELF_MULTIPLE -local LOOT_ITEM_PUSHED_SELF = _G.LOOT_ITEM_PUSHED_SELF ---[[ -########################################################## -LOCAL VARS -########################################################## -]]-- -local currentModeKey = false; -local ModeLogsFrame = CreateFrame("Frame", "SVUI_ModeLogsFrame", UIParent) -local classColors = SVUI_CLASS_COLORS[SuperVillain.class] -local classR, classG, classB = classColors.r, classColors.g, classColors.b -local classA = 0.35 -local lastClickTime; ---[[ -########################################################## -LOCAL FUNCTIONS -########################################################## -]]-- -local function SendModeMessage(...) - if not CombatText_AddMessage then return end; - CombatText_AddMessage(...) -end; - -local function onMouseWheel(self, delta) - if (delta > 0) then - self:ScrollUp() - elseif (delta < 0) then - self:ScrollDown() - end -end; - -local function CheckForDoubleClick() - if lastClickTime then - local pressTime = GetTime() - local doubleTime = pressTime - lastClickTime - if ( (doubleTime < 0.4) and (doubleTime > 0.05) ) then - lastClickTime = nil - return true - end - end - lastClickTime = GetTime() - return false -end ---[[ -########################################################## -XML FRAME SCRIPT HANDLERS -########################################################## -]]-- -local WorldFrame_Hook = function(self, button) - if InCombatLockdown() then return end - if(currentModeKey and button == "RightButton" and CheckForDoubleClick()) then - local handle = MOD[currentModeKey]; - if(handle and handle.Bind) then - handle.Bind() - end - end -end - -local ModeCap_OnEvent = function(self, event, ...) - local readyToFish, knowFishing, knowArchaeology = false,false,false - if event == "PLAYER_ENTERING_WORLD" then - knowFishing = IsSpellKnown(131474) - knowArchaeology = IsSpellKnown(80451) - knowCooking = IsSpellKnown(818) - if (knowFishing or knowArchaeology or knowCooking) then - WorldFrame:HookScript("OnMouseDown", WorldFrame_Hook) - end - self:UnregisterEvent("PLAYER_ENTERING_WORLD") - end -end - -function SVUI_ModeCaptureWindow_OnLoad() - _G["SVUI_ModeCaptureWindow"].Grip = _G["SVUI_ModesHandler"]; - _G["SVUI_ModeCaptureWindow"]:RegisterForClicks("RightButtonUp"); - _G["SVUI_ModeCaptureWindow"].Grip = _G["SVUI_ModesHandler"]; - _G["SVUI_ModeCaptureWindow"]:Hide(); - _G["SVUI_ModeCaptureWindow"]:RegisterEvent("PLAYER_ENTERING_WORLD") - _G["SVUI_ModeCaptureWindow"]:SetScript('OnEvent', ModeCap_OnEvent) -end; ---[[ -########################################################## -CORE FUNCTIONS -########################################################## -]]-- -function MOD:LaborerReset() - self.TitleWindow:Clear(); - self.LogWindow:Clear(); - self.TitleWindow:AddMessage("Laborer Modes", 1, 1, 0); - self.LogWindow:AddMessage("Select a Tool to Begin", 1, 1, 1); - self.LogWindow:AddMessage(" ", 0, 1, 1); - collectgarbage("collect") -end - -function MOD:ModeLootLoader(mode, msg, info) - self.TitleWindow:Clear(); - self.LogWindow:Clear(); - self.ModeAlert.HelpText = info - if(mode and self[mode]) then - if(self[mode].Log) then - local stored = self[mode].Log; - self.TitleWindow:AddMessage(msg, 1, 1, 1); - local previous = false - for name,data in pairs(stored) do - if type(data) == "table" and data.amount and data.texture then - self.LogWindow:AddMessage("|cff55FF55"..data.amount.." x|r |T".. data.texture ..":16:16:0:0:64:64:4:60:4:60|t".." "..name, 0.8, 0.8, 0.8); - previous = true - end - end; - if(previous) then - self.LogWindow:AddMessage("----------------", 0, 0, 0); - self.LogWindow:AddMessage(" ", 0, 0, 0); - end - self.LogWindow:AddMessage(info, 1, 1, 1); - self.LogWindow:AddMessage(" ", 1, 1, 1); - end - else - self:LaborerReset() - end; -end - -function MOD:CheckForModeLoot(msg) - local item, amt = SuperVillain:DeFormat(msg, LOOT_ITEM_CREATED_SELF) - if not item then - item = SuperVillain:DeFormat(msg, LOOT_ITEM_SELF_MULTIPLE) - if not item then - item = SuperVillain:DeFormat(msg, LOOT_ITEM_SELF) - if not item then - item = SuperVillain:DeFormat(msg, LOOT_ITEM_PUSHED_SELF_MULTIPLE) - if not item then - item, amt = SuperVillain:DeFormat(msg, LOOT_ITEM_PUSHED_SELF) - --print(item) - end - end - end - end - --print(msg) - if item then - if not amt then - amt = 1 - end - return item, amt - end -end; - -function MOD:SetJobMode(category) - if InCombatLockdown() then return end - if(not category) then - self:EndJobModes() - return; - end; - self:ChangeModeGear() - if(currentModeKey and self[currentModeKey] and self[currentModeKey].Disable) then - self[currentModeKey].Disable() - end - currentModeKey = category; - if(self[category] and self[category].Enable) then - self[category].Enable() - else - self:EndJobModes() - return; - end -end - -function MOD:EndJobModes() - if(currentModeKey and self[currentModeKey] and self[currentModeKey].Disable) then - self[currentModeKey].Disable() - end - currentModeKey = false; - if SVUI_ModesDockFrame:IsShown() then SVUI_ModesDockFrame_ToolBarButton:Click() end - self:ChangeModeGear() - self.ModeAlert:Hide(); - SendModeMessage("Mode Disabled", CombatText_StandardScroll, 1, 0.35, 0); - PlaySound("UndeadExploration"); - self:LaborerReset() -end - -function MOD:ChangeModeGear() - if(not self.InModeGear) then return end - if InCombatLockdown() then - _G["SVUI_ModeCaptureWindow"]:RegisterEvent("PLAYER_REGEN_ENABLED", "ChangeModeGear"); - return - else - _G["SVUI_ModeCaptureWindow"]:UnregisterEvent("PLAYER_REGEN_ENABLED"); - - if(self.WornItems["HEAD"]) then - EquipItemByName(self.WornItems["HEAD"]) - self.WornItems["HEAD"] = false - end - if(self.WornItems["TAB"]) then - EquipItemByName(self.WornItems["TAB"]) - self.WornItems["TAB"] = false - end - if(self.WornItems["MAIN"]) then - EquipItemByName(self.WornItems["MAIN"]) - self.WornItems["MAIN"] = false - end - if(self.WornItems["OFF"]) then - EquipItemByName(self.WornItems["OFF"]) - self.WornItems["OFF"] = false - end - - self.InModeGear = false - end -end - -function MOD:UpdateLogWindow() - self.LogWindow:SetFont(SuperVillain.Media.font.system, self.db.fontSize, "OUTLINE") -end - -function MOD:MakeLogWindow() - local DOCK_WIDTH = SVUI_ModesDockFrame:GetWidth(); - local DOCK_HEIGHT = SVUI_ModesDockFrame:GetHeight(); - - ModeLogsFrame:SetFrameStrata("MEDIUM") - ModeLogsFrame:SetPoint("TOPLEFT",SVUI_ModeButton1,"TOPRIGHT",5,-5) - ModeLogsFrame:SetPoint("BOTTOMRIGHT",SVUI_ModesDockFrame,"BOTTOMRIGHT",-5,5) - ModeLogsFrame:SetParent(SVUI_ModesDockFrame) - - local title = CreateFrame("ScrollingMessageFrame", nil, ModeLogsFrame) - title:SetSpacing(4) - title:SetClampedToScreen(false) - title:SetFrameStrata("MEDIUM") - title:SetPoint("TOPLEFT",ModeLogsFrame,"TOPLEFT",0,0) - title:SetPoint("BOTTOMRIGHT",ModeLogsFrame,"TOPRIGHT",0,-20) - title:SetFontTemplate(UNIT_NAME_FONT, 16, "OUTLINE", "CENTER", "MIDDLE") - title:SetMaxLines(1) - title:EnableMouseWheel(false) - title:SetFading(false) - title:SetInsertMode('TOP') - - title.divider = title:CreateTexture(nil,"OVERLAY") - title.divider:SetTexture(classR, classG, classB) - title.divider:SetAlpha(classA) - title.divider:SetPoint("BOTTOMLEFT") - title.divider:SetPoint("BOTTOMRIGHT") - title.divider:SetHeight(1) - - local topleftline = title:CreateTexture(nil,"OVERLAY") - topleftline:SetTexture(classR, classG, classB) - topleftline:SetAlpha(classA) - topleftline:SetPoint("TOPLEFT") - topleftline:SetPoint("BOTTOMLEFT") - topleftline:SetWidth(1) - - local log = CreateFrame("ScrollingMessageFrame", nil, ModeLogsFrame) - log:SetSpacing(4) - log:SetClampedToScreen(false) - log:SetFrameStrata("MEDIUM") - log:SetPoint("TOPLEFT",title,"BOTTOMLEFT",0,0) - log:SetPoint("BOTTOMRIGHT",ModeLogsFrame,"BOTTOMRIGHT",0,0) - log:SetFont(SuperVillain.Media.font.system, self.db.fontSize, "OUTLINE") - log:SetJustifyH("CENTER") - log:SetJustifyV("MIDDLE") - log:SetShadowColor(0, 0, 0, 0) - log:SetMaxLines(120) - log:EnableMouseWheel(true) - log:SetScript("OnMouseWheel", onMouseWheel) - log:SetFading(false) - log:SetInsertMode('TOP') - - local bottomleftline = log:CreateTexture(nil,"OVERLAY") - bottomleftline:SetTexture(classR, classG, classB) - bottomleftline:SetAlpha(classA) - bottomleftline:SetPoint("TOPLEFT") - bottomleftline:SetPoint("BOTTOMLEFT") - bottomleftline:SetWidth(1) - - self.TitleWindow = title - self.LogWindow = log - - self.ListenerEnabled = false; - SuperVillain:RegisterDocklet("SVUI_ModesDockFrame", "Laborer Modes", [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-LABORER]], false) - self:LaborerReset() -end - -function MOD:SKILL_LINES_CHANGED() - if(currentModeKey and self[currentModeKey] and self[currentModeKey].Update) then - self[currentModeKey].Update() - end -end ---[[ -########################################################## -BUILD FUNCTION / UPDATE -########################################################## -]]-- -local ModeAlert_OnEnter = function(self) - if InCombatLockdown() then return; end - self:SetBackdropColor(0.9, 0.15, 0.1) - GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) - GameTooltip:ClearLines() - GameTooltip:AddLine(self.ModeText, 1, 1, 0) - GameTooltip:AddLine("") - GameTooltip:AddLine("Click here end this mode.", 0.79, 0.23, 0.23) - GameTooltip:AddLine("") - GameTooltip:AddLine(self.HelpText, 0.74, 1, 0.57) - GameTooltip:Show() -end - -local ModeAlert_OnLeave = function(self) - GameTooltip:Hide() - if InCombatLockdown() then return end; - self:SetBackdropColor(0.25, 0.52, 0.1) -end - -local ModeAlert_OnHide = function() - if InCombatLockdown() then - SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); - return; - end - SuperDockAlertRight:Deactivate() -end - -local ModeAlert_OnShow = function(self) - if InCombatLockdown() then - SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); - self:Hide() - return; - end - SuperVillain:SecureFadeIn(self, 0.3, 0, 1) - SuperDockAlertRight:Activate(self) -end - -local ModeAlert_OnMouseDown = function(self) - MOD:EndJobModes() - SuperVillain:SecureFadeOut(self, 0.5, 1, 0, true) -end - -local ModeButton_OnEnter = function(self) - if InCombatLockdown() then return; end - local name = self.modeName - self.icon:SetGradient(unpack(SuperVillain.Media.gradient.yellow)) - GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) - GameTooltip:ClearLines() - GameTooltip:AddLine(L[name .. " Mode"], 1, 1, 1) - GameTooltip:Show() -end - -local ModeButton_OnLeave = function(self) - if InCombatLockdown() then return; end - self.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - GameTooltip:Hide() -end - -local ModeButton_OnMouseDown = function(self) - local name = self.modeName - MOD:SetJobMode(name) -end - -function MOD:Load() - lastClickTime = nil; - self.WornItems = {}; - self.InModeGear = false; - - local ALERT_HEIGHT = 60; - local DOCK_WIDTH = SuperDockWindowRight:GetWidth(); - local DOCK_HEIGHT = SuperDockWindowRight:GetHeight(); - local BUTTON_SIZE = (DOCK_HEIGHT * 0.25) - 4; - - local modesDocklet = CreateFrame("Frame", "SVUI_ModesDockFrame", SuperDockWindowRight) - modesDocklet:SetWidth(DOCK_WIDTH - 4); - modesDocklet:SetHeight(DOCK_HEIGHT - 4); - modesDocklet:SetPoint("CENTER",SuperDockWindowRight,"CENTER",0,0); - - local modesToolBar = CreateFrame("Frame", "SVUI_ModesDockToolBar", modesDocklet) - modesToolBar:SetWidth(BUTTON_SIZE + 4); - modesToolBar:SetHeight((BUTTON_SIZE + 4) * 4); - modesToolBar:SetPoint("BOTTOMLEFT",modesDocklet,"BOTTOMLEFT",0,0); - - local mode4Button = CreateFrame("Frame", "SVUI_ModeButton4", modesToolBar) - mode4Button:SetPoint("BOTTOM",modesToolBar,"BOTTOM",0,0) - mode4Button:SetSize(BUTTON_SIZE,BUTTON_SIZE) - mode4Button.icon = mode4Button:CreateTexture(nil, 'OVERLAY') - mode4Button.icon:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\LABORER-FARMING]]) - mode4Button.icon:FillInner(mode4Button) - mode4Button.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - mode4Button.modeName = "Farming" - mode4Button:SetScript('OnEnter', ModeButton_OnEnter) - mode4Button:SetScript('OnLeave', ModeButton_OnLeave) - mode4Button:SetScript('OnMouseDown', ModeButton_OnMouseDown) - - local mode3Button = CreateFrame("Frame", "SVUI_ModeButton3", modesToolBar) - mode3Button:SetPoint("BOTTOM",mode4Button,"TOP",0,2) - mode3Button:SetSize(BUTTON_SIZE,BUTTON_SIZE) - mode3Button.icon = mode3Button:CreateTexture(nil, 'OVERLAY') - mode3Button.icon:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\LABORER-SURVEY]]) - mode3Button.icon:FillInner(mode3Button) - mode3Button.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - mode3Button.modeName = "Archaeology" - mode3Button:SetScript('OnEnter', ModeButton_OnEnter) - mode3Button:SetScript('OnLeave', ModeButton_OnLeave) - mode3Button:SetScript('OnMouseDown', ModeButton_OnMouseDown) - - local mode2Button = CreateFrame("Frame", "SVUI_ModeButton2", modesToolBar) - mode2Button:SetPoint("BOTTOM",mode3Button,"TOP",0,2) - mode2Button:SetSize(BUTTON_SIZE,BUTTON_SIZE) - mode2Button.icon = mode2Button:CreateTexture(nil, 'OVERLAY') - mode2Button.icon:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\LABORER-FISHING]]) - mode2Button.icon:FillInner(mode2Button) - mode2Button.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - mode2Button.modeName = "Fishing" - mode2Button:SetScript('OnEnter', ModeButton_OnEnter) - mode2Button:SetScript('OnLeave', ModeButton_OnLeave) - mode2Button:SetScript('OnMouseDown', ModeButton_OnMouseDown) - - local mode1Button = CreateFrame("Frame", "SVUI_ModeButton1", modesToolBar) - mode1Button:SetPoint("BOTTOM",mode2Button,"TOP",0,2) - mode1Button:SetSize(BUTTON_SIZE,BUTTON_SIZE) - mode1Button.icon = mode1Button:CreateTexture(nil, 'OVERLAY') - mode1Button.icon:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Icons\LABORER-COOKING]]) - mode1Button.icon:FillInner(mode1Button) - mode1Button.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - mode1Button.modeName = "Cooking" - mode1Button:SetScript('OnEnter', ModeButton_OnEnter) - mode1Button:SetScript('OnLeave', ModeButton_OnLeave) - mode1Button:SetScript('OnMouseDown', ModeButton_OnMouseDown) - - local ModeAlert = CreateFrame("Frame", nil, SuperDockAlertRight) - ModeAlert:SetAllPoints(SuperDockAlertRight) - ModeAlert:SetBackdrop({ - bgFile = [[Interface\AddOns\SVUI\assets\artwork\Bars\HALFTONE]], - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = true, - tileSize = 64, - edgeSize = 1, - insets = { - left = 1, - right = 1, - top = 1, - bottom = 1 - } - }) - ModeAlert:SetBackdropBorderColor(0,0,0,1) - ModeAlert:SetBackdropColor(0.25, 0.52, 0.1) - ModeAlert.text = ModeAlert:CreateFontString(nil, 'ARTWORK', 'GameFontWhite') - ModeAlert.text:SetAllPoints(ModeAlert) - ModeAlert.text:SetTextColor(1, 1, 1) - ModeAlert.text:SetJustifyH("CENTER") - ModeAlert.text:SetJustifyV("MIDDLE") - ModeAlert.text:SetText("Click to Exit") - ModeAlert.ModeText = "Click to Exit"; - ModeAlert.HelpText = ""; - ModeAlert:SetScript('OnEnter', ModeAlert_OnEnter) - ModeAlert:SetScript('OnLeave', ModeAlert_OnLeave) - ModeAlert:SetScript('OnHide', ModeAlert_OnHide) - ModeAlert:SetScript('OnShow', ModeAlert_OnShow) - ModeAlert:SetScript('OnMouseDown', ModeAlert_OnMouseDown) - ModeAlert:Hide() - - self.ModeAlert = ModeAlert - - self:MakeLogWindow() - modesDocklet:Hide() - self:LoadCookingMode() - self:LoadFishingMode() - self:LoadArchaeologyMode() - self:PrepareFarmingTools() - self:RegisterEvent("SKILL_LINES_CHANGED") -end -SuperVillain.Registry:NewPackage(MOD, "SVLaborer"); \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/laborer/SVLaborer.xml b/Interface/AddOns/SVUI/packages/laborer/SVLaborer.xml deleted file mode 100644 index 7ad892e..0000000 --- a/Interface/AddOns/SVUI/packages/laborer/SVLaborer.xml +++ /dev/null @@ -1,26 +0,0 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/"> - <Script file='SVLaborer.lua'/> - <Script file="modes\archaeology.lua"/> - <Script file="modes\cooking.lua"/> - <Script file="modes\fishing.lua"/> - <Script file="modes\farming.lua"/> - - <Frame name="SVUI_ModesHandler" hidden="true" frameStrata="LOW" parent="UIParent"> - <Anchors> - <Anchor point="LEFT" relativeTo="UIParent" relativePoint="RIGHT"> - <Offset x="10000" y="0"/> - </Anchor> - </Anchors> - <Frames> - <Button name="SVUI_ModeCaptureWindow" inherits="SecureActionButtonTemplate" enableMouse="true"> - <Scripts> - <PostClick> - ClearOverrideBindings(self); - self.Grip:Hide(); - </PostClick> - <OnLoad function="SVUI_ModeCaptureWindow_OnLoad"/> - </Scripts> - </Button> - </Frames> - </Frame> -</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/laborer/modes/archaeology.lua b/Interface/AddOns/SVUI/packages/laborer/modes/archaeology.lua deleted file mode 100644 index 79df080..0000000 --- a/Interface/AddOns/SVUI/packages/laborer/modes/archaeology.lua +++ /dev/null @@ -1,513 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local type = _G.type; -local string = _G.string; -local math = _G.math; -local table = _G.table; -local rept,format = string.rep, string.format; -local tsort,twipe = table.sort, table.wipe; -local floor,ceil = math.floor, math.ceil; -local min = math.min ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVLaborer; ---[[ -########################################################## -LOCAL VARS -########################################################## -]]-- -local playerRace = select(2,UnitRace("player")) -local archSpell, survey, surveyIsKnown, skillRank, skillModifier; -local EnableListener, DisableListener; -local CanScanResearchSite = CanScanResearchSite -local GetNumArtifactsByRace = GetNumArtifactsByRace -local GetArchaeologyRaceInfo = GetArchaeologyRaceInfo -local GetSelectedArtifactInfo = GetSelectedArtifactInfo -local GetArtifactProgress = GetArtifactProgress -local CanSolveArtifact = CanSolveArtifact -local GetContainerNumSlots = GetContainerNumSlots -local GetContainerItemInfo = GetContainerItemInfo -local GetContainerItemID = GetContainerItemID -local DockButton, ModeLogsFrame; -local refArtifacts = {}; -for i = 1, 12 do - refArtifacts[i] = {} -end -local NEEDS_UPDATE = true; -local ArchLaborer = CreateFrame("Frame", "SVUI_ArchLaborer", UIParent) ---[[ -########################################################## -DATA -########################################################## -]]-- -MOD.Archaeology = {}; -MOD.Archaeology.Bars = {}; -MOD.Archaeology.Loaded = false; ---[[ -########################################################## -LOCAL FUNCTIONS -########################################################## -]]-- -local function EnableSolve(index, button) - button:SetAlpha(1) - button.text:SetTextColor(1, 1, 1) - button:SetScript("OnEnter", function(self) - self.text:SetTextColor(1, 1, 0) - end) - button:SetScript("OnLeave", function(self) - self.text:SetTextColor(1, 1, 1) - end) - button:SetScript("OnClick", function(self) - SetSelectedArtifact(index) - local _, _, _, _, _, numSockets = GetActiveArtifactByRace(index) - local _, _, itemID = GetArchaeologyRaceInfo(index) - local ready = true - if numSockets and numSockets > 0 then - for socketNum = 1, numSockets do - if not ItemAddedToArtifact(itemID) then - SocketItemToArtifact() - end - end - end - - if GetNumArtifactsByRace(index) > 0 then - print("Solving...") - SolveArtifact() - end - end) -end - -local function DisableSolve(button) - button:SetAlpha(0) - button.text:SetTextColor(0.5, 0.5, 0.5) - button.text:SetText("") - button:SetScript("OnEnter", SuperVillain.fubar) - button:SetScript("OnLeave", SuperVillain.fubar) - button:SetScript("OnMouseUp", SuperVillain.fubar) -end - -local function UpdateArtifactBars(index) - local cache = refArtifacts[index] - local bar = MOD.Archaeology.Bars[index] - - bar["race"]:SetText(cache["race"]) - - if GetNumArtifactsByRace(index) ~= 0 then - local keystoneBonus = 0 - bar["race"]:SetTextColor(1, 1, 1) - bar["progress"]:SetTextColor(1, 1, 1) - if cache["numKeysockets"] then - keystoneBonus = min(cache["numKeystones"], cache["numKeysockets"]) * 12 - end - local actual = min(cache["progress"], cache["total"]) - local potential = cache["total"] - local green = 0.75 * (actual / potential); - bar["bar"]:SetMinMaxValues(0, potential) - bar["bar"]:SetValue(actual) - - if cache["numKeysockets"] and cache["numKeysockets"] > 0 then - bar["solve"].text:SetText(SOLVE.." ["..cache["numKeystones"].."/"..cache["numKeysockets"].."]") - else - bar["solve"].text:SetText(SOLVE) - end - - if keystoneBonus > 0 then - bar["progress"]:SetText(format("|cff00c1ea%d|r/%d", cache["progress"] + keystoneBonus, cache["total"])) - else - if cache["total"] > 65 then - bar["progress"]:SetText(format("%d/|cff00c1ea%d|r", cache["progress"], cache["total"])) - else - bar["progress"]:SetText(format("%d/%d", cache["progress"], cache["total"])) - end - end - if cache["canSolve"] then - EnableSolve(index, bar["solve"]) - else - DisableSolve(bar["solve"]) - end - bar["bar"]:SetStatusBarColor(0.1, green, 1, 0.5) - else - DisableSolve(bar["solve"]) - bar["progress"]:SetText("") - bar["bar"]:SetStatusBarColor(0, 0, 0, 0) - bar["race"]:SetTextColor(0.25, 0.25, 0.25) - bar["progress"]:SetTextColor(0.25, 0.25, 0.25) - end -end - -local function UpdateArtifactCache() - local found, raceName, raceItemID, cache, _; - for index = 1, 12 do - found = GetNumArtifactsByRace(index) - raceName, _, raceItemID = GetArchaeologyRaceInfo(index) - cache = refArtifacts[index] - cache["race"] = raceName - cache["keyID"] = raceItemID - cache["numKeystones"] = 0 - local oldNum = cache["progress"] - if found == 0 then - cache["numKeysockets"] = 0 - cache["progress"] = 0 - cache["modifier"] = 0 - cache["total"] = 0 - cache["canSolve"] = false - else - SetSelectedArtifact(index) - local _, _, _, _, _, keystoneCount = GetSelectedArtifactInfo() - local numFragmentsCollected, numFragmentsAdded, numFragmentsRequired = GetArtifactProgress() - - cache["numKeysockets"] = keystoneCount - cache["progress"] = numFragmentsCollected - cache["modifier"] = numFragmentsAdded - cache["total"] = numFragmentsRequired - cache["canSolve"] = CanSolveArtifact() - - for i = 0, 4 do - for j = 1, GetContainerNumSlots(i) do - local slotID = GetContainerItemID(i, j) - if slotID == cache["keyID"] then - local _, count = GetContainerItemInfo(i, j) - if cache["numKeystones"] < cache["numKeysockets"] then - cache["numKeystones"] = cache["numKeystones"] + count - end - if min(cache["numKeystones"], cache["numKeysockets"]) * 12 + cache["progress"] >= cache["total"] then - cache["canSolve"] = true - end - end - end - end - end - UpdateArtifactBars(index) - end - NEEDS_UPDATE = false -end - -local function GetTitleAndSkill() - local msg = "|cff22ff11Archaeology Mode|r" - if(skillRank) then - if(skillModifier) then - skillRank = skillRank + skillModifier; - end - msg = msg .. " (|cff00ddff" .. skillRank .. "|r)"; - end; - return msg -end - -local function SendModeMessage(...) - if not CombatText_AddMessage then return end; - CombatText_AddMessage(...) -end; ---[[ -########################################################## -EVENT HANDLER -########################################################## -]]-- -do - local SURVEYCDFONT = SuperVillain.Media.font.numbers - local SURVEYRED = {0,0.5,1} - local last = 0 - local time = 3 - - local ArchEventHandler = CreateFrame("Frame"); - local SurveyCooldown = CreateFrame("Frame", nil, UIParent); - local ArchSiteFound; - local ArchCanSurvey, ArchWillSurvey = false, false; - - SurveyCooldown:SetPoint("CENTER", 0, -80) - SurveyCooldown:SetSize(150, 150) - SurveyCooldown.text = SurveyCooldown:CreateFontString(nil, "OVERLAY") - SurveyCooldown.text:SetAllPoints(SurveyCooldown) - SurveyCooldown.text:SetFont(SURVEYCDFONT, 150, "OUTLINE") - SurveyCooldown.text:SetTextColor(0,1,0.12,0.5) - SurveyCooldown.text:SetPoint("CENTER") - SurveyCooldown:SetScale(1.5) - - local Arch_OnEvent = function(self, event, ...) - if(InCombatLockdown() or not archSpell) then return end - if(event == "CURRENCY_DISPLAY_UPDATE" or event == "CHAT_MSG_SKILL" or event == "ARTIFACT_COMPLETE") then - local msg = GetTitleAndSkill() - MOD.TitleWindow:Clear() - MOD.TitleWindow:AddMessage(msg) - end - if(CanScanResearchSite() and (event == "CURRENCY_DISPLAY_UPDATE")) then - UpdateArtifactCache() - elseif(event == "ARCHAEOLOGY_SURVEY_CAST" or event == "ARTIFACT_COMPLETE" or event == "ARTIFACT_DIG_SITE_UPDATED") then - UpdateArtifactCache() - elseif(event == "ARTIFACT_HISTORY_READY" or event == "ARTIFACT_DIGSITE_COMPLETE") then - NEEDS_UPDATE = true - else - ArchCanSurvey = CanScanResearchSite() - if(ArchCanSurvey and not ArchWillSurvey) then - _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") - _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', survey) - MOD.ModeAlert.HelpText = "Double-Right-Click anywhere on the screen to survey."; - ArchWillSurvey = true - elseif(not ArchCanSurvey and ArchWillSurvey) then - _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") - _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', archSpell) - MOD.ModeAlert.HelpText = "Double-Right-Click anywhere on the screen to open the artifacts window."; - ArchWillSurvey = false - end - if(event == "ZONE_CHANGED_NEW_AREA") then ArchSiteFound = nil end - if(not ArchSiteFound) then - local sites = ArchaeologyMapUpdateAll(); - if(sites and sites > 0) then - ArchSiteFound = true - SendModeMessage("Digsite Located", CombatText_StandardScroll, 0.91, 0.78, 0.12); - else - ArchSiteFound = nil - end - end - if(NEEDS_UPDATE) then - UpdateArtifactCache() - end - end - end; - - local Survey_OnUpdate = function(self, elapsed) - last = last + elapsed - if last > 1 then - time = time - 1 - self.text:SetText(time) - if time <= 0 then - self:SetScript("OnUpdate", nil) - self.text:SetText("") - time = 3 - end - self.text:SetTextColor(SURVEYRED[time],1,0.12,0.8) - last = 0 - end - end; - - local Survey_OnEvent = function(self, event, unit, _, _, _, spellid) - if not unit == "player" then return end - if spellid == 80451 then - self.text:SetText("3") - self:SetScript("OnUpdate", Survey_OnUpdate) - end - end; - - function EnableListener() - UpdateArtifactCache() - - ArchEventHandler:RegisterEvent("ZONE_CHANGED") - ArchEventHandler:RegisterEvent("ZONE_CHANGED_NEW_AREA") - ArchEventHandler:RegisterEvent("ZONE_CHANGED_INDOORS") - - ArchEventHandler:RegisterEvent("ARTIFACT_DIG_SITE_UPDATED") - ArchEventHandler:RegisterEvent("ARTIFACT_DIGSITE_COMPLETE") - ArchEventHandler:RegisterEvent("ARTIFACT_HISTORY_READY") - ArchEventHandler:RegisterEvent("ARTIFACT_COMPLETE") - - ArchEventHandler:RegisterEvent("CURRENCY_DISPLAY_UPDATE") - ArchEventHandler:RegisterEvent("ARCHAEOLOGY_SURVEY_CAST") - - ArchEventHandler:RegisterEvent("CHAT_MSG_SKILL") - - ArchEventHandler:SetScript("OnEvent", Arch_OnEvent) - if(playerRace ~= "Dwarf") then - SurveyCooldown:RegisterEvent("UNIT_SPELLCAST_STOP") - SurveyCooldown:SetScript("OnEvent", Survey_OnEvent) - end - end - - function DisableListener() - ArchEventHandler:UnregisterAllEvents() - ArchEventHandler:SetScript("OnEvent", nil) - if(playerRace ~= "Dwarf") then - SurveyCooldown:UnregisterAllEvents() - SurveyCooldown:SetScript("OnEvent", nil) - end - end -end ---[[ -########################################################## -CORE FUNCTIONS -########################################################## -]]-- -function MOD.Archaeology:Enable() - MOD.Archaeology:Update() - if(not SVUI_ModesDockFrame:IsShown()) then DockButton:Click() end - - PlaySoundFile("Sound\\Item\\UseSounds\\UseCrinklingPaper.wav") - MOD.ModeAlert:SetBackdropColor(0.25, 0.52, 0.1) - if(not IsSpellKnown(80451)) then - MOD:ModeLootLoader("Archaeology", "WTF is Archaeology?", "You don't know archaeology! \nPicking up a rock and telling everyone that \nyou found a fossil is cute, BUT WRONG!! \nGo find someone who can train you to do this job."); - MOD.TitleWindow:Clear(); - MOD.TitleWindow:AddMessage("WTF is Archaeology?"); - MOD.LogWindow:Clear(); - MOD.LogWindow:AddMessage("You don't know archaeology! \nPicking up a rock and telling everyone that \nyou found a fossil is cute, BUT WRONG!! \nGo find someone who can train you to do this job.", 1, 1, 1); - MOD.LogWindow:AddMessage(" ", 1, 1, 1); - else - ArchLaborer:Show() - local msg = GetTitleAndSkill() - if surveyIsKnown and CanScanResearchSite() then - MOD:ModeLootLoader("Archaeology", msg, "Double-Right-Click anywhere on the screen to survey."); - _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") - _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', survey) - else - MOD:ModeLootLoader("Archaeology", msg, "Double-Right-Click anywhere on the screen to open the artifacts window."); - _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") - _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', archSpell) - end - MOD.TitleWindow:Clear(); - MOD.TitleWindow:AddMessage(msg); - end - EnableListener() - MOD.ModeAlert:Show() - SendModeMessage("Archaeology Mode Enabled", CombatText_StandardScroll, 0.28, 0.9, 0.1); -end - -function MOD.Archaeology:Disable() - DisableListener() - ArchLaborer:Hide() -end - -function MOD.Archaeology:Bind() - if InCombatLockdown() then return end - if(archSpell) then - if surveyIsKnown and CanScanResearchSite() then - _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") - _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', survey) - MOD.ModeAlert.HelpText = 'Double-Right-Click anywhere on the screen to survey.' - else - _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") - _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', archSpell) - MOD.ModeAlert.HelpText = 'Double-Right-Click anywhere on the screen to open the artifacts window.' - end - SetOverrideBindingClick(_G["SVUI_ModeCaptureWindow"], true, "BUTTON2", "SVUI_ModeCaptureWindow"); - _G["SVUI_ModeCaptureWindow"].Grip:Show(); - end -end - -function MOD.Archaeology:Update() - surveyIsKnown = IsSpellKnown(80451); - survey = GetSpellInfo(80451); - local _,_,arch,_,_,_ = GetProfessions(); - if(arch) then - archSpell, _, skillRank, _, _, _, _, skillModifier = GetProfessionInfo(arch) - end -end ---[[ -########################################################## -LOADER -########################################################## -]]-- -function MOD:LoadArchaeologyMode() - ModeLogsFrame = MOD.LogWindow; - DockButton = _G["SVUI_ModesDockFrame_ToolBarButton"]; - - local progressBars = MOD.Archaeology.Bars - - ArchLaborer:SetParent(ModeLogsFrame) - ArchLaborer:SetFrameStrata("MEDIUM") - ArchLaborer:FillInner(ModeLogsFrame) - - local BAR_WIDTH = (ArchLaborer:GetWidth() * 0.5) - 4 - local BAR_HEIGHT = (ArchLaborer:GetHeight() / 6) - 4 - - for i = 1, 12 do - local bar = CreateFrame("StatusBar", nil, ArchLaborer) - local race = bar:CreateFontString() - local progress = bar:CreateFontString() - local solve = CreateFrame("Button", nil, bar, "SecureHandlerClickTemplate") - local yOffset; - - bar:SetPanelTemplate("Inset") - bar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - bar:SetSize(BAR_WIDTH,BAR_HEIGHT) - if(i > 6) then - yOffset = ((i - 7) * (BAR_HEIGHT + 4)) + 4 - bar:SetPoint("TOPRIGHT", ArchLaborer, "TOPRIGHT", -2, -yOffset) - else - yOffset = ((i - 1) * (BAR_HEIGHT + 4)) + 4; - bar:SetPoint("TOPLEFT", ArchLaborer, "TOPLEFT", 2, -yOffset) - end - bar:SetStatusBarColor(0.2, 0.2, 0.8, 0.5) - bar:SetScript("OnEnter", function(self) - GameTooltip:SetOwner(self, "ANCHOR_BOTTOMRIGHT", 2, 250) - GameTooltip:ClearLines() - if GetNumArtifactsByRace(i) > 0 then - SetSelectedArtifact(i) - local artifactName, artifactDescription, artifactRarity, _, _, keystoneCount = GetSelectedArtifactInfo() - local numFragmentsCollected, numFragmentsAdded, numFragmentsRequired = GetArtifactProgress() - local r, g, b - if artifactRarity == 1 then - artifactRarity = ITEM_QUALITY3_DESC - r, g, b = GetItemQualityColor(3) - else - artifactRarity = ITEM_QUALITY1_DESC - r, g, b = GetItemQualityColor(1) - end - GameTooltip:AddLine(artifactName, r, g, b, 1) - GameTooltip:AddLine(artifactRarity, r, g, b, r, g, b) - GameTooltip:AddDoubleLine(ARCHAEOLOGY_RUNE_STONES..": "..numFragmentsCollected.."/"..numFragmentsRequired, "Keystones: "..keystoneCount, 1, 1, 1, 1, 1, 1) - GameTooltip:AddLine(" ") - GameTooltip:AddLine(artifactDescription, 1, 1, 1, 1) - GameTooltip:Show() - end - end) - bar:SetScript("OnLeave", function() - GameTooltip:Hide() - end) - - -- Race Text - race:SetFont(SuperVillain.Media.font.roboto, 12, "OUTLINE") - race:SetText(RACE) - race:SetPoint("LEFT", bar, "LEFT", 2, 0) - - -- Progress Text - progress:SetFont(SuperVillain.Media.font.roboto, 12, "OUTLINE") - progress:SetText("") - progress:SetPoint("RIGHT", bar, "RIGHT", 1, 0) - - -- Solve - solve:SetAllPoints(bar) - - solve.bg = solve:CreateTexture(nil,"BORDER") - solve.bg:SetAllPoints(solve) - solve.bg:SetTexture(SuperVillain.Media.bar.default) - solve.bg:SetVertexColor(0.1,0.5,0) - - solve.text = solve:CreateFontString(nil,"OVERLAY") - solve.text:SetFont(SuperVillain.Media.font.roboto, 14, "NONE") - solve.text:SetShadowOffset(-1,-1) - solve.text:SetShadowColor(0,0,0,0.5) - solve.text:SetText(SOLVE) - solve.text:SetPoint("CENTER", solve, "CENTER", 2, 0) - - progressBars[i] = { - ["bar"] = bar, - ["race"] = race, - ["progress"] = progress, - ["solve"] = solve - } - end - ArchLaborer:Hide() - MOD.Archaeology:Update() - UpdateArtifactCache() -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/laborer/modes/cooking.lua b/Interface/AddOns/SVUI/packages/laborer/modes/cooking.lua deleted file mode 100644 index 8f35b43..0000000 --- a/Interface/AddOns/SVUI/packages/laborer/modes/cooking.lua +++ /dev/null @@ -1,227 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local type = _G.type; -local string = _G.string; -local math = _G.math; -local table = _G.table; -local rept = string.rep; -local tsort,twipe = table.sort,table.wipe; -local floor,ceil = math.floor, math.ceil; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVLaborer; ---[[ -########################################################## -LOCAL VARS -########################################################## -]]-- -local cookingSpell, campFire, skillRank, skillModifier; -local DockButton; ---[[ -########################################################## -LOCAL FUNCTIONS -########################################################## -]]-- -local function UpdateChefWear() - if(GetItemCount(46349) > 0) then - MOD.WornItems["HEAD"] = GetInventoryItemID("player", INVSLOT_HEAD); - EquipItemByName(46349) - MOD.InModeGear = true - end - if(GetItemCount(86468) > 0) then - MOD.WornItems["TAB"] = GetInventoryItemID("player", INVSLOT_TABARD); - EquipItemByName(86468) - MOD.InModeGear = true - end - if(GetItemCount(86559) > 0) then - MOD.WornItems["MAIN"] = GetInventoryItemID("player", INVSLOT_MAINHAND); - EquipItemByName(86559) - MOD.InModeGear = true - end - if(GetItemCount(86558) > 0) then - MOD.WornItems["OFF"] = GetInventoryItemID("player", INVSLOT_OFFHAND); - EquipItemByName(86558) - MOD.InModeGear = true - end -end; - -local function GetTitleAndSkill() - local msg = "|cff22ff11Cooking Mode|r" - if(skillRank) then - if(skillModifier) then - skillRank = skillRank + skillModifier; - end - msg = msg .. " (|cff00ddff" .. skillRank .. "|r)"; - end; - return msg -end; - -local function SendModeMessage(...) - if not CombatText_AddMessage then return end; - CombatText_AddMessage(...) -end; ---[[ -########################################################## -CORE NAMESPACE -########################################################## -]]-- -MOD.Cooking = {}; -MOD.Cooking.Log = {}; -MOD.Cooking.Loaded = false; ---[[ -########################################################## -EVENT HANDLER -########################################################## -]]-- -do - local CookEventHandler = CreateFrame("Frame") - local LootProxy = function(item, name) - if(item) then - local mask = [[0x10000]]; - local itemType = GetItemFamily(item); - local pass = bit.band(itemType, mask); - if pass > 0 then - proxyTest = true; - end - end - end; - - local Cook_OnEvent = function(self, event, ...) - if(InCombatLockdown()) then return end - if(event == "BAG_UPDATE" or event == "CHAT_MSG_SKILL") then - local msg = GetTitleAndSkill() - MOD.TitleWindow:Clear() - MOD.TitleWindow:AddMessage(msg) - elseif(event == "CHAT_MSG_LOOT") then - local item, amt = MOD:CheckForModeLoot(...); - if item then - local name, lnk, rarity, lvl, mlvl, itype, stype, cnt, ieq, tex, price = GetItemInfo(item); - if proxyTest == false then - LootProxy(lnk, name) - end; - if proxyTest == false then return end; - if not MOD.Cooking.Log[name] then - MOD.Cooking.Log[name] = {amount = 0, texture = ""}; - end; - local r, g, b, hex = GetItemQualityColor(rarity); - local stored = MOD.Cooking.Log - local mod = stored[name]; - local newAmt = mod.amount + 1; - if amt >= 2 then newAmt = mod.amount + amt end; - MOD.Cooking.Log[name].amount = newAmt; - MOD.Cooking.Log[name].texture = tex; - MOD.LogWindow:Clear(); - for name,data in pairs(stored) do - if type(data) == "table" and data.amount and data.texture then - MOD.LogWindow:AddMessage("|cff55FF55"..data.amount.." x|r |T".. data.texture ..":16:16:0:0:64:64:4:60:4:60|t".." "..name, r, g, b); - end - end; - MOD.LogWindow:AddMessage("----------------", 0, 0, 0); - MOD.LogWindow:AddMessage("Cooked So Far...", 0, 1, 1); - MOD.LogWindow:AddMessage(" ", 0, 0, 0); - proxyTest = false; - end - end - end; - - function EnableListener() - CookEventHandler:RegisterEvent("ZONE_CHANGED") - CookEventHandler:RegisterEvent("BAG_UPDATE") - CookEventHandler:RegisterEvent("CHAT_MSG_SKILL") - CookEventHandler:SetScript("OnEvent", Cook_OnEvent) - end - - function DisableListener() - CookEventHandler:UnregisterAllEvents() - CookEventHandler:SetScript("OnEvent", nil) - end -end ---[[ -########################################################## -CORE METHODS -########################################################## -]]-- -function MOD.Cooking:Enable() - MOD.Cooking:Update() - if(not SVUI_ModesDockFrame:IsShown()) then DockButton:Click() end - if(MOD.db.cooking.autoequip) then - UpdateChefWear(); - end - PlaySoundFile("Sound\\Spells\\Tradeskills\\CookingPrepareA.wav") - MOD.ModeAlert:SetBackdropColor(0.25, 0.52, 0.1) - - if(not IsSpellKnown(818)) then - MOD:ModeLootLoader("Cooking", "WTF is Cooking?", "You have no clue how to cook! \nEven toast is a mystery to you. \nGo find a trainer and learn \nhow to do this simple job."); - else - local msg = GetTitleAndSkill(); - if cookingSpell and GetSpellCooldown(campFire) > 0 then - MOD:ModeLootLoader("Cooking", msg, "Double-Right-Click anywhere on the screen \nto open your cookbook."); - _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") - _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', cookingSpell) - else - MOD:ModeLootLoader("Cooking", msg, "Double-Right-Click anywhere on the screen \nto start a cooking fire."); - _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") - _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', campFire) - end - end - EnableListener() - MOD.ModeAlert:Show() - SendModeMessage("Cooking Mode Enabled", CombatText_StandardScroll, 0.28, 0.9, 0.1); -end - -function MOD.Cooking:Disable() - DisableListener() -end - -function MOD.Cooking:Bind() - if InCombatLockdown() then return end - if cookingSpell then - if cookingSpell and GetSpellCooldown(campFire) > 0 then - _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") - _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', cookingSpell) - MOD.ModeAlert.HelpText = 'Double-Right-Click to open the cooking window.' - end - SetOverrideBindingClick(_G["SVUI_ModeCaptureWindow"], true, "BUTTON2", "SVUI_ModeCaptureWindow"); - _G["SVUI_ModeCaptureWindow"].Grip:Show(); - end -end - -function MOD.Cooking:Update() - campFire = GetSpellInfo(818); - local _,_,_,_,cook,_ = GetProfessions(); - if cook ~= nil then - cookingSpell, _, skillRank, _, _, _, _, skillModifier = GetProfessionInfo(cook) - end; -end ---[[ -########################################################## -LOADER -########################################################## -]]-- -function MOD:LoadCookingMode() - DockButton = _G["SVUI_ModesDockFrame_ToolBarButton"]; -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/laborer/modes/farming.lua b/Interface/AddOns/SVUI/packages/laborer/modes/farming.lua deleted file mode 100644 index df89a3f..0000000 --- a/Interface/AddOns/SVUI/packages/laborer/modes/farming.lua +++ /dev/null @@ -1,613 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local type = _G.type; -local string = _G.string; -local math = _G.math; -local table = _G.table; -local rept = string.rep; -local tsort,twipe = table.sort,table.wipe; -local floor,ceil = math.floor, math.ceil; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVLaborer; ---[[ -########################################################## -LOCAL VARS -########################################################## -]]-- -local NUM_SEED_BARS = 7 -local EnableListener, DisableListener, InventoryUpdate, LoadFarmingModeTools; -local seedButtons,farmToolButtons,portalButtons = {},{},{}; -local DockButton, ModeLogsFrame; -local refSeeds = {[79102]={1},[89328]={1},[80590]={1},[80592]={1},[80594]={1},[80593]={1},[80591]={1},[89329]={1},[80595]={1},[89326]={1},[80809]={3},[95434]={4},[89848]={3},[95437]={4},[84782]={3},[95436]={4},[85153]={3},[95438]={4},[85162]={3},[95439]={4},[85158]={3},[95440]={4},[84783]={3},[95441]={4},[89849]={3},[95442]={4},[85163]={3},[95443]={4},[89847]={3},[95444]={4},[85216]={2},[85217]={2},[89202]={2},[85215]={2},[89233]={2},[89197]={2},[85219]={2},[91806]={2},[95449]={5},[95450]={6},[95451]={5},[95452]={6},[95457]={5},[95458]={6},[95447]={5},[95448]={6},[95445]={5},[95446]={6},[95454]={5},[95456]={6},[85267]={7},[85268]={7},[85269]={7}}; -local refTools = {[79104]={30254},[80513]={30254},[89880]={30535},[89815]={31938}}; -local refPortals = {[91850]={"Horde"},[91861]={"Horde"},[91862]={"Horde"},[91863]={"Horde"},[91860]={"Alliance"},[91864]={"Alliance"},[91865]={"Alliance"},[91866]={"Alliance"}}; ---[[ -########################################################## -LOCAL FUNCTIONS -########################################################## -]]-- -local Scroll_OnValueChanged = function(self,argValue) - FarmModeFrame:SetVerticalScroll(argValue) -end - -local Scroll_OnMouseWheel = function(self, delta) - local scroll = self:GetVerticalScroll(); - local value = (scroll - (20 * delta)); - if value < -1 then - value = 0 - end; - if value > 420 then - value = 420 - end; - self:SetVerticalScroll(value) - self.slider:SetValue(value) -end - -local function FindItemInBags(itemId) - for container = 0, NUM_BAG_SLOTS do - for slot = 1, GetContainerNumSlots(container) do - if itemId == GetContainerItemID(container, slot) then - return container, slot - end - end - end -end ---[[ -########################################################## -EVENT HANDLER -########################################################## -]]-- -do - local FarmEventHandler = CreateFrame("Frame") - - local ButtonUpdate = function(button) - button.items = GetItemCount(button.itemId) - if button.text then - button.text:SetText(button.items) - end - button.icon:SetDesaturated(button.items == 0) - button.icon:SetAlpha(button.items == 0 and .25 or 1) - end - - local InFarmZone = function() - local zone = GetSubZoneText() - if (zone == L["Sunsong Ranch"] or zone == L["The Halfhill Market"]) then - if MOD.Farming.ToolsLoaded and MOD.ModeAlert:IsShown() then - MOD.TitleWindow:Clear() - MOD.TitleWindow:AddMessage("|cff22ff11Farming Mode|r") - end - return true - else - if MOD.Farming.ToolsLoaded and MOD.ModeAlert:IsShown() then - MOD.TitleWindow:Clear() - MOD.TitleWindow:AddMessage("|cffff2211Must be in Sunsong Ranch|r") - end - return false - end; - end - - local UpdateFarmtoolCooldown = function() - for i = 1, NUM_SEED_BARS do - for _, button in ipairs(seedButtons[i]) do - if button.cooldown then - button.cooldown:SetCooldown(GetItemCooldown(button.itemId)) - end - end - end - for _, button in ipairs(farmToolButtons) do - if button.cooldown then - button.cooldown:SetCooldown(GetItemCooldown(button.itemId)) - end - end - for _, button in ipairs(portalButtons) do - if button.cooldown then - button.cooldown:SetCooldown(GetItemCooldown(button.itemId)) - end - end - end - - local Farm_OnEvent = function(self, event, ...) - if(InCombatLockdown()) then return end - if(event == "ZONE_CHANGED") then - local inZone = InFarmZone() - if not inZone and MOD.db.farming.droptools then - for k, v in pairs(refTools) do - local container, slot = FindItemInBags(k) - if container and slot then - PickupContainerItem(container, slot) - DeleteCursorItem() - end - end - end - if inZone then - self:RegisterEvent("BAG_UPDATE") - self:RegisterEvent("BAG_UPDATE_COOLDOWN") - else - self:UnregisterEvent("BAG_UPDATE") - self:UnregisterEvent("BAG_UPDATE_COOLDOWN") - end - InventoryUpdate() - elseif(event == "BAG_UPDATE") then - InventoryUpdate() - elseif(event == "BAG_UPDATE_COOLDOWN") then - UpdateFarmtoolCooldown() - end - end; - - InventoryUpdate = function() - if InCombatLockdown() then - FarmEventHandler:RegisterEvent("PLAYER_REGEN_ENABLED", InventoryUpdate) - return - else - FarmEventHandler:UnregisterEvent("PLAYER_REGEN_ENABLED") - end - for i = 1, NUM_SEED_BARS do - for _, button in ipairs(seedButtons[i]) do - ButtonUpdate(button) - end - end - for _, button in ipairs(farmToolButtons) do - ButtonUpdate(button) - end - for _, button in ipairs(portalButtons) do - ButtonUpdate(button) - end - - MOD:RefreshFarmingTools() - end - - EnableListener = function() - FarmEventHandler:RegisterEvent("ZONE_CHANGED") - FarmEventHandler:SetScript("OnEvent", Farm_OnEvent) - end - - DisableListener = function() - FarmEventHandler:UnregisterAllEvents() - FarmEventHandler:SetScript("OnEvent", nil) - end -end ---[[ -########################################################## -LOADING HANDLER -########################################################## -]]-- -do - local seedsort = function(a, b) return a.sortname < b.sortname end; - - local SeedToSoil = function(group, itemId) - if(UnitName("target") ~= L["Tilled Soil"]) then return false; end - for i, v in pairs(group) do - if i == itemId then return true end - end - return false - end; - - local Button_OnEnter = function(self) - GameTooltip:SetOwner(self, 'ANCHOR_TOPLEFT', 2, 4) - GameTooltip:ClearLines() - GameTooltip:AddDoubleLine(self.sortname) - if self.allowDrop then - GameTooltip:AddLine(L['Right-click to drop the item.']) - end - GameTooltip:Show() - end; - - local Button_OnLeave = function() - GameTooltip:Hide() - end; - - local Button_OnMouseDown = function(self, mousebutton) - if InCombatLockdown() then return end - if mousebutton == "LeftButton" then - self:SetAttribute("type", self.buttonType) - self:SetAttribute(self.buttonType, self.sortname) - if(SeedToSoil(refSeeds, self.itemId)) then - local container, slot = FindItemInBags(self.itemId) - if container and slot then - self:SetAttribute("type", "macro") - self:SetAttribute("macrotext", format("/targetexact %s \n/use %s %s", L["Tilled Soil"], container, slot)) - end - end - if self.cooldown then - self.cooldown:SetCooldown(GetItemCooldown(self.itemId)) - end - elseif mousebutton == "RightButton" and self.allowDrop then - self:SetAttribute("type", "click") - local container, slot = FindItemInBags(self.itemId) - if container and slot then - PickupContainerItem(container, slot) - DeleteCursorItem() - end - end - end; - - local function CreateFarmingButton(index, owner, buttonName, buttonType, name, texture, allowDrop, showCount) - local BUTTONSIZE = owner.ButtonSize; - local button = CreateFrame("Button", ("FarmingButton"..buttonName.."%d"):format(index), owner, "SecureActionButtonTemplate") - button:SetFixedPanelTemplate("Transparent") - button.Panel:SetFrameLevel(0) - button:SetNormalTexture(nil) - button:Size(BUTTONSIZE, BUTTONSIZE) - button.sortname = name - button.itemId = index - button.allowDrop = allowDrop - button.buttonType = buttonType - button.items = GetItemCount(index) - button.icon = button:CreateTexture(nil, "OVERLAY", nil, 2) - button.icon:SetTexture(texture) - button.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - button.icon:FillInner(button,2,2) - if showCount then - button.text = button:CreateFontString(nil, "OVERLAY") - button.text:SetFont(SuperVillain.Media.font.action, 12, "OUTLINE") - button.text:SetPoint("BOTTOMRIGHT", button, 1, 2) - end - button.cooldown = CreateFrame("Cooldown", ("FarmingButton"..buttonName.."%dCooldown"):format(index), button) - button.cooldown:SetAllPoints(button) - button:SetScript("OnEnter", Button_OnEnter) - button:SetScript("OnLeave", Button_OnLeave) - button:SetScript("OnMouseDown", Button_OnMouseDown) - return button - end - - function LoadFarmingModeTools() - local itemError = false - for k, v in pairs(refSeeds) do - if select(2, GetItemInfo(k)) == nil then itemError = true end - end - for k, v in pairs(refTools) do - if select(2, GetItemInfo(k)) == nil then itemError = true end - end - for k, v in pairs(refPortals) do - if select(2, GetItemInfo(k)) == nil then itemError = true end - end - if InCombatLockdown() or itemError then - MOD.TitleWindow:AddMessage("|cffffff11Loading Farm Tools...|r|cffff1111PLEASE WAIT|r") - SuperVillain:ExecuteTimer(LoadFarmingModeTools, 5) - else - local horizontal = MOD.db.farming.toolbardirection == 'HORIZONTAL' - - local seeds, farmtools, portals = {},{},{} - - for k, v in pairs(refSeeds) do - seeds[k] = { v[1], GetItemInfo(k) } - end - - for k, v in pairs(refTools) do - farmtools[k] = { v[1], GetItemInfo(k) } - end - - for k, v in pairs(refPortals) do - portals[k] = { v[1], GetItemInfo(k) } - end - - for i = 1, NUM_SEED_BARS do - local seedBar = _G["FarmSeedBar"..i] - seedButtons[i] = seedButtons[i] or {} - local sbc = 1; - for k, v in pairs(seeds) do - if v[1] == i then - seedButtons[i][sbc] = CreateFarmingButton(k, seedBar, "SeedBar"..i.."Seed", "item", v[2], v[11], false, true); - sbc = sbc + 1; - end - tsort(seedButtons[i], seedsort) - end - end - - local ftc = 1; - for k, v in pairs(farmtools) do - farmToolButtons[ftc] = CreateFarmingButton(k, _G["FarmToolBar"], "Tools", "item", v[2], v[11], true, false); - ftc = ftc + 1; - end - - local playerFaction = UnitFactionGroup('player') - local pbc = 1; - for k, v in pairs(portals) do - if v[1] == playerFaction then - portalButtons[pbc] = CreateFarmingButton(k, _G["FarmPortalBar"], "Portals", "item", v[2], v[11], false, true); - pbc = pbc + 1; - end - end - - MOD.Farming.Loaded = true - SuperVillain:ExecuteTimer(MOD.Farming.Enable, 1.5) - end - end -end ---[[ -########################################################## -CORE FUNCTIONS -########################################################## -]]-- -MOD.Farming = {}; -MOD.Farming.Loaded = false; -MOD.Farming.ToolsLoaded = false; - -function MOD.Farming:Enable() - if InCombatLockdown() then return end - - MOD:ModeLootLoader("Farming", "Farming Mode", "This mode will provide you \nwith fast-access buttons for each \nof your seeds and farming tools."); - - MOD.TitleWindow:Clear() - if(not MOD.Farming.Loaded) then - MOD.TitleWindow:AddMessage("|cffffff11Loading Farm Tools...|r") - LoadFarmingModeTools() - return - else - if not MOD.Farming.ToolsLoaded then - PlaySoundFile("Sound\\Effects\\DeathImpacts\\mDeathImpactColossalDirtA.wav") - MOD.TitleWindow:AddMessage("|cff22ff11Farming Mode|r") - MOD.ModeAlert:Show() - InventoryUpdate() - MOD.Farming.ToolsLoaded = true - EnableListener() - if not FarmModeFrame:IsShown() then FarmModeFrame:Show() end - if(not SVUI_ModesDockFrame:IsShown()) then DockButton:Click() end - end - end -end - -function MOD.Farming:Disable() - if(InCombatLockdown() or (not MOD.Farming.Loaded) or (not MOD.Farming.ToolsLoaded)) then - DisableListener() - return - end - if MOD.db.farming.droptools then - for k, v in pairs(refTools) do - local container, slot = FindItemInBags(k) - if container and slot then - PickupContainerItem(container, slot) - DeleteCursorItem() - end - end - end - if FarmModeFrame:IsShown() then FarmModeFrame:Hide() end - MOD.Farming.ToolsLoaded = false - DisableListener() -end ---[[ -########################################################## -CORE FUNCTIONS -########################################################## -]]-- -function MOD:RefreshFarmingTools() - local count, horizontal = 0, MOD.db.farming.toolbardirection == 'HORIZONTAL' - local BUTTONSPACE = MOD.db.farming.buttonspacing or 2; - local lastBar; - if not FarmToolBar:IsShown() then - _G["FarmSeedBarAnchor"]:SetPoint("TOPLEFT", _G["FarmModeFrameSlots"], "TOPLEFT", 0, 0) - else - _G["FarmSeedBarAnchor"]:SetPoint("TOPLEFT", _G["FarmToolBar"], horizontal and "BOTTOMLEFT" or "TOPRIGHT", 0, 0) - end - - for i = 1, NUM_SEED_BARS do - local seedBar = _G["FarmSeedBar"..i] - count = 0 - for i, button in ipairs(seedButtons[i]) do - local BUTTONSIZE = seedBar.ButtonSize; - button:Point("TOPLEFT", seedBar, "TOPLEFT", horizontal and (count * (BUTTONSIZE + BUTTONSPACE) + 1) or 1, horizontal and -1 or -(count * (BUTTONSIZE + BUTTONSPACE) + 1)) - button:Size(BUTTONSIZE,BUTTONSIZE) - if (not MOD.db.farming.onlyactive or (MOD.db.farming.onlyactive and button.items > 0)) then - button.icon:SetVertexColor(1,1,1) - count = count + 1 - elseif (not MOD.db.farming.onlyactive and button.items <= 0) then - button:Show() - button.icon:SetVertexColor(0.25,0.25,0.25) - count = count + 1 - else - button:Hide() - end - end - if(MOD.db.farming.onlyactive and not MOD.db.farming.undocked) then - if count==0 then - seedBar:Hide() - else - seedBar:Show() - if(not lastBar) then - seedBar:SetPoint("TOPLEFT", _G["FarmSeedBarAnchor"], "TOPLEFT", 0, 0) - else - seedBar:SetPoint("TOPLEFT", lastBar, horizontal and "BOTTOMLEFT" or "TOPRIGHT", 0, 0) - end - lastBar = seedBar - end - end - end - count = 0; - lastBar = nil; - FarmToolBar:ClearAllPoints() - FarmToolBar:SetAllPoints(FarmToolBarAnchor) - for i, button in ipairs(farmToolButtons) do - local BUTTONSIZE = FarmToolBar.ButtonSize; - button:Point("TOPLEFT", FarmToolBar, "TOPLEFT", horizontal and (count * (BUTTONSIZE + BUTTONSPACE) + 1) or 1, horizontal and -1 or -(count * (BUTTONSIZE + BUTTONSPACE) + 1)) - button:Size(BUTTONSIZE,BUTTONSIZE) - if (not MOD.db.farming.onlyactive or (MOD.db.farming.onlyactive and button.items > 0)) then - button:Show() - button.icon:SetVertexColor(1,1,1) - count = count + 1 - elseif (not MOD.db.farming.onlyactive and button.items == 0) then - button:Show() - button.icon:SetVertexColor(0.25,0.25,0.25) - count = count + 1 - else - button:Hide() - end - end - if(MOD.db.farming.onlyactive and not MOD.db.farming.undocked) then - if count==0 then - FarmToolBarAnchor:Hide() - FarmPortalBar:SetPoint("TOPLEFT", FarmModeFrameSlots, "TOPLEFT", 0, 0) - else - FarmToolBarAnchor:Show() - FarmPortalBar:SetPoint("TOPLEFT", FarmToolBarAnchor, "TOPRIGHT", 0, 0) - end - end - count = 0; - FarmPortalBar:ClearAllPoints() - FarmPortalBar:SetAllPoints(FarmPortalBarAnchor) - for i, button in ipairs(portalButtons) do - local BUTTONSIZE = FarmPortalBar.ButtonSize; - button:Point("TOPLEFT", FarmPortalBar, "TOPLEFT", horizontal and (count * (BUTTONSIZE + BUTTONSPACE) + 1) or 1, horizontal and -1 or -(count * (BUTTONSIZE + BUTTONSPACE) + 1)) - button:Size(BUTTONSIZE,BUTTONSIZE) - if (not MOD.db.farming.onlyactive or (MOD.db.farming.onlyactive and button.items > 0)) then - button:Show() - button.icon:SetVertexColor(1,1,1) - count = count + 1 - elseif (not MOD.db.farming.onlyactive and button.items == 0) then - button:Show() - button.icon:SetVertexColor(0.25,0.25,0.25) - count = count + 1 - else - button:Hide() - end - end - if(MOD.db.farming.onlyactive) then - if count==0 then - FarmPortalBar:Hide() - else - FarmPortalBar:Show() - end - end -end - -function MOD:PrepareFarmingTools() - local horizontal = self.db.farming.toolbardirection == "HORIZONTAL" - local BUTTONSPACE = self.db.farming.buttonspacing or 2; - - ModeLogsFrame = MOD.LogWindow; - DockButton = _G["SVUI_ModesDockFrame_ToolBarButton"] - - if not self.db.farming.undocked then - local bgTex = [[Interface\BUTTONS\WHITE8X8]] - local bdTex = SuperVillain.Media.bar.glow - local farmingDocklet = CreateFrame("ScrollFrame", "FarmModeFrame", ModeLogsFrame); - farmingDocklet:SetPoint("TOPLEFT", ModeLogsFrame, 31, -3); - farmingDocklet:SetPoint("BOTTOMRIGHT", ModeLogsFrame, -3, 3); - farmingDocklet:EnableMouseWheel(true); - - local farmingDockletSlots = CreateFrame("Frame", "FarmModeFrameSlots", farmingDocklet); - farmingDockletSlots:SetPoint("TOPLEFT", farmingDocklet, 0, 0); - farmingDockletSlots:SetWidth(farmingDocklet:GetWidth()) - farmingDockletSlots:SetHeight(500); - farmingDockletSlots:SetFrameLevel(farmingDocklet:GetFrameLevel() + 1) - farmingDocklet:SetScrollChild(farmingDockletSlots) - - local slotSlider = CreateFrame("Slider", "FarmModeSlotSlider", farmingDocklet); - slotSlider:SetHeight(farmingDocklet:GetHeight() - 3); - slotSlider:SetWidth(18); - slotSlider:SetPoint("TOPLEFT", farmingDocklet, -28, 0); - slotSlider:SetPoint("BOTTOMLEFT", farmingDocklet, -28, 0); - slotSlider:SetBackdrop({bgFile = bgTex, edgeFile = bdTex, edgeSize = 4, insets = {left = 3, right = 3, top = 3, bottom = 3}}); - slotSlider:SetFrameLevel(6) - slotSlider:SetFixedPanelTemplate("Transparent", true); - slotSlider:SetThumbTexture("Interface\\Buttons\\UI-ScrollBar-Knob"); - slotSlider:SetOrientation("VERTICAL"); - slotSlider:SetValueStep(5); - slotSlider:SetMinMaxValues(1, 420); - slotSlider:SetValue(1); - - farmingDocklet.slider = slotSlider; - slotSlider:SetScript("OnValueChanged", Scroll_OnValueChanged) - farmingDocklet:SetScript("OnMouseWheel", Scroll_OnMouseWheel); - - local parentWidth = FarmModeFrameSlots:GetWidth() - 31 - local BUTTONSIZE = (parentWidth / (horizontal and 10 or 8)); - local TOOLSIZE = (parentWidth / 8); - - -- FARM TOOLS - local farmToolBarAnchor = CreateFrame("Frame", "FarmToolBarAnchor", farmingDockletSlots) - farmToolBarAnchor:Point("TOPLEFT", farmingDockletSlots, "TOPLEFT", 0, 0) - farmToolBarAnchor:Size(horizontal and ((TOOLSIZE + BUTTONSPACE) * 4) or (TOOLSIZE + BUTTONSPACE), horizontal and (TOOLSIZE + BUTTONSPACE) or ((TOOLSIZE + BUTTONSPACE) * 4)) - - local farmToolBar = CreateFrame("Frame", "FarmToolBar", farmToolBarAnchor) - farmToolBar:Size(horizontal and ((TOOLSIZE + BUTTONSPACE) * 4) or (TOOLSIZE + BUTTONSPACE), horizontal and (TOOLSIZE + BUTTONSPACE) or ((TOOLSIZE + BUTTONSPACE) * 4)) - farmToolBar:SetPoint("TOPLEFT", farmToolBarAnchor, "TOPLEFT", (horizontal and BUTTONSPACE or (TOOLSIZE + BUTTONSPACE)), (horizontal and -(TOOLSIZE + BUTTONSPACE) or -BUTTONSPACE)) - farmToolBar.ButtonSize = TOOLSIZE; - - -- PORTALS - local farmPortalBarAnchor = CreateFrame("Frame", "FarmPortalBarAnchor", farmingDockletSlots) - farmPortalBarAnchor:Point("TOPLEFT", farmToolBarAnchor, "TOPRIGHT", 0, 0) - farmPortalBarAnchor:Size(horizontal and ((TOOLSIZE + BUTTONSPACE) * 4) or (TOOLSIZE + BUTTONSPACE), horizontal and (TOOLSIZE + BUTTONSPACE) or ((TOOLSIZE + BUTTONSPACE) * 4)) - - local farmPortalBar = CreateFrame("Frame", "FarmPortalBar", farmPortalBarAnchor) - farmPortalBar:Size(horizontal and ((TOOLSIZE + BUTTONSPACE) * 4) or (TOOLSIZE + BUTTONSPACE), horizontal and (TOOLSIZE + BUTTONSPACE) or ((TOOLSIZE + BUTTONSPACE) * 4)) - farmPortalBar:SetPoint("TOPLEFT", farmPortalBarAnchor, "TOPLEFT", (horizontal and BUTTONSPACE or (TOOLSIZE + BUTTONSPACE)), (horizontal and -(TOOLSIZE + BUTTONSPACE) or -BUTTONSPACE)) - farmPortalBar.ButtonSize = TOOLSIZE; - - -- SEEDS - local farmSeedBarAnchor = CreateFrame("Frame", "FarmSeedBarAnchor", farmingDockletSlots) - farmSeedBarAnchor:Point("TOPLEFT", farmPortalBarAnchor, horizontal and "BOTTOMLEFT" or "TOPRIGHT", 0, 0) - farmSeedBarAnchor:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 10) or ((BUTTONSIZE + BUTTONSPACE) * 8), horizontal and ((BUTTONSIZE + BUTTONSPACE) * 8) or ((BUTTONSIZE + BUTTONSPACE) * 10)) - - for i = 1, NUM_SEED_BARS do - local seedBar = CreateFrame("Frame", "FarmSeedBar"..i, farmSeedBarAnchor) - seedBar.ButtonSize = BUTTONSIZE; - seedBar:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 10) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 10)) - if i == 1 then - seedBar:SetPoint("TOPLEFT", farmSeedBarAnchor, "TOPLEFT", 0, 0) - else - seedBar:SetPoint("TOPLEFT", "FarmSeedBar"..i-1, horizontal and "BOTTOMLEFT" or "TOPRIGHT", 0, 0) - end - end - - farmingDocklet:Hide() - else - local BUTTONSIZE = self.db.farming.buttonsize or 35; - - -- SEEDS - local farmSeedBarAnchor = CreateFrame("Frame", "FarmSeedBarAnchor", SuperVillain.UIParent) - farmSeedBarAnchor:Point("TOPRIGHT", SuperVillain.UIParent, "TOPRIGHT", -40, -300) - farmSeedBarAnchor:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 10) or ((BUTTONSIZE + BUTTONSPACE) * 8), horizontal and ((BUTTONSIZE + BUTTONSPACE) * 8) or ((BUTTONSIZE + BUTTONSPACE) * 10)) - for i = 1, NUM_SEED_BARS do - local seedBar = CreateFrame("Frame", "FarmSeedBar"..i, farmSeedBarAnchor) - seedBar:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 10) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 10)) - seedBar:SetPoint("TOPRIGHT", _G["FarmSeedBarAnchor"], "TOPRIGHT", (horizontal and 0 or -((BUTTONSIZE + BUTTONSPACE) * i)), (horizontal and -((BUTTONSIZE + BUTTONSPACE) * i) or 0)) - seedBar.ButtonSize = BUTTONSIZE; - end - SuperVillain:SetSVMovable(farmSeedBarAnchor, "Farming Seeds") - - -- FARM TOOLS - local farmToolBarAnchor = CreateFrame("Frame", "FarmToolBarAnchor", SuperVillain.UIParent) - farmToolBarAnchor:Point("TOPRIGHT", farmSeedBarAnchor, horizontal and "BOTTOMRIGHT" or "TOPLEFT", horizontal and 0 or -(BUTTONSPACE * 2), horizontal and -(BUTTONSPACE * 2) or 0) - farmToolBarAnchor:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 4) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 4)) - local farmToolBar = CreateFrame("Frame", "FarmToolBar", farmToolBarAnchor) - farmToolBar:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 4) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 4)) - farmToolBar:SetPoint("TOPRIGHT", farmToolBarAnchor, "TOPRIGHT", (horizontal and -BUTTONSPACE or -(BUTTONSIZE + BUTTONSPACE)), (horizontal and -(BUTTONSIZE + BUTTONSPACE) or -BUTTONSPACE)) - farmToolBar.ButtonSize = BUTTONSIZE; - SuperVillain:SetSVMovable(farmToolBarAnchor, "Farming Tools") - - -- PORTALS - local farmPortalBarAnchor = CreateFrame("Frame", "FarmPortalBarAnchor", SuperVillain.UIParent) - farmPortalBarAnchor:Point("TOPRIGHT", farmToolBarAnchor, horizontal and "BOTTOMRIGHT" or "TOPLEFT", horizontal and 0 or -(BUTTONSPACE * 2), horizontal and -(BUTTONSPACE * 2) or 0) - farmPortalBarAnchor:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 4) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 4)) - local farmPortalBar = CreateFrame("Frame", "FarmPortalBar", farmPortalBarAnchor) - farmPortalBar:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 4) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 4)) - farmPortalBar:SetPoint("TOPRIGHT", farmPortalBarAnchor, "TOPRIGHT", (horizontal and -BUTTONSPACE or -(BUTTONSIZE + BUTTONSPACE)), (horizontal and -(BUTTONSIZE + BUTTONSPACE) or -BUTTONSPACE)) - farmPortalBar.ButtonSize = BUTTONSIZE; - SuperVillain:SetSVMovable(farmPortalBarAnchor, "Farming Portals") - end -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/laborer/modes/fishing.lua b/Interface/AddOns/SVUI/packages/laborer/modes/fishing.lua deleted file mode 100644 index bcc3730..0000000 --- a/Interface/AddOns/SVUI/packages/laborer/modes/fishing.lua +++ /dev/null @@ -1,379 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local type = _G.type; -local string = _G.string; -local math = _G.math; -local table = _G.table; -local rept = string.rep; -local tsort,twipe = table.sort,table.wipe; -local floor,ceil = math.floor, math.ceil; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SuperVillain, L = unpack(select(2, ...)); -local MOD = SuperVillain.SVLaborer; ---[[ -########################################################## -LOCAL VARS -########################################################## -]]-- -local fishingIsKnown, fishingSpell, fishingLure; -local proxyTest = false; -local refLures = { - { ["id"] = 6529, ["bonus"] = 25, ["skillReq"] = 1, ["order"] = 10, }, --Shiny Bauble - { ["id"] = 6811, ["bonus"] = 50, ["skillReq"] = 50, ["order"] = 10, }, --Aquadynamic Fish Lens - { ["id"] = 6530, ["bonus"] = 50, ["skillReq"] = 50, ["order"] = 10, }, --Nightcrawlers - { ["id"] = 7307, ["bonus"] = 75, ["skillReq"] = 100, ["order"] = 10, }, --Flesh Eating Worm - { ["id"] = 6532, ["bonus"] = 75, ["skillReq"] = 100, ["order"] = 10, }, --Bright Baubles - { ["id"] = 34861, ["bonus"] = 100, ["skillReq"] = 100, ["order"] = 10, }, --Sharpened Fish Hook - { ["id"] = 6533, ["bonus"] = 100, ["skillReq"] = 100, ["order"] = 10, }, --Aquadynamic Fish Attractor - { ["id"] = 62673, ["bonus"] = 100, ["skillReq"] = 100, ["order"] = 10, }, --Feathered Lure - { ["id"] = 46006, ["bonus"] = 100, ["skillReq"] = 100, ["order"] = 60, }, --Glow Worm - { ["id"] = 68049, ["bonus"] = 150, ["skillReq"] = 250, ["order"] = 5, }, --Heat-Treated Spinning Lure - { ["id"] = 67404, ["bonus"] = 15, ["skillReq"] = 1, ["order"] = 10, }, --Glass Fishing Bobber -} -tsort(refLures, function(a,b) - if ( a.bonus == b.bonus ) then - return a.order < b.order; - else - return a.bonus < b.bonus; - end -end); -local refHats = { - { ["id"] = 93732, ["weight"] = 10, ["nocast"] = true }, --Darkmoon Fishing Hat - { ["id"] = 33820, ["weight"] = 50 }, --Weather Beaten Fishing Hat - { ["id"] = 19972, ["weight"] = 75 }, --Lucky Fishing Hat - { ["id"] = 88710, ["weight"] = 100 }, --Nats Hat -} -local refPoles = { - { ["id"] = 44050, ["weight"] = 33 }, --Kaluak - { ["id"] = 25978, ["weight"] = 22 }, --Seths Graphite - { ["id"] = 19022, ["weight"] = 21 }, --Nat Pagles Extreme Angler - { ["id"] = 6367, ["weight"] = 20 }, --Big Iron - { ["id"] = 6366, ["weight"] = 15 }, --Darkwood - { ["id"] = 84661, ["weight"] = 32 }, --Dragon - { ["id"] = 19970, ["weight"] = 40 }, --Arcanite - { ["id"] = 45858, ["weight"] = 25 }, --Nats Lucky - { ["id"] = 45992, ["weight"] = 31 }, --Jeweled - { ["id"] = 45991, ["weight"] = 30 }, --Bone - { ["id"] = 6365, ["weight"] = 5 }, --Strong - { ["id"] = 12225, ["weight"] = 4 }, --Blump Family - { ["id"] = 46337, ["weight"] = 3 }, --Staats - { ["id"] = 84660, ["weight"] = 10 }, --Pandaren - { ["id"] = 6256, ["weight"] = 1 } --Standard -} -local DockButton; ---[[ -########################################################## -LOCAL FUNCTIONS -########################################################## -]]-- -local function SendModeMessage(...) - if not CombatText_AddMessage then return end; - CombatText_AddMessage(...) -end; - -local function GetFishingSkill() - local fishing = select(4, GetProfessions()) - if (fishing) then - local rank = select(3, GetProfessionInfo(fishing)) - return rank - end - return 0, 0, 0 -end; - -local function FishingPoleIsEquipped() - local itemId = GetInventoryItemID("player", 16) - if itemId then - local subclass = select(7, GetItemInfo(itemId)) - local weaponSubTypesList = select(17, GetAuctionItemSubClasses(1)) - if subclass == weaponSubTypesList then - return true - else - return false - end - else - return false - end -end - -local function UpdateFishingGear(autoequip) - local lastBonus, lastWeight = 0,0; - local rawskill = GetFishingSkill(); - local item,id,bonus,count; - - -- Check for and equip a fishing hat, if autoequip is enabled - if(autoequip) then - local fishingHat = false; - for i=1, #refHats do - item = refHats[i] - id = item.id - bonus = item.weight - count = GetItemCount(id) - if ( count > 0 and bonus > lastWeight ) then - fishingHat = id - lastWeight = bonus - if(item.weight > 10) then - fishingLure = id - lastBonus = bonus - end - end - end - if(fishingHat) then - local HelmetID = GetInventoryItemID("player", INVSLOT_HEAD); - if(HelmetID) then - MOD.WornItems["HEAD"] = HelmetID - end - EquipItemByName(fishingHat) - MOD.InModeGear = true - end - end - - -- Check for and save best fishing lure - for i=1, #refLures do - item = refLures[i] - id = item.id - bonus = item.bonus - count = GetItemCount(id) - if ( count > 0 and bonus > (lastBonus or 0) ) then - if ( item.skillReq <= rawskill ) then - fishingLure = id - lastBonus = bonus - end - end - end - - -- Check for and equip a fishing pole, if autoequip is enabled - if(autoequip) then - lastBonus = 0; - local fishingPole = false; - for i=1, #refPoles do - item = refPoles[i] - id = item.id - bonus = item.weight - count = GetItemCount(id) - if ( count > 0 and bonus > (lastBonus or 0) ) then - fishingPole = id - lastBonus = bonus - end - end - if(fishingPole) then - local MainHandID = GetInventoryItemID("player", INVSLOT_MAINHAND); - if(MainHandID) then - MOD.WornItems["MAIN"] = MainHandID - end - - local OffHandID = GetInventoryItemID("player", INVSLOT_OFFHAND); - if(OffHandID) then - MOD.WornItems["OFF"] = OffHandID; - end - - EquipItemByName(fishingPole) - MOD.InModeGear = true - end - end -end - -local function LootProxy(item, name) - if(item) then - local mask = [[0x100000]]; - local itemType = GetItemFamily(item); - local pass = bit.band(itemType, mask); - if pass > 0 then - proxyTest = true; - end - end -end; - -local function GetTitleAndSkill() - local skillRank, skillModifier; - local msg = "|cff22ff11Fishing Mode|r" - local _,_,_,fishing,_,_ = GetProfessions(); - if fishing ~= nil then - _, _, skillRank, _, _, _, _, skillModifier = GetProfessionInfo(fishing) - if(skillModifier) then - skillRank = skillRank + skillModifier; - end - msg = msg .. " (|cff00ddff" .. skillRank .. "|r)"; - end; - return msg -end ---[[ -########################################################## -CORE NAMESPACE -########################################################## -]]-- -MOD.Fishing = {}; -MOD.Fishing.Log = {}; -MOD.Fishing.Loaded = false; ---[[ -########################################################## -EVENT HANDLER -########################################################## -]]-- -do - local FishEventHandler = CreateFrame("Frame") - local LootProxy = function(item, name) - if(item) then - local mask = [[0x10000]]; - local itemType = GetItemFamily(item); - local pass = bit.band(itemType, mask); - if pass > 0 then - proxyTest = true; - end - end - end; - - local Fish_OnEvent = function(self, event, ...) - if(InCombatLockdown()) then return end - if(event == "BAG_UPDATE" or event == "CHAT_MSG_SKILL") then - local msg = GetTitleAndSkill() - MOD.TitleWindow:Clear() - MOD.TitleWindow:AddMessage(msg) - elseif(event == "LOOT_OPENED") then - if IsFishingLoot() then - proxyTest = true; - else - proxyTest = false; - end - elseif(event == "CHAT_MSG_LOOT") then - local item, amt = MOD:CheckForModeLoot(...); - if item then - local name, lnk, rarity, lvl, mlvl, itype, stype, cnt, ieq, tex, price = GetItemInfo(item); - if proxyTest == false then - LootProxy(lnk, name) - end; - if proxyTest == false then return end; - if not MOD.Fishing.Log[name] then - MOD.Fishing.Log[name] = {amount = 0, texture = ""}; - end; - local r, g, b, hex = GetItemQualityColor(rarity); - local stored = MOD.Fishing.Log - local mod = stored[name]; - local newAmt = mod.amount + 1; - if amt >= 2 then newAmt = mod.amount + amt end; - MOD.Fishing.Log[name].amount = newAmt; - MOD.Fishing.Log[name].texture = tex; - MOD.LogWindow:Clear(); - - for name,data in pairs(stored) do - if type(data) == "table" and data.amount and data.texture then - MOD.LogWindow:AddMessage("|cff55FF55"..data.amount.." x|r |T".. data.texture ..":16:16:0:0:64:64:4:60:4:60|t".." "..name, r, g, b); - end - end; - MOD.LogWindow:AddMessage("----------------", 0, 0, 0); - MOD.LogWindow:AddMessage("Caught So Far...", 0, 1, 1); - MOD.LogWindow:AddMessage(" ", 0, 0, 0); - proxyTest = false; - end - end - end; - - function EnableListener() - FishEventHandler:RegisterEvent("LOOT_OPENED") - FishEventHandler:RegisterEvent("CHAT_MSG_LOOT") - FishEventHandler:RegisterEvent("BAG_UPDATE") - FishEventHandler:RegisterEvent("CHAT_MSG_SKILL") - FishEventHandler:SetScript("OnEvent", Fish_OnEvent) - end - - function DisableListener() - FishEventHandler:UnregisterAllEvents() - FishEventHandler:SetScript("OnEvent", nil) - end -end ---[[ -########################################################## -CORE METHODS -########################################################## -]]-- -function MOD.Fishing:Enable() - MOD:UpdateFishingMode() - if(not SVUI_ModesDockFrame:IsShown()) then DockButton:Click() end - UpdateFishingGear(MOD.db.fishing.autoequip); - PlaySoundFile("Sound\\Spells\\Tradeskills\\FishCast.wav") - MOD.ModeAlert:SetBackdropColor(0.25, 0.52, 0.1) - if(not IsSpellKnown(131474)) then - MOD:ModeLootLoader("Fishing", "WTF is Fishing?", "You have no clue how to fish! \nThe last time you tried \nyou hooked yourself through the eyelid. \nGo find a trainer and learn \nhow to do this properly!"); - else - local msg = GetTitleAndSkill(); - MOD:ModeLootLoader("Fishing", msg, "Double-Right-Click anywhere on the screen \nto cast your fishing line."); - end - EnableListener() - MOD.ModeAlert:Show() - SendModeMessage("Fishing Mode Enabled", CombatText_StandardScroll, 0.28, 0.9, 0.1); -end - -function MOD.Fishing:Disable() - DisableListener() -end - -function MOD.Fishing:Bind() - if InCombatLockdown() then return end - if fishingIsKnown then - if FishingPoleIsEquipped() then - local hasMainHandEnchant = GetWeaponEnchantInfo() - if hasMainHandEnchant then - _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") - _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', fishingSpell) - MOD.ModeAlert.HelpText = 'Double-Right-Click to fish.' - elseif(fishingLure) then - _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "item") - _G["SVUI_ModeCaptureWindow"]:SetAttribute("item", "item:" .. fishingLure) - if(GetItemCooldown(fishingLure) > 0) then - _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") - _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', fishingSpell) - MOD.ModeAlert.HelpText = 'Double-Right-Click to fish.' - else - MOD.ModeAlert.HelpText = 'Double-Right-Click to apply fishing enchants.' - end - else - _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") - _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', fishingSpell) - MOD.ModeAlert.HelpText = 'Double-Right-Click to fish.' - end - else - _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") - _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', fishingSpell) - MOD.ModeAlert.HelpText = 'Double-Right-Click to fish.' - end - SetOverrideBindingClick(_G["SVUI_ModeCaptureWindow"], true, "BUTTON2", "SVUI_ModeCaptureWindow"); - _G["SVUI_ModeCaptureWindow"].Grip:Show(); - end -end ---[[ -########################################################## -LOADER -########################################################## -]]-- -function MOD:UpdateFishingMode() - fishingIsKnown = IsSpellKnown(131474); - fishingSpell = GetSpellInfo(131474); -end - -function MOD:LoadFishingMode() - DockButton = _G["SVUI_ModesDockFrame_ToolBarButton"] - MOD:UpdateFishingMode() -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/map/SVMap.lua b/Interface/AddOns/SVUI/packages/map/SVMap.lua index 48d0585..7938b04 100644 --- a/Interface/AddOns/SVUI/packages/map/SVMap.lua +++ b/Interface/AddOns/SVUI/packages/map/SVMap.lua @@ -36,7 +36,7 @@ local parsefloat = math.parsefloat; -- Uncommon GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SuperVillain, L, G, CONFIGS = unpack(select(2, ...)); local MOD = {}; --[[ ########################################################## @@ -92,8 +92,8 @@ local MiniMap_MouseUp = function(self, btn) local position = self:GetPoint() if btn == "RightButton" then local xoff = -1 - if position:match("RIGHT") then xoff = SuperVillain:Scale(-16) end - ToggleDropDownMenu(1, nil, MiniMapTrackingDropDown, self, xoff, SuperVillain:Scale(-3)) + if position:match("RIGHT") then xoff = -16 end + ToggleDropDownMenu(1, nil, MiniMapTrackingDropDown, self, xoff, -3) else Minimap_OnClick(self) end @@ -196,12 +196,7 @@ do btn:SetPushedTexture(nil) btn:SetHighlightTexture(nil) btn:SetDisabledTexture(nil) - if name == "DBMMinimapButton" then - btn:SetNormalTexture("Interface\\Icons\\INV_Helmet_87") - end - if name == "SmartBuff_MiniMapButton" then - btn:SetNormalTexture(select(3, GetSpellInfo(12051))) - end + if not btn.isStyled then btn:HookScript("OnEnter", MMB_OnEnter) btn:HookScript("OnLeave", MMB_OnLeave) @@ -220,15 +215,15 @@ do end if btn:HasScript("OnDragEnd") then btn.preset.DragEnd = btn:GetScript("OnDragEnd") - end + end if frame:GetObjectType() == "Texture" then - local icon = frame:GetTexture() - if icon and icon ~= nil and icon:find("Border") or icon:find("Background") or icon:find("AlphaMask") then - frame:SetTexture(nil) + 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) else frame:ClearAllPoints() - frame:Point("TOPLEFT", btn, "TOPLEFT", 4, -4) - frame:Point("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -4, 4) + frame:Point("TOPLEFT", btn, "TOPLEFT", 2, -2) + frame:Point("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -2, 2) frame:SetTexCoord(0.1, 0.9, 0.1, 0.9 ) frame:SetDrawLayer("ARTWORK") if name == "PS_MinimapButton" then @@ -237,7 +232,13 @@ do end end end - btn:SetButtonTemplate() + btn:SetSlotTemplate(true, 2, -1, -1) + if name == "DBMMinimapButton" then + btn:SetNormalTexture("Interface\\Icons\\INV_Helmet_87") + end + if name == "SmartBuff_MiniMapButton" then + btn:SetNormalTexture(select(3, GetSpellInfo(12051))) + end btn.isStyled = true local nextindex = #buttonCache[2] + 1 buttonCache[2][nextindex] = name @@ -326,7 +327,7 @@ local function AdjustMapSize() elseif WORLDMAP_SETTINGS.size == WORLDMAP_QUESTLIST_SIZE then SetQuestWorldMap() end - BlackoutWorld:SetTexture(nil) + BlackoutWorld:SetTexture(0,0,0,0) else if WORLDMAP_SETTINGS.size == WORLDMAP_FULLMAP_SIZE then WorldMapFrame_SetFullMapView() @@ -789,6 +790,7 @@ local function LoadWorldMap() DropDownList1:SetScale(UIParent:GetScale()) end end) + WorldFrame:SetAllPoints() end --[[ ########################################################## @@ -831,7 +833,7 @@ function MOD:ReLoad() self:RefreshMiniMap() end -function MOD:Load() +function MOD:PriorityLoad() if(not self.db.enable) then Minimap:SetMaskTexture('Textures\\MinimapMask') return @@ -866,4 +868,28 @@ function MOD:Load() SuperVillain:AddToDisplayAudit(SVUI_MinimapFrame) self:ReLoad() end -SuperVillain.Registry:NewPackage(MOD, "SVMap", "pre") \ No newline at end of file +--[[ +########################################################## +DEFINE CONFIG AND REGISTER +########################################################## +]]-- +CONFIGS["SVMap"] = { + ["enable"] = true, + ["mapAlpha"] = 1, + ["tinyWorldMap"] = true, + ["size"] = 240, + ["customshape"] = true, + ["locationText"] = "CUSTOM", + ["playercoords"] = "CUSTOM", + ["bordersize"] = 6, + ["bordercolor"] = "light", + ["minimapbar"] = { + ["enable"] = true, + ["styleType"] = "HORIZONTAL", + ["layoutDirection"] = "NORMAL", + ["buttonSize"] = 28, + ["mouseover"] = false, + }, +} + +SuperVillain.Registry:NewPackage(MOD, "SVMap") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/override/SVOverride.lua b/Interface/AddOns/SVUI/packages/override/SVOverride.lua index 925c63a..283c9db 100644 --- a/Interface/AddOns/SVUI/packages/override/SVOverride.lua +++ b/Interface/AddOns/SVUI/packages/override/SVOverride.lua @@ -33,7 +33,7 @@ local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SuperVillain, L, G, CONFIGS = unpack(select(2, ...)); local MOD = {}; MOD.LewtRollz = {}; --[[ @@ -135,8 +135,8 @@ end local Vehicle_OnSetPoint = function(self,_,parent) if(parent == "MinimapCluster" or parent == _G["MinimapCluster"]) then VehicleSeatIndicator:ClearAllPoints() - if _G.SVUI_VehicleFrame_MOVE then - VehicleSeatIndicator:Point("BOTTOM", SVUI_VehicleFrame_MOVE, "BOTTOM", 0, 0) + if _G.VehicleSeatIndicator_MOVE then + VehicleSeatIndicator:Point("BOTTOM", VehicleSeatIndicator_MOVE, "BOTTOM", 0, 0) else VehicleSeatIndicator:Point("TOPLEFT", SuperVillain.UIParent, "TOPLEFT", 22, -45) SuperVillain:SetSVMovable(VehicleSeatIndicator, L["Vehicle Seat Frame"]) @@ -403,7 +403,7 @@ local function SetTimerStyle(bar) for i=1, bar:GetNumRegions()do local child = select(i, bar:GetRegions()) if child:GetObjectType() == "Texture"then - child:SetTexture(nil) + child:SetTexture(0,0,0,0) elseif child:GetObjectType() == "FontString" then child:SetFontTemplate(SuperVillain.Media.font.roboto, 12, 'OUTLINE') end @@ -1098,5 +1098,17 @@ function MOD:Load() SuperVillain:SetSVMovable(LossOfControlFrame, L["Loss Control Icon"], nil, nil, nil, nil, "LoC") end +--[[ +########################################################## +DEFINE CONFIG AND REGISTER +########################################################## +]]-- +CONFIGS["SVOverride"] = { + ["enable"] = true, + ["loot"] = true, + ["lootRoll"] = true, + ["lootRollWidth"] = 328, + ["lootRollHeight"] = 28, +} SuperVillain.Registry:NewPackage(MOD, "SVOverride"); \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/plates/SVPlate.lua b/Interface/AddOns/SVUI/packages/plates/SVPlate.lua index 4619bfc..27f9d4a 100644 --- a/Interface/AddOns/SVUI/packages/plates/SVPlate.lua +++ b/Interface/AddOns/SVUI/packages/plates/SVPlate.lua @@ -49,7 +49,7 @@ local tremove, tcopy, twipe, tsort, tconcat = table.remove, table.copy, table.wi GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SuperVillain, L, G, CONFIGS = unpack(select(2, ...)); local MOD = {}; --[[ ########################################################## @@ -78,7 +78,7 @@ local PLATE_LEFT = [[Interface\Addons\SVUI\assets\artwork\Template\Plate\PLATE-L Unlike many of the other modules, SVPlates has to continuously reference config settings which can start to get sluggish. What I have done is set local variables for every database value - that the module can read efficiently. The function "UpdateDataLocals" + that the module can read efficiently. The function "UpdateLocals" is used to refresh these any time a change is made to configs and once when the mod is loaded. ]]-- @@ -92,8 +92,9 @@ local NPComboColor={ [3]={0.65,0.63,0.35}, [4]={0.65,0.63,0.35}, [5]={0.33,0.59,0.33} -}; -local NPFont = SuperVillain.Media.font.action; +} + +local NPFont = [[Interface\AddOns\SVUI\assets\fonts\Action.ttf]]; local NPFSize = 10; local NPFOutline = "OUTLINE"; @@ -135,12 +136,12 @@ local CBColor = {0.1,0.81,0} local CBNoInterrupt = {0.78,0.25,0.25} local CBHeight = 6; -local AuraFont = SuperVillain.Media.font.roboto; +local AuraFont = [[Interface\AddOns\SVUI\assets\fonts\Roboto.ttf]]; local AuraFSize = 10; local AuraFOutline = "MONOCHROME"; local AuraMaxCount = 5; -local AuraFont = SuperVillain.Media.font.numbers; +local AuraFont = [[Interface\AddOns\SVUI\assets\fonts\Numbers.ttf]]; local AuraFSize = 7; local AuraFOutline = "OUTLINE"; local AuraFilterName, AuraFilter; @@ -1128,22 +1129,22 @@ do health:Hide() fontRegions:Hide() - ref.threat:SetTexture(nil) + ref.threat:SetTexture(0,0,0,0) ref.border:Hide() - ref.highlight:SetTexture(nil) + ref.highlight:SetTexture(0,0,0,0) ref.level:SetWidth( 000.1 ) ref.level:Hide() - ref.skullicon:SetTexture(nil) + ref.skullicon:SetTexture(0,0,0,0) ref.raidicon:SetAlpha( 0 ) - ref.eliteicon:SetTexture(nil) + ref.eliteicon:SetTexture(0,0,0,0) plate.name:Hide() - cast.border:SetTexture(nil) - cast.shield:SetTexture(nil) + cast.border:SetTexture(0,0,0,0) + cast.shield:SetTexture(0,0,0,0) cast.icon:SetTexCoord( 0, 0, 0, 0 ) cast.icon:SetWidth(.001) - cast.shadow:SetTexture(nil) + cast.shadow:SetTexture(0,0,0,0) cast.shadow:Hide() cast.text:Hide() @@ -1297,7 +1298,7 @@ do end function MOD:UpdateAllPlates() - self:UpdateDataLocals() + self:UpdateLocals() for plate, _ in pairs(VisiblePlates) do if(plate) then UpdateThisPlate(plate) @@ -1354,7 +1355,7 @@ EVENTS ########################################################## ]]-- function MOD:PLAYER_ENTERING_WORLD() - self:UpdateDataLocals(); + self:UpdateLocals(); end function MOD:UPDATE_MOUSEOVER_UNIT() @@ -1461,7 +1462,7 @@ end UPDATE AND BUILD ########################################################## ]]-- -function MOD:UpdateDataLocals() +function MOD:UpdateLocals() local db = self.db if not db then return end; @@ -1526,10 +1527,10 @@ function MOD:UpdateDataLocals() AuraFilter = SuperVillain.db.filter[AuraFilterName] if (db.comboPoints and (SuperVillain.class == 'ROGUE' or SuperVillain.class == 'DRUID')) then - MOD.UseCombo = true + self.UseCombo = true self:RegisterEvent("UNIT_COMBO_POINTS") else - MOD.UseCombo = false + self.UseCombo = false self:UnregisterEvent("UNIT_COMBO_POINTS") end end @@ -1560,7 +1561,7 @@ end; function MOD:Load() if SuperVillain.db["SVPlate"].enable ~= true then return end - self:UpdateDataLocals() + self:UpdateLocals() self:RegisterEvent("PLAYER_ENTERING_WORLD") self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") self:RegisterEvent("UNIT_AURA") @@ -1569,4 +1570,74 @@ function MOD:Load() WorldFrame:HookScript('OnUpdate', WorldFrameUpdateHook) self:CombatToggle(true) end +--[[ +########################################################## +DEFINE CONFIG AND REGISTER +########################################################## +]]-- +CONFIGS["SVPlate"] = { + ["enable"] = true, + ["filter"] = {}, + ["font"] = "SVUI Name Font", + ["fontSize"] = 10, + ["fontOutline"] = "OUTLINE", + ["comboPoints"] = true, + ["nonTargetAlpha"] = 0.6, + ["combatHide"] = false, + ["colorNameByValue"] = true, + ["showthreat"] = true, + ["targetcount"] = true, + ["pointer"] = { + ["enable"] = true, + ["colorMatchHealthBar"] = true, + ["color"] = {0.9, 1, 0.9}, + }, + ["healthBar"] = { + ["lowThreshold"] = 0.4, + ["width"] = 108, + ["height"] = 9, + ["text"] = { + ["enable"] = false, + ["format"] = "CURRENT", + ["xOffset"] = 0, + ["yOffset"] = 0, + ["attachTo"] = "CENTER", + }, + }, + ["castBar"] = { + ["height"] = 6, + ["color"] = {1, 0.81, 0}, + ["noInterrupt"] = {0.78, 0.25, 0.25}, + }, + ["raidHealIcon"] = { + ["xOffset"] = -4, + ["yOffset"] = 6, + ["size"] = 36, + ["attachTo"] = "LEFT", + }, + ["threat"] = { + ["enable"] = false, + ["goodScale"] = 1, + ["badScale"] = 1, + ["goodColor"] = {0.29, 0.68, 0.3}, + ["badColor"] = {0.78, 0.25, 0.25}, + ["goodTransitionColor"] = {0.85, 0.77, 0.36}, + ["badTransitionColor"] = {0.94, 0.6, 0.06}, + }, + ["auras"] = { + ["font"] = "SVUI Number Font", + ["fontSize"] = 7, + ["fontOutline"] = "OUTLINE", + ["numAuras"] = 5, + ["additionalFilter"] = "CC" + }, + ["reactions"] = { + ["tapped"] = {0.6, 0.6, 0.6}, + ["friendlyNPC"] = { 0.31, 0.45, 0.63}, + ["friendlyPlayer"] = {0.29, 0.68, 0.3}, + ["neutral"] = {0.85, 0.77, 0.36}, + ["enemy"] = {0.78, 0.25, 0.25}, + }, +} + SuperVillain.Registry:NewPackage(MOD, "SVPlate") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/SVStats.lua b/Interface/AddOns/SVUI/packages/stats/SVStats.lua index d82b389..0901c80 100644 --- a/Interface/AddOns/SVUI/packages/stats/SVStats.lua +++ b/Interface/AddOns/SVUI/packages/stats/SVStats.lua @@ -33,7 +33,7 @@ local min = math.min; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SuperVillain, L, G, CONFIGS = unpack(select(2, ...)); local MOD = {}; MOD.Anchors = {}; MOD.Statistics = {}; @@ -51,6 +51,8 @@ local RAID_CLASS_COLORS = _G.RAID_CLASS_COLORS LOCAL VARIABLES ########################################################## ]]-- +local playerName = UnitName("player"); +local playerRealm = GetRealmName(); local hexString = "|cffFFFFFF"; local myName = UnitName("player"); local myClass = select(2,UnitClass("player")); @@ -559,11 +561,11 @@ end function MOD:Load() hexString = SuperVillain:HexColor("highlight") or "|cffFFFFFF" SVUI_Global["Accountant"] = SVUI_Global["Accountant"] or {}; - SVUI_Global["Accountant"][SuperVillain.realm] = SVUI_Global["Accountant"][SuperVillain.realm] or {}; - SVUI_Global["Accountant"][SuperVillain.realm]["gold"] = SVUI_Global["Accountant"][SuperVillain.realm]["gold"] or {}; - SVUI_Global["Accountant"][SuperVillain.realm]["gold"][SuperVillain.name] = SVUI_Global["Accountant"][SuperVillain.realm]["gold"][SuperVillain.name] or 0; - SVUI_Global["Accountant"][SuperVillain.realm]["tokens"] = SVUI_Global["Accountant"][SuperVillain.realm]["tokens"] or {}; - SVUI_Global["Accountant"][SuperVillain.realm]["tokens"][SuperVillain.name] = SVUI_Global["Accountant"][SuperVillain.realm]["tokens"][SuperVillain.name] or 738; + SVUI_Global["Accountant"][playerRealm] = SVUI_Global["Accountant"][playerRealm] or {}; + SVUI_Global["Accountant"][playerRealm]["gold"] = SVUI_Global["Accountant"][playerRealm]["gold"] or {}; + SVUI_Global["Accountant"][playerRealm]["gold"][playerName] = SVUI_Global["Accountant"][playerRealm]["gold"][playerName] or 0; + SVUI_Global["Accountant"][playerRealm]["tokens"] = SVUI_Global["Accountant"][playerRealm]["tokens"] or {}; + SVUI_Global["Accountant"][playerRealm]["tokens"][playerName] = SVUI_Global["Accountant"][playerRealm]["tokens"][playerName] or 738; self:LoadServerGold() self:CacheRepData() @@ -580,5 +582,42 @@ function MOD:Load() self:Generate() self:RegisterEvent("PLAYER_ENTERING_WORLD", "Generate") end +--[[ +########################################################## +DEFINE CONFIG AND REGISTER +########################################################## +]]-- +CONFIGS["SVStats"] = { + ["enable"] = true, + ["font"] = "SVUI Number Font", + ["fontSize"] = 12, + ["fontOutline"] = "OUTLINE", + ["showBackground"] = true, + ["shortGold"] = true, + ["panels"] = { + ["BottomRightDataPanel"] = { + ["right"] = "Bags", + ["left"] = "Friends", + ["middle"] = "Guild", + }, + ["BottomLeftDataPanel"] = { + ["left"] = "Time", + ["middle"] = "System", + ["right"] = "Gold", + }, + ["TopLeftDataPanel"] = { + ["left"] = "Durability Bar", + ["middle"] = "Reputation Bar", + ["right"] = "Experience Bar", + }, + }, + ["localtime"] = true, + ["time24"] = false, + ["battleground"] = true, + ["topLeftDockPanel"] = true, + ["bottomLeftDockPanel"] = true, + ["bottomRightDockPanel"] = true, + ["panelTransparency"] = false, +} SuperVillain.Registry:NewPackage(MOD, "SVStats") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/gold.lua b/Interface/AddOns/SVUI/packages/stats/stats/gold.lua index 355d4ff..8c96ea2 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/gold.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/gold.lua @@ -56,16 +56,19 @@ local MOD = SuperVillain.SVStats; GOLD STATS ########################################################## ]]-- +local playerName = UnitName("player"); +local playerRealm = GetRealmName(); + local StatEvents = {'PLAYER_ENTERING_WORLD','PLAYER_MONEY','SEND_MAIL_MONEY_CHANGED','SEND_MAIL_COD_CHANGED','PLAYER_TRADE_MONEY','TRADE_MONEY_CHANGED'}; local gains = 0; local loss = 0; local recorded = 0; -local copperFormat = join("","%d",L.copperabbrev) -local silverFormat = join("","%d",L.silverabbrev," %.2d",L.copperabbrev) -local goldFormat = join("","%s",L.goldabbrev," %.2d",L.silverabbrev," %.2d",L.copperabbrev) +local copperFormat = "%d" .. L.copperabbrev +local silverFormat = "%d" .. L.silverabbrev .. " %.2d" .. L.copperabbrev +local goldFormat = "%s" .. L.goldabbrev .. " %.2d" .. L.silverabbrev .. " %.2d" .. L.copperabbrev -local silverShortFormat = join("","%d",L.silverabbrev) -local goldShortFormat = join("","%s",L.goldabbrev) +local silverShortFormat = "%d" .. L.silverabbrev +local goldShortFormat = "%s" .. L["goldabbrev"] local tiptext = join("","|cffaaaaaa",L["Reset Data: Hold Left Ctrl + Shift then Click"],"|r") local serverGold = {}; @@ -74,20 +77,22 @@ local function FormatCurrency(amount, short) if not amount then return end; local gold, silver, copper = floor(abs(amount/10000)), abs(mod(amount/100,100)), abs(mod(amount,100)) if(short) then - if gold ~= 0 then - return format(goldShortFormat, BreakUpLargeNumbers(gold)) + if gold ~= 0 then + gold = BreakUpLargeNumbers(gold) + return goldShortFormat:format(gold) elseif silver ~= 0 then - return format(silverShortFormat, silver) + return silverShortFormat:format(silver) else - return format(copperFormat, copper) + return copperFormat:format(copper) end else - if gold ~= 0 then - return format(goldFormat, BreakUpLargeNumbers(gold), silver, copper) + if gold ~= 0 then + gold = BreakUpLargeNumbers(gold) + return goldFormat:format(gold, silver, copper) elseif silver ~= 0 then - return format(silverFormat, silver, copper) + return silverFormat:format(silver, copper) else - return format(copperFormat, copper) + return copperFormat:format(copper) end end end; @@ -95,7 +100,7 @@ end; local function Gold_OnEvent(self, event,...) if not IsLoggedIn() then return end; local current = GetMoney() - recorded = SVUI_Global["Accountant"][SuperVillain.realm]["gold"][SuperVillain.name] or GetMoney(); + recorded = SVUI_Global["Accountant"][playerRealm]["gold"][playerName] or GetMoney(); local adjusted = current - recorded; if recorded > current then loss = loss - adjusted @@ -103,13 +108,13 @@ local function Gold_OnEvent(self, event,...) gains = gains + adjusted end; self.text:SetText(FormatCurrency(current, MOD.db.shortGold)) - SVUI_Global["Accountant"][SuperVillain.realm]["gold"][SuperVillain.name] = GetMoney() + SVUI_Global["Accountant"][playerRealm]["gold"][playerName] = GetMoney() end; local function Gold_OnClick(self, button) if IsLeftControlKeyDown() and IsShiftKeyDown() then - SVUI_Global["Accountant"][SuperVillain.realm]["gold"] = {}; - SVUI_Global["Accountant"][SuperVillain.realm]["gold"][SuperVillain.name] = GetMoney(); + SVUI_Global["Accountant"][playerRealm]["gold"] = {}; + SVUI_Global["Accountant"][playerRealm]["gold"][playerName] = GetMoney(); Gold_OnEvent(self) MOD.tooltip:Hide() else @@ -128,14 +133,14 @@ local function Gold_OnEnter(self) MOD.tooltip:AddDoubleLine(L["Profit:"],FormatCurrency(gains - loss),0,1,0,1,1,1) end; MOD.tooltip:AddLine(" ") - local cash = SVUI_Global["Accountant"][SuperVillain.realm]["gold"][SuperVillain.name]; - MOD.tooltip:AddLine(L[""..SuperVillain.name..": "]) + local cash = SVUI_Global["Accountant"][playerRealm]["gold"][playerName]; + MOD.tooltip:AddLine(L[playerName..": "]) MOD.tooltip:AddDoubleLine(L["Total: "], FormatCurrency(cash), 1,1,1,1,1,1) MOD.tooltip:AddLine(" ") MOD.tooltip:AddLine(L["Characters: "]) for name,amount in pairs(serverGold)do - if(name ~= SuperVillain.name and name ~= 'total') then + if(name ~= playerName and name ~= 'total') then cash = cash + amount; MOD.tooltip:AddDoubleLine(name, FormatCurrency(amount), 1,1,1,1,1,1) end @@ -152,8 +157,8 @@ MOD:Extend('Gold', StatEvents, Gold_OnEvent, nil, Gold_OnClick, Gold_OnEnter); function MOD:LoadServerGold() local totalGold = 0; - for name,amount in pairs(SVUI_Global["Accountant"][SuperVillain.realm]["gold"])do - if SVUI_Global["Accountant"][SuperVillain.realm]["gold"][name] then + for name,amount in pairs(SVUI_Global["Accountant"][playerRealm]["gold"])do + if SVUI_Global["Accountant"][playerRealm]["gold"][name] then serverGold[name] = amount; totalGold = totalGold + amount end diff --git a/Interface/AddOns/SVUI/packages/stats/stats/guild.lua b/Interface/AddOns/SVUI/packages/stats/stats/guild.lua index c4ccafe..cf139f2 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/guild.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/guild.lua @@ -43,6 +43,9 @@ local MOD = SuperVillain.SVStats; GUILD STATS ########################################################## ]]-- +local playerName = UnitName("player"); +local playerRealm = GetRealmName(); + local StatEvents = {"PLAYER_ENTERING_WORLD","GUILD_ROSTER_UPDATE","GUILD_XP_UPDATE","PLAYER_GUILD_UPDATE","GUILD_MOTD"}; local updatedString = ""; @@ -210,7 +213,7 @@ local function Guild_OnClick(self, button) for i = 1, #GuildStatMembers do info = GuildStatMembers[i] - if info[7] and info[1] ~= SuperVillain.name then + if info[7] and info[1] ~= playerName then local classc, levelc = RAID_CLASS_COLORS[info[9]], GetQuestDifficultyColor(info[3]) if UnitInParty(info[1])or UnitInRaid(info[1]) then grouped = "|cffaaaaaa*|r" diff --git a/Interface/AddOns/SVUI/packages/stats/stats/reputation.lua b/Interface/AddOns/SVUI/packages/stats/stats/reputation.lua index bc29b95..b0a2241 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/reputation.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/reputation.lua @@ -87,6 +87,7 @@ local function Reputation_OnEvent(self, ...) self.text:SetJustifyH("CENTER") self.barframe:Hide() self.text:SetAlpha(1) + self.text:SetShadowOffset(2, -4) end; local ID = 100 local isFriend, friendText @@ -118,6 +119,7 @@ local function ReputationBar_OnEvent(self, ...) self.barframe:Show() self.barframe.icon.texture:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Icons\\STAT-REP") self.text:SetAlpha(1) + self.text:SetShadowOffset(1, -2) end; local bar = self.barframe.bar; local name, reaction, min, max, value = GetWatchedFactionInfo() diff --git a/Interface/AddOns/SVUI/packages/stats/stats/tokens.lua b/Interface/AddOns/SVUI/packages/stats/stats/tokens.lua index 206fc38..3239ff8 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/tokens.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/tokens.lua @@ -38,6 +38,9 @@ local MOD = SuperVillain.SVStats; GOLD STATS ########################################################## ]]-- +local playerName = UnitName("player"); +local playerRealm = GetRealmName(); + local TokenEvents = {'PLAYER_ENTERING_WORLD','PLAYER_MONEY','CURRENCY_DISPLAY_UPDATE'}; local TokenMenuList = {}; local TokenParent; @@ -49,32 +52,36 @@ local function TokenInquiry(id, weekly, capped) local _, _, _, itemID = GetBackpackCurrencyInfo(i) if id == itemID then r, g, b = 0.23, 0.88, 0.27 end end + local texStr = ("\124T%s:12\124t %s"):format(tex, name) + local altStr = "" if weekly then if discovered then if id == 390 then - MOD.tooltip:AddDoubleLine("\124T"..tex..":12\124t "..name, "Current: "..amount.." | ".." Weekly: "..week.." / "..weekmax, r, g, b, r, g, b) + altStr = ("Current: %d | Weekly: %d / %d"):format(amount, week, weekmax) else - MOD.tooltip:AddDoubleLine("\124T"..tex..":12\124t "..name, "Current: "..amount.." / "..maxed.." | ".." Weekly: "..week.." / "..weekmax, r, g, b, r, g, b) + altStr = ("Current: %d / %d | Weekly: %d / %d"):format(amount, maxed, week, weekmax) end + MOD.tooltip:AddDoubleLine(texStr, altStr, r, g, b, r, g, b) end elseif capped then if id == 392 or id == 395 then maxed = 4000 end if id == 396 then maxed = 3000 end if discovered then - MOD.tooltip:AddDoubleLine("\124T"..tex..":12\124t "..name, amount.." / "..maxed, r, g, b, r, g, b) + altStr = ("%d / %d"):format(amount, maxed) + MOD.tooltip:AddDoubleLine(texStr, altStr, r, g, b, r, g, b) end else if discovered then - MOD.tooltip:AddDoubleLine("\124T"..tex..":12\124t "..name, amount, r, g, b, r, g, b) + MOD.tooltip:AddDoubleLine(texStr, amount, r, g, b, r, g, b) end end end local function TokensEventHandler(self, event,...) if not IsLoggedIn() or not self then return end; - local id = SVUI_Global["Accountant"][SuperVillain.realm]["tokens"][SuperVillain.name]; + local id = SVUI_Global["Accountant"][playerRealm]["tokens"][playerName]; local _, current, tex = GetCurrencyInfo(id) - local currentText = "\124T"..tex..":12\124t " .. current; + local currentText = ("\124T%s:12\124t %s"):format(tex, current); self.text:SetText(currentText) end; @@ -82,7 +89,7 @@ local function AddToTokenMenu(id) local name, _, tex, _, _, _, _ = GetCurrencyInfo(id) local itemName = "\124T"..tex..":12\124t "..name; local fn = function() - SVUI_Global["Accountant"][SuperVillain.realm]["tokens"][SuperVillain.name] = id; + SVUI_Global["Accountant"][playerRealm]["tokens"][playerName] = id; TokensEventHandler(TokenParent) end; tinsert(TokenMenuList, {text = itemName, func = fn}); @@ -132,7 +139,7 @@ end local function Tokens_OnEnter(self) MOD:Tip(self) - MOD.tooltip:AddLine(SuperVillain.name .. "\'s Tokens") + MOD.tooltip:AddLine(playerName .. "\'s Tokens") MOD.tooltip:AddLine(" ") MOD.tooltip:AddLine("Common") diff --git a/Interface/AddOns/SVUI/packages/tip/SVTip.lua b/Interface/AddOns/SVUI/packages/tip/SVTip.lua index cad39af..e989b35 100644 --- a/Interface/AddOns/SVUI/packages/tip/SVTip.lua +++ b/Interface/AddOns/SVUI/packages/tip/SVTip.lua @@ -36,7 +36,7 @@ local twipe, tconcat = table.wipe, table.concat; GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L = unpack(select(2, ...)); +local SuperVillain, L, G, CONFIGS = unpack(select(2, ...)); local MOD = {}; --[[ ########################################################## @@ -935,5 +935,32 @@ function MOD:Load() GameTooltip:HookScript("OnTooltipSetUnit", _hook_GameTooltip_OnTooltipSetUnit) GameTooltipStatusBar:HookScript("OnValueChanged", _hook_GameTooltipStatusBar_OnValueChanged) self:RegisterEvent("MODIFIER_STATE_CHANGED", TooltipModifierChangeHandler) -end +end +--[[ +########################################################## +DEFINE CONFIG AND REGISTER +########################################################## +]]-- +CONFIGS["SVTip"] = { + ["enable"] = true, + ["cursorAnchor"] = false, + ["targetInfo"] = true, + ["playerTitles"] = true, + ["guildRanks"] = true, + ["inspectInfo"] = false, + ["itemCount"] = true, + ["spellID"] = false, + ["progressInfo"] = true, + ["visibility"] = { + ["unitFrames"] = "NONE", + ["combat"] = false, + }, + ["healthBar"] = { + ["text"] = true, + ["height"] = 10, + ["font"] = "Roboto", + ["fontSize"] = 10, + }, +} + SuperVillain.Registry:NewPackage(MOD, "SVTip") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua index fc01b3b..78660c6 100644 --- a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua +++ b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua @@ -53,6 +53,9 @@ MODULE AND INNER CLASSES local MOD = {} MOD.Units = {} MOD.Headers = {} +MOD.Roster = {} + +oUF_SuperVillain.SVConfigs = {} --[[ ########################################################## LOCALS @@ -301,6 +304,11 @@ function MOD:RefreshUnitColors() end local r, g, b = db.health[1], db.health[2], db.health[3] oUF_SuperVillain.colors.smooth = {1, 0, 0, 1, 1, 0, r, g, b} + + oUF_SuperVillain.SVConfigs.classbackdrop = SuperVillain.db.SVUnit.classbackdrop + oUF_SuperVillain.SVConfigs.healthclass = SuperVillain.db.SVUnit.healthclass + oUF_SuperVillain.SVConfigs.colorhealthbyvalue = SuperVillain.db.SVUnit.colorhealthbyvalue + oUF_SuperVillain.SVConfigs.gridMode = SuperVillain.db.SVUnit.gridMode end function MOD:RefreshAllUnitMedia() @@ -522,40 +530,42 @@ function MOD:RefreshUnitLayout(frame, template) end --[[ INFO TEXTS ]]-- - + local point,cX,cY; if(infoPanel.Name and db.name) then local nametext = infoPanel.Name - if(not db.power or (not db.power.hideonnpc) or db.power.tags == "") then - nametext:ClearAllPoints() - SuperVillain:ReversePoint(nametext, db.name.position, infoPanel, db.name.xOffset, db.name.yOffset) - end + point = db.name.position + cX = db.name.xOffset + cY = db.name.yOffset + nametext:ClearAllPoints() + SuperVillain:ReversePoint(nametext, point, infoPanel, cX, cY) frame:Tag(nametext, db.name.tags) end if(frame.Health and infoPanel.Health and db.health) then local healthtext = infoPanel.Health - local point = db.health.position + point = db.health.position + cX = db.health.xOffset + cY = db.health.yOffset healthtext:ClearAllPoints() - SuperVillain:ReversePoint(healthtext, point, infoPanel, db.health.xOffset, db.health.yOffset) + SuperVillain:ReversePoint(healthtext, point, infoPanel, cX, cY) frame:Tag(healthtext, db.health.tags) end if(frame.Power and infoPanel.Power and db.power) then local powertext = infoPanel.Power if db.power.tags ~= nil and db.power.tags ~= '' then - local point = db.power.position + point = db.power.position + cX = db.power.xOffset + cY = db.power.yOffset powertext:ClearAllPoints() - SuperVillain:ReversePoint(powertext, point, infoPanel, db.power.xOffset, db.power.yOffset) - frame:Tag(powertext, db.power.tags) + SuperVillain:ReversePoint(powertext, point, infoPanel, cX, cY) if db.power.attachTextToPower then powertext:SetParent(frame.Power) else powertext:SetParent(infoPanel) end - powertext:Show() - else - powertext:Hide() end + frame:Tag(powertext, db.power.tags) end if(infoPanel.Misc and db.misc) then @@ -1307,7 +1317,7 @@ function MOD:ReLoad() self:RefreshUnitFrames() end -function MOD:Load() +function MOD:PriorityLoad() self:RefreshUnitColors() local SVUI_UnitFrameParent = CreateFrame("Frame", "SVUI_UnitFrameParent", SuperVillain.UIParent, "SecureHandlerStateTemplate") @@ -1359,5 +1369,9 @@ function MOD:Load() rDebuffs.FilterDispellableDebuff = true; rDebuffs.MatchBySpellName = true; end - -SuperVillain.Registry:NewPackage(MOD, "SVUnit", "pre") \ No newline at end of file +--[[ +########################################################## +DEFINE CONFIG AND REGISTER +########################################################## +]]-- +SuperVillain.Registry:NewPackage(MOD, "SVUnit") \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/SVUnit.xml b/Interface/AddOns/SVUI/packages/unit/SVUnit.xml index e33225f..b95f83d 100644 --- a/Interface/AddOns/SVUI/packages/unit/SVUnit.xml +++ b/Interface/AddOns/SVUI/packages/unit/SVUnit.xml @@ -40,7 +40,8 @@ </Frames> </Button> - <Script file='SVUnit.lua'/> + <Script file="config.lua"/> + <Script file="SVUnit.lua"/> <Script file="elements\tags.lua"/> <Script file="elements\essentials.lua"/> diff --git a/Interface/AddOns/SVUI/packages/unit/config.lua b/Interface/AddOns/SVUI/packages/unit/config.lua new file mode 100644 index 0000000..7088a03 --- /dev/null +++ b/Interface/AddOns/SVUI/packages/unit/config.lua @@ -0,0 +1,2431 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +--[[ +########################################################## +GET ADDON DATA AND TEST FOR oUF +########################################################## +]]-- +local SuperVillain, L, G, CONFIGS = unpack(select(2, ...)); +--[[ +########################################################## +LOCALS +########################################################## +]]-- +CONFIGS["SVUnit"] = { + ["enable"] = true, + ["disableBlizzard"] = true, + + ["smoothbars"] = false, + ["statusbar"] = "SVUI BasicBar", + ["auraBarStatusbar"] = "SVUI GlowBar", + + ["font"] = "SVUI Number Font", + ["fontSize"] = 12, + ["fontOutline"] = "OUTLINE", + + ["auraFont"] = "SVUI Alert Font", + ["auraFontSize"] = 12, + ["auraFontOutline"] = "OUTLINE", + + ["OORAlpha"] = 0.65, + ["combatFadeRoles"] = true, + ["combatFadeNames"] = true, + ["debuffHighlighting"] = true, + ["smartRaidFilter"] = true, + ["fastClickTarget"] = false, + ["healglow"] = true, + ["glowtime"] = 0.8, + ["glowcolor"] = {1, 1, 0}, + ["autoRoleSet"] = false, + ["healthclass"] = true, + ["forceHealthColor"] = false, + ["overlayAnimation"] = true, + ["powerclass"] = false, + ["colorhealthbyvalue"] = true, + ["customhealthbackdrop"] = true, + ["classbackdrop"] = false, + ["auraBarByType"] = true, + ["auraBarShield"] = true, + ["castClassColor"] = false, + ["xrayFocus"] = true, + ["player"] = { + ["enable"] = true, + ["width"] = 215, + ["height"] = 60, + ["lowmana"] = 30, + ["combatfade"] = false, + ["predict"] = false, + ["threatEnabled"] = true, + ["playerExpBar"] = false, + ["playerRepBar"] = false, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "current", + ["name_colored"] = true, + ["name_length"] = 21, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "[health:color][health:current]", + ["position"] = "INNERRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 11, + }, + ["power"] = + { + ["enable"] = true, + ["tags"] = "", + ["height"] = 10, + ["position"] = "INNERLEFT", + ["hideonnpc"] = false, + ["xOffset"] = 0, + ["yOffset"] = 0, + ["detachedWidth"] = 250, + ["attachTextToPower"] = false, + ["druidMana"] = true, + ["fontSize"] = 11, + }, + ["name"] = + { + ["position"] = "CENTER", + ["tags"] = "", + ["xOffset"] = 0, + ["yOffset"] = 0, + ["font"] = "SVUI Number Font", + ["fontSize"] = 13, + ["fontOutline"] = "OUTLINE", + }, + ["pvp"] = + { + ["font"] = "SVUI Number Font", + ["fontSize"] = 12, + ["fontOutline"] = "OUTLINE", + ["position"] = "BOTTOM", + ["tags"] = "||cFFB04F4F[pvptimer][mouseover]||r", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + ["portrait"] = + { + ["enable"] = true, + ["width"] = 50, + ["overlay"] = true, + ["camDistanceScale"] = 1.4, + ["rotation"] = 0, + ["style"] = "3D", + }, + ["buffs"] = + { + ["enable"] = false, + ["perrow"] = 8, + ["numrows"] = 1, + ["attachTo"] = "DEBUFFS", + ["anchorPoint"] = "TOPLEFT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = true, + ["filterRaid"] = true, + ["filterBlocked"] = true, + ["filterAllowed"] = true, + ["filterInfinite"] = true, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = 8, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = true, + ["perrow"] = 8, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "TOPLEFT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = false, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = false, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = 8, + ["sizeOverride"] = 0, + }, + ["aurabar"] = + { + ["enable"] = false, + ["anchorPoint"] = "ABOVE", + ["attachTo"] = "DEBUFFS", + ["filterPlayer"] = true, + ["filterRaid"] = true, + ["filterBlocked"] = true, + ["filterAllowed"] = true, + ["filterInfinite"] = true, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["friendlyAuraType"] = "HELPFUL", + ["enemyAuraType"] = "HARMFUL", + ["height"] = 18, + ["sort"] = "TIME_REMAINING", + }, + ["castbar"] = + { + ["enable"] = true, + ["width"] = 215, + ["height"] = 20, + ["matchFrameWidth"] = true, + ["icon"] = true, + ["latency"] = false, + ["format"] = "REMAINING", + ["ticks"] = false, + ["spark"] = true, + ["displayTarget"] = false, + ["useCustomColor"] = false, + ["castingColor"] = {0.8, 0.8, 0}, + ["sparkColor"] = {1, 0.72, 0}, + }, + ["classbar"] = + { + ["enable"] = true, + ["slideLeft"] = true, + ["inset"] = "inset", + ["height"] = 25, + ["detachFromFrame"] = false, + }, + ["icons"] = + { + ["raidicon"] = + { + ["enable"] = true, + ["size"] = 30, + ["attachTo"] = "INNERRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + ["combatIcon"] = { + ["enable"] = true, + ["size"] = 26, + ["attachTo"] = "INNERTOPRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + ["restIcon"] = { + ["enable"] = true, + ["size"] = 26, + ["attachTo"] = "INNERTOPRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + ["stagger"] = + { + ["enable"] = true, + }, + }, + ["target"] = { + ["enable"] = true, + ["width"] = 215, + ["height"] = 60, + ["threatEnabled"] = true, + ["rangeCheck"] = true, + ["predict"] = false, + ["smartAuraDisplay"] = "DISABLED", + ["middleClickFocus"] = true, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "current", + ["name_colored"] = true, + ["name_length"] = 18, + ["smartlevel"] = true, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "[health:color][health:current]", + ["position"] = "INNERLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + ["reversed"] = true, + ["fontSize"] = 11, + }, + ["power"] = + { + ["enable"] = true, + ["tags"] = "[power:color][power:current]", + ["height"] = 10, + ["position"] = "INNERRIGHT", + ["hideonnpc"] = true, + ["xOffset"] = 0, + ["yOffset"] = 0, + ["attachTextToPower"] = false, + ["fontSize"] = 11, + }, + ["name"] = + { + ["position"] = "INNERRIGHT", + ["tags"] = "[name:color][name:18][smartlevel]", + ["xOffset"] = -2, + ["yOffset"] = 36, + ["font"] = "SVUI Name Font", + ["fontSize"] = 15, + ["fontOutline"] = "NONE", + }, + ["portrait"] = + { + ["enable"] = true, + ["width"] = 50, + ["overlay"] = true, + ["rotation"] = 0, + ["camDistanceScale"] = 1.4, + ["style"] = "3D", + }, + ["buffs"] = + { + ["enable"] = true, + ["perrow"] = 8, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "TOPRIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "LEFT", + ["filterPlayer"] = + { + friendly = false, + enemy = false, + }, + ["filterRaid"] = + { + friendly = false, + enemy = false, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = false, + enemy = false, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = 8, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = true, + ["perrow"] = 8, + ["numrows"] = 1, + ["attachTo"] = "BUFFS", + ["anchorPoint"] = "TOPRIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "LEFT", + ["filterPlayer"] = + { + friendly = false, + enemy = true, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = false, + enemy = false, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = 8, + ["sizeOverride"] = 0, + }, + ["aurabar"] = + { + ["enable"] = false, + ["anchorPoint"] = "ABOVE", + ["attachTo"] = "DEBUFFS", + ["filterPlayer"] = + { + friendly = true, + enemy = true, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = true, + enemy = true, + }, + ["filterRaid"] = + { + friendly = true, + enemy = true, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "", + ["friendlyAuraType"] = "HELPFUL", + ["enemyAuraType"] = "HARMFUL", + ["height"] = 18, + ["sort"] = "TIME_REMAINING", + }, + ["castbar"] = + { + ["enable"] = true, + ["width"] = 215, + ["height"] = 20, + ["matchFrameWidth"] = true, + ["icon"] = true, + ["format"] = "REMAINING", + ["spark"] = true, + ["useCustomColor"] = false, + ["castingColor"] = {0.8, 0.8, 0}, + ["sparkColor"] = {1, 0.72, 0}, + }, + ["combobar"] = + { + ["enable"] = true, + ["height"] = 30, + ["smallIcons"] = false, + ["hudStyle"] = false, + ["hudScale"] = 64, + ["autoHide"] = true, + }, + ["icons"] = + { + ["raidicon"] = + { + ["enable"] = true, + ["size"] = 30, + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + } + }, + }, + ["targettarget"] = { + ["enable"] = true, + ["rangeCheck"] = true, + ["threatEnabled"] = false, + ["width"] = 150, + ["height"] = 30, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "none", + ["name_colored"] = true, + ["name_length"] = 10, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "", + ["position"] = "INNERRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 9, + }, + ["power"] = + { + ["enable"] = false, + ["tags"] = "", + ["height"] = 7, + ["position"] = "INNERLEFT", + ["hideonnpc"] = false, + ["xOffset"] = 0, + ["yOffset"] = 0, + ["fontSize"] = 9, + }, + ["name"] = + { + ["position"] = "CENTER", + ["tags"] = "[name:color][name:10]", + ["xOffset"] = 0, + ["yOffset"] = 1, + ["font"] = "SVUI Narrator Font", + ["fontSize"] = 14, + ["fontOutline"] = "OUTLINE", + }, + ["portrait"] = + { + ["enable"] = true, + ["width"] = 45, + ["overlay"] = true, + ["rotation"] = 0, + ["camDistanceScale"] = 1, + ["style"] = "3D", + }, + ["buffs"] = + { + ["enable"] = false, + ["perrow"] = 7, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "BOTTOMLEFT", + ["verticalGrowth"] = "DOWN", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = + { + friendly = true, + enemy = false, + }, + ["filterRaid"] = + { + friendly = true, + enemy = false, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = true, + enemy = false, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = -8, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = false, + ["perrow"] = 5, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "TOPLEFT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = + { + friendly = false, + enemy = true, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = false, + enemy = false, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = 8, + ["sizeOverride"] = 0, + }, + ["icons"] = + { + ["raidicon"] = + { + ["enable"] = true, + ["size"] = 18, + ["attachTo"] = "INNERRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + }, + ["focus"] = { + ["enable"] = true, + ["rangeCheck"] = true, + ["threatEnabled"] = true, + ["width"] = 170, + ["height"] = 30, + ["predict"] = false, + ["smartAuraDisplay"] = "DISABLED", + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "none", + ["name_colored"] = true, + ["name_length"] = 15, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "", + ["position"] = "INNERRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 10, + }, + ["power"] = + { + ["enable"] = true, + ["tags"] = "", + ["height"] = 7, + ["position"] = "INNERLEFT", + ["hideonnpc"] = false, + ["xOffset"] = 0, + ["yOffset"] = 0, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "CENTER", + ["tags"] = "[name:color][name:15]", + ["xOffset"] = 0, + ["yOffset"] = 0, + ["font"] = "SVUI Narrator Font", + ["fontSize"] = 14, + ["fontOutline"] = "OUTLINE", + }, + ["buffs"] = + { + ["enable"] = false, + ["perrow"] = 7, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "BOTTOMRIGHT", + ["verticalGrowth"] = "DOWN", + ["horizontalGrowth"] = "LEFT", + ["filterPlayer"] = + { + friendly = true, + enemy = false, + }, + ["filterRaid"] = + { + friendly = true, + enemy = false, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = true, + enemy = false, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = -8, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = true, + ["perrow"] = 5, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "TOPRIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "LEFT", + ["filterPlayer"] = + { + friendly = false, + enemy = true, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = false, + enemy = false, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = 8, + ["sizeOverride"] = 0, + }, + ["castbar"] = + { + ["enable"] = true, + ["width"] = 170, + ["height"] = 18, + ["icon"] = true, + ["matchFrameWidth"] = true, + ["format"] = "REMAINING", + ["spark"] = true, + ["useCustomColor"] = false, + ["castingColor"] = {0.8, 0.8, 0}, + ["sparkColor"] = {1, 0.72, 0}, + }, + ["aurabar"] = + { + ["enable"] = false, + ["anchorPoint"] = "ABOVE", + ["attachTo"] = "FRAME", + ["filterPlayer"] = + { + friendly = false, + enemy = true, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = false, + enemy = false, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["filterRaid"] = + { + friendly = true, + enemy = true, + }, + ["useFilter"] = "", + ["friendlyAuraType"] = "HELPFUL", + ["enemyAuraType"] = "HARMFUL", + ["height"] = 18, + ["sort"] = "TIME_REMAINING", + }, + ["icons"] = + { + ["raidicon"] = + { + ["enable"] = true, + ["size"] = 18, + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + }, + ["focustarget"] = { + ["enable"] = false, + ["rangeCheck"] = true, + ["threatEnabled"] = false, + ["width"] = 150, + ["height"] = 26, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "none", + ["name_colored"] = true, + ["name_length"] = 15, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "", + ["position"] = "INNERRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 10, + }, + ["power"] = + { + ["enable"] = false, + ["tags"] = "", + ["height"] = 7, + ["position"] = "INNERLEFT", + ["hideonnpc"] = false, + ["xOffset"] = 0, + ["yOffset"] = 0, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "CENTER", + ["tags"] = "[name:color][name:15]", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["font"] = "SVUI Narrator Font", + ["fontSize"] = 14, + ["fontOutline"] = "OUTLINE", + }, + ["buffs"] = + { + ["enable"] = false, + ["perrow"] = 7, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "BOTTOMLEFT", + ["verticalGrowth"] = "DOWN", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = + { + friendly = true, + enemy = false, + }, + ["filterRaid"] = + { + friendly = true, + enemy = false, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = true, + enemy = false, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = -8, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = false, + ["perrow"] = 5, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "TOPLEFT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = + { + friendly = false, + enemy = true, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = false, + enemy = false, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = 8, + ["sizeOverride"] = 0, + }, + ["icons"] = + { + ["raidicon"] = + { + ["enable"] = true, + ["size"] = 18, + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + }, + ["pet"] = { + ["enable"] = true, + ["rangeCheck"] = true, + ["threatEnabled"] = true, + ["width"] = 150, + ["height"] = 30, + ["predict"] = false, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "none", + ["name_colored"] = true, + ["name_length"] = 10, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "", + ["position"] = "INNERRIGHT", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 10, + }, + ["power"] = + { + ["enable"] = false, + ["tags"] = "", + ["height"] = 7, + ["position"] = "INNERLEFT", + ["hideonnpc"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "CENTER", + ["tags"] = "[name:color][name:8]", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["font"] = "SVUI Narrator Font", + ["fontSize"] = 14, + ["fontOutline"] = "OUTLINE", + }, + ["portrait"] = + { + ["enable"] = true, + ["width"] = 45, + ["overlay"] = true, + ["rotation"] = 0, + ["camDistanceScale"] = 1, + ["style"] = "3D", + }, + ["buffs"] = + { + ["enable"] = true, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "LEFT", + ["verticalGrowth"] = "DOWN", + ["horizontalGrowth"] = "LEFT", + ["filterPlayer"] = true, + ["filterRaid"] = true, + ["filterBlocked"] = true, + ["filterAllowed"] = true, + ["filterInfinite"] = true, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = -3, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = true, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "RIGHT", + ["verticalGrowth"] = "DOWN", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = false, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = false, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 3, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["castbar"] = + { + ["enable"] = true, + ["width"] = 130, + ["height"] = 8, + ["icon"] = false, + ["matchFrameWidth"] = true, + ["format"] = "REMAINING", + ["spark"] = false, + ["useCustomColor"] = false, + ["castingColor"] = {0.8, 0.8, 0}, + ["sparkColor"] = {1, 0.72, 0}, + }, + ["auraWatch"] = + { + ["enable"] = true, + ["size"] = 8, + }, + }, + ["pettarget"] = { + ["enable"] = false, + ["rangeCheck"] = true, + ["threatEnabled"] = false, + ["width"] = 130, + ["height"] = 26, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "none", + ["name_colored"] = true, + ["name_length"] = 15, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "", + ["position"] = "INNERRIGHT", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 10, + }, + ["power"] = + { + ["enable"] = false, + ["tags"] = "", + ["height"] = 7, + ["position"] = "INNERLEFT", + ["hideonnpc"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "CENTER", + ["tags"] = "[name:color][name:15]", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["font"] = "SVUI Narrator Font", + ["fontSize"] = 14, + ["fontOutline"] = "OUTLINE", + }, + ["buffs"] = + { + ["enable"] = false, + ["perrow"] = 7, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "BOTTOMLEFT", + ["verticalGrowth"] = "DOWN", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = + { + friendly = true, + enemy = false, + }, + ["filterRaid"] = + { + friendly = true, + enemy = false, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = true, + enemy = false, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = -8, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = false, + ["perrow"] = 5, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "BOTTOMRIGHT", + ["verticalGrowth"] = "DOWN", + ["horizontalGrowth"] = "LEFT", + ["filterPlayer"] = + { + friendly = false, + enemy = true, + }, + ["filterBlocked"] = + { + friendly = true, + enemy = true, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = false, + enemy = false, + }, + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "", + ["xOffset"] = 0, + ["yOffset"] = 8, + ["sizeOverride"] = 0, + }, + }, + ["boss"] = { + ["enable"] = true, + ["rangeCheck"] = true, + ["showBy"] = "UP", + ["width"] = 200, + ["height"] = 45, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "current", + ["name_colored"] = true, + ["name_length"] = 15, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "[health:color][health:current]", + ["position"] = "INNERTOPRIGHT", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["reversed"] = true, + ["fontSize"] = 10, + }, + ["power"] = + { + ["enable"] = true, + ["tags"] = "[power:color][power:current]", + ["height"] = 7, + ["position"] = "INNERBOTTOMRIGHT", + ["hideonnpc"] = false, + ["yOffset"] = 7, + ["xOffset"] = 0, + ["fontSize"] = 10, + }, + ["portrait"] = + { + ["enable"] = true, + ["width"] = 35, + ["overlay"] = true, + ["rotation"] = 0, + ["camDistanceScale"] = 1, + ["style"] = "3D", + }, + ["name"] = + { + ["position"] = "INNERLEFT", + ["tags"] = "[name:color][name:15]", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["font"] = "SVUI Number Font", + ["fontSize"] = 12, + ["fontOutline"] = "OUTLINE", + }, + ["buffs"] = + { + ["enable"] = true, + ["perrow"] = 2, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "LEFT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "LEFT", + ["filterPlayer"] = false, + ["filterRaid"] = false, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = false, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = -8, + ["yOffset"] = 0, + ["sizeOverride"] = 40, + }, + ["debuffs"] = + { + ["enable"] = true, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "BUFFS", + ["anchorPoint"] = "LEFT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "LEFT", + ["filterPlayer"] = true, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = false, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = -8, + ["yOffset"] = 0, + ["sizeOverride"] = 40, + }, + ["castbar"] = + { + ["enable"] = true, + ["width"] = 200, + ["height"] = 18, + ["icon"] = true, + ["matchFrameWidth"] = true, + ["format"] = "REMAINING", + ["spark"] = true, + ["useCustomColor"] = false, + ["castingColor"] = {0.8, 0.8, 0}, + ["sparkColor"] = {1, 0.72, 0}, + }, + ["icons"] = + { + ["raidicon"] = + { + ["enable"] = true, + ["size"] = 22, + ["attachTo"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + }, + ["arena"] = { + ["enable"] = true, + ["rangeCheck"] = true, + ["showBy"] = "UP", + ["width"] = 215, + ["height"] = 45, + ["predict"] = false, + ["colorOverride"] = "USE_DEFAULT", + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "current", + ["name_colored"] = true, + ["name_length"] = 15, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "[health:color][health:current]", + ["position"] = "INNERTOPRIGHT", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["reversed"] = true, + ["fontSize"] = 10, + }, + ["power"] = + { + ["enable"] = true, + ["tags"] = "[power:color][power:current]", + ["height"] = 7, + ["position"] = "INNERBOTTOMRIGHT", + ["hideonnpc"] = false, + ["yOffset"] = 7, + ["xOffset"] = 0, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "INNERLEFT", + ["tags"] = "[name:color][name:15]", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["font"] = "SVUI Number Font", + ["fontSize"] = 12, + ["fontOutline"] = "OUTLINE", + }, + ["portrait"] = + { + ["enable"] = true, + ["width"] = 45, + ["overlay"] = true, + ["rotation"] = 0, + ["camDistanceScale"] = 1, + ["style"] = "3D", + }, + ["buffs"] = + { + ["enable"] = true, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "LEFT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "LEFT", + ["filterPlayer"] = + { + friendly = false, + enemy = false, + }, + ["filterRaid"] = + { + friendly = false, + enemy = false, + }, + ["filterBlocked"] = + { + friendly = false, + enemy = false, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "Shield", + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["xOffset"] = -8, + ["yOffset"] = 0, + ["sizeOverride"] = 40, + }, + ["debuffs"] = + { + ["enable"] = true, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "BUFFS", + ["anchorPoint"] = "LEFT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "LEFT", + ["filterPlayer"] = + { + friendly = false, + enemy = false, + }, + ["filterBlocked"] = + { + friendly = false, + enemy = false, + }, + ["filterAllowed"] = + { + friendly = false, + enemy = false, + }, + ["filterInfinite"] = + { + friendly = false, + enemy = false, + }, + ["useFilter"] = "CC", + ["filterDispellable"] = + { + friendly = false, + enemy = false, + }, + ["xOffset"] = -8, + ["yOffset"] = 0, + ["sizeOverride"] = 40, + }, + ["castbar"] = + { + ["enable"] = true, + ["width"] = 215, + ["height"] = 18, + ["icon"] = true, + ["matchFrameWidth"] = true, + ["format"] = "REMAINING", + ["spark"] = true, + ["useCustomColor"] = false, + ["castingColor"] = {0.8, 0.8, 0}, + ["sparkColor"] = {1, 0.72, 0}, + }, + ["pvp"] = + { + ["enable"] = true, + ["trinketPosition"] = "LEFT", + ["trinketSize"] = 45, + ["trinketX"] = -2, + ["trinketY"] = 0, + ["specPosition"] = "RIGHT", + ["specSize"] = 45, + ["specX"] = 2, + ["specY"] = 0, + }, + }, + ["party"] = { + ["enable"] = true, + ["rangeCheck"] = true, + ["threatEnabled"] = true, + ["visibility"] = "[@raid6, exists][nogroup] hide;show", + ["showBy"] = "UP_RIGHT", + ["wrapXOffset"] = 9, + ["wrapYOffset"] = 13, + ["groupCount"] = 1, + ["gRowCol"] = 1, + ["customSorting"] = false, + ["sortMethod"] = "GROUP", + ["sortDir"] = "ASC", + ["invertGroupingOrder"] = false, + ["startFromCenter"] = false, + ["showPlayer"] = true, + ["predict"] = false, + ["colorOverride"] = "USE_DEFAULT", + ["gridMode"] = false, + ["width"] = 70, + ["height"] = 70, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "none", + ["name_colored"] = true, + ["name_length"] = 10, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "", + ["position"] = "BOTTOM", + ["orientation"] = "HORIZONTAL", + ["frequentUpdates"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 10, + }, + ["power"] = + { + ["enable"] = true, + ["tags"] = "", + ["frequentUpdates"] = false, + ["height"] = 7, + ["position"] = "BOTTOMRIGHT", + ["hideonnpc"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "INNERTOPLEFT", + ["tags"] = "[name:color][name:10]", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["font"] = "SVUI Narrator Font", + ["fontSize"] = 13, + ["fontOutline"] = "OUTLINE", + }, + ["buffs"] = + { + ["enable"] = false, + ["perrow"] = 2, + ["numrows"] = 2, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "RIGHTTOP", + ["verticalGrowth"] = "DOWN", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = true, + ["filterRaid"] = true, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = true, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 8, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = true, + ["perrow"] = 2, + ["numrows"] = 2, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "RIGHTTOP", + ["verticalGrowth"] = "DOWN", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = false, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = false, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 8, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["auraWatch"] = + { + ["enable"] = true, + ["size"] = 8, + ["fontSize"] = 11, + }, + ["petsGroup"] = + { + ["enable"] = false, + ["width"] = 30, + ["height"] = 30, + ["anchorPoint"] = "BOTTOMLEFT", + ["xOffset"] = - 1, + ["yOffset"] = 0, + ["name_length"] = 3, + ["tags"] = "[name:3]", + }, + ["targetsGroup"] = + { + ["enable"] = false, + ["width"] = 30, + ["height"] = 30, + ["anchorPoint"] = "TOPLEFT", + ["xOffset"] = - 1, + ["yOffset"] = 0, + ["name_length"] = 3, + ["tags"] = "[name:3]", + }, + ["icons"] = + { + ["raidicon"] = + { + ["enable"] = true, + ["size"] = 25, + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + ["roleIcon"] = + { + ["enable"] = true, + ["size"] = 18, + ["attachTo"] = "INNERBOTTOMRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + ["raidRoleIcons"] = + { + ["enable"] = true, + ["size"] = 18, + ["attachTo"] = "TOPLEFT", + ["xOffset"] = 0, + ["yOffset"] = -4, + }, + }, + ["portrait"] = + { + ["enable"] = true, + ["width"] = 45, + ["overlay"] = true, + ["rotation"] = 0, + ["camDistanceScale"] = 1, + ["style"] = "3D", + }, + }, + ["raid10"] = { + ["enable"] = true, + ["rangeCheck"] = true, + ["threatEnabled"] = true, + ["visibility"] = "[@raid6, noexists][@raid11, exists][nogroup] hide;show", + ["showBy"] = "RIGHT_DOWN", + ["wrapXOffset"] = 8, + ["wrapYOffset"] = 8, + ["groupCount"] = 2, + ["gRowCol"] = 1, + ["customSorting"] = false, + ["sortMethod"] = "GROUP", + ["sortDir"] = "ASC", + ["showPlayer"] = true, + ["predict"] = false, + ["colorOverride"] = "USE_DEFAULT", + ["gridMode"] = false, + ["width"] = 75, + ["height"] = 34, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "none", + ["name_colored"] = true, + ["name_length"] = 4, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "", + ["position"] = "BOTTOM", + ["orientation"] = "HORIZONTAL", + ["frequentUpdates"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 10, + }, + ["power"] = + { + ["enable"] = true, + ["tags"] = "", + ["frequentUpdates"] = false, + ["height"] = 4, + ["position"] = "BOTTOMRIGHT", + ["hideonnpc"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "INNERTOPLEFT", + ["tags"] = "[name:color][name:4]", + ["yOffset"] = 0, + ["xOffset"] = 8, + ["font"] = "SVUI Default Font", + ["fontSize"] = 10, + ["fontOutline"] = "OUTLINE", + }, + ["buffs"] = + { + ["enable"] = false, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "RIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = true, + ["filterRaid"] = true, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = true, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 8, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = false, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "RIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = false, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = false, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 8, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["auraWatch"] = + { + ["enable"] = true, + ["size"] = 8, + }, + ["rdebuffs"] = + { + ["enable"] = true, + ["size"] = 26, + ["xOffset"] = 0, + ["yOffset"] = 2, + }, + ["icons"] = + { + ["raidicon"] = + { + ["enable"] = true, + ["size"] = 15, + ["attachTo"] = "INNERBOTTOMRIGHT", + ["xOffset"] = -8, + ["yOffset"] = 0, + }, + ["roleIcon"] = + { + ["enable"] = true, + ["size"] = 12, + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + ["raidRoleIcons"] = + { + ["enable"] = true, + ["size"] = 18, + ["attachTo"] = "TOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = -4, + }, + }, + }, + ["raid25"] = { + ["enable"] = true, + ["rangeCheck"] = true, + ["threatEnabled"] = true, + ["visibility"] = "[@raid6, noexists][@raid11, noexists][@raid26, exists][nogroup] hide;show", + ["showBy"] = "RIGHT_DOWN", + ["wrapXOffset"] = 8, + ["wrapYOffset"] = 8, + ["groupCount"] = 5, + ["gRowCol"] = 1, + ["customSorting"] = false, + ["sortMethod"] = "GROUP", + ["sortDir"] = "ASC", + ["showPlayer"] = true, + ["predict"] = false, + ["colorOverride"] = "USE_DEFAULT", + ["gridMode"] = false, + ["width"] = 50, + ["height"] = 30, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "none", + ["name_colored"] = true, + ["name_length"] = 4, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "", + ["position"] = "BOTTOM", + ["orientation"] = "HORIZONTAL", + ["frequentUpdates"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 10, + }, + ["power"] = + { + ["enable"] = true, + ["tags"] = "", + ["height"] = 4, + ["position"] = "BOTTOMRIGHT", + ["hideonnpc"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "INNERTOPLEFT", + ["tags"] = "[name:color][name:4]", + ["yOffset"] = 0, + ["xOffset"] = 8, + ["font"] = "SVUI Default Font", + ["fontSize"] = 10, + ["fontOutline"] = "OUTLINE", + }, + ["buffs"] = + { + ["enable"] = false, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "RIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = true, + ["filterRaid"] = true, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = true, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 8, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = false, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "RIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = false, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = false, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 8, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["auraWatch"] = + { + ["enable"] = true, + ["size"] = 8, + }, + ["rdebuffs"] = + { + ["enable"] = true, + ["size"] = 26, + ["xOffset"] = 0, + ["yOffset"] = 2, + }, + ["icons"] = + { + ["raidicon"] = + { + ["enable"] = true, + ["size"] = 15, + ["attachTo"] = "INNERBOTTOMRIGHT", + ["xOffset"] = -8, + ["yOffset"] = 0, + }, + ["roleIcon"] = + { + ["enable"] = true, + ["size"] = 12, + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + ["raidRoleIcons"] = + { + ["enable"] = true, + ["size"] = 18, + ["attachTo"] = "TOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = -4, + }, + }, + }, + ["raid40"] = { + ["enable"] = true, + ["rangeCheck"] = true, + ["threatEnabled"] = true, + ["visibility"] = "[@raid6, noexists][@raid11, noexists][@raid26, noexists][nogroup] hide;show", + ["showBy"] = "RIGHT_DOWN", + ["wrapXOffset"] = 8, + ["wrapYOffset"] = 8, + ["groupCount"] = 8, + ["gRowCol"] = 1, + ["customSorting"] = false, + ["sortMethod"] = "GROUP", + ["sortDir"] = "ASC", + ["showPlayer"] = true, + ["predict"] = false, + ["colorOverride"] = "USE_DEFAULT", + ["gridMode"] = false, + ["width"] = 50, + ["height"] = 30, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "none", + ["name_colored"] = true, + ["name_length"] = 4, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "", + ["position"] = "BOTTOM", + ["orientation"] = "HORIZONTAL", + ["frequentUpdates"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 10, + }, + ["power"] = + { + ["enable"] = false, + ["tags"] = "", + ["frequentUpdates"] = false, + ["height"] = 4, + ["position"] = "BOTTOMRIGHT", + ["hideonnpc"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "INNERTOPLEFT", + ["tags"] = "[name:color][name:4]", + ["yOffset"] = 0, + ["xOffset"] = 8, + ["font"] = "SVUI Default Font", + ["fontSize"] = 10, + ["fontOutline"] = "OUTLINE", + }, + ["buffs"] = + { + ["enable"] = false, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "RIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = true, + ["filterRaid"] = true, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = true, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 8, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = false, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "RIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = false, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = false, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 8, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["rdebuffs"] = + { + ["enable"] = true, + ["size"] = 22, + ["xOffset"] = 0, + ["yOffset"] = 2, + }, + ["auraWatch"] = + { + ["enable"] = true, + ["size"] = 8, + }, + ["icons"] = + { + ["raidicon"] = + { + ["enable"] = true, + ["size"] = 15, + ["attachTo"] = "INNERBOTTOMRIGHT", + ["xOffset"] = -8, + ["yOffset"] = 0, + }, + ["roleIcon"] = + { + ["enable"] = true, + ["size"] = 12, + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + ["raidRoleIcons"] = + { + ["enable"] = true, + ["size"] = 18, + ["attachTo"] = "TOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = -4, + }, + }, + }, + ["raidpet"] = { + ["enable"] = false, + ["rangeCheck"] = true, + ["threatEnabled"] = true, + ["visibility"] = "[group:raid] show; hide", + ["showBy"] = "DOWN_RIGHT", + ["wrapXOffset"] = 3, + ["wrapYOffset"] = 3, + ["groupCount"] = 2, + ["gRowCol"] = 1, + ["customSorting"] = true, + ["sortMethod"] = "PETNAME", + ["sortDir"] = "ASC", + ["invertGroupingOrder"] = false, + ["startFromCenter"] = false, + ["predict"] = false, + ["colorOverride"] = "USE_DEFAULT", + ["gridMode"] = false, + ["width"] = 80, + ["height"] = 30, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "deficit", + ["name_colored"] = true, + ["name_length"] = 4, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "[health:color][health:deficit]", + ["position"] = "BOTTOM", + ["orientation"] = "HORIZONTAL", + ["frequentUpdates"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "INNERTOPLEFT", + ["tags"] = "[name:color][name:4]", + ["yOffset"] = 4, + ["xOffset"] = -4, + ["font"] = "SVUI Default Font", + ["fontSize"] = 10, + ["fontOutline"] = "OUTLINE", + }, + ["buffs"] = + { + ["enable"] = false, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "RIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = true, + ["filterRaid"] = true, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = true, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 8, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["debuffs"] = + { + ["enable"] = false, + ["perrow"] = 3, + ["numrows"] = 1, + ["attachTo"] = "FRAME", + ["anchorPoint"] = "RIGHT", + ["verticalGrowth"] = "UP", + ["horizontalGrowth"] = "RIGHT", + ["filterPlayer"] = false, + ["filterBlocked"] = true, + ["filterAllowed"] = false, + ["filterInfinite"] = false, + ["filterDispellable"] = false, + ["useFilter"] = "", + ["xOffset"] = 8, + ["yOffset"] = 0, + ["sizeOverride"] = 0, + }, + ["auraWatch"] = + { + ["enable"] = true, + ["size"] = 8, + }, + ["rdebuffs"] = + { + ["enable"] = true, + ["size"] = 26, + ["xOffset"] = 0, + ["yOffset"] = 2, + }, + ["icons"] = + { + ["raidicon"] = + { + ["enable"] = true, + ["size"] = 18, + ["attachTo"] = "INNERTOPLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + }, + ["tank"] = { + ["enable"] = true, + ["threatEnabled"] = true, + ["rangeCheck"] = true, + ["gridMode"] = false, + ["width"] = 120, + ["height"] = 28, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "deficit", + ["name_colored"] = true, + ["name_length"] = 8, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "[health:color][health:deficit]", + ["position"] = "INNERRIGHT", + ["orientation"] = "HORIZONTAL", + ["frequentUpdates"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "INNERLEFT", + ["tags"] = "[name:color][name:8]", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["font"] = "SVUI Default Font", + ["fontSize"] = 10, + ["fontOutline"] = "OUTLINE", + }, + ["targetsGroup"] = + { + ["enable"] = false, + ["anchorPoint"] = "RIGHT", + ["xOffset"] = 1, + ["yOffset"] = 0, + ["width"] = 120, + ["height"] = 28, + }, + }, + ["assist"] = { + ["enable"] = true, + ["threatEnabled"] = true, + ["rangeCheck"] = true, + ["gridMode"] = false, + ["width"] = 120, + ["height"] = 28, + ["formatting"] = { + ["power_colored"] = true, + ["power_type"] = "none", + ["power_class"] = false, + ["power_alt"] = false, + ["health_colored"] = true, + ["health_type"] = "deficit", + ["name_colored"] = true, + ["name_length"] = 8, + ["smartlevel"] = false, + ["absorbs"] = false, + ["threat"] = false, + ["incoming"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + }, + ["misc"] = { + ["tags"] = "" + }, + ["health"] = + { + ["tags"] = "[health:color][health:deficit]", + ["position"] = "INNERRIGHT", + ["orientation"] = "HORIZONTAL", + ["frequentUpdates"] = false, + ["yOffset"] = 0, + ["xOffset"] = 0, + ["reversed"] = false, + ["fontSize"] = 10, + }, + ["name"] = + { + ["position"] = "INNERLEFT", + ["tags"] = "[name:color][name:8]", + ["yOffset"] = 0, + ["xOffset"] = 0, + ["font"] = "SVUI Default Font", + ["fontSize"] = 10, + ["fontOutline"] = "OUTLINE", + }, + ["targetsGroup"] = + { + ["enable"] = false, + ["anchorPoint"] = "RIGHT", + ["xOffset"] = 1, + ["yOffset"] = 0, + ["width"] = 120, + ["height"] = 28, + }, + } +} \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/elements/auras.lua b/Interface/AddOns/SVUI/packages/unit/elements/auras.lua index aafceae..32a36fe 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(nil) - aura.stealable:SetTexture(nil) + aura.overlay:SetTexture(0,0,0,0) + aura.stealable:SetTexture(0,0,0,0) if aura.styled then return end if aura.SetNormalTexture then aura:SetNormalTexture("") end @@ -473,7 +473,7 @@ end function MOD:CreateAuraWatch(frame, unit) local aWatch = CreateFrame("Frame", nil, frame) aWatch:SetFrameLevel(frame:GetFrameLevel() + 25) - aWatch:FillInner(frame.Health) + aWatch:SetAllPoints(frame) aWatch.presentAlpha = 1; aWatch.missingAlpha = 0; aWatch.strictMatching = true; @@ -550,17 +550,17 @@ end UPDATE ########################################################## ]]-- +local WATCH_CACHE = {} function MOD:UpdateAuraWatch(frame, key, override) local AW = frame.AuraWatch - local WATCH_CACHE = {} - if not MOD.db[key] then return end - local db = MOD.db[key].auraWatch + if not self.db[key] then return end + local db = self.db[key].auraWatch if not db then return end if not db.enable then AW:Hide() return - else + else AW:Show() end @@ -577,7 +577,7 @@ function MOD:UpdateAuraWatch(frame, key, override) end end else - local unitBW = SuperVillain.db.filter["BuffWatch"][SuperVillain.class] + local unitBW = SuperVillain.db.filter["BuffWatch"] if(unitBW) then for _, buff in pairs(unitBW)do if buff.style == "text" then @@ -604,9 +604,9 @@ function MOD:UpdateAuraWatch(frame, key, override) end end - local fontFile = SuperVillain.Shared:Fetch("font", MOD.db.auraFont) - local fontSize = MOD.db.auraFontSize - local fontOutline = MOD.db.auraFontOutline + local fontFile = SuperVillain.Shared:Fetch("font", self.db.auraFont) + local fontSize = self.db.auraFontSize + local fontOutline = self.db.auraFontOutline for i = 1, #WATCH_CACHE do if WATCH_CACHE[i].id then @@ -631,6 +631,7 @@ function MOD:UpdateAuraWatch(frame, key, override) watchedAura:Width(bwSize) watchedAura:Height(bwSize) watchedAura:ClearAllPoints() + watchedAura:SetPoint(WATCH_CACHE[i].point, frame.Health, WATCH_CACHE[i].point, WATCH_CACHE[i].xOffset, WATCH_CACHE[i].yOffset) if not watchedAura.icon then watchedAura.icon = watchedAura:CreateTexture(nil, "BORDER") @@ -720,7 +721,7 @@ function MOD:UpdateAuraWatch(frame, key, override) if frame.AuraWatch.Update then frame.AuraWatch.Update(frame) end - WATCH_CACHE = nil + wipe(WATCH_CACHE) end function MOD:UpdateGroupAuraWatch(header, override) @@ -728,6 +729,6 @@ function MOD:UpdateGroupAuraWatch(header, override) local group = self.Headers[header] for i = 1, group:GetNumChildren() do local frame = select(i, group:GetChildren()) - if frame and frame.Health then MOD:UpdateAuraWatch(frame, header, override) end + if frame and frame.Health then self:UpdateAuraWatch(frame, header, override) end end end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua b/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua index c9676a4..ec0923d 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua @@ -47,7 +47,7 @@ LOCALS -- local MISSING_MODEL_FILE = [[interface\buttons\talktome_gears.m2]]; -- local MISSING_MODEL_FILE = [[creature\Ghostlyskullpet\ghostlyskullpet.m2]]; -- local MISSING_MODEL_FILE = [[creature\ghost\ghost.m2]]; -local MISSING_MODEL_FILE = [[Spells\Monk_travelingmist_missile.m2]]; +-- local MISSING_MODEL_FILE = [[Spells\Monk_travelingmist_missile.m2]]; local HEALTH_ANIM_FILE = [[Interface\Addons\SVUI\assets\artwork\Unitframe\UNIT-HEALTH-ANIMATION]]; local ELITE_TOP = [[Interface\Addons\SVUI\assets\artwork\Unitframe\Border\ELITE-TOP]] local ELITE_BOTTOM = [[Interface\Addons\SVUI\assets\artwork\Unitframe\Border\ELITE-BOTTOM]] @@ -454,10 +454,10 @@ function MOD:SetActionPanel(frame, unit, noHealthText, noPowerText, noMiscText) frame.StatusPanel.texture = frame.StatusPanel:CreateTexture(nil, "OVERLAY") frame.StatusPanel.texture:SetAllPoints() - frame.StatusPanel.texture:SetTexture([[Interface\BUTTONS\WHITE8X8]]) - frame.StatusPanel.texture:SetBlendMode("ADD") - frame.StatusPanel.texture:SetGradient("VERTICAL",1,1,0,1,0,0) - frame.StatusPanel.texture:SetAlpha(0) + -- frame.StatusPanel.texture:SetTexture([[Interface\BUTTONS\WHITE8X8]]) + -- frame.StatusPanel.texture:SetBlendMode("ADD") + -- frame.StatusPanel.texture:SetGradient("VERTICAL",1,1,0,1,0,0) + -- frame.StatusPanel.texture:SetAlpha(0) frame.StatusPanel:SetFrameStrata("LOW") frame.StatusPanel:SetFrameLevel(20) @@ -467,173 +467,6 @@ end HEALTH ########################################################## ]]-- -local function updateFrequentUpdates(self) - local health = self.Health - if health.frequentUpdates and not self:IsEventRegistered("UNIT_HEALTH_FREQUENT") then - if GetCVarBool("predictedHealth") ~= 1 then - SetCVar("predictedHealth", 1) - end - - self:RegisterEvent('UNIT_HEALTH_FREQUENT', Path) - - if self:IsEventRegistered("UNIT_HEALTH") then - self:UnregisterEvent("UNIT_HEALTH", Path) - end - elseif not self:IsEventRegistered("UNIT_HEALTH") then - self:RegisterEvent('UNIT_HEALTH', Path) - - if self:IsEventRegistered("UNIT_HEALTH_FREQUENT") then - self:UnregisterEvent("UNIT_HEALTH_FREQUENT", Path) - end - end -end - -local CustomUpdate = function(self, event, unit) - if(self.unit ~= unit) or not unit then return end - local health = self.Health - - local min, max = UnitHealth(unit), UnitHealthMax(unit) - local disconnected = not UnitIsConnected(unit) - local invisible = ((min == max) or UnitIsDeadOrGhost(unit) or disconnected); - local tapped = (UnitIsTapped(unit) and (not UnitIsTappedByPlayer(unit))); - - if health.fillInverted then - health:SetReverseFill(true) - end - - health:SetMinMaxValues(-max, 0) - health:SetValue(-min) - - health.disconnected = disconnected - - if health.frequentUpdates ~= health.__frequentUpdates then - health.__frequentUpdates = health.frequentUpdates - updateFrequentUpdates(self) - end - - local bg = health.bg; - local mu = (min / max); - - if(invisible or not health.overlayAnimation) then - health.animation[1].anim:Stop() - health.animation[1]:SetAlpha(0) - end - - if(invisible) then - health:SetStatusBarColor(0.6,0.4,1,0.5) - health.animation[1]:SetVertexColor(0.8,0.3,1,0.4) - elseif(health.colorOverlay) then - local t = oUF_SuperVillain.colors.health - health:SetStatusBarColor(t[1], t[2], t[3], 0.9) - else - health:SetStatusBarColor(1, 0.25 * mu, 0, 0.85) - health.animation[1]:SetVertexColor(1, 0.1 * mu, 0, 0.5) - end - - if(bg) then - bg:SetVertexColor(0,0,0,0) - end - - if(health.overlayAnimation and not invisible) then - if(mu <= 0.25) then - health.animation[1]:SetAlpha(1) - health.animation[1].anim:Play() - else - health.animation[1].anim:Stop() - health.animation[1]:SetAlpha(0) - end - end - - if self.ResurrectIcon then - self.ResurrectIcon:SetAlpha(min == 0 and 1 or 0) - end - if self.isForced then - local current = random(1,max) - health:SetValue(-current) - end -end - -local Update = function(self, event, unit) - if(self.unit ~= unit) or not unit then return end - local health = self.Health - local min, max = UnitHealth(unit), UnitHealthMax(unit) - local disconnected = not UnitIsConnected(unit) - if health.fillInverted then - health:SetReverseFill(true) - end - health:SetMinMaxValues(0, max) - - if(disconnected) then - health:SetValue(max) - else - health:SetValue(min) - end - - health.disconnected = disconnected - - if health.frequentUpdates ~= health.__frequentUpdates then - health.__frequentUpdates = health.frequentUpdates - updateFrequentUpdates(self) - end - - local bg = health.bg; - local db = MOD.db or SuperVillain.db.SVUnit; - local r, g, b, t, t2; - - if(health.colorTapping and not UnitPlayerControlled(unit) and UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit) and not UnitIsTappedByAllThreatList(unit)) then - t = oUF_SuperVillain.colors.tapped - elseif(health.colorDisconnected and not UnitIsConnected(unit)) then - t = oUF_SuperVillain.colors.disconnected - elseif(health.colorClass and UnitIsPlayer(unit)) or - (health.colorClassNPC and not UnitIsPlayer(unit)) or - (health.colorClassPet and UnitPlayerControlled(unit) and not UnitIsPlayer(unit)) then - local _, class = UnitClass(unit) - local tmp = oUF_SuperVillain.colors.class[class] or oUF_SuperVillain.colors.health - t = {(tmp[1] * 0.75),(tmp[2] * 0.75),(tmp[3] * 0.75)} - if(bg and db.classbackdrop and UnitIsPlayer(unit)) then - t2 = t - end - elseif(health.colorReaction and UnitReaction(unit, 'player')) then - t = oUF_SuperVillain.colors.reaction[UnitReaction(unit, "player")] - if(bg and db.classbackdrop and not UnitIsPlayer(unit) and UnitReaction(unit, "player")) then - t2 = t - end - elseif(health.colorSmooth) then - r, g, b = oUF_SuperVillain.ColorGradient(min, max, unpack(health.smoothGradient or oUF_SuperVillain.colors.smooth)) - elseif(health.colorHealth) then - t = oUF_SuperVillain.colors.health - end - - if(t) then - r, g, b = t[1], t[2], t[3] - end - - if(b) then - if(db.healthclass == true and db.colorhealthbyvalue == true or db.colorhealthbyvalue and self.isForced and not(UnitIsTapped(unit) and not UnitIsTappedByPlayer(unit))) then - r, g, b = oUF_SuperVillain.ColorGradient(min,max,1,0,0,1,1,0,r,g,b) - end - health:SetStatusBarColor(r, g, b) - if(bg) then - local mu = bg.multiplier or 1 - if(t2) then - r, g, b = t2[1], t2[2], t2[3] - end - bg:SetVertexColor(r * mu, g * mu, b * mu) - end - end - - if self.ResurrectIcon then - self.ResurrectIcon:SetAlpha(min == 0 and 1 or 0) - end - if self.isForced then - min = random(1,max) - health:SetValue(min) - end - if(db.gridMode) then - health:SetOrientation("VERTICAL") - end -end - function MOD:CreateHealthBar(frame, hasbg, reverse) local healthBar = CreateFrame("StatusBar", nil, frame) healthBar:SetFrameStrata("LOW") @@ -664,16 +497,16 @@ function MOD:CreateHealthBar(frame, hasbg, reverse) healthBar.noupdate = false; healthBar.fillInverted = reverse; healthBar.colorTapping = true; - healthBar.colorDisconnected = true - healthBar.Override = Update; + healthBar.colorDisconnected = true; + healthBar.Override = false; return healthBar end function MOD:RefreshHealthBar(frame, overlay) if(overlay) then - frame.Health.Override = CustomUpdate; + frame.Health.Override = true; else - frame.Health.Override = Update; + frame.Health.Override = false; end end --[[ @@ -744,23 +577,6 @@ function MOD:CreateAltPowerBar(frame) return altPower end -local function PowerUpdateNamePosition(frame, unit) - local panel = frame.InfoPanel - if(not panel.Power or (panel.Power and not panel.Power:IsShown()) or not panel.Name) then return end - local db = MOD.db[unit] - local parent = panel.Name:GetParent() - if UnitIsPlayer(unit)then - local point = db.name.position; - panel.Power:SetAlpha(1) - panel.Name:ClearAllPoints() - SuperVillain:ReversePoint(panel.Name, point, parent, db.name.xOffset, db.name.yOffset) - else - panel.Power:SetAlpha(db.power.hideonnpc and 0 or 1) - panel.Name:ClearAllPoints() - panel.Name:SetPoint(panel.Power:GetPoint()) - end -end - function MOD:PostUpdatePower(unit, value, max) local db = MOD.db[unit] local powerType, _, _, _, _ = UnitPowerType(unit) @@ -783,71 +599,12 @@ function MOD:PostUpdatePower(unit, value, max) if not colors then return end self:SetStatusBarColor(colors[1], colors[2], colors[3]) self.bg:SetVertexColor(colors[1] * mult, colors[2] * mult, colors[3] * mult) - if db and db.power and db.power.hideonnpc then - PowerUpdateNamePosition(parent, unit) - end end --[[ ########################################################## PORTRAIT ########################################################## ]]-- -local Update2DPortrait = function(self, event, unit) - if(not unit or not UnitIsUnit(self.unit, unit)) then return end - local portrait = self.Portrait - SetPortraitTexture(portrait, unit) -end - -local Update3DPortrait = function(self, event, unit) - if(not unit or not UnitIsUnit(self.unit, unit)) then return end - local portrait = self.Portrait - if(not portrait:IsObjectType'Model') then return; end - local guid = UnitGUID(unit) - local camera = portrait.UserCamDistance or 1 - local rotate = portrait.UserRotation - if(not UnitExists(unit) or not UnitIsConnected(unit) or not UnitIsVisible(unit)) then - portrait:SetCamDistanceScale(1) - portrait:SetPortraitZoom(0) - portrait:SetPosition(4,-1,1) - portrait:ClearModel() - portrait:SetModel(MISSING_MODEL_FILE) - portrait.guid = nil - portrait:SetBackdropColor(0.25,0.25,0.25) - if portrait.UpdateColor then - portrait:UpdateColor(0.25,0.25,0.25) - end - elseif(portrait.guid ~= guid or event == 'UNIT_MODEL_CHANGED') then - portrait:SetCamDistanceScale(camera) - portrait:SetPortraitZoom(1) - portrait:SetPosition(0,0,0) - portrait:ClearModel() - portrait:SetUnit(unit) - portrait.guid = guid - - if(rotate and portrait:GetFacing() ~= rotate / 60) then - portrait:SetFacing(rotate / 60) - end - - local r, g, b, color = 0.25, 0.25, 0.25 - if not UnitIsPlayer(unit)then - color = oUF_SuperVillain.colors.reaction[UnitReaction(unit,"player")] - if(color ~= nil) then - r,g,b = color[1], color[2], color[3] - end; - else - local _,unitClass = UnitClass(unit) - if unitClass then - color = oUF_SuperVillain.colors.class[unitClass] - r,g,b = color[1], color[2], color[3] - end - end - portrait:SetBackdropColor(r,g,b) - if portrait.UpdateColor then - portrait:UpdateColor(r,g,b) - end - end -end - function MOD:CreatePortrait(frame,smallUnit,isPlayer) -- 3D Portrait local portrait3D = CreateFrame("PlayerModel",nil,frame) @@ -888,10 +645,6 @@ function MOD:CreatePortrait(frame,smallUnit,isPlayer) overlay:SetFrameLevel(3) portrait2D.overlay = overlay; - -- Set Updates - portrait2D.Override = Update2DPortrait - portrait3D.Override = Update3DPortrait - -- Assign To Frame frame.PortraitModel = portrait3D; frame.PortraitTexture = portrait2D; diff --git a/Interface/AddOns/SVUI/packages/unit/elements/misc.lua b/Interface/AddOns/SVUI/packages/unit/elements/misc.lua index eb7a394..d99e8ef 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/misc.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/misc.lua @@ -473,13 +473,13 @@ function MOD:CreateXRay(frame) xray.icon:SetTexture("Interface\\Addons\\SVUI\\assets\\artwork\\Unitframe\\UNIT-XRAY") xray.icon:SetAllPoints(xray) xray.icon:SetAlpha(0) - xray:SetScript("OnLeave",function()GameTooltip:Hide()xray.icon:SetAlpha(0)end) - xray:SetScript("OnEnter",function(self) + xray:SetScript("OnLeave", function() GameTooltip:Hide() xray.icon:SetAlpha(0) end) + xray:SetScript("OnEnter", function(self) xray.icon:SetAlpha(1) - local r,s,b,m=GetScreenHeight(),GetScreenWidth(),self:GetCenter() - local t,u,v="RIGHT","TOP","BOTTOM" - if (b < (r / 2)) then t="LEFT" end - if (m < (s / 2)) then u,v=v,u end + local r,s,b,m = GetScreenHeight(),GetScreenWidth(),self:GetCenter() + local t,u,v = "RIGHT","TOP","BOTTOM" + if (b < (r / 2)) then t = "LEFT" end + if (m < (s / 2)) then u,v = v,u end GameTooltip:SetOwner(self,"ANCHOR_NONE") GameTooltip:SetPoint(u..t,self,v..t) GameTooltip:SetText(FOCUSTARGET.."\n") diff --git a/Interface/AddOns/SVUI/packages/unit/elements/tags.lua b/Interface/AddOns/SVUI/packages/unit/elements/tags.lua index 7b2b3b2..af59fa3 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/tags.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/tags.lua @@ -244,7 +244,7 @@ end for i = 1, 30 do oUF_SuperVillain.Tags.Methods["name:"..i] = function(unit) local name = UnitName(unit) - local result = (name ~= nil) and TrimTagText(name, i).."|r" or "" + local result = (name ~= nil) and (TrimTagText(name, i).."|r ") or "" return result end end @@ -282,7 +282,7 @@ oUF_SuperVillain.Tags.Methods["name:level"] = function(unit) end end local pre,status = GetStatusString(unit) - local levelString = pre .. level .. status + local levelString = " " .. pre .. level .. status hexString = Hex(r, g, b) return ("%s%s|r"):format(hexString, levelString) end diff --git a/Interface/AddOns/SVUI/packages/unit/frames.lua b/Interface/AddOns/SVUI/packages/unit/frames.lua index f23e7ae..39cbbc1 100644 --- a/Interface/AddOns/SVUI/packages/unit/frames.lua +++ b/Interface/AddOns/SVUI/packages/unit/frames.lua @@ -23,9 +23,11 @@ local type = _G.type; local tostring = _G.tostring; local tinsert = _G.tinsert; local string = _G.string; +local math = _G.math; --[[ STRING METHODS ]]-- local find, format, upper = string.find, string.format, string.upper; local match, gsub = string.match, string.gsub; +local numMin = math.min; local SuperVillain, L = unpack(select(2, ...)); local _, ns = ... @@ -42,7 +44,7 @@ LOCAL DATA ]]-- local CONSTRUCTORS, UPDATERS = {}, {} local lastArenaFrame, lastBossFrame -local _POINTMAP = { +local sortMapping = { ["DOWN_RIGHT"] = {[1]="TOP",[2]="TOPLEFT",[3]="LEFT",[4]="RIGHT",[5]="LEFT",[6]=1,[7]=-1,[8]=false}, ["DOWN_LEFT"] = {[1]="TOP",[2]="TOPRIGHT",[3]="RIGHT",[4]="LEFT",[5]="RIGHT",[6]=1,[7]=-1,[8]=false}, ["UP_RIGHT"] = {[1]="BOTTOM",[2]="BOTTOMLEFT",[3]="LEFT",[4]="RIGHT",[5]="LEFT",[6]=1,[7]=1,[8]=false}, @@ -54,52 +56,52 @@ local _POINTMAP = { ["UP"] = {[1]="BOTTOM",[2]="BOTTOM",[3]="BOTTOM",[4]="TOP",[5]="TOP",[6]=1,[7]=1,[8]=false}, ["DOWN"] = {[1]="TOP",[2]="TOP",[3]="TOP",[4]="BOTTOM",[5]="BOTTOM",[6]=1,[7]=1,[8]=false}, } -local _GSORT = { - ['CLASS']=function(self) - self:SetAttribute("groupingOrder","DEATHKNIGHT,DRUID,HUNTER,MAGE,PALADIN,PRIEST,SHAMAN,WARLOCK,WARRIOR,MONK") - self:SetAttribute('sortMethod','NAME') - self:SetAttribute("sortMethod",'CLASS') +local GroupDistributor = { + ["CLASS"] = function(x) + x:SetAttribute("groupingOrder","DEATHKNIGHT,DRUID,HUNTER,MAGE,PALADIN,PRIEST,SHAMAN,WARLOCK,WARRIOR,MONK") + x:SetAttribute("sortMethod","NAME") + x:SetAttribute("groupBy","CLASS") end, - ['MTMA']=function(self) - self:SetAttribute("groupingOrder","MAINTANK,MAINASSIST,NONE") - self:SetAttribute('sortMethod','NAME') - self:SetAttribute("sortMethod",'ROLE') + ["MTMA"] = function(x) + x:SetAttribute("groupingOrder","MAINTANK,MAINASSIST,NONE") + x:SetAttribute("sortMethod","NAME") + x:SetAttribute("groupBy","ROLE") end, - ['ROLE']=function(self) - self:SetAttribute("groupingOrder","TANK,HEALER,DAMAGER,NONE") - self:SetAttribute('sortMethod','NAME') - self:SetAttribute("sortMethod",'ASSIGNEDROLE') + ["ROLE_TDH"] = function(x) + x:SetAttribute("groupingOrder","TANK,DAMAGER,HEALER,NONE") + x:SetAttribute("sortMethod","NAME") + x:SetAttribute("groupBy","ASSIGNEDROLE") end, - ['ROLE_TDH']=function(self) - self:SetAttribute("groupingOrder","TANK,DAMAGER,HEALER,NONE") - self:SetAttribute('sortMethod','NAME') - self:SetAttribute("sortMethod",'ASSIGNEDROLE') + ["ROLE_HTD"] = function(x) + x:SetAttribute("groupingOrder","HEALER,TANK,DAMAGER,NONE") + x:SetAttribute("sortMethod","NAME") + x:SetAttribute("groupBy","ASSIGNEDROLE") end, - ['ROLE_HTD']=function(self) - self:SetAttribute("groupingOrder","HEALER,TANK,DAMAGER,NONE") - self:SetAttribute('sortMethod','NAME') - self:SetAttribute("sortMethod",'ASSIGNEDROLE') + ["ROLE_HDT"] = function(x) + x:SetAttribute("groupingOrder","HEALER,DAMAGER,TANK,NONE") + x:SetAttribute("sortMethod","NAME") + x:SetAttribute("groupBy","ASSIGNEDROLE") end, - ['ROLE_HDT']=function(self) - self:SetAttribute("groupingOrder","HEALER,DAMAGER,TANK,NONE") - self:SetAttribute('sortMethod','NAME') - self:SetAttribute("sortMethod",'ASSIGNEDROLE') + ["ROLE"] = function(x) + x:SetAttribute("groupingOrder","TANK,HEALER,DAMAGER,NONE") + x:SetAttribute("sortMethod","NAME") + x:SetAttribute("groupBy","ASSIGNEDROLE") end, - ['NAME']=function(self) - self:SetAttribute("groupingOrder","1,2,3,4,5,6,7,8") - self:SetAttribute('sortMethod','NAME') - self:SetAttribute("sortMethod",nil) + ["NAME"] = function(x) + x:SetAttribute("groupingOrder","1,2,3,4,5,6,7,8") + x:SetAttribute("sortMethod","NAME") + x:SetAttribute("groupBy",nil) end, - ['GROUP']=function(self) - self:SetAttribute("groupingOrder","1,2,3,4,5,6,7,8") - self:SetAttribute('sortMethod','INDEX') - self:SetAttribute("sortMethod",'GROUP') + ["GROUP"] = function(x) + x:SetAttribute("groupingOrder","1,2,3,4,5,6,7,8") + x:SetAttribute("sortMethod","INDEX") + x:SetAttribute("groupBy","GROUP") end, - ['PETNAME']=function(self) - self:SetAttribute("groupingOrder","1,2,3,4,5,6,7,8") - self:SetAttribute('sortMethod','NAME') - self:SetAttribute("sortMethod",nil) - self:SetAttribute("filterOnPet",true) + ["PETNAME"] = function(x) + x:SetAttribute("groupingOrder","1,2,3,4,5,6,7,8") + x:SetAttribute("sortMethod","NAME") + x:SetAttribute("groupBy", nil) + x:SetAttribute("filterOnPet", true) end } --[[ @@ -1028,6 +1030,7 @@ function MOD:SetUnitFrame(key) oUF_SuperVillain:SetActiveStyle(styleName) frame = oUF_SuperVillain:Spawn(unit, styleName) self.Units[unit] = frame + self.Roster[#self.Roster+1] = styleName else frame = self.Units[unit] end @@ -1055,6 +1058,7 @@ function MOD:SetEnemyFrames(key, maxCount) oUF_SuperVillain:SetActiveStyle(styleName) frame = oUF_SuperVillain:Spawn(unit, styleName) self.Units[unit] = frame + self.Roster[#self.Roster+1] = styleName else frame = self.Units[unit] end @@ -1193,7 +1197,8 @@ local UpdateRaidSubUnit = function(self, key, db) if not self:IsElementEnabled('RaidDebuffs')then self:EnableElement("RaidDebuffs") end - rdBuffs:Size(db.rdebuffs.size) + local actualSz = numMin(db.rdebuffs.size, (db.height - 4)) + rdBuffs:Size(actualSz) rdBuffs:Point("CENTER", self, "CENTER", db.rdebuffs.xOffset, db.rdebuffs.yOffset) rdBuffs:Show() else @@ -1320,12 +1325,12 @@ local function SetRaidFrame(frame) shadow:WrapOuter(frame, 3, 3) shadow:SetBackdrop({ edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], - edgeSize = SuperVillain:Scale(3), + edgeSize = 3, insets = { - left = SuperVillain:Scale(5), - right = SuperVillain:Scale(5), - top = SuperVillain:Scale(5), - bottom = SuperVillain:Scale(5) + left = 5, + right = 5, + top = 5, + bottom = 5 } }) shadow:SetBackdropColor(0, 0, 0, 0) @@ -1455,12 +1460,12 @@ CONSTRUCTORS["raidpet"] = function(self, unit) shadow:WrapOuter(self, 3, 3) shadow:SetBackdrop({ edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], - edgeSize = SuperVillain:Scale(3), + edgeSize = 3, insets = { - left = SuperVillain:Scale(5), - right = SuperVillain:Scale(5), - top = SuperVillain:Scale(5), - bottom = SuperVillain:Scale(5) + left = 5, + right = 5, + top = 5, + bottom = 5 } }) shadow:SetBackdropColor(0, 0, 0, 0) @@ -1609,12 +1614,12 @@ CONSTRUCTORS["party"] = function(self, unit) shadow:WrapOuter(self, 3, 3) shadow:SetBackdrop({ edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], - edgeSize = SuperVillain:Scale(3), + edgeSize = 3, insets = { - left = SuperVillain:Scale(5), - right = SuperVillain:Scale(5), - top = SuperVillain:Scale(5), - bottom = SuperVillain:Scale(5) + left = 5, + right = 5, + top = 5, + bottom = 5 } }) shadow:SetBackdropColor(0, 0, 0, 0) @@ -1849,8 +1854,8 @@ local SecureHeaderClear = function(self) self:SetAttribute("yOffset", nil) end -local function ConstructGroupHeader(parentFrame, filter, styleName, headerName, template1, groupName, template2) - local db = MOD.db[groupName] +function MOD:ConstructGroupHeader(parentFrame, filter, styleName, headerName, template1, groupName, template2) + local db = self.db[groupName] oUF_SuperVillain:SetActiveStyle(styleName) local groupHeader = oUF_SuperVillain:SpawnHeader(headerName, template2, nil, "oUF-initialConfigFunction", ("self:SetWidth(%d); self:SetHeight(%d); self:SetFrameLevel(5)"):format(db.width, db.height), @@ -1879,9 +1884,10 @@ local GroupSetConfigEnvironment = function(self) local key = self.___groupkey local db = MOD.db[key] local anchorPoint; + local sorting = db.showBy + local pointMap = sortMapping[sorting] + local sortMethod = db.sortMethod local widthCalc, heightCalc, xCalc, yCalc = 0, 0, 0, 0; - local sorting = db.showBy; - local pointMap = _POINTMAP[sorting] local point1, point2, point3, point4, point5, horizontal, vertical, isHorizontal = pointMap[1], pointMap[2], pointMap[3], pointMap[4], pointMap[5], pointMap[6], pointMap[7], pointMap[8]; for i = 1, db.groupCount do local frame = self.groups[i] @@ -1917,10 +1923,10 @@ local GroupSetConfigEnvironment = function(self) end DetachSubFrames(frame:GetChildren()) frame:SetAttribute("point", point1) - if not frame.isForced then + if not frame.isForced then frame:SetAttribute("maxColumns", db.customSorting and db.groupCount or 1) frame:SetAttribute("unitsPerColumn", db.customSorting and (db.gRowCol * 5) or 5) - _GSORT[db.sortMethod](frame) + GroupDistributor[sortMethod](frame) frame:SetAttribute("sortDir", db.sortDir) frame:SetAttribute("showPlayer", db.showPlayer) end @@ -1948,7 +1954,7 @@ local GroupSetConfigEnvironment = function(self) widthCalc = widthCalc + db.width + db.wrapXOffset; xCalc = xCalc + 1 end - else + else if isHorizontal then if yCalc == 1 then if frame then @@ -2038,7 +2044,8 @@ function MOD:SetGroupFrame(key, filter, template1, forceUpdate, template2) oUF_SuperVillain:SetActiveStyle(styleName) if(key == "tank" or key == "assist") then - frame = ConstructGroupHeader(SVUI_UnitFrameParent, filter, styleName, styleName, template1, key, template2) + frame = self:ConstructGroupHeader(SVUI_UnitFrameParent, filter, styleName, styleName, template1, key, template2) + self.Roster[#self.Roster+1] = styleName else frame = CreateFrame("Frame", styleName, SVUI_UnitFrameParent, "SecureHandlerStateTemplate") frame.groups = {} @@ -2066,13 +2073,13 @@ function MOD:SetGroupFrame(key, filter, template1, forceUpdate, template2) if(db.customSorting) then if(not frame.groups[1]) then groupName = styleName .. "Group1" - frame.groups[1] = ConstructGroupHeader(frame, 1, styleName, groupName, template1, key, template2) + frame.groups[1] = self:ConstructGroupHeader(frame, 1, styleName, groupName, template1, key, template2) end else for i = 1, db.groupCount do if(not frame.groups[i]) then groupName = styleName .. "Group" .. i - frame.groups[i] = ConstructGroupHeader(frame, i, styleName, groupName, template1, key, template2) + frame.groups[i] = self:ConstructGroupHeader(frame, i, styleName, groupName, template1, key, template2) end end end diff --git a/Interface/AddOns/SVUI/scripts/comix.lua b/Interface/AddOns/SVUI/scripts/comix.lua index 142a154..98cd9f2 100644 --- a/Interface/AddOns/SVUI/scripts/comix.lua +++ b/Interface/AddOns/SVUI/scripts/comix.lua @@ -126,13 +126,13 @@ local Comix_OnEvent = function(self, event, ...) if subEvent == "PARTY_KILL" and guid == playerGUID and ready then self:ReadyState(false) local rng = random(1,15) - if rng < 8 then - self:LaunchPopup("BASIC") - elseif rng < 13 then + if((rng < 3) and SuperVillain.db.system.bigComix) then + self:LaunchPopup("PREMIUM") + elseif rng < 8 then self:LaunchPopup("DELUXE") else - self:LaunchPopup("PREMIUM") - end + self:LaunchPopup("BASIC") + end end end diff --git a/Interface/AddOns/SVUI/scripts/misc.lua b/Interface/AddOns/SVUI/scripts/misc.lua index 8c13f5c..ad70cde 100644 --- a/Interface/AddOns/SVUI/scripts/misc.lua +++ b/Interface/AddOns/SVUI/scripts/misc.lua @@ -51,211 +51,6 @@ function MerchantItemButton_OnModifiedClick(self, ...) end --[[ ########################################################## -PVP TOOLKIT -########################################################## -]]-- -local ICON_FILE = [[Interface\AddOns\SVUI\assets\artwork\Icons\DOCK-PVP]] -local PVP_SAFE = [[Interface\AddOns\SVUI\assets\artwork\Icons\PVP-SAFE]] -local PVP_HELP = [[Interface\AddOns\SVUI\assets\artwork\Icons\PVP-INCOMING]] -local PVP_LOST = [[Interface\WorldMap\Skull_64Red]] -local PVP_NODES = { - [461] = { --Arathi Basin (5) - "Stables", "Lumber", "Blacksmith", "Mine", "Farm" - }, - [935] = { --Deepwind Gorge (3) - "Center Mine", "North Mine", "South Mine" - }, - [482] = { --Eye of the Storm (4) - "Fel Reaver", "Blood Elf", "Draenei", "Mage" - }, - [736] = { --The Battle for Gilneas (3) - "LightHouse", "WaterWorks", "Mines" - }, -} - -local Safe_OnEnter = function(self) - if InCombatLockdown() then return end - if(self.name and self.name ~= "") then - self:SetBackdropBorderColor(1,0.45,0) - GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) - GameTooltip:ClearLines() - GameTooltip:AddLine(self.name .. " is Safe!", 1, 1, 1) - GameTooltip:Show() - end -end - -local Safe_OnLeave = function(self) - if InCombatLockdown() then return end - self:SetBackdropBorderColor(0,0,0) - if(GameTooltip:IsShown()) then GameTooltip:Hide() end -end - -local Safe_OnClick = function(self) - if(self.name and self.name ~= "") then - local msg = ("%s Safe"):format(self.name) - SendChatMessage(msg, "INSTANCE_CHAT") - end -end - -local Help_OnEnter = function(self) - if InCombatLockdown() then return end - if(self.name and self.name ~= "") then - self:SetBackdropBorderColor(1,0.45,0) - GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) - GameTooltip:ClearLines() - GameTooltip:AddLine(self.name .. " Needs Help!", 1, 1, 1) - GameTooltip:Show() - end -end - -local Help_OnLeave = function(self) - if InCombatLockdown() then return end - self:SetBackdropBorderColor(0,0,0) - if(GameTooltip:IsShown()) then GameTooltip:Hide() end -end - -local Help_OnClick = function(self) - if(self.name and self.name ~= "") then - local msg = ("{rt8} Incoming %s {rt8}"):format(self.name) - SendChatMessage(msg, "INSTANCE_CHAT") - end -end - -local EnteringBattleGround = function(self) - local mapID = GetCurrentMapAreaID() - if(not mapID) then - self:RegisterEvent("ZONE_CHANGED") - return - end - local points = PVP_NODES[mapID] - if(points) then - for i = 1, 5 do - local nodeName = ("SVUI_PVPNode%d"):format(i) - local node = _G[nodeName] - local safe = node.Safe - local help = node.Help - if(i <= #points) then - local name = points[i] - safe.name = name - help.name = name - node.Text:SetText(name) - node:Show() - else - safe.name = "" - help.name = "" - node.Text:SetText("") - node:Hide() - end - end - self:Enable() - end - - self:UnregisterEvent("ZONE_CHANGED") - self.InPVP = true -end - -local ExitingBattleGround = function(self) - for i = 1, 5 do - local nodeName = ("SVUI_PVPNode%d"):format(i) - local node = _G[nodeName] - local safe = node.Safe - local help = node.Help - safe.name = "" - help.name = "" - node.Text:SetText("") - node:Hide() - end - self:Disable() -end - -local PVPCommunicator_OnEvent = function(self, event, ...) - local instance, groupType = IsInInstance() - if((instance and groupType == "pvp") or event == "UPDATE_BATTLEFIELD_SCORE") then - if(not self.InPVP) then - self:EnteringBattleGround() - end - else - self:ExitingBattleGround() - self.InPVP = nil - end -end - -local function LoadPVPComm() - local holder = CreateFrame("Frame", "SVUI_PVPComm", SuperDockWindowRight) - holder:SetFrameStrata("BACKGROUND") - SuperVillain:RegisterDocklet("SVUI_PVPComm", "PVP ToolKit", ICON_FILE) - - local width = holder:GetWidth() - local height = holder:GetHeight() - local sectionWidth = (width / 6) - 2 - local sectionHeight = (height / 5) - 2 - local iconSize = sectionHeight * 0.5 - - for i = 1, 5 do - local yOffset = (sectionHeight * (i - 1)) + 2 - - local poiName = ("SVUI_PVPNode%d"):format(i) - local poi = CreateFrame("Frame", poiName, holder) - poi:SetSize((width - 2), sectionHeight) - poi:SetPoint("TOP", holder, "TOP", 0, -yOffset) - poi:SetPanelTemplate("Transparent") - - local safe = CreateFrame("Button", nil, poi) - safe:SetSize(sectionWidth, sectionHeight) - safe:SetPoint("RIGHT", poi, "RIGHT", -2, 0) - safe:SetButtonTemplate() - safe:SetPanelColor("green") - local sicon = safe:CreateTexture(nil, "OVERLAY") - sicon:SetPoint("CENTER", safe, "CENTER", 0, 0) - sicon:SetSize(iconSize,iconSize) - sicon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - sicon:SetTexture(PVP_SAFE) - safe:SetScript("OnEnter", Safe_OnEnter) - safe:SetScript("OnLeave", Safe_OnLeave) - safe:SetScript("OnClick", Safe_OnClick) - - poi.Safe = safe - - local help = CreateFrame("Button", nil, poi) - help:SetSize(sectionWidth, sectionHeight) - help:SetPoint("RIGHT", safe, "LEFT", -2, 0) - help:SetButtonTemplate() - help:SetPanelColor("red") - local hicon = help:CreateTexture(nil, "OVERLAY") - hicon:SetPoint("CENTER", help, "CENTER", 0, 0) - hicon:SetSize(iconSize,iconSize) - hicon:SetTexCoord(0.1, 0.9, 0.1, 0.9) - hicon:SetTexture(PVP_HELP) - help:SetScript("OnEnter", Help_OnEnter) - help:SetScript("OnLeave", Help_OnLeave) - help:SetScript("OnClick", Help_OnClick) - - poi.Help = help - - poi.Text = poi:CreateFontString(nil,"OVERLAY") - poi.Text:SetFont(SuperVillain.Media.font.roboto, 12, "NONE") - poi.Text:SetPoint("TOPLEFT", poi, "TOPLEFT", 2, 0) - poi.Text:SetPoint("BOTTOMRIGHT", help, "BOTTOMLEFT", -2, 0) - poi.Text:SetJustifyH("CENTER") - poi.Text:SetText("") - end - - holder:Hide() - - local docklet = _G["SVUI_PVPComm_ToolBarButton"] - docklet.Enable = SuperVillain.AddTool - docklet.Disable = SuperVillain.RemoveTool - docklet.EnteringBattleGround = EnteringBattleGround - docklet.ExitingBattleGround = ExitingBattleGround - docklet:RegisterEvent("PLAYER_ENTERING_WORLD") - docklet:RegisterEvent("UPDATE_BATTLEFIELD_SCORE") - docklet:SetScript("OnEvent", PVPCommunicator_OnEvent) - docklet:Disable() -end - ---SuperVillain.Registry:NewScript(LoadPVPComm) ---[[ -########################################################## CHAT BUBBLES ########################################################## ]]-- @@ -286,7 +81,7 @@ local function LoadStyledChatBubbles() region:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Chat\CHATBUBBLE-TAIL]]) needsUpdate = false else - region:SetTexture(nil) + region:SetTexture(0,0,0,0) end elseif(region:GetObjectType() == "FontString" and not frame.text) then frame.text = region @@ -740,15 +535,14 @@ local function GetThreatBarColor(unitWithHighestThreat) end local function ThreatBar_OnEvent(self, event) - local grouped,inRaid,hasPet=IsInGroup(),IsInRaid(),UnitExists('pet') local isTanking, status, scaledPercent = UnitDetailedThreatSituation('player','target') if scaledPercent and scaledPercent > 0 then self:Show() if scaledPercent==100 then - if hasPet then + if(UnitExists('pet')) then CurrentThreats['pet']=select(3,UnitDetailedThreatSituation('pet','target')) end - if inRaid then + if(IsInRaid()) then for i=1,40 do if UnitExists('raid'..i) and not UnitIsUnit('raid'..i,'player') then CurrentThreats['raid'..i]=select(3,UnitDetailedThreatSituation('raid'..i,'target')) diff --git a/Interface/AddOns/SVUI/scripts/questwatch.lua b/Interface/AddOns/SVUI/scripts/questwatch.lua index d18be09..e62a98c 100644 --- a/Interface/AddOns/SVUI/scripts/questwatch.lua +++ b/Interface/AddOns/SVUI/scripts/questwatch.lua @@ -314,8 +314,7 @@ local QuestDocklet_OnEvent = function(self, event) QuestDockletFrame:Show() if button then button.IsOpen = true; - button:SetPanelColor("green") - button.icon:SetGradient(unpack(SuperVillain.Media.gradient.green)) + button:SaveColors("green", "green") end end end diff --git a/Interface/AddOns/SVUI/scripts/raid.lua b/Interface/AddOns/SVUI/scripts/raid.lua index 362dcc1..afd86e4 100644 --- a/Interface/AddOns/SVUI/scripts/raid.lua +++ b/Interface/AddOns/SVUI/scripts/raid.lua @@ -35,7 +35,6 @@ RAID UTILITY By: Elv local PANEL_HEIGHT = 120 local find = string.find local RaidUtilFrame = CreateFrame("Frame"); -local screenMod = SuperVillain.mult; --Check if We are Raid Leader or Raid Officer local function CheckRaidStatus() local inInstance, instanceType = IsInInstance() @@ -70,8 +69,8 @@ local function CreateUtilButton(name, parent, template, width, height, point, re elseif texture then local t = b:CreateTexture(nil,"OVERLAY",nil) t:SetTexture(texture) - t:SetPoint("TOPLEFT", b, "TOPLEFT", screenMod, -screenMod) - t:SetPoint("BOTTOMRIGHT", b, "BOTTOMRIGHT", -screenMod, screenMod) + t:Point("TOPLEFT", b, "TOPLEFT", 1, -1) + t:Point("BOTTOMRIGHT", b, "BOTTOMRIGHT", -1, 1) end b:HookScript("OnEnter", ButtonEnter) b:HookScript("OnLeave", ButtonLeave) diff --git a/Interface/AddOns/SVUI/scripts/spellbind.lua b/Interface/AddOns/SVUI/scripts/spellbind.lua index 8c9ce72..01f269b 100644 --- a/Interface/AddOns/SVUI/scripts/spellbind.lua +++ b/Interface/AddOns/SVUI/scripts/spellbind.lua @@ -42,55 +42,161 @@ local DB = {}; DB.spells = DB.spells or {} DB.frames = DB.frames or {} DB.keys = DB.keys or {} -local SpellBinder = CreateFrame("Frame", "SpellBinder", SpellBookFrame, "ButtonFrameTemplate") -SpellBinder:SetPoint("TOPLEFT", SpellBookFrame, "TOPRIGHT", 100, 0) -SpellBinder:SetSize(300, 400) -SpellBinder:Hide() - -_G["SpellBinderPortrait"]:SetTexture("Interface\\Spellbook\\Spellbook-Icon") - -SpellBinder.title = _G["SpellBinderTitle"] or SpellBinder:CreateFontString("SpellBinderTitle", "OVERLAY", "GameFontNormal") -SpellBinder.title:SetPoint("TOP", _G["SpellBinder"], "TOP", 0, -5) -SpellBinder.title:SetText("SpellBinder") - -SpellBinder.sbOpen = false -SpellBinder.spellbuttons = {} - -ClickCastFrames = _G.ClickCastFrames or {} -for i, v in pairs({ - "PlayerFrame", "PetFrame", - -- Party members - "PartyMemberFrame1", "PartyMemberFrame2", "PartyMemberFrame3", "PartyMemberFrame4", "PartyMemberFrame5", - -- Party pets - "PartyMemberFrame1PetFrame", "PartyMemberFrame2PetFrame", "PartyMemberFrame3PetFrame", "PartyMemberFrame4PetFrame", "PartyMemberFrame5PetFrame", - -- Compact party member frame - "CompactPartyFrameMemberSelf", "CompactPartyFrameMemberSelfBuff1", "CompactPartyFrameMemberSelfBuff2", "CompactPartyFrameMemberSelfBuff3", "CompactPartyFrameMemberSelfDebuff1", "CompactPartyFrameMemberSelfDebuff2", "CompactPartyFrameMemberSelfDebuff3", - "CompactPartyFrameMember1Buff1", "CompactPartyFrameMember1Buff2", "CompactPartyFrameMember1Buff3", "CompactPartyFrameMember1Debuff1", "CompactPartyFrameMember1Debuff2", "CompactPartyFrameMember1Debuff3", - "CompactPartyFrameMember2Buff1", "CompactPartyFrameMember2Buff2", "CompactPartyFrameMember2Buff3", "CompactPartyFrameMember2Debuff1", "CompactPartyFrameMember2Debuff2", "CompactPartyFrameMember2Debuff3", - "CompactPartyFrameMember3Buff1", "CompactPartyFrameMember3Buff2", "CompactPartyFrameMember3Buff3", "CompactPartyFrameMember3Debuff1", "CompactPartyFrameMember3Debuff2", "CompactPartyFrameMember3Debuff3", - "CompactPartyFrameMember4Buff1", "CompactPartyFrameMember4Buff2", "CompactPartyFrameMember4Buff3", "CompactPartyFrameMember4Debuff1", "CompactPartyFrameMember4Debuff2", "CompactPartyFrameMember4Debuff3", - "CompactPartyFrameMember5Buff1", "CompactPartyFrameMember5Buff2", "CompactPartyFrameMember5Buff3", "CompactPartyFrameMember5Debuff1", "CompactPartyFrameMember5Debuff2", "CompactPartyFrameMember5Debuff3", - -- Target and focus frames - "TargetFrame", "TargetFrameToT", - "FocusFrame", "FocusFrameToT", - -- Boss and arena frames - "Boss1TargetFrame", "Boss2TargetFrame", "Boss3TargetFrame", "Boss4TargetFrame", - "ArenaEnemyFrame1", "ArenaEnemyFrame2", "ArenaEnemyFrame3", "ArenaEnemyFrame4", "ArenaEnemyFrame5", -}) do - if _G[v] then ClickCastFrames[_G[v]] = true end + +local binder = CreateFrame("Frame", "SVUI_SpellBinder", SpellBookFrame, "ButtonFrameTemplate") +binder:SetPoint("TOPLEFT", SpellBookFrame, "TOPRIGHT", 100, 0) +binder:SetSize(300, 400) +binder:Hide() + +binder.title = binder:CreateFontString(nil, "OVERLAY", "GameFontNormal") +binder.title:SetPoint("TOP", binder, "TOP", 0, -5) +binder.title:SetText("Click-Cast Bindings") + +binder.sbOpen = false +binder.spellbuttons = {} + +binder.list = CreateFrame("ScrollFrame", "SVUI_SpellBinderSpellList", _G["SVUI_SpellBinderInset"], "UIPanelScrollFrameTemplate") +binder.list.child = CreateFrame("Frame", nil, binder.list) +binder.list:SetPoint("TOPLEFT", _G["SVUI_SpellBinderInset"], "TOPLEFT", 0, -5) +binder.list:SetPoint("BOTTOMRIGHT", _G["SVUI_SpellBinderInset"], "BOTTOMRIGHT", -30, 5) +binder.list:SetScrollChild(binder.list.child) + +binder.roster = {} + +local BoundSpell_OnEnter = function(self) + self.delete:GetNormalTexture():SetVertexColor(1, 0, 0) + self:SetBackdrop({bgFile = "Interface\\Buttons\\WHITE8x8"}) + self:SetBackdropColor(0.2, 0.2, 0.2, 0.7) end -hooksecurefunc("CreateFrame", function(ftype, name, parent, template) if template and template:find("SecureUnitButtonTemplate") then ClickCastFrames[_G[name]] = true end end) -hooksecurefunc("CompactUnitFrame_SetUpFrame", function(frame, ...) ClickCastFrames[frame] = true end) +local BoundSpell_OnLeave = function(self) + self.delete:GetNormalTexture():SetVertexColor(0.8, 0, 0) + self:SetBackdrop(nil) +end -local ScrollSpells = CreateFrame("ScrollFrame", "SpellBinderScrollFrameSpellList", _G["SpellBinderInset"], "UIPanelScrollFrameTemplate") -ScrollSpells.child = CreateFrame("Frame", "SpellBinderScrollFrameSpellListChild", ScrollSpells) -ScrollSpells:SetPoint("TOPLEFT", _G["SpellBinderInset"], "TOPLEFT", 0, -5) -ScrollSpells:SetPoint("BOTTOMRIGHT", _G["SpellBinderInset"], "BOTTOMRIGHT", -30, 5) -ScrollSpells:SetScrollChild(ScrollSpells.child) +local Temp_OnUpdate = function(self) + self:UpdateAll() + if self.updated then + self:UnregisterEvent("PLAYER_REGEN_ENABLED") + end +end + +local SpellBindTab_OnEnter = function(self) + GameTooltip:ClearLines() + GameTooltip:SetOwner(self, "ANCHOR_RIGHT") + GameTooltip:AddLine("Click-Cast Binding") + GameTooltip:Show() +end + +local SpellBindTab_OnLeave = function(self) + GameTooltip:Hide() +end + +local SpellBindTab_OnShow = function(self) + if binder:IsVisible() then self:SetChecked(true) end + local num = GetNumSpellTabs() + local lastTab = _G["SpellBookSkillLineTab"..num] + + self:ClearAllPoints() + self:SetPoint("TOPLEFT", lastTab, "BOTTOMLEFT", 0, -17) + + self:SetScript("OnEnter", SpellBindTab_OnEnter) + self:SetScript("OnLeave", SpellBindTab_OnLeave) +end -SpellBinder.makeSpellsList = function(self, scroll, delete) +local SpellBindTab_OnClick = function(self) + if InCombatLockdown() then binder:Hide() return end + if binder:IsVisible() then + binder:Hide() + binder.sbOpen = false + else + binder:Show() + binder.sbOpen = true + end + binder:ToggleButtons() +end + +local SpellBindClose_OnClick = function(self) + binder:Hide() + binder.sbOpen = false + binder:ToggleButtons() +end + +local _hook_SpellBookFrame_OnUpdate = function(self) + if binder.sbOpen then binder:ToggleButtons() end +end + +local _hook_SpellBookFrame_OnHide = function(self) + binder:Hide() + binder.sbOpen = false + binder:ToggleButtons() +end + +local addSpell = function(self, button) + if binder.sbOpen then + local slot = SpellBook_GetSpellBookSlot(self:GetParent()) + local spellname, subtype = GetSpellBookItemName(slot, SpellBookFrame.bookType) + local texture = GetSpellBookItemTexture(slot, SpellBookFrame.bookType) + + if spellname ~= 0 and ((SpellBookFrame.bookType == BOOKTYPE_PET) or (SpellBookFrame.selectedSkillLine > 1)) then + local originalbutton = button + local modifier = "" + + if IsShiftKeyDown() then modifier = "Shift-"..modifier end + if IsControlKeyDown() then modifier = "Ctrl-"..modifier end + if IsAltKeyDown() then modifier = "Alt-"..modifier end + + if IsHarmfulSpell(slot, SpellBookFrame.bookType) then + button = format("%s%d", "harmbutton", SecureButton_GetButtonSuffix(button)) + originalbutton = "|cffff2222(harm)|r "..originalbutton + else + button = SecureButton_GetButtonSuffix(button) + end + + for i, v in pairs(DB.spells) do if v.spell == spellname then return end end + + tinsert(DB.spells, {["id"] = slot, ["modifier"] = modifier, ["button"] = button, ["spell"] = spellname, ["rank"] = rank, ["texture"] = texture, ["origbutton"] = originalbutton,}) + binder:BuildSpells(false) + end + end +end + +local SpellBind_OnEvent = function(self, event, ...) + if event == "PLAYER_LOGIN" then + DB = SVUI_Cache["Bindings"] or {} + DB.spells = DB.spells or {} + DB.frames = DB.frames or {} + DB.keys = DB.keys or {} + binder:BuildList() + binder:BuildSpells(true) + + for i = 1, SPELLS_PER_PAGE do + local parent = _G["SpellButton"..i] + local button = CreateFrame("Button", "SpellButtonMask"..i, parent) + button:SetID(parent:GetID()) + button:RegisterForClicks("AnyDown") + button:SetAllPoints(parent) + button:SetScript("OnClick", addSpell) + + button.shine = SpellBook_GetAutoCastShine() + button.shine:Show() + button.shine:SetParent(button) + button.shine:SetAllPoints() + AutoCastShine_AutoCastStart(button.shine) + + button:Hide() + binder.spellbuttons[i] = button + end + + self:UnregisterEvent("PLAYER_LOGIN") + elseif event == "PLAYER_ENTERING_WORLD" or event == "GROUP_ROSTER_UPDATE" or event == "ZONE_CHANGED" or event == "ZONE_CHANGED_NEW_AREA" then + binder:UpdateAll() + end +end + +local function binder_BuildSpells(self, delete) local oldb + local scroll = self.list.child scroll:SetPoint("TOPLEFT") scroll:SetSize(270, 300) @@ -98,7 +204,7 @@ SpellBinder.makeSpellsList = function(self, scroll, delete) i = 1 while _G[i.."_cbs"] do _G[i.."_fs"]:SetText("") - _G[i.."_texture"]:SetTexture(nil) + _G[i.."_texture"]:SetTexture(0,0,0,0) _G[i.."_cbs"].checked = false _G[i.."_cbs"]:ClearAllPoints() _G[i.."_cbs"]:Hide() @@ -135,7 +241,7 @@ SpellBinder.makeSpellsList = function(self, scroll, delete) bf.delete:GetNormalTexture():SetVertexColor(0.8, 0, 0) bf.delete:SetPushedTexture("Interface\\BUTTONS\\UI-GroupLoot-Pass-Up") bf.delete:SetHighlightTexture("Interface\\BUTTONS\\UI-GroupLoot-Pass-Up") - bf.delete:SetScript("OnClick", function(self) + bf.delete:SetScript("OnClick", function() for j, k in ipairs(DB.spells) do if k ~= spell then k.checked = false @@ -143,35 +249,33 @@ SpellBinder.makeSpellsList = function(self, scroll, delete) end end spell.checked = not spell.checked - SpellBinder.DeleteSpell() + binder:DeleteSpell() end) - bf:SetScript("OnEnter", function(self) bf.delete:GetNormalTexture():SetVertexColor(1, 0, 0) self:SetBackdrop({bgFile = "Interface\\Buttons\\WHITE8x8"}) self:SetBackdropColor(0.2, 0.2, 0.2, 0.7) end) - bf:SetScript("OnLeave", function(self) bf.delete:GetNormalTexture():SetVertexColor(0.8, 0, 0) self:SetBackdrop(nil) end) + bf:SetScript("OnEnter", BoundSpell_OnEnter) + bf:SetScript("OnLeave", BoundSpell_OnLeave) bf.fs = bf.fs or bf:CreateFontString(i.."_fs", "OVERLAY", "GameFontNormal") bf.fs:SetText(spell.modifier..spell.origbutton) bf.fs:SetPoint("RIGHT", bf.delete, "LEFT", -4, 0) - for frame, j in pairs(ClickCastFrames) do - local f - if frame and type(frame) == "table" then f = frame:GetName() end - if f and DB.frames[frame] then - if _G[f]:CanChangeAttribute() or _G[f]:CanChangeProtectedState() then - if _G[f]:GetAttribute(spell.modifier.."type"..spell.button) ~= "menu" then - _G[f]:RegisterForClicks("AnyDown") + for frame, j in pairs(self.roster) do + if frame and DB.frames[frame] then + if frame:CanChangeAttribute() or frame:CanChangeProtectedState() then + if frame:GetAttribute(spell.modifier.."type"..spell.button) ~= "menu" then + --frame:RegisterForClicks("AnyDown") if spell.button:find("harmbutton") then - _G[f]:SetAttribute(spell.modifier..spell.button, spell.spell) - _G[f]:SetAttribute(spell.modifier.."type-"..spell.spell, "spell") - _G[f]:SetAttribute(spell.modifier.."spell-"..spell.spell, spell.spell) + frame:SetAttribute(spell.modifier..spell.button, spell.spell) + frame:SetAttribute(spell.modifier.."type-"..spell.spell, "spell") + frame:SetAttribute(spell.modifier.."spell-"..spell.spell, spell.spell) DB.keys[spell.modifier..spell.button] = spell.spell DB.keys[spell.modifier.."type-"..spell.spell] = "spell" DB.keys[spell.modifier.."spell-"..spell.spell] = spell.spell else - _G[f]:SetAttribute(spell.modifier.."type"..spell.button, "spell") - _G[f]:SetAttribute(spell.modifier.."spell"..spell.button, spell.spell) + frame:SetAttribute(spell.modifier.."type"..spell.button, "spell") + frame:SetAttribute(spell.modifier.."spell"..spell.button, spell.spell) DB.keys[spell.modifier.."type"..spell.button] = "spell" DB.keys[spell.modifier.."spell"..spell.button] = spell.spell @@ -187,93 +291,49 @@ SpellBinder.makeSpellsList = function(self, scroll, delete) end end -SpellBinder.makeFramesList = function(self) - for frame, value in pairs(ClickCastFrames) do - local v - if frame and type(frame) == "table" then v = frame:GetName() end - if v ~= "SVUI_Target" and v ~= "SVUI_Player" then DB.frames[frame] = DB.frames[frame] or true end +local function binder_BuildList(self) + for frame, value in pairs(self.roster) do + DB.frames[frame] = DB.frames[frame] or true end end -SpellBinder.ToggleButtons = function() +local function binder_ToggleButtons(self) for i = 1, SPELLS_PER_PAGE do - if(SpellBinder.spellbuttons[i]) then - SpellBinder.spellbuttons[i]:Hide() - end - if SpellBinder.sbOpen and SpellBookFrame.bookType ~= BOOKTYPE_PROFESSION then - local slot = SpellBook_GetSpellBookSlot(SpellBinder.spellbuttons[i]:GetParent()) - if slot then - local spellname, subtype = GetSpellBookItemName(slot, SpellBookFrame.bookType) - if spellname then - SpellBinder.spellbuttons[i]:Show() + if(binder.spellbuttons[i]) then + binder.spellbuttons[i]:Hide() + if binder.sbOpen and SpellBookFrame.bookType ~= BOOKTYPE_PROFESSION then + local slot = SpellBook_GetSpellBookSlot(binder.spellbuttons[i]:GetParent()) + if slot then + local spellname, subtype = GetSpellBookItemName(slot, SpellBookFrame.bookType) + if spellname then + binder.spellbuttons[i]:Show() + end end end end end - SpellBinder:makeFramesList() - SpellBinder:makeSpellsList(ScrollSpells.child, true) - if SpellBinder:IsVisible() then SpellBinder.OpenButton:SetChecked(true) else SpellBinder.OpenButton:SetChecked(false) end + binder:BuildList() + binder:BuildSpells(true) + if binder:IsVisible() then binder.tab:SetChecked(true) else binder.tab:SetChecked(false) end end -hooksecurefunc("SpellBookFrame_Update", function() if SpellBinder.sbOpen then SpellBinder:ToggleButtons() end end) - -SpellBinder.OpenButton = CreateFrame("CheckButton", "SpellBinderOpenButton", _G["SpellBookSkillLineTab1"], "SpellBookSkillLineTabTemplate") -SpellBinder.OpenButton:SetNormalTexture("Interface\\ICONS\\Achievement_Guild_Doctorisin") - -SpellBinder.OpenButton:SetScript("OnShow", function(self) - if SpellBinder:IsVisible() then self:SetChecked(true) end - local num = GetNumSpellTabs() - local lastTab = _G["SpellBookSkillLineTab"..num] - - self:ClearAllPoints() - self:SetPoint("TOPLEFT", lastTab, "BOTTOMLEFT", 0, -17) - - self:SetScript("OnEnter", function(self) GameTooltip:ClearLines() GameTooltip:SetOwner(self, "ANCHOR_RIGHT") GameTooltip:AddLine("SpellBinder") GameTooltip:Show() end) - self:SetScript("OnLeave", function() GameTooltip:Hide() end) -end) - -SpellBinder.OpenButton:SetScript("OnClick", function(self) - if InCombatLockdown() then SpellBinder:Hide() return end - if SpellBinder:IsVisible() then - SpellBinder:Hide() - SpellBinder.sbOpen = false - else - SpellBinder:Show() - SpellBinder.sbOpen = true - end - SpellBinder:ToggleButtons() -end) -SpellBinder.OpenButton:Show() - -_G["SpellBinderCloseButton"]:SetScript("OnClick", function(self) - SpellBinder:Hide() - SpellBinder.sbOpen = false - SpellBinder:ToggleButtons() -end) - -hooksecurefunc(SpellBookFrame, "Hide", function() - SpellBinder:Hide() - SpellBinder.sbOpen = false - SpellBinder:ToggleButtons() -end) - -SpellBinder.DeleteSpell = function() +local function binder_DeleteSpell(self) local count = table.getn(DB.spells) for i, spell in ipairs(DB.spells) do if spell.checked then - for frame, j in pairs(ClickCastFrames) do + for frame, j in pairs(self.roster) do local f if frame and type(frame) == "table" then f = frame:GetName() end if f then - if _G[f]:CanChangeAttribute() or _G[f]:CanChangeProtectedState() then - if _G[f]:GetAttribute(spell.modifier.."type"..spell.button) ~= "menu" then + if frame:CanChangeAttribute() or frame:CanChangeProtectedState() then + if frame:GetAttribute(spell.modifier.."type"..spell.button) ~= "menu" then if spell.button:find("harmbutton") then - _G[f]:SetAttribute(spell.modifier..spell.button, nil) - _G[f]:SetAttribute(spell.modifier.."type-"..spell.spell, nil) - _G[f]:SetAttribute(spell.modifier.."spell-"..spell.spell, nil) + frame:SetAttribute(spell.modifier..spell.button, nil) + frame:SetAttribute(spell.modifier.."type-"..spell.spell, nil) + frame:SetAttribute(spell.modifier.."spell-"..spell.spell, nil) else - _G[f]:SetAttribute(spell.modifier.."type"..spell.button, nil) - _G[f]:SetAttribute(spell.modifier.."spell"..spell.button, nil) + frame:SetAttribute(spell.modifier.."type"..spell.button, nil) + frame:SetAttribute(spell.modifier.."spell"..spell.button, nil) end end end @@ -282,114 +342,93 @@ SpellBinder.DeleteSpell = function() tremove(DB.spells, i) end end - SpellBinder:makeSpellsList(ScrollSpells.child, true) -end - -local addSpell = function(self, button) - if SpellBinder.sbOpen then - local slot = SpellBook_GetSpellBookSlot(self:GetParent()) - local spellname, subtype = GetSpellBookItemName(slot, SpellBookFrame.bookType) - local texture = GetSpellBookItemTexture(slot, SpellBookFrame.bookType) - - if spellname ~= 0 and ((SpellBookFrame.bookType == BOOKTYPE_PET) or (SpellBookFrame.selectedSkillLine > 1)) then - local originalbutton = button - local modifier = "" - - if IsShiftKeyDown() then modifier = "Shift-"..modifier end - if IsControlKeyDown() then modifier = "Ctrl-"..modifier end - if IsAltKeyDown() then modifier = "Alt-"..modifier end - - if IsHarmfulSpell(slot, SpellBookFrame.bookType) then - button = format("%s%d", "harmbutton", SecureButton_GetButtonSuffix(button)) - originalbutton = "|cffff2222(harm)|r "..originalbutton - else - button = SecureButton_GetButtonSuffix(button) - end - - for i, v in pairs(DB.spells) do if v.spell == spellname then return end end - - tinsert(DB.spells, {["id"] = slot, ["modifier"] = modifier, ["button"] = button, ["spell"] = spellname, ["rank"] = rank, ["texture"] = texture, ["origbutton"] = originalbutton,}) - SpellBinder:makeSpellsList(ScrollSpells.child, false) - end - end + self:BuildSpells(true) end -SpellBinder.UpdateAll = function() +local function binder_UpdateAll(self) if InCombatLockdown() then - SpellBinder.SheduleUpdate() + self:SheduleUpdate() return end - SpellBinder:makeFramesList() - SpellBinder:makeSpellsList(ScrollSpells.child, true) + self:BuildList() + self:BuildSpells(true) end -SpellBinder.SheduleUpdate = function() - SpellBinder.updated = false +local function binder_SheduleUpdate(self) + self.updated = false if InCombatLockdown() then - SpellBinder:RegisterEvent("PLAYER_REGEN_ENABLED") - SpellBinder:SetScript("OnEvent", function(self) - SpellBinder.UpdateAll() - if SpellBinder.updated then - SpellBinder:UnregisterEvent("PLAYER_REGEN_ENABLED") - end - end) + self:RegisterEvent("PLAYER_REGEN_ENABLED") + self:SetScript("OnEvent", Temp_OnUpdate) else - SpellBinder.UpdateAll() + self:UpdateAll() end end +--[[ +########################################################## +LOADER +########################################################## +]]-- +local function enable(frame) + if type(frame) == "string" then + local frameName = frame + frame = _G[frameName] + end + + if frame then + binder.roster[frame] = true + end +end -SpellBinder:RegisterEvent("GROUP_ROSTER_UPDATE") -SpellBinder:RegisterEvent("PLAYER_ENTERING_WORLD") -SpellBinder:RegisterEvent("PLAYER_LOGIN") -SpellBinder:RegisterEvent("ZONE_CHANGED_NEW_AREA") -SpellBinder:RegisterEvent("ZONE_CHANGED") -SpellBinder:SetScript("OnEvent", function(self, event, ...) - if event == "PLAYER_LOGIN" then - DB = SVUI_Cache["Bindings"] or {} - DB.spells = DB.spells or {} - DB.frames = DB.frames or {} - DB.keys = DB.keys or {} - SpellBinder:makeFramesList() - SpellBinder:makeSpellsList(ScrollSpells.child, true) - - for i = 1, SPELLS_PER_PAGE do - local parent = _G["SpellButton"..i] - local button = CreateFrame("Button", "SpellBinderFakeButton"..i, parent) - button:SetID(parent:GetID()) - button:RegisterForClicks("AnyDown") - button:SetAllPoints(parent) - button:SetScript("OnClick", addSpell) - - button.shine = SpellBook_GetAutoCastShine() - button.shine:Show() - button.shine:SetParent(button) - button.shine:SetAllPoints() - AutoCastShine_AutoCastStart(button.shine) - - button:Hide() - SpellBinder.spellbuttons[i] = button - end +local BindableFrames = SuperVillain.SVUnit.Roster - self:UnregisterEvent("PLAYER_LOGIN") - elseif event == "PLAYER_ENTERING_WORLD" or event == "GROUP_ROSTER_UPDATE" or event == "ZONE_CHANGED" or event == "ZONE_CHANGED_NEW_AREA" then - SpellBinder.UpdateAll() +for i, v in pairs(BindableFrames) do + if _G[v] then binder.roster[_G[v]] = true end +end + +binder.BuildSpells = binder_BuildSpells +binder.BuildList = binder_BuildList +binder.ToggleButtons = binder_ToggleButtons +binder.DeleteSpell = binder_DeleteSpell +binder.UpdateAll = binder_UpdateAll +binder.SheduleUpdate = binder_SheduleUpdate + +_G["SVUI_SpellBinderCloseButton"]:SetScript("OnClick", SpellBindClose_OnClick) +hooksecurefunc("SpellBookFrame_Update", _hook_SpellBookFrame_OnUpdate) +hooksecurefunc(SpellBookFrame, "Hide", _hook_SpellBookFrame_OnHide) + +binder:Formula409() +_G["SVUI_SpellBinderInset"]:Formula409() + +binder:SetPanelTemplate("Action") +binder.Panel:SetPoint("TOPLEFT", -18, 0) +binder.Panel:SetPoint("BOTTOMRIGHT", 0, 0) + +binder.list:Formula409() +binder.list:SetPanelTemplate("Inset") + +binder.tab = CreateFrame("CheckButton", nil, _G["SpellBookSkillLineTab1"], "SpellBookSkillLineTabTemplate") +binder.tab:Formula409() +binder.tab:SetButtonTemplate() +binder.tab:SetNormalTexture("Interface\\ICONS\\Achievement_Guild_Doctorisin") +binder.tab:GetNormalTexture():ClearAllPoints() +binder.tab:GetNormalTexture():SetPoint("TOPLEFT", 2, -2) +binder.tab:GetNormalTexture():SetPoint("BOTTOMRIGHT", -2, 2) +binder.tab:GetNormalTexture():SetTexCoord(0.1, 0.9, 0.1, 0.9) +binder.tab:SetScript("OnShow", SpellBindTab_OnShow) +binder.tab:SetScript("OnClick", SpellBindTab_OnClick) +binder.tab:Show() + +binder:RegisterEvent("GROUP_ROSTER_UPDATE") +binder:RegisterEvent("PLAYER_ENTERING_WORLD") +binder:RegisterEvent("PLAYER_LOGIN") +binder:RegisterEvent("ZONE_CHANGED_NEW_AREA") +binder:RegisterEvent("ZONE_CHANGED") +binder:SetScript("OnEvent", SpellBind_OnEvent) + +local function LoadSpellBinder() + for i, v in pairs(SuperVillain.SVUnit.Roster) do + if _G[v] then binder.roster[_G[v]] = true end end -end) - -SpellBinder:Formula409() -SpellBinderInset:Formula409() - -SpellBinder:SetPanelTemplate("Action") -SpellBinder.Panel:SetPoint("TOPLEFT", -18, 0) -SpellBinder.Panel:SetPoint("BOTTOMRIGHT", 0, 0) - -SpellBinder.OpenButton:Formula409() -SpellBinder.OpenButton:SetButtonTemplate() -SpellBinder.OpenButton:SetNormalTexture("Interface\\ICONS\\Achievement_Guild_Doctorisin") -SpellBinder.OpenButton:GetNormalTexture():ClearAllPoints() -SpellBinder.OpenButton:GetNormalTexture():SetPoint("TOPLEFT", 2, -2) -SpellBinder.OpenButton:GetNormalTexture():SetPoint("BOTTOMRIGHT", -2, 2) -SpellBinder.OpenButton:GetNormalTexture():SetTexCoord(0.1, 0.9, 0.1, 0.9) +end -SpellBinderScrollFrameSpellList:Formula409() -SpellBinderScrollFrameSpellList:SetPanelTemplate("Inset") \ No newline at end of file +SuperVillain.Registry:NewScript(LoadSpellBinder) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/alerts.lua b/Interface/AddOns/SVUI/system/alerts.lua index 0b47714..8af570a 100644 --- a/Interface/AddOns/SVUI/system/alerts.lua +++ b/Interface/AddOns/SVUI/system/alerts.lua @@ -815,7 +815,7 @@ local function SetConfigAlertAnim(f) f.trans[1]:SetOrder(1) f.trans[1]:SetDuration(0.3) f.trans[1]:SetOffset(x,y) - f.trans[1]:SetScript("OnPlay",function()f:SetScale(0.01)f:SetAlpha(1)end) + f.trans[1]:SetScript("OnPlay",function()f:SetScale(0.01)f:Show()end) f.trans[1]:SetScript("OnUpdate",function(self)f:SetScale(0.1+(1*f.trans[1]:GetProgress()))end) f.trans[2] = f.trans:CreateAnimation("Translation") f.trans[2]:SetOrder(2) @@ -825,7 +825,7 @@ local function SetConfigAlertAnim(f) f.trans[3]:SetOrder(3) f.trans[3]:SetDuration(0.1) f.trans[3]:SetOffset(0,0) - f.trans[3]:SetScript("OnStop",function()f:SetAlpha(0)end) + f.trans[3]:SetScript("OnStop",function()f:Hide()end) f.trans:SetScript("OnFinished",f.trans[3]:GetScript("OnStop")) end @@ -878,7 +878,7 @@ function SuperVillain:LoadSystemAlerts() fgtex:SetTexture("Interface\\AddOns\\SVUI\\assets\\artwork\\Template\\SAVED-FG") SetConfigAlertAnim(configAlert.bg, configAlert) SetConfigAlertAnim(configAlert.fg, configAlert) - SuperVillain.Animate:Orbit(configAlert.bg, 10) + SuperVillain.Animate:Orbit(configAlert.bg, 10, false, true) end; for i = 1, 4 do local alert = CreateFrame("Frame", "SVUI_SystemAlert"..i, SuperVillain.UIParent, "StaticPopupTemplate") diff --git a/Interface/AddOns/SVUI/system/cartography.lua b/Interface/AddOns/SVUI/system/cartography.lua index 2d84b02..28a85a9 100644 --- a/Interface/AddOns/SVUI/system/cartography.lua +++ b/Interface/AddOns/SVUI/system/cartography.lua @@ -381,7 +381,7 @@ do local function _findplayer() local x, y = GetPlayerMapPosition("player"); if(x <= 0 and y <= 0) then - if(WorldMap:IsShown()) then return; end + if(WorldMap and WorldMap:IsShown()) then return end SetMapToCurrentZone(); x, y = GetPlayerMapPosition("player"); if(x <= 0 and y <= 0) then diff --git a/Interface/AddOns/SVUI/system/common.lua b/Interface/AddOns/SVUI/system/common.lua new file mode 100644 index 0000000..5521b36 --- /dev/null +++ b/Interface/AddOns/SVUI/system/common.lua @@ -0,0 +1,1344 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local ipairs = _G.ipairs; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local table = _G.table; +local string = _G.string; +local math = _G.math; +--[[ MATH METHODS ]]-- +local floor, abs, min, max = math.floor, math.abs, math.min, math.max; +local parsefloat = math.parsefloat; +--[[ STRING METHODS ]]-- +local lower = string.lower; +--[[ TABLE METHODS ]]-- +local tremove, tcopy, twipe, tsort, tconcat, tdump = table.remove, table.copy, table.wipe, table.sort, table.concat, table.dump; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SuperVillain, L = unpack(select(2, ...)) +--[[ +########################################################## +LOCAL VARS +########################################################## +]]-- +local SizeScaled, HeightScaled, WidthScaled, PointScaled, WrapOuter, FillInner +local TemplateUpdateFrames = {}; +local FontUpdateFrames = {}; +local NewFrame = CreateFrame; +local NewHook = hooksecurefunc; +local STANDARD_TEXT_FONT = _G.STANDARD_TEXT_FONT +local SCREEN_MOD = 1; +local function GetUsableScreen() + local rez = GetCVar("gxResolution") + local height = rez:match("%d+x(%d+)") + local width = rez:match("(%d+)x%d+") + local gxHeight = tonumber(height) + local gxWidth = tonumber(width) + local gxMod = (768 / gxHeight) + return gxWidth, gxHeight, gxMod +end +--[[ +########################################################## +UI SCALING +########################################################## +]]-- +-- function SuperVillain:UIScale(event) +-- return +-- end + +function SuperVillain:UIScale(event) + local scale, evalwidth + local gxWidth, gxHeight, gxMod = GetUsableScreen() + + if(IsMacClient() and SVUI_Cache and SVUI_Cache.screenheight and SVUI_Cache.screenwidth) then + if(gxHeight ~= SVUI_Cache.screenheight or gxWidth ~= SVUI_Cache.screenwidth) then + gxHeight = SVUI_Cache.screenheight; + gxWidth = SVUI_Cache.screenwidth + end + end; + + if self.db.system.autoScale then + scale = max(0.64, min(1.15, gxMod)) + else + scale = max(0.64, min(1.15, GetCVar("uiScale") or UIParent:GetScale() or gxMod)) + end + + SCREEN_MOD = gxMod / scale; + + self.ghettoMonitor = nil + + if gxWidth < 1600 then + self.ghettoMonitor = true; + elseif gxWidth >= 3840 then + local width = gxWidth; + local height = gxHeight; + if(self.db.system.multiMonitor) then + if width >= 9840 then width = 3280; end + if width >= 7680 and width < 9840 then width = 2560; end + if width >= 5760 and width < 7680 then width = 1920; end + if width >= 5040 and width < 5760 then width = 1680; end + if width >= 4800 and width < 5760 and height == 900 then width = 1600; end + if width >= 4320 and width < 4800 then width = 1440; end + if width >= 4080 and width < 4320 then width = 1360; end + if width >= 3840 and width < 4080 then width = 1224; end + if width < 1600 then + self.ghettoMonitor = true; + end + else + if width >= 9840 then width = 9840; end + if width >= 7680 and width < 9840 then width = 7680; end + if width >= 5760 and width < 7680 then width = 5760; end + if width >= 5040 and width < 5760 then width = 5040; end + if width >= 4800 and width < 5040 then width = 4800; end + if width >= 4320 and width < 4800 then width = 4320; end + if width >= 4080 and width < 4320 then width = 4080; end + if width >= 3840 and width < 4080 then width = 3840; end + end + + evalwidth = width; + end + + if(parsefloat(UIParent:GetScale(),5) ~= parsefloat(scale,5) and (event == 'PLAYER_LOGIN')) then + SetCVar("useUiScale",1) + SetCVar("uiScale",scale) + WorldMapFrame.hasTaint = true; + end + + if(event == 'PLAYER_LOGIN' or event == 'UI_SCALE_CHANGED') then + if IsMacClient() then + SVUI_Cache.screenheight = floor(GetScreenHeight() * 100 + .5) / 100 + SVUI_Cache.screenwidth = floor(GetScreenWidth() * 100 + .5) / 100 + end + + if evalwidth then + local width = evalwidth + local height = gxHeight; + if not self.db.system.autoScale or height > 1200 then + height = UIParent:GetHeight(); + local ratio = gxHeight / height; + width = evalwidth / ratio; + end + self.UIParent:SetSize(width, height); + else + self.UIParent:SetSize(UIParent:GetSize()); + end + + self.UIParent:ClearAllPoints() + self.UIParent:SetPoint("CENTER") + + local change = abs((parsefloat(UIParent:GetScale(),5) * 100) - (parsefloat(scale,5) * 100)) + if(event == 'UI_SCALE_CHANGED' and change > 1 and self.db.system.autoScale) then + self:StaticPopup_Show('FAILED_UISCALE') + elseif(event == 'UI_SCALE_CHANGED' and change > 1) then + self:StaticPopup_Show('RL_CLIENT') + end; + + self.UIParent:UnregisterEvent('PLAYER_LOGIN') + end +end +--[[ +########################################################## +APPENDED POSITIONING METHODS +########################################################## +]]-- +do + local PARAMS = {} + + local function scaled(value) + if(not SCREEN_MOD) then + SuperVillain:UIScale() + end + return SCREEN_MOD * floor(value / SCREEN_MOD + .5); + end + + function SizeScaled(self, width, height) + self:SetSize(scaled(width), scaled(height or width)) + end + + function WidthScaled(self, width) + self:SetWidth(scaled(width)) + end + + function HeightScaled(self, height) + self:SetHeight(scaled(height)) + end + + function PointScaled(self, ...) + local n = select('#', ...) + PARAMS = {...} + local arg + for i = 1, n do + arg = PARAMS[i] + if(arg and type(arg) == "number") then + PARAMS[i] = scaled(arg) + end + end + self:SetPoint(unpack(PARAMS)) + end + + function WrapOuter(self, parent, x, y) + x = x or 1 + y = y or x + local nx = scaled(x); + local ny = scaled(y); + parent = parent or self:GetParent() + if self:GetPoint() then + self:ClearAllPoints() + end + self:SetPoint("TOPLEFT", parent, "TOPLEFT", -nx, ny) + self:SetPoint("BOTTOMRIGHT", parent, "BOTTOMRIGHT", nx, -ny) + end + + function FillInner(self, parent, x, y) + x = x or 1 + y = y or x + local nx = scaled(x); + local ny = scaled(y); + parent = parent or self:GetParent() + if self:GetPoint() then + self:ClearAllPoints() + end + self:SetPoint("TOPLEFT", parent, "TOPLEFT", nx, -ny) + self:SetPoint("BOTTOMRIGHT", parent, "BOTTOMRIGHT", -nx, ny) + end +end +--[[ +########################################################## +APPENDED DESTROY METHODS +########################################################## +]]-- +-- MUNG ( Modify - Until - No - Good ) +local MUNGFRAME = NewFrame("Frame", nil) +MUNGFRAME:Hide() + +local function MUNG(self) + if self.UnregisterAllEvents then + self:UnregisterAllEvents() + self:SetParent(MUNGFRAME) + else + self:Hide() + self.Show = SuperVillain.fubar + end +end + +local function Formula409(self, option) + for i = 1, self:GetNumRegions()do + local target = select(i, self:GetRegions()) + if(target and (target:GetObjectType() == "Texture")) then + if(option and (type(option) == "boolean")) then + if target.UnregisterAllEvents then + target:UnregisterAllEvents() + target:SetParent(MUNGFRAME) + else + target.Show = target.Hide + end + target:Hide() + elseif(target:GetDrawLayer() == option) then + target:SetTexture(0,0,0,0) + elseif(option and (type(option) == "string") and (target:GetTexture() ~= option)) then + target:SetTexture(0,0,0,0) + else + target:SetTexture(0,0,0,0) + end + end + end +end +--[[ +########################################################## +APPENDED FONT TEMPLATING METHODS +########################################################## +]]-- +local function SetFontTemplate(self, font, fontSize, fontStyle, fontJustifyH, fontJustifyV, noUpdate) + local STANDARDFONTSIZE = SuperVillain.db.media.fonts.size + font = font or STANDARD_TEXT_FONT + fontSize = fontSize or STANDARDFONTSIZE; + fontJustifyH = fontJustifyH or "CENTER"; + fontJustifyV = fontJustifyV or "MIDDLE"; + self.font = font; + self.fontSize = fontSize; + self.fontStyle = fontStyle; + self.fontJustifyH = fontJustifyH; + self.fontJustifyV = fontJustifyV; + self:SetFont(font, fontSize, fontStyle) + if(fontStyle and fontStyle ~= "NONE") then + self:SetShadowColor(0, 0, 0, 0) + else + self:SetShadowColor(0, 0, 0, 0.2) + end + self:SetShadowOffset(1, -1) + self:SetJustifyH(fontJustifyH) + self:SetJustifyV(fontJustifyV) + self.useCommon = fontSize and (fontSize == STANDARDFONTSIZE); + if(not noUpdate) then + FontUpdateFrames[self] = true + end +end +--[[ +########################################################## +FONT UPDATE CALLBACK +########################################################## +]]-- +local function FontTemplateUpdates() + local STANDARDFONTSIZE = SuperVillain.db.media.fonts.size; + for i=1, #FontUpdateFrames do + local frame = FontUpdateFrames[i] + if frame then + local fontSize = frame.useCommon and STANDARDFONTSIZE or frame.fontSize + frame:SetFont(frame.font, fontSize, frame.fontStyle) + else + FontUpdateFrames[i] = nil + end + end +end + +function SuperVillain:UpdateFontTemplates() + FontTemplateUpdates() +end + +SuperVillain.Registry:SetCallback(FontTemplateUpdates) +--[[ +########################################################## +APPENDED TEMPLATING METHODS +########################################################## +]]-- +local _templates = { + ["Default"] = { + backdrop = { + bgFile = [[Interface\BUTTONS\WHITE8X8]], + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeSize = 1, + insets = + { + left = 0, + right = 0, + top = 0, + bottom = 0, + }, + }, + color = "default", + gradient = "default", + texture = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]], + texupdate = false, + padding = 1, + shadow = false, + noupdate = false, + }, + ["Transparent"] = { + backdrop = { + bgFile = [[Interface\BUTTONS\WHITE8X8]], + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeSize = 1, + insets = + { + left = 0, + right = 0, + top = 0, + bottom = 0, + }, + }, + color = "transparent", + gradient = false, + texture = false, + texupdate = false, + padding = 1, + shadow = false, + noupdate = true, + }, + ["Component"] = { + backdrop = { + bgFile = [[Interface\BUTTONS\WHITE8X8]], + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeSize = 2, + insets = + { + left = 0, + right = 0, + top = 0, + bottom = 0, + }, + }, + color = "default", + gradient = "default", + texture = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]], + texupdate = false, + padding = 1, + shadow = true, + noupdate = false, + }, + ["Button"] = { + backdrop = { + bgFile = [[Interface\AddOns\SVUI\assets\artwork\Template\BUTTON]], + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeSize = 1, + insets = + { + left = 1, + right = 1, + top = 1, + bottom = 1, + }, + }, + color = "default", + gradient = false, + texture = false, + texupdate = false, + padding = 1, + shadow = true, + noupdate = false, + }, + ["FramedTop"] = { + backdrop = { + bgFile = [[Interface\BUTTONS\WHITE8X8]], + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeSize = 1, + insets = + { + left = 0, + right = 0, + top = 0, + bottom = 0, + }, + }, + color = "default", + gradient = "darkest2", + texture = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT2]], + texupdate = true, + padding = 1, + shadow = false, + noupdate = false, + }, + ["FramedBottom"] = { + backdrop = { + bgFile = [[Interface\BUTTONS\WHITE8X8]], + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeSize = 1, + insets = + { + left = 0, + right = 0, + top = 0, + bottom = 0, + }, + }, + color = "default", + gradient = "darkest", + texture = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]], + texupdate = true, + padding = 1, + shadow = false, + noupdate = false, + }, + ["Bar"] = { + backdrop = { + bgFile = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]], + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeSize = 1, + insets = + { + left = 0, + right = 0, + top = 0, + bottom = 0, + }, + }, + color = "transparent", + gradient = false, + texture = false, + texupdate = false, + padding = 1, + shadow = false, + noupdate = true, + }, + ["Slot"] = { + backdrop = { + bgFile = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]], + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeSize = 1, + insets = + { + left = 1, + right = 1, + top = 1, + bottom = 1, + }, + }, + color = "transparent", + gradient = false, + texture = false, + texupdate = false, + padding = 2, + shadow = true, + noupdate = true, + }, + ["Inset"] = { + backdrop = { + bgFile = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]], + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeSize = 2, + insets = + { + left = 0, + right = 0, + top = 0, + bottom = 0, + }, + }, + color = "transparent", + gradient = false, + texture = false, + texupdate = false, + padding = 2, + shadow = false, + noupdate = true, + }, + ["Comic"] = { + backdrop = { + bgFile = [[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC1]], + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeSize = 2, + insets = + { + left = 1, + right = 1, + top = 1, + bottom = 1, + }, + }, + color = "class", + gradient = "class", + texture = [[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC1]], + texupdate = true, + padding = 2, + shadow = false, + noupdate = false, + }, + ["Container"] = { + backdrop = { + bgFile = [[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN3]], + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeSize = 2, + insets = + { + left = 1, + right = 1, + top = 1, + bottom = 1, + }, + }, + color = "special", + gradient = "special", + texture = [[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN3]], + texupdate = true, + padding = 2, + shadow = true, + noupdate = false, + }, + ["Pattern"] = { + backdrop = { + bgFile = [[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN1]], + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeSize = 2, + insets = + { + left = 1, + right = 1, + top = 1, + bottom = 1, + }, + }, + color = "special", + gradient = "special", + texture = [[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN1]], + texupdate = true, + padding = 2, + shadow = true, + noupdate = false, + }, + ["Halftone"] = { + backdrop = { + bgFile = [[Interface\BUTTONS\WHITE8X8]], + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeSize = 2, + insets = + { + left = 1, + right = 1, + top = 1, + bottom = 1, + }, + }, + color = "default", + gradient = "special", + texture = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]], + texupdate = true, + padding = 2, + shadow = true, + noupdate = false, + extended = [[HALFTONE]], + }, + ["Action"] = { + backdrop = { + bgFile = [[Interface\BUTTONS\WHITE8X8]], + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeSize = 2, + insets = + { + left = 1, + right = 1, + top = 1, + bottom = 1, + }, + }, + color = "default", + gradient = "special", + texture = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]], + texupdate = true, + padding = 2, + shadow = true, + noupdate = false, + extended = [[ACTION]], + }, + ["UnitLarge"] = { + backdrop = false, + color = "special", + gradient = false, + texture = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-BG1]], + texupdate = true, + padding = 0, + shadow = false, + noupdate = false, + }, + ["UnitSmall"] = { + backdrop = false, + color = "special", + gradient = false, + texture = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG1]], + texupdate = true, + padding = 0, + shadow = false, + noupdate = false, + } +}; +--[[ +########################################################## +INTERNAL HANDLERS +########################################################## +]]-- +local HookPanelBorderColor = function(self,r,g,b,a) + if self[1]then + self[1]:SetTexture(r,g,b,a) + self[2]:SetTexture(r,g,b,a) + self[3]:SetTexture(r,g,b,a) + self[4]:SetTexture(r,g,b,a) + if self[5]then + self[5]:SetBackdropBorderColor(r,g,b,0.5) + end + end +end + +local HookBackdrop = function(self,...) + self.Panel:SetBackdrop(...) +end + +local HookBackdropColor = function(self,...) + self.Panel:SetBackdropColor(...) +end + +local HookBackdropBorderColor = function(self,...) + self.Panel:SetBackdropBorderColor(...) +end + +local HookVertexColor = function(self,...) + self._skin:SetVertexColor(...) +end + +local HookCustomBackdrop = function(self) + local newBgFile = SuperVillain.Media.bg[self._bdtex] + local bd = { + bgFile = newBgFile, + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = false, + tileSize = 0, + edgeSize = 2, + insets = + { + left = 2, + right = 2, + top = 2, + bottom = 2, + }, + } + self:SetBackdrop(bd) +end +--[[ +########################################################## +TEMPLATE HELPERS +########################################################## +]]-- +local function CreatePanelTemplate(frame, templateName, underlay, noupdate, padding, xOffset, yOffset) + if(not templateName or not _templates[templateName]) then templateName = 'Default' end + local settings = _templates[templateName] + local colorName = settings.color + local gradientName = settings.gradient + local texFile = settings.texture + local hasShadow = settings.shadow + local bd = settings.backdrop + local bypass = noupdate or settings.noupdate + local bgColor = SuperVillain.Media.color[colorName] or {0.18,0.18,0.18,1} + local borderColor = {0,0,0,1} + local initLevel = 0; + + padding = padding or settings.padding or 1 + + xOffset = xOffset or 1 + yOffset = yOffset or 1 + + frame._template = templateName; + frame._color = colorName; + frame._gradient = gradientName; + frame._texture = false; + frame._noupdate = bypass; + + local panel = NewFrame('Frame', nil, frame) + panel:Point('TOPLEFT', frame, 'TOPLEFT', (xOffset * -1), yOffset) + panel:Point('BOTTOMRIGHT', frame, 'BOTTOMRIGHT', xOffset, (yOffset * -1)) + + if(padding > 0 and type(t) == 'table') then + panel[1] = panel:CreateTexture(nil,"BORDER") + panel[1]:SetTexture(0,0,0) + panel[1]:SetPoint("TOPLEFT") + panel[1]:SetPoint("BOTTOMLEFT") + panel[1]:SetWidth(padding) + panel[2] = panel:CreateTexture(nil,"BORDER") + panel[2]:SetTexture(0,0,0) + panel[2]:SetPoint("TOPRIGHT") + panel[2]:SetPoint("BOTTOMRIGHT") + panel[2]:SetWidth(padding) + panel[3] = panel:CreateTexture(nil,"BORDER") + panel[3]:SetTexture(0,0,0) + panel[3]:SetPoint("TOPLEFT") + panel[3]:SetPoint("TOPRIGHT") + panel[3]:SetHeight(padding) + panel[4] = panel:CreateTexture(nil,"BORDER") + panel[4]:SetTexture(0,0,0) + panel[4]:SetPoint("BOTTOMLEFT") + panel[4]:SetPoint("BOTTOMRIGHT") + panel[4]:SetHeight(padding) + end + + if(hasShadow) then + if(underlay) then + panel[5] = NewFrame('Frame', nil, panel) + panel[5]:Point('TOPLEFT', panel, 'TOPLEFT', -3, 3) + panel[5]:Point('BOTTOMRIGHT', panel, 'BOTTOMRIGHT', 3, -3) + else + panel[5] = NewFrame('Frame', nil, frame) + panel[5]:Point('TOPLEFT', frame, 'TOPLEFT', -3, 3) + panel[5]:Point('BOTTOMRIGHT', frame, 'BOTTOMRIGHT', 3, -3) + end + panel[5]:SetBackdrop({ + edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], + edgeSize = 3, + insets = { + left = 0, + right = 0, + top = 0, + bottom = 0 + } + }); + panel[5]:SetBackdropBorderColor(0,0,0,0.5) + local level = panel[5]:GetFrameLevel() - 1 + if(level >= 0) then + panel[5]:SetFrameLevel(level) + else + panel[5]:SetFrameLevel(0) + end + end + + frame.Panel = panel + + if(bd) then + initLevel = 1; + if(underlay) then + frame.Panel:SetBackdrop(bd) + frame.Panel:SetBackdropColor(bgColor[1],bgColor[2],bgColor[3],bgColor[4] or 1) + frame.Panel:SetBackdropBorderColor(0,0,0,1) + else + frame:SetBackdrop(bd) + frame:SetBackdropColor(bgColor[1],bgColor[2],bgColor[3],bgColor[4] or 1) + frame:SetBackdropBorderColor(0,0,0,1) + end + if(templateName ~= 'Transparent') then + NewHook(frame.Panel, "SetBackdropBorderColor", HookPanelBorderColor) + NewHook(frame, "SetBackdropBorderColor", HookBackdropBorderColor) + if(underlay) then + NewHook(frame, "SetBackdrop", HookBackdrop) + NewHook(frame, "SetBackdropColor", HookBackdropColor) + end + frame.BackdropNeedsUpdate = true + if(templateName == 'Pattern' or templateName == 'Comic') then + frame._bdtex = lower(templateName) + frame.UpdateBackdrop = HookCustomBackdrop + end + end + end + + if(texFile) then + local xyOffset = padding + 1; + if(underlay) then + frame._skin = frame.Panel:CreateTexture(nil,"BACKGROUND",nil,initLevel) + frame._skin:Point('TOPLEFT', frame.Panel, 'TOPLEFT', xyOffset, (xyOffset * -1)) + frame._skin:Point('BOTTOMRIGHT', frame.Panel, 'BOTTOMRIGHT', (xyOffset * -1), xyOffset) + else + frame._skin = frame:CreateTexture(nil,"BACKGROUND",nil,initLevel) + frame._skin:Point('TOPLEFT', frame, 'TOPLEFT', xyOffset, (xyOffset * -1)) + frame._skin:Point('BOTTOMRIGHT', frame, 'BOTTOMRIGHT', (xyOffset * -1), xyOffset) + end + + frame._skin:SetTexture(texFile) + if(gradientName and SuperVillain.Media.gradient[gradientName]) then + frame._skin:SetGradient(unpack(SuperVillain.Media.gradient[gradientName])) + else + frame._skin:SetVertexColor(bgColor[1], bgColor[2], bgColor[3], bgColor[4] or 1) + end + frame._skin:SetNonBlocking(true) + + if((not bypass) and settings.texupdate) then + frame._texture = lower(templateName) + frame.TextureNeedsUpdate = true + if(templateName == 'UnitLarge' or templateName == 'UnitSmall') then + frame.UpdateColor = HookVertexColor + frame.NoColorUpdate = true + end + end + + initLevel = 2; + end + + if(settings.extended) then + if(not underlay) then + initLevel = 0 + end + local name = settings.extended + local topLeft = frame.Panel:CreateTexture(nil, "BACKGROUND", nil, initLevel) + topLeft:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\Extended\]] .. name .. [[_TOPLEFT]]) + topLeft:SetPoint("TOPLEFT", frame.Panel, "TOPLEFT", 0, 0) + topLeft:SetPoint("TOPRIGHT", frame.Panel, "TOP", 0, 0) + topLeft:SetPoint("BOTTOMLEFT", frame.Panel, "LEFT", 0, 0) + topLeft:SetVertexColor(0.05, 0.05, 0.05, 0.5) + topLeft:SetNonBlocking(true) + + local topRight = frame.Panel:CreateTexture(nil, "BACKGROUND", nil, initLevel) + topRight:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\Extended\]] .. name .. [[_TOPRIGHT]]) + topRight:SetPoint("TOPRIGHT", frame.Panel, "TOPRIGHT", 0, 0) + topRight:SetPoint("TOPLEFT", frame.Panel, "TOP", 0, 0) + topRight:SetPoint("BOTTOMRIGHT", frame.Panel, "RIGHT", 0, 0) + topRight:SetVertexColor(0.05, 0.05, 0.05, 0.5) + topRight:SetNonBlocking(true) + + local bottomRight = frame.Panel:CreateTexture(nil, "BACKGROUND", nil, initLevel) + bottomRight:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\Extended\]] .. name .. [[_BOTTOMRIGHT]]) + bottomRight:SetPoint("BOTTOMRIGHT", frame.Panel, "BOTTOMRIGHT", 0, 0) + bottomRight:SetPoint("BOTTOMLEFT", frame.Panel, "BOTTOM", 0, 0) + bottomRight:SetPoint("TOPRIGHT", frame.Panel, "RIGHT", 0, 0) + bottomRight:SetVertexColor(0.1, 0.1, 0.1, 0.5) + bottomRight:SetNonBlocking(true) + + local bottomLeft = frame.Panel:CreateTexture(nil, "BACKGROUND", nil, initLevel) + bottomLeft:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\Extended\]] .. name .. [[_BOTTOMLEFT]]) + bottomLeft:SetPoint("BOTTOMLEFT", frame.Panel, "BOTTOMLEFT", 0, 0) + bottomLeft:SetPoint("BOTTOMRIGHT", frame.Panel, "BOTTOM", 0, 0) + bottomLeft:SetPoint("TOPLEFT", frame.Panel, "LEFT", 0, 0) + bottomLeft:SetVertexColor(0.1, 0.1, 0.1, 0.5) + bottomLeft:SetNonBlocking(true) + end + + local level = frame:GetFrameLevel() - 1 + if(level >= 0) then + frame.Panel:SetFrameLevel(level) + else + frame.Panel:SetFrameLevel(0) + end +end + +local function HasCooldown(n) + local cd = n and n.."Cooldown" + return cd and _G[cd] +end + +local function CreateButtonPanel(frame, noChecked, brightChecked) + if(frame.hasPanel) then return end + + if(frame.Left) then + frame.Left:SetAlpha(0) + end + + if(frame.Middle) then + frame.Middle:SetAlpha(0) + end + + if(frame.Right) then + frame.Right:SetAlpha(0) + end + + if(frame.SetNormalTexture) then + frame:SetNormalTexture("") + end + + if(frame.SetDisabledTexture) then + frame:SetDisabledTexture("") + end + + if(frame.SetCheckedTexture) then + frame:SetCheckedTexture("") + end + + if(frame.SetHighlightTexture and not frame.hover) then + local hover = frame:CreateTexture(nil, "OVERLAY") + local color = SuperVillain.Media.color.highlight + hover:SetTexture(color[1], color[2], color[3], 0.5) + hover:FillInner(frame.Panel) + frame.hover = hover; + frame:SetHighlightTexture(hover) + end + + if(frame.SetPushedTexture and not frame.pushed) then + local pushed = frame:CreateTexture(nil, "OVERLAY") + pushed:SetTexture(0.1, 0.8, 0.1, 0.3) + pushed:FillInner(frame.Panel) + frame.pushed = pushed; + frame:SetPushedTexture(pushed) + end + + if(not noChecked and frame.SetCheckedTexture) then + local checked = frame:CreateTexture(nil, "OVERLAY") + if(not brightChecked) then + checked:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) + checked:SetVertexColor(0, 0.5, 0, 0.2) + else + checked:SetTexture(SuperVillain.Media.bar.gloss) + checked:SetVertexColor(0, 1, 0, 1) + end + checked:FillInner(frame.Panel) + frame.checked = checked; + frame:SetCheckedTexture(checked) + end + + local cd = HasCooldown(frame:GetName()) + if cd then + cd:ClearAllPoints() + cd:SetAllPoints() + end + + frame.hasPanel = true +end +--[[ +########################################################## +TEMPLATE API +########################################################## +]]-- +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 + if(overridePadding and type(overridePadding) == "number") then + padding = overridePadding + end + + CreatePanelTemplate(self, templateName, true, noupdate, padding, xOffset, yOffset) + + if(not self._noupdate) then + TemplateUpdateFrames[self] = true + end +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 + + local padding = false + if(overridePadding and type(overridePadding) == "number") then + padding = overridePadding + end + + CreatePanelTemplate(self, templateName, false, noupdate, padding, xOffset, yOffset) + + if(not self._noupdate) then + TemplateUpdateFrames[self] = true + end +end + +local function SetPanelColor(self, ...) + local arg1,arg2,arg3,arg4,arg5,arg6,arg7 = select(1, ...) + if(not self.Panel or not arg1) then return; end + if(self._skin and self._gradient) then + if(type(arg1) == "string") then + if(arg1 == "VERTICAL" or arg1 == "HORIZONTAL") then + self._skin:SetGradient(...) + elseif(SuperVillain.Media.gradient[arg1]) then + if self.BorderPanel then + local d,r,g,b,r2,g2,b2 = unpack(SuperVillain.Media.gradient[arg1]) + --self._skin:SetGradient(d,r,g,b,r2,g2,b2) + self.BorderPanel[1]:SetTexture(r2,g2,b2) + self.BorderPanel[2]:SetTexture(r2,g2,b2) + self.BorderPanel[3]:SetTexture(r2,g2,b2) + self.BorderPanel[4]:SetTexture(r2,g2,b2) + else + self._skin:SetGradient(unpack(SuperVillain.Media.gradient[arg1])) + if(SuperVillain.Media.color[arg1]) then + local t = SuperVillain.Media.color[arg1] + local r,g,b,a = t[1], t[2], t[3], t[4] or 1; + self:SetBackdropColor(r,g,b,a) + end + end + end + end + elseif(type(arg1) == "string" and SuperVillain.Media.color[arg1]) then + local t = SuperVillain.Media.color[arg1] + local r,g,b,a = t[1], t[2], t[3], t[4] or 1; + if self.BorderPanel then + self.BorderPanel[1]:SetTexture(r,g,b) + self.BorderPanel[2]:SetTexture(r,g,b) + self.BorderPanel[3]:SetTexture(r,g,b) + self.BorderPanel[4]:SetTexture(r,g,b) + else + self:SetBackdropColor(r,g,b) + end + elseif(arg1 and type(arg1) == "number") then + self:SetBackdropColor(...) + end +end +--[[ +########################################################## +APPENDED BUTTON TEMPLATING METHODS +########################################################## +]]-- +local function SetButtonTemplate(self, invisible) + if self.styled then return end + + if(invisible) then + CreatePanelTemplate(self, "Transparent", false, true, 1) + self:SetBackdropColor(0,0,0,0) + self:SetBackdropBorderColor(0,0,0,0) + else + CreatePanelTemplate(self, "Button", false, true, 1) + end + + if(self.Left) then + self.Left:SetAlpha(0) + end + + if(self.Middle) then + self.Middle:SetAlpha(0) + end + + if(self.Right) then + self.Right:SetAlpha(0) + end + + if(self.SetNormalTexture) then + self:SetNormalTexture("") + end + + if(self.SetDisabledTexture) then + self:SetDisabledTexture("") + end + + if(self.SetHighlightTexture and not self.hover) then + local hover = self:CreateTexture(nil, "HIGHLIGHT") + local color = SuperVillain.Media.color.highlight + hover:SetTexture(color[1], color[2], color[3], 0.5) + FillInner(hover, self.Panel) + self.hover = hover; + self:SetHighlightTexture(hover) + end + + if(self.SetPushedTexture and not self.pushed) then + local pushed = self:CreateTexture(nil, "OVERLAY") + pushed:SetTexture(0.1, 0.8, 0.1, 0.3) + FillInner(pushed, self.Panel) + self.pushed = pushed; + self:SetPushedTexture(pushed) + end + + if(self.SetCheckedTexture and not self.checked) then + local checked = self:CreateTexture(nil, "OVERLAY") + checked:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) + checked:SetVertexColor(0, 0.5, 0, 0.2) + FillInner(checked, self.Panel) + self.checked = checked; + self:SetCheckedTexture(checked) + end + + self.styled = true +end + +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) + self.styled = true +end + +local function SetCheckboxTemplate(self, underlay, x, y) + if self.styled then return end + if(underlay) then + x = x or -7 + y = y or -7 + end + CreatePanelTemplate(self, "Slot", underlay, true, 1, x, y) + CreateButtonPanel(self, false, true) + + NewHook(self, "SetChecked", function(self,checked) + local r,g,b = 0,0,0 + if(checked == 1) then + r,g,b = self:GetCheckedTexture():GetVertexColor() + end + self:SetBackdropBorderColor(r,g,b) + end) + + self.styled = true +end + +local function SetEditboxTemplate(self, x, y) + if self.styled then return end + + if self.TopLeftTex then MUNG(self.TopLeftTex) end + if self.TopRightTex then MUNG(self.TopRightTex) end + if self.TopTex then MUNG(self.TopTex) end + if self.BottomLeftTex then MUNG(self.BottomLeftTex) end + if self.BottomRightTex then MUNG(self.BottomRightTex) end + if self.BottomTex then MUNG(self.BottomTex) end + if self.LeftTex then MUNG(self.LeftTex) end + if self.RightTex then MUNG(self.RightTex) end + if self.MiddleTex then MUNG(self.MiddleTex) end + + CreatePanelTemplate(self, "Inset", true, true, 1, x, y) + + local globalName = self:GetName(); + if globalName then + if _G[globalName.."Left"] then MUNG(_G[globalName.."Left"]) end + if _G[globalName.."Middle"] then MUNG(_G[globalName.."Middle"]) end + if _G[globalName.."Right"] then MUNG(_G[globalName.."Right"]) end + if _G[globalName.."Mid"] then MUNG(_G[globalName.."Mid"]) end + if globalName:find("Silver") or globalName:find("Copper") then + self.Panel:SetPoint("BOTTOMRIGHT", -12, -2) + end + end + self.styled = true +end + +local function SetFramedButtonTemplate(self, template) + if self.styled then return end + template = template or "FramedBottom" + CreatePanelTemplate(self, template, false, false, 1) + + if(self.Left) then + self.Left:SetAlpha(0) + end + + if(self.Middle) then + self.Middle:SetAlpha(0) + end + + if(self.Right) then + self.Right:SetAlpha(0) + end + + if(self.SetNormalTexture) then + self:SetNormalTexture("") + end + + if(self.SetDisabledTexture) then + self:SetDisabledTexture("") + end + + local border = NewFrame('Frame',nil,self) + border:Point('TOPLEFT', self, 'TOPLEFT', -2, 2) + border:Point('BOTTOMRIGHT', self, 'BOTTOMRIGHT', 2, -2) + local t = SuperVillain.Media.color.default + local r,g,b = t[1], t[2], t[3] + border[1] = border:CreateTexture(nil,"BORDER") + border[1]:SetTexture(r,g,b) + border[1]:SetPoint("TOPLEFT") + border[1]:SetPoint("BOTTOMLEFT") + border[1]:SetWidth(3) + border[2] = border:CreateTexture(nil,"BORDER") + border[2]:SetTexture(r,g,b) + border[2]:SetPoint("TOPRIGHT") + border[2]:SetPoint("BOTTOMRIGHT") + border[2]:SetWidth(3) + border[3] = border:CreateTexture(nil,"BORDER") + border[3]:SetTexture(r,g,b) + border[3]:SetPoint("TOPLEFT") + border[3]:SetPoint("TOPRIGHT") + border[3]:SetHeight(3) + border[4] = border:CreateTexture(nil,"BORDER") + border[4]:SetTexture(r,g,b) + border[4]:SetPoint("BOTTOMLEFT") + border[4]:SetPoint("BOTTOMRIGHT") + border[4]:SetHeight(3) + + border[5] = NewFrame('Frame',nil,border) + border[5]:Point('TOPLEFT',border,'TOPLEFT',-2,2) + border[5]:Point('BOTTOMRIGHT',border,'BOTTOMRIGHT',2,-2) + border[5]:SetBackdrop({ + edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], + edgeSize = 3, + insets = { + left = 2, + right = 2, + top = 2, + bottom = 2 + } + }) + border[5]:SetBackdropBorderColor(0,0,0,0.6) + + if(not self.hover) then + local hover = border:CreateTexture(nil, "HIGHLIGHT") + local color = SuperVillain.Media.color.highlight + hover:SetTexture(color[1], color[2], color[3], 0.5) + hover:SetAllPoints(border) + self.hover = hover; + if(self.SetHighlightTexture) then + self:SetHighlightTexture(hover) + end + end + + self.BorderPanel = border + self.styled = true + TemplateUpdateFrames[self] = true +end +--[[ +########################################################## +TEMPLATE UPDATE CALLBACK +########################################################## +]]-- +local function FrameTemplateUpdates() + for frame in pairs(TemplateUpdateFrames) do + if(frame) then + local p = SuperVillain.Media.color[frame._color]; + if(frame.BackdropNeedsUpdate) then + if(frame.UpdateBackdrop) then + frame:UpdateBackdrop() + end + if(p) then + frame:SetBackdropColor(p[1], p[2], p[3], p[4] or 1) + end + frame:SetBackdropBorderColor(0,0,0,1) + end + if(frame.TextureNeedsUpdate and frame._texture) then + local tex = SuperVillain.Media.bg[frame._texture] + if(tex) then + frame._skin:SetTexture(tex) + end + if(not frame.NoColorUpdate) then + if(frame._gradient and SuperVillain.Media.gradient[frame._gradient]) then + local g = SuperVillain.Media.gradient[frame._gradient] + frame._skin:SetGradient(g[1], g[2], g[3], g[4], g[5], g[6], g[7]) + elseif(p) then + frame._skin:SetVertexColor(p[1], p[2], p[3], p[4] or 1) + end + end + end + end + end +end +SuperVillain.Registry:SetCallback(FrameTemplateUpdates) +--[[ +########################################################## +ENUMERATION +########################################################## +]]-- +local function AppendMethods(OBJECT) + local META = getmetatable(OBJECT).__index + if not OBJECT.Size then META.Size = SizeScaled end + if not OBJECT.Width then META.Width = WidthScaled end + if not OBJECT.Height then META.Height = HeightScaled end + if not OBJECT.Point then META.Point = PointScaled end + if not OBJECT.WrapOuter then META.WrapOuter = WrapOuter end + 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.SetPanelTemplate then META.SetPanelTemplate = SetPanelTemplate end + if not OBJECT.SetFixedPanelTemplate then META.SetFixedPanelTemplate = SetFixedPanelTemplate end + if not OBJECT.SetPanelColor then META.SetPanelColor = SetPanelColor end + if not OBJECT.SetButtonTemplate then META.SetButtonTemplate = SetButtonTemplate end + if not OBJECT.SetSlotTemplate then META.SetSlotTemplate = SetSlotTemplate end + if not OBJECT.SetCheckboxTemplate then META.SetCheckboxTemplate = SetCheckboxTemplate end + if not OBJECT.SetEditboxTemplate then META.SetEditboxTemplate = SetEditboxTemplate end + if not OBJECT.SetFramedButtonTemplate then META.SetFramedButtonTemplate = SetFramedButtonTemplate end + if not OBJECT.SetFontTemplate then META.SetFontTemplate = SetFontTemplate end +end + +local HANDLER, OBJECT = {["Frame"] = true}, NewFrame("Frame") +AppendMethods(OBJECT) +AppendMethods(OBJECT:CreateTexture()) +AppendMethods(OBJECT:CreateFontString()) + +OBJECT = EnumerateFrames() +while OBJECT do + local objType = OBJECT:GetObjectType() + if not HANDLER[objType] then + AppendMethods(OBJECT) + HANDLER[objType] = true + end + OBJECT = EnumerateFrames(OBJECT) +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/database.lua b/Interface/AddOns/SVUI/system/database.lua index 5720620..a9c2124 100644 --- a/Interface/AddOns/SVUI/system/database.lua +++ b/Interface/AddOns/SVUI/system/database.lua @@ -26,37 +26,19 @@ local type = _G.type; local error = _G.error; local rawset = _G.rawset; local rawget = _G.rawget; -local string = _G.string; -local math = _G.math; -local bit = _G.bit; local table = _G.table; ---[[ STRING METHODS ]]-- -local lower, upper = string.lower, string.upper; -local find, format, len, split = string.find, string.format, string.len, string.split; -local match, sub, join = string.match, string.sub, string.join; -local gmatch, gsub = string.gmatch, string.gsub; ---[[ MATH METHODS ]]-- -local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; -- Basic -local fmod, modf, sqrt = math.fmod, math.modf, math.sqrt; -- Algebra -local atan2, cos, deg, rad, sin = math.atan2, math.cos, math.deg, math.rad, math.sin; -- Trigonometry -local parsefloat, huge, random = math.parsefloat, math.huge, math.random; -- Uncommon -local max = math.max; ---[[ BINARY METHODS ]]-- -local band, bor = bit.band, bit.bor; --[[ TABLE METHODS ]]-- local tremove, tcopy, twipe, tsort, tconcat, tdump = table.remove, table.copy, table.wipe, table.sort, table.concat, table.dump; ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = enforce; --[[ ########################################################## GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L, G = unpack(select(2, ...)); +local SuperVillain, L, G, CONFIGS = unpack(select(2, ...)); SuperVillain.Shared = LibStub("LibSharedMedia-3.0") local realm = GetRealmName() local name = UnitName("player") -local pkey = name .. " - " .. realm +local pkey = ("%s - %s"):format(name, realm) local logoutListener = CreateFrame("Frame", nil) --[[ ########################################################## @@ -177,6 +159,7 @@ do ["red"] = {"VERTICAL", 0.5, 0, 0, 0.9, 0.08, 0.08}, ["yellow"] = {"VERTICAL", 1, 0.3, 0, 1, 1, 0}, ["inverse"] = {"VERTICAL", 0.25, 0.25, 0.25, 0.12, 0.12, 0.12}, + ["icon"] = {"VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1} } end --[[ @@ -197,3129 +180,110 @@ end DB PROFILE ########################################################## ]]-- -local rez = GetCVar("gxResolution"); -local gxWidth = tonumber(match(rez,"(%d+)x%d+")); -local bw = gxWidth * 0.5 -local statBarWidth = max(bw, 600) - -local DefaultSettings = { - ["copyKey"] = pkey, - ["profileKey"] = pkey, - ["framelocations"] = {}, - ["system"] = { - ["cooldown"] = true, - ["autoScale"] = true, - ["multiMonitor"] = false, - ["taintLog"] = false, - ["stickyFrames"] = true, - ["loginmessage"] = true, - ["hideErrorFrame"] = true, - ["threatbar"] = false, - ["bubbles"] = true, - ["comix"] = true, - ["questWatch"] = true, - ["woot"] = true, - ["pvpinterrupt"] = true, - ["lookwhaticando"] = false, - ["sharingiscaring"] = false, - ["arenadrink"] = true, - ["stupidhat"] = true, - ["totems"] = { - ["enable"] = true, - ["showBy"] = "VERTICAL", - ["sortDirection"] = "ASCENDING", - ["size"] = 40, - ["spacing"] = 4 - }, - }, - ["media"] = { - ["fonts"] = { - ["default"] = "SVUI System Font", - ["name"] = "SVUI Name Font", - ["number"] = "SVUI Number Font", - ["combat"] = "SVUI Combat Font", - ["giant"] = "SVUI Action Font", - ["size"] = 10, - ["unicodeSize"] = 12, - }, - ["textures"] = { - ["pattern"] = "SVUI Backdrop 1", - ["comic"] = "SVUI Comic 1", - ["unitlarge"] = "SVUI Unit BG 3", - ["unitsmall"] = "SVUI Small BG 3" - }, - ["colors"] = { - ["default"] = {0.2, 0.2, 0.2, 1}, - ["special"] = {0.37, 0.32, 0.29, 1}, - }, - ["unitframes"] = { - ["health"] = {0.3, 0.5, 0.3}, - ["power"] = { - ["MANA"] = {0.41, 0.85, 1}, - ["RAGE"] = {1, 0.31, 0.31}, - ["FOCUS"] = {1, 0.63, 0.27}, - ["ENERGY"] = {0.85, 0.83, 0.25}, - ["RUNES"] = {0.55, 0.57, 0.61}, - ["RUNIC_POWER"] = {0, 0.82, 1}, - ["FUEL"] = {0, 0.75, 0.75} - }, - ["reaction"] = { - [1] = {0.92, 0.15, 0.15}, - [2] = {0.92, 0.15, 0.15}, - [3] = {0.92, 0.15, 0.15}, - [4] = {0.85, 0.85, 0.13}, - [5] = {0.19, 0.85, 0.13}, - [6] = {0.19, 0.85, 0.13}, - [7] = {0.19, 0.85, 0.13}, - [8] = {0.19, 0.85, 0.13}, - }, - ["tapped"] = {0.55, 0.57, 0.61}, - ["disconnected"] = {0.84, 0.75, 0.65}, - ["casting"] = {0.8, 0.8, 0}, - ["spark"] = {1, 0.72, 0}, - ["interrupt"] = {0.78, 0.25, 0.25}, - ["shield_bars"] = {0.56, 0.4, 0.62}, - ["buff_bars"] = {0.31, 0.31, 0.31}, - ["debuff_bars"] = {0.8, 0.1, 0.1}, - ["predict"] = { - ["personal"] = {0, 1, 0.5, 0.25}, - ["others"] = {0, 1, 0, 0.25}, - ["absorbs"] = {1, 1, 0, 0.25} - }, - ["spellcolor"] = { - [SpellName(2825)] = {0.98, 0.57, 0.11}, --Bloodlust - [SpellName(32182)] = {0.98, 0.57, 0.11}, --Heroism - [SpellName(80353)] = {0.98, 0.57, 0.11}, --Time Warp - [SpellName(90355)] = {0.98, 0.57, 0.11}, --Ancient Hysteria - [SpellName(84963)] = {0.98, 0.57, 0.11}, --Inquisition - [SpellName(86659)] = {0.98, 0.57, 0.11}, --Guardian of Ancient Kings - } - } - }, - ["SVAura"] = { - ["enable"] = true, - ["disableBlizzard"] = true, - ["font"] = "SVUI Number Font", - ["fontSize"] = 12, - ["fontOutline"] = "THINOUTLINE", - ["countOffsetV"] = 0, - ["countOffsetH"] = 0, - ["timeOffsetV"] = -4, - ["timeOffsetH"] = 0, - ["hyperBuffs"] = { - ["enable"] = true, - ["filter"] = true, - }, - ["fadeBy"] = 5, - ["buffs"] = { - ["showBy"] = "LEFT_DOWN", - ["wrapAfter"] = 12, - ["maxWraps"] = 3, - ["wrapXOffset"] = 6, - ["wrapYOffset"] = 16, - ["sortMethod"] = "TIME", - ["sortDir"] = "-", - ["isolate"] = 1, - ["size"] = 32, - }, - ["debuffs"] = { - ["showBy"] = "LEFT_DOWN", - ["wrapAfter"] = 12, - ["maxWraps"] = 1, - ["wrapXOffset"] = 6, - ["wrapYOffset"] = 16, - ["sortMethod"] = "TIME", - ["sortDir"] = "-", - ["isolate"] = 1, - ["size"] = 32, - }, - }, - ["SVBag"] = { - ["enable"] = true, - ["sortInverted"] = false, - ["bags"] = { - ["xOffset"] = 0, - ["yOffset"] = 0, - ["point"] = "BOTTOMRIGHT", - }, - ["bank"] = { - ["xOffset"] = 0, - ["yOffset"] = 0, - ["point"] = "BOTTOMLEFT", - }, - ["bagSize"] = 34, - ["bankSize"] = 34, - ["alignToChat"] = false, - ["bagWidth"] = 450, - ["bankWidth"] = 450, - ["currencyFormat"] = "ICON", - ["ignoreItems"] = "", - ["bagTools"] = true, - ["bagBar"] = { - ["enable"] = false, - ["showBy"] = "VERTICAL", - ["sortDirection"] = "ASCENDING", - ["size"] = 30, - ["spacing"] = 4, - ["showBackdrop"] = false, - ["mouseover"] = false, - }, - }, - ["SVBar"] = { - ["enable"] = true, - ["font"] = "Roboto", - ["fontSize"] = 11, - ["fontOutline"] = "OUTLINE", - ["countFont"] = "SVUI Number Font", - ["countFontSize"] = 11, - ["countFontOutline"] = "OUTLINE", - ["cooldownSize"] = 18, - ["rightClickSelf"] = false, - ["macrotext"] = false, - ["hotkeytext"] = false, - ["hotkeyAbbrev"] = true, - ["showGrid"] = true, - ["unc"] = {0.8, 0.1, 0.1, 0.7}, - ["unpc"] = {0.5, 0.5, 1, 0.7}, - ["keyDown"] = false, - ["unlock"] = "SHIFT", - ["Micro"] = { - ["enable"] = true, - ["mouseover"] = true, - ["alpha"] = 1, - ["buttonsize"] = 30, - ["buttonspacing"] = 4, - ["yOffset"] = 4 - }, - ["Bar1"] = { - ["enable"] = true, - ["buttons"] = 12, - ["mouseover"] = false, - ["buttonsPerRow"] = 12, - ["point"] = "BOTTOMLEFT", - ["backdrop"] = false, - ["buttonsize"] = 32, - ["buttonspacing"] = 2, - ["useCustomPaging"] = true, - ["useCustomVisibility"] = false, - ["customVisibility"] = "[petbattle] hide; show", - ["customPaging"] = { - ["HUNTER"] = "", - ["WARLOCK"] = "[form:2] 10;", - ["PRIEST"] = "[bonusbar:1] 7;", - ["PALADIN"] = "", - ["MAGE"] = "", - ["ROGUE"] = "[stance:1] 7; [stance:2] 7; [stance:3] 7; [bonusbar:1] 7; [form:3] 7;", - ["DRUID"] = "[bonusbar:1, nostealth] 7; [bonusbar:1, stealth] 8; [bonusbar:2] 8; [bonusbar:3] 9; [bonusbar:4] 10;", - ["SHAMAN"] = "", - ["WARRIOR"] = "", - ["DEATHKNIGHT"] = "", - ["MONK"] = "[bonusbar:1] 7; [bonusbar:2] 8; [bonusbar:3] 9;", - }, - ["alpha"] = 1 - }, - ["Bar2"] = { - ["enable"] = false, - ["mouseover"] = false, - ["buttons"] = 12, - ["buttonsPerRow"] = 12, - ["point"] = "BOTTOMLEFT", - ["backdrop"] = false, - ["buttonsize"] = 32, - ["buttonspacing"] = 2, - ["useCustomPaging"] = false, - ["useCustomVisibility"] = false, - ["customVisibility"] = "[vehicleui] hide; [overridebar] hide; [petbattle] hide; show", - ["customPaging"] = { - ["HUNTER"] = "", - ["WARLOCK"] = "", - ["PRIEST"] = "", - ["PALADIN"] = "", - ["MAGE"] = "", - ["ROGUE"] = "", - ["DRUID"] = "", - ["SHAMAN"] = "", - ["WARRIOR"] = "", - ["DEATHKNIGHT"] = "", - ["MONK"] = "", - }, - ["alpha"] = 1 - }, - ["Bar3"] = { - ["enable"] = true, - ["mouseover"] = false, - ["buttons"] = 6, - ["buttonsPerRow"] = 6, - ["point"] = "BOTTOMLEFT", - ["backdrop"] = false, - ["buttonsize"] = 32, - ["buttonspacing"] = 2, - ["useCustomPaging"] = false, - ["useCustomVisibility"] = false, - ["customVisibility"] = "[vehicleui] hide; [overridebar] hide; [petbattle] hide; show", - ["customPaging"] = { - ["HUNTER"] = "", - ["WARLOCK"] = "", - ["PRIEST"] = "", - ["PALADIN"] = "", - ["MAGE"] = "", - ["ROGUE"] = "", - ["DRUID"] = "", - ["SHAMAN"] = "", - ["WARRIOR"] = "", - ["DEATHKNIGHT"] = "", - ["MONK"] = "", - }, - ["alpha"] = 1 - }, - ["Bar4"] = { - ["enable"] = true, - ["mouseover"] = true, - ["buttons"] = 12, - ["buttonsPerRow"] = 1, - ["point"] = "TOPRIGHT", - ["backdrop"] = false, - ["buttonsize"] = 32, - ["buttonspacing"] = 2, - ["useCustomPaging"] = false, - ["useCustomVisibility"] = false, - ["customVisibility"] = "[vehicleui] hide; [overridebar] hide; [petbattle] hide; show", - ["customPaging"] = { - ["HUNTER"] = "", - ["WARLOCK"] = "", - ["PRIEST"] = "", - ["PALADIN"] = "", - ["MAGE"] = "", - ["ROGUE"] = "", - ["DRUID"] = "", - ["SHAMAN"] = "", - ["WARRIOR"] = "", - ["DEATHKNIGHT"] = "", - ["MONK"] = "", - }, - ["alpha"] = 1 - }, - ["Bar5"] = { - ["enable"] = true, - ["mouseover"] = false, - ["buttons"] = 6, - ["buttonsPerRow"] = 6, - ["point"] = "BOTTOMLEFT", - ["backdrop"] = false, - ["buttonsize"] = 32, - ["buttonspacing"] = 2, - ["useCustomPaging"] = false, - ["useCustomVisibility"] = false, - ["customVisibility"] = "[vehicleui] hide; [overridebar] hide; [petbattle] hide; show", - ["customPaging"] = { - ["HUNTER"] = "", - ["WARLOCK"] = "", - ["PRIEST"] = "", - ["PALADIN"] = "", - ["MAGE"] = "", - ["ROGUE"] = "", - ["DRUID"] = "", - ["SHAMAN"] = "", - ["WARRIOR"] = "", - ["DEATHKNIGHT"] = "", - ["MONK"] = "", - }, - ["alpha"] = 1 - }, - ["Bar6"] = { - ["enable"] = false, - ["mouseover"] = false, - ["buttons"] = 12, - ["buttonsPerRow"] = 12, - ["point"] = "BOTTOMLEFT", - ["backdrop"] = false, - ["buttonsize"] = 32, - ["buttonspacing"] = 2, - ["useCustomPaging"] = false, - ["useCustomVisibility"] = false, - ["customVisibility"] = "[vehicleui] hide; [overridebar] hide; [petbattle] hide; show", - ["customPaging"] = { - ["HUNTER"] = "", - ["WARLOCK"] = "", - ["PRIEST"] = "", - ["PALADIN"] = "", - ["MAGE"] = "", - ["ROGUE"] = "", - ["DRUID"] = "", - ["SHAMAN"] = "", - ["WARRIOR"] = "", - ["DEATHKNIGHT"] = "", - ["MONK"] = "", - }, - ["alpha"] = 1 - }, - ["Pet"] = { - ["enable"] = true, - ["mouseover"] = false, - ["buttons"] = NUM_PET_ACTION_SLOTS, - ["buttonsPerRow"] = NUM_PET_ACTION_SLOTS, - ["point"] = "TOPLEFT", - ["backdrop"] = false, - ["buttonsize"] = 24, - ["buttonspacing"] = 3, - ["useCustomVisibility"] = false, - ["customVisibility"] = "[petbattle] hide; [pet, novehicleui, nooverridebar, nopossessbar] show; hide", - ["alpha"] = 1 - }, - ["Stance"] = { - ["enable"] = true, - ["style"] = "darkenInactive", - ["mouseover"] = false, - ["buttons"] = NUM_STANCE_SLOTS, - ["buttonsPerRow"] = NUM_STANCE_SLOTS, - ["point"] = "BOTTOMRIGHT", - ["backdrop"] = false, - ["buttonsize"] = 24, - ["buttonspacing"] = 5, - ["useCustomVisibility"] = false, - ["customVisibility"] = "[petbattle] hide; show", - ["alpha"] = 1 - }, - }, - ["SVChat"] = { - ["enable"] = true, - ["tabHeight"] = 20, - ["tabWidth"] = 75, - ["tabStyled"] = true, - ["font"] = "Roboto", - ["fontOutline"] = "OUTLINE", - ["tabFont"] = "SVUI Alert Font", - ["tabFontSize"] = 10, - ["tabFontOutline"] = "OUTLINE", - ["url"] = true, - ["shortChannels"] = true, - ["hyperlinkHover"] = true, - ["throttleInterval"] = 45, - ["fade"] = false, - ["sticky"] = true, - ["smileys"] = true, - ["secretWordTone"] = "None", - ["psst"] = "Whisper Alert", - ["noWipe"] = false, - ["timeStampFormat"] = "NONE", - ["secretWords"] = "%MYNAME%, SVUI", - ["basicTools"] = true, - ["saveChats"] = false, - }, - ["SVDock"] = { - ["enable"] = true, - ["dockLeftWidth"] = 412, - ["dockLeftHeight"] = 224, - ["dockRightWidth"] = 412, - ["dockRightHeight"] = 224, - ["dockStatWidth"] = statBarWidth, - ["buttonSize"] = 30, - ["buttonSpacing"] = 4, - ["leftDockBackdrop"] = true, - ["rightDockBackdrop"] = true, - ["topPanel"] = true, - ["bottomPanel"] = true, - ["docklets"] = { - ["DockletMain"] = "None", - ["MainWindow"] = "None", - ["DockletExtra"] = "None", - ["ExtraWindow"] = "None", - ["enableExtra"] = false, - ["DockletCombatFade"] = true - }, - }, - ["SVGear"] = { - ["enable"] = true, - ["specialization"] = { - ["enable"] = false, - }, - ["battleground"] = { - ["enable"] = false, - }, - ["primary"] = "none", - ["secondary"] = "none", - ["equipmentset"] = "none", - ["durability"] = { - ["enable"] = true, - ["onlydamaged"] = true, - }, - ["itemlevel"] = { - ["enable"] = true, - }, - ["misc"] = { - setoverlay = true, - } - }, - ["SVHenchmen"] = { - ["enable"] = true, - ["answeringServiceEnable"] = false, - ["autoRoll"] = false, - ["autoRepair"] = "PLAYER", - ["vendorGrays"] = true, - ["autoAcceptInvite"] = false, - ["autorepchange"] = false, - ["pvpautorelease"] = false, - ["autoquestcomplete"] = false, - ["autoquestreward"] = false, - ["autoquestaccept"] = false, - ["autodailyquests"] = false, - ["autopvpquests"] = false, - ["skipcinematics"] = false, - ["mailOpener"] = true, - ["answeringService"] = { - ["autoAnswer"] = false, - ["prefix"] = true - } - }, - ["SVLaborer"] = { - ["enable"] = true, - ["fontSize"] = 12, - ["farming"] = { - ["buttonsize"] = 35, - ["buttonspacing"] = 3, - ["onlyactive"] = false, - ["droptools"] = true, - ["toolbardirection"] = "HORIZONTAL", - }, - ["fishing"] = { - ["autoequip"] = true, - }, - ["cooking"] = { - ["autoequip"] = true, - }, - }, - ["SVMap"] = { - ["enable"] = true, - ["mapAlpha"] = 1, - ["tinyWorldMap"] = true, - ["size"] = 240, - ["customshape"] = true, - ["locationText"] = "CUSTOM", - ["playercoords"] = "CUSTOM", - ["bordersize"] = 6, - ["bordercolor"] = "light", - ["minimapbar"] = { - ["enable"] = true, - ["styleType"] = "HORIZONTAL", - ["layoutDirection"] = "NORMAL", - ["buttonSize"] = 28, - ["mouseover"] = false, - }, - }, - ["SVOverride"] = { +CONFIGS["copyKey"] = pkey +CONFIGS["profileKey"] = pkey +CONFIGS["framelocations"] = {} +CONFIGS["system"] = { + ["cooldown"] = true, + ["autoScale"] = true, + ["multiMonitor"] = false, + ["taintLog"] = false, + ["stickyFrames"] = true, + ["loginmessage"] = true, + ["hideErrorFrame"] = true, + ["threatbar"] = false, + ["bubbles"] = true, + ["comix"] = true, + ["bigComix"] = true, + ["questWatch"] = true, + ["woot"] = true, + ["pvpinterrupt"] = true, + ["lookwhaticando"] = false, + ["sharingiscaring"] = false, + ["arenadrink"] = true, + ["stupidhat"] = true, + ["totems"] = { ["enable"] = true, - ["loot"] = true, - ["lootRoll"] = true, - ["lootRollWidth"] = 328, - ["lootRollHeight"] = 28, + ["showBy"] = "VERTICAL", + ["sortDirection"] = "ASCENDING", + ["size"] = 40, + ["spacing"] = 4 }, - ["SVPlate"] = { - ["enable"] = true, - ["filter"] = {}, - ["font"] = "SVUI Name Font", - ["fontSize"] = 10, - ["fontOutline"] = "OUTLINE", - ["comboPoints"] = true, - ["nonTargetAlpha"] = 0.6, - ["combatHide"] = false, - ["colorNameByValue"] = true, - ["showthreat"] = true, - ["targetcount"] = true, - ["pointer"] = { - ["enable"] = true, - ["colorMatchHealthBar"] = true, - ["color"] = {0.9, 1, 0.9}, - }, - ["healthBar"] = { - ["lowThreshold"] = 0.4, - ["width"] = 108, - ["height"] = 9, - ["text"] = { - ["enable"] = false, - ["format"] = "CURRENT", - ["xOffset"] = 0, - ["yOffset"] = 0, - ["attachTo"] = "CENTER", - }, - }, - ["castBar"] = { - ["height"] = 6, - ["color"] = {1, 0.81, 0}, - ["noInterrupt"] = {0.78, 0.25, 0.25}, - }, - ["raidHealIcon"] = { - ["xOffset"] = -4, - ["yOffset"] = 6, - ["size"] = 36, - ["attachTo"] = "LEFT", - }, - ["threat"] = { - ["enable"] = false, - ["goodScale"] = 1, - ["badScale"] = 1, - ["goodColor"] = {0.29, 0.68, 0.3}, - ["badColor"] = {0.78, 0.25, 0.25}, - ["goodTransitionColor"] = {0.85, 0.77, 0.36}, - ["badTransitionColor"] = {0.94, 0.6, 0.06}, - }, - ["auras"] = { - ["font"] = "SVUI Number Font", - ["fontSize"] = 7, - ["fontOutline"] = "OUTLINE", - ["numAuras"] = 5, - ["additionalFilter"] = "CC" - }, - ["reactions"] = { - ["tapped"] = {0.6, 0.6, 0.6}, - ["friendlyNPC"] = { 0.31, 0.45, 0.63}, - ["friendlyPlayer"] = {0.29, 0.68, 0.3}, - ["neutral"] = {0.85, 0.77, 0.36}, - ["enemy"] = {0.78, 0.25, 0.25}, - }, +} +CONFIGS["media"] = { + ["fonts"] = { + ["default"] = "SVUI System Font", + ["name"] = "SVUI Name Font", + ["number"] = "SVUI Number Font", + ["combat"] = "SVUI Combat Font", + ["giant"] = "SVUI Action Font", + ["size"] = 10, + ["unicodeSize"] = 12, }, - ["SVStats"] = { - ["enable"] = true, - ["font"] = "SVUI Number Font", - ["fontSize"] = 12, - ["fontOutline"] = "OUTLINE", - ["showBackground"] = true, - ["shortGold"] = true, - ["panels"] = { - ["BottomRightDataPanel"] = { - ["right"] = "Bags", - ["left"] = "Friends", - ["middle"] = "Guild", - }, - ["BottomLeftDataPanel"] = { - ["left"] = "Time", - ["middle"] = "System", - ["right"] = "Gold", - }, - ["TopLeftDataPanel"] = { - ["left"] = "Durability Bar", - ["middle"] = "Reputation Bar", - ["right"] = "Experience Bar", - }, - }, - ["localtime"] = true, - ["time24"] = false, - ["battleground"] = true, - ["topLeftDockPanel"] = true, - ["bottomLeftDockPanel"] = true, - ["bottomRightDockPanel"] = true, - ["panelTransparency"] = false, + ["textures"] = { + ["pattern"] = "SVUI Backdrop 1", + ["comic"] = "SVUI Comic 1", + ["unitlarge"] = "SVUI Unit BG 3", + ["unitsmall"] = "SVUI Small BG 3" }, - ["SVTip"] = { - ["enable"] = true, - ["cursorAnchor"] = false, - ["targetInfo"] = true, - ["playerTitles"] = true, - ["guildRanks"] = true, - ["inspectInfo"] = false, - ["itemCount"] = true, - ["spellID"] = false, - ["progressInfo"] = true, - ["visibility"] = { - ["unitFrames"] = "NONE", - ["combat"] = false, - }, - ["healthBar"] = { - ["text"] = true, - ["height"] = 10, - ["font"] = "Roboto", - ["fontSize"] = 10, - }, + ["colors"] = { + ["default"] = {0.2, 0.2, 0.2, 1}, + ["special"] = {0.37, 0.32, 0.29, 1}, }, - ["SVUnit"] = { - ["enable"] = true, - ["disableBlizzard"] = true, - - ["smoothbars"] = false, - ["statusbar"] = "SVUI BasicBar", - ["auraBarStatusbar"] = "SVUI GlowBar", - - ["font"] = "SVUI Number Font", - ["fontSize"] = 12, - ["fontOutline"] = "OUTLINE", - - ["auraFont"] = "SVUI Alert Font", - ["auraFontSize"] = 12, - ["auraFontOutline"] = "OUTLINE", - - ["OORAlpha"] = 0.65, - ["combatFadeRoles"] = true, - ["combatFadeNames"] = true, - ["debuffHighlighting"] = true, - ["smartRaidFilter"] = true, - ["fastClickTarget"] = false, - ["healglow"] = true, - ["glowtime"] = 0.8, - ["glowcolor"] = {1, 1, 0}, - ["autoRoleSet"] = false, - ["healthclass"] = true, - ["forceHealthColor"] = false, - ["overlayAnimation"] = true, - ["powerclass"] = false, - ["colorhealthbyvalue"] = true, - ["customhealthbackdrop"] = true, - ["classbackdrop"] = false, - ["auraBarByType"] = true, - ["auraBarShield"] = true, - ["castClassColor"] = false, - ["xrayFocus"] = true, - ["player"] = { - ["enable"] = true, - ["width"] = 215, - ["height"] = 60, - ["lowmana"] = 30, - ["combatfade"] = false, - ["predict"] = false, - ["threatEnabled"] = true, - ["playerExpBar"] = false, - ["playerRepBar"] = false, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "current", - ["name_colored"] = true, - ["name_length"] = 21, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "[health:color][health:current]", - ["position"] = "INNERRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 11, - }, - ["power"] = - { - ["enable"] = true, - ["tags"] = "", - ["height"] = 10, - ["position"] = "INNERLEFT", - ["hideonnpc"] = false, - ["xOffset"] = 0, - ["yOffset"] = 0, - ["detachedWidth"] = 250, - ["attachTextToPower"] = false, - ["druidMana"] = true, - ["fontSize"] = 11, - }, - ["name"] = - { - ["position"] = "CENTER", - ["tags"] = "", - ["xOffset"] = 0, - ["yOffset"] = 0, - ["font"] = "SVUI Number Font", - ["fontSize"] = 13, - ["fontOutline"] = "OUTLINE", - }, - ["pvp"] = - { - ["font"] = "SVUI Number Font", - ["fontSize"] = 12, - ["fontOutline"] = "OUTLINE", - ["position"] = "BOTTOM", - ["tags"] = "||cFFB04F4F[pvptimer][mouseover]||r", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - ["portrait"] = - { - ["enable"] = true, - ["width"] = 50, - ["overlay"] = true, - ["camDistanceScale"] = 1.4, - ["rotation"] = 0, - ["style"] = "3D", - }, - ["buffs"] = - { - ["enable"] = false, - ["perrow"] = 8, - ["numrows"] = 1, - ["attachTo"] = "DEBUFFS", - ["anchorPoint"] = "TOPLEFT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = true, - ["filterRaid"] = true, - ["filterBlocked"] = true, - ["filterAllowed"] = true, - ["filterInfinite"] = true, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = 8, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = true, - ["perrow"] = 8, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "TOPLEFT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = false, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = false, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = 8, - ["sizeOverride"] = 0, - }, - ["aurabar"] = - { - ["enable"] = false, - ["anchorPoint"] = "ABOVE", - ["attachTo"] = "DEBUFFS", - ["filterPlayer"] = true, - ["filterRaid"] = true, - ["filterBlocked"] = true, - ["filterAllowed"] = true, - ["filterInfinite"] = true, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["friendlyAuraType"] = "HELPFUL", - ["enemyAuraType"] = "HARMFUL", - ["height"] = 18, - ["sort"] = "TIME_REMAINING", - }, - ["castbar"] = - { - ["enable"] = true, - ["width"] = 215, - ["height"] = 20, - ["matchFrameWidth"] = true, - ["icon"] = true, - ["latency"] = false, - ["format"] = "REMAINING", - ["ticks"] = false, - ["spark"] = true, - ["displayTarget"] = false, - ["useCustomColor"] = false, - ["castingColor"] = {0.8, 0.8, 0}, - ["sparkColor"] = {1, 0.72, 0}, - }, - ["classbar"] = - { - ["enable"] = true, - ["slideLeft"] = true, - ["inset"] = "inset", - ["height"] = 25, - ["detachFromFrame"] = false, - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 30, - ["attachTo"] = "INNERRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - ["combatIcon"] = { - ["enable"] = true, - ["size"] = 26, - ["attachTo"] = "INNERTOPRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - ["restIcon"] = { - ["enable"] = true, - ["size"] = 26, - ["attachTo"] = "INNERTOPRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - }, - ["stagger"] = - { - ["enable"] = true, - }, - }, - ["target"] = { - ["enable"] = true, - ["width"] = 215, - ["height"] = 60, - ["threatEnabled"] = true, - ["rangeCheck"] = true, - ["predict"] = false, - ["smartAuraDisplay"] = "DISABLED", - ["middleClickFocus"] = true, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "current", - ["name_colored"] = true, - ["name_length"] = 18, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "[health:color][health:current]", - ["position"] = "INNERLEFT", - ["xOffset"] = 0, - ["yOffset"] = 0, - ["reversed"] = true, - ["fontSize"] = 11, - }, - ["power"] = - { - ["enable"] = true, - ["tags"] = "", - ["height"] = 10, - ["position"] = "CENTER", - ["hideonnpc"] = true, - ["xOffset"] = 0, - ["yOffset"] = 0, - ["attachTextToPower"] = false, - ["fontSize"] = 11, - }, - ["name"] = - { - ["position"] = "INNERRIGHT", - ["tags"] = "[name:color][name:18] [name:level]", - ["xOffset"] = 0, - ["yOffset"] = 0, - ["font"] = "SVUI Number Font", - ["fontSize"] = 13, - ["fontOutline"] = "OUTLINE", - }, - ["portrait"] = - { - ["enable"] = true, - ["width"] = 50, - ["overlay"] = true, - ["rotation"] = 0, - ["camDistanceScale"] = 1.4, - ["style"] = "3D", - }, - ["buffs"] = - { - ["enable"] = true, - ["perrow"] = 8, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "TOPRIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "LEFT", - ["filterPlayer"] = - { - friendly = false, - enemy = false, - }, - ["filterRaid"] = - { - friendly = false, - enemy = false, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = false, - enemy = false, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = 8, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = true, - ["perrow"] = 8, - ["numrows"] = 1, - ["attachTo"] = "BUFFS", - ["anchorPoint"] = "TOPRIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "LEFT", - ["filterPlayer"] = - { - friendly = false, - enemy = true, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = false, - enemy = false, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = 8, - ["sizeOverride"] = 0, - }, - ["aurabar"] = - { - ["enable"] = false, - ["anchorPoint"] = "ABOVE", - ["attachTo"] = "DEBUFFS", - ["filterPlayer"] = - { - friendly = true, - enemy = true, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = true, - enemy = true, - }, - ["filterRaid"] = - { - friendly = true, - enemy = true, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "", - ["friendlyAuraType"] = "HELPFUL", - ["enemyAuraType"] = "HARMFUL", - ["height"] = 18, - ["sort"] = "TIME_REMAINING", - }, - ["castbar"] = - { - ["enable"] = true, - ["width"] = 215, - ["height"] = 20, - ["matchFrameWidth"] = true, - ["icon"] = true, - ["format"] = "REMAINING", - ["spark"] = true, - ["useCustomColor"] = false, - ["castingColor"] = {0.8, 0.8, 0}, - ["sparkColor"] = {1, 0.72, 0}, - }, - ["combobar"] = - { - ["enable"] = true, - ["height"] = 30, - ["smallIcons"] = false, - ["hudStyle"] = false, - ["hudScale"] = 64, - ["autoHide"] = true, - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 30, - ["attachTo"] = "INNERLEFT", - ["xOffset"] = 0, - ["yOffset"] = 0, - } - }, - }, - ["targettarget"] = { - ["enable"] = true, - ["rangeCheck"] = true, - ["threatEnabled"] = false, - ["width"] = 150, - ["height"] = 30, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "none", - ["name_colored"] = true, - ["name_length"] = 10, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "", - ["position"] = "INNERRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 9, - }, - ["power"] = - { - ["enable"] = false, - ["tags"] = "", - ["height"] = 7, - ["position"] = "INNERLEFT", - ["hideonnpc"] = false, - ["xOffset"] = 0, - ["yOffset"] = 0, - ["fontSize"] = 9, - }, - ["name"] = - { - ["position"] = "CENTER", - ["tags"] = "[name:color][name:10]", - ["xOffset"] = 0, - ["yOffset"] = 1, - ["font"] = "SVUI Narrator Font", - ["fontSize"] = 14, - ["fontOutline"] = "OUTLINE", - }, - ["portrait"] = - { - ["enable"] = true, - ["width"] = 45, - ["overlay"] = true, - ["rotation"] = 0, - ["camDistanceScale"] = 1, - ["style"] = "3D", - }, - ["buffs"] = - { - ["enable"] = false, - ["perrow"] = 7, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "BOTTOMLEFT", - ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = - { - friendly = true, - enemy = false, - }, - ["filterRaid"] = - { - friendly = true, - enemy = false, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = true, - enemy = false, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = -8, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = false, - ["perrow"] = 5, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "TOPLEFT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = - { - friendly = false, - enemy = true, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = false, - enemy = false, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = 8, - ["sizeOverride"] = 0, - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 18, - ["attachTo"] = "INNERRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - }, - }, - ["focus"] = { - ["enable"] = true, - ["rangeCheck"] = true, - ["threatEnabled"] = true, - ["width"] = 170, - ["height"] = 30, - ["predict"] = false, - ["smartAuraDisplay"] = "DISABLED", - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "none", - ["name_colored"] = true, - ["name_length"] = 15, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "", - ["position"] = "INNERRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["power"] = - { - ["enable"] = true, - ["tags"] = "", - ["height"] = 7, - ["position"] = "INNERLEFT", - ["hideonnpc"] = false, - ["xOffset"] = 0, - ["yOffset"] = 0, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "CENTER", - ["tags"] = "[name:color][name:15]", - ["xOffset"] = 0, - ["yOffset"] = 0, - ["font"] = "SVUI Narrator Font", - ["fontSize"] = 14, - ["fontOutline"] = "OUTLINE", - }, - ["buffs"] = - { - ["enable"] = false, - ["perrow"] = 7, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "BOTTOMRIGHT", - ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "LEFT", - ["filterPlayer"] = - { - friendly = true, - enemy = false, - }, - ["filterRaid"] = - { - friendly = true, - enemy = false, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = true, - enemy = false, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = -8, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = true, - ["perrow"] = 5, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "TOPRIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "LEFT", - ["filterPlayer"] = - { - friendly = false, - enemy = true, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = false, - enemy = false, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = 8, - ["sizeOverride"] = 0, - }, - ["castbar"] = - { - ["enable"] = true, - ["width"] = 170, - ["height"] = 18, - ["icon"] = true, - ["matchFrameWidth"] = true, - ["format"] = "REMAINING", - ["spark"] = true, - ["useCustomColor"] = false, - ["castingColor"] = {0.8, 0.8, 0}, - ["sparkColor"] = {1, 0.72, 0}, - }, - ["aurabar"] = - { - ["enable"] = false, - ["anchorPoint"] = "ABOVE", - ["attachTo"] = "FRAME", - ["filterPlayer"] = - { - friendly = false, - enemy = true, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = false, - enemy = false, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["filterRaid"] = - { - friendly = true, - enemy = true, - }, - ["useFilter"] = "", - ["friendlyAuraType"] = "HELPFUL", - ["enemyAuraType"] = "HARMFUL", - ["height"] = 18, - ["sort"] = "TIME_REMAINING", - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 18, - ["attachTo"] = "INNERLEFT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - }, - }, - ["focustarget"] = { - ["enable"] = false, - ["rangeCheck"] = true, - ["threatEnabled"] = false, - ["width"] = 150, - ["height"] = 26, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "none", - ["name_colored"] = true, - ["name_length"] = 15, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "", - ["position"] = "INNERRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["power"] = - { - ["enable"] = false, - ["tags"] = "", - ["height"] = 7, - ["position"] = "INNERLEFT", - ["hideonnpc"] = false, - ["xOffset"] = 0, - ["yOffset"] = 0, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "CENTER", - ["tags"] = "[name:color][name:15]", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["font"] = "SVUI Narrator Font", - ["fontSize"] = 14, - ["fontOutline"] = "OUTLINE", - }, - ["buffs"] = - { - ["enable"] = false, - ["perrow"] = 7, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "BOTTOMLEFT", - ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = - { - friendly = true, - enemy = false, - }, - ["filterRaid"] = - { - friendly = true, - enemy = false, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = true, - enemy = false, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = -8, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = false, - ["perrow"] = 5, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "TOPLEFT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = - { - friendly = false, - enemy = true, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = false, - enemy = false, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = 8, - ["sizeOverride"] = 0, - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 18, - ["attachTo"] = "INNERLEFT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - }, - }, - ["pet"] = { - ["enable"] = true, - ["rangeCheck"] = true, - ["threatEnabled"] = true, - ["width"] = 150, - ["height"] = 30, - ["predict"] = false, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "none", - ["name_colored"] = true, - ["name_length"] = 10, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "", - ["position"] = "INNERRIGHT", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["power"] = - { - ["enable"] = false, - ["tags"] = "", - ["height"] = 7, - ["position"] = "INNERLEFT", - ["hideonnpc"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "CENTER", - ["tags"] = "[name:color][name:8]", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["font"] = "SVUI Narrator Font", - ["fontSize"] = 14, - ["fontOutline"] = "OUTLINE", - }, - ["portrait"] = - { - ["enable"] = true, - ["width"] = 45, - ["overlay"] = true, - ["rotation"] = 0, - ["camDistanceScale"] = 1, - ["style"] = "3D", - }, - ["buffs"] = - { - ["enable"] = true, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "LEFT", - ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "LEFT", - ["filterPlayer"] = true, - ["filterRaid"] = true, - ["filterBlocked"] = true, - ["filterAllowed"] = true, - ["filterInfinite"] = true, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = -3, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = true, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = false, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = false, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 3, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["castbar"] = - { - ["enable"] = true, - ["width"] = 130, - ["height"] = 8, - ["icon"] = false, - ["matchFrameWidth"] = true, - ["format"] = "REMAINING", - ["spark"] = false, - ["useCustomColor"] = false, - ["castingColor"] = {0.8, 0.8, 0}, - ["sparkColor"] = {1, 0.72, 0}, - }, - ["auraWatch"] = - { - ["enable"] = true, - ["size"] = 8, - }, - }, - ["pettarget"] = { - ["enable"] = false, - ["rangeCheck"] = true, - ["threatEnabled"] = false, - ["width"] = 130, - ["height"] = 26, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "none", - ["name_colored"] = true, - ["name_length"] = 15, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "", - ["position"] = "INNERRIGHT", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["power"] = - { - ["enable"] = false, - ["tags"] = "", - ["height"] = 7, - ["position"] = "INNERLEFT", - ["hideonnpc"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "CENTER", - ["tags"] = "[name:color][name:15]", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["font"] = "SVUI Narrator Font", - ["fontSize"] = 14, - ["fontOutline"] = "OUTLINE", - }, - ["buffs"] = - { - ["enable"] = false, - ["perrow"] = 7, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "BOTTOMLEFT", - ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = - { - friendly = true, - enemy = false, - }, - ["filterRaid"] = - { - friendly = true, - enemy = false, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = true, - enemy = false, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = -8, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = false, - ["perrow"] = 5, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "BOTTOMRIGHT", - ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "LEFT", - ["filterPlayer"] = - { - friendly = false, - enemy = true, - }, - ["filterBlocked"] = - { - friendly = true, - enemy = true, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = false, - enemy = false, - }, - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "", - ["xOffset"] = 0, - ["yOffset"] = 8, - ["sizeOverride"] = 0, - }, + ["unitframes"] = { + ["health"] = {0.3, 0.5, 0.3}, + ["power"] = { + ["MANA"] = {0.41, 0.85, 1}, + ["RAGE"] = {1, 0.31, 0.31}, + ["FOCUS"] = {1, 0.63, 0.27}, + ["ENERGY"] = {0.85, 0.83, 0.25}, + ["RUNES"] = {0.55, 0.57, 0.61}, + ["RUNIC_POWER"] = {0, 0.82, 1}, + ["FUEL"] = {0, 0.75, 0.75} }, - ["boss"] = { - ["enable"] = true, - ["rangeCheck"] = true, - ["showBy"] = "UP", - ["width"] = 200, - ["height"] = 45, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "current", - ["name_colored"] = true, - ["name_length"] = 15, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "[health:color][health:current]", - ["position"] = "INNERTOPRIGHT", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = true, - ["fontSize"] = 10, - }, - ["power"] = - { - ["enable"] = true, - ["tags"] = "[power:color][power:current]", - ["height"] = 7, - ["position"] = "INNERBOTTOMRIGHT", - ["hideonnpc"] = false, - ["yOffset"] = 7, - ["xOffset"] = 0, - ["fontSize"] = 10, - }, - ["portrait"] = - { - ["enable"] = true, - ["width"] = 35, - ["overlay"] = true, - ["rotation"] = 0, - ["camDistanceScale"] = 1, - ["style"] = "3D", - }, - ["name"] = - { - ["position"] = "INNERLEFT", - ["tags"] = "[name:color][name:15]", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["font"] = "SVUI Number Font", - ["fontSize"] = 12, - ["fontOutline"] = "OUTLINE", - }, - ["buffs"] = - { - ["enable"] = true, - ["perrow"] = 2, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "LEFT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "LEFT", - ["filterPlayer"] = false, - ["filterRaid"] = false, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = false, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = -8, - ["yOffset"] = 0, - ["sizeOverride"] = 40, - }, - ["debuffs"] = - { - ["enable"] = true, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "BUFFS", - ["anchorPoint"] = "LEFT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "LEFT", - ["filterPlayer"] = true, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = false, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = -8, - ["yOffset"] = 0, - ["sizeOverride"] = 40, - }, - ["castbar"] = - { - ["enable"] = true, - ["width"] = 200, - ["height"] = 18, - ["icon"] = true, - ["matchFrameWidth"] = true, - ["format"] = "REMAINING", - ["spark"] = true, - ["useCustomColor"] = false, - ["castingColor"] = {0.8, 0.8, 0}, - ["sparkColor"] = {1, 0.72, 0}, - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 22, - ["attachTo"] = "CENTER", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - }, - }, - ["arena"] = { - ["enable"] = true, - ["rangeCheck"] = true, - ["showBy"] = "UP", - ["width"] = 215, - ["height"] = 45, - ["predict"] = false, - ["colorOverride"] = "USE_DEFAULT", - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "current", - ["name_colored"] = true, - ["name_length"] = 15, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "[health:color][health:current]", - ["position"] = "INNERTOPRIGHT", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = true, - ["fontSize"] = 10, - }, - ["power"] = - { - ["enable"] = true, - ["tags"] = "[power:color][power:current]", - ["height"] = 7, - ["position"] = "INNERBOTTOMRIGHT", - ["hideonnpc"] = false, - ["yOffset"] = 7, - ["xOffset"] = 0, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "INNERLEFT", - ["tags"] = "[name:color][name:15]", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["font"] = "SVUI Number Font", - ["fontSize"] = 12, - ["fontOutline"] = "OUTLINE", - }, - ["portrait"] = - { - ["enable"] = true, - ["width"] = 45, - ["overlay"] = true, - ["rotation"] = 0, - ["camDistanceScale"] = 1, - ["style"] = "3D", - }, - ["buffs"] = - { - ["enable"] = true, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "LEFT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "LEFT", - ["filterPlayer"] = - { - friendly = false, - enemy = false, - }, - ["filterRaid"] = - { - friendly = false, - enemy = false, - }, - ["filterBlocked"] = - { - friendly = false, - enemy = false, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "Shield", - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["xOffset"] = -8, - ["yOffset"] = 0, - ["sizeOverride"] = 40, - }, - ["debuffs"] = - { - ["enable"] = true, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "BUFFS", - ["anchorPoint"] = "LEFT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "LEFT", - ["filterPlayer"] = - { - friendly = false, - enemy = false, - }, - ["filterBlocked"] = - { - friendly = false, - enemy = false, - }, - ["filterAllowed"] = - { - friendly = false, - enemy = false, - }, - ["filterInfinite"] = - { - friendly = false, - enemy = false, - }, - ["useFilter"] = "CC", - ["filterDispellable"] = - { - friendly = false, - enemy = false, - }, - ["xOffset"] = -8, - ["yOffset"] = 0, - ["sizeOverride"] = 40, - }, - ["castbar"] = - { - ["enable"] = true, - ["width"] = 215, - ["height"] = 18, - ["icon"] = true, - ["matchFrameWidth"] = true, - ["format"] = "REMAINING", - ["spark"] = true, - ["useCustomColor"] = false, - ["castingColor"] = {0.8, 0.8, 0}, - ["sparkColor"] = {1, 0.72, 0}, - }, - ["pvp"] = - { - ["enable"] = true, - ["trinketPosition"] = "LEFT", - ["trinketSize"] = 45, - ["trinketX"] = -2, - ["trinketY"] = 0, - ["specPosition"] = "RIGHT", - ["specSize"] = 45, - ["specX"] = 2, - ["specY"] = 0, - }, - }, - ["party"] = { - ["enable"] = true, - ["rangeCheck"] = true, - ["threatEnabled"] = true, - ["visibility"] = "[@raid6, exists][nogroup] hide;show", - ["showBy"] = "UP_RIGHT", - ["wrapXOffset"] = 9, - ["wrapYOffset"] = 13, - ["groupCount"] = 1, - ["gRowCol"] = 1, - ["customSorting"] = false, - ["sortMethod"] = "GROUP", - ["sortDir"] = "ASC", - ["invertGroupingOrder"] = false, - ["startFromCenter"] = false, - ["showPlayer"] = true, - ["predict"] = false, - ["colorOverride"] = "USE_DEFAULT", - ["gridMode"] = false, - ["width"] = 70, - ["height"] = 70, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "none", - ["name_colored"] = true, - ["name_length"] = 10, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "", - ["position"] = "BOTTOM", - ["orientation"] = "HORIZONTAL", - ["frequentUpdates"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["power"] = - { - ["enable"] = true, - ["tags"] = "", - ["frequentUpdates"] = false, - ["height"] = 7, - ["position"] = "BOTTOMRIGHT", - ["hideonnpc"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "INNERTOPLEFT", - ["tags"] = "[name:color][name:10]", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["font"] = "SVUI Narrator Font", - ["fontSize"] = 13, - ["fontOutline"] = "OUTLINE", - }, - ["buffs"] = - { - ["enable"] = false, - ["perrow"] = 2, - ["numrows"] = 2, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHTTOP", - ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = true, - ["filterRaid"] = true, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = true, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = true, - ["perrow"] = 2, - ["numrows"] = 2, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHTTOP", - ["verticalGrowth"] = "DOWN", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = false, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = false, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["auraWatch"] = - { - ["enable"] = true, - ["size"] = 8, - ["fontSize"] = 11, - }, - ["petsGroup"] = - { - ["enable"] = false, - ["width"] = 30, - ["height"] = 30, - ["anchorPoint"] = "BOTTOMLEFT", - ["xOffset"] = - 1, - ["yOffset"] = 0, - ["name_length"] = 3, - ["tags"] = "[name:3]", - }, - ["targetsGroup"] = - { - ["enable"] = false, - ["width"] = 30, - ["height"] = 30, - ["anchorPoint"] = "TOPLEFT", - ["xOffset"] = - 1, - ["yOffset"] = 0, - ["name_length"] = 3, - ["tags"] = "[name:3]", - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 25, - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - ["roleIcon"] = - { - ["enable"] = true, - ["size"] = 18, - ["attachTo"] = "INNERBOTTOMRIGHT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - ["raidRoleIcons"] = - { - ["enable"] = true, - ["size"] = 18, - ["attachTo"] = "TOPLEFT", - ["xOffset"] = 0, - ["yOffset"] = -4, - }, - }, - ["portrait"] = - { - ["enable"] = true, - ["width"] = 45, - ["overlay"] = true, - ["rotation"] = 0, - ["camDistanceScale"] = 1, - ["style"] = "3D", - }, - }, - ["raid10"] = { - ["enable"] = true, - ["rangeCheck"] = true, - ["threatEnabled"] = true, - ["visibility"] = "[@raid6, noexists][@raid11, exists][nogroup] hide;show", - ["showBy"] = "RIGHT_DOWN", - ["wrapXOffset"] = 8, - ["wrapYOffset"] = 8, - ["groupCount"] = 2, - ["gRowCol"] = 1, - ["customSorting"] = false, - ["sortMethod"] = "GROUP", - ["sortDir"] = "ASC", - ["showPlayer"] = true, - ["predict"] = false, - ["colorOverride"] = "USE_DEFAULT", - ["gridMode"] = false, - ["width"] = 75, - ["height"] = 34, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "none", - ["name_colored"] = true, - ["name_length"] = 4, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "", - ["position"] = "BOTTOM", - ["orientation"] = "HORIZONTAL", - ["frequentUpdates"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["power"] = - { - ["enable"] = true, - ["tags"] = "", - ["frequentUpdates"] = false, - ["height"] = 4, - ["position"] = "BOTTOMRIGHT", - ["hideonnpc"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "INNERTOPLEFT", - ["tags"] = "[name:color][name:4]", - ["yOffset"] = 0, - ["xOffset"] = 8, - ["font"] = "SVUI Default Font", - ["fontSize"] = 10, - ["fontOutline"] = "OUTLINE", - }, - ["buffs"] = - { - ["enable"] = false, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = true, - ["filterRaid"] = true, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = true, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = false, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = false, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = false, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["auraWatch"] = - { - ["enable"] = true, - ["size"] = 8, - }, - ["rdebuffs"] = - { - ["enable"] = true, - ["size"] = 26, - ["xOffset"] = 0, - ["yOffset"] = 2, - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 15, - ["attachTo"] = "INNERBOTTOMRIGHT", - ["xOffset"] = -8, - ["yOffset"] = 0, - }, - ["roleIcon"] = - { - ["enable"] = true, - ["size"] = 12, - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - ["raidRoleIcons"] = - { - ["enable"] = true, - ["size"] = 18, - ["attachTo"] = "TOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = -4, - }, - }, - }, - ["raid25"] = { - ["enable"] = true, - ["rangeCheck"] = true, - ["threatEnabled"] = true, - ["visibility"] = "[@raid6, noexists][@raid11, noexists][@raid26, exists][nogroup] hide;show", - ["showBy"] = "RIGHT_DOWN", - ["wrapXOffset"] = 8, - ["wrapYOffset"] = 8, - ["groupCount"] = 5, - ["gRowCol"] = 1, - ["customSorting"] = false, - ["sortMethod"] = "GROUP", - ["sortDir"] = "ASC", - ["showPlayer"] = true, - ["predict"] = false, - ["colorOverride"] = "USE_DEFAULT", - ["gridMode"] = false, - ["width"] = 50, - ["height"] = 30, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "none", - ["name_colored"] = true, - ["name_length"] = 4, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "", - ["position"] = "BOTTOM", - ["orientation"] = "HORIZONTAL", - ["frequentUpdates"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["power"] = - { - ["enable"] = true, - ["tags"] = "", - ["height"] = 4, - ["position"] = "BOTTOMRIGHT", - ["hideonnpc"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "INNERTOPLEFT", - ["tags"] = "[name:color][name:4]", - ["yOffset"] = 0, - ["xOffset"] = 8, - ["font"] = "SVUI Default Font", - ["fontSize"] = 10, - ["fontOutline"] = "OUTLINE", - }, - ["buffs"] = - { - ["enable"] = false, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = true, - ["filterRaid"] = true, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = true, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = false, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = false, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = false, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["auraWatch"] = - { - ["enable"] = true, - ["size"] = 8, - }, - ["rdebuffs"] = - { - ["enable"] = true, - ["size"] = 26, - ["xOffset"] = 0, - ["yOffset"] = 2, - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 15, - ["attachTo"] = "INNERBOTTOMRIGHT", - ["xOffset"] = -8, - ["yOffset"] = 0, - }, - ["roleIcon"] = - { - ["enable"] = true, - ["size"] = 12, - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - ["raidRoleIcons"] = - { - ["enable"] = true, - ["size"] = 18, - ["attachTo"] = "TOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = -4, - }, - }, - }, - ["raid40"] = { - ["enable"] = true, - ["rangeCheck"] = true, - ["threatEnabled"] = true, - ["visibility"] = "[@raid6, noexists][@raid11, noexists][@raid26, noexists][nogroup] hide;show", - ["showBy"] = "RIGHT_DOWN", - ["wrapXOffset"] = 8, - ["wrapYOffset"] = 8, - ["groupCount"] = 8, - ["gRowCol"] = 1, - ["customSorting"] = false, - ["sortMethod"] = "GROUP", - ["sortDir"] = "ASC", - ["showPlayer"] = true, - ["predict"] = false, - ["colorOverride"] = "USE_DEFAULT", - ["gridMode"] = false, - ["width"] = 50, - ["height"] = 30, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "none", - ["name_colored"] = true, - ["name_length"] = 4, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "", - ["position"] = "BOTTOM", - ["orientation"] = "HORIZONTAL", - ["frequentUpdates"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["power"] = - { - ["enable"] = false, - ["tags"] = "", - ["frequentUpdates"] = false, - ["height"] = 4, - ["position"] = "BOTTOMRIGHT", - ["hideonnpc"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "INNERTOPLEFT", - ["tags"] = "[name:color][name:4]", - ["yOffset"] = 0, - ["xOffset"] = 8, - ["font"] = "SVUI Default Font", - ["fontSize"] = 10, - ["fontOutline"] = "OUTLINE", - }, - ["buffs"] = - { - ["enable"] = false, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = true, - ["filterRaid"] = true, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = true, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = false, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = false, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = false, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["rdebuffs"] = - { - ["enable"] = true, - ["size"] = 22, - ["xOffset"] = 0, - ["yOffset"] = 2, - }, - ["auraWatch"] = - { - ["enable"] = true, - ["size"] = 8, - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 15, - ["attachTo"] = "INNERBOTTOMRIGHT", - ["xOffset"] = -8, - ["yOffset"] = 0, - }, - ["roleIcon"] = - { - ["enable"] = true, - ["size"] = 12, - ["attachTo"] = "INNERBOTTOMLEFT", - ["xOffset"] = 8, - ["yOffset"] = 0, - }, - ["raidRoleIcons"] = - { - ["enable"] = true, - ["size"] = 18, - ["attachTo"] = "TOPLEFT", - ["xOffset"] = 8, - ["yOffset"] = -4, - }, - }, - }, - ["raidpet"] = { - ["enable"] = false, - ["rangeCheck"] = true, - ["threatEnabled"] = true, - ["visibility"] = "[group:raid] show; hide", - ["showBy"] = "DOWN_RIGHT", - ["wrapXOffset"] = 3, - ["wrapYOffset"] = 3, - ["groupCount"] = 2, - ["gRowCol"] = 1, - ["customSorting"] = true, - ["sortMethod"] = "PETNAME", - ["sortDir"] = "ASC", - ["invertGroupingOrder"] = false, - ["startFromCenter"] = false, - ["predict"] = false, - ["colorOverride"] = "USE_DEFAULT", - ["gridMode"] = false, - ["width"] = 80, - ["height"] = 30, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "deficit", - ["name_colored"] = true, - ["name_length"] = 4, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "[health:color][health:deficit]", - ["position"] = "BOTTOM", - ["orientation"] = "HORIZONTAL", - ["frequentUpdates"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "INNERTOPLEFT", - ["tags"] = "[name:color][name:4]", - ["yOffset"] = 4, - ["xOffset"] = -4, - ["font"] = "SVUI Default Font", - ["fontSize"] = 10, - ["fontOutline"] = "OUTLINE", - }, - ["buffs"] = - { - ["enable"] = false, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = true, - ["filterRaid"] = true, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = true, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["debuffs"] = - { - ["enable"] = false, - ["perrow"] = 3, - ["numrows"] = 1, - ["attachTo"] = "FRAME", - ["anchorPoint"] = "RIGHT", - ["verticalGrowth"] = "UP", - ["horizontalGrowth"] = "RIGHT", - ["filterPlayer"] = false, - ["filterBlocked"] = true, - ["filterAllowed"] = false, - ["filterInfinite"] = false, - ["filterDispellable"] = false, - ["useFilter"] = "", - ["xOffset"] = 8, - ["yOffset"] = 0, - ["sizeOverride"] = 0, - }, - ["auraWatch"] = - { - ["enable"] = true, - ["size"] = 8, - }, - ["rdebuffs"] = - { - ["enable"] = true, - ["size"] = 26, - ["xOffset"] = 0, - ["yOffset"] = 2, - }, - ["icons"] = - { - ["raidicon"] = - { - ["enable"] = true, - ["size"] = 18, - ["attachTo"] = "INNERTOPLEFT", - ["xOffset"] = 0, - ["yOffset"] = 0, - }, - }, - }, - ["tank"] = { - ["enable"] = true, - ["threatEnabled"] = true, - ["rangeCheck"] = true, - ["gridMode"] = false, - ["width"] = 120, - ["height"] = 28, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "deficit", - ["name_colored"] = true, - ["name_length"] = 8, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "[health:color][health:deficit]", - ["position"] = "INNERRIGHT", - ["orientation"] = "HORIZONTAL", - ["frequentUpdates"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "INNERLEFT", - ["tags"] = "[name:color][name:8]", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["font"] = "SVUI Default Font", - ["fontSize"] = 10, - ["fontOutline"] = "OUTLINE", - }, - ["targetsGroup"] = - { - ["enable"] = false, - ["anchorPoint"] = "RIGHT", - ["xOffset"] = 1, - ["yOffset"] = 0, - ["width"] = 120, - ["height"] = 28, - }, - }, - ["assist"] = { - ["enable"] = true, - ["threatEnabled"] = true, - ["rangeCheck"] = true, - ["gridMode"] = false, - ["width"] = 120, - ["height"] = 28, - ["formatting"] = { - ["power_colored"] = true, - ["power_type"] = "none", - ["power_class"] = false, - ["power_alt"] = false, - ["health_colored"] = true, - ["health_type"] = "deficit", - ["name_colored"] = true, - ["name_length"] = 8, - ["smartlevel"] = false, - ["absorbs"] = false, - ["threat"] = false, - ["incoming"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - }, - ["misc"] = { - ["tags"] = "" - }, - ["health"] = - { - ["tags"] = "[health:color][health:deficit]", - ["position"] = "INNERRIGHT", - ["orientation"] = "HORIZONTAL", - ["frequentUpdates"] = false, - ["yOffset"] = 0, - ["xOffset"] = 0, - ["reversed"] = false, - ["fontSize"] = 10, - }, - ["name"] = - { - ["position"] = "INNERLEFT", - ["tags"] = "[name:color][name:8]", - ["yOffset"] = 0, - ["xOffset"] = 0, - ["font"] = "SVUI Default Font", - ["fontSize"] = 10, - ["fontOutline"] = "OUTLINE", - }, - ["targetsGroup"] = - { - ["enable"] = false, - ["anchorPoint"] = "RIGHT", - ["xOffset"] = 1, - ["yOffset"] = 0, - ["width"] = 120, - ["height"] = 28, - }, - } - }, - ["SVStyle"] = { - ["blizzard"] = { - ["enable"] = true, - ["bags"] = true, - ["bmah"] = true, - ["reforge"] = true, - ["calendar"] = true, - ["achievement"] = true, - ["lfguild"] = true, - ["inspect"] = true, - ["binding"] = true, - ["gbank"] = true, - ["archaeology"] = true, - ["guildcontrol"] = true, - ["gossip"] = true, - ["guild"] = true, - ["tradeskill"] = true, - ["raid"] = false, - ["talent"] = true, - ["auctionhouse"] = true, - ["barber"] = true, - ["macro"] = true, - ["debug"] = true, - ["trainer"] = true, - ["socket"] = true, - ["loot"] = true, - ["alertframes"] = true, - ["bgscore"] = true, - ["merchant"] = true, - ["mail"] = true, - ["help"] = true, - ["trade"] = true, - ["gossip"] = true, - ["greeting"] = true, - ["worldmap"] = true, - ["taxi"] = true, - ["quest"] = true, - ["petition"] = true, - ["dressingroom"] = true, - ["pvp"] = true, - ["lfg"] = true, - ["nonraid"] = true, - ["friends"] = true, - ["spellbook"] = true, - ["character"] = true, - ["misc"] = true, - ["tabard"] = true, - ["guildregistrar"] = true, - ["timemanager"] = true, - ["encounterjournal"] = true, - ["voidstorage"] = true, - ["transmogrify"] = true, - ["stable"] = true, - ["bgmap"] = true, - ["mounts"] = true, - ["petbattleui"] = true, - ["losscontrol"] = true, - ["itemUpgrade"] = true, + ["reaction"] = { + [1] = {0.92, 0.15, 0.15}, + [2] = {0.92, 0.15, 0.15}, + [3] = {0.92, 0.15, 0.15}, + [4] = {0.85, 0.85, 0.13}, + [5] = {0.19, 0.85, 0.13}, + [6] = {0.19, 0.85, 0.13}, + [7] = {0.19, 0.85, 0.13}, + [8] = {0.19, 0.85, 0.13}, + }, + ["tapped"] = {0.55, 0.57, 0.61}, + ["disconnected"] = {0.84, 0.75, 0.65}, + ["casting"] = {0.8, 0.8, 0}, + ["spark"] = {1, 0.72, 0}, + ["interrupt"] = {0.78, 0.25, 0.25}, + ["shield_bars"] = {0.56, 0.4, 0.62}, + ["buff_bars"] = {0.31, 0.31, 0.31}, + ["debuff_bars"] = {0.8, 0.1, 0.1}, + ["predict"] = { + ["personal"] = {0, 1, 0.5, 0.25}, + ["others"] = {0, 1, 0, 0.25}, + ["absorbs"] = {1, 1, 0, 0.25} }, - ["addons"] = { - ["enable"] = true, - ["Skada"] = true, - ["Recount"] = true, - ["AuctionLite"] = true, - ["AtlasLoot"] = true, - ["SexyCooldown"] = true, - ["Lightheaded"] = true, - ["Outfitter"] = true, - ["WeakAuras"] = true, - ["Quartz"] = true, - ["TomTom"] = true, - ["TinyDPS"] = true, - ["Clique"] = true, - ["CoolLine"] = true, - ["ACP"] = true, - ["DXE"] = true, - ["MogIt"] = true, - ["alDamageMeter"] = true, - ["Omen"] = true, - ["TradeSkillDW"] = true, + ["spellcolor"] = { + [SpellName(2825)] = {0.98, 0.57, 0.11}, --Bloodlust + [SpellName(32182)] = {0.98, 0.57, 0.11}, --Heroism + [SpellName(80353)] = {0.98, 0.57, 0.11}, --Time Warp + [SpellName(90355)] = {0.98, 0.57, 0.11}, --Ancient Hysteria + [SpellName(84963)] = {0.98, 0.57, 0.11}, --Inquisition + [SpellName(86659)] = {0.98, 0.57, 0.11}, --Guardian of Ancient Kings } - }, - ["filter"] = { - ["CC"] = {}, - ["Shield"] = {}, - ["Player"] = {}, - ["Blocked"] = {}, - ["Allowed"] = {}, - ["Strict"] = {}, - ["Raid"] = {}, - }, + } +} +CONFIGS["filter"] = { + ["CC"] = {}, + ["Shield"] = {}, + ["Player"] = {}, + ["Blocked"] = {}, + ["Allowed"] = {}, + ["Strict"] = {}, + ["Raid"] = {}, } + --[[ ########################################################## CONSTRUCT FILTER DEFAULTS @@ -3880,7 +844,7 @@ end for k, x in pairs(FilterIDs) do local src = {}; - for id in gmatch(x, '([^,]+)') do + for id in x:gmatch("([^,]+)") do if(id) then local saved local n = safename(id); @@ -3893,255 +857,259 @@ for k, x in pairs(FilterIDs) do src[n] = saved end end - DefaultSettings.filter[k] = src + CONFIGS.filter[k] = src end -DefaultSettings.filter.BuffWatch = CLASS_WATCH_INDEX[SuperVillain.class] or {} -DefaultSettings.filter.PetBuffWatch = PET_WATCH +CONFIGS.filter.BuffWatch = CLASS_WATCH_INDEX[SuperVillain.class] or {} +CONFIGS.filter.PetBuffWatch = PET_WATCH --[[ ########################################################## CREATE DB ########################################################## ]]-- local function tablecopy(d, s) - if type(s) ~= "table" then return end - if type(d) == "table" then - for k, v in pairs(s) do - if(k ~= "SAFEDATA") then - if type(v) == "table" then - if not rawget(d, k) then rawset(d, k, {}) end - tablecopy(d[k], v) - else - if rawget(d, k) == nil then - rawset(d, k, v) - end - end - end - end - end + if type(s) ~= "table" then return end + if type(d) == "table" then + for k, v in pairs(s) do + if(k ~= "SAFEDATA") then + if type(v) == "table" then + if not rawget(d, k) then rawset(d, k, {}) end + tablecopy(d[k], v) + else + if rawget(d, k) == nil then + rawset(d, k, v) + end + end + end + end + end end local function importdata(s, d) - if type(d) ~= "table" then d = {} end - if type(s) == "table" then - for k,v in pairs(s) do - if(k ~= "SAFEDATA") then - if type(v) == "table" then - v = importdata(v, d[k]) - end - d[k] = v - end - end - end - return d + if type(d) ~= "table" then d = {} end + if type(s) == "table" then + for k,v in pairs(s) do + if(k ~= "SAFEDATA") then + if type(v) == "table" then + v = importdata(v, d[k]) + end + d[k] = v + end + end + end + return d end local function setdefaults(t, key, sub, sub2) - local sv = rawget(t, "profile") - local src = rawget(t, "defaults") - local savedProfile = sv[key] - if(sub2 and sv[key] and sv[key][sub]) then - savedProfile = sv[key][sub][sub2] - elseif(sub and sv[key]) then - savedProfile = sv[key][sub] - else - savedProfile = sv[key] - end - if(savedProfile) then - for k,v in pairs(savedProfile) do - savedProfile[k] = nil - end - else - sv[key] = {} - end - tablecopy(sv[key], src[key]) + local sv = rawget(t, "profile") + local src = rawget(t, "defaults") + local savedProfile = sv[key] + if(sub2 and sv[key] and sv[key][sub]) then + savedProfile = sv[key][sub][sub2] + elseif(sub and sv[key]) then + savedProfile = sv[key][sub] + else + savedProfile = sv[key] + end + if(savedProfile) then + for k,v in pairs(savedProfile) do + savedProfile[k] = nil + end + else + sv[key] = {} + end + tablecopy(sv[key], src[key]) end local function getdefaults(t, key) - local src = rawget(t, "defaults") - return src[key] or {} + local src = rawget(t, "defaults") + return src[key] or {} end local function removedefaults(db, src, nometa) - if(type(src) ~= "table") then return end - if(not nometa) then - setmetatable(db, nil) - end - for k,v in pairs(src) do - if(k ~= "SAFEDATA") then - if type(v) == "table" and type(db[k]) == "table" then - removedefaults(db[k], v, nometa) - if next(db[k]) == nil then - db[k] = nil - end - else - if db[k] == v then - db[k] = nil - end - end - end - end + if(type(src) ~= "table") then return end + if(not nometa) then + setmetatable(db, nil) + end + for k,v in pairs(src) do + if(k ~= "SAFEDATA") then + if type(v) == "table" and type(db[k]) == "table" then + removedefaults(db[k], v, nometa) + if next(db[k]) == nil then + db[k] = nil + end + else + if db[k] == v then + db[k] = nil + end + end + end + end end local function resetprofile(t) - local sv = rawget(t, "profile") - local src = rawget(t, "defaults") - for k,v in pairs(sv) do - if(k ~= "SAFEDATA") then - sv[k] = nil - end - end + local sv = rawget(t, "profile") + local src = rawget(t, "defaults") + for k,v in pairs(sv) do + if(k ~= "SAFEDATA") then + sv[k] = nil + end + end end local function importprofile(t, key) - local sv = rawget(t, "profile") - local dv = rawget(t, "defaults") - local globals = G - local src = globals.profiles[key] - if(not src) then return end - for k,v in pairs(sv) do - if(k ~= "SAFEDATA") then - sv[k] = nil - end - end - tablecopy(sv, src) - sv.copyKey = key - ReloadUI() + local sv = rawget(t, "profile") + local dv = rawget(t, "defaults") + local globals = G + local src = globals.profiles[key] + if(not src) then return end + for k,v in pairs(sv) do + if(k ~= "SAFEDATA") then + sv[k] = nil + end + end + tablecopy(sv, src) + sv.copyKey = key + ReloadUI() end local function importprompt(t, key) - SuperVillain.SystemAlert["COPY_PROFILE_PROMPT"].text = L["Are you sure you want to copy the profile '" .. key .. "'?"] - SuperVillain.SystemAlert["COPY_PROFILE_PROMPT"].OnAccept = function() importprofile(t, key) end - SuperVillain:StaticPopup_Show("COPY_PROFILE_PROMPT") + SuperVillain.SystemAlert["COPY_PROFILE_PROMPT"].text = L["Are you sure you want to copy the profile '" .. key .. "'?"] + SuperVillain.SystemAlert["COPY_PROFILE_PROMPT"].OnAccept = function() importprofile(t, key) end + SuperVillain:StaticPopup_Show("COPY_PROFILE_PROMPT") end local function exportprofile(t, key) - local sv = rawget(t, "profile") - local dv = rawget(t, "defaults") - local globals = G - if(not globals.profiles[key]) then globals.profiles[key] = {} end - local saved = globals.profiles[key] - tablecopy(saved, sv) - for k,v in pairs(saved) do - removedefaults(saved[k], dv[k]) - end - globals.profileKeys[key] = key - SuperVillain:SavedPopup() + local sv = rawget(t, "profile") + local dv = rawget(t, "defaults") + local globals = G + if(not globals.profiles[key]) then globals.profiles[key] = {} end + local saved = globals.profiles[key] + tablecopy(saved, sv) + for k,v in pairs(saved) do + removedefaults(saved[k], dv[k]) + end + globals.profileKeys[key] = key + SuperVillain:SavedPopup() end local function removeprofile(t, key) - local globals = G - if(globals.profiles[key]) then globals.profiles[key] = nil end - if(globals.profileKeys[key]) then globals.profileKeys[key] = nil end - collectgarbage("collect") + local globals = G + if(globals.profiles[key]) then globals.profiles[key] = nil end + if(globals.profileKeys[key]) then globals.profileKeys[key] = nil end + collectgarbage("collect") end local function insertdata(t, src) - local sv = rawget(t, "profile") - local dv = rawget(t, "defaults") - for k,v in pairs(src) do - if(not sv[k]) then sv[k] = {} end - tablecopy(sv[k], src[k]) - if(not dv[k]) then dv[k] = {} end - tablecopy(dv[k], src[k]) + local sv = rawget(t, "profile") + local dv = rawget(t, "defaults") + for k,v in pairs(src) do + if(not sv[k]) then sv[k] = {} end + tablecopy(sv[k], src[k]) + if(not dv[k]) then dv[k] = {} end + tablecopy(dv[k], src[k]) - rawset(t, k, sv[k]) - end + rawset(t, k, sv[k]) + end end local function initializedata(t) - local sv = rawget(t, "profile") - if(not sv.copyKey or (sv.copyKey and type(sv.copyKey) ~= "string")) then - sv.copyKey = pkey - end + local sv = rawget(t, "profile") + if(not sv.copyKey or (sv.copyKey and type(sv.copyKey) ~= "string")) then + sv.copyKey = pkey + end end local function SanitizeDatabase() - if(not SuperVillain.db) then return end - local db = SuperVillain.db - local src = DefaultSettings - for k,v in pairs(db) do - if(k ~= "SAFEDATA" and src[k]) then - removedefaults(db[k], src[k]) - end - end + if(not SuperVillain.db) then return end + local db = SuperVillain.db + local src = CONFIGS + for k,v in pairs(db) do + if(k ~= "SAFEDATA" and src[k]) then + removedefaults(db[k], src[k]) + end + end end local LogOut_OnEvent = function(self, event) - if event == "PLAYER_LOGOUT" then - SanitizeDatabase() - end + if event == "PLAYER_LOGOUT" then + SanitizeDatabase() + end end local metadatabase = { - __index = function(t, k) - if(not k or k == "") then return end - local sv = rawget(t, "profile") - local dv = rawget(t, "defaults") - local src = dv and dv[k] - if(not sv[k]) then sv[k] = {} end - if(src) then - tablecopy(sv[k], src) - end - rawset(t, k, sv[k]) - return rawget(t, k) - end, + __index = function(t, k) + if(not k or k == "") then return end + local sv = rawget(t, "profile") + local dv = rawget(t, "defaults") + local src = dv and dv[k] + if(not sv[k]) then sv[k] = {} end + if(src) then + tablecopy(sv[k], src) + end + rawset(t, k, sv[k]) + return rawget(t, k) + end, } local METAPROFILE = function(sv) - local db = setmetatable({}, metadatabase) + local db = setmetatable({}, metadatabase) - db.profile = sv - db.defaults = DefaultSettings - db.Init = initializedata - db.Append = insertdata - db.Reset = resetprofile - db.SetDefault = setdefaults - db.GetDefault = getdefaults - db.Import = importprompt - db.Export = exportprofile - db.Remove = removeprofile + db.profile = sv + db.defaults = CONFIGS + db.Init = initializedata + db.Append = insertdata + db.Reset = resetprofile + db.SetDefault = setdefaults + db.GetDefault = getdefaults + db.Import = importprompt + db.Export = exportprofile + db.Remove = removeprofile + + return db +end - return db +function SuperVillain:AppendDefaults(newIndex, newData) + self.Configs[newIndex] = newData end function SuperVillain:GetProfiles() - return G.profileKeys or {} + return self.Global.profileKeys or {} end function SuperVillain:CheckProfiles() - local hasProfile = false - local list = G.profileKeys or {} - for key,_ in pairs(list) do - hasProfile = true - end - return hasProfile + local hasProfile = false + local list = self.Global.profileKeys or {} + for key,_ in pairs(list) do + hasProfile = true + end + return hasProfile end function SuperVillain:HexColor(arg1,arg2,arg3) - local r,g,b; - if arg1 and type(arg1) == "string" then - local t - if(self.Media or self.db.media) then - t = self.Media.color[arg1] or self.db.media.unitframes[arg1] - else - t = DefaultSettings.media.colors[arg1] or DefaultSettings.media.unitframes[arg1] - end - if t then - r,g,b = t[1],t[2],t[3] - else - r,g,b = 0,0,0 - end - else - r = type(arg1) == "number" and arg1 or 0; - g = type(arg2) == "number" and arg2 or 0; - b = type(arg3) == "number" and arg3 or 0; - end - r = (r < 0 or r > 1) and 0 or (r * 255) - g = (g < 0 or g > 1) and 0 or (g * 255) - b = (b < 0 or b > 1) and 0 or (b * 255) - local hexString = ("|cff%02x%02x%02x"):format(r,g,b) - return hexString + local r,g,b; + if arg1 and type(arg1) == "string" then + local t + if(self.Media or self.db.media) then + t = self.Media.color[arg1] or self.db.media.unitframes[arg1] + else + t = self.Configs.media.colors[arg1] or self.Configs.media.unitframes[arg1] + end + if t then + r,g,b = t[1],t[2],t[3] + else + r,g,b = 0,0,0 + end + else + r = type(arg1) == "number" and arg1 or 0; + g = type(arg2) == "number" and arg2 or 0; + b = type(arg3) == "number" and arg3 or 0; + end + r = (r < 0 or r > 1) and 0 or (r * 255) + g = (g < 0 or g > 1) and 0 or (g * 255) + b = (b < 0 or b > 1) and 0 or (b * 255) + local hexString = ("|cff%02x%02x%02x"):format(r,g,b) + return hexString end function SuperVillain:TableSplice(targetTable, mergeTable) @@ -4159,24 +1127,24 @@ function SuperVillain:TableSplice(targetTable, mergeTable) end function SuperVillain:SetDatabaseObjects(init) - if(init) then - self.db = tcopy(DefaultSettings, true) - else - G = self:TableSplice(SVUI_Global, G) - G.profileKeys = {} - for k,v in pairs(G.profiles) do - G.profileKeys[k] = k - end + if(init) then + self.db = tcopy(self.Configs, true) + else + self.Global = self:TableSplice(SVUI_Global, self.Global) + self.Global.profileKeys = {} + for k,v in pairs(self.Global.profiles) do + self.Global.profileKeys[k] = k + end - local sv = _G["SVUI_Profile"] + local sv = _G["SVUI_Profile"] - twipe(self.db) + twipe(self.db) - self.db = METAPROFILE(sv) - self.db:Init() - self.db.profileKey = pkey + self.db = METAPROFILE(sv) + self.db:Init() + self.db.profileKey = pkey - logoutListener:RegisterEvent("PLAYER_LOGOUT") - logoutListener:SetScript("OnEvent", LogOut_OnEvent) - end + logoutListener:RegisterEvent("PLAYER_LOGOUT") + logoutListener:SetScript("OnEvent", LogOut_OnEvent) + end end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/deepcopy.lua b/Interface/AddOns/SVUI/system/deepcopy.lua new file mode 100644 index 0000000..5354fa9 --- /dev/null +++ b/Interface/AddOns/SVUI/system/deepcopy.lua @@ -0,0 +1,264 @@ +do + local type = rawtype or type + local rawget = rawget + local rawset = rawset + local next = rawnext or next + local getmetatable = debug and debug.getmetatable or getmetatable + local setmetatable = debug and debug.setmetatable or setmetatable + local debug_getupvalue = debug and debug.getupvalue or nil + local debug_setupvalue = debug and debug.setupvalue or nil + local debug_upvalueid = debug and debug.upvalueid or nil + local debug_upvaluejoin = debug and debug.upvaluejoin or nil + local unpack = unpack + local table = table + table.deepcopy_copyfunc_list = { + + _plainolddata = function(stack, orig, copy, state) + return orig, true + end, + ["table"] = function(stack, orig, copy, state, arg1, arg2, arg3, arg4) + local orig_prevkey, grabkey = nil, false + if state == nil then -- 'init' + -- Initial state, check for metatable, or get first key + -- orig, copy:nil, state + copy = stack[orig] + if copy ~= nil then -- Check if already copied + return copy, true + else + copy = {} -- Would be nice if you could preallocate sizes! + stack[orig] = copy + local orig_meta = getmetatable(orig) + if orig_meta ~= nil then -- This table has a metatable, copy it + if not stack.metatable_immutable then + stack:_recurse(orig_meta) + return copy, 'metatable' + else + setmetatable(copy, orig_meta) + end + end + end + -- No metatable, go straight to copying key-value pairs + orig_prevkey = nil -- grab first key + grabkey = true --goto grabkey + elseif state == 'metatable' then + -- Metatable has been copied, set it and get first key + -- orig, copy:{}, state, metaorig, metacopy + local copy_meta = arg2--select(2, ...) + stack:_pop(2) + + if copy_meta ~= nil then + setmetatable(copy, copy_meta) + end + + -- Now start copying key-value pairs + orig_prevkey = nil -- grab first key + grabkey = true --goto grabkey + elseif state == 'key' then + -- Key has been copied, now copy value + -- orig, copy:{}, state, keyorig, keycopy + local orig_key = arg1--select(1, ...) + local copy_key = arg2--select(2, ...) + + if copy_key ~= nil then + -- leave keyorig and keycopy on the stack + local orig_value = rawget(orig, orig_key) + stack:_recurse(orig_value) + return copy, 'value' + else -- key not copied? move onto next + stack:_pop(2) -- pop keyorig, keycopy + orig_prevkey = orig_key + grabkey = true--goto grabkey + end + elseif state == 'value' then + -- Value has been copied, set it and get next key + -- orig, copy:{}, state, keyorig, keycopy, valueorig, valuecopy + local orig_key = arg1--select(1, ...) + local copy_key = arg2--select(2, ...) + --local orig_value = arg3--select(3, ...) + local copy_value = arg4--select(4, ...) + stack:_pop(4) + + if copy_value ~= nil then + rawset(copy, copy_key, copy_value) + end + + -- Grab next key to copy + orig_prevkey = orig_key + grabkey = true --goto grabkey + end + --return + --::grabkey:: + if grabkey then + local orig_key, orig_value = next(orig, orig_prevkey) + if orig_key ~= nil then + stack:_recurse(orig_key) -- Copy key + return copy, 'key' + else + return copy, true -- Key is nil, copying of table is complete + end + end + return + end, + ["function"] = function(stack, orig, copy, state, arg1, arg2, arg3) + local grabupvalue, grabupvalue_idx = false, nil + if state == nil then + -- .., orig, copy, state + copy = stack[orig] + if copy ~= nil then + return copy, true + elseif stack.function_immutable then + copy = orig + return copy, true + else + copy = loadstring(string.dump(orig), nil, nil, stack.function_env) + stack[orig] = copy + + if debug_getupvalue ~= nil and debug_setupvalue ~= nil then + grabupvalue = true + grabupvalue_idx = 1 + else + -- No way to get/set upvalues! + return copy, true + end + end + elseif this_state == 'upvalue' then + -- .., orig, copy, state, uvidx, uvvalueorig, uvvaluecopy + local orig_upvalue_idx = arg1 + --local orig_upvalue_value = arg2 + local copy_upvalue_value = arg3 + stack:_pop(3) + + debug_setupvalue(copy, orig_upvalue_idx, copy_upvalue_value) + + grabupvalue_idx = orig_upvalue_idx+1 + stack:_push(grabupvalue_idx) + grabupvalue = true + end + if grabupvalue then + -- .., orig, copy, retto, state, uvidx + local upvalue_idx_curr = grabupvalue_idx + for upvalue_idx = upvalue_idx_curr, math.huge do + local upvalue_name, upvalue_value_orig = debug_getupvalue(orig, upvalue_idx) + if upvalue_name ~= nil then + local upvalue_handled = false + if not stack.function_upvalue_isolate and debug_upvalueid ~= nil and debug_upvaluejoin ~= nil then + local upvalue_uid = debug.upvalueid(orig, upvalue_idx) + -- Attempting to store an upvalueid of a function as a child of root is UB! + local other_orig = stack[upvalue_uid] + if other_orig ~= nil then + for other_upvalue_idx = 1, math.huge do + if upvalue_uid == debug_upvalueid(other_orig, other_upvalue_idx) then + local other_copy = stack[other_orig] + debug_upvaluejoin( + copy, upvalue_idx, + other_copy, other_upvalue_idx + ) + break + end + end + upvalue_handled = true + else + stack[upvalue_uid] = orig + end + end + if not stack.function_upvalue_dontcopy and not upvalue_handled and upvalue_value_orig ~= nil then + stack:_recurse(upvalue_value_orig) + return copy, 'upvalue' + end + else + stack:_pop(1) -- pop uvidx + return copy, true + end + end + end + end, + ["userdata"] = nil, + ["lightuserdata"] = nil, + ["thread"] = nil, + } + table.deepcopy_copyfunc_list["number" ] = table.deepcopy_copyfunc_list._plainolddata + table.deepcopy_copyfunc_list["string" ] = table.deepcopy_copyfunc_list._plainolddata + table.deepcopy_copyfunc_list["boolean"] = table.deepcopy_copyfunc_list._plainolddata + -- `nil` should never be encounted... but just in case: + table.deepcopy_copyfunc_list["nil" ] = table.deepcopy_copyfunc_list._plainolddata + + do + local ORIG, COPY, RETTO, STATE, SIZE = 0, 1, 2, 3, 4 + function table.deepcopy_push(...) + local arg_list_len = select('#', ...) + local stack_offset = stack._top+1 + for arg_i = 1, arg_list_len do + stack[stack_offset+arg_i] = select(arg_i, ...) + end + stack._top = stack_top+arg_list_len + end + function table.deepcopy_pop(stack, count) + stack._top = stack._top-count + end + function table.deepcopy_recurse(stack, orig) + local retto = stack._ptr + local stack_top = stack._top + local stack_ptr = stack_top+1 + stack._top = stack_top+SIZE + stack._ptr = stack_ptr + stack[stack_ptr+ORIG ] = orig + stack[stack_ptr+COPY ] = nil + stack[stack_ptr+RETTO] = retto + stack[stack_ptr+STATE] = nil + end + function table.deepcopy(root, params, customcopyfunc_list) + local stack = params or {} + --orig,copy,retto,state,[temp...,] partorig,partcopy,partretoo,partstate + stack[1+ORIG ] = root stack[1+COPY ] = nil + stack[1+RETTO] = nil stack[1+STATE] = nil + stack._ptr = 1 stack._top = 4 + stack._push = table.deepcopy_push stack._pop = table.deepcopy_pop + stack._recurse = table.deepcopy_recurse + + local copyfunc_list = table.deepcopy_copyfunc_list + repeat + local stack_ptr = stack._ptr + local this_orig = stack[stack_ptr+ORIG] + local this_copy, this_state + stack[0] = stack[0] + if stack.value_ignore and stack.value_ignore[this_orig] then + this_copy = nil + this_state = true --goto valuefound + else + if stack.value_translate then + this_copy = stack.value_translate[this_orig] + if this_copy ~= nil then + this_state = true --goto valuefound + end + end + if not this_state then + local this_orig_type = type(this_orig) + local copyfunc = ( + customcopyfunc_list and customcopyfunc_list[this_orig_type] + or copyfunc_list[this_orig_type] + or error(("cannot copy type %q"):format(this_orig_type), 2) + ) + this_copy, this_state = copyfunc( + stack, + this_orig, + stack[stack_ptr+COPY], + unpack(stack--[[_dbg]], stack_ptr+STATE, stack._top) + ) + end + end + stack[stack_ptr+COPY] = this_copy + --::valuefound:: + if this_state == true then + local retto = stack[stack_ptr+RETTO] + stack._top = stack_ptr+1 -- pop retto, state, temp... + -- Leave orig and copy on stack for parent object + stack_ptr = retto -- return to parent's stack frame + stack._ptr = stack_ptr + else + stack[stack_ptr+STATE] = this_state + end + until stack_ptr == nil + return stack[1+COPY] + end + end +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/installer.lua b/Interface/AddOns/SVUI/system/installer.lua index b0a193a..8cc9918 100644 --- a/Interface/AddOns/SVUI/system/installer.lua +++ b/Interface/AddOns/SVUI/system/installer.lua @@ -36,7 +36,7 @@ local SuperVillain, L = unpack(select(2, ...)); LOCAL VARS ########################################################## ]]-- -local CURRENT_PAGE, MAX_PAGE, XOFF = 0, 8, (GetScreenWidth() * 0.025) +local CURRENT_PAGE, MAX_PAGE, XOFF = 0, 9, (GetScreenWidth() * 0.025) local okToResetMOVE = false local mungs = false; local user_music_vol; @@ -77,18 +77,24 @@ local function forceCVars() SetCVar('SpamFilter',0) InterfaceOptionsActionBarsPanelPickupActionKeyDropDown:SetValue('SHIFT') InterfaceOptionsActionBarsPanelPickupActionKeyDropDown:RefreshValue() -end +end + +local function ShowLayout(show40) + if(show40 and _G["SVUI_Raid40"].forceShow == true) then return end + if(not show40 and _G["SVUI_Raid40"].forceShow ~= true) then return end + SuperVillain.SVUnit:UpdateGroupConfig(_G["SVUI_Raid40"], show40) +end local function BarShuffle() local bar2 = SuperVillain.db.SVBar.Bar2.enable; local base = 30; local bS = SuperVillain.db.SVBar.Bar1.buttonspacing; - local tH = SuperVillain.db.SVBar.Bar1.buttonsize + base; + local tH = SuperVillain.db.SVBar.Bar1.buttonsize + (base - bS); local b2h = bar2 and tH or base; local sph = (400 - b2h); if not SuperVillain.db.framelocations then SuperVillain.db.framelocations = {} end SuperVillain.db.framelocations.SVUI_SpecialAbility_MOVE = "BOTTOMSVUIParentBOTTOM0"..sph; - SuperVillain.db.framelocations.SVUI_ActionBar2_MOVE = "BOTTOMSVUI_ActionBar1TOP04"; + SuperVillain.db.framelocations.SVUI_ActionBar2_MOVE = "BOTTOMSVUI_ActionBar1TOP0"..(-bS); SuperVillain.db.framelocations.SVUI_ActionBar3_MOVE = "BOTTOMLEFTSVUI_ActionBar1BOTTOMRIGHT40"; SuperVillain.db.framelocations.SVUI_ActionBar5_MOVE = "BOTTOMRIGHTSVUI_ActionBar1BOTTOMLEFT-40"; if bar2 then @@ -370,6 +376,7 @@ function SuperVillain:SetUserScreen(rez, preserve) self:SetSVMovablesPositions() self.Registry:Update('SVDock') self.Registry:Update('SVAura') + self.Registry:Update('SVBar') self.Registry:Update('SVUnit') SuperVillain:SavedPopup() end @@ -439,6 +446,20 @@ function SuperVillain:SetUnitframeLayout(style, preserve) end end +function SuperVillain:SetGroupframeLayout(style, preserve) + style = style or "default"; + + local presets = self:LoadPresetData("layouts", style) + self.db.SAFEDATA.groupstyle = style + + if(not mungs) then + self.Registry:Update('SVUnit') + if(not preserve) then + SuperVillain:SavedPopup() + end + end +end + function SuperVillain:SetupBarLayout(style, preserve) style = style or "default"; @@ -500,7 +521,7 @@ local function PlayThemeSong() end local function InstallComplete() - SVUI_Profile.SAFEDATA.install_version = SuperVillain.version; + SVUI_Profile.SAFEDATA.install_version = SuperVillain.___ver; StopMusic() SetCVar("Sound_MusicVolume",user_music_vol) okToResetMOVE = false; @@ -515,10 +536,11 @@ local function InstallMungsChoice() SuperVillain:SetColorTheme(); SuperVillain.db.SAFEDATA.unitstyle = nil; SuperVillain:SetUnitframeLayout(); + SuperVillain.db.SAFEDATA.groupstyle = nil; SuperVillain.db.SAFEDATA.barstyle = nil; SuperVillain:SetupBarLayout(); SuperVillain:SetupAuralayout(); - SVUI_Profile.SAFEDATA.install_version = SuperVillain.version; + SVUI_Profile.SAFEDATA.install_version = SuperVillain.___ver; StopMusic() SetCVar("Sound_MusicVolume",user_music_vol) ReloadUI() @@ -580,13 +602,13 @@ local function SetPage(newPage) LFGWIZARD_TITLE CONTINUE ]]-- - + ShowLayout() if newPage == 1 then local hasOldConfig = SVUI_Profile.SAFEDATA.install_version SVUI_InstallPrevButton:Disable() SVUI_InstallPrevButton:Hide() okToResetMOVE = true - setupFrame.SubTitle:SetText(format(L["This is Supervillain UI version %s!"], SuperVillain.version)) + setupFrame.SubTitle:SetText(format(L["This is Supervillain UI version %s!"], SuperVillain.___ver)) setupFrame.Desc1:SetText(L["Before I can turn you loose, persuing whatever villainy you feel will advance your professional career... I need to ask some questions and turn a few screws first."]) setupFrame.Desc2:SetText(L["At any time you can get to the config options by typing the command / sv. For quick changes to frame, bar or color sets, call your henchman by clicking the button on the bottom right of your screen. (Its the one with his stupid face on it)"]) setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) @@ -682,6 +704,7 @@ local function SetPage(newPage) SVUI_InstallOption4Button:SetText(L["Vintage"]) elseif newPage == 5 then + ShowLayout(true) setupFrame.SubTitle:SetText(UNITFRAME_LABEL.." "..SETTINGS) setupFrame.Desc1:SetText(L["You can now choose what primary unitframe style you wish to use."]) setupFrame.Desc2:SetText(L["This will change the layout of your unitframes (ie.. Player, Target, Pet, Party, Raid ...etc)."]) @@ -713,8 +736,42 @@ local function SetPage(newPage) SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["you dont need no fanciness getting in the way of world domination do you?"]) end) SVUI_InstallOption3Button:SetText(L["Compact"]) - + elseif newPage == 6 then + ShowLayout(true) + setupFrame.SubTitle:SetText("Group Layout") + setupFrame.Desc1:SetText(L["You can now choose what group layout you prefer."]) + setupFrame.Desc2:SetText(L["This will adjust various settings on group units, attempting to make certain roles more usable"]) + setupFrame.Desc3:SetText(L["CHOOSE_OR_DIE"]) + SVUI_InstallOption1Button:Show() + SVUI_InstallOption1Button:SetScript("OnClick", function() + SuperVillain.db.SAFEDATA.groupstyle = "default"; + SuperVillain:SetGroupframeLayout("default") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFStandard|r"]) + SVUI_SetupHolder.Desc2:SetText(L["You are good to go with the default layout"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["frames schmames, lets kill some stuff!"]) + end) + SVUI_InstallOption1Button:SetText(L["Standard"]) + SVUI_InstallOption2Button:Show() + SVUI_InstallOption2Button:SetScript("OnClick", function() + SuperVillain.db.SAFEDATA.groupstyle = nil; + SuperVillain:SetGroupframeLayout("healer") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFMEDIC!!|r"]) + SVUI_SetupHolder.Desc2:SetText(L["You are pretty helpful.. for a VILLAIN!"]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["Hey, even a super villain gets his ass kicked once in awhile. We need the likes of you!"]) + end) + SVUI_InstallOption2Button:SetText(L["Healer"]) + SVUI_InstallOption3Button:Show() + SVUI_InstallOption3Button:SetScript("OnClick", function() + SuperVillain.db.SAFEDATA.groupstyle = nil; + SuperVillain:SetGroupframeLayout("dps") + SVUI_SetupHolder.Desc1:SetText(L["|cff00FFFFDeath Dealer|r"]) + SVUI_SetupHolder.Desc2:SetText(L["You are the kings of our craft. Handing out pain like its halloween candy."]..CONTINUED) + SVUI_SetupHolder.Desc3:SetText(CONTINUED..L["I will move and squeeze group frames out of your way so you have more room for BOOM!"]) + end) + SVUI_InstallOption3Button:SetText(L["DPS"]) + + elseif newPage == 7 then setupFrame.SubTitle:SetText(ACTIONBAR_LABEL.." "..SETTINGS) setupFrame.Desc1:SetText(L["Choose a layout for your action bars."]) setupFrame.Desc2:SetText(L["Sometimes you need big buttons, sometimes you don't. Your choice here."]) @@ -756,7 +813,7 @@ local function SetPage(newPage) end) SVUI_InstallOption4Button:SetText(L["2 Big" .. "\n" .. "Rows"]) - elseif newPage == 7 then + elseif newPage == 8 then setupFrame.SubTitle:SetText(AURAS.." "..SETTINGS) setupFrame.Desc1:SetText(L["Select an aura layout. \"Icons\" will display only icons and aurabars won't be used. \"Bars\" will display only aurabars and icons won't be used (duh). \"The Works!\" does just what it says.... icons, bars and awesomeness."]) setupFrame.Desc2:SetText(L["If you have an aura that you don't want to display simply hold down shift and right click the icon for it to suffer a painful death."]) @@ -786,7 +843,7 @@ local function SetPage(newPage) end) SVUI_InstallOption4Button:SetText(L["The" .. "\n" .. "Works!"]) - elseif newPage == 8 then + elseif newPage == 9 then SVUI_InstallNextButton:Disable() SVUI_InstallNextButton:Hide() setupFrame.SubTitle:SetText(BASIC_OPTIONS_TOOLTIP..CONTINUED..AUCTION_TIME_LEFT0) @@ -814,9 +871,6 @@ local function PreviousPage() end local function ResetGlobalVariables() - for k,v in pairs(SVUI_Filters) do - SVUI_Filters[k] = nil - end for k,v in pairs(SVUI_Cache) do SVUI_Cache[k] = nil end @@ -857,7 +911,7 @@ function SuperVillain:ResetInstallation() SuperVillain:SetupAuralayout() end - SVUI_Profile.SAFEDATA.install_version = SuperVillain.version; + SVUI_Profile.SAFEDATA.install_version = SuperVillain.___ver; ResetGlobalVariables() ReloadUI() end diff --git a/Interface/AddOns/SVUI/system/mentalo.lua b/Interface/AddOns/SVUI/system/mentalo.lua index f22bae0..9a5e00e 100644 --- a/Interface/AddOns/SVUI/system/mentalo.lua +++ b/Interface/AddOns/SVUI/system/mentalo.lua @@ -412,7 +412,7 @@ local function SetSVMovable(frame, moveName, title, raised, snap, dragStopFunc) movable.overlay = raised; movable.snapOffset = snap or -2; SuperVillain.MentaloFrames[moveName].Avatar = movable; - SuperVillain["snaps"][#SuperVillain["snaps"] + 1] = movable; + SuperVillain["Snap"][#SuperVillain["Snap"] + 1] = movable; if raised == true then movable:SetFrameStrata("DIALOG") else @@ -436,7 +436,7 @@ local function SetSVMovable(frame, moveName, title, raised, snap, dragStopFunc) movable:SetScript("OnDragStart", function(this) if InCombatLockdown()then SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT)return end if SuperVillain.db["system"].stickyFrames then - Sticky:StartMoving(this, SuperVillain["snaps"], movable.snapOffset, movable.snapOffset, movable.snapOffset, movable.snapOffset) + Sticky:StartMoving(this, SuperVillain["Snap"], movable.snapOffset, movable.snapOffset, movable.snapOffset, movable.snapOffset) else this:StartMoving() end diff --git a/Interface/AddOns/SVUI/system/presets.lua b/Interface/AddOns/SVUI/system/presets.lua index 3cba839..e7c4380 100644 --- a/Interface/AddOns/SVUI/system/presets.lua +++ b/Interface/AddOns/SVUI/system/presets.lua @@ -362,13 +362,13 @@ local presets = { }, ["Bar3"] = { buttons = 6, - buttonspacin3, + buttonspacing = 2, buttonsPerRow = 6, buttonsize = 40 }, ["Bar5"] = { buttons = 6, - buttonspacin3, + buttonspacing = 2, buttonsPerRow = 6, buttonsize = 40 } @@ -382,13 +382,13 @@ local presets = { }, ["Bar3"] = { buttons = 6, - buttonspacin2, + buttonspacing = 2, buttonsPerRow = 6, buttonsize = 32 }, ["Bar5"] = { buttons = 6, - buttonspacin2, + buttonspacing = 2, buttonsPerRow = 6, buttonsize = 32 } @@ -403,13 +403,13 @@ local presets = { }, ["Bar3"] = { buttons = 12, - buttonspacin2, + buttonspacing = 2, buttonsPerRow = 6, buttonsize = 32 }, ["Bar5"] = { buttons = 12, - buttonspacin2, + buttonspacing = 2, buttonsPerRow = 6, buttonsize = 32 } @@ -424,13 +424,13 @@ local presets = { }, ["Bar3"] = { buttons = 12, - buttonspacin3, + buttonspacing = 2, buttonsPerRow = 6, buttonsize = 40 }, ["Bar5"] = { buttons = 12, - buttonspacin3, + buttonspacing = 2, buttonsPerRow = 6, buttonsize = 40 } @@ -788,6 +788,319 @@ local presets = { wrapYOffset = 6, }, }, + }, + ["layouts"] = { + ["link"] = "SVUnit", + ["default"] = { + ["party"] = { + width = 75, + height = 60, + gridMode = false, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + icons = { + roleIcon = { + ["attachTo"] = "INNERBOTTOMRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + name = { + ["font"] = "SVUI Default Font", + ["fontOutline"] = "OUTLINE", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + ["raid10"] = { + width = 50, + height = 30, + gridMode = false, + gRowCol = 1, + wrapXOffset = 9, + wrapYOffset = 13, + showBy = "RIGHT_DOWN", + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid25"] = { + width = 50, + height = 30, + gridMode = false, + gRowCol = 1, + wrapXOffset = 9, + wrapYOffset = 13, + showBy = "RIGHT_DOWN", + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid40"] = { + width = 50, + height = 30, + gridMode = false, + gRowCol = 1, + wrapXOffset = 9, + wrapYOffset = 13, + showBy = "RIGHT_DOWN", + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + }, + ["healer"] = { + ["party"] = { + width = 75, + height = 60, + gridMode = false, + wrapXOffset = 9, + wrapYOffset = 13, + portrait = { + enable = true, + overlay = true, + style = "3D", + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMRIGHT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["fontOutline"] = "OUTLINE", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 0, + ["yOffset"] = 0, + }, + }, + ["raid10"] = { + width = 50, + height = 30, + gridMode = false, + ["showBy"] = "DOWN_RIGHT", + ["gRowCol"] = 1, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = true, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid25"] = { + width = 50, + height = 30, + gridMode = false, + ["showBy"] = "DOWN_RIGHT", + ["gRowCol"] = 1, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = true, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["raid40"] = { + width = 50, + height = 30, + gridMode = false, + ["showBy"] = "DOWN_RIGHT", + ["gRowCol"] = 1, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = true, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERBOTTOMLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "SVUI Default Font", + ["position"] = "INNERTOPLEFT", + ["xOffset"] = 8, + ["yOffset"] = 0, + }, + }, + }, + ["dps"] = { + ["party"] = { + width = 115, + height = 25, + gridMode = false, + wrapXOffset = 9, + wrapYOffset = 13, + ["power"] = { + ["enable"] = false, + }, + portrait = { + enable = false, + overlay = false, + style = "2D", + width = 35, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "LEFT", + ["xOffset"] = -2, + ["yOffset"] = 0, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["fontOutline"] = "NONE", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + }, + ["raid10"] = { + ["showBy"] = "UP_RIGHT", + ["gRowCol"] = 2, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 10, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + ["width"] = 80, + ["height"] = 20, + }, + ["raid25"] = { + ["showBy"] = "UP_RIGHT", + ["gRowCol"] = 3, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 10, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + ["width"] = 80, + ["height"] = 20, + }, + ["raid40"] = { + ["showBy"] = "UP_RIGHT", + ["gRowCol"] = 4, + ["wrapXOffset"] = 4, + ["wrapYOffset"] = 4, + ["power"] = { + ["enable"] = false, + }, + ["icons"] = { + ["roleIcon"] = { + ["attachTo"] = "INNERLEFT", + ["xOffset"] = 10, + ["yOffset"] = 1, + }, + }, + ["name"] = { + ["font"] = "Roboto", + ["position"] = "CENTER", + ["xOffset"] = 0, + ["yOffset"] = 1, + }, + ["width"] = 80, + ["height"] = 20, + }, + }, } }; diff --git a/Interface/AddOns/SVUI/system/screen.lua b/Interface/AddOns/SVUI/system/screen.lua deleted file mode 100644 index fdcb663..0000000 --- a/Interface/AddOns/SVUI/system/screen.lua +++ /dev/null @@ -1,144 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local type = _G.type; -local tonumber = _G.tonumber; -local string = _G.string; -local math = _G.math; ---[[ STRING METHODS ]]-- -local match = string.match; ---[[ MATH METHODS ]]-- -local floor, abs, min, max = math.floor, math.abs, math.min, math.max; -local parsefloat = math.parsefloat; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SuperVillain, L = unpack(select(2, ...)); ---[[ -########################################################## -LOCAL VARS -########################################################## -]]-- -local scale; -local rez = GetCVar("gxResolution"); -local gxHeight = tonumber(match(rez,"%d+x(%d+)")); -local gxWidth = tonumber(match(rez,"(%d+)x%d+")); -local evalwidth ---[[ -########################################################## -CORE FUNCTIONS -########################################################## -]]-- -function SuperVillain:UIScale(event) - self.ghettoMonitor = nil; - if(IsMacClient() and SVUI_Cache and SVUI_Cache.screenheight and SVUI_Cache.screenwidth) then - if(gxHeight ~= SVUI_Cache.screenheight or gxWidth ~= SVUI_Cache.screenwidth) then - gxHeight = SVUI_Cache.screenheight; - gxWidth = SVUI_Cache.screenwidth - end - end; - - if self.db.system.autoScale then - scale = max(0.64, min(1.15, 768 / gxHeight)) - else - scale = max(0.64, min(1.15, GetCVar("uiScale") or UIParent:GetScale() or 768 / gxHeight)) - end - if gxWidth < 1600 then - self.ghettoMonitor = true; - elseif gxWidth >= 3840 then - local width = gxWidth; - local height = gxHeight; - if(self.db.system.multiMonitor) then - if width >= 9840 then width = 3280; end - if width >= 7680 and width < 9840 then width = 2560; end - if width >= 5760 and width < 7680 then width = 1920; end - if width >= 5040 and width < 5760 then width = 1680; end - if width >= 4800 and width < 5760 and height == 900 then width = 1600; end - if width >= 4320 and width < 4800 then width = 1440; end - if width >= 4080 and width < 4320 then width = 1360; end - if width >= 3840 and width < 4080 then width = 1224; end - if width < 1600 then - self.ghettoMonitor = true; - end - else - if width >= 9840 then width = 9840; end - if width >= 7680 and width < 9840 then width = 7680; end - if width >= 5760 and width < 7680 then width = 5760; end - if width >= 5040 and width < 5760 then width = 5040; end - if width >= 4800 and width < 5040 then width = 4800; end - if width >= 4320 and width < 4800 then width = 4320; end - if width >= 4080 and width < 4320 then width = 4080; end - if width >= 3840 and width < 4080 then width = 3840; end - end - - evalwidth = width; - end - - self.mult = 768 / match(GetCVar("gxResolution"), "%d+x(%d+)") / scale; - - if(parsefloat(UIParent:GetScale(),5) ~= parsefloat(scale,5) and (event == 'PLAYER_LOGIN')) then - SetCVar("useUiScale",1) - SetCVar("uiScale",scale) - WorldMapFrame.hasTaint = true; - end; - - if(event == 'PLAYER_LOGIN' or event == 'UI_SCALE_CHANGED') then - if IsMacClient() then - SVUI_Cache.screenheight = floor(GetScreenHeight() * 100 + .5) / 100 - SVUI_Cache.screenwidth = floor(GetScreenWidth() * 100 + .5) / 100 - end; - - if evalwidth then - local width = evalwidth - local height = gxHeight; - if not self.db.system.autoScale or height > 1200 then - local h = UIParent:GetHeight(); - local ratio = gxHeight / h; - local w = evalwidth / ratio; - - width = w; - height = h; - end - self.UIParent:SetSize(width, height); - else - self.UIParent:SetSize(UIParent:GetSize()); - end - - self.UIParent:ClearAllPoints() - self.UIParent:SetPoint("CENTER") - - local change = abs((parsefloat(UIParent:GetScale(),5) * 100) - (parsefloat(scale,5) * 100)) - if(event == 'UI_SCALE_CHANGED' and change > 1 and self.db.system.autoScale) then - SuperVillain:StaticPopup_Show('FAILED_UISCALE') - elseif(event == 'UI_SCALE_CHANGED' and change > 1) then - SuperVillain:StaticPopup_Show('RL_CLIENT') - end; - - SVUISystemEventHandler:UnregisterEvent('PLAYER_LOGIN') - end -end; - -function SuperVillain:Scale(value) - return self.mult * floor(value / self.mult + .5); -end; \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/slash.lua b/Interface/AddOns/SVUI/system/slash.lua index af7401a..dcd4aae 100644 --- a/Interface/AddOns/SVUI/system/slash.lua +++ b/Interface/AddOns/SVUI/system/slash.lua @@ -22,33 +22,6 @@ LOCAL VARS local lower, trim = string.lower, string.trim --[[ ########################################################## -GLOBAL SLASH FUNCTIONS -########################################################## -]]-- -function SVUIFishingMode() - if InCombatLockdown() then SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); return; end - if SuperVillain.Modes.CurrentMode and SuperVillain.Modes.CurrentMode == "Fishing" then SuperVillain.Modes:EndJobModes() else SuperVillain.Modes:SetJobMode("Fishing") end -end -function SVUIFarmingMode() - if InCombatLockdown() then SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); return; end - if SuperVillain.Modes.CurrentMode and SuperVillain.CurrentMode == "Farming" then SuperVillain.Modes:EndJobModes() else SuperVillain.Modes:SetJobMode("Farming") end -end -function SVUIArchaeologyMode() - if InCombatLockdown() then SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); return; end - if SuperVillain.Modes.CurrentMode and SuperVillain.Modes.CurrentMode == "Archaeology" then SuperVillain.Modes:EndJobModes() else SuperVillain.Modes:SetJobMode("Archaeology") end -end -function SVUICookingMode() - if InCombatLockdown() then SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); return; end - if SuperVillain.Modes.CurrentMode and SuperVillain.Modes.CurrentMode == "Cooking" then SuperVillain.Modes:EndJobModes() else SuperVillain.Modes:SetJobMode("Cooking") end -end -function SVUISayIncoming() - local subzoneText = GetSubZoneText() - local msg = ("{rt8} Incoming %s {rt8}"):format(subzoneText) - SendChatMessage(msg, "INSTANCE_CHAT") - return -end ---[[ -########################################################## LOCAL SLASH FUNCTIONS ########################################################## ]]-- @@ -63,14 +36,6 @@ local function SVUIMasterCommand(msg) SuperVillain.SVBar:ToggleKeyBindingMode() elseif (msg == "reset" or msg == "resetui") then SuperVillain:ResetAllUI() - elseif (msg == "fish" or msg == "fishing") then - SVUIFishingMode() - elseif (msg == "farm" or msg == "farming") then - SVUIFarmingMode() - elseif (msg == "cook" or msg == "cooking") then - SVUIArchaeologyMode() - elseif (msg == "dig" or msg == "survey" or msg == "archaeology") then - SVUICookingMode() elseif (msg == "bg" or msg == "pvp") then local MOD = SuperVillain.SVStats MOD.ForceHideBGStats = nil; diff --git a/Interface/AddOns/SVUI/system/system.lua b/Interface/AddOns/SVUI/system/system.lua index 9a534c6..b6179d4 100644 --- a/Interface/AddOns/SVUI/system/system.lua +++ b/Interface/AddOns/SVUI/system/system.lua @@ -51,14 +51,16 @@ local tremove, tcopy, twipe, tsort, tconcat, tdump = table.remove, table.copy, t GET ADDON DATA ########################################################## ]]-- -local SuperVillain, L, G = unpack(select(2, ...)) +local SuperVillain, L = unpack(select(2, ...)) --[[ ########################################################## LOCALS ########################################################## ]]-- -local bld = select(2,GetBuildInfo()); local toonClass = select(2,UnitClass("player")); +local playerName = UnitName("player"); +local playerRealm = GetRealmName(); + local rez = GetCVar("gxResolution"); local gxHeight = tonumber(match(rez,"%d+x(%d+)")); local gxWidth = tonumber(match(rez,"(%d+)x%d+")); @@ -66,59 +68,13 @@ local NewHook = hooksecurefunc; local version = GetAddOnMetadata(..., "Version"); --[[ ########################################################## -SET MANY VARIABLES -########################################################## -]]-- -SuperVillain.db = {} -SuperVillain.snaps = {} -SuperVillain.Media = {} -SuperVillain.DisplayAudit = {} -SuperVillain.DynamicOptions = {} -SuperVillain.Dispellable = {} - -SuperVillain.fubar = function() return end -SuperVillain.Options = { type = "group", name = "|cff339fffConfig-O-Matic|r", args = {} }; - -SuperVillain.class = toonClass; -SuperVillain.mult = 1; -SuperVillain.ClassRole = ""; -SuperVillain.name = UnitName("player"); -SuperVillain.realm = GetRealmName(); -SuperVillain.build = tonumber(bld); -SuperVillain.guid = UnitGUID('player'); -SuperVillain.ConfigurationMode = false; - -SuperVillain.snaps[#SuperVillain.snaps + 1] = SuperVillain.UIParent; -SuperVillain.UIParent = CreateFrame("Frame", "SVUIParent", UIParent); -SuperVillain.UIParent:SetFrameLevel(UIParent:GetFrameLevel()); -SuperVillain.UIParent:SetPoint("CENTER", UIParent, "CENTER"); -SuperVillain.UIParent:SetSize(UIParent:GetSize()); -SuperVillain.Cloaked = CreateFrame("Frame", nil, UIParent); -SuperVillain.Cloaked:Hide(); -local SVUISystemEventHandler = CreateFrame("Frame", "SVUISystemEventHandler") ---[[ -########################################################## -THE CLEANING LADY -########################################################## -]]-- --- local LemonPledge = 0; --- local Consuela = CreateFrame("Frame", nil) --- Consuela:RegisterAllEvents() --- Consuela:SetScript("OnEvent", function(self, event) --- LemonPledge = LemonPledge + 1 --- if (InCombatLockdown() and LemonPledge > 25000) or (not InCombatLockdown() and LemonPledge > 10000) then --- collectgarbage("collect") --- LemonPledge = 0; --- end --- end) ---[[ -########################################################## DISPEL MECHANICS ########################################################## ]]-- local droodSpell1, droodSpell2 = GetSpellInfo(110309), GetSpellInfo(4987); local RefClassRoles; local RefMagicSpec; +-- canBeTank, canBeHealer, canBeDPS = UnitGetAvailableRoles("unit") do if(toonClass == "PRIEST") then RefClassRoles = {"C", "C", "C"} @@ -187,7 +143,7 @@ function SuperVillain:DefinePlayerRole() role = "C" end end - if self.ClassRole ~= role then + if self.ClassRole ~= role and self.RoleChangedCallback then self.ClassRole = role; self.RoleChangedCallback() end @@ -205,6 +161,31 @@ end SYSTEM FUNCTIONS ########################################################## ]]-- +local function SendAddonMessage(msg, prefix) + if(type(msg) == "table") then + msg = tostring(msg) + end + + if(not msg) then return end + + if(prefix) then + local outbound = ("%s %s"):format(prefix, msg); + print(outbound) + else + print(msg) + end +end + +function SuperVillain:AddonMessage(msg) + local outbound = ("|cffffcc1a%s:|r"):format("SVUI") + SendAddonMessage(msg, outbound) +end + +function SuperVillain:ToonMessage(msg) + local outbound = ("|cffffcc1a%s:|r"):format(playerName) + SendAddonMessage(msg, outbound) +end + function SuperVillain:StaticPopup_Show(arg) if arg == "ADDON_ACTION_FORBIDDEN" then StaticPopup_Hide(arg) @@ -213,7 +194,7 @@ end function SuperVillain:ResetAllUI(confirmed) if InCombatLockdown()then - SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT) + SendAddonMessage(ERR_NOT_IN_COMBAT) return end if(not confirmed) then @@ -225,7 +206,7 @@ end function SuperVillain:ResetUI(confirmed) if InCombatLockdown()then - SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT) + SendAddonMessage(ERR_NOT_IN_COMBAT) return end if(not confirmed) then @@ -237,8 +218,8 @@ end function SuperVillain:ToggleConfig() if InCombatLockdown() then - SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT) - SVUISystemEventHandler:RegisterEvent('PLAYER_REGEN_ENABLED') + SendAddonMessage(ERR_NOT_IN_COMBAT) + self.UIParent:RegisterEvent('PLAYER_REGEN_ENABLED') return end if not IsAddOnLoaded("SVUI_ConfigOMatic") then @@ -250,7 +231,7 @@ function SuperVillain:ToggleConfig() self:StaticPopup_Show("CLIENT_UPDATE_REQUEST") end else - SuperVillain:AddonMessage("|cffff0000Error -- Addon 'SVUI_ConfigOMatic' not found or is disabled.|r") + self:AddonMessage("|cffff0000Error -- Addon 'SVUI_ConfigOMatic' not found or is disabled.|r") return end end @@ -266,35 +247,6 @@ function SuperVillain:TaintHandler(taint, sourceName, sourceFunc) end --[[ ########################################################## -REGISTRY ADDON_LOADED EVENT AND OPTIONS -########################################################## -]]-- -SuperVillain.Registry.EventHandler = CreateFrame("Frame", nil) -SuperVillain.Registry.EventHandler.__owner = Registry -SuperVillain.Registry.EventHandler:RegisterEvent("ADDON_LOADED") -SuperVillain.Registry.EventHandler:SetScript("OnEvent", addonEvent) -SuperVillain.Registry:NewPlugin("SuperVillain Plugins", function() - SuperVillain.Options.args.plugins = { - order = -10, - type = "group", - name = INFO_NAME, - guiInline = false, - args = { - pluginheader = { - order = 1, - type = "header", - name = format(INFO_HEADER, PLUGIN_VERSION), - }, - pluginlist = { - order = 2, - type = "description", - name = SuperVillain.Registry:FetchPlugins(), - }, - } - } -end) ---[[ -########################################################## ANIMATION CLASS ########################################################## ]]-- @@ -755,8 +707,6 @@ function SuperVillain:RefreshEverything(bypass) SuperVillain.UIParent:Show(); - collectgarbage("collect"); - if not bypass then self:VersionCheck() end @@ -795,7 +745,7 @@ function SuperVillain:Load() self:LoadSystemAlerts(); self.Registry:PreLoadPackages(); - SVUISystemEventHandler:RegisterEvent('PLAYER_REGEN_DISABLED'); + self.UIParent:RegisterEvent('PLAYER_REGEN_DISABLED'); self.AddonLoaded = true end @@ -813,28 +763,30 @@ function SuperVillain:Launch() NewHook("StaticPopup_Show", self.StaticPopup_Show) - SVUISystemEventHandler:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED"); - SVUISystemEventHandler:RegisterEvent("PLAYER_TALENT_UPDATE"); - SVUISystemEventHandler:RegisterEvent("CHARACTER_POINTS_CHANGED"); - SVUISystemEventHandler:RegisterEvent("UNIT_INVENTORY_CHANGED"); - SVUISystemEventHandler:RegisterEvent("UPDATE_BONUS_ACTIONBAR"); - SVUISystemEventHandler:RegisterEvent("UI_SCALE_CHANGED"); - SVUISystemEventHandler:RegisterEvent("PLAYER_ENTERING_WORLD"); - SVUISystemEventHandler:RegisterEvent("PET_BATTLE_CLOSE"); - SVUISystemEventHandler:RegisterEvent("PET_BATTLE_OPENING_START"); - SVUISystemEventHandler:RegisterEvent("ADDON_ACTION_BLOCKED"); - SVUISystemEventHandler:RegisterEvent("ADDON_ACTION_FORBIDDEN"); - SVUISystemEventHandler:RegisterEvent("SPELLS_CHANGED"); + self.UIParent:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED"); + self.UIParent:RegisterEvent("PLAYER_TALENT_UPDATE"); + self.UIParent:RegisterEvent("CHARACTER_POINTS_CHANGED"); + self.UIParent:RegisterEvent("UNIT_INVENTORY_CHANGED"); + self.UIParent:RegisterEvent("UPDATE_BONUS_ACTIONBAR"); + self.UIParent:RegisterEvent("UI_SCALE_CHANGED"); + self.UIParent:RegisterEvent("PLAYER_ENTERING_WORLD"); + self.UIParent:RegisterEvent("PET_BATTLE_CLOSE"); + self.UIParent:RegisterEvent("PET_BATTLE_OPENING_START"); + self.UIParent:RegisterEvent("ADDON_ACTION_BLOCKED"); + self.UIParent:RegisterEvent("ADDON_ACTION_FORBIDDEN"); + self.UIParent:RegisterEvent("SPELLS_CHANGED"); self.Registry:Update("SVMap"); self.Registry:Update("SVUnit", true); + collectgarbage("collect") _G["SVUI_Mentalo"]:SetFixedPanelTemplate("Component") _G["SVUI_Mentalo"]:SetPanelColor("yellow") _G["SVUI_MentaloPrecision"]:SetPanelTemplate("Transparent") - if self.db.system.loginmessage then - self:AddonMessage((L["LOGIN_MSG"]):format("|cffffcc1a", "|cffff801a", self.version)); + if self.db.system.loginmessage then + local logMsg = (L["LOGIN_MSG"]):format("|cffffcc1a", "|cffff801a", self.___ver) + self:AddonMessage(logMsg); end self.AddonLaunched = true @@ -845,6 +797,18 @@ EVENT HANDLERS ########################################################## ]]-- local SVUISystem_OnEvent = function(self, event, arg, ...) + if(event == "ADDON_LOADED" and arg == "SVUI") then + if(not SuperVillain.AddonLoaded) then + SuperVillain:Load() + self:UnregisterEvent("ADDON_LOADED") + end + end + if(event == "PLAYER_LOGIN") then + if(not SuperVillain.AddonLaunched and IsLoggedIn()) then + SuperVillain:Launch() + self:UnregisterEvent("PLAYER_LOGIN") + end + end if(event == "ACTIVE_TALENT_GROUP_CHANGED" or event == "PLAYER_TALENT_UPDATE" or event == "CHARACTER_POINTS_CHANGED" or event == "UNIT_INVENTORY_CHANGED" or event == "UPDATE_BONUS_ACTIONBAR") then SuperVillain:DefinePlayerRole() elseif(event == "UI_SCALE_CHANGED") then @@ -863,7 +827,6 @@ local SVUISystem_OnEvent = function(self, event, arg, ...) SuperVillain:RemoveLoop(SuperVillain.BGTimer) SuperVillain.BGTimer = nil end - collectgarbage("collect") elseif(event == "SPELLS_CHANGED") then if (toonClass ~= "DRUID") then self:UnregisterEvent("SPELLS_CHANGED") @@ -904,28 +867,29 @@ local SVUISystem_OnEvent = function(self, event, arg, ...) forceClosed = true; end if forceClosed == true then - SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT) + SendAddonMessage(ERR_NOT_IN_COMBAT) end elseif(event == "PLAYER_REGEN_ENABLED") then SuperVillain:ToggleConfig() self:UnregisterEvent('PLAYER_REGEN_ENABLED') end end -SVUISystemEventHandler:SetScript("OnEvent", SVUISystem_OnEvent) - --- Load/Creation Handling -local LoadEventHandler = CreateFrame("Frame", nil) -local LoadEventHandler_OnEvent = function(self, event, arg1) - if (event == "ADDON_LOADED" and arg1 ~= "Blizzard_DebugTools") or event == "PLAYER_LOGIN" then - if(not SuperVillain.AddonLoaded) then - SuperVillain:Load() - end - if(not SuperVillain.AddonLaunched and IsLoggedIn()) then - SuperVillain:Launch() - end - end -end -LoadEventHandler:RegisterEvent("ADDON_LOADED") -LoadEventHandler:RegisterEvent("PLAYER_LOGIN") -LoadEventHandler:SetScript("OnEvent", LoadEventHandler_OnEvent) \ No newline at end of file +SuperVillain.UIParent:RegisterEvent("ADDON_LOADED") +SuperVillain.UIParent:RegisterEvent("PLAYER_LOGIN") +SuperVillain.UIParent:SetScript("OnEvent", SVUISystem_OnEvent) +--[[ +########################################################## +THE CLEANING LADY +########################################################## +]]-- +-- local LemonPledge = 0; +-- local Consuela = CreateFrame("Frame", nil) +-- Consuela:RegisterAllEvents() +-- Consuela:SetScript("OnEvent", function(self, event) +-- LemonPledge = LemonPledge + 1 +-- if (InCombatLockdown() and LemonPledge > 25000) or (not InCombatLockdown() and LemonPledge > 10000) then +-- collectgarbage("collect") +-- LemonPledge = 0; +-- end +-- end) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/templates.lua b/Interface/AddOns/SVUI/system/templates.lua deleted file mode 100644 index 3403dac..0000000 --- a/Interface/AddOns/SVUI/system/templates.lua +++ /dev/null @@ -1,1217 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local select = _G.select; -local pairs = _G.pairs; -local ipairs = _G.ipairs; -local type = _G.type; -local error = _G.error; -local pcall = _G.pcall; -local tostring = _G.tostring; -local tonumber = _G.tonumber; -local table = _G.table; -local string = _G.string; ---[[ STRING METHODS ]]-- -local lower = string.lower; ---[[ TABLE METHODS ]]-- -local tremove, tcopy, twipe, tsort, tconcat, tdump = table.remove, table.copy, table.wipe, table.sort, table.concat, table.dump; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SuperVillain, L = unpack(select(2, ...)) ---[[ -########################################################## -LOCAL VARS -########################################################## -]]-- -local TemplateUpdateFrames = {}; -local FontUpdateFrames = {}; - -local NewFrame = CreateFrame; -local NewHook = hooksecurefunc; -local screenMod = SuperVillain.mult; -local STANDARD_TEXT_FONT = _G.STANDARD_TEXT_FONT ---[[ -########################################################## -APPENDED POSITIONING METHODS -########################################################## -]]-- -local function UserScale(value) - return screenMod * floor(value / screenMod + .5); -end - -local function Size(self,width,height) - if not self then return end - self:SetSize(UserScale(width),UserScale(height or width)) -end - -local function Width(self,b) - if not self then return end - self:SetWidth(UserScale(b)) -end - -local function Height(self,c) - if not self then return end - self:SetHeight(UserScale(c)) -end - -local function Point(self, ...) - local arg1, arg2, arg3, arg4, arg5 = select(1, ...) - if not self then return end - local params = { arg1, arg2, arg3, arg4, arg5 } - for i = 1, #params do - if type(params[i]) == "number" then - params[i] = UserScale(params[i]) - end - end - self:SetPoint(unpack(params)) -end - -local function WrapOuter(self, target, x, y) - x = UserScale(x or 1); - y = UserScale(y or x); - target = target or self:GetParent() - if self:GetPoint() then - self:ClearAllPoints() - end - self:SetPoint("TOPLEFT", target, "TOPLEFT", -x, y) - self:SetPoint("BOTTOMRIGHT", target, "BOTTOMRIGHT", x, -y) -end - -local function FillInner(self, target, x, y) - x = UserScale(x or 1); - y = UserScale(y or x); - target = target or self:GetParent() - if self:GetPoint() then - self:ClearAllPoints() - end - self:SetPoint("TOPLEFT", target, "TOPLEFT", x, -y) - self:SetPoint("BOTTOMRIGHT", target, "BOTTOMRIGHT", -x, y) -end ---[[ -########################################################## -APPENDED DESTROY METHODS -########################################################## -]]-- --- MUNG ( Modify - Until - No - Good ) -local MUNGFRAME = NewFrame("Frame", nil) -MUNGFRAME:Hide() - -local function MUNG(self) - if self.UnregisterAllEvents then - self:UnregisterAllEvents() - self:SetParent(MUNGFRAME) - else - self:Hide() - self.Show = SuperVillain.fubar - end -end - -local function Formula409(self, option) - for i = 1, self:GetNumRegions()do - local target = select(i, self:GetRegions()) - if(target and (target:GetObjectType() == "Texture")) then - if(option and (type(option) == "boolean")) then - if target.UnregisterAllEvents then - target:UnregisterAllEvents() - target:SetParent(MUNGFRAME) - else - target.Show = target.Hide - end - target:Hide() - elseif(target:GetDrawLayer() == option) then - target:SetTexture(nil) - elseif(option and (type(option) == "string") and (target:GetTexture() ~= option)) then - target:SetTexture(nil) - else - target:SetTexture(nil) - end - end - end -end ---[[ -########################################################## -APPENDED FONT TEMPLATING METHODS -########################################################## -]]-- -local function SetFontTemplate(self, font, fontSize, fontStyle, fontJustifyH, fontJustifyV, noUpdate) - local STANDARDFONTSIZE = SuperVillain.db.media.fonts.size - font = font or STANDARD_TEXT_FONT - fontSize = fontSize or STANDARDFONTSIZE; - fontJustifyH = fontJustifyH or "CENTER"; - fontJustifyV = fontJustifyV or "MIDDLE"; - self.font = font; - self.fontSize = fontSize; - self.fontStyle = fontStyle; - self.fontJustifyH = fontJustifyH; - self.fontJustifyV = fontJustifyV; - self:SetFont(font, fontSize, fontStyle) - if(fontStyle and fontStyle ~= "NONE") then - self:SetShadowColor(0, 0, 0, 0) - else - self:SetShadowColor(0, 0, 0, 0.2) - end - self:SetShadowOffset(1, -1) - self:SetJustifyH(fontJustifyH) - self:SetJustifyV(fontJustifyV) - self.useCommon = fontSize and (fontSize == STANDARDFONTSIZE); - if(not noUpdate) then - FontUpdateFrames[self] = true - end -end ---[[ -########################################################## -FONT UPDATE CALLBACK -########################################################## -]]-- -local function FontTemplateUpdates() - local STANDARDFONTSIZE = SuperVillain.db.media.fonts.size; - for i=1, #FontUpdateFrames do - local frame = FontUpdateFrames[i] - if frame then - local fontSize = frame.useCommon and STANDARDFONTSIZE or frame.fontSize - frame:SetFont(frame.font, fontSize, frame.fontStyle) - else - FontUpdateFrames[i] = nil - end - end -end - -function SuperVillain:UpdateFontTemplates() - FontTemplateUpdates() -end - -SuperVillain.Registry:SetCallback(FontTemplateUpdates) ---[[ -########################################################## -APPENDED TEMPLATING METHODS -########################################################## -]]-- -local _templates = { - ["Default"] = { - backdrop = { - bgFile = [[Interface\BUTTONS\WHITE8X8]], - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 1, - insets = - { - left = 0, - right = 0, - top = 0, - bottom = 0, - }, - }, - color = "default", - gradient = "default", - texture = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]], - texupdate = false, - padding = 1, - shadow = false, - noupdate = false, - }, - ["Transparent"] = { - backdrop = { - bgFile = [[Interface\BUTTONS\WHITE8X8]], - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 1, - insets = - { - left = 0, - right = 0, - top = 0, - bottom = 0, - }, - }, - color = "transparent", - gradient = false, - texture = false, - texupdate = false, - padding = 1, - shadow = false, - noupdate = true, - }, - ["Component"] = { - backdrop = { - bgFile = [[Interface\BUTTONS\WHITE8X8]], - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 2, - insets = - { - left = 0, - right = 0, - top = 0, - bottom = 0, - }, - }, - color = "default", - gradient = "default", - texture = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]], - texupdate = false, - padding = 1, - shadow = true, - noupdate = false, - }, - ["Button"] = { - backdrop = { - bgFile = [[Interface\AddOns\SVUI\assets\artwork\Template\BUTTON]], - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 1, - insets = - { - left = 1, - right = 1, - top = 1, - bottom = 1, - }, - }, - color = "default", - gradient = false, - texture = false, - texupdate = false, - padding = 1, - shadow = true, - noupdate = false, - }, - ["FramedTop"] = { - backdrop = { - bgFile = [[Interface\BUTTONS\WHITE8X8]], - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 1, - insets = - { - left = 0, - right = 0, - top = 0, - bottom = 0, - }, - }, - color = "default", - gradient = "darkest2", - texture = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT2]], - texupdate = true, - padding = 1, - shadow = false, - noupdate = false, - }, - ["FramedBottom"] = { - backdrop = { - bgFile = [[Interface\BUTTONS\WHITE8X8]], - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 1, - insets = - { - left = 0, - right = 0, - top = 0, - bottom = 0, - }, - }, - color = "default", - gradient = "darkest", - texture = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]], - texupdate = true, - padding = 1, - shadow = false, - noupdate = false, - }, - ["Bar"] = { - backdrop = { - bgFile = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]], - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 1, - insets = - { - left = 0, - right = 0, - top = 0, - bottom = 0, - }, - }, - color = "transparent", - gradient = false, - texture = false, - texupdate = false, - padding = 1, - shadow = false, - noupdate = true, - }, - ["Slot"] = { - backdrop = { - bgFile = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]], - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 1, - insets = - { - left = 1, - right = 1, - top = 1, - bottom = 1, - }, - }, - color = "transparent", - gradient = false, - texture = false, - texupdate = false, - padding = 2, - shadow = true, - noupdate = true, - }, - ["Inset"] = { - backdrop = { - bgFile = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]], - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 2, - insets = - { - left = 0, - right = 0, - top = 0, - bottom = 0, - }, - }, - color = "transparent", - gradient = false, - texture = false, - texupdate = false, - padding = 2, - shadow = false, - noupdate = true, - }, - ["Comic"] = { - backdrop = { - bgFile = [[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC1]], - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 2, - insets = - { - left = 1, - right = 1, - top = 1, - bottom = 1, - }, - }, - color = "class", - gradient = "class", - texture = [[Interface\AddOns\SVUI\assets\artwork\Template\Background\COMIC1]], - texupdate = true, - padding = 2, - shadow = false, - noupdate = false, - }, - ["Container"] = { - backdrop = { - bgFile = [[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN3]], - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 2, - insets = - { - left = 1, - right = 1, - top = 1, - bottom = 1, - }, - }, - color = "special", - gradient = "special", - texture = [[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN3]], - texupdate = true, - padding = 2, - shadow = true, - noupdate = false, - }, - ["Pattern"] = { - backdrop = { - bgFile = [[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN1]], - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 2, - insets = - { - left = 1, - right = 1, - top = 1, - bottom = 1, - }, - }, - color = "special", - gradient = "special", - texture = [[Interface\AddOns\SVUI\assets\artwork\Template\Background\PATTERN1]], - texupdate = true, - padding = 2, - shadow = true, - noupdate = false, - }, - ["Halftone"] = { - backdrop = { - bgFile = [[Interface\BUTTONS\WHITE8X8]], - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 2, - insets = - { - left = 1, - right = 1, - top = 1, - bottom = 1, - }, - }, - color = "default", - gradient = "special", - texture = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]], - texupdate = true, - padding = 2, - shadow = true, - noupdate = false, - extended = [[HALFTONE]], - }, - ["Action"] = { - backdrop = { - bgFile = [[Interface\BUTTONS\WHITE8X8]], - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 2, - insets = - { - left = 1, - right = 1, - top = 1, - bottom = 1, - }, - }, - color = "default", - gradient = "special", - texture = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]], - texupdate = true, - padding = 2, - shadow = true, - noupdate = false, - extended = [[ACTION]], - }, - ["UnitLarge"] = { - backdrop = false, - color = "special", - gradient = false, - texture = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-BG1]], - texupdate = true, - padding = 0, - shadow = false, - noupdate = false, - }, - ["UnitSmall"] = { - backdrop = false, - color = "special", - gradient = false, - texture = [[Interface\AddOns\SVUI\assets\artwork\Unitframe\Background\UNIT-SMALL-BG1]], - texupdate = true, - padding = 0, - shadow = false, - noupdate = false, - } -}; ---[[ -########################################################## -INTERNAL HANDLERS -########################################################## -]]-- -local HookPanelBorderColor = function(self,r,g,b,a) - if self[1]then - self[1]:SetTexture(r,g,b,a) - self[2]:SetTexture(r,g,b,a) - self[3]:SetTexture(r,g,b,a) - self[4]:SetTexture(r,g,b,a) - if self[5]then - self[5]:SetBackdropBorderColor(r,g,b,0.5) - end - end -end - -local HookBackdrop = function(self,...) - self.Panel:SetBackdrop(...) -end - -local HookBackdropColor = function(self,...) - self.Panel:SetBackdropColor(...) -end - -local HookBackdropBorderColor = function(self,...) - self.Panel:SetBackdropBorderColor(...) -end - -local HookVertexColor = function(self,...) - self._skin:SetVertexColor(...) -end - -local HookCustomBackdrop = function(self) - local newBgFile = SuperVillain.Media.bg[self._bdtex] - local bd = { - bgFile = newBgFile, - edgeFile = [[Interface\BUTTONS\WHITE8X8]], - tile = false, - tileSize = 0, - edgeSize = 2, - insets = - { - left = 2, - right = 2, - top = 2, - bottom = 2, - }, - } - self:SetBackdrop(bd) -end ---[[ -########################################################## -TEMPLATE HELPERS -########################################################## -]]-- -local function CreatePanelTemplate(frame, templateName, underlay, noupdate, padding, xOffset, yOffset) - if(not templateName or not _templates[templateName]) then templateName = 'Default' end - local settings = _templates[templateName] - local colorName = settings.color - local gradientName = settings.gradient - local texFile = settings.texture - local hasShadow = settings.shadow - local bd = settings.backdrop - local bypass = noupdate or settings.noupdate - local bgColor = SuperVillain.Media.color[colorName] or {0.18,0.18,0.18,1} - local borderColor = {0,0,0,1} - local initLevel = 0; - - padding = padding or settings.padding or 1 - - xOffset = xOffset or 1 - yOffset = yOffset or 1 - - frame._template = templateName; - frame._color = colorName; - frame._gradient = gradientName; - frame._texture = false; - frame._noupdate = bypass; - - local panel = NewFrame('Frame', nil, frame) - panel:Point('TOPLEFT', frame, 'TOPLEFT', (xOffset * -1), yOffset) - panel:Point('BOTTOMRIGHT', frame, 'BOTTOMRIGHT', xOffset, (yOffset * -1)) - - if(padding > 0 and type(t) == 'table') then - panel[1] = panel:CreateTexture(nil,"BORDER") - panel[1]:SetTexture(0,0,0) - panel[1]:SetPoint("TOPLEFT") - panel[1]:SetPoint("BOTTOMLEFT") - panel[1]:SetWidth(padding) - panel[2] = panel:CreateTexture(nil,"BORDER") - panel[2]:SetTexture(0,0,0) - panel[2]:SetPoint("TOPRIGHT") - panel[2]:SetPoint("BOTTOMRIGHT") - panel[2]:SetWidth(padding) - panel[3] = panel:CreateTexture(nil,"BORDER") - panel[3]:SetTexture(0,0,0) - panel[3]:SetPoint("TOPLEFT") - panel[3]:SetPoint("TOPRIGHT") - panel[3]:SetHeight(padding) - panel[4] = panel:CreateTexture(nil,"BORDER") - panel[4]:SetTexture(0,0,0) - panel[4]:SetPoint("BOTTOMLEFT") - panel[4]:SetPoint("BOTTOMRIGHT") - panel[4]:SetHeight(padding) - end - - if(hasShadow) then - if(underlay) then - panel[5] = NewFrame('Frame', nil, panel) - panel[5]:Point('TOPLEFT', panel, 'TOPLEFT', -3, 3) - panel[5]:Point('BOTTOMRIGHT', panel, 'BOTTOMRIGHT', 3, -3) - else - panel[5] = NewFrame('Frame', nil, frame) - panel[5]:Point('TOPLEFT', frame, 'TOPLEFT', -3, 3) - panel[5]:Point('BOTTOMRIGHT', frame, 'BOTTOMRIGHT', 3, -3) - end - panel[5]:SetBackdrop({ - edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], - edgeSize = 3, - insets = { - left = 0, - right = 0, - top = 0, - bottom = 0 - } - }); - panel[5]:SetBackdropBorderColor(0,0,0,0.5) - local level = panel[5]:GetFrameLevel() - 1 - if(level >= 0) then - panel[5]:SetFrameLevel(level) - else - panel[5]:SetFrameLevel(0) - end - end - - frame.Panel = panel - - if(bd) then - initLevel = 1; - if(underlay) then - frame.Panel:SetBackdrop(bd) - frame.Panel:SetBackdropColor(bgColor[1],bgColor[2],bgColor[3],bgColor[4] or 1) - frame.Panel:SetBackdropBorderColor(0,0,0,1) - else - frame:SetBackdrop(bd) - frame:SetBackdropColor(bgColor[1],bgColor[2],bgColor[3],bgColor[4] or 1) - frame:SetBackdropBorderColor(0,0,0,1) - end - if(templateName ~= 'Transparent') then - NewHook(frame.Panel, "SetBackdropBorderColor", HookPanelBorderColor) - NewHook(frame, "SetBackdropBorderColor", HookBackdropBorderColor) - if(underlay) then - NewHook(frame, "SetBackdrop", HookBackdrop) - NewHook(frame, "SetBackdropColor", HookBackdropColor) - end - frame.BackdropNeedsUpdate = true - if(templateName == 'Pattern' or templateName == 'Comic') then - frame._bdtex = lower(templateName) - frame.UpdateBackdrop = HookCustomBackdrop - end - end - end - - if(texFile) then - local xyOffset = padding + 1; - if(underlay) then - frame._skin = frame.Panel:CreateTexture(nil,"BACKGROUND",nil,initLevel) - frame._skin:Point('TOPLEFT', frame.Panel, 'TOPLEFT', xyOffset, (xyOffset * -1)) - frame._skin:Point('BOTTOMRIGHT', frame.Panel, 'BOTTOMRIGHT', (xyOffset * -1), xyOffset) - else - frame._skin = frame:CreateTexture(nil,"BACKGROUND",nil,initLevel) - frame._skin:Point('TOPLEFT', frame, 'TOPLEFT', xyOffset, (xyOffset * -1)) - frame._skin:Point('BOTTOMRIGHT', frame, 'BOTTOMRIGHT', (xyOffset * -1), xyOffset) - end - - frame._skin:SetTexture(texFile) - if(gradientName and SuperVillain.Media.gradient[gradientName]) then - frame._skin:SetGradient(unpack(SuperVillain.Media.gradient[gradientName])) - else - frame._skin:SetVertexColor(bgColor[1], bgColor[2], bgColor[3], bgColor[4] or 1) - end - frame._skin:SetNonBlocking(true) - - if((not bypass) and settings.texupdate) then - frame._texture = lower(templateName) - frame.TextureNeedsUpdate = true - if(templateName == 'UnitLarge' or templateName == 'UnitSmall') then - frame.UpdateColor = HookVertexColor - frame.NoColorUpdate = true - end - end - - initLevel = 2; - end - - if(settings.extended) then - if(not underlay) then - initLevel = 0 - end - local name = settings.extended - local topLeft = frame.Panel:CreateTexture(nil, "BACKGROUND", nil, initLevel) - topLeft:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\Extended\]] .. name .. [[_TOPLEFT]]) - topLeft:SetPoint("TOPLEFT", frame.Panel, "TOPLEFT", 0, 0) - topLeft:SetPoint("TOPRIGHT", frame.Panel, "TOP", 0, 0) - topLeft:SetPoint("BOTTOMLEFT", frame.Panel, "LEFT", 0, 0) - topLeft:SetVertexColor(0.05, 0.05, 0.05, 0.5) - topLeft:SetNonBlocking(true) - - local topRight = frame.Panel:CreateTexture(nil, "BACKGROUND", nil, initLevel) - topRight:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\Extended\]] .. name .. [[_TOPRIGHT]]) - topRight:SetPoint("TOPRIGHT", frame.Panel, "TOPRIGHT", 0, 0) - topRight:SetPoint("TOPLEFT", frame.Panel, "TOP", 0, 0) - topRight:SetPoint("BOTTOMRIGHT", frame.Panel, "RIGHT", 0, 0) - topRight:SetVertexColor(0.05, 0.05, 0.05, 0.5) - topRight:SetNonBlocking(true) - - local bottomRight = frame.Panel:CreateTexture(nil, "BACKGROUND", nil, initLevel) - bottomRight:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\Extended\]] .. name .. [[_BOTTOMRIGHT]]) - bottomRight:SetPoint("BOTTOMRIGHT", frame.Panel, "BOTTOMRIGHT", 0, 0) - bottomRight:SetPoint("BOTTOMLEFT", frame.Panel, "BOTTOM", 0, 0) - bottomRight:SetPoint("TOPRIGHT", frame.Panel, "RIGHT", 0, 0) - bottomRight:SetVertexColor(0.1, 0.1, 0.1, 0.5) - bottomRight:SetNonBlocking(true) - - local bottomLeft = frame.Panel:CreateTexture(nil, "BACKGROUND", nil, initLevel) - bottomLeft:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\Extended\]] .. name .. [[_BOTTOMLEFT]]) - bottomLeft:SetPoint("BOTTOMLEFT", frame.Panel, "BOTTOMLEFT", 0, 0) - bottomLeft:SetPoint("BOTTOMRIGHT", frame.Panel, "BOTTOM", 0, 0) - bottomLeft:SetPoint("TOPLEFT", frame.Panel, "LEFT", 0, 0) - bottomLeft:SetVertexColor(0.1, 0.1, 0.1, 0.5) - bottomLeft:SetNonBlocking(true) - end - - local level = frame:GetFrameLevel() - 1 - if(level >= 0) then - frame.Panel:SetFrameLevel(level) - else - frame.Panel:SetFrameLevel(0) - end -end - -local function HasCooldown(n) - local cd = n and n.."Cooldown" - return cd and _G[cd] -end - -local function CreateButtonPanel(frame, noChecked, brightChecked) - if(frame.hasPanel) then return end - - if(frame.Left) then - frame.Left:SetAlpha(0) - end - - if(frame.Middle) then - frame.Middle:SetAlpha(0) - end - - if(frame.Right) then - frame.Right:SetAlpha(0) - end - - if(frame.SetNormalTexture) then - frame:SetNormalTexture("") - end - - if(frame.SetDisabledTexture) then - frame:SetDisabledTexture("") - end - - if(frame.SetCheckedTexture) then - frame:SetCheckedTexture("") - end - - if(frame.SetHighlightTexture and not frame.hover) then - local hover = frame:CreateTexture(nil, "OVERLAY") - local color = SuperVillain.Media.color.highlight - hover:SetTexture(color[1], color[2], color[3], 0.5) - hover:FillInner(frame.Panel) - frame.hover = hover; - frame:SetHighlightTexture(hover) - end - - if(frame.SetPushedTexture and not frame.pushed) then - local pushed = frame:CreateTexture(nil, "OVERLAY") - pushed:SetTexture(0.1, 0.8, 0.1, 0.3) - pushed:FillInner(frame.Panel) - frame.pushed = pushed; - frame:SetPushedTexture(pushed) - end - - if(not noChecked and frame.SetCheckedTexture) then - local checked = frame:CreateTexture(nil, "OVERLAY") - if(not brightChecked) then - checked:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - checked:SetVertexColor(0, 0.5, 0, 0.2) - else - checked:SetTexture(SuperVillain.Media.bar.gloss) - checked:SetVertexColor(0, 1, 0, 1) - end - checked:FillInner(frame.Panel) - frame.checked = checked; - frame:SetCheckedTexture(checked) - end - - local cd = HasCooldown(frame:GetName()) - if cd then - cd:ClearAllPoints() - cd:SetAllPoints() - end - - frame.hasPanel = true -end ---[[ -########################################################## -TEMPLATE API -########################################################## -]]-- -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 - if(overridePadding and type(overridePadding) == "number") then - padding = overridePadding - end - - CreatePanelTemplate(self, templateName, true, noupdate, padding, xOffset, yOffset) - - if(not self._noupdate) then - TemplateUpdateFrames[self] = true - end -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 - - local padding = false - if(overridePadding and type(overridePadding) == "number") then - padding = overridePadding - end - - CreatePanelTemplate(self, templateName, false, noupdate, padding, xOffset, yOffset) - - if(not self._noupdate) then - TemplateUpdateFrames[self] = true - end -end - -local function SetPanelColor(self, ...) - local arg1,arg2,arg3,arg4,arg5,arg6,arg7 = select(1, ...) - if(not self.Panel or not arg1) then return; end - if(self._skin and self._gradient) then - if(type(arg1) == "string") then - if(arg1 == "VERTICAL" or arg1 == "HORIZONTAL") then - self._skin:SetGradient(...) - elseif(SuperVillain.Media.gradient[arg1]) then - if self.BorderPanel then - local d,r,g,b,r2,g2,b2 = unpack(SuperVillain.Media.gradient[arg1]) - --self._skin:SetGradient(d,r,g,b,r2,g2,b2) - self.BorderPanel[1]:SetTexture(r2,g2,b2) - self.BorderPanel[2]:SetTexture(r2,g2,b2) - self.BorderPanel[3]:SetTexture(r2,g2,b2) - self.BorderPanel[4]:SetTexture(r2,g2,b2) - else - self._skin:SetGradient(unpack(SuperVillain.Media.gradient[arg1])) - if(SuperVillain.Media.color[arg1]) then - local t = SuperVillain.Media.color[arg1] - local r,g,b,a = t[1], t[2], t[3], t[4] or 1; - self:SetBackdropColor(r,g,b,a) - end - end - end - end - elseif(type(arg1) == "string" and SuperVillain.Media.color[arg1]) then - local t = SuperVillain.Media.color[arg1] - local r,g,b,a = t[1], t[2], t[3], t[4] or 1; - if self.BorderPanel then - self.BorderPanel[1]:SetTexture(r,g,b) - self.BorderPanel[2]:SetTexture(r,g,b) - self.BorderPanel[3]:SetTexture(r,g,b) - self.BorderPanel[4]:SetTexture(r,g,b) - else - self:SetBackdropColor(r,g,b) - end - elseif(arg1 and type(arg1) == "number") then - self:SetBackdropColor(...) - end -end ---[[ -########################################################## -APPENDED BUTTON TEMPLATING METHODS -########################################################## -]]-- -local function SetButtonTemplate(self) - if self.styled then return end - - CreatePanelTemplate(self, "Button", false, true, 1) - - if(self.Left) then - self.Left:SetAlpha(0) - end - - if(self.Middle) then - self.Middle:SetAlpha(0) - end - - if(self.Right) then - self.Right:SetAlpha(0) - end - - if(self.SetNormalTexture) then - self:SetNormalTexture("") - end - - if(self.SetDisabledTexture) then - self:SetDisabledTexture("") - end - - if(self.SetHighlightTexture and not self.hover) then - local hover = self:CreateTexture(nil, "HIGHLIGHT") - local color = SuperVillain.Media.color.highlight - hover:SetTexture(color[1], color[2], color[3], 0.5) - FillInner(hover, self.Panel) - self.hover = hover; - self:SetHighlightTexture(hover) - end - - if(self.SetPushedTexture and not self.pushed) then - local pushed = self:CreateTexture(nil, "OVERLAY") - pushed:SetTexture(0.1, 0.8, 0.1, 0.3) - FillInner(pushed, self.Panel) - self.pushed = pushed; - self:SetPushedTexture(pushed) - end - - if(self.SetCheckedTexture and not self.checked) then - local checked = self:CreateTexture(nil, "OVERLAY") - checked:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - checked:SetVertexColor(0, 0.5, 0, 0.2) - FillInner(checked, self.Panel) - self.checked = checked; - self:SetCheckedTexture(checked) - end - - self.styled = true -end - -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) - self.styled = true -end - -local function SetCheckboxTemplate(self, underlay, x, y) - if self.styled then return end - if(underlay) then - x = x or -7 - y = y or -7 - end - CreatePanelTemplate(self, "Slot", underlay, true, 1, x, y) - CreateButtonPanel(self, false, true) - - NewHook(self, "SetChecked", function(self,checked) - local r,g,b = 0,0,0 - if(checked == 1) then - r,g,b = self:GetCheckedTexture():GetVertexColor() - end - self:SetBackdropBorderColor(r,g,b) - end) - - self.styled = true -end - -local function SetEditboxTemplate(self, x, y) - if self.styled then return end - - if self.TopLeftTex then MUNG(self.TopLeftTex) end - if self.TopRightTex then MUNG(self.TopRightTex) end - if self.TopTex then MUNG(self.TopTex) end - if self.BottomLeftTex then MUNG(self.BottomLeftTex) end - if self.BottomRightTex then MUNG(self.BottomRightTex) end - if self.BottomTex then MUNG(self.BottomTex) end - if self.LeftTex then MUNG(self.LeftTex) end - if self.RightTex then MUNG(self.RightTex) end - if self.MiddleTex then MUNG(self.MiddleTex) end - - CreatePanelTemplate(self, "Inset", true, true, 1, x, y) - - local globalName = self:GetName(); - if globalName then - if _G[globalName.."Left"] then MUNG(_G[globalName.."Left"]) end - if _G[globalName.."Middle"] then MUNG(_G[globalName.."Middle"]) end - if _G[globalName.."Right"] then MUNG(_G[globalName.."Right"]) end - if _G[globalName.."Mid"] then MUNG(_G[globalName.."Mid"]) end - if globalName:find("Silver") or globalName:find("Copper") then - self.Panel:SetPoint("BOTTOMRIGHT", -12, -2) - end - end - self.styled = true -end - -local function SetFramedButtonTemplate(self, template) - if self.styled then return end - template = template or "FramedBottom" - CreatePanelTemplate(self, template, false, false, 1) - - if(self.Left) then - self.Left:SetAlpha(0) - end - - if(self.Middle) then - self.Middle:SetAlpha(0) - end - - if(self.Right) then - self.Right:SetAlpha(0) - end - - if(self.SetNormalTexture) then - self:SetNormalTexture("") - end - - if(self.SetDisabledTexture) then - self:SetDisabledTexture("") - end - - local border = NewFrame('Frame',nil,self) - border:Point('TOPLEFT', self, 'TOPLEFT', -2, 2) - border:Point('BOTTOMRIGHT', self, 'BOTTOMRIGHT', 2, -2) - local t = SuperVillain.Media.color.default - local r,g,b = t[1], t[2], t[3] - border[1] = border:CreateTexture(nil,"BORDER") - border[1]:SetTexture(r,g,b) - border[1]:SetPoint("TOPLEFT") - border[1]:SetPoint("BOTTOMLEFT") - border[1]:SetWidth(3) - border[2] = border:CreateTexture(nil,"BORDER") - border[2]:SetTexture(r,g,b) - border[2]:SetPoint("TOPRIGHT") - border[2]:SetPoint("BOTTOMRIGHT") - border[2]:SetWidth(3) - border[3] = border:CreateTexture(nil,"BORDER") - border[3]:SetTexture(r,g,b) - border[3]:SetPoint("TOPLEFT") - border[3]:SetPoint("TOPRIGHT") - border[3]:SetHeight(3) - border[4] = border:CreateTexture(nil,"BORDER") - border[4]:SetTexture(r,g,b) - border[4]:SetPoint("BOTTOMLEFT") - border[4]:SetPoint("BOTTOMRIGHT") - border[4]:SetHeight(3) - - border[5] = NewFrame('Frame',nil,border) - border[5]:Point('TOPLEFT',border,'TOPLEFT',-2,2) - border[5]:Point('BOTTOMRIGHT',border,'BOTTOMRIGHT',2,-2) - border[5]:SetBackdrop({ - edgeFile = [[Interface\AddOns\SVUI\assets\artwork\Template\GLOW]], - edgeSize = 3, - insets = { - left = 2, - right = 2, - top = 2, - bottom = 2 - } - }) - border[5]:SetBackdropBorderColor(0,0,0,0.6) - - if(not self.hover) then - local hover = border:CreateTexture(nil, "HIGHLIGHT") - local color = SuperVillain.Media.color.highlight - hover:SetTexture(color[1], color[2], color[3], 0.5) - hover:SetAllPoints(border) - self.hover = hover; - if(self.SetHighlightTexture) then - self:SetHighlightTexture(hover) - end - end - - self.BorderPanel = border - self.styled = true - TemplateUpdateFrames[self] = true -end ---[[ -########################################################## -TEMPLATE UPDATE CALLBACK -########################################################## -]]-- -local function FrameTemplateUpdates() - for frame in pairs(TemplateUpdateFrames) do - if(frame) then - local p = SuperVillain.Media.color[frame._color]; - if(frame.BackdropNeedsUpdate) then - if(frame.UpdateBackdrop) then - frame:UpdateBackdrop() - end - if(p) then - frame:SetBackdropColor(p[1], p[2], p[3], p[4] or 1) - end - frame:SetBackdropBorderColor(0,0,0,1) - end - if(frame.TextureNeedsUpdate and frame._texture) then - local tex = SuperVillain.Media.bg[frame._texture] - if(tex) then - frame._skin:SetTexture(tex) - end - if(not frame.NoColorUpdate) then - if(frame._gradient and SuperVillain.Media.gradient[frame._gradient]) then - local g = SuperVillain.Media.gradient[frame._gradient] - frame._skin:SetGradient(g[1], g[2], g[3], g[4], g[5], g[6], g[7]) - elseif(p) then - frame._skin:SetVertexColor(p[1], p[2], p[3], p[4] or 1) - end - end - end - end - end -end -SuperVillain.Registry:SetCallback(FrameTemplateUpdates) ---[[ -########################################################## -ENUMERATION -########################################################## -]]-- -local function AppendMethods(OBJECT) - local META = getmetatable(OBJECT).__index - if not OBJECT.Size then META.Size = Size end - if not OBJECT.Width then META.Width = Width end - if not OBJECT.Height then META.Height = Height end - if not OBJECT.Point then META.Point = Point end - if not OBJECT.WrapOuter then META.WrapOuter = WrapOuter end - 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.SetPanelTemplate then META.SetPanelTemplate = SetPanelTemplate end - if not OBJECT.SetFixedPanelTemplate then META.SetFixedPanelTemplate = SetFixedPanelTemplate end - if not OBJECT.SetPanelColor then META.SetPanelColor = SetPanelColor end - if not OBJECT.SetButtonTemplate then META.SetButtonTemplate = SetButtonTemplate end - if not OBJECT.SetSlotTemplate then META.SetSlotTemplate = SetSlotTemplate end - if not OBJECT.SetCheckboxTemplate then META.SetCheckboxTemplate = SetCheckboxTemplate end - if not OBJECT.SetEditboxTemplate then META.SetEditboxTemplate = SetEditboxTemplate end - if not OBJECT.SetFramedButtonTemplate then META.SetFramedButtonTemplate = SetFramedButtonTemplate end - if not OBJECT.SetFontTemplate then META.SetFontTemplate = SetFontTemplate end -end - -local HANDLER, OBJECT = {["Frame"] = true}, NewFrame("Frame") -AppendMethods(OBJECT) -AppendMethods(OBJECT:CreateTexture()) -AppendMethods(OBJECT:CreateFontString()) - -OBJECT = EnumerateFrames() -while OBJECT do - local objType = OBJECT:GetObjectType() - if not HANDLER[objType] then - AppendMethods(OBJECT) - HANDLER[objType] = true - end - OBJECT = EnumerateFrames(OBJECT) -end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/system/utilities.lua b/Interface/AddOns/SVUI/system/utilities.lua index d55cc1c..51f7fdd 100644 --- a/Interface/AddOns/SVUI/system/utilities.lua +++ b/Interface/AddOns/SVUI/system/utilities.lua @@ -31,6 +31,7 @@ local match, format = string.match, string.format; local gmatch, gsub = string.gmatch, string.gsub; --[[ MATH METHODS ]]-- local floor, modf = math.floor, math.modf; +local iLevelFilter = ITEM_LEVEL:gsub( "%%d", "(%%d+)" ) --[[ ########################################################## GET ADDON DATA @@ -42,14 +43,6 @@ local SuperVillain, L = unpack(select(2, ...)) MISC UTILITY FUNCTIONS ########################################################## ]]-- -function SuperVillain:AddonMessage(msg,toon) - if type(msg) == "table" then - msg = tostring(msg) - end; - local msgFrom = toon and SuperVillain.name or "SVUI"; - print("|cffffcc1a" .. msgFrom .. ":|r", msg) -end; - function SuperVillain:ColorGradient(perc, ...) if perc >= 1 then return select(select('#', ...) - 2, ...) @@ -179,6 +172,9 @@ do 42945,48716 } + -- DEPRECATED + -- local _heirloom_regex = "|?c?f?f?(%x*)|?H?([^:]*):?(%d+):?(%d*):?(%d*):?(%d*):?(%d*):?(%d*):?(%-?%d*):?(%-?%d*):?(%d*):?(%d*)|?h?%[?([^%[%]]*)%]?|?h?|?r?"; + local _slots = { ["HeadSlot"] = {true, true}, ["NeckSlot"] = {true, false}, ["ShoulderSlot"] = {true, true}, ["BackSlot"] = {true, false}, @@ -194,6 +190,14 @@ do return _failsafe end}) + local function _justthetip() + for i=1, #GameTooltip.shoppingTooltips do + if(not GameTooltip.shoppingTooltips[i]:IsShown()) then + return GameTooltip.shoppingTooltips[i] + end + end + end + local function _getHeirloomLevel(unit, itemID) if(not itemID) then return; end local baseLevel = UnitLevel(unit) @@ -239,6 +243,29 @@ do return iLevel end + local function _scanItemLevel(unit, itemString) + local tooltip = _justthetip(); + if(not tooltip) then return _getItemLevel(unit, itemString) end + tooltip:SetOwner(UIParent, "ANCHOR_NONE"); + tooltip:SetHyperlink(itemString); + tooltip:Show(); + + local iLevel = 0; + local tname = tooltip:GetName().."TextLeft%s"; + for i = 2, tooltip:NumLines() do + local text = _G[tname:format(i)]:GetText(); + if(text and text ~= "") then + local value = tonumber(text:match(iLevelFilter)); + if(value) then + iLevel = value; + end + end + end + + tooltip:Hide(); + return iLevel + end + function SuperVillain:ParseGearSlots(unit, inspecting, firstCallback, secondCallback) local category = (inspecting) and "Inspect" or "Character"; local averageLevel,totalSlots,upgradeAdjust,globalName = 0,0,0; @@ -247,8 +274,8 @@ do local slotId = GetInventorySlotInfo(slotName) local iLink = GetInventoryItemLink(unit, slotId) if(iLink ~= nil) then - local iLevel = _getItemLevel(unit, iLink) - if iLevel ~= nil then + local iLevel = _scanItemLevel(unit, iLink) + if(iLevel and iLevel > 0) then totalSlots = totalSlots + 1; averageLevel = averageLevel + iLevel if(flags[1] and firstCallback and type(firstCallback) == "function") then diff --git a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua new file mode 100644 index 0000000..123ded9 --- /dev/null +++ b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua @@ -0,0 +1,1016 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local ipairs = _G.ipairs; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local assert = _G.assert; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local tinsert = _G.tinsert; +local string = _G.string; +local math = _G.math; +local table = _G.table; +--[[ STRING METHODS ]]-- +local lower, upper = string.lower, string.upper; +local find, format, len, split = string.find, string.format, string.len, string.split; +local match, sub, join = string.match, string.sub, string.join; +local gmatch, gsub = string.gmatch, string.gsub; +--[[ MATH METHODS ]]-- +local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; -- Basic +local random = math.random; -- Uncommon +--[[ TABLE METHODS ]]-- +local tremove, tcopy, twipe = table.remove, table.copy, table.wipe; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SVUIAddOnName, PLUGIN = ...; +local SuperVillain, L, G, CONFIGS = unpack(SVUI); +local NewHook = hooksecurefunc; +local SVUIAddonEventHandler = CreateFrame("Frame", nil) +local version = GetAddOnMetadata(..., "Version"); + +PLUGIN = SuperVillain:Prototype(SVUIAddOnName, version) + +_G["WhisperVillain"] = PLUGIN; +--[[ +########################################################## +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]] +--[[ +########################################################## +DIALOG TABLES +########################################################## +]]-- +local OneLiners = { + [1] = "I've got to sit down and work out where I stand.", + [2] = "If I save time, when do I get it back?", + [3] = "I am not prejudice. I hate everyone equally.", + [4] = "Take my advice, I don't use it anyway.", + [5] = "The statement below is true. The statement above is false.", + [6] = "As I said before, I never repeat myself.", + [7] = "If at first you don't succeed, avoid skydiving.", + [8] = "War doesn't determine who's right. War determines who's left.", + [9] = "Best way to prevent a hangover is to stay drunk.", + [10] = "Doesn't expecting the unexpected make the unexpected become the expected?", + [11] = "I was born intelligent... education ruined me.", + [12] = "A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station... What more can I say?", + [13] = "If it's true that we are here to help others, then, what exactly are the others here for?", + [14] = "Since light travels faster than sound, people appear bright Until you hear them speak.", + [15] = "How come \"abbreviated\" is such a long word?", + [16] = "Living on Earth may be expensive... but it includes an annual free trip around the Sun.", + [17] = "Your future depends on your dreams So go to sleep!", + [18] = "A good discussion is like a miniskirt, short enough to hold interest and long enough to cover the subject.", + [19] = "A good time to keep your mouth shut is when you are in deep water.", + [20] = "How come we choose from just two people for President and 50 for Miss America?", + [21] = "No one ever says \"it's just a game\" when they are winning.", + [22] = "Suicidal twin kills sister by mistake!", + [23] = "He who laughs last thinks slowest!", + [24] = "Always remember you're unique, just like everyone else.", + [25] = "Hard work has a future payoff. Laziness pays off now.", + [26] = "Don't take life too seriously, you won't get out alive.", + [27] = "I don't suffer from insanity. I enjoy every minute of it.", + [28] = "I'm as confused as a baby in a topless bar.", + [29] = "90% of all statistics are made up.", + [30] = "If you can't convince them, confuse them.", + [31] = "If at first you don't succeed, destroy all evidence that you tried" +} + +local Excuse = { + -- OPENERS + [1] = "I'd love to, but ", + [2] = "I'm being told that ", + [3] = "The voices say that ", + [4] = "Hang on a sec ", + [5] = "You should know that ", + [6] = "I just found out that ", + [7] = "I would but ", + [8] = "Umm... ", + [9] = "I don't know about you but ", + [10] = "Can't talk right now, ", + -- PUNCHLINES + [11] = "I have to floss my cat", + [12] = "I've dedicated my life to linguini", + [13] = "I want to spend more time with my blender", + [14] = "the President said he might drop in", + [15] = "the man on television told me to say tuned", + [16] = "I've been scheduled for a karma transplant", + [17] = "I'm staying home to work on my cottage cheese sculpture", + [18] = "it's my parakeet's bowling night", + [19] = "it wouldn't be fair to the other Beautiful People", + [20] = "I'm building a pig from a kit", + [21] = "I did my own thing and now I've got to undo it", + [22] = "I'm enrolled in aerobic scream therapy", + [23] = "there's a disturbance in the Force", + [24] = "I'm doing door-to-door collecting for static cling", + [25] = "I have to go to the post office to see if I'm still wanted", + [26] = "I'm teaching my ferret to yodel", + [27] = "I have to check the freshness dates on my dairy products", + [28] = "I'm going through cherry cheesecake withdrawl", + [29] = "I'm planning to go downtown to try on gloves", + [30] = "my crayons all melted together", + [31] = "I'm trying to see how long I can go without saying yes", + [32] = "I'm in training to be a household pest", + [33] = "I'm getting my overalls overhauled", + [34] = "my patent is pending", + [35] = "I'm attending the opening of my garage door", + [36] = "I'm sandblasting my oven", + [37] = "I'm worried about my vertical hold", + [38] = "I'm going down to the bakery to watch the buns rise", + [39] = "I'm being deported", + [40] = "the grunion are running", + [41] = "I'll be looking for a parking space", + [42] = "my Millard Filmore Fan Club meets then", + [43] = "the monsters haven't turned blue yet, and I have to eat more dots", + [44] = "I'm taking punk totem pole carving", + [45] = "I have to fluff my shower cap", + [46] = "I'm converting my calendar watch from Julian to Gregorian", + [47] = "I've come down with a really horrible case of something or other", + [48] = "I made an appointment with a cuticle specialist", + [49] = "my plot to take over the world is thickening", + [50] = "I have to fulfill my potential", + [51] = "I don't want to leave my comfort zone", + [52] = "it's too close to the turn of the century", + [53] = "I have some real hard words to look up in the dictionary", + [54] = "my subconscious says no", + [55] = "I'm giving nuisance lessons at a convenience store", + [56] = "I left my body in my other clothes", + [57] = "the last time I went, I never came back", + [58] = "I've got a Friends of Rutabaga meeting", + [59] = "I have to answer all of my 'occupant' letters", + [60] = "none of my socks match", + [61] = "I have to be on the next train to Bermuda", + [62] = "I'm having all my plants neutered", + [63] = "people are blaming me for the Spanish-American War", + [64] = "I changed the lock on my door and now I can't get out", + [65] = "I'm making a home movie called 'The Thing That Grew in My Refrigerator'", + [66] = "I'm attending a perfume convention as guest sniffer", + [67] = "my yucca plant is feeling yucky", + [68] = "I'm touring China with a wok band", + [69] = "my chocolate-appreciation class meets that night", + [70] = "I never go out on days that end in 'Y'", + [71] = "my mother would never let me hear the end of it", + [72] = "I'm running off to Yugoslavia with a foreign-exchange student named Basil Metabolism", + [73] = "I just picked up a book called 'Glue in Many Lands' and I can't put it down", + [74] = "I'm too evil for that stuff", + [75] = "I have to torment my hair", + [76] = "I have too much guilt", + [77] = "there are important world issues that need worrying about", + [78] = "I have to draw 'Cubby' for an art scholarship", + [79] = "I'm uncomfortable when I'm alone or with others", + [80] = "I promised to help a friend fold road maps", + [81] = "I feel a song coming on", + [82] = "I'm trying to be less popular", + [83] = "my bathroom tiles need grouting", + [84] = "I have to bleach my hare", + [85] = "I'm waiting to see if I'm already a winner", + [86] = "I'm writing a love letter to Richard Simmons", + [87] = "you know how we psychos are", + [88] = "my favorite commercial is on TV", + [89] = "I have to study for a blood test", + [90] = "I'm going to be old someday", + [91] = "I've been traded to Cincinnati", + [92] = "I'm observing National Apathy Week", + [93] = "I have to rotate my crops", + [94] = "my uncle escaped again", + [95] = "I'm up to my elbows in waxy buildup", + [96] = "I have to knit some dust bunnies for a charity bazaar", + [97] = "I'm having my baby shoes bronzed", + [98] = "I have to go to court for kitty littering", + [99] = "I'm going to count the bristles in my toothbrush", + [100] = "I have to thaw some karate chops for dinner", + [101] = "having fun gives me prickly heat", + [102] = "I'm going to the Missing Persons Bureau to see if anyone is looking for me", + [103] = "I have to jog my memory", + [104] = "my palm reader advised against it", + [105] = "my Dress For Obscurity class meets then", + [106] = "I have to stay home and see if I snore", + [107] = "I prefer to remain an enigma", + [108] = "I think you want the OTHER " .. playerName, + [109] = "I have to sit up with a sick ant", + [110] = "I'm trying to cut down", + [111] = ".. well, maybe", +}; + +local Phrases = { + [1] = "I don't really want to<*", + [2] = "Are you going to<*", + [3] = "I don't know, should I<*", + [4] = "So you are not going to<*", + [5] = "Why don't you<*", + [6] = "So you think I'm<*", + [7] = "What's it to you if I'm<*", + [8] = "Did you wanna<*", + [9] = "Do you wanna<*", + [10] = "Don't you really<*", + [11] = "Why don't you<*", + [12] = "I bet you can't<*", + [13] = "UMADBRO?", + [14] = "I'm marginally listening.", + [15] = "Let me get this straight, you feel<*", + [16] = "Stop feeling<*", + [17] = "Why would I<*", + [18] = "If your lucky I just might<@", + [19] = "So, your really asking me to<*", + [20] = "Is there a reason why YOU don't<*", + [21] = "Why can't you<*", + [22] = "Why are you interested in whether or not I am<*", + [23] = "Would you prefer if I were not<*", + [24] = "Perhaps in your fantasies I am<*", + [25] = "How do you know you can't<*", + [26] = "Have you tried?", + [27] = "Perhaps you can now<*", + [28] = "Did you come to me because you are<*", + [29] = "How long have you been<*", + [30] = "Do you believe it is normal to be<*", + [31] = "Do you enjoy being<*", + [32] = "We were discussing you, not me.", + [33] = "Oh... <*", + [34] = "Doesn't sound like me though, does it?", + [35] = "How awesome would it be if you got<*", + [36] = "Why do you want<*", + [37] = "Suppose you got<*", + [38] = "What if you never got<*", + [39] = "I sometimes also want<@", + [40] = "Whay are you asking me?", + [41] = "Does it really matter?", + [42] = "Is there a right answer?", + [43] = "What do you think?", + [44] = "You are asking the wrong questions, wanna try again?", + [45] = "What is it that you really want to know?", + [46] = "Who else have you asked?", + [47] = "Am I the first person you have asked this?", + [48] = "Don't you already know the aswer to that?", + [49] = "The names aren't important.", + [50] = "I won't remember any names, do continue.", + [51] = "Is that the real reason?", + [52] = "Don't any other reasons come to mind?", + [53] = "Does that reason explain anything else?", + [54] = "What other reasons might there be?", + [55] = "Please don't apologise!", + [56] = "Apologies are not necessary.", + [57] = "What feelings do you have when you apologise?", + [58] = "Don't be so defensive!", + [59] = "What does that dream suggest to you?", + [60] = "Do you dream often?", + [61] = "What persons appear in your dreams?", + [62] = "Are you disturbed by your dreams?", + [63] = "What?", + [64] = "You don't seem quite certain.", + [65] = "Why the uncertain tone?", + [66] = "Can't you be more positive?", + [67] = "You aren't sure?", + [68] = "Don't you know?", + [69] = "Are you saying no just to be negative?", + [70] = "You are being a bit negative.", + [71] = "Why not?", + [72] = "Are you sure?", + [73] = "Why no?", + [74] = "Why are you concerned about my<*", + [75] = "What about your own<*", + [76] = "Can you think of a specific example?", + [77] = "When?", + [78] = "What are you thinking of?", + [79] = "Really, always?", + [80] = "Think so?", + [81] = "You thought<*", + [82] = "You really think<*", + [83] = "In what way?", + [84] = "What resemblence do you see?", + [85] = "What does the similarity suggest to you?", + [86] = "What other connections do you see?", + [87] = "Could there really be some connection?", + [88] = "How?", + [89] = "You seem quite positive.", + [90] = "ORLY?", + [91] = "OIC.", + [92] = "Word.", + [93] = "You dont have any friends.", + [94] = "Why would I care about your friends?", + [95] = "Are you sure you know what 'friend' means?", + [96] = "Are you sure you have any friends?", + [97] = "Do your friends usually get really quiet when you are around?", + [98] = "I'm willing to bet your friends hate you.", + [99] = "Who still uses the word noob?", + [100] = "Are you talking about me specifically?", + [101] = "I dunno. What are YOU doing?", + [102] = "Would't you like to know?", + [103] = "What do you think?", + [104] = "I'm guessing you want something from me?", + [105] = "I'm playing World of Warcraft... you seriously didn't know that?", + [106] = "No kidding? Fo' realz? That's dope fresh son!", + [107] = "And what did you learn?", + [108] = "Gotcha.", + [109] = "MmmmHmmm", + [110] = "I don't follow...", + [111] = "I'm gonna need a bit more context. Do you know what context means?", + [112] = "Wow... just ...wow.", + [113] = "Same question huh?", + [114] = "Deja Vu!", + [115] = "Yeah, lets try this again shall we?", + [116] = "Have you recently suffered a head injury?", + [117] = "Im hearing an echo I think....", + [118] = "Cant all classes heal themselves now?", + [119] = "Bandages FTW!", + [120] = "Why are you asking me?", + [121] = "Thats adorable how excited you are about it!", + [122] = "What do you think?", + [123] = "What is it that you really want to know?", + [124] = "What is your level?", + [125] = "Is this your first character?", + [126] = "Most guilds are just full of high school kids with nothing better to do.", + [127] = "What is a guild?", + [128] = "What is the name?", + [129] = "Oh really?", + [130] = "Great story.", + [131] = "Meh.", + [132] = "No clue." +}; + +local Responses = { + [1] = {Key = "**NO KEY**", Question = false, Dialog = {106,107,108,109,110,111,112,129,130,131,132}}, + [2] = {Key = "**REPEAT**", Question = false, Dialog = {113,114,115,116,117}}, + [3] = {Key = "YOU'RE", Question = false, Dialog = {6,7,8,9}}, + [4] = {Key = "I DON'T", Question = false, Dialog = {10,11,12,13}}, + [5] = {Key = "I FEEL", Question = false, Dialog = {14,15,16 }}, + [6] = {Key = "WHY DON'T YOU", Question = false, Dialog = {17,18,19}}, + [7] = {Key = "WHY CAN'T I", Question = false, Dialog = {20,21 }}, + [8] = {Key = "ARE YOU", Question = false, Dialog = {22,23,24}}, + [9] = {Key = "I CAN'T", Question = false, Dialog = {25,26,27}}, + [10] = {Key = "I AM", Question = false, Dialog = {28,29,30,31}}, + [11] = {Key = "I'M", Question = false, Dialog = {28,29,30,31}}, + [12] = {Key = "YOU", Question = false, Dialog = {32,33,34}}, + [13] = {Key = "I WANT", Question = false, Dialog = {35,36,37,38,39 }}, + [14] = {Key = "WHAT", Question = true, Dialog = {40,41,42,43,44,45,46,47,48}}, + [15] = {Key = "HOW", Question = true, Dialog = {40,41,42,43,44,45,46,47,48}}, + [16] = {Key = "WHO", Question = true, Dialog = {40,41,42,43,44,45,46,47,48}}, + [17] = {Key = "WHERE", Question = true, Dialog = {40,41,42,43,44,45,46,47,48}}, + [18] = {Key = "WHEN", Question = true, Dialog = {40,41,42,43,44,45,46,47,48}}, + [19] = {Key = "WHY", Question = true, Dialog = {40,41,42,43,44,45,46,47,48}}, + [20] = {Key = "NAME", Question = false, Dialog = {49,50}}, + [21] = {Key = "CAUSE", Question = false, Dialog = {51,52,53,54}}, + [22] = {Key = "SORRY", Question = false, Dialog = {55,56,57,58}}, + [23] = {Key = "DREAM", Question = false, Dialog = {59,60,61,62}}, + [24] = {Key = "HELLO", Question = false, Dialog = {63}}, + [25] = {Key = "HI", Question = false, Dialog = {63}}, + [26] = {Key = "MAYBE", Question = false, Dialog = {64,65,66,67,68}}, + [27] = {Key = "NO", Question = false, Dialog = {69,70,71,72,73}}, + [28] = {Key = "YOUR", Question = false, Dialog = {74,75}}, + [29] = {Key = "ALWAYS", Question = false, Dialog = {76,77,78,79}}, + [30] = {Key = "THINK", Question = false, Dialog = {80,81,82}}, + [31] = {Key = "ALIKE", Question = false, Dialog = {83,84,85,86,87,88,89}}, + [32] = {Key = "YES", Question = false, Dialog = {90,91,92}}, + [33] = {Key = "FRIEND", Question = false, Dialog = {93,94,95,96,97,98}}, + [34] = {Key = "NOOB", Question = false, Dialog = {99}}, + [35] = {Key = "CAN I", Question = false, Dialog = {4,5}}, + [36] = {Key = "CAN YOU", Question = false, Dialog = {1,2,3}}, + [37] = {Key = "WILL YOU", Question = false, Dialog = {1,2,3}}, + [38] = {Key = "WOULD YOU", Question = false, Dialog = {1,2,3}}, + [39] = {Key = "COULD YOU", Question = false, Dialog = {1,2,3}}, + [40] = {Key = "YOU ARE", Question = false, Dialog = {6,7,8,9 }}, + [41] = {Key = "HEALER", Question = false, Dialog = {118,119}}, + [42] = {Key = "HOLY", Question = false, Dialog = {118,119}}, + [43] = {Key = "RESTORATION", Question = false, Dialog = {118,119}}, + [44] = {Key = "HEAL", Question = false, Dialog = {118,119}}, + [45] = {Key = "PORT", Question = false, Dialog = {40,41,42,43,44,45,46,47,48}}, + [46] = {Key = "PORTAL", Question = false, Dialog = {40,41,42,43,44,45,46,47,48}}, + [47] = {Key = "WATER", Question = false, Dialog = {40,41,42,43,44,45,46,47,48}}, + [48] = {Key = "FOOD", Question = false, Dialog = {40,41,42,43,44,45,46,47,48}}, + [49] = {Key = "MONEY", Question = false, Dialog = {40,41,42,43,44,45,46,47,48}}, + [50] = {Key = "GOLD", Question = false, Dialog = {40,41,42,43,44,45,46,47,48}}, + [51] = {Key = "PVP", Question = false, Dialog = {120,121,122,123,124,125}}, + [52] = {Key = "RAID", Question = false, Dialog = {120,121,122,123,124,125}}, + [53] = {Key = "KNOW", Question = false, Dialog = {64,65,66,67,68}}, + [54] = {Key = "POSSIBLE", Question = false, Dialog = {64,65,66,67,68}}, + [55] = {Key = "WTF", Question = false, Dialog = {64,65,66,67,68}}, + [56] = {Key = "LOL", Question = false, Dialog = {64,65,66,67,68}}, + [57] = {Key = "GUILD", Question = false, Dialog = {126,127,128}}, + [58] = {Key = "TOON", Question = false, Dialog = {49,50}}, + [59] = {Key = "CHARACTER", Question = false, Dialog = {49,50}}, + [60] = {Key = "PLAYER", Question = false, Dialog = {49,50}}, + [61] = {Key = "DOING", Question = false, Dialog = {100,101,102,103,104,105}}, + [62] = {Key = "UP TO", Question = false, Dialog = {100,101,102,103,104,105}}, +}; +--[[ +########################################################## +LOCAL FUNCTIONS +########################################################## +]]-- +local function ServiceMessage(msg) + local msgFrom = SuperVillain.db.SVAnswer.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 + if ResponseQueue[x].CID == caller then + tremove(ResponseQueue, x) + end + end + end +end + +local function RemoveCaller(caller) + ClearResponses(caller) + + if PhoneLines[caller] then + local data = PhoneLines[caller] + local btn = _G["HenchmenPhoneLine"..data.Line]; + btn.Text:SetText("Empty Phone Line"); + btn:SetPanelColor("default"); + PhoneLines[caller] = nil + 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 +########################################################## +]]-- +do + local function Conjugate(parse) + for i,cj in pairs(ConjugationKeys[1]) do + parse = gsub(parse, cj, "#@&"..i) + end + for i,cj in pairs(ConjugationKeys[2]) do + parse = gsub(parse, "#@&"..i, cj) + end + for i,cj in pairs(ConjugationKeys[3]) do + parse = gsub(parse, cj, "#@&"..i) + end + for i,cj in pairs(ConjugationKeys[4]) do + parse = gsub(parse, "#@&"..i, cj) + end + return parse + end + + local function PadString(strng) + aString = " "..strng.." " + for i = 1, 12, 1 do + aString = gsub(aString, punctuations[i].pattern, " "..punctuations[i].value.." ") + end + return " "..aString.." " + end + + local function UnPadString(strng) + aString = strng + aString = gsub(aString, " ", " ") + if sub(aString, 1, 1) == " " then + aString = sub(aString, 2) + end + if sub(aString, -1, -1) == " " then + aString = sub(aString, 1, len(aString)-1) + end + for i = 1, 12, 1 do + aString = gsub(aString, " "..punctuations[i].pattern, punctuations[i].value) + end + return aString + end + + local function TrimString(orgString, unpad) + local tmpChars = ".,!?:;&\"@#()^$+-%= " + local x = 1 + local found = true + + if(unpad) then + orgString = UnPadString(orgString) + end + + while found == true do + local tchar = sub(orgString, -(x), -(x)) + if tchar == "(" or tchar == ")" or tchar == "." or tchar == "%" or tchar == "+" or tchar == "-" or tchar == "*" or tchar == "?" or tchar == "[" or tchar == "]" or tchar == "^" or tchar == "$" then + tchar = "%"..tchar + end + found = find(tchar,tmpChars) and (len(orgString) - x) > 0 + x = x + 1 + end + x = x - 1 + if (len(orgString) - x) > 0 then + orgString = sub(orgString, 1, len(orgString) - x + 1) + end + x = 1 + while find(sub(orgString, x, x),tmpChars) and (len(orgString) - x) > 0 do + x = x + 1 + end + if (len(orgString) - x) > 0 then + orgString = sub(orgString, x) + end + return orgString + end + + local function PhraseSearch(sString, keyid, data) + local thisstr = ""; + local phrase; + local wordkey = Responses[keyid].Key; + local links = Responses[keyid].Dialog; + idrange = #links + if idrange > 1 then + while(not phrase) do + local mod = floor(random(1, idrange)) + if links[mod] ~= data.LastKey then + phrase = Phrases[links[mod]] + data.LastKey = links[mod] + end + end + else + data.LastKey = 1 + end + local tempt = sub(phrase, -1, -1) + local sTemp = "" + if tempt == "*" or tempt == "@" then + sTemp = PadString(sString) + local wTemp = upper(sTemp) + local strpstr = find(wTemp, " "..wordkey.." ") + if not strpstr then + strpstr = find(wTemp, " "..wordkey) + end + if not strpstr then + strpstr = find(wTemp, wordkey.." ") + end + strpstr = strpstr + len(wordkey) + 1 + thisstr = Conjugate(sub(sTemp, strpstr)) + thisstr = TrimString(thisstr, true) + if tempt == "*" then + sTemp = gsub(phrase, "<%*", " "..thisstr.."?") + else + sTemp = gsub(phrase, "<@", " "..thisstr..".") + end + else + sTemp = phrase + end + return sTemp + end + + local function KeywordSearch(wString) + for k, v in gmatch(wString, "([%w']+ [%w']+ [%w']+ [%w']+ [%w']+)") do + for x = 1, 62, 1 do + if Responses[x].Key == k then + return x + end + end + end + for k, v in gmatch(wString, "([%w']+ [%w']+ [%w']+ [%w']+)") do + for x = 1, 62, 1 do + if Responses[x].Key == k then + return x + end + end + end + for k, v in gmatch(wString, "([%w']+ [%w']+ [%w']+)") do + for x = 1, 62, 1 do + if Responses[x].Key == k then + return x + end + end + end + for k, v in gmatch(wString, "([%w']+ [%w']+)") do + for x = 1, 62, 1 do + if Responses[x].Key == k then + return x + end + end + end + for k, v in gmatch(wString, "([%w]-) ") do + for x = 1, 62, 1 do + if Responses[x].Key == k then + return x + end + end + end + return 1 + end + + local function MakeExcuse(sInput) + local joke = random(100) + if(joke <= 31) then + return OneLiners[joke]; + end + local word_list = {} + for k, v in gmatch(sInput, "([%w']+)") do + tinsert(word_list, k) + end + local tBestQuotes = {} + local mxWords = 0 + for x = 11, 101, 1 do + local count = 0 + for y = 1, #word_list, 1 do + if find(Excuse[x], word_list[y]) then + count = count + 1 + end + end + if count > mxWords then + tBestQuotes = {} + mxWords = count + tinsert(tBestQuotes, x) + elseif count == mxWords then + tinsert(tBestQuotes, x) + end + end + + local response = Excuse[random(1,10)] + local mod = random(11,101) + if #tBestQuotes > 0 then + mod = tBestQuotes[random(#tBestQuotes)] + end + response = response .. Excuse[mod] + return response; + end + + local function MessageBuilder(data, inbound) + local sInput = TrimString(inbound); + local outbound; + local mapkey = 1; + if sInput ~= "" and sInput ~= " " and sInput ~= " " and sInput ~= "." and sInput ~= "," then + local wInput = PadString(upper(sInput)); + mapkey = KeywordSearch(wInput); + if Responses[mapkey].Question == true then + if sub(inbound, -1, -1) ~= "?" then + mapkey = 1 + end + end + if(inbound == data.InBound or inbound == data.OutBound) then + mapkey = 2 + elseif mapkey == 1 then + if data.FirstResponse == true then + outbound = ":)"; + else + if(20 >= random(100)) then + outbound = MakeExcuse(sInput) + end + end + end + data.FirstResponse = false + end + if(not outbound) then + outbound = PhraseSearch(sInput, mapkey, data) + end + return outbound + end + + function PLUGIN:TakeAMessage(caller, inbound) + ClearResponses(caller) + local data = PhoneLines[caller]; + --SuperVillain:ShowDebug("Answering Service","TakeAMessage",data) + if(data) then + if(data.InUse) then + local data = PhoneLines[caller]; + local outbound = MessageBuilder(data, inbound) + data.OutBound = outbound + local tm = (floor(GetTime()) + ((len(outbound)/400) * 60)); + tinsert(ResponseQueue, {["ETA"] = tm, ["MSG"] = outbound, ["CID"] = caller}) + end + data.InBound = inbound + data.TimeStamp = GetTime() + end + end +end +--[[ +########################################################## +EVENTS +########################################################## +]]-- +local function AnsweringServiceEventHandler(self, event, ...) + local handler = Events[event] + if handler then handler(...) end +end + +function Events.CHAT_MSG_IGNORED(inbound_message, caller, ...) + if(PhoneLines[caller] and PhoneLines[caller].InUse) then + HangUp(caller,true) + end +end + +function Events.CHAT_MSG_WHISPER(inbound_message, caller) + if not UnitIsAFK("player") and not UnitIsDND("player") then + if (not PhoneLines[caller]) then + AddCaller(caller) + end + PLUGIN:TakeAMessage(caller, inbound_message) + end +end + +function Events.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) + end + PLUGIN:TakeAMessage(caller, inbound_message) + end +end +--[[ +########################################################## +OTHER HANDLERS +########################################################## +]]-- +local PhoneLineClick = function(self, button) + local caller = self.Text:GetText() + if((caller == "Empty Phone Line") or not PhoneLines[caller]) then return; end + if button == "LeftButton" then + if(not PhoneLines[caller].InUse) then + self:SetPanelColor("green"); + PhoneLines[caller].InUse = true + ServiceMessage("Let the torment of "..caller.." begin!") + PLUGIN:TakeAMessage(caller, PhoneLines[caller].InBound) + else + self:SetPanelColor("yellow"); + PhoneLines[caller].InUse = false + 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; + ElapsedUpdate = 0 + if #ResponseQueue > 0 then + local ttime = GetTime() + 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 GetTime() > 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 < (GetTime() - timer) then + if(not PhoneLines[caller].GiveUp) then + SendChatMessage("You still there?", "WHISPER", nil, caller) + PhoneLines[caller].GiveUp = true + else + PhoneLines[caller].GiveUp = nil; + HangUp(caller) + end + end + end + end + end + end +end +--[[ +########################################################## +LOAD AND CONSTRUCT +########################################################## +]]-- +local function LoadOptions() + SuperVillain.Options.args.plugins.args.pluginOptions.args.SVAnswer = { + type = "group", + name = L["Answering Service"], + childGroups = "tree", + args = { + enable = { + 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 + }, + 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 + }, + 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 + }, + } + } +end + +local AnsweringOnClick = function() + if HenchmenOperator:IsShown() then + HenchmenOperator:Hide() + else + HenchmenOperator:Show() + end +end + +local function LoadAnsweringService() + if(not SuperVillain.db.SVAnswer.enable) then return end + + PLUGIN.db = SuperVillain.db.SVAnswer + + AnsweringService:SetScript("OnEvent", AnsweringServiceEventHandler) + AnsweringService:RegisterEvent("CHAT_MSG_WHISPER") + AnsweringService:RegisterEvent("CHAT_MSG_BN_WHISPER") + AnsweringService:RegisterEvent("CHAT_MSG_IGNORED") + PhoneTimeHandler:SetScript("OnUpdate", PhoneTimeUpdate) + + 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) + + 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") + 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:SetText("Henchman Answering Service") + for x = 1, 5, 1 do + local phLn = CreateFrame("Button", "HenchmenPhoneLine"..x, f) + phLn:SetWidth(124) + phLn:SetHeight(20) + phLn:SetPoint("TOPLEFT", "HenchmenOperator", "TOPLEFT", 2, ((-16) - (x * 21))) + phLn:RegisterForClicks("AnyUp") + phLn:SetScript("OnClick", PhoneLineClick) + phLn:SetFixedPanelTemplate("Button") + phLn.Text = phLn:CreateFontString() + phLn.Text:SetWidth(124) + phLn.Text:SetHeight(20) + phLn.Text:SetFontObject(GameFontNormalSmall) + phLn.Text:SetTextColor(1, 1, 1, 1) + phLn.Text:SetJustifyH("CENTER") + phLn.Text:SetJustifyV("MIDDLE") + phLn.Text:SetPoint("TOP", "HenchmenPhoneLine"..x, "TOP") + phLn.Text:SetText("Empty Phone Line") + end + + HenchmenOperator:Hide() + local strMsg + if SuperVillain.db.SVAnswer.autoAnswer == true then + strMsg = "The Henchmen Operators Are Screening My Calls.." + else + strMsg = "The Henchmen Operators Are Standing By.." + end + SuperVillain:ToonMessage(strMsg) +end + +CONFIGS["SVAnswer"] = { + ["enable"] = false, + ["autoAnswer"] = false, + ["prefix"] = true +} + +SuperVillain.Registry:NewScript(LoadAnsweringService) +SuperVillain.Registry:NewPlugin(PLUGIN, "SVAnswer", LoadOptions) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.toc b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.toc new file mode 100644 index 0000000..00f0be4 --- /dev/null +++ b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.toc @@ -0,0 +1,8 @@ +## Interface: 50400 +## Author: Munglunch +## Version: 1.0 +## Title: |cffFF9900SVUI |r|cffFFEF00Answering Service|r +## Notes: Supervillain UI [|cff9911FFAutomatic Whispers|r]. +## RequiredDeps: SVUI + +SVUI_AnsweringService.lua diff --git a/Interface/AddOns/SVUI_AnsweringService/artwork/DOCK-CALL.blp b/Interface/AddOns/SVUI_AnsweringService/artwork/DOCK-CALL.blp new file mode 100644 index 0000000..de23af0 Binary files /dev/null and b/Interface/AddOns/SVUI_AnsweringService/artwork/DOCK-CALL.blp differ diff --git a/Interface/AddOns/SVUI_ArtOfWar/Bindings.xml b/Interface/AddOns/SVUI_ArtOfWar/Bindings.xml new file mode 100644 index 0000000..f0778e8 --- /dev/null +++ b/Interface/AddOns/SVUI_ArtOfWar/Bindings.xml @@ -0,0 +1,5 @@ +<Bindings> + <Binding name="Call Out Incoming" header="SVUIAOW" runOnUp="false"> + SVUISayIncoming() + </Binding> +</Bindings> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua new file mode 100644 index 0000000..e2b35e7 --- /dev/null +++ b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua @@ -0,0 +1,708 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local pairs = _G.pairs; +local ipairs = _G.ipairs; +local type = _G.type; +local error = _G.error; +local pcall = _G.pcall; +local assert = _G.assert; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local tinsert = _G.tinsert; +local string = _G.string; +local math = _G.math; +local table = _G.table; +local bit = _G.bit; +--[[ STRING METHODS ]]-- +local format, sub = string.format, string.sub; +--[[ MATH METHODS ]]-- +local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; +--[[ TABLE METHODS ]]-- +local tremove, twipe = table.remove, table.wipe; +--[[ BINARY METHODS ]]-- +local band, bor = bit.band, bit.bor; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SVUIAddOnName, PLUGIN = ...; +local SuperVillain, L, G, CONFIGS = unpack(SVUI); +local NewHook = hooksecurefunc; +local SVUIAddonEventHandler = CreateFrame("Frame", nil) +local version = GetAddOnMetadata(..., "Version") + +PLUGIN = SuperVillain:Prototype(SVUIAddOnName, version) + +_G["WarVillain"] = PLUGIN; +--[[ +########################################################## +GLOBAL SLASH FUNCTIONS +########################################################## +]]-- +BINDING_HEADER_SVUIAOW = "SuperVillain UI: Art of War"; + +function SVUISayIncoming() + local subzoneText = GetSubZoneText() + local msg = ("{rt8} Incoming %s {rt8}"):format(subzoneText) + SendChatMessage(msg, "INSTANCE_CHAT") + return +end +--[[ +########################################################## +LOCAL FUNCTIONS +########################################################## +]]-- +local function HeadsUpAlarm(...) + if not CombatText_AddMessage then return end + CombatText_AddMessage(...) +end +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +local EnemyCache, AlertedCache = {},{} +local AoWLogs = CreateFrame("Frame", "SVUI_AoWLogs", UIParent) +local playerGUID = UnitGUID('player') +local playerFaction = UnitFactionGroup("player") +local classColor = RAID_CLASS_COLORS +local classColors = SVUI_CLASS_COLORS[SuperVillain.class] +local classR, classG, classB = classColors.r, classColors.g, classColors.b +local classA = 0.35 +local fallbackColor = {r=1,g=1,b=1} +local ACTIVE_ZONE = "" +local ICON_FILE = [[Interface\AddOns\SVUI_ArtOfWar\artwork\DOCK-PVP]] +local PVP_SAFE = [[Interface\AddOns\SVUI_ArtOfWar\artwork\PVP-SAFE]] +local PVP_HELP = [[Interface\AddOns\SVUI_ArtOfWar\artwork\PVP-INCOMING]] +local SCAN_ICON = [[Interface\Addons\SVUI_ArtOfWar\artwork\DOCK-SCAN]] +local SCAN_ANIM = [[Interface\Addons\SVUI_ArtOfWar\artwork\SCAN-ANIMATION]] +local PVP_LOST = [[Interface\WorldMap\Skull_64Red]] +local PVP_NODES = { + [461] = { --Arathi Basin (5) + "Stables", "Lumber", "Blacksmith", "Mine", "Farm" + }, + [935] = { --Deepwind Gorge (3) + "Center Mine", "North Mine", "South Mine" + }, + [482] = { --Eye of the Storm (4) + "Fel Reaver", "Blood Elf", "Draenei", "Mage" + }, + [736] = { --The Battle for Gilneas (3) + "LightHouse", "WaterWorks", "Mines" + }, +} + +local Safe_OnEnter = function(self) + if InCombatLockdown() then return end + local zone = self.name + if(zone and zone ~= "") then + self:SetBackdropBorderColor(1,0.45,0) + GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) + GameTooltip:ClearLines() + GameTooltip:AddLine(("%s Is Safe!"):format(zone), 1, 1, 1) + GameTooltip:Show() + end +end + +local Safe_OnLeave = function(self) + if InCombatLockdown() then return end + self:SetBackdropBorderColor(0,0,0) + if(GameTooltip:IsShown()) then GameTooltip:Hide() end +end + +local Safe_OnClick = function(self) + local zone = self.name + if(zone and zone ~= "") then + SendChatMessage(("{rt4} %s Is Safe {rt4}"):format(zone), "INSTANCE_CHAT") + end +end + +local Help_OnEnter = function(self) + if InCombatLockdown() then return end + local zone = self.name + if(zone and zone ~= "") then + self:SetBackdropBorderColor(1,0.45,0) + GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) + GameTooltip:ClearLines() + GameTooltip:AddLine(("%s Needs Help!"):format(zone), 1, 1, 1) + GameTooltip:Show() + end +end + +local Help_OnLeave = function(self) + if InCombatLockdown() then return end + self:SetBackdropBorderColor(0,0,0) + if(GameTooltip:IsShown()) then GameTooltip:Hide() end +end + +local Help_OnClick = function(self) + if(self.name and self.name ~= "") then + local msg = ("{rt8} Incoming %s {rt8}"):format(self.name) + SendChatMessage(msg, "INSTANCE_CHAT") + end +end + +local function AddEnemyScan(guid, timestamp) + if(EnemyCache[guid]) then + return EnemyCache[guid] + end + local class, key, _, race, sex, name, realm = GetPlayerInfoByGUID(guid) + -- local key = class:upper() + -- key = key:gsub("%s+", "") + local colors = classColor[key] or fallbackColor + EnemyCache[guid] = { + ["name"] = name, + ["realm"] = realm, + ["class"] = class, + ["race"] = race, + ["sex"] = sex, + ["colors"] = colors, + ["time"] = timestampa + } + PLUGIN:ScannerLog(EnemyCache[guid]) + return EnemyCache[guid]; +end + +local function SaveEnemyScan(guid, timestamp) + local e = EnemyCache[guid] + if(not e) then e = 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 + } + local msg = ("Killed By: %s"):format(e.name); + HeadsUpAlarm(msg, CombatText_StandardScroll, e.colors.r, e.colors.g, e.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"); + end + e = EnemyCache[guid] + if(e) then + HeadsUpAlarm(("Killed Enemy: %s"):format(e.name), CombatText_StandardScroll, 0.1, 0.8, 0); + end +end + +local function ClearCacheScans() + wipe(EnemyCache) + wipe(AlertedCache) + PLUGIN.LogWindow:Clear(); +end + +local function ClearSavedScans() + SVAOW_Cache = {} +end + +local function EnemyAlarm(name, class, colors, kos) + local inInstance, instanceType = IsInInstance() + if(instanceType ~= "pvp" and not AlertedCache[name]) then + local msg + if(kos) then + msg = ("Mortal Enemy Detected!: %s"):format(name); + HeadsUpAlarm(msg, CombatText_StandardScroll, 1, 0, 0) + else + msg = ("%s Detected"):format(class); + HeadsUpAlarm(msg, CombatText_StandardScroll, colors.r, colors.g, colors.b) + end + AlertedCache[name] = true + end +end + +local function StealthAlarm(name) + local msg = ("%s Detected!"):format(name); + HeadsUpAlarm(msg, CombatText_StandardScroll, 1, 0.5, 0); +end + +function PLUGIN:UpdateSummary() + self.SummaryWindow:Clear(); + local stored = SVAOW_Cache; + local amount = 0 + for _,data in pairs(stored) do + if type(data) == "table" and data.name and data.class then + amount = amount + 1; + end + end + self.SummaryWindow:AddMessage(("You Have |cffff5500%s|r Mortal Enemies"):format(amount), 0.8, 0.8, 0.8); +end + +function PLUGIN:ResetLogs() + wipe(EnemyCache) + self.TitleWindow:Clear(); + self.SummaryWindow:Clear(); + self.LogWindow:Clear(); + self.TitleWindow:AddMessage(("Scanning %s"):format(ACTIVE_ZONE), 1, 1, 0); + local stored = SVAOW_Cache; + local amount = 0 + for _,data in pairs(stored) do + if type(data) == "table" and data.name and data.class then + amount = amount + 1; + end + end + self.SummaryWindow:AddMessage(("You Have |cffff5500%s|r Mortal Enemies"):format(amount), 0.8, 0.8, 0.8); + collectgarbage("collect") +end + +function PLUGIN:ScannerLog(enemy) + local hex = ("%s - %s %s"):format(enemy.name, enemy.race, enemy.class) + self.LogWindow:AddMessage(hex, enemy.colors.r, enemy.colors.g, enemy.colors.b); + EnemyAlarm(enemy.name, enemy.class, enemy.colors) +end + +function PLUGIN:UpdateCommunicator() + local docklet = _G["SVUI_ArtOfWarDock_ToolBarButton"] + if(not self.InPVP) then + local mapID = GetCurrentMapAreaID() + if(mapID) then + local points = PVP_NODES[mapID] + if(points) then + for i = 1, 5 do + local nodeName = ("SVUI_PVPNode%d"):format(i) + local node = _G[nodeName] + local safe = node.Safe + local help = node.Help + if(i <= #points) then + local name = points[i] + safe.name = name + help.name = name + node.Text:SetText(name) + node:Show() + else + safe.name = "" + help.name = "" + node.Text:SetText("") + node:Hide() + end + end + self.InPVP = true + SVUIAddonEventHandler:UnregisterEvent("UPDATE_BATTLEFIELD_SCORE") + self.DockButton:SaveColors("yellow", "yellow", true) + self.DockButton.icon:SetTexture(ICON_FILE) + self.DockButton.Scanner:Hide() + AoWLogs:Hide() + self.Scanning = false + end + end + elseif(self.InPVP) then + for i = 1, 5 do + local nodeName = ("SVUI_PVPNode%d"):format(i) + local node = _G[nodeName] + local safe = node.Safe + local help = node.Help + safe.name = "" + help.name = "" + node.Text:SetText("") + node:Hide() + end + self.InPVP = nil + SVUIAddonEventHandler:RegisterEvent("UPDATE_BATTLEFIELD_SCORE") + self.DockButton:SaveColors("special", "icon", false) + self.DockButton.icon:SetTexture(0,0,0,0) + self.DockButton.Scanner:Show() + AoWLogs:Show() + self.Scanning = true + end +end + +function PLUGIN:UpdateZoneStatus() + local zoneText = GetRealZoneText() or GetZoneText() + if(not zoneText or zoneText == "") then + SuperVillain:ExecuteTimer(PLUGIN.UpdateZoneStatus, 5) + return + end + if(zoneText ~= ACTIVE_ZONE) then + ClearCacheScans() + ACTIVE_ZONE = zoneText + PLUGIN.TitleWindow:Clear(); + PLUGIN.TitleWindow:AddMessage(("Scanning %s"):format(ACTIVE_ZONE), 1, 1, 0); + end + local zonePvP = GetZonePVPInfo() + if(zonePvP == "sanctuary" or zoneText == "") then + PLUGIN.Scanning = false + PLUGIN.VS = false + else + PLUGIN.Scanning = true + local inInstance, instanceType = IsInInstance() + if(inInstance and ((instanceType == "party") or (instanceType == "raid"))) then + PLUGIN.Scanning = false + PLUGIN.VS = false + elseif (not zonePvP or (zonePvP == "friendly") or (not UnitIsPVP("player"))) then + PLUGIN.Scanning = false + PLUGIN.VS = false + elseif(instanceType == "pvp" and not PLUGIN.InPVP and PLUGIN.Scanning == true) then + PLUGIN:UpdateCommunicator() + end + end +end + +local function ParseIncomingLog(timestamp, event, eGuid, eName, pGuid) + local cached = SVAOW_Cache[eGuid] + local kos, needsUpdate = false, false + + if(cached) then + kos = true + else + cached = EnemyCache[eGuid] + end + + if(cached and cached.time) then + needsUpdate = (cached.time + 60) < timestamp; + else + cached = AddEnemyScan(eGuid, timestamp) + needsUpdate = true + end + + if(cached) then + if(needsUpdate) then + EnemyAlarm(eName, cached.class, cached.colors, kos) + cached.time = timeStamp + end + + if(pGuid == playerGUID and not AlertedCache[eName]) then + AlertedCache[eName] = true + local incoming = ("%s Attacking You!"):format(eName); + HeadsUpAlarm(incoming, CombatText_StandardScroll, 1, 0.05, 0, "crit") + end + end + + if(pGuid == playerGUID and event == "UNIT_DIED") then + SaveEnemyScan(eGuid, timestamp) + end +end + +local function GetSourceType(guid) + local subStr, binStr, bitVal, srcType + subStr = guid:sub(3, 5) + binStr = ("0x%s"):format(subStr) + bitVal = tonumber(binStr) + srcType = band(bitVal, 0x00F) + return srcType +end + +function PLUGIN:CombatLogScanner(timestamp, event, _, srcGUID, srcName, srcFlags, sourceRaidFlags, dstGUID, dstName, dstFlags, destRaidFlags, _, spellName) + local flagParse = band(srcFlags, COMBATLOG_OBJECT_REACTION_HOSTILE) + local flagged = flagParse == COMBATLOG_OBJECT_REACTION_HOSTILE + + if(flagged) then + 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(event == "SPELL_AURA_APPLIED") then + if(spellName == L["Stealth"] or spellName == L["Prowl"]) then + StealthAlarm(spellName) + end + end + if(not PLUGIN.Scanning) then return end + ParseIncomingLog(timestamp, event, srcGUID, srcName, dstGUID, srcType) + end + end + + 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 + ParseIncomingLog(timestamp, event, dstGUID, dstName, srcGUID, srcType) + end + end + end + + if(PLUGIN.Scanning and event == "PARTY_KILL") then + if(srcGUID == playerGUID and dstName) then + KilledEnemyHandler(dstGUID) + end + 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 + +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("UNIT_FACTION") +SVUIAddonEventHandler:RegisterEvent("UPDATE_BATTLEFIELD_SCORE") + +local Registry_OnEvent = function(self, event, ...) + if(event == "PLAYER_TARGET_CHANGED") then + PLUGIN:TargetChanged() + elseif(event == "COMBAT_LOG_EVENT_UNFILTERED") then + PLUGIN:CombatLogScanner(...) + elseif(event == "PLAYER_ENTERING_WORLD" or event == "UPDATE_BATTLEFIELD_SCORE") then + PLUGIN:UpdateCommunicator() + else + PLUGIN:UpdateZoneStatus() + end +end + +SVUIAddonEventHandler:SetScript("OnEvent", Registry_OnEvent) + +local LogClear_OnClick = function(self, button) + if(IsShiftKeyDown()) then + ClearSavedScans() + PLUGIN:ResetLogs() + end + ClearCacheScans() +end + +local LogClear_OnEnter = function(self) + GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) + GameTooltip:ClearLines() + GameTooltip:AddDoubleLine("Click", "To Clear Scan", 0.1, 1, 0.2, 1, 1, 1) + GameTooltip:AddDoubleLine("[SHIFT] Click", "To Clear All", 0.1, 1, 0.2, 1, 1, 1) + GameTooltip:Show() +end + +local LogClear_OnLeave = function(self) + GameTooltip:Hide() +end + +local onMouseWheel = function(self, delta) + if (delta > 0) then + self:ScrollUp() + elseif (delta < 0) then + self:ScrollDown() + end +end + +local function MakeLogWindow() + AoWLogs:SetFrameStrata("MEDIUM") + AoWLogs:FillInner(SVUI_ArtOfWarDock) + AoWLogs:SetParent(SVUI_ArtOfWarDock) + + local title = CreateFrame("ScrollingMessageFrame", nil, AoWLogs) + title:SetSpacing(4) + title:SetClampedToScreen(false) + title:SetFrameStrata("MEDIUM") + title:SetPoint("TOPLEFT", AoWLogs, "TOPLEFT",0,0) + title:SetPoint("BOTTOMRIGHT", AoWLogs, "TOPRIGHT",0,-20) + title:SetFontTemplate(SuperVillain.Media.font.names, 16, "OUTLINE", "CENTER", "MIDDLE") + title:SetMaxLines(1) + title:EnableMouseWheel(false) + title:SetFading(false) + title:SetInsertMode('TOP') + + title.divider = title:CreateTexture(nil,"OVERLAY") + title.divider:SetTexture(classR, classG, classB) + title.divider:SetAlpha(classA) + title.divider:SetPoint("BOTTOMLEFT") + title.divider:SetPoint("BOTTOMRIGHT") + title.divider:SetHeight(1) + + local clearcount = CreateFrame("Button", nil, AoWLogs) + clearcount:SetPoint("TOPLEFT", title, "BOTTOMLEFT",0,0) + clearcount:SetPoint("BOTTOMRIGHT", title, "BOTTOMRIGHT",0,-20) + clearcount:SetButtonTemplate(true) + clearcount:SetScript("OnEnter", LogClear_OnEnter) + clearcount:SetScript("OnLeave", LogClear_OnLeave) + clearcount:SetScript("OnClick", LogClear_OnClick) + + local summary = CreateFrame("ScrollingMessageFrame", nil, clearcount) + summary:SetSpacing(4) + summary:SetClampedToScreen(false) + summary:SetFrameStrata("MEDIUM") + summary:SetAllPoints(clearcount) + summary:SetFontTemplate(SuperVillain.Media.font.system, 16, "OUTLINE", "CENTER", "MIDDLE") + summary:SetMaxLines(1) + summary:EnableMouse(false) + summary:SetFading(false) + summary:SetInsertMode('TOP') + + summary.divider = summary:CreateTexture(nil,"OVERLAY") + summary.divider:SetTexture(classR, classG, classB) + summary.divider:SetAlpha(classA) + summary.divider:SetPoint("BOTTOMLEFT") + summary.divider:SetPoint("BOTTOMRIGHT") + summary.divider:SetHeight(1) + + local log = CreateFrame("ScrollingMessageFrame", nil, AoWLogs) + log:SetSpacing(4) + log:SetClampedToScreen(false) + log:SetFrameStrata("MEDIUM") + log:SetPoint("TOPLEFT",summary,"BOTTOMLEFT",0,0) + log:SetPoint("BOTTOMRIGHT",AoWLogs,"BOTTOMRIGHT",0,0) + log:SetFont(SuperVillain.Media.font.system, 11, "OUTLINE") + log:SetJustifyH("CENTER") + log:SetJustifyV("MIDDLE") + log:SetShadowColor(0, 0, 0, 0) + log:SetMaxLines(120) + log:EnableMouseWheel(true) + log:SetScript("OnMouseWheel", onMouseWheel) + log:SetFading(false) + log:SetInsertMode('TOP') + + PLUGIN.TitleWindow = title + PLUGIN.SummaryWindow = summary + PLUGIN.LogWindow = log +end +--[[ +########################################################## +BUILD FUNCTION +########################################################## +]]-- +local function LoadOptions() + SuperVillain.Options.args.plugins.args.pluginOptions.args.SVAOW = { + type = "group", + name = L["Art of War"], + childGroups = "tree", + args = { + enable = { + 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 + } + } + } +end + +local function LoadWarVillain() + PLUGIN.db = SuperVillain.db.SVAOW + + if(not SVAOW_Data) then SVAOW_Data = {} end + if(not SVAOW_Cache) then SVAOW_Cache = {} end + + PLUGIN.VS = false; + PLUGIN.Scanning = false; + PLUGIN.InPVP = false + + local holder = CreateFrame("Frame", "SVUI_ArtOfWarDock", SuperDockWindowRight) + holder:SetFrameStrata("BACKGROUND") + MakeLogWindow() + SuperVillain:RegisterDocklet("SVUI_ArtOfWarDock", "Art of War", ICON_FILE) + + local dockbutton = _G["SVUI_ArtOfWarDock_ToolBarButton"]; + + local scanner = CreateFrame("Frame", nil, dockbutton) + scanner:SetAllPoints(dockbutton) + scanner:SetFrameLevel(dockbutton:GetFrameLevel() + 2) + + -- local blip = scanner:CreateTexture(nil, "BORDER") + -- blip:SetAllPoints(scanner) + -- blip:SetTexture(SCAN_ICON) + -- blip:SetVertexColor(0,0.8,0) + -- blip:SetAlpha(0.5) + + scanner.Spinner = scanner:CreateTexture(nil, "ARTWORK", nil, 2) + scanner.Spinner:SetTexture(SCAN_ANIM) + scanner.Spinner:SetVertexColor(0.5,0.5,0.5) + scanner.Spinner:Size(dockbutton:GetSize()) + scanner.Spinner:SetPoint("CENTER", scanner, "CENTER", 0, 0) + + SuperVillain.Animate:Orbit(scanner.Spinner, 8, true) + + dockbutton.Scanner = scanner + + PLUGIN.DockButton = dockbutton + PLUGIN.DockButton.icon:SetTexture(0,0,0,0) + + local width = holder:GetWidth() + local height = holder:GetHeight() + local sectionWidth = (width / 6) - 2 + local sectionHeight = (height / 5) - 2 + local iconSize = sectionHeight * 0.5 + + for i = 1, 5 do + local yOffset = (sectionHeight * (i - 1)) + 2 + + local poiName = ("SVUI_PVPNode%d"):format(i) + local poi = CreateFrame("Frame", poiName, holder) + poi:SetSize((width - 2), sectionHeight) + poi:SetPoint("TOP", holder, "TOP", 0, -yOffset) + poi:SetPanelTemplate("Transparent") + + local safe = CreateFrame("Button", nil, poi) + safe:SetSize(sectionWidth, sectionHeight) + safe:SetPoint("RIGHT", poi, "RIGHT", -2, 0) + safe:SetButtonTemplate() + safe:SetPanelColor("green") + local sicon = safe:CreateTexture(nil, "OVERLAY") + sicon:SetPoint("CENTER", safe, "CENTER", 0, 0) + sicon:SetSize(iconSize,iconSize) + sicon:SetTexCoord(0.1, 0.9, 0.1, 0.9) + sicon:SetTexture(PVP_SAFE) + safe:SetScript("OnEnter", Safe_OnEnter) + safe:SetScript("OnLeave", Safe_OnLeave) + safe:SetScript("OnClick", Safe_OnClick) + + poi.Safe = safe + + local help = CreateFrame("Button", nil, poi) + help:SetSize(sectionWidth, sectionHeight) + help:SetPoint("RIGHT", safe, "LEFT", -2, 0) + help:SetButtonTemplate() + help:SetPanelColor("red") + local hicon = help:CreateTexture(nil, "OVERLAY") + hicon:SetPoint("CENTER", help, "CENTER", 0, 0) + hicon:SetSize(iconSize,iconSize) + hicon:SetTexCoord(0.1, 0.9, 0.1, 0.9) + hicon:SetTexture(PVP_HELP) + help:SetScript("OnEnter", Help_OnEnter) + help:SetScript("OnLeave", Help_OnLeave) + help:SetScript("OnClick", Help_OnClick) + + poi.Help = help + + poi.Text = poi:CreateFontString(nil,"OVERLAY") + poi.Text:SetFont(SuperVillain.Media.font.roboto, 12, "NONE") + poi.Text:SetPoint("TOPLEFT", poi, "TOPLEFT", 2, 0) + poi.Text:SetPoint("BOTTOMRIGHT", help, "BOTTOMLEFT", -2, 0) + poi.Text:SetJustifyH("CENTER") + poi.Text:SetText("") + poi:Hide() + end + + holder:Hide() + + PLUGIN:ResetLogs() + + +end + +CONFIGS["SVAOW"] = { + ["enable"] = true +} + +SuperVillain.Registry:NewScript(LoadWarVillain) +SuperVillain.Registry:NewPlugin(PLUGIN, "SVAOW", LoadOptions) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.toc b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.toc new file mode 100644 index 0000000..134f974 --- /dev/null +++ b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.toc @@ -0,0 +1,10 @@ +## Interface: 50400 +## Author: Munglunch +## Version: 1.0 +## Title: |cffFF9900SVUI |r|cffFFEF00Art of War|r +## Notes: Supervillain UI [|cff9911FFPvP Tools|r]. +## SavedVariables: SVAOW_Data +## SavedVariablesPerCharacter: SVAOW_Cache +## RequiredDeps: SVUI + +SVUI_ArtOfWar.lua diff --git a/Interface/AddOns/SVUI_ArtOfWar/artwork/DOCK-PVP.blp b/Interface/AddOns/SVUI_ArtOfWar/artwork/DOCK-PVP.blp new file mode 100644 index 0000000..a51de9a Binary files /dev/null and b/Interface/AddOns/SVUI_ArtOfWar/artwork/DOCK-PVP.blp differ diff --git a/Interface/AddOns/SVUI_ArtOfWar/artwork/DOCK-SCAN.blp b/Interface/AddOns/SVUI_ArtOfWar/artwork/DOCK-SCAN.blp new file mode 100644 index 0000000..8bc4525 Binary files /dev/null and b/Interface/AddOns/SVUI_ArtOfWar/artwork/DOCK-SCAN.blp differ diff --git a/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-INCOMING.blp b/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-INCOMING.blp new file mode 100644 index 0000000..f72c045 Binary files /dev/null and b/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-INCOMING.blp differ diff --git a/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-SAFE.blp b/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-SAFE.blp new file mode 100644 index 0000000..4c84f3e Binary files /dev/null and b/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-SAFE.blp differ diff --git a/Interface/AddOns/SVUI_ArtOfWar/artwork/SCAN-ANIMATION.blp b/Interface/AddOns/SVUI_ArtOfWar/artwork/SCAN-ANIMATION.blp new file mode 100644 index 0000000..53d920b Binary files /dev/null and b/Interface/AddOns/SVUI_ArtOfWar/artwork/SCAN-ANIMATION.blp differ diff --git a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua index 74702c8..f69f641 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua @@ -120,14 +120,12 @@ end; SET PACKAGE OPTIONS ########################################################## ]]-- -SuperVillain.Options.args = { - SVUI_Header = { - order = 1, - type = "header", - name = "You are using |cffff9900Super Villain UI|r - "..L["Version"]..format(": |cff99ff33%s|r", SuperVillain.version), - width = "full" - } -}; +SuperVillain.Options.args.SVUI_Header = { + order = 1, + type = "header", + name = "You are using |cffff9900Super Villain UI|r - "..L["Version"]..format(": |cff99ff33%s|r", SuperVillain.___ver), + width = "full" +} SuperVillain.Options.args.primary = { type = "group", @@ -323,6 +321,14 @@ SuperVillain.Options.args.common = { get = function(j)return SuperVillain.db.system.comix end, set = function(j,value)SuperVillain.db.system.comix = value;SuperVillain:ToggleComix()end }, + bigComix = { + order = 1, + type = 'toggle', + name = L["Include Large Comics"], + disabled = function() return not SuperVillain.db.system.comix end, + get = function(j) return SuperVillain.db.system.bigComix end, + set = function(j,value) SuperVillain.db.system.bigComix = value end + }, bubbles = { order = 2, type = "toggle", @@ -813,7 +819,7 @@ local s = "\n"; local p = "\n"..format("|cff4f4f4f%s|r", "---------------------------------------------"); local t = {"Munglunch", "Elv", "Tukz", "Azilroka", "Sortokk", "AlleyKat", "Quokka", "Haleth", "P3lim", "Haste", "Totalpackage", "Kryso", "Thepilli"}; local u = {"Wowinterface Community", "Doonga - (The man who keeps me busy)", "Judicate", "Cazart506", "Movster", "MuffinMonster", "Joelsoul", "Trendkill09", "Luamar", "Zharooz", "Lyn3x5", "Madh4tt3r", "Xarioth", "Sinnisterr", "Melonmaniac", "Hojowameeat", "Xandeca", "Bkan", "Daigan - (My current 2nd in command)", "AtomicKiller", "Meljen", "Moondoggy", "Stormblade", "Schreibstift", "Anj", "Risien"}; -local v = {"Movster", "Cazart506", "FaolanKing", "FaolanKing", "Other Silent Partners.. (Let me know if I have forgotten you)"}; +local v = {"Movster", "Cazart506", "FaolanKing", "Doonga", "Other Silent Partners.. (Let me know if I have forgotten you)"}; local credit_header = format("|cffff9900%s|r", "SUPERVILLAIN CREDITS:")..p; local credit_sub = format("|cffff9900%s|r", "CREATED BY:").." Munglunch"..p; local credit_sub2 = format("|cffff9900%s|r", "USING ORIGINAL CODE BY:").." Elv, Tukz, Azilroka, Sortokk"..p; @@ -821,6 +827,7 @@ local special_thanks = format("|cffff9900%s|r", "A VERY SPECIAL THANKS TO: ").. local coding = format("|cff3399ff%s|r", L['CODE MONKEYS (aka ORIGINAL AUTHORS):'])..p; local testing = format("|cffaa33ff%s|r", L['PERFECTIONISTS (aka TESTERS):'])..p; local doners = format("|cff99ff33%s|r", L['KINGPINS (aka INVESTORS):'])..p; +local music = format("|cff00ccff%s|r", 'Theme Song By: Fingathing [taken from the song: SuperHero Music]'); tsort(t, function(o,n) return o < n end) for _, x in pairs(t) do @@ -835,7 +842,7 @@ for _, z in pairs(v) do dnt = dnt..s..z end; -local creditsString = credit_header..'\n'..credit_sub..'\n'..credit_sub2..'\n'..special_thanks..'\n\n'..coding..q..'\n\n'..testing..r..'\n\n'..doners..dnt..'\n\n'; +local creditsString = credit_header..'\n'..credit_sub..'\n'..credit_sub2..'\n'..special_thanks..'\n\n'..coding..q..'\n\n'..testing..r..'\n\n'..doners..dnt..'\n\n'..music..'\n\n'; SuperVillain.Options.args.credits = { type = "group", diff --git a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc index 136fef4..bb96cbb 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc +++ b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc @@ -1,6 +1,6 @@ ## Interface: 50400 ## Author: Munglunch, Elv -## Version: 4.076 +## Version: 4.08 ## Title: |cffFF9900SVUI |r|cffFFEF00Config O Matic|r ## Notes: Supervillain UI [|cff9911FFConfig Options|r] ## RequiredDeps: SVUI 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 b6b59f0..01c1808 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(nil) + button.icon:SetTexture(0,0,0,0) 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 9e06049..f8411b4 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(nil) + highlight:SetTexture(0,0,0,0) 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 0c8701b..6d304c7 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(nil) + frame.bgTex:SetTexture(0,0,0,0) 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 6fbe066..0e6236d 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(nil) + button.icon:SetTexture(0,0,0,0) 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 9e06049..f8411b4 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(nil) + highlight:SetTexture(0,0,0,0) highlight:SetAllPoints() highlight:SetBlendMode("ADD") diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/_load.xml b/Interface/AddOns/SVUI_ConfigOMatic/modules/_load.xml index c2f0d4e..8e786b1 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/_load.xml +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/_load.xml @@ -12,7 +12,6 @@ <Script file='art.lua'/> <Script file='tip.lua'/> <Include file='units\_load.xml'/> - <Script file='mode.lua'/> <!-- <Script file='ct.lua'/> --> <Script file='dynamic.lua'/> <Script file='profiles.lua'/> diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/chat.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/chat.lua index dcc2bd8..0e8134f 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/chat.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/chat.lua @@ -66,42 +66,34 @@ SuperVillain.Options.args.SVChat={ name = L["Sticky Chat"], desc = L["When opening the Chat Editbox to type a message having this option set means it will retain the last channel you spoke in. If this option is turned off opening the Chat Editbox should always default to the SAY channel."] }, - saveChats = { - order = 2, - type = "toggle", - name = L["Save Chats"], - desc = L["Retain chat messages even after logging out."], - get = function(a)return SuperVillain.db.SVChat[a[#a]]end, - set = function(a,b)MOD:ChangeDBVar(b,a[#a]);MOD:ReLoad() end, - }, url = { - order = 3, + order = 2, type = "toggle", name = L["URL Links"], desc = L["Attempt to create URL links inside the chat."], - set = function(a,b)MOD:ChangeDBVar(b,a[#a]); MOD:UpdateUpvalues(); end + set = function(a,b) MOD:ChangeDBVar(b,a[#a]) end }, hyperlinkHover = { - order = 4, + order = 3, type = "toggle", name = L["Hyperlink Hover"], desc = L["Display the hyperlink tooltip while hovering over a hyperlink."], - set = function(a,b)MOD:ChangeDBVar(b,a[#a]); MOD:ToggleHyperlinks(b); end + set = function(a,b) MOD:ChangeDBVar(b,a[#a]); MOD:ToggleHyperlinks(b); end }, smileys = { - order = 5, + order = 4, type = "toggle", name = L["Emotion Icons"], desc = L["Display emotion icons in chat."] }, tabStyled = { - order = 6, + order = 5, type = "toggle", name = L["Custom Tab Style"], - set = function(a,b)MOD:ChangeDBVar(b,a[#a]);SuperVillain:StaticPopup_Show("RL_CLIENT") end, + set = function(a,b) MOD:ChangeDBVar(b,a[#a]);SuperVillain:StaticPopup_Show("RL_CLIENT") end, }, timeStampFormat = { - order = 7, + order = 6, type = "select", name = TIMESTAMPS_LABEL, desc = OPTION_TOOLTIP_TIMESTAMPS, @@ -116,21 +108,21 @@ SuperVillain.Options.args.SVChat={ } }, psst = { - order = 9, + order = 7, type = "select", dialogControl = "LSM30_Sound", name = L["Whisper Alert"], disabled = function()return not SuperVillain.db.SVChat.psst end, values = AceGUIWidgetLSMlists.sound, - set = function(a,b)MOD:ChangeDBVar(b,a[#a]); MOD:UpdateUpvalues(); end + set = function(a,b) MOD:ChangeDBVar(b,a[#a]) end }, spacer2 = { - order = 10, + order = 8, type = "description", name = "" }, throttleInterval = { - order = 11, + order = 9, type = "range", name = L["Spam Interval"], desc = L["Prevent the same messages from displaying in chat more than once within this set amount of seconds, set to zero to disable."], @@ -138,7 +130,7 @@ SuperVillain.Options.args.SVChat={ max = 120, step = 1, width = "full", - set = function(a,b)MOD:ChangeDBVar(b,a[#a]); MOD:UpdateUpvalues(b); end + set = function(a,b) MOD:ChangeDBVar(b,a[#a]) end }, } }, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/plate.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/plate.lua index 7794e4c..0c1cc23 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/plate.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/plate.lua @@ -444,7 +444,6 @@ SuperVillain.Options.args.SVPlate={ desc = L["Match the color of the healthbar."], set = function(key, value) MOD:ChangeDBVar(value, key[#key], "pointer"); - MOD:UpdateDataLocals() if value then WorldFrame.elapsed = 3 end diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/party.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/party.lua index 1e797b1..43851eb 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/party.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/party.lua @@ -247,12 +247,14 @@ SuperVillain.Options.args.SVUnit.args.party ={ name = L['Group By'], desc = L['Set the order that the group will sort.'], type = 'select', - values ={ - ['CLASS'] = CLASS, - ['ROLE'] = ROLE, - ['NAME'] = NAME, - ['MTMA'] = L['Main Tanks / Main Assist'], - ['GROUP'] = GROUP, + values = { + ["CLASS"] = CLASS, + ["ROLE"] = ROLE.."(Tanks, Healers, DPS)", + ["ROLE_TDH"] = ROLE.."(Tanks, DPS, Healers)", + ["ROLE_HDT"] = ROLE.."(Healers, DPS, Tanks)", + ["ROLE_HTD"] = ROLE.."(Healers, Tanks, DPS)", + ["NAME"] = NAME, + ["GROUP"] = GROUP, }, }, sortDir ={ diff --git a/Interface/AddOns/SVUI_Laborer/Bindings.xml b/Interface/AddOns/SVUI_Laborer/Bindings.xml new file mode 100644 index 0000000..b126d31 --- /dev/null +++ b/Interface/AddOns/SVUI_Laborer/Bindings.xml @@ -0,0 +1,14 @@ +<Bindings> + <Binding name="Fishing Mode" header="SVUILABORER" runOnUp="false"> + SVUIFishingMode() + </Binding> + <Binding name="Farming Mode" runOnUp="false"> + SVUIFarmingMode() + </Binding> + <Binding name="Archaeology Mode" runOnUp="false"> + SVUIArchaeologyMode() + </Binding> + <Binding name="Cooking Mode" runOnUp="false"> + SVUICookingMode() + </Binding> +</Bindings> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.lua b/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.lua new file mode 100644 index 0000000..6f9bda9 --- /dev/null +++ b/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.lua @@ -0,0 +1,678 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local type = _G.type; +local string = _G.string; +local math = _G.math; +local table = _G.table; +local rept = string.rep; +local tsort,twipe = table.sort,table.wipe; +local floor,ceil = math.floor, math.ceil; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SVUIAddOnName, PLUGIN = ...; +local SuperVillain, L, G, CONFIGS = unpack(SVUI); +local NewHook = hooksecurefunc; +local SVUIAddonEventHandler = CreateFrame("Frame", nil) + +local version = GetAddOnMetadata(..., "Version") +local playerGUID = UnitGUID('player') +local classColor = RAID_CLASS_COLORS +PLUGIN = SuperVillain:Prototype(SVUIAddOnName, version) + +_G["LaborVillain"] = PLUGIN; +--[[ +########################################################## +GLOBAL BINDINGS +########################################################## +]]-- +BINDING_HEADER_SVUILABORER = "SuperVillain UI: Laborer"; + +function SVUIFishingMode() + if InCombatLockdown() then SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); return; end + if PLUGIN.CurrentMode and PLUGIN.CurrentMode == "Fishing" then PLUGIN:EndJobModes() else PLUGIN:SetJobMode("Fishing") end +end + +function SVUIFarmingMode() + if InCombatLockdown() then SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); return; end + if PLUGIN.CurrentMode and SuperVillain.CurrentMode == "Farming" then PLUGIN:EndJobModes() else PLUGIN:SetJobMode("Farming") end +end + +function SVUIArchaeologyMode() + if InCombatLockdown() then SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); return; end + if PLUGIN.CurrentMode and PLUGIN.CurrentMode == "Archaeology" then PLUGIN:EndJobModes() else PLUGIN:SetJobMode("Archaeology") end +end + +function SVUICookingMode() + if InCombatLockdown() then SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); return; end + if PLUGIN.CurrentMode and PLUGIN.CurrentMode == "Cooking" then PLUGIN:EndJobModes() else PLUGIN:SetJobMode("Cooking") end +end +--[[ +########################################################## +LOCALIZED GLOBALS +########################################################## +]]-- +local LOOT_ITEM_SELF = _G.LOOT_ITEM_SELF; +local LOOT_ITEM_CREATED_SELF = _G.LOOT_ITEM_CREATED_SELF; +local LOOT_ITEM_SELF_MULTIPLE = _G.LOOT_ITEM_SELF_MULTIPLE +local LOOT_ITEM_PUSHED_SELF_MULTIPLE = _G.LOOT_ITEM_PUSHED_SELF_MULTIPLE +local LOOT_ITEM_PUSHED_SELF = _G.LOOT_ITEM_PUSHED_SELF +--[[ +########################################################## +LOCAL VARS +########################################################## +]]-- +local currentModeKey = false; +local ModeLogsFrame = CreateFrame("Frame", "SVUI_ModeLogsFrame", UIParent) +local classColors = SVUI_CLASS_COLORS[SuperVillain.class] +local classR, classG, classB = classColors.r, classColors.g, classColors.b +local classA = 0.35 +local lastClickTime; +local ICON_FILE = [[Interface\AddOns\SVUI_Laborer\artwork\DOCK-LABORER]] +local COOK_ICON = [[Interface\AddOns\SVUI_Laborer\artwork\LABORER-COOKING]] +local FISH_ICON = [[Interface\AddOns\SVUI_Laborer\artwork\LABORER-FISHING]] +local ARCH_ICON = [[Interface\AddOns\SVUI_Laborer\artwork\LABORER-SURVEY]] +local FARM_ICON = [[Interface\AddOns\SVUI_Laborer\artwork\LABORER-FARMING]] +--[[ +########################################################## +LOCAL FUNCTIONS +########################################################## +]]-- +local function SendModeMessage(...) + if not CombatText_AddMessage then return end; + CombatText_AddMessage(...) +end; + +local function onMouseWheel(self, delta) + if (delta > 0) then + self:ScrollUp() + elseif (delta < 0) then + self:ScrollDown() + end +end; + +local function CheckForDoubleClick() + if lastClickTime then + local pressTime = GetTime() + local doubleTime = pressTime - lastClickTime + if ( (doubleTime < 0.4) and (doubleTime > 0.05) ) then + lastClickTime = nil + return true + end + end + lastClickTime = GetTime() + return false +end +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +function PLUGIN:WorldFrameHook(button) + if InCombatLockdown() then return end + if(currentModeKey and button == "RightButton" and CheckForDoubleClick()) then + local handle = PLUGIN[currentModeKey]; + if(handle and handle.Bind) then + handle.Bind() + end + end +end + +function SVUI_ModeCaptureWindow:PostClickHandler() + if InCombatLockdown() then + self:RegisterEvent("PLAYER_REGEN_ENABLED") + return + end + ClearOverrideBindings(self) + self.Grip:Hide() +end + +function PLUGIN:LaborerReset() + self.TitleWindow:Clear(); + self.LogWindow:Clear(); + self.TitleWindow:AddMessage("Laborer Modes", 1, 1, 0); + self.LogWindow:AddMessage("Select a Tool to Begin", 1, 1, 1); + self.LogWindow:AddMessage(" ", 0, 1, 1); + collectgarbage("collect") +end + +function PLUGIN:ModeLootLoader(mode, msg, info) + self.TitleWindow:Clear(); + self.LogWindow:Clear(); + self.ModeAlert.HelpText = info + if(mode and self[mode]) then + if(self[mode].Log) then + local stored = self[mode].Log; + self.TitleWindow:AddMessage(msg, 1, 1, 1); + local previous = false + for name,data in pairs(stored) do + if type(data) == "table" and data.amount and data.texture then + self.LogWindow:AddMessage("|cff55FF55"..data.amount.." x|r |T".. data.texture ..":16:16:0:0:64:64:4:60:4:60|t".." "..name, 0.8, 0.8, 0.8); + previous = true + end + end; + if(previous) then + self.LogWindow:AddMessage("----------------", 0, 0, 0); + self.LogWindow:AddMessage(" ", 0, 0, 0); + end + self.LogWindow:AddMessage(info, 1, 1, 1); + self.LogWindow:AddMessage(" ", 1, 1, 1); + end + else + self:LaborerReset() + end; +end + +function PLUGIN:CheckForModeLoot(msg) + local item, amt = SuperVillain:DeFormat(msg, LOOT_ITEM_CREATED_SELF) + if not item then + item = SuperVillain:DeFormat(msg, LOOT_ITEM_SELF_MULTIPLE) + if not item then + item = SuperVillain:DeFormat(msg, LOOT_ITEM_SELF) + if not item then + item = SuperVillain:DeFormat(msg, LOOT_ITEM_PUSHED_SELF_MULTIPLE) + if not item then + item, amt = SuperVillain:DeFormat(msg, LOOT_ITEM_PUSHED_SELF) + --print(item) + end + end + end + end + --print(msg) + if item then + if not amt then + amt = 1 + end + return item, amt + end +end; + +function PLUGIN:SetJobMode(category) + if InCombatLockdown() then return end + if(not category) then + self:EndJobModes() + return; + end; + self:ChangeModeGear() + if(currentModeKey and self[currentModeKey] and self[currentModeKey].Disable) then + self[currentModeKey].Disable() + end + currentModeKey = category; + if(self[category] and self[category].Enable) then + self[category].Enable() + else + self:EndJobModes() + return; + end +end + +function PLUGIN:EndJobModes() + if(currentModeKey and self[currentModeKey] and self[currentModeKey].Disable) then + self[currentModeKey].Disable() + end + currentModeKey = false; + if SVUI_ModesDockFrame:IsShown() then SVUI_ModesDockFrame_ToolBarButton:Click() end + self:ChangeModeGear() + self.ModeAlert:Hide(); + SendModeMessage("Mode Disabled", CombatText_StandardScroll, 1, 0.35, 0); + PlaySound("UndeadExploration"); + self:LaborerReset() +end + +function PLUGIN:ChangeModeGear() + if(not self.InModeGear) then return end + if InCombatLockdown() then + _G["SVUI_ModeCaptureWindow"]:RegisterEvent("PLAYER_REGEN_ENABLED"); + return + else + if(self.WornItems["HEAD"]) then + EquipItemByName(self.WornItems["HEAD"]) + self.WornItems["HEAD"] = false + end + if(self.WornItems["TAB"]) then + EquipItemByName(self.WornItems["TAB"]) + self.WornItems["TAB"] = false + end + if(self.WornItems["MAIN"]) then + EquipItemByName(self.WornItems["MAIN"]) + self.WornItems["MAIN"] = false + end + if(self.WornItems["OFF"]) then + EquipItemByName(self.WornItems["OFF"]) + self.WornItems["OFF"] = false + end + + self.InModeGear = false + end +end + +function PLUGIN:UpdateLogWindow() + self.LogWindow:SetFont(SuperVillain.Media.font.system, self.db.fontSize, "OUTLINE") +end + +function PLUGIN:MakeLogWindow() + local DOCK_WIDTH = SVUI_ModesDockFrame:GetWidth(); + local DOCK_HEIGHT = SVUI_ModesDockFrame:GetHeight(); + + ModeLogsFrame:SetFrameStrata("MEDIUM") + ModeLogsFrame:SetPoint("TOPLEFT",SVUI_ModeButton1,"TOPRIGHT",5,-5) + ModeLogsFrame:SetPoint("BOTTOMRIGHT",SVUI_ModesDockFrame,"BOTTOMRIGHT",-5,5) + ModeLogsFrame:SetParent(SVUI_ModesDockFrame) + + local title = CreateFrame("ScrollingMessageFrame", nil, ModeLogsFrame) + title:SetSpacing(4) + title:SetClampedToScreen(false) + title:SetFrameStrata("MEDIUM") + title:SetPoint("TOPLEFT",ModeLogsFrame,"TOPLEFT",0,0) + title:SetPoint("BOTTOMRIGHT",ModeLogsFrame,"TOPRIGHT",0,-20) + title:SetFontTemplate(UNIT_NAME_FONT, 16, "OUTLINE", "CENTER", "MIDDLE") + title:SetMaxLines(1) + title:EnableMouseWheel(false) + title:SetFading(false) + title:SetInsertMode('TOP') + + title.divider = title:CreateTexture(nil,"OVERLAY") + title.divider:SetTexture(classR, classG, classB) + title.divider:SetAlpha(classA) + title.divider:SetPoint("BOTTOMLEFT") + title.divider:SetPoint("BOTTOMRIGHT") + title.divider:SetHeight(1) + + local topleftline = title:CreateTexture(nil,"OVERLAY") + topleftline:SetTexture(classR, classG, classB) + topleftline:SetAlpha(classA) + topleftline:SetPoint("TOPLEFT") + topleftline:SetPoint("BOTTOMLEFT") + topleftline:SetWidth(1) + + local log = CreateFrame("ScrollingMessageFrame", nil, ModeLogsFrame) + log:SetSpacing(4) + log:SetClampedToScreen(false) + log:SetFrameStrata("MEDIUM") + log:SetPoint("TOPLEFT",title,"BOTTOMLEFT",0,0) + log:SetPoint("BOTTOMRIGHT",ModeLogsFrame,"BOTTOMRIGHT",0,0) + log:SetFont(SuperVillain.Media.font.system, self.db.fontSize, "OUTLINE") + log:SetJustifyH("CENTER") + log:SetJustifyV("MIDDLE") + log:SetShadowColor(0, 0, 0, 0) + log:SetMaxLines(120) + log:EnableMouseWheel(true) + log:SetScript("OnMouseWheel", onMouseWheel) + log:SetFading(false) + log:SetInsertMode('TOP') + + local bottomleftline = log:CreateTexture(nil,"OVERLAY") + bottomleftline:SetTexture(classR, classG, classB) + bottomleftline:SetAlpha(classA) + bottomleftline:SetPoint("TOPLEFT") + bottomleftline:SetPoint("BOTTOMLEFT") + bottomleftline:SetWidth(1) + + self.TitleWindow = title + self.LogWindow = log + + self.ListenerEnabled = false; + SuperVillain:RegisterDocklet("SVUI_ModesDockFrame", "Laborer Modes", ICON_FILE, false) + self:LaborerReset() +end + +function PLUGIN:SKILL_LINES_CHANGED() + if(currentModeKey and self[currentModeKey] and self[currentModeKey].Update) then + self[currentModeKey].Update() + end +end +--[[ +########################################################## +BUILD FUNCTION / UPDATE +########################################################## +]]-- +local ModeAlert_OnEnter = function(self) + if InCombatLockdown() then return; end + self:SetBackdropColor(0.9, 0.15, 0.1) + GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) + GameTooltip:ClearLines() + GameTooltip:AddLine(self.ModeText, 1, 1, 0) + GameTooltip:AddLine("") + GameTooltip:AddLine("Click here end this mode.", 0.79, 0.23, 0.23) + GameTooltip:AddLine("") + GameTooltip:AddLine(self.HelpText, 0.74, 1, 0.57) + GameTooltip:Show() +end + +local ModeAlert_OnLeave = function(self) + GameTooltip:Hide() + if InCombatLockdown() then return end; + self:SetBackdropColor(0.25, 0.52, 0.1) +end + +local ModeAlert_OnHide = function() + if InCombatLockdown() then + SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); + return; + end + SuperDockAlertRight:Deactivate() +end + +local ModeAlert_OnShow = function(self) + if InCombatLockdown() then + SuperVillain:AddonMessage(ERR_NOT_IN_COMBAT); + self:Hide() + return; + end + SuperVillain:SecureFadeIn(self, 0.3, 0, 1) + SuperDockAlertRight:Activate(self) +end + +local ModeAlert_OnMouseDown = function(self) + PLUGIN:EndJobModes() + SuperVillain:SecureFadeOut(self, 0.5, 1, 0, true) +end + +local ModeButton_OnEnter = function(self) + if InCombatLockdown() then return; end + local name = self.modeName + self.icon:SetGradient(unpack(SuperVillain.Media.gradient.yellow)) + GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) + GameTooltip:ClearLines() + GameTooltip:AddLine(L[name .. " Mode"], 1, 1, 1) + GameTooltip:Show() +end + +local ModeButton_OnLeave = function(self) + if InCombatLockdown() then return; end + self.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + GameTooltip:Hide() +end + +local ModeButton_OnMouseDown = function(self) + local name = self.modeName + PLUGIN:SetJobMode(name) +end +--[[ +########################################################## +BUILD FUNCTION +########################################################## +]]-- +local function LoadOptions() + SuperVillain.Options.args.plugins.args.pluginOptions.args.SVLaborer = { + type = 'group', + name = L['Laborer'], + get = function(key)return SuperVillain.db.SVLaborer[key[#key]]end, + set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key]) end, + args = { + intro = { + order = 1, + type = 'description', + name = L["Options for laborer modes"] + }, + enable = { + type = "toggle", + order = 2, + name = L['Enable'], + desc = L['Enable/Disable the Laborer dock.'], + get = function(key)return SuperVillain.db.SVLaborer[key[#key]]end, + set = function(key, value)SuperVillain.db.SVLaborer.enable = value;SuperVillain:StaticPopup_Show("RL_CLIENT")end + }, + fontSize = { + order = 3, + name = L["Font Size"], + desc = L["Set the font size of the log window."], + type = "range", + min = 6, + max = 22, + step = 1, + set = function(j,value)PLUGIN:ChangeDBVar(value,j[#j]);PLUGIN:UpdateLogWindow()end + }, + fishing = { + order = 4, + type = "group", + name = L["Fishing Mode Settings"], + guiInline = true, + args = { + autoequip = { + type = "toggle", + order = 1, + name = L['AutoEquip'], + desc = L['Enable/Disable automatically equipping fishing gear.'], + get = function(key)return SuperVillain.db.SVLaborer.fishing[key[#key]]end, + set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key], "fishing")end + } + } + }, + cooking = { + order = 5, + type = "group", + name = L["Cooking Mode Settings"], + guiInline = true, + args = { + autoequip = { + type = "toggle", + order = 1, + name = L['AutoEquip'], + desc = L['Enable/Disable automatically equipping cooking gear.'], + get = function(key)return SuperVillain.db.SVLaborer.cooking[key[#key]]end, + set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key], "cooking")end + } + } + }, + farming = { + order = 6, + type = "group", + name = L["Farming Mode Settings"], + guiInline = true, + get = function(key)return SuperVillain.db.SVLaborer.farming[key[#key]]end, + set = function(key, value)SuperVillain.db.SVLaborer.farming[key[#key]] = value end, + args = { + buttonsize = { + type = 'range', + name = L['Button Size'], + desc = L['The size of the action buttons.'], + min = 15, + max = 60, + step = 1, + order = 1, + set = function(key, value) + PLUGIN:ChangeDBVar(value, key[#key],"farming"); + PLUGIN:RefreshFarmingTools() + end, + }, + buttonspacing = { + type = 'range', + name = L['Button Spacing'], + desc = L['The spacing between buttons.'], + min = 1, + max = 10, + step = 1, + order = 2, + set = function(key, value) + PLUGIN:ChangeDBVar(value, key[#key],"farming"); + PLUGIN:RefreshFarmingTools() + end, + }, + onlyactive = { + order = 3, + type = 'toggle', + name = L['Only active buttons'], + desc = L['Only show the buttons for the seeds, portals, tools you have in your bags.'], + set = function(key, value) + PLUGIN:ChangeDBVar(value, key[#key],"farming"); + PLUGIN:RefreshFarmingTools() + end, + }, + droptools = { + order = 4, + type = 'toggle', + name = L['Drop '], + desc = L['Automatically drop tools from your bags when leaving the farming area.'], + }, + toolbardirection = { + order = 5, + type = 'select', + name = L['Bar Direction'], + desc = L['The direction of the bar buttons (Horizontal or Vertical).'], + set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key],"farming"); PLUGIN:RefreshFarmingTools() end, + values = { + ['VERTICAL'] = L['Vertical'], ['HORIZONTAL'] = L['Horizontal'] + } + } + } + } + } + } +end + +function LoadLaborVillain() + PLUGIN.db = SuperVillain.db.SVLaborer + lastClickTime = nil; + PLUGIN.WornItems = {}; + PLUGIN.InModeGear = false; + + local ALERT_HEIGHT = 60; + local DOCK_WIDTH = SuperDockWindowRight:GetWidth(); + local DOCK_HEIGHT = SuperDockWindowRight:GetHeight(); + local BUTTON_SIZE = (DOCK_HEIGHT * 0.25) - 4; + + local modesDocklet = CreateFrame("Frame", "SVUI_ModesDockFrame", SuperDockWindowRight) + modesDocklet:SetWidth(DOCK_WIDTH - 4); + modesDocklet:SetHeight(DOCK_HEIGHT - 4); + modesDocklet:SetPoint("CENTER",SuperDockWindowRight,"CENTER",0,0); + + local modesToolBar = CreateFrame("Frame", "SVUI_ModesDockToolBar", modesDocklet) + modesToolBar:SetWidth(BUTTON_SIZE + 4); + modesToolBar:SetHeight((BUTTON_SIZE + 4) * 4); + modesToolBar:SetPoint("BOTTOMLEFT",modesDocklet,"BOTTOMLEFT",0,0); + + local mode4Button = CreateFrame("Frame", "SVUI_ModeButton4", modesToolBar) + mode4Button:SetPoint("BOTTOM",modesToolBar,"BOTTOM",0,0) + mode4Button:SetSize(BUTTON_SIZE,BUTTON_SIZE) + mode4Button.icon = mode4Button:CreateTexture(nil, 'OVERLAY') + mode4Button.icon:SetTexture(FARM_ICON) + mode4Button.icon:FillInner(mode4Button) + mode4Button.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + mode4Button.modeName = "Farming" + mode4Button:SetScript('OnEnter', ModeButton_OnEnter) + mode4Button:SetScript('OnLeave', ModeButton_OnLeave) + mode4Button:SetScript('OnMouseDown', ModeButton_OnMouseDown) + + local mode3Button = CreateFrame("Frame", "SVUI_ModeButton3", modesToolBar) + mode3Button:SetPoint("BOTTOM",mode4Button,"TOP",0,2) + mode3Button:SetSize(BUTTON_SIZE,BUTTON_SIZE) + mode3Button.icon = mode3Button:CreateTexture(nil, 'OVERLAY') + mode3Button.icon:SetTexture(ARCH_ICON) + mode3Button.icon:FillInner(mode3Button) + mode3Button.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + mode3Button.modeName = "Archaeology" + mode3Button:SetScript('OnEnter', ModeButton_OnEnter) + mode3Button:SetScript('OnLeave', ModeButton_OnLeave) + mode3Button:SetScript('OnMouseDown', ModeButton_OnMouseDown) + + local mode2Button = CreateFrame("Frame", "SVUI_ModeButton2", modesToolBar) + mode2Button:SetPoint("BOTTOM",mode3Button,"TOP",0,2) + mode2Button:SetSize(BUTTON_SIZE,BUTTON_SIZE) + mode2Button.icon = mode2Button:CreateTexture(nil, 'OVERLAY') + mode2Button.icon:SetTexture(FISH_ICON) + mode2Button.icon:FillInner(mode2Button) + mode2Button.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + mode2Button.modeName = "Fishing" + mode2Button:SetScript('OnEnter', ModeButton_OnEnter) + mode2Button:SetScript('OnLeave', ModeButton_OnLeave) + mode2Button:SetScript('OnMouseDown', ModeButton_OnMouseDown) + + local mode1Button = CreateFrame("Frame", "SVUI_ModeButton1", modesToolBar) + mode1Button:SetPoint("BOTTOM",mode2Button,"TOP",0,2) + mode1Button:SetSize(BUTTON_SIZE,BUTTON_SIZE) + mode1Button.icon = mode1Button:CreateTexture(nil, 'OVERLAY') + mode1Button.icon:SetTexture(COOK_ICON) + mode1Button.icon:FillInner(mode1Button) + mode1Button.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + mode1Button.modeName = "Cooking" + mode1Button:SetScript('OnEnter', ModeButton_OnEnter) + mode1Button:SetScript('OnLeave', ModeButton_OnLeave) + mode1Button:SetScript('OnMouseDown', ModeButton_OnMouseDown) + + local ModeAlert = CreateFrame("Frame", nil, SuperDockAlertRight) + ModeAlert:SetAllPoints(SuperDockAlertRight) + ModeAlert:SetBackdrop({ + bgFile = [[Interface\AddOns\SVUI\assets\artwork\Bars\HALFTONE]], + edgeFile = [[Interface\BUTTONS\WHITE8X8]], + tile = true, + tileSize = 64, + edgeSize = 1, + insets = { + left = 1, + right = 1, + top = 1, + bottom = 1 + } + }) + + ModeAlert:SetBackdropBorderColor(0,0,0,1) + ModeAlert:SetBackdropColor(0.25, 0.52, 0.1) + ModeAlert.text = ModeAlert:CreateFontString(nil, 'ARTWORK', 'GameFontWhite') + ModeAlert.text:SetAllPoints(ModeAlert) + ModeAlert.text:SetTextColor(1, 1, 1) + ModeAlert.text:SetJustifyH("CENTER") + ModeAlert.text:SetJustifyV("MIDDLE") + ModeAlert.text:SetText("Click to Exit") + ModeAlert.ModeText = "Click to Exit"; + ModeAlert.HelpText = ""; + ModeAlert:SetScript('OnEnter', ModeAlert_OnEnter) + ModeAlert:SetScript('OnLeave', ModeAlert_OnLeave) + ModeAlert:SetScript('OnHide', ModeAlert_OnHide) + ModeAlert:SetScript('OnShow', ModeAlert_OnShow) + ModeAlert:SetScript('OnMouseDown', ModeAlert_OnMouseDown) + ModeAlert:Hide() + + PLUGIN.ModeAlert = ModeAlert + + PLUGIN:MakeLogWindow() + modesDocklet:Hide() + PLUGIN:LoadCookingMode() + PLUGIN:LoadFishingMode() + PLUGIN:LoadArchaeologyMode() + PLUGIN:PrepareFarmingTools() + PLUGIN:RegisterEvent("SKILL_LINES_CHANGED") +end + +CONFIGS["SVLaborer"] = { + ["enable"] = true, + ["fontSize"] = 12, + ["farming"] = { + ["buttonsize"] = 35, + ["buttonspacing"] = 3, + ["onlyactive"] = false, + ["droptools"] = true, + ["toolbardirection"] = "HORIZONTAL", + }, + ["fishing"] = { + ["autoequip"] = true, + }, + ["cooking"] = { + ["autoequip"] = true, + }, +} + +SuperVillain.Registry:NewScript(LoadLaborVillain) +SuperVillain.Registry:NewPlugin(PLUGIN, "SVLaborer", LoadOptions) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.toc b/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.toc new file mode 100644 index 0000000..aea9232 --- /dev/null +++ b/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.toc @@ -0,0 +1,10 @@ +## Interface: 50400 +## Author: Munglunch +## Version: 1.0 +## Title: |cffFF9900SVUI |r|cffFFEF00Laborer|r +## Notes: Supervillain UI [|cff9911FFProfession Tools|r]. +## SavedVariables: LABOR_Data +## SavedVariablesPerCharacter: LABOR_Cache +## RequiredDeps: SVUI + +SVUI_Laborer.xml diff --git a/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.xml b/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.xml new file mode 100644 index 0000000..ed6483d --- /dev/null +++ b/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.xml @@ -0,0 +1,43 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Frame name="SVUI_ModesHandler" hidden="true" frameStrata="LOW" parent="UIParent"> + <Anchors> + <Anchor point="LEFT" relativeTo="UIParent" relativePoint="RIGHT"> + <Offset x="10000" y="0"/> + </Anchor> + </Anchors> + <Frames> + <Button name="SVUI_ModeCaptureWindow" inherits="SecureActionButtonTemplate" enableMouse="true"> + <Scripts> + <PostClick> + if(self.PostClickHandler) then self:PostClickHandler() end + </PostClick> + <OnLoad> + self.Grip = _G["SVUI_ModesHandler"]; + self:RegisterForClicks("RightButtonUp"); + self:Hide(); + self:RegisterEvent("PLAYER_ENTERING_WORLD") + self:SetScript("OnEvent", function(self, event, ...) + if event == "PLAYER_REGEN_ENABLED" then + self:UnregisterEvent("PLAYER_REGEN_ENABLED") + LaborVillain:ChangeModeGear() + self:PostClickHandler() + end + if event == "PLAYER_ENTERING_WORLD" then + if (IsSpellKnown(131474) or IsSpellKnown(80451) or IsSpellKnown(818)) then + WorldFrame:HookScript("OnMouseDown", LaborVillain.WorldFrameHook) + end + self:UnregisterEvent("PLAYER_ENTERING_WORLD") + end + end) + </OnLoad> + </Scripts> + </Button> + </Frames> + </Frame> + + <Script file='SVUI_Laborer.lua'/> + <Script file="modes\archaeology.lua"/> + <Script file="modes\cooking.lua"/> + <Script file="modes\fishing.lua"/> + <Script file="modes\farming.lua"/> +</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_Laborer/artwork/DOCK-LABORER.blp b/Interface/AddOns/SVUI_Laborer/artwork/DOCK-LABORER.blp new file mode 100644 index 0000000..9397f22 Binary files /dev/null and b/Interface/AddOns/SVUI_Laborer/artwork/DOCK-LABORER.blp differ diff --git a/Interface/AddOns/SVUI_Laborer/artwork/LABORER-COOKING.blp b/Interface/AddOns/SVUI_Laborer/artwork/LABORER-COOKING.blp new file mode 100644 index 0000000..fe824f0 Binary files /dev/null and b/Interface/AddOns/SVUI_Laborer/artwork/LABORER-COOKING.blp differ diff --git a/Interface/AddOns/SVUI_Laborer/artwork/LABORER-FARMING.blp b/Interface/AddOns/SVUI_Laborer/artwork/LABORER-FARMING.blp new file mode 100644 index 0000000..7127055 Binary files /dev/null and b/Interface/AddOns/SVUI_Laborer/artwork/LABORER-FARMING.blp differ diff --git a/Interface/AddOns/SVUI_Laborer/artwork/LABORER-FISHING.blp b/Interface/AddOns/SVUI_Laborer/artwork/LABORER-FISHING.blp new file mode 100644 index 0000000..76474d1 Binary files /dev/null and b/Interface/AddOns/SVUI_Laborer/artwork/LABORER-FISHING.blp differ diff --git a/Interface/AddOns/SVUI_Laborer/artwork/LABORER-SURVEY.blp b/Interface/AddOns/SVUI_Laborer/artwork/LABORER-SURVEY.blp new file mode 100644 index 0000000..40f68ae Binary files /dev/null and b/Interface/AddOns/SVUI_Laborer/artwork/LABORER-SURVEY.blp differ diff --git a/Interface/AddOns/SVUI_Laborer/modes/archaeology.lua b/Interface/AddOns/SVUI_Laborer/modes/archaeology.lua new file mode 100644 index 0000000..ad90bef --- /dev/null +++ b/Interface/AddOns/SVUI_Laborer/modes/archaeology.lua @@ -0,0 +1,513 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local type = _G.type; +local string = _G.string; +local math = _G.math; +local table = _G.table; +local rept,format = string.rep, string.format; +local tsort,twipe = table.sort, table.wipe; +local floor,ceil = math.floor, math.ceil; +local min = math.min +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SuperVillain, L = unpack(SVUI) +local MOD = _G.LaborVillain +--[[ +########################################################## +LOCAL VARS +########################################################## +]]-- +local playerRace = select(2,UnitRace("player")) +local archSpell, survey, surveyIsKnown, skillRank, skillModifier; +local EnableListener, DisableListener; +local CanScanResearchSite = CanScanResearchSite +local GetNumArtifactsByRace = GetNumArtifactsByRace +local GetArchaeologyRaceInfo = GetArchaeologyRaceInfo +local GetSelectedArtifactInfo = GetSelectedArtifactInfo +local GetArtifactProgress = GetArtifactProgress +local CanSolveArtifact = CanSolveArtifact +local GetContainerNumSlots = GetContainerNumSlots +local GetContainerItemInfo = GetContainerItemInfo +local GetContainerItemID = GetContainerItemID +local DockButton, ModeLogsFrame; +local refArtifacts = {}; +for i = 1, 12 do + refArtifacts[i] = {} +end +local NEEDS_UPDATE = true; +local ArchLaborer = CreateFrame("Frame", "SVUI_ArchLaborer", UIParent) +--[[ +########################################################## +DATA +########################################################## +]]-- +MOD.Archaeology = {}; +MOD.Archaeology.Bars = {}; +MOD.Archaeology.Loaded = false; +--[[ +########################################################## +LOCAL FUNCTIONS +########################################################## +]]-- +local function EnableSolve(index, button) + button:SetAlpha(1) + button.text:SetTextColor(1, 1, 1) + button:SetScript("OnEnter", function(self) + self.text:SetTextColor(1, 1, 0) + end) + button:SetScript("OnLeave", function(self) + self.text:SetTextColor(1, 1, 1) + end) + button:SetScript("OnClick", function(self) + SetSelectedArtifact(index) + local _, _, _, _, _, numSockets = GetActiveArtifactByRace(index) + local _, _, itemID = GetArchaeologyRaceInfo(index) + local ready = true + if numSockets and numSockets > 0 then + for socketNum = 1, numSockets do + if not ItemAddedToArtifact(itemID) then + SocketItemToArtifact() + end + end + end + + if GetNumArtifactsByRace(index) > 0 then + print("Solving...") + SolveArtifact() + end + end) +end + +local function DisableSolve(button) + button:SetAlpha(0) + button.text:SetTextColor(0.5, 0.5, 0.5) + button.text:SetText("") + button:SetScript("OnEnter", SuperVillain.fubar) + button:SetScript("OnLeave", SuperVillain.fubar) + button:SetScript("OnMouseUp", SuperVillain.fubar) +end + +local function UpdateArtifactBars(index) + local cache = refArtifacts[index] + local bar = MOD.Archaeology.Bars[index] + + bar["race"]:SetText(cache["race"]) + + if GetNumArtifactsByRace(index) ~= 0 then + local keystoneBonus = 0 + bar["race"]:SetTextColor(1, 1, 1) + bar["progress"]:SetTextColor(1, 1, 1) + if cache["numKeysockets"] then + keystoneBonus = min(cache["numKeystones"], cache["numKeysockets"]) * 12 + end + local actual = min(cache["progress"], cache["total"]) + local potential = cache["total"] + local green = 0.75 * (actual / potential); + bar["bar"]:SetMinMaxValues(0, potential) + bar["bar"]:SetValue(actual) + + if cache["numKeysockets"] and cache["numKeysockets"] > 0 then + bar["solve"].text:SetText(SOLVE.." ["..cache["numKeystones"].."/"..cache["numKeysockets"].."]") + else + bar["solve"].text:SetText(SOLVE) + end + + if keystoneBonus > 0 then + bar["progress"]:SetText(format("|cff00c1ea%d|r/%d", cache["progress"] + keystoneBonus, cache["total"])) + else + if cache["total"] > 65 then + bar["progress"]:SetText(format("%d/|cff00c1ea%d|r", cache["progress"], cache["total"])) + else + bar["progress"]:SetText(format("%d/%d", cache["progress"], cache["total"])) + end + end + if cache["canSolve"] then + EnableSolve(index, bar["solve"]) + else + DisableSolve(bar["solve"]) + end + bar["bar"]:SetStatusBarColor(0.1, green, 1, 0.5) + else + DisableSolve(bar["solve"]) + bar["progress"]:SetText("") + bar["bar"]:SetStatusBarColor(0, 0, 0, 0) + bar["race"]:SetTextColor(0.25, 0.25, 0.25) + bar["progress"]:SetTextColor(0.25, 0.25, 0.25) + end +end + +local function UpdateArtifactCache() + local found, raceName, raceItemID, cache, _; + for index = 1, 12 do + found = GetNumArtifactsByRace(index) + raceName, _, raceItemID = GetArchaeologyRaceInfo(index) + cache = refArtifacts[index] + cache["race"] = raceName + cache["keyID"] = raceItemID + cache["numKeystones"] = 0 + local oldNum = cache["progress"] + if found == 0 then + cache["numKeysockets"] = 0 + cache["progress"] = 0 + cache["modifier"] = 0 + cache["total"] = 0 + cache["canSolve"] = false + else + SetSelectedArtifact(index) + local _, _, _, _, _, keystoneCount = GetSelectedArtifactInfo() + local numFragmentsCollected, numFragmentsAdded, numFragmentsRequired = GetArtifactProgress() + + cache["numKeysockets"] = keystoneCount + cache["progress"] = numFragmentsCollected + cache["modifier"] = numFragmentsAdded + cache["total"] = numFragmentsRequired + cache["canSolve"] = CanSolveArtifact() + + for i = 0, 4 do + for j = 1, GetContainerNumSlots(i) do + local slotID = GetContainerItemID(i, j) + if slotID == cache["keyID"] then + local _, count = GetContainerItemInfo(i, j) + if cache["numKeystones"] < cache["numKeysockets"] then + cache["numKeystones"] = cache["numKeystones"] + count + end + if min(cache["numKeystones"], cache["numKeysockets"]) * 12 + cache["progress"] >= cache["total"] then + cache["canSolve"] = true + end + end + end + end + end + UpdateArtifactBars(index) + end + NEEDS_UPDATE = false +end + +local function GetTitleAndSkill() + local msg = "|cff22ff11Archaeology Mode|r" + if(skillRank) then + if(skillModifier) then + skillRank = skillRank + skillModifier; + end + msg = msg .. " (|cff00ddff" .. skillRank .. "|r)"; + end; + return msg +end + +local function SendModeMessage(...) + if not CombatText_AddMessage then return end; + CombatText_AddMessage(...) +end; +--[[ +########################################################## +EVENT HANDLER +########################################################## +]]-- +do + local SURVEYCDFONT = SuperVillain.Media.font.numbers + local SURVEYRED = {0,0.5,1} + local last = 0 + local time = 3 + + local ArchEventHandler = CreateFrame("Frame"); + local SurveyCooldown = CreateFrame("Frame", nil, UIParent); + local ArchSiteFound; + local ArchCanSurvey, ArchWillSurvey = false, false; + + SurveyCooldown:SetPoint("CENTER", 0, -80) + SurveyCooldown:SetSize(150, 150) + SurveyCooldown.text = SurveyCooldown:CreateFontString(nil, "OVERLAY") + SurveyCooldown.text:SetAllPoints(SurveyCooldown) + SurveyCooldown.text:SetFont(SURVEYCDFONT, 150, "OUTLINE") + SurveyCooldown.text:SetTextColor(0,1,0.12,0.5) + SurveyCooldown.text:SetPoint("CENTER") + SurveyCooldown:SetScale(1.5) + + local Arch_OnEvent = function(self, event, ...) + if(InCombatLockdown() or not archSpell) then return end + if(event == "CURRENCY_DISPLAY_UPDATE" or event == "CHAT_MSG_SKILL" or event == "ARTIFACT_COMPLETE") then + local msg = GetTitleAndSkill() + MOD.TitleWindow:Clear() + MOD.TitleWindow:AddMessage(msg) + end + if(CanScanResearchSite() and (event == "CURRENCY_DISPLAY_UPDATE")) then + UpdateArtifactCache() + elseif(event == "ARCHAEOLOGY_SURVEY_CAST" or event == "ARTIFACT_COMPLETE" or event == "ARTIFACT_DIG_SITE_UPDATED") then + UpdateArtifactCache() + elseif(event == "ARTIFACT_HISTORY_READY" or event == "ARTIFACT_DIGSITE_COMPLETE") then + NEEDS_UPDATE = true + else + ArchCanSurvey = CanScanResearchSite() + if(ArchCanSurvey and not ArchWillSurvey) then + _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") + _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', survey) + MOD.ModeAlert.HelpText = "Double-Right-Click anywhere on the screen to survey."; + ArchWillSurvey = true + elseif(not ArchCanSurvey and ArchWillSurvey) then + _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") + _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', archSpell) + MOD.ModeAlert.HelpText = "Double-Right-Click anywhere on the screen to open the artifacts window."; + ArchWillSurvey = false + end + if(event == "ZONE_CHANGED_NEW_AREA") then ArchSiteFound = nil end + if(not ArchSiteFound) then + local sites = ArchaeologyMapUpdateAll(); + if(sites and sites > 0) then + ArchSiteFound = true + SendModeMessage("Digsite Located", CombatText_StandardScroll, 0.91, 0.78, 0.12); + else + ArchSiteFound = nil + end + end + if(NEEDS_UPDATE) then + UpdateArtifactCache() + end + end + end; + + local Survey_OnUpdate = function(self, elapsed) + last = last + elapsed + if last > 1 then + time = time - 1 + self.text:SetText(time) + if time <= 0 then + self:SetScript("OnUpdate", nil) + self.text:SetText("") + time = 3 + end + self.text:SetTextColor(SURVEYRED[time],1,0.12,0.8) + last = 0 + end + end; + + local Survey_OnEvent = function(self, event, unit, _, _, _, spellid) + if not unit == "player" then return end + if spellid == 80451 then + self.text:SetText("3") + self:SetScript("OnUpdate", Survey_OnUpdate) + end + end; + + function EnableListener() + UpdateArtifactCache() + + ArchEventHandler:RegisterEvent("ZONE_CHANGED") + ArchEventHandler:RegisterEvent("ZONE_CHANGED_NEW_AREA") + ArchEventHandler:RegisterEvent("ZONE_CHANGED_INDOORS") + + ArchEventHandler:RegisterEvent("ARTIFACT_DIG_SITE_UPDATED") + ArchEventHandler:RegisterEvent("ARTIFACT_DIGSITE_COMPLETE") + ArchEventHandler:RegisterEvent("ARTIFACT_HISTORY_READY") + ArchEventHandler:RegisterEvent("ARTIFACT_COMPLETE") + + ArchEventHandler:RegisterEvent("CURRENCY_DISPLAY_UPDATE") + ArchEventHandler:RegisterEvent("ARCHAEOLOGY_SURVEY_CAST") + + ArchEventHandler:RegisterEvent("CHAT_MSG_SKILL") + + ArchEventHandler:SetScript("OnEvent", Arch_OnEvent) + if(playerRace ~= "Dwarf") then + SurveyCooldown:RegisterEvent("UNIT_SPELLCAST_STOP") + SurveyCooldown:SetScript("OnEvent", Survey_OnEvent) + end + end + + function DisableListener() + ArchEventHandler:UnregisterAllEvents() + ArchEventHandler:SetScript("OnEvent", nil) + if(playerRace ~= "Dwarf") then + SurveyCooldown:UnregisterAllEvents() + SurveyCooldown:SetScript("OnEvent", nil) + end + end +end +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +function MOD.Archaeology:Enable() + MOD.Archaeology:Update() + if(not SVUI_ModesDockFrame:IsShown()) then DockButton:Click() end + + PlaySoundFile("Sound\\Item\\UseSounds\\UseCrinklingPaper.wav") + MOD.ModeAlert:SetBackdropColor(0.25, 0.52, 0.1) + if(not IsSpellKnown(80451)) then + MOD:ModeLootLoader("Archaeology", "WTF is Archaeology?", "You don't know archaeology! \nPicking up a rock and telling everyone that \nyou found a fossil is cute, BUT WRONG!! \nGo find someone who can train you to do this job."); + MOD.TitleWindow:Clear(); + MOD.TitleWindow:AddMessage("WTF is Archaeology?"); + MOD.LogWindow:Clear(); + MOD.LogWindow:AddMessage("You don't know archaeology! \nPicking up a rock and telling everyone that \nyou found a fossil is cute, BUT WRONG!! \nGo find someone who can train you to do this job.", 1, 1, 1); + MOD.LogWindow:AddMessage(" ", 1, 1, 1); + else + ArchLaborer:Show() + local msg = GetTitleAndSkill() + if surveyIsKnown and CanScanResearchSite() then + MOD:ModeLootLoader("Archaeology", msg, "Double-Right-Click anywhere on the screen to survey."); + _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") + _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', survey) + else + MOD:ModeLootLoader("Archaeology", msg, "Double-Right-Click anywhere on the screen to open the artifacts window."); + _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") + _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', archSpell) + end + MOD.TitleWindow:Clear(); + MOD.TitleWindow:AddMessage(msg); + end + EnableListener() + MOD.ModeAlert:Show() + SendModeMessage("Archaeology Mode Enabled", CombatText_StandardScroll, 0.28, 0.9, 0.1); +end + +function MOD.Archaeology:Disable() + DisableListener() + ArchLaborer:Hide() +end + +function MOD.Archaeology:Bind() + if InCombatLockdown() then return end + if(archSpell) then + if surveyIsKnown and CanScanResearchSite() then + _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") + _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', survey) + MOD.ModeAlert.HelpText = 'Double-Right-Click anywhere on the screen to survey.' + else + _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") + _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', archSpell) + MOD.ModeAlert.HelpText = 'Double-Right-Click anywhere on the screen to open the artifacts window.' + end + SetOverrideBindingClick(_G["SVUI_ModeCaptureWindow"], true, "BUTTON2", "SVUI_ModeCaptureWindow"); + _G["SVUI_ModeCaptureWindow"].Grip:Show(); + end +end + +function MOD.Archaeology:Update() + surveyIsKnown = IsSpellKnown(80451); + survey = GetSpellInfo(80451); + local _,_,arch,_,_,_ = GetProfessions(); + if(arch) then + archSpell, _, skillRank, _, _, _, _, skillModifier = GetProfessionInfo(arch) + end +end +--[[ +########################################################## +LOADER +########################################################## +]]-- +function MOD:LoadArchaeologyMode() + ModeLogsFrame = MOD.LogWindow; + DockButton = _G["SVUI_ModesDockFrame_ToolBarButton"]; + + local progressBars = MOD.Archaeology.Bars + + ArchLaborer:SetParent(ModeLogsFrame) + ArchLaborer:SetFrameStrata("MEDIUM") + ArchLaborer:FillInner(ModeLogsFrame) + + local BAR_WIDTH = (ArchLaborer:GetWidth() * 0.5) - 4 + local BAR_HEIGHT = (ArchLaborer:GetHeight() / 6) - 4 + + for i = 1, 12 do + local bar = CreateFrame("StatusBar", nil, ArchLaborer) + local race = bar:CreateFontString() + local progress = bar:CreateFontString() + local solve = CreateFrame("Button", nil, bar, "SecureHandlerClickTemplate") + local yOffset; + + bar:SetPanelTemplate("Inset") + bar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) + bar:SetSize(BAR_WIDTH,BAR_HEIGHT) + if(i > 6) then + yOffset = ((i - 7) * (BAR_HEIGHT + 4)) + 4 + bar:SetPoint("TOPRIGHT", ArchLaborer, "TOPRIGHT", -2, -yOffset) + else + yOffset = ((i - 1) * (BAR_HEIGHT + 4)) + 4; + bar:SetPoint("TOPLEFT", ArchLaborer, "TOPLEFT", 2, -yOffset) + end + bar:SetStatusBarColor(0.2, 0.2, 0.8, 0.5) + bar:SetScript("OnEnter", function(self) + GameTooltip:SetOwner(self, "ANCHOR_BOTTOMRIGHT", 2, 250) + GameTooltip:ClearLines() + if GetNumArtifactsByRace(i) > 0 then + SetSelectedArtifact(i) + local artifactName, artifactDescription, artifactRarity, _, _, keystoneCount = GetSelectedArtifactInfo() + local numFragmentsCollected, numFragmentsAdded, numFragmentsRequired = GetArtifactProgress() + local r, g, b + if artifactRarity == 1 then + artifactRarity = ITEM_QUALITY3_DESC + r, g, b = GetItemQualityColor(3) + else + artifactRarity = ITEM_QUALITY1_DESC + r, g, b = GetItemQualityColor(1) + end + GameTooltip:AddLine(artifactName, r, g, b, 1) + GameTooltip:AddLine(artifactRarity, r, g, b, r, g, b) + GameTooltip:AddDoubleLine(ARCHAEOLOGY_RUNE_STONES..": "..numFragmentsCollected.."/"..numFragmentsRequired, "Keystones: "..keystoneCount, 1, 1, 1, 1, 1, 1) + GameTooltip:AddLine(" ") + GameTooltip:AddLine(artifactDescription, 1, 1, 1, 1) + GameTooltip:Show() + end + end) + bar:SetScript("OnLeave", function() + GameTooltip:Hide() + end) + + -- Race Text + race:SetFont(SuperVillain.Media.font.roboto, 12, "OUTLINE") + race:SetText(RACE) + race:SetPoint("LEFT", bar, "LEFT", 2, 0) + + -- Progress Text + progress:SetFont(SuperVillain.Media.font.roboto, 12, "OUTLINE") + progress:SetText("") + progress:SetPoint("RIGHT", bar, "RIGHT", 1, 0) + + -- Solve + solve:SetAllPoints(bar) + + solve.bg = solve:CreateTexture(nil,"BORDER") + solve.bg:SetAllPoints(solve) + solve.bg:SetTexture(SuperVillain.Media.bar.default) + solve.bg:SetVertexColor(0.1,0.5,0) + + solve.text = solve:CreateFontString(nil,"OVERLAY") + solve.text:SetFont(SuperVillain.Media.font.roboto, 14, "NONE") + solve.text:SetShadowOffset(-1,-1) + solve.text:SetShadowColor(0,0,0,0.5) + solve.text:SetText(SOLVE) + solve.text:SetPoint("CENTER", solve, "CENTER", 2, 0) + + progressBars[i] = { + ["bar"] = bar, + ["race"] = race, + ["progress"] = progress, + ["solve"] = solve + } + end + ArchLaborer:Hide() + MOD.Archaeology:Update() + UpdateArtifactCache() +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_Laborer/modes/cooking.lua b/Interface/AddOns/SVUI_Laborer/modes/cooking.lua new file mode 100644 index 0000000..51ec82f --- /dev/null +++ b/Interface/AddOns/SVUI_Laborer/modes/cooking.lua @@ -0,0 +1,228 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local type = _G.type; +local string = _G.string; +local math = _G.math; +local table = _G.table; +local rept = string.rep; +local tsort,twipe = table.sort,table.wipe; +local floor,ceil = math.floor, math.ceil; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SuperVillain, L = unpack(SVUI) +local MOD = _G.LaborVillain +--[[ +########################################################## +LOCAL VARS +########################################################## +]]-- +local cookingSpell, campFire, skillRank, skillModifier; +local DockButton; +--[[ +########################################################## +LOCAL FUNCTIONS +########################################################## +]]-- +local function UpdateChefWear() + if(GetItemCount(46349) > 0) then + MOD.WornItems["HEAD"] = GetInventoryItemID("player", INVSLOT_HEAD); + EquipItemByName(46349) + MOD.InModeGear = true + end + if(GetItemCount(86468) > 0) then + MOD.WornItems["TAB"] = GetInventoryItemID("player", INVSLOT_TABARD); + EquipItemByName(86468) + MOD.InModeGear = true + end + if(GetItemCount(86559) > 0) then + MOD.WornItems["MAIN"] = GetInventoryItemID("player", INVSLOT_MAINHAND); + EquipItemByName(86559) + MOD.InModeGear = true + end + if(GetItemCount(86558) > 0) then + MOD.WornItems["OFF"] = GetInventoryItemID("player", INVSLOT_OFFHAND); + EquipItemByName(86558) + MOD.InModeGear = true + end +end; + +local function GetTitleAndSkill() + local msg = "|cff22ff11Cooking Mode|r" + if(skillRank) then + if(skillModifier) then + skillRank = skillRank + skillModifier; + end + msg = msg .. " (|cff00ddff" .. skillRank .. "|r)"; + end; + return msg +end; + +local function SendModeMessage(...) + if not CombatText_AddMessage then return end; + CombatText_AddMessage(...) +end; +--[[ +########################################################## +CORE NAMESPACE +########################################################## +]]-- +MOD.Cooking = {}; +MOD.Cooking.Log = {}; +MOD.Cooking.Loaded = false; +--[[ +########################################################## +EVENT HANDLER +########################################################## +]]-- +local EnableListener, DisableListener +do + local CookEventHandler = CreateFrame("Frame") + local LootProxy = function(item, name) + if(item) then + local mask = [[0x10000]]; + local itemType = GetItemFamily(item); + local pass = bit.band(itemType, mask); + if pass > 0 then + proxyTest = true; + end + end + end; + + local Cook_OnEvent = function(self, event, ...) + if(InCombatLockdown()) then return end + if(event == "BAG_UPDATE" or event == "CHAT_MSG_SKILL") then + local msg = GetTitleAndSkill() + MOD.TitleWindow:Clear() + MOD.TitleWindow:AddMessage(msg) + elseif(event == "CHAT_MSG_LOOT") then + local item, amt = MOD:CheckForModeLoot(...); + if item then + local name, lnk, rarity, lvl, mlvl, itype, stype, cnt, ieq, tex, price = GetItemInfo(item); + if proxyTest == false then + LootProxy(lnk, name) + end; + if proxyTest == false then return end; + if not MOD.Cooking.Log[name] then + MOD.Cooking.Log[name] = {amount = 0, texture = ""}; + end; + local r, g, b, hex = GetItemQualityColor(rarity); + local stored = MOD.Cooking.Log + local mod = stored[name]; + local newAmt = mod.amount + 1; + if amt >= 2 then newAmt = mod.amount + amt end; + MOD.Cooking.Log[name].amount = newAmt; + MOD.Cooking.Log[name].texture = tex; + MOD.LogWindow:Clear(); + for name,data in pairs(stored) do + if type(data) == "table" and data.amount and data.texture then + MOD.LogWindow:AddMessage("|cff55FF55"..data.amount.." x|r |T".. data.texture ..":16:16:0:0:64:64:4:60:4:60|t".." "..name, r, g, b); + end + end; + MOD.LogWindow:AddMessage("----------------", 0, 0, 0); + MOD.LogWindow:AddMessage("Cooked So Far...", 0, 1, 1); + MOD.LogWindow:AddMessage(" ", 0, 0, 0); + proxyTest = false; + end + end + end; + + function EnableListener() + CookEventHandler:RegisterEvent("ZONE_CHANGED") + CookEventHandler:RegisterEvent("BAG_UPDATE") + CookEventHandler:RegisterEvent("CHAT_MSG_SKILL") + CookEventHandler:SetScript("OnEvent", Cook_OnEvent) + end + + function DisableListener() + CookEventHandler:UnregisterAllEvents() + CookEventHandler:SetScript("OnEvent", nil) + end +end +--[[ +########################################################## +CORE METHODS +########################################################## +]]-- +function MOD.Cooking:Enable() + MOD.Cooking:Update() + if(not SVUI_ModesDockFrame:IsShown()) then DockButton:Click() end + if(MOD.db.cooking.autoequip) then + UpdateChefWear(); + end + PlaySoundFile("Sound\\Spells\\Tradeskills\\CookingPrepareA.wav") + MOD.ModeAlert:SetBackdropColor(0.25, 0.52, 0.1) + + if(not IsSpellKnown(818)) then + MOD:ModeLootLoader("Cooking", "WTF is Cooking?", "You have no clue how to cook! \nEven toast is a mystery to you. \nGo find a trainer and learn \nhow to do this simple job."); + else + local msg = GetTitleAndSkill(); + if cookingSpell and GetSpellCooldown(campFire) > 0 then + MOD:ModeLootLoader("Cooking", msg, "Double-Right-Click anywhere on the screen \nto open your cookbook."); + _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") + _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', cookingSpell) + else + MOD:ModeLootLoader("Cooking", msg, "Double-Right-Click anywhere on the screen \nto start a cooking fire."); + _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") + _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', campFire) + end + end + EnableListener() + MOD.ModeAlert:Show() + SendModeMessage("Cooking Mode Enabled", CombatText_StandardScroll, 0.28, 0.9, 0.1); +end + +function MOD.Cooking:Disable() + DisableListener() +end + +function MOD.Cooking:Bind() + if InCombatLockdown() then return end + if cookingSpell then + if cookingSpell and GetSpellCooldown(campFire) > 0 then + _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") + _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', cookingSpell) + MOD.ModeAlert.HelpText = 'Double-Right-Click to open the cooking window.' + end + SetOverrideBindingClick(_G["SVUI_ModeCaptureWindow"], true, "BUTTON2", "SVUI_ModeCaptureWindow"); + _G["SVUI_ModeCaptureWindow"].Grip:Show(); + end +end + +function MOD.Cooking:Update() + campFire = GetSpellInfo(818); + local _,_,_,_,cook,_ = GetProfessions(); + if cook ~= nil then + cookingSpell, _, skillRank, _, _, _, _, skillModifier = GetProfessionInfo(cook) + end; +end +--[[ +########################################################## +LOADER +########################################################## +]]-- +function MOD:LoadCookingMode() + DockButton = _G["SVUI_ModesDockFrame_ToolBarButton"]; +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_Laborer/modes/farming.lua b/Interface/AddOns/SVUI_Laborer/modes/farming.lua new file mode 100644 index 0000000..4e4eeed --- /dev/null +++ b/Interface/AddOns/SVUI_Laborer/modes/farming.lua @@ -0,0 +1,613 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local type = _G.type; +local string = _G.string; +local math = _G.math; +local table = _G.table; +local rept = string.rep; +local tsort,twipe = table.sort,table.wipe; +local floor,ceil = math.floor, math.ceil; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SuperVillain, L = unpack(SVUI) +local MOD = _G.LaborVillain +--[[ +########################################################## +LOCAL VARS +########################################################## +]]-- +local NUM_SEED_BARS = 7 +local EnableListener, DisableListener, InventoryUpdate, LoadFarmingModeTools; +local seedButtons,farmToolButtons,portalButtons = {},{},{}; +local DockButton, ModeLogsFrame; +local refSeeds = {[79102]={1},[89328]={1},[80590]={1},[80592]={1},[80594]={1},[80593]={1},[80591]={1},[89329]={1},[80595]={1},[89326]={1},[80809]={3},[95434]={4},[89848]={3},[95437]={4},[84782]={3},[95436]={4},[85153]={3},[95438]={4},[85162]={3},[95439]={4},[85158]={3},[95440]={4},[84783]={3},[95441]={4},[89849]={3},[95442]={4},[85163]={3},[95443]={4},[89847]={3},[95444]={4},[85216]={2},[85217]={2},[89202]={2},[85215]={2},[89233]={2},[89197]={2},[85219]={2},[91806]={2},[95449]={5},[95450]={6},[95451]={5},[95452]={6},[95457]={5},[95458]={6},[95447]={5},[95448]={6},[95445]={5},[95446]={6},[95454]={5},[95456]={6},[85267]={7},[85268]={7},[85269]={7}}; +local refTools = {[79104]={30254},[80513]={30254},[89880]={30535},[89815]={31938}}; +local refPortals = {[91850]={"Horde"},[91861]={"Horde"},[91862]={"Horde"},[91863]={"Horde"},[91860]={"Alliance"},[91864]={"Alliance"},[91865]={"Alliance"},[91866]={"Alliance"}}; +--[[ +########################################################## +LOCAL FUNCTIONS +########################################################## +]]-- +local Scroll_OnValueChanged = function(self,argValue) + FarmModeFrame:SetVerticalScroll(argValue) +end + +local Scroll_OnMouseWheel = function(self, delta) + local scroll = self:GetVerticalScroll(); + local value = (scroll - (20 * delta)); + if value < -1 then + value = 0 + end; + if value > 420 then + value = 420 + end; + self:SetVerticalScroll(value) + self.slider:SetValue(value) +end + +local function FindItemInBags(itemId) + for container = 0, NUM_BAG_SLOTS do + for slot = 1, GetContainerNumSlots(container) do + if itemId == GetContainerItemID(container, slot) then + return container, slot + end + end + end +end +--[[ +########################################################## +EVENT HANDLER +########################################################## +]]-- +do + local FarmEventHandler = CreateFrame("Frame") + + local ButtonUpdate = function(button) + button.items = GetItemCount(button.itemId) + if button.text then + button.text:SetText(button.items) + end + button.icon:SetDesaturated(button.items == 0) + button.icon:SetAlpha(button.items == 0 and .25 or 1) + end + + local InFarmZone = function() + local zone = GetSubZoneText() + if (zone == L["Sunsong Ranch"] or zone == L["The Halfhill Market"]) then + if MOD.Farming.ToolsLoaded and MOD.ModeAlert:IsShown() then + MOD.TitleWindow:Clear() + MOD.TitleWindow:AddMessage("|cff22ff11Farming Mode|r") + end + return true + else + if MOD.Farming.ToolsLoaded and MOD.ModeAlert:IsShown() then + MOD.TitleWindow:Clear() + MOD.TitleWindow:AddMessage("|cffff2211Must be in Sunsong Ranch|r") + end + return false + end; + end + + local UpdateFarmtoolCooldown = function() + for i = 1, NUM_SEED_BARS do + for _, button in ipairs(seedButtons[i]) do + if button.cooldown then + button.cooldown:SetCooldown(GetItemCooldown(button.itemId)) + end + end + end + for _, button in ipairs(farmToolButtons) do + if button.cooldown then + button.cooldown:SetCooldown(GetItemCooldown(button.itemId)) + end + end + for _, button in ipairs(portalButtons) do + if button.cooldown then + button.cooldown:SetCooldown(GetItemCooldown(button.itemId)) + end + end + end + + local Farm_OnEvent = function(self, event, ...) + if(InCombatLockdown()) then return end + if(event == "ZONE_CHANGED") then + local inZone = InFarmZone() + if not inZone and MOD.db.farming.droptools then + for k, v in pairs(refTools) do + local container, slot = FindItemInBags(k) + if container and slot then + PickupContainerItem(container, slot) + DeleteCursorItem() + end + end + end + if inZone then + self:RegisterEvent("BAG_UPDATE") + self:RegisterEvent("BAG_UPDATE_COOLDOWN") + else + self:UnregisterEvent("BAG_UPDATE") + self:UnregisterEvent("BAG_UPDATE_COOLDOWN") + end + InventoryUpdate() + elseif(event == "BAG_UPDATE") then + InventoryUpdate() + elseif(event == "BAG_UPDATE_COOLDOWN") then + UpdateFarmtoolCooldown() + end + end; + + InventoryUpdate = function() + if InCombatLockdown() then + FarmEventHandler:RegisterEvent("PLAYER_REGEN_ENABLED", InventoryUpdate) + return + else + FarmEventHandler:UnregisterEvent("PLAYER_REGEN_ENABLED") + end + for i = 1, NUM_SEED_BARS do + for _, button in ipairs(seedButtons[i]) do + ButtonUpdate(button) + end + end + for _, button in ipairs(farmToolButtons) do + ButtonUpdate(button) + end + for _, button in ipairs(portalButtons) do + ButtonUpdate(button) + end + + MOD:RefreshFarmingTools() + end + + EnableListener = function() + FarmEventHandler:RegisterEvent("ZONE_CHANGED") + FarmEventHandler:SetScript("OnEvent", Farm_OnEvent) + end + + DisableListener = function() + FarmEventHandler:UnregisterAllEvents() + FarmEventHandler:SetScript("OnEvent", nil) + end +end +--[[ +########################################################## +LOADING HANDLER +########################################################## +]]-- +do + local seedsort = function(a, b) return a.sortname < b.sortname end; + + local SeedToSoil = function(group, itemId) + if(UnitName("target") ~= L["Tilled Soil"]) then return false; end + for i, v in pairs(group) do + if i == itemId then return true end + end + return false + end; + + local Button_OnEnter = function(self) + GameTooltip:SetOwner(self, 'ANCHOR_TOPLEFT', 2, 4) + GameTooltip:ClearLines() + GameTooltip:AddDoubleLine(self.sortname) + if self.allowDrop then + GameTooltip:AddLine(L['Right-click to drop the item.']) + end + GameTooltip:Show() + end; + + local Button_OnLeave = function() + GameTooltip:Hide() + end; + + local Button_OnMouseDown = function(self, mousebutton) + if InCombatLockdown() then return end + if mousebutton == "LeftButton" then + self:SetAttribute("type", self.buttonType) + self:SetAttribute(self.buttonType, self.sortname) + if(SeedToSoil(refSeeds, self.itemId)) then + local container, slot = FindItemInBags(self.itemId) + if container and slot then + self:SetAttribute("type", "macro") + self:SetAttribute("macrotext", format("/targetexact %s \n/use %s %s", L["Tilled Soil"], container, slot)) + end + end + if self.cooldown then + self.cooldown:SetCooldown(GetItemCooldown(self.itemId)) + end + elseif mousebutton == "RightButton" and self.allowDrop then + self:SetAttribute("type", "click") + local container, slot = FindItemInBags(self.itemId) + if container and slot then + PickupContainerItem(container, slot) + DeleteCursorItem() + end + end + end; + + local function CreateFarmingButton(index, owner, buttonName, buttonType, name, texture, allowDrop, showCount) + local BUTTONSIZE = owner.ButtonSize; + local button = CreateFrame("Button", ("FarmingButton"..buttonName.."%d"):format(index), owner, "SecureActionButtonTemplate") + button:SetFixedPanelTemplate("Transparent") + button.Panel:SetFrameLevel(0) + button:SetNormalTexture(nil) + button:Size(BUTTONSIZE, BUTTONSIZE) + button.sortname = name + button.itemId = index + button.allowDrop = allowDrop + button.buttonType = buttonType + button.items = GetItemCount(index) + button.icon = button:CreateTexture(nil, "OVERLAY", nil, 2) + button.icon:SetTexture(texture) + button.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) + button.icon:FillInner(button,2,2) + if showCount then + button.text = button:CreateFontString(nil, "OVERLAY") + button.text:SetFont(SuperVillain.Media.font.action, 12, "OUTLINE") + button.text:SetPoint("BOTTOMRIGHT", button, 1, 2) + end + button.cooldown = CreateFrame("Cooldown", ("FarmingButton"..buttonName.."%dCooldown"):format(index), button) + button.cooldown:SetAllPoints(button) + button:SetScript("OnEnter", Button_OnEnter) + button:SetScript("OnLeave", Button_OnLeave) + button:SetScript("OnMouseDown", Button_OnMouseDown) + return button + end + + function LoadFarmingModeTools() + local itemError = false + for k, v in pairs(refSeeds) do + if select(2, GetItemInfo(k)) == nil then itemError = true end + end + for k, v in pairs(refTools) do + if select(2, GetItemInfo(k)) == nil then itemError = true end + end + for k, v in pairs(refPortals) do + if select(2, GetItemInfo(k)) == nil then itemError = true end + end + if InCombatLockdown() or itemError then + MOD.TitleWindow:AddMessage("|cffffff11Loading Farm Tools...|r|cffff1111PLEASE WAIT|r") + SuperVillain:ExecuteTimer(LoadFarmingModeTools, 5) + else + local horizontal = MOD.db.farming.toolbardirection == 'HORIZONTAL' + + local seeds, farmtools, portals = {},{},{} + + for k, v in pairs(refSeeds) do + seeds[k] = { v[1], GetItemInfo(k) } + end + + for k, v in pairs(refTools) do + farmtools[k] = { v[1], GetItemInfo(k) } + end + + for k, v in pairs(refPortals) do + portals[k] = { v[1], GetItemInfo(k) } + end + + for i = 1, NUM_SEED_BARS do + local seedBar = _G["FarmSeedBar"..i] + seedButtons[i] = seedButtons[i] or {} + local sbc = 1; + for k, v in pairs(seeds) do + if v[1] == i then + seedButtons[i][sbc] = CreateFarmingButton(k, seedBar, "SeedBar"..i.."Seed", "item", v[2], v[11], false, true); + sbc = sbc + 1; + end + tsort(seedButtons[i], seedsort) + end + end + + local ftc = 1; + for k, v in pairs(farmtools) do + farmToolButtons[ftc] = CreateFarmingButton(k, _G["FarmToolBar"], "Tools", "item", v[2], v[11], true, false); + ftc = ftc + 1; + end + + local playerFaction = UnitFactionGroup('player') + local pbc = 1; + for k, v in pairs(portals) do + if v[1] == playerFaction then + portalButtons[pbc] = CreateFarmingButton(k, _G["FarmPortalBar"], "Portals", "item", v[2], v[11], false, true); + pbc = pbc + 1; + end + end + + MOD.Farming.Loaded = true + SuperVillain:ExecuteTimer(MOD.Farming.Enable, 1.5) + end + end +end +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +MOD.Farming = {}; +MOD.Farming.Loaded = false; +MOD.Farming.ToolsLoaded = false; + +function MOD.Farming:Enable() + if InCombatLockdown() then return end + + MOD:ModeLootLoader("Farming", "Farming Mode", "This mode will provide you \nwith fast-access buttons for each \nof your seeds and farming tools."); + + MOD.TitleWindow:Clear() + if(not MOD.Farming.Loaded) then + MOD.TitleWindow:AddMessage("|cffffff11Loading Farm Tools...|r") + LoadFarmingModeTools() + return + else + if not MOD.Farming.ToolsLoaded then + PlaySoundFile("Sound\\Effects\\DeathImpacts\\mDeathImpactColossalDirtA.wav") + MOD.TitleWindow:AddMessage("|cff22ff11Farming Mode|r") + MOD.ModeAlert:Show() + InventoryUpdate() + MOD.Farming.ToolsLoaded = true + EnableListener() + if not FarmModeFrame:IsShown() then FarmModeFrame:Show() end + if(not SVUI_ModesDockFrame:IsShown()) then DockButton:Click() end + end + end +end + +function MOD.Farming:Disable() + if(InCombatLockdown() or (not MOD.Farming.Loaded) or (not MOD.Farming.ToolsLoaded)) then + DisableListener() + return + end + if MOD.db.farming.droptools then + for k, v in pairs(refTools) do + local container, slot = FindItemInBags(k) + if container and slot then + PickupContainerItem(container, slot) + DeleteCursorItem() + end + end + end + if FarmModeFrame:IsShown() then FarmModeFrame:Hide() end + MOD.Farming.ToolsLoaded = false + DisableListener() +end +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +function MOD:RefreshFarmingTools() + local count, horizontal = 0, MOD.db.farming.toolbardirection == 'HORIZONTAL' + local BUTTONSPACE = MOD.db.farming.buttonspacing or 2; + local lastBar; + if not FarmToolBar:IsShown() then + _G["FarmSeedBarAnchor"]:SetPoint("TOPLEFT", _G["FarmModeFrameSlots"], "TOPLEFT", 0, 0) + else + _G["FarmSeedBarAnchor"]:SetPoint("TOPLEFT", _G["FarmToolBar"], horizontal and "BOTTOMLEFT" or "TOPRIGHT", 0, 0) + end + + for i = 1, NUM_SEED_BARS do + local seedBar = _G["FarmSeedBar"..i] + count = 0 + for i, button in ipairs(seedButtons[i]) do + local BUTTONSIZE = seedBar.ButtonSize; + button:Point("TOPLEFT", seedBar, "TOPLEFT", horizontal and (count * (BUTTONSIZE + BUTTONSPACE) + 1) or 1, horizontal and -1 or -(count * (BUTTONSIZE + BUTTONSPACE) + 1)) + button:Size(BUTTONSIZE,BUTTONSIZE) + if (not MOD.db.farming.onlyactive or (MOD.db.farming.onlyactive and button.items > 0)) then + button.icon:SetVertexColor(1,1,1) + count = count + 1 + elseif (not MOD.db.farming.onlyactive and button.items <= 0) then + button:Show() + button.icon:SetVertexColor(0.25,0.25,0.25) + count = count + 1 + else + button:Hide() + end + end + if(MOD.db.farming.onlyactive and not MOD.db.farming.undocked) then + if count==0 then + seedBar:Hide() + else + seedBar:Show() + if(not lastBar) then + seedBar:SetPoint("TOPLEFT", _G["FarmSeedBarAnchor"], "TOPLEFT", 0, 0) + else + seedBar:SetPoint("TOPLEFT", lastBar, horizontal and "BOTTOMLEFT" or "TOPRIGHT", 0, 0) + end + lastBar = seedBar + end + end + end + count = 0; + lastBar = nil; + FarmToolBar:ClearAllPoints() + FarmToolBar:SetAllPoints(FarmToolBarAnchor) + for i, button in ipairs(farmToolButtons) do + local BUTTONSIZE = FarmToolBar.ButtonSize; + button:Point("TOPLEFT", FarmToolBar, "TOPLEFT", horizontal and (count * (BUTTONSIZE + BUTTONSPACE) + 1) or 1, horizontal and -1 or -(count * (BUTTONSIZE + BUTTONSPACE) + 1)) + button:Size(BUTTONSIZE,BUTTONSIZE) + if (not MOD.db.farming.onlyactive or (MOD.db.farming.onlyactive and button.items > 0)) then + button:Show() + button.icon:SetVertexColor(1,1,1) + count = count + 1 + elseif (not MOD.db.farming.onlyactive and button.items == 0) then + button:Show() + button.icon:SetVertexColor(0.25,0.25,0.25) + count = count + 1 + else + button:Hide() + end + end + if(MOD.db.farming.onlyactive and not MOD.db.farming.undocked) then + if count==0 then + FarmToolBarAnchor:Hide() + FarmPortalBar:SetPoint("TOPLEFT", FarmModeFrameSlots, "TOPLEFT", 0, 0) + else + FarmToolBarAnchor:Show() + FarmPortalBar:SetPoint("TOPLEFT", FarmToolBarAnchor, "TOPRIGHT", 0, 0) + end + end + count = 0; + FarmPortalBar:ClearAllPoints() + FarmPortalBar:SetAllPoints(FarmPortalBarAnchor) + for i, button in ipairs(portalButtons) do + local BUTTONSIZE = FarmPortalBar.ButtonSize; + button:Point("TOPLEFT", FarmPortalBar, "TOPLEFT", horizontal and (count * (BUTTONSIZE + BUTTONSPACE) + 1) or 1, horizontal and -1 or -(count * (BUTTONSIZE + BUTTONSPACE) + 1)) + button:Size(BUTTONSIZE,BUTTONSIZE) + if (not MOD.db.farming.onlyactive or (MOD.db.farming.onlyactive and button.items > 0)) then + button:Show() + button.icon:SetVertexColor(1,1,1) + count = count + 1 + elseif (not MOD.db.farming.onlyactive and button.items == 0) then + button:Show() + button.icon:SetVertexColor(0.25,0.25,0.25) + count = count + 1 + else + button:Hide() + end + end + if(MOD.db.farming.onlyactive) then + if count==0 then + FarmPortalBar:Hide() + else + FarmPortalBar:Show() + end + end +end + +function MOD:PrepareFarmingTools() + local horizontal = self.db.farming.toolbardirection == "HORIZONTAL" + local BUTTONSPACE = self.db.farming.buttonspacing or 2; + + ModeLogsFrame = MOD.LogWindow; + DockButton = _G["SVUI_ModesDockFrame_ToolBarButton"] + + if not self.db.farming.undocked then + local bgTex = [[Interface\BUTTONS\WHITE8X8]] + local bdTex = SuperVillain.Media.bar.glow + local farmingDocklet = CreateFrame("ScrollFrame", "FarmModeFrame", ModeLogsFrame); + farmingDocklet:SetPoint("TOPLEFT", ModeLogsFrame, 31, -3); + farmingDocklet:SetPoint("BOTTOMRIGHT", ModeLogsFrame, -3, 3); + farmingDocklet:EnableMouseWheel(true); + + local farmingDockletSlots = CreateFrame("Frame", "FarmModeFrameSlots", farmingDocklet); + farmingDockletSlots:SetPoint("TOPLEFT", farmingDocklet, 0, 0); + farmingDockletSlots:SetWidth(farmingDocklet:GetWidth()) + farmingDockletSlots:SetHeight(500); + farmingDockletSlots:SetFrameLevel(farmingDocklet:GetFrameLevel() + 1) + farmingDocklet:SetScrollChild(farmingDockletSlots) + + local slotSlider = CreateFrame("Slider", "FarmModeSlotSlider", farmingDocklet); + slotSlider:SetHeight(farmingDocklet:GetHeight() - 3); + slotSlider:SetWidth(18); + slotSlider:SetPoint("TOPLEFT", farmingDocklet, -28, 0); + slotSlider:SetPoint("BOTTOMLEFT", farmingDocklet, -28, 0); + slotSlider:SetBackdrop({bgFile = bgTex, edgeFile = bdTex, edgeSize = 4, insets = {left = 3, right = 3, top = 3, bottom = 3}}); + slotSlider:SetFrameLevel(6) + slotSlider:SetFixedPanelTemplate("Transparent", true); + slotSlider:SetThumbTexture("Interface\\Buttons\\UI-ScrollBar-Knob"); + slotSlider:SetOrientation("VERTICAL"); + slotSlider:SetValueStep(5); + slotSlider:SetMinMaxValues(1, 420); + slotSlider:SetValue(1); + + farmingDocklet.slider = slotSlider; + slotSlider:SetScript("OnValueChanged", Scroll_OnValueChanged) + farmingDocklet:SetScript("OnMouseWheel", Scroll_OnMouseWheel); + + local parentWidth = FarmModeFrameSlots:GetWidth() - 31 + local BUTTONSIZE = (parentWidth / (horizontal and 10 or 8)); + local TOOLSIZE = (parentWidth / 8); + + -- FARM TOOLS + local farmToolBarAnchor = CreateFrame("Frame", "FarmToolBarAnchor", farmingDockletSlots) + farmToolBarAnchor:Point("TOPLEFT", farmingDockletSlots, "TOPLEFT", 0, 0) + farmToolBarAnchor:Size(horizontal and ((TOOLSIZE + BUTTONSPACE) * 4) or (TOOLSIZE + BUTTONSPACE), horizontal and (TOOLSIZE + BUTTONSPACE) or ((TOOLSIZE + BUTTONSPACE) * 4)) + + local farmToolBar = CreateFrame("Frame", "FarmToolBar", farmToolBarAnchor) + farmToolBar:Size(horizontal and ((TOOLSIZE + BUTTONSPACE) * 4) or (TOOLSIZE + BUTTONSPACE), horizontal and (TOOLSIZE + BUTTONSPACE) or ((TOOLSIZE + BUTTONSPACE) * 4)) + farmToolBar:SetPoint("TOPLEFT", farmToolBarAnchor, "TOPLEFT", (horizontal and BUTTONSPACE or (TOOLSIZE + BUTTONSPACE)), (horizontal and -(TOOLSIZE + BUTTONSPACE) or -BUTTONSPACE)) + farmToolBar.ButtonSize = TOOLSIZE; + + -- PORTALS + local farmPortalBarAnchor = CreateFrame("Frame", "FarmPortalBarAnchor", farmingDockletSlots) + farmPortalBarAnchor:Point("TOPLEFT", farmToolBarAnchor, "TOPRIGHT", 0, 0) + farmPortalBarAnchor:Size(horizontal and ((TOOLSIZE + BUTTONSPACE) * 4) or (TOOLSIZE + BUTTONSPACE), horizontal and (TOOLSIZE + BUTTONSPACE) or ((TOOLSIZE + BUTTONSPACE) * 4)) + + local farmPortalBar = CreateFrame("Frame", "FarmPortalBar", farmPortalBarAnchor) + farmPortalBar:Size(horizontal and ((TOOLSIZE + BUTTONSPACE) * 4) or (TOOLSIZE + BUTTONSPACE), horizontal and (TOOLSIZE + BUTTONSPACE) or ((TOOLSIZE + BUTTONSPACE) * 4)) + farmPortalBar:SetPoint("TOPLEFT", farmPortalBarAnchor, "TOPLEFT", (horizontal and BUTTONSPACE or (TOOLSIZE + BUTTONSPACE)), (horizontal and -(TOOLSIZE + BUTTONSPACE) or -BUTTONSPACE)) + farmPortalBar.ButtonSize = TOOLSIZE; + + -- SEEDS + local farmSeedBarAnchor = CreateFrame("Frame", "FarmSeedBarAnchor", farmingDockletSlots) + farmSeedBarAnchor:Point("TOPLEFT", farmPortalBarAnchor, horizontal and "BOTTOMLEFT" or "TOPRIGHT", 0, 0) + farmSeedBarAnchor:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 10) or ((BUTTONSIZE + BUTTONSPACE) * 8), horizontal and ((BUTTONSIZE + BUTTONSPACE) * 8) or ((BUTTONSIZE + BUTTONSPACE) * 10)) + + for i = 1, NUM_SEED_BARS do + local seedBar = CreateFrame("Frame", "FarmSeedBar"..i, farmSeedBarAnchor) + seedBar.ButtonSize = BUTTONSIZE; + seedBar:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 10) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 10)) + if i == 1 then + seedBar:SetPoint("TOPLEFT", farmSeedBarAnchor, "TOPLEFT", 0, 0) + else + seedBar:SetPoint("TOPLEFT", "FarmSeedBar"..i-1, horizontal and "BOTTOMLEFT" or "TOPRIGHT", 0, 0) + end + end + + farmingDocklet:Hide() + else + local BUTTONSIZE = self.db.farming.buttonsize or 35; + + -- SEEDS + local farmSeedBarAnchor = CreateFrame("Frame", "FarmSeedBarAnchor", SuperVillain.UIParent) + farmSeedBarAnchor:Point("TOPRIGHT", SuperVillain.UIParent, "TOPRIGHT", -40, -300) + farmSeedBarAnchor:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 10) or ((BUTTONSIZE + BUTTONSPACE) * 8), horizontal and ((BUTTONSIZE + BUTTONSPACE) * 8) or ((BUTTONSIZE + BUTTONSPACE) * 10)) + for i = 1, NUM_SEED_BARS do + local seedBar = CreateFrame("Frame", "FarmSeedBar"..i, farmSeedBarAnchor) + seedBar:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 10) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 10)) + seedBar:SetPoint("TOPRIGHT", _G["FarmSeedBarAnchor"], "TOPRIGHT", (horizontal and 0 or -((BUTTONSIZE + BUTTONSPACE) * i)), (horizontal and -((BUTTONSIZE + BUTTONSPACE) * i) or 0)) + seedBar.ButtonSize = BUTTONSIZE; + end + SuperVillain:SetSVMovable(farmSeedBarAnchor, "Farming Seeds") + + -- FARM TOOLS + local farmToolBarAnchor = CreateFrame("Frame", "FarmToolBarAnchor", SuperVillain.UIParent) + farmToolBarAnchor:Point("TOPRIGHT", farmSeedBarAnchor, horizontal and "BOTTOMRIGHT" or "TOPLEFT", horizontal and 0 or -(BUTTONSPACE * 2), horizontal and -(BUTTONSPACE * 2) or 0) + farmToolBarAnchor:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 4) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 4)) + local farmToolBar = CreateFrame("Frame", "FarmToolBar", farmToolBarAnchor) + farmToolBar:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 4) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 4)) + farmToolBar:SetPoint("TOPRIGHT", farmToolBarAnchor, "TOPRIGHT", (horizontal and -BUTTONSPACE or -(BUTTONSIZE + BUTTONSPACE)), (horizontal and -(BUTTONSIZE + BUTTONSPACE) or -BUTTONSPACE)) + farmToolBar.ButtonSize = BUTTONSIZE; + SuperVillain:SetSVMovable(farmToolBarAnchor, "Farming Tools") + + -- PORTALS + local farmPortalBarAnchor = CreateFrame("Frame", "FarmPortalBarAnchor", SuperVillain.UIParent) + farmPortalBarAnchor:Point("TOPRIGHT", farmToolBarAnchor, horizontal and "BOTTOMRIGHT" or "TOPLEFT", horizontal and 0 or -(BUTTONSPACE * 2), horizontal and -(BUTTONSPACE * 2) or 0) + farmPortalBarAnchor:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 4) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 4)) + local farmPortalBar = CreateFrame("Frame", "FarmPortalBar", farmPortalBarAnchor) + farmPortalBar:Size(horizontal and ((BUTTONSIZE + BUTTONSPACE) * 4) or (BUTTONSIZE + BUTTONSPACE), horizontal and (BUTTONSIZE + BUTTONSPACE) or ((BUTTONSIZE + BUTTONSPACE) * 4)) + farmPortalBar:SetPoint("TOPRIGHT", farmPortalBarAnchor, "TOPRIGHT", (horizontal and -BUTTONSPACE or -(BUTTONSIZE + BUTTONSPACE)), (horizontal and -(BUTTONSIZE + BUTTONSPACE) or -BUTTONSPACE)) + farmPortalBar.ButtonSize = BUTTONSIZE; + SuperVillain:SetSVMovable(farmPortalBarAnchor, "Farming Portals") + end +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_Laborer/modes/fishing.lua b/Interface/AddOns/SVUI_Laborer/modes/fishing.lua new file mode 100644 index 0000000..e22c264 --- /dev/null +++ b/Interface/AddOns/SVUI_Laborer/modes/fishing.lua @@ -0,0 +1,380 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ GLOBALS ]]-- +local _G = _G; +local unpack = _G.unpack; +local select = _G.select; +local type = _G.type; +local string = _G.string; +local math = _G.math; +local table = _G.table; +local rept = string.rep; +local tsort,twipe = table.sort,table.wipe; +local floor,ceil = math.floor, math.ceil; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local SuperVillain, L = unpack(SVUI) +local MOD = _G.LaborVillain +--[[ +########################################################## +LOCAL VARS +########################################################## +]]-- +local fishingIsKnown, fishingSpell, fishingLure; +local proxyTest = false; +local refLures = { + { ["id"] = 6529, ["bonus"] = 25, ["skillReq"] = 1, ["order"] = 10, }, --Shiny Bauble + { ["id"] = 6811, ["bonus"] = 50, ["skillReq"] = 50, ["order"] = 10, }, --Aquadynamic Fish Lens + { ["id"] = 6530, ["bonus"] = 50, ["skillReq"] = 50, ["order"] = 10, }, --Nightcrawlers + { ["id"] = 7307, ["bonus"] = 75, ["skillReq"] = 100, ["order"] = 10, }, --Flesh Eating Worm + { ["id"] = 6532, ["bonus"] = 75, ["skillReq"] = 100, ["order"] = 10, }, --Bright Baubles + { ["id"] = 34861, ["bonus"] = 100, ["skillReq"] = 100, ["order"] = 10, }, --Sharpened Fish Hook + { ["id"] = 6533, ["bonus"] = 100, ["skillReq"] = 100, ["order"] = 10, }, --Aquadynamic Fish Attractor + { ["id"] = 62673, ["bonus"] = 100, ["skillReq"] = 100, ["order"] = 10, }, --Feathered Lure + { ["id"] = 46006, ["bonus"] = 100, ["skillReq"] = 100, ["order"] = 60, }, --Glow Worm + { ["id"] = 68049, ["bonus"] = 150, ["skillReq"] = 250, ["order"] = 5, }, --Heat-Treated Spinning Lure + { ["id"] = 67404, ["bonus"] = 15, ["skillReq"] = 1, ["order"] = 10, }, --Glass Fishing Bobber +} +tsort(refLures, function(a,b) + if ( a.bonus == b.bonus ) then + return a.order < b.order; + else + return a.bonus < b.bonus; + end +end); +local refHats = { + { ["id"] = 93732, ["weight"] = 10, ["nocast"] = true }, --Darkmoon Fishing Hat + { ["id"] = 33820, ["weight"] = 50 }, --Weather Beaten Fishing Hat + { ["id"] = 19972, ["weight"] = 75 }, --Lucky Fishing Hat + { ["id"] = 88710, ["weight"] = 100 }, --Nats Hat +} +local refPoles = { + { ["id"] = 44050, ["weight"] = 33 }, --Kaluak + { ["id"] = 25978, ["weight"] = 22 }, --Seths Graphite + { ["id"] = 19022, ["weight"] = 21 }, --Nat Pagles Extreme Angler + { ["id"] = 6367, ["weight"] = 20 }, --Big Iron + { ["id"] = 6366, ["weight"] = 15 }, --Darkwood + { ["id"] = 84661, ["weight"] = 32 }, --Dragon + { ["id"] = 19970, ["weight"] = 40 }, --Arcanite + { ["id"] = 45858, ["weight"] = 25 }, --Nats Lucky + { ["id"] = 45992, ["weight"] = 31 }, --Jeweled + { ["id"] = 45991, ["weight"] = 30 }, --Bone + { ["id"] = 6365, ["weight"] = 5 }, --Strong + { ["id"] = 12225, ["weight"] = 4 }, --Blump Family + { ["id"] = 46337, ["weight"] = 3 }, --Staats + { ["id"] = 84660, ["weight"] = 10 }, --Pandaren + { ["id"] = 6256, ["weight"] = 1 } --Standard +} +local DockButton; +--[[ +########################################################## +LOCAL FUNCTIONS +########################################################## +]]-- +local function SendModeMessage(...) + if not CombatText_AddMessage then return end; + CombatText_AddMessage(...) +end; + +local function GetFishingSkill() + local fishing = select(4, GetProfessions()) + if (fishing) then + local rank = select(3, GetProfessionInfo(fishing)) + return rank + end + return 0, 0, 0 +end; + +local function FishingPoleIsEquipped() + local itemId = GetInventoryItemID("player", 16) + if itemId then + local subclass = select(7, GetItemInfo(itemId)) + local weaponSubTypesList = select(17, GetAuctionItemSubClasses(1)) + if subclass == weaponSubTypesList then + return true + else + return false + end + else + return false + end +end + +local function UpdateFishingGear(autoequip) + local lastBonus, lastWeight = 0,0; + local rawskill = GetFishingSkill(); + local item,id,bonus,count; + + -- Check for and equip a fishing hat, if autoequip is enabled + if(autoequip) then + local fishingHat = false; + for i=1, #refHats do + item = refHats[i] + id = item.id + bonus = item.weight + count = GetItemCount(id) + if ( count > 0 and bonus > lastWeight ) then + fishingHat = id + lastWeight = bonus + if(item.weight > 10) then + fishingLure = id + lastBonus = bonus + end + end + end + if(fishingHat) then + local HelmetID = GetInventoryItemID("player", INVSLOT_HEAD); + if(HelmetID) then + MOD.WornItems["HEAD"] = HelmetID + end + EquipItemByName(fishingHat) + MOD.InModeGear = true + end + end + + -- Check for and save best fishing lure + for i=1, #refLures do + item = refLures[i] + id = item.id + bonus = item.bonus + count = GetItemCount(id) + if ( count > 0 and bonus > (lastBonus or 0) ) then + if ( item.skillReq <= rawskill ) then + fishingLure = id + lastBonus = bonus + end + end + end + + -- Check for and equip a fishing pole, if autoequip is enabled + if(autoequip) then + lastBonus = 0; + local fishingPole = false; + for i=1, #refPoles do + item = refPoles[i] + id = item.id + bonus = item.weight + count = GetItemCount(id) + if ( count > 0 and bonus > (lastBonus or 0) ) then + fishingPole = id + lastBonus = bonus + end + end + if(fishingPole) then + local MainHandID = GetInventoryItemID("player", INVSLOT_MAINHAND); + if(MainHandID) then + MOD.WornItems["MAIN"] = MainHandID + end + + local OffHandID = GetInventoryItemID("player", INVSLOT_OFFHAND); + if(OffHandID) then + MOD.WornItems["OFF"] = OffHandID; + end + + EquipItemByName(fishingPole) + MOD.InModeGear = true + end + end +end + +local function LootProxy(item, name) + if(item) then + local mask = [[0x100000]]; + local itemType = GetItemFamily(item); + local pass = bit.band(itemType, mask); + if pass > 0 then + proxyTest = true; + end + end +end; + +local function GetTitleAndSkill() + local skillRank, skillModifier; + local msg = "|cff22ff11Fishing Mode|r" + local _,_,_,fishing,_,_ = GetProfessions(); + if fishing ~= nil then + _, _, skillRank, _, _, _, _, skillModifier = GetProfessionInfo(fishing) + if(skillModifier) then + skillRank = skillRank + skillModifier; + end + msg = msg .. " (|cff00ddff" .. skillRank .. "|r)"; + end; + return msg +end +--[[ +########################################################## +CORE NAMESPACE +########################################################## +]]-- +MOD.Fishing = {}; +MOD.Fishing.Log = {}; +MOD.Fishing.Loaded = false; +--[[ +########################################################## +EVENT HANDLER +########################################################## +]]-- +local EnableListener, DisableListener +do + local FishEventHandler = CreateFrame("Frame") + local LootProxy = function(item, name) + if(item) then + local mask = [[0x10000]]; + local itemType = GetItemFamily(item); + local pass = bit.band(itemType, mask); + if pass > 0 then + proxyTest = true; + end + end + end; + + local Fish_OnEvent = function(self, event, ...) + if(InCombatLockdown()) then return end + if(event == "BAG_UPDATE" or event == "CHAT_MSG_SKILL") then + local msg = GetTitleAndSkill() + MOD.TitleWindow:Clear() + MOD.TitleWindow:AddMessage(msg) + elseif(event == "LOOT_OPENED") then + if IsFishingLoot() then + proxyTest = true; + else + proxyTest = false; + end + elseif(event == "CHAT_MSG_LOOT") then + local item, amt = MOD:CheckForModeLoot(...); + if item then + local name, lnk, rarity, lvl, mlvl, itype, stype, cnt, ieq, tex, price = GetItemInfo(item); + if proxyTest == false then + LootProxy(lnk, name) + end; + if proxyTest == false then return end; + if not MOD.Fishing.Log[name] then + MOD.Fishing.Log[name] = {amount = 0, texture = ""}; + end; + local r, g, b, hex = GetItemQualityColor(rarity); + local stored = MOD.Fishing.Log + local mod = stored[name]; + local newAmt = mod.amount + 1; + if amt >= 2 then newAmt = mod.amount + amt end; + MOD.Fishing.Log[name].amount = newAmt; + MOD.Fishing.Log[name].texture = tex; + MOD.LogWindow:Clear(); + + for name,data in pairs(stored) do + if type(data) == "table" and data.amount and data.texture then + MOD.LogWindow:AddMessage("|cff55FF55"..data.amount.." x|r |T".. data.texture ..":16:16:0:0:64:64:4:60:4:60|t".." "..name, r, g, b); + end + end; + MOD.LogWindow:AddMessage("----------------", 0, 0, 0); + MOD.LogWindow:AddMessage("Caught So Far...", 0, 1, 1); + MOD.LogWindow:AddMessage(" ", 0, 0, 0); + proxyTest = false; + end + end + end; + + function EnableListener() + FishEventHandler:RegisterEvent("LOOT_OPENED") + FishEventHandler:RegisterEvent("CHAT_MSG_LOOT") + FishEventHandler:RegisterEvent("BAG_UPDATE") + FishEventHandler:RegisterEvent("CHAT_MSG_SKILL") + FishEventHandler:SetScript("OnEvent", Fish_OnEvent) + end + + function DisableListener() + FishEventHandler:UnregisterAllEvents() + FishEventHandler:SetScript("OnEvent", nil) + end +end +--[[ +########################################################## +CORE METHODS +########################################################## +]]-- +function MOD.Fishing:Enable() + MOD:UpdateFishingMode() + if(not SVUI_ModesDockFrame:IsShown()) then DockButton:Click() end + UpdateFishingGear(MOD.db.fishing.autoequip); + PlaySoundFile("Sound\\Spells\\Tradeskills\\FishCast.wav") + MOD.ModeAlert:SetBackdropColor(0.25, 0.52, 0.1) + if(not IsSpellKnown(131474)) then + MOD:ModeLootLoader("Fishing", "WTF is Fishing?", "You have no clue how to fish! \nThe last time you tried \nyou hooked yourself through the eyelid. \nGo find a trainer and learn \nhow to do this properly!"); + else + local msg = GetTitleAndSkill(); + MOD:ModeLootLoader("Fishing", msg, "Double-Right-Click anywhere on the screen \nto cast your fishing line."); + end + EnableListener() + MOD.ModeAlert:Show() + SendModeMessage("Fishing Mode Enabled", CombatText_StandardScroll, 0.28, 0.9, 0.1); +end + +function MOD.Fishing:Disable() + DisableListener() +end + +function MOD.Fishing:Bind() + if InCombatLockdown() then return end + if fishingIsKnown then + if FishingPoleIsEquipped() then + local hasMainHandEnchant = GetWeaponEnchantInfo() + if hasMainHandEnchant then + _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") + _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', fishingSpell) + MOD.ModeAlert.HelpText = 'Double-Right-Click to fish.' + elseif(fishingLure) then + _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "item") + _G["SVUI_ModeCaptureWindow"]:SetAttribute("item", "item:" .. fishingLure) + if(GetItemCooldown(fishingLure) > 0) then + _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") + _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', fishingSpell) + MOD.ModeAlert.HelpText = 'Double-Right-Click to fish.' + else + MOD.ModeAlert.HelpText = 'Double-Right-Click to apply fishing enchants.' + end + else + _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") + _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', fishingSpell) + MOD.ModeAlert.HelpText = 'Double-Right-Click to fish.' + end + else + _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") + _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', fishingSpell) + MOD.ModeAlert.HelpText = 'Double-Right-Click to fish.' + end + SetOverrideBindingClick(_G["SVUI_ModeCaptureWindow"], true, "BUTTON2", "SVUI_ModeCaptureWindow"); + _G["SVUI_ModeCaptureWindow"].Grip:Show(); + end +end +--[[ +########################################################## +LOADER +########################################################## +]]-- +function MOD:UpdateFishingMode() + fishingIsKnown = IsSpellKnown(131474); + fishingSpell = GetSpellInfo(131474); +end + +function MOD:LoadFishingMode() + DockButton = _G["SVUI_ModesDockFrame_ToolBarButton"] + MOD:UpdateFishingMode() +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua index 3e75291..c743ae0 100644 --- a/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua +++ b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua @@ -37,15 +37,15 @@ local twipe,tcopy,tsort = table.wipe, table.copy, table.sort; GET ADDON DATA ########################################################## ]]-- -local SVUIAddOnName, LOG = ...; -local SuperVillain, L = unpack(SVUI); +local SVUIAddOnName, PLUGIN = ...; +local SuperVillain, L, G, CONFIGS = unpack(SVUI); local NewHook = hooksecurefunc; local SVUILogEventHandler = CreateFrame("Frame", nil) local version = GetAddOnMetadata(..., "Version"); -LOG = SuperVillain:Prototype(SVUIAddOnName, version) +PLUGIN = SuperVillain:Prototype(SVUIAddOnName, version) -_G["LogVillain"] = LOG; +_G["LogVillain"] = PLUGIN; local CHAT = SuperVillain.SVChat; --[[ ########################################################## @@ -81,11 +81,10 @@ local LoggingEvents = { CORE DATA ########################################################## ]]-- -LOG.stash = {}; -LOG.myStash = {}; -LOG.BagItemCache = {}; -LOG.HasAltInventory = false; -LOG.OptionsCache = {}; +PLUGIN.stash = {}; +PLUGIN.myStash = {}; +PLUGIN.BagItemCache = {}; +PLUGIN.HasAltInventory = false; --[[ ########################################################## LOCAL FUNCTIONS @@ -130,7 +129,7 @@ local RefreshLoggedSlot = function(self, bag, slotID, save) end if (key and save) then local id = GetContainerItemID(bag,slotID) - if id ~= 6948 then LOG.myStash[bag][key] = GetItemCount(id,true) end + if id ~= 6948 then PLUGIN.myStash[bag][key] = GetItemCount(id,true) end end else slot:SetBackdropBorderColor(0, 0, 0) @@ -160,28 +159,28 @@ local RefreshLoggedBagsSlots = function(self) for _,bag in ipairs(self.BagIDs)do local container = self.Bags[bag] if container then - if LOG.myStash[bag] then - twipe(LOG.myStash[bag]) + if PLUGIN.myStash[bag] then + twipe(PLUGIN.myStash[bag]) else - LOG.myStash[bag] = {}; + PLUGIN.myStash[bag] = {}; end RefreshLoggedBagSlots(container, bag, true) end end - for bag,items in pairs(LOG.myStash) do + for bag,items in pairs(PLUGIN.myStash) do for id,amt in pairs(items) do - LOG.BagItemCache[id] = LOG.BagItemCache[id] or {} - LOG.BagItemCache[id][nameKey] = amt + PLUGIN.BagItemCache[id] = PLUGIN.BagItemCache[id] or {} + PLUGIN.BagItemCache[id][nameKey] = amt end end end local GameTooltip_LogTooltipSetItem = function(self) local key,itemID = self:GetItem() - if LOG.BagItemCache[key] then + if PLUGIN.BagItemCache[key] then self:AddLine(" ") self:AddDoubleLine("|cFFFFDD3C[Character]|r","|cFFFFDD3C[Count]|r") - for alt,amt in pairs(LOG.BagItemCache[key]) do + for alt,amt in pairs(PLUGIN.BagItemCache[key]) do local hexString = SVLOG_Data[realmKey]["info"][alt] or "|cffCC1410" local name = ("%s%s|r"):format(hexString, alt) local result = ("%s%s|r"):format(hexString, amt) @@ -253,15 +252,15 @@ function CHAT:PLAYER_ENTERING_WORLD() self:UnregisterEvent("PLAYER_ENTERING_WORLD") end -function LOG:AppendBankFunctions() +function PLUGIN:AppendBankFunctions() local BAGS = SuperVillain.SVBag; if(BAGS.BankFrame) then BAGS.BankFrame.RefreshBagsSlots = RefreshLoggedBagsSlots end end -function LOG:AppendChatFunctions() - if SuperVillain.db.SVChat.enable and SuperVillain.db.SVChat.saveChats then +function PLUGIN:AppendChatFunctions() + if SuperVillain.db.SVChat.enable and SuperVillain.db.SVLogs.saveChats then for _,event in pairs(LoggingEvents) do SuperVillain.SVChat:RegisterEvent(event, "LogCurrentChat") end @@ -273,29 +272,11 @@ end CORE FUNCTIONS ########################################################## ]]-- -local function SetConfigOptions() - SuperVillain.Options.args.SVLogs = { - type = "group", - name = L["Logging"], - childGroups = "tree", - args = { - common = { - order = 100, - type = "group", - name = "Logging", - guiInline = true, - args = {} - } - } - }; - for key, options in pairs(LOG.OptionsCache) do - SuperVillain.Options.args.SVLogs.args.common.args[key] = options; - end -end - local function ResetAllLogs() - if SVLOG_Data[realmKey]["bags"][nameKey] then SVLOG_Data[realmKey]["bags"][nameKey] = {} end - if SVLOG_Data[realmKey]["gold"][nameKey] then SVLOG_Data[realmKey]["gold"][nameKey] = 0 end + if SVLOG_Data[realmKey] then + if SVLOG_Data[realmKey]["bags"] and SVLOG_Data[realmKey]["bags"][nameKey] then SVLOG_Data[realmKey]["bags"][nameKey] = {} end + if SVLOG_Data[realmKey]["gold"] and SVLOG_Data[realmKey]["gold"][nameKey] then SVLOG_Data[realmKey]["gold"][nameKey] = 0 end + end if SVLOG_Cache then SVLOG_Cache = {} end end --[[ @@ -303,7 +284,36 @@ end BUILD FUNCTION ########################################################## ]]-- +local function LoadOptions() + SuperVillain.Options.args.plugins.args.pluginOptions.args.SVLogs = { + type = "group", + name = L["Log O Matic"], + childGroups = "tree", + args = { + enable = { + order = 1, + type = "toggle", + name = "Enable", + get = function(a)return SuperVillain.db.SVLogs.enable end, + set = function(a,b)SuperVillain.db.SVLogs.enable = b; SuperVillain:StaticPopup_Show("RL_CLIENT") end + }, + saveChats = { + order = 2, + type = "toggle", + name = L["Save Chats"], + desc = L["Retain chat messages even after logging out."], + get = function(a)return SuperVillain.db.SVLogs.saveChats end, + set = function(a,b) SuperVillain.db.SVLogs.saveChats = b; SuperVillain:StaticPopup_Show("RL_CLIENT") end + }, + } + } +end + local function LoadLogOMatic() + if not SuperVillain.db.SVLogs.enable then return end + + PLUGIN.db = SuperVillain.db.SVLogs + local toonClass = select(2,UnitClass("player")); local r,g,b = RAID_CLASS_COLORS[toonClass].r, RAID_CLASS_COLORS[toonClass].g, RAID_CLASS_COLORS[toonClass].b local hexString = ("|cff%02x%02x%02x"):format(r * 255, g * 255, b * 255) @@ -315,24 +325,23 @@ local function LoadLogOMatic() SVLOG_Data[realmKey]["info"][nameKey] = hexString; SVLOG_Data[realmKey]["bags"][nameKey] = SVLOG_Data[realmKey]["bags"][nameKey] or {}; - LOG.stash = SVLOG_Data[realmKey]["bags"]; - LOG.myStash = SVLOG_Data[realmKey]["bags"][nameKey]; + PLUGIN.stash = SVLOG_Data[realmKey]["bags"]; + PLUGIN.myStash = SVLOG_Data[realmKey]["bags"][nameKey]; SVLOG_Data[realmKey]["quests"] = SVLOG_Data[realmKey]["quests"] or {}; SVLOG_Data[realmKey]["quests"][nameKey] = SVLOG_Data[realmKey]["quests"][nameKey] or {}; - LOG.chronicle = SVLOG_Data[realmKey]["quests"][nameKey]; + PLUGIN.chronicle = SVLOG_Data[realmKey]["quests"][nameKey]; NewHook(SuperVillain, "ResetAllUI", ResetAllLogs); - local uselog = SuperVillain.db.SVChat.saveChats; if not SVLOG_Cache["chat"] then SVLOG_Cache["chat"] = {} end for alt,_ in pairs(SVLOG_Data[realmKey]["bags"]) do for bag,items in pairs(SVLOG_Data[realmKey]["bags"][alt]) do for id,amt in pairs(items) do - LOG.BagItemCache[id] = LOG.BagItemCache[id] or {} - LOG.BagItemCache[id][alt] = amt + PLUGIN.BagItemCache[id] = PLUGIN.BagItemCache[id] or {} + PLUGIN.BagItemCache[id][alt] = amt end end end @@ -342,7 +351,7 @@ local function LoadLogOMatic() local BAGS = SuperVillain.SVBag; if BAGS.BagFrame then BAGS.BagFrame.RefreshBagsSlots = RefreshLoggedBagsSlots; - NewHook(BAGS, "MakeBank", LOG.AppendBankFunctions); + NewHook(BAGS, "MakeBank", PLUGIN.AppendBankFunctions); RefreshLoggedBagsSlots(BAGS.BagFrame) end end @@ -351,9 +360,14 @@ local function LoadLogOMatic() end --[[ APPLY HOOKS ]]-- - LOG:AppendChatFunctions() - NewHook(CHAT, "ReLoad", LOG.AppendChatFunctions); + PLUGIN:AppendChatFunctions() + NewHook(CHAT, "ReLoad", PLUGIN.AppendChatFunctions); end +CONFIGS["SVLogs"] = { + ["enable"] = true, + ["saveChats"] = false +} + SuperVillain.Registry:NewScript(LoadLogOMatic) -SuperVillain.Registry:NewPlugin(SVUIAddOnName, SetConfigOptions) \ No newline at end of file +SuperVillain.Registry:NewPlugin(PLUGIN, "SVLogs", LoadOptions) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua index 2530d2d..ed5dd70 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua @@ -37,28 +37,28 @@ local twipe, tcopy = table.wipe, table.copy; GET ADDON DATA ########################################################## ]]-- -local SVUIAddOnName, StyleVillain = ...; -local SuperVillain, L = unpack(SVUI); +local SVUIAddOnName, PLUGIN = ...; +local SuperVillain, L, G, CONFIGS = unpack(SVUI); local NewHook = hooksecurefunc; local SVUIAddonEventHandler = CreateFrame("Frame", nil) local version = GetAddOnMetadata(..., "Version"); -StyleVillain = SuperVillain:Prototype(SVUIAddOnName, version) +PLUGIN = SuperVillain:Prototype(SVUIAddOnName, version) -_G["StyleVillain"] = StyleVillain; +_G["StyleVillain"] = PLUGIN; --[[ ########################################################## CORE DATA ########################################################## ]]-- -StyleVillain.DockedParent = {} -StyleVillain.AddOnQueue = {}; -StyleVillain.AddOnEvents = {}; -StyleVillain.BlizzardQueue = {}; -StyleVillain.CustomQueue = {}; -StyleVillain.EventListeners = {}; -StyleVillain.PassiveAddons = {}; -StyleVillain.OptionsCache = { +PLUGIN.DockedParent = {} +PLUGIN.AddOnQueue = {}; +PLUGIN.AddOnEvents = {}; +PLUGIN.BlizzardQueue = {}; +PLUGIN.CustomQueue = {}; +PLUGIN.EventListeners = {}; +PLUGIN.PassiveAddons = {}; +PLUGIN.OptionsCache = { order = 4, type = "group", name = "Addon Styling", @@ -79,13 +79,13 @@ StyleVillain.OptionsCache = { CORE FUNCTIONS ########################################################## ]]-- -function StyleVillain:LoadAlert(MainText, Function) +function PLUGIN:LoadAlert(MainText, Function) self.Alert.Text:SetText(MainText) self.Alert.Accept:SetScript('OnClick', Function) self.Alert:Show() end -function StyleVillain:IsAddonReady(this, ...) +function PLUGIN:IsAddonReady(this, ...) for i = 1, select('#', ...) do local a = select(i, ...) if not a then break end @@ -94,7 +94,7 @@ function StyleVillain:IsAddonReady(this, ...) return SuperVillain.db.SVStyle.addons[this] end -function StyleVillain:SaveAddonStyle(addon, fn, force, passive, ...) +function PLUGIN:SaveAddonStyle(addon, fn, force, passive, ...) local args,hasEvent = {},false; for i=1, select("#",...) do local event = select(i,...) @@ -119,7 +119,7 @@ function StyleVillain:SaveAddonStyle(addon, fn, force, passive, ...) end end; -function StyleVillain:SaveBlizzardStyle(addon, fn, force, passive, preload) +function PLUGIN:SaveBlizzardStyle(addon, fn, force, passive, preload) if passive then self.PassiveAddons[addon] = true end; if force then if(preload and not IsAddOnLoaded(addon)) then @@ -132,11 +132,11 @@ function StyleVillain:SaveBlizzardStyle(addon, fn, force, passive, preload) end end; -function StyleVillain:SaveCustomStyle(fn) - tinsert(StyleVillain.CustomQueue, fn) +function PLUGIN:SaveCustomStyle(fn) + tinsert(PLUGIN.CustomQueue, fn) end; -function StyleVillain:DefineEventFunction(addonEvent, addon) +function PLUGIN:DefineEventFunction(addonEvent, addon) if(not self.EventListeners[addonEvent]) then self.EventListeners[addonEvent] = {} end @@ -155,7 +155,7 @@ function StyleVillain:DefineEventFunction(addonEvent, addon) end end -function StyleVillain:SafeEventRemoval(addon, event) +function PLUGIN:SafeEventRemoval(addon, event) if not self.EventListeners[event] then return end; if not self.EventListeners[event][addon] then return end; self.EventListeners[event][addon] = nil; @@ -171,7 +171,7 @@ function StyleVillain:SafeEventRemoval(addon, event) end end; -function StyleVillain:RefreshAddonStyles() +function PLUGIN:RefreshAddonStyles() for addon,fn in pairs(self.AddOnQueue) do if(SuperVillain.db.SVStyle.addons[addon] == true) then if IsAddOnLoaded(addon) then @@ -181,7 +181,7 @@ function StyleVillain:RefreshAddonStyles() end end -function StyleVillain:LoadStyles() +function PLUGIN:LoadStyles() for addon,fn in pairs(self.BlizzardQueue) do if IsAddOnLoaded(addon) then fn() @@ -193,7 +193,7 @@ function StyleVillain:LoadStyles() end; twipe(self.CustomQueue) for addon,fn in pairs(self.AddOnQueue)do - StyleVillain:AppendAddonOption(addon) + PLUGIN:AppendAddonOption(addon) if IsAddOnLoaded(addon) then if(SuperVillain.db.SVStyle.addons[addon] == nil) then SuperVillain.db.SVStyle.addons[addon] = true @@ -213,7 +213,7 @@ function StyleVillain:LoadStyles() self:RefreshAddonStyles() end -function StyleVillain:ToggleStyle(addon, value) +function PLUGIN:ToggleStyle(addon, value) SuperVillain.db.SVStyle.addons[addon] = value end; --[[ @@ -221,12 +221,12 @@ end; OPTIONS CREATION ########################################################## ]]-- -function StyleVillain:AppendAddonOption(addon) - StyleVillain.OptionsCache.args[addon] = { +function PLUGIN:AppendAddonOption(addon) + PLUGIN.OptionsCache.args[addon] = { type = "toggle", name = addon, desc = L["Addon Styling"], - get=function(a)return StyleVillain:IsAddonReady(a[#a])end, + get=function(a)return PLUGIN:IsAddonReady(a[#a])end, set=function(a,b)SuperVillain.db.SVStyle.addons[a[#a]] = b;SuperVillain:StaticPopup_Show("RL_CLIENT")end, disabled = function() if addon then @@ -238,10 +238,119 @@ function StyleVillain:AppendAddonOption(addon) } end; -function StyleVillain:SetConfigOptions() - SuperVillain.Options.args.SVStyle={ +local RegisterAddonDocklets = function() + local MAIN = _G["SuperDockletMain"]; + local EXTRA = _G["SuperDockletExtra"]; + local main = SuperVillain.db.SVDock.docklets.DockletMain; + local alternate = SuperVillain.db.SVDock.docklets.enableExtra and SuperVillain.db.SVDock.docklets.DockletExtra or ""; + local tipLeft, tipRight = "", ""; + if main == nil or main == "None" then return end; + + if find(main, "Skada") or find(alternate, "Skada") then + if SuperVillain:IsDockletReady("Skada") then + PLUGIN:Docklet_Skada() + if find(alternate, "Skada") and EXTRA.FrameName ~= "SkadaHolder2" then + tipRight = "and Skada"; + SuperVillain:RegisterExtraDocklet("SkadaHolder2") + --PLUGIN.DockedParent["Skada"] = EXTRA + end + if find(main, "Skada") and MAIN.FrameName ~= "SkadaHolder" then + tipLeft = "Skada"; + SuperVillain:RegisterMainDocklet("SkadaHolder") + --PLUGIN.DockedParent["Skada"] = MAIN + end + end; + end; + if main == "Omen" or alternate == "Omen" then + if SuperVillain:IsDockletReady("Omen") then + if alternate == "Omen" and EXTRA.FrameName ~= "OmenAnchor" then + tipRight = "and Omen"; + SuperVillain:RegisterExtraDocklet("OmenAnchor") + PLUGIN:Docklet_Omen(EXTRA) + PLUGIN.DockedParent["Omen"] = EXTRA + elseif MAIN.FrameName ~= "OmenAnchor" then + tipLeft = "Omen"; + SuperVillain:RegisterMainDocklet("OmenAnchor") + PLUGIN:Docklet_Omen(MAIN) + PLUGIN.DockedParent["Omen"] = MAIN + end + end; + end; + if main == "Recount" or alternate == "Recount" then + if SuperVillain:IsDockletReady("Recount") then + if alternate == "Recount" and EXTRA.FrameName ~= "Recount_MainWindow" then + tipRight = "and Recount"; + SuperVillain:RegisterExtraDocklet("Recount_MainWindow") + PLUGIN:Docklet_Recount(EXTRA) + PLUGIN.DockedParent["Recount"] = EXTRA + elseif MAIN.FrameName ~= "Recount_MainWindow" then + tipLeft = "Recount"; + SuperVillain:RegisterMainDocklet("Recount_MainWindow") + PLUGIN:Docklet_Recount(MAIN) + PLUGIN.DockedParent["Recount"] = MAIN + end + end; + end; + if main == "TinyDPS" or alternate == "TinyDPS" then + if SuperVillain:IsDockletReady("TinyDPS") then + if alternate == "TinyDPS" and EXTRA.FrameName ~= "tdpsFrame" then + tipRight = "and TinyDPS"; + SuperVillain:RegisterExtraDocklet("tdpsFrame") + PLUGIN:Docklet_TinyDPS(EXTRA) + PLUGIN.DockedParent["TinyDPS"] = EXTRA + elseif MAIN.FrameName ~= "tdpsFrame" then + tipLeft = "TinyDPS"; + SuperVillain:RegisterMainDocklet("tdpsFrame") + PLUGIN:Docklet_TinyDPS(MAIN) + PLUGIN.DockedParent["TinyDPS"] = MAIN + end + end; + end; + if main == "alDamageMeter" or alternate == "alDamageMeter" then + if SuperVillain:IsDockletReady("alDamageMeter") then + if alternate == "alDamageMeter" and EXTRA.FrameName ~= "alDamagerMeterFrame" then + tipRight = "and alDamageMeter"; + SuperVillain:RegisterExtraDocklet("alDamagerMeterFrame") + PLUGIN:Docklet_alDamageMeter(EXTRA) + PLUGIN.DockedParent["alDamageMeter"] = EXTRA + elseif MAIN.FrameName ~= "alDamagerMeterFrame" then + tipLeft = "alDamageMeter"; + SuperVillain:RegisterMainDocklet("alDamagerMeterFrame") + PLUGIN:Docklet_alDamageMeter(MAIN) + PLUGIN.DockedParent["alDamageMeter"] = MAIN + end + end; + end; + + if(_G["SVUI_AddonDocklet"]) then + _G["SVUI_AddonDocklet"].TText = ("%s%s"):format(tipLeft, tipRight) + end +end; +--[[ +########################################################## +BUILD FUNCTION +########################################################## +]]-- +local Registry_OnEvent = function(self, event, ...) + if(event == "ADDON_LOADED") then + local addon = select(1, ...) + if PLUGIN.PassiveAddons[addon] then + PLUGIN.BlizzardQueue[addon]() + PLUGIN.BlizzardQueue[addon] = nil; + return + end; + if not SuperVillain.AddonLaunched or not PLUGIN.BlizzardQueue[addon] then return end; + PLUGIN.BlizzardQueue[addon]() + PLUGIN.BlizzardQueue[addon] = nil + elseif(PLUGIN[event]) then + PLUGIN[event](PLUGIN, event, ...) + end +end + +local function LoadOptions() + SuperVillain.Options.args.plugins.args.pluginOptions.args.SVStyle={ type = "group", - name = L["UI Styling"], + name = L["Style O Matic"], childGroups = "tree", args = { intro = { @@ -544,105 +653,14 @@ function StyleVillain:SetConfigOptions() } } }, - addons = StyleVillain.OptionsCache + addons = PLUGIN.OptionsCache } } end -local RegisterAddonDocklets = function() - local MAIN = _G["SuperDockletMain"]; - local EXTRA = _G["SuperDockletExtra"]; - local main = SuperVillain.db.SVDock.docklets.DockletMain; - local alternate = SuperVillain.db.SVDock.docklets.enableExtra and SuperVillain.db.SVDock.docklets.DockletExtra or ""; - local tipLeft, tipRight = "", ""; - if main == nil or main == "None" then return end; - - if find(main, "Skada") or find(alternate, "Skada") then - if SuperVillain:IsDockletReady("Skada") then - StyleVillain:Docklet_Skada() - if find(alternate, "Skada") and EXTRA.FrameName ~= "SkadaHolder2" then - tipRight = "and Skada"; - SuperVillain:RegisterExtraDocklet("SkadaHolder2") - --StyleVillain.DockedParent["Skada"] = EXTRA - end - if find(main, "Skada") and MAIN.FrameName ~= "SkadaHolder" then - tipLeft = "Skada"; - SuperVillain:RegisterMainDocklet("SkadaHolder") - --StyleVillain.DockedParent["Skada"] = MAIN - end - end; - end; - if main == "Omen" or alternate == "Omen" then - if SuperVillain:IsDockletReady("Omen") then - if alternate == "Omen" and EXTRA.FrameName ~= "OmenAnchor" then - tipRight = "and Omen"; - SuperVillain:RegisterExtraDocklet("OmenAnchor") - StyleVillain:Docklet_Omen(EXTRA) - StyleVillain.DockedParent["Omen"] = EXTRA - elseif MAIN.FrameName ~= "OmenAnchor" then - tipLeft = "Omen"; - SuperVillain:RegisterMainDocklet("OmenAnchor") - StyleVillain:Docklet_Omen(MAIN) - StyleVillain.DockedParent["Omen"] = MAIN - end - end; - end; - if main == "Recount" or alternate == "Recount" then - if SuperVillain:IsDockletReady("Recount") then - if alternate == "Recount" and EXTRA.FrameName ~= "Recount_MainWindow" then - tipRight = "and Recount"; - SuperVillain:RegisterExtraDocklet("Recount_MainWindow") - StyleVillain:Docklet_Recount(EXTRA) - StyleVillain.DockedParent["Recount"] = EXTRA - elseif MAIN.FrameName ~= "Recount_MainWindow" then - tipLeft = "Recount"; - SuperVillain:RegisterMainDocklet("Recount_MainWindow") - StyleVillain:Docklet_Recount(MAIN) - StyleVillain.DockedParent["Recount"] = MAIN - end - end; - end; - if main == "TinyDPS" or alternate == "TinyDPS" then - if SuperVillain:IsDockletReady("TinyDPS") then - if alternate == "TinyDPS" and EXTRA.FrameName ~= "tdpsFrame" then - tipRight = "and TinyDPS"; - SuperVillain:RegisterExtraDocklet("tdpsFrame") - StyleVillain:Docklet_TinyDPS(EXTRA) - StyleVillain.DockedParent["TinyDPS"] = EXTRA - elseif MAIN.FrameName ~= "tdpsFrame" then - tipLeft = "TinyDPS"; - SuperVillain:RegisterMainDocklet("tdpsFrame") - StyleVillain:Docklet_TinyDPS(MAIN) - StyleVillain.DockedParent["TinyDPS"] = MAIN - end - end; - end; - if main == "alDamageMeter" or alternate == "alDamageMeter" then - if SuperVillain:IsDockletReady("alDamageMeter") then - if alternate == "alDamageMeter" and EXTRA.FrameName ~= "alDamagerMeterFrame" then - tipRight = "and alDamageMeter"; - SuperVillain:RegisterExtraDocklet("alDamagerMeterFrame") - StyleVillain:Docklet_alDamageMeter(EXTRA) - StyleVillain.DockedParent["alDamageMeter"] = EXTRA - elseif MAIN.FrameName ~= "alDamagerMeterFrame" then - tipLeft = "alDamageMeter"; - SuperVillain:RegisterMainDocklet("alDamagerMeterFrame") - StyleVillain:Docklet_alDamageMeter(MAIN) - StyleVillain.DockedParent["alDamageMeter"] = MAIN - end - end; - end; - - if(_G["SVUI_AddonDocklet"]) then - _G["SVUI_AddonDocklet"].TText = ("%s%s"):format(tipLeft, tipRight) - end -end; ---[[ -########################################################## -BUILD FUNCTION -########################################################## -]]-- local function LoadStyleOMatic() + PLUGIN.db = SuperVillain.db.SVStyle + local alert = CreateFrame('Frame', nil, UIParent); alert:SetFixedPanelTemplate('Transparent'); alert:SetSize(250, 70); @@ -669,33 +687,101 @@ local function LoadStyleOMatic() alert.Accept:SetButtonTemplate(); alert.Close:SetButtonTemplate(); alert:Hide(); - StyleVillain.Alert = alert; + PLUGIN.Alert = alert; - StyleVillain:LoadStyles(); + PLUGIN:LoadStyles(); NewHook(SuperVillain, "ReloadDocklets", RegisterAddonDocklets); SuperVillain:ReloadDocklets(); - SuperVillain.DynamicOptions["SVStyle"] = {key = "addons", data = StyleVillain.OptionsCache}; + SuperVillain.DynamicOptions["SVStyle"] = {key = "addons", data = PLUGIN.OptionsCache}; SVUIAddonEventHandler:RegisterEvent('ADDON_LOADED'); end +CONFIGS["SVStyle"] = { + ["blizzard"] = { + ["enable"] = true, + ["bags"] = true, + ["bmah"] = true, + ["reforge"] = true, + ["calendar"] = true, + ["achievement"] = true, + ["lfguild"] = true, + ["inspect"] = true, + ["binding"] = true, + ["gbank"] = true, + ["archaeology"] = true, + ["guildcontrol"] = true, + ["gossip"] = true, + ["guild"] = true, + ["tradeskill"] = true, + ["raid"] = false, + ["talent"] = true, + ["auctionhouse"] = true, + ["barber"] = true, + ["macro"] = true, + ["debug"] = true, + ["trainer"] = true, + ["socket"] = true, + ["loot"] = true, + ["alertframes"] = true, + ["bgscore"] = true, + ["merchant"] = true, + ["mail"] = true, + ["help"] = true, + ["trade"] = true, + ["gossip"] = true, + ["greeting"] = true, + ["worldmap"] = true, + ["taxi"] = true, + ["quest"] = true, + ["petition"] = true, + ["dressingroom"] = true, + ["pvp"] = true, + ["lfg"] = true, + ["nonraid"] = true, + ["friends"] = true, + ["spellbook"] = true, + ["character"] = true, + ["misc"] = true, + ["tabard"] = true, + ["guildregistrar"] = true, + ["timemanager"] = true, + ["encounterjournal"] = true, + ["voidstorage"] = true, + ["transmogrify"] = true, + ["stable"] = true, + ["bgmap"] = true, + ["mounts"] = true, + ["petbattleui"] = true, + ["losscontrol"] = true, + ["itemUpgrade"] = true, + }, + ["addons"] = { + ["enable"] = true, + ["Skada"] = true, + ["Recount"] = true, + ["AuctionLite"] = true, + ["AtlasLoot"] = true, + ["SexyCooldown"] = true, + ["Lightheaded"] = true, + ["Outfitter"] = true, + ["WeakAuras"] = true, + ["Quartz"] = true, + ["TomTom"] = true, + ["TinyDPS"] = true, + ["Clique"] = true, + ["CoolLine"] = true, + ["ACP"] = true, + ["DXE"] = true, + ["MogIt"] = true, + ["alDamageMeter"] = true, + ["Omen"] = true, + ["TradeSkillDW"] = true, + } +} + SuperVillain.Registry:NewScript(LoadStyleOMatic) -SuperVillain.Registry:NewPlugin(SVUIAddOnName, StyleVillain.SetConfigOptions) +SuperVillain.Registry:NewPlugin(PLUGIN, "SVStyle", LoadOptions) -local Registry_OnEvent = function(self, event, ...) - if(event == "ADDON_LOADED") then - local addon = select(1, ...) - if StyleVillain.PassiveAddons[addon] then - StyleVillain.BlizzardQueue[addon]() - StyleVillain.BlizzardQueue[addon] = nil; - return - end; - if not SuperVillain.AddonLaunched or not StyleVillain.BlizzardQueue[addon] then return end; - StyleVillain.BlizzardQueue[addon]() - StyleVillain.BlizzardQueue[addon] = nil - elseif(StyleVillain[event]) then - StyleVillain[event](StyleVillain, event, ...) - end -end SVUIAddonEventHandler:SetScript("OnEvent", Registry_OnEvent) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc index 8e2e24c..dff28a0 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc +++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc @@ -1,6 +1,6 @@ ## Interface: 50400 ## Author: Munglunch, Azilroka, Sortokk -## Version: 4.076 +## Version: 4.08 ## Title: |cffFF9900SVUI |r|cffFFEF00Style O Matic|r ## Notes: Supervillain UI [|cff9911FFAddon Skins|r]. ## RequiredDeps: SVUI diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/alert.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/alert.lua index 99ecfd1..ce87424 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/alert.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/alert.lua @@ -61,7 +61,7 @@ local function AlertStyle() frame.Panel:Point("TOPLEFT", _G[frame:GetName().."Background"], "TOPLEFT", -2, -6) frame.Panel:Point("BOTTOMRIGHT", _G[frame:GetName().."Background"], "BOTTOMRIGHT", -2, 6) end; - _G["AchievementAlertFrame"..i.."Background"]:SetTexture(nil) + _G["AchievementAlertFrame"..i.."Background"]:SetTexture(0,0,0,0) _G["AchievementAlertFrame"..i.."OldAchievement"]:MUNG() _G["AchievementAlertFrame"..i.."Glow"]:MUNG() _G["AchievementAlertFrame"..i.."Shine"]:MUNG() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/character.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/character.lua index aab4126..63e305d 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/character.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/character.lua @@ -113,7 +113,7 @@ local function EquipmentFlyout_OnShow() local texture = _G["EquipmentFlyoutFrameButton"..counter.."IconTexture"] button:SetButtonTemplate() texture:SetTexCoord(0.1, 0.9, 0.1, 0.9) - button:GetNormalTexture():SetTexture(nil) + button:GetNormalTexture():SetTexture(0,0,0,0) texture:FillInner() button:SetFrameLevel(button:GetFrameLevel() + 2) if not button.Panel then @@ -162,13 +162,13 @@ local function Reputation_OnShow() if not bar.Panel then bar:SetPanelTemplate("Inset") end; - _G["ReputationBar"..i.."Background"]:SetTexture(nil) - _G["ReputationBar"..i.."ReputationBarHighlight1"]:SetTexture(nil) - _G["ReputationBar"..i.."ReputationBarHighlight2"]:SetTexture(nil) - _G["ReputationBar"..i.."ReputationBarAtWarHighlight1"]:SetTexture(nil) - _G["ReputationBar"..i.."ReputationBarAtWarHighlight2"]:SetTexture(nil) - _G["ReputationBar"..i.."ReputationBarLeftTexture"]:SetTexture(nil) - _G["ReputationBar"..i.."ReputationBarRightTexture"]:SetTexture(nil) + _G["ReputationBar"..i.."Background"]:SetTexture(0,0,0,0) + _G["ReputationBar"..i.."ReputationBarHighlight1"]:SetTexture(0,0,0,0) + _G["ReputationBar"..i.."ReputationBarHighlight2"]:SetTexture(0,0,0,0) + _G["ReputationBar"..i.."ReputationBarAtWarHighlight1"]:SetTexture(0,0,0,0) + _G["ReputationBar"..i.."ReputationBarAtWarHighlight2"]:SetTexture(0,0,0,0) + _G["ReputationBar"..i.."ReputationBarLeftTexture"]:SetTexture(0,0,0,0) + _G["ReputationBar"..i.."ReputationBarRightTexture"]:SetTexture(0,0,0,0) end end end; @@ -250,10 +250,10 @@ local function CharacterFrameStyle() for _,btn in pairs(CharFrameList)do _G[btn]:Formula409(true) end; - CharacterModelFrameBackgroundTopLeft:SetTexture(nil) - CharacterModelFrameBackgroundTopRight:SetTexture(nil) - CharacterModelFrameBackgroundBotLeft:SetTexture(nil) - CharacterModelFrameBackgroundBotRight:SetTexture(nil) + CharacterModelFrameBackgroundTopLeft:SetTexture(0,0,0,0) + CharacterModelFrameBackgroundTopRight:SetTexture(0,0,0,0) + CharacterModelFrameBackgroundBotLeft:SetTexture(0,0,0,0) + CharacterModelFrameBackgroundBotRight:SetTexture(0,0,0,0) CharacterFrame:SetPanelTemplate("Action") CharacterModelFrame:SetPanelTemplate("Comic", false, 0) CharacterFrameExpandButton:SetFrameLevel(CharacterModelFrame:GetFrameLevel() + 5) @@ -261,10 +261,10 @@ local function CharacterFrameStyle() PaperDollTitlesPane:SetFixedPanelTemplate("Inset") PaperDollTitlesPane:HookScript("OnShow", function(f) for _,btn in pairs(PaperDollTitlesPane.buttons)do - btn.BgTop:SetTexture(nil) - btn.BgBottom:SetTexture(nil) - btn.BgMiddle:SetTexture(nil) - btn.Check:SetTexture(nil) + btn.BgTop:SetTexture(0,0,0,0) + btn.BgBottom:SetTexture(0,0,0,0) + btn.BgMiddle:SetTexture(0,0,0,0) + btn.Check:SetTexture(0,0,0,0) btn.text:FillInner(btn) btn.text:SetFontTemplate(SuperVillain.Media.font.roboto,10,"NONE","LEFT") end @@ -276,14 +276,14 @@ local function CharacterFrameStyle() PaperDollEquipmentManagerPaneSaveSet:Width(PaperDollEquipmentManagerPaneSaveSet:GetWidth()-8) PaperDollEquipmentManagerPaneEquipSet:Point("TOPLEFT", PaperDollEquipmentManagerPane, "TOPLEFT", 8, 0) PaperDollEquipmentManagerPaneSaveSet:Point("LEFT", PaperDollEquipmentManagerPaneEquipSet, "RIGHT", 4, 0) - PaperDollEquipmentManagerPaneEquipSet.ButtonBackground:SetTexture(nil) + PaperDollEquipmentManagerPaneEquipSet.ButtonBackground:SetTexture(0,0,0,0) PaperDollEquipmentManagerPane:HookScript("OnShow", function(f) for _,btn in pairs(PaperDollEquipmentManagerPane.buttons)do - btn.BgTop:SetTexture(nil) - btn.BgBottom:SetTexture(nil) - btn.BgMiddle:SetTexture(nil) + btn.BgTop:SetTexture(0,0,0,0) + btn.BgBottom:SetTexture(0,0,0,0) + btn.BgMiddle:SetTexture(0,0,0,0) btn.icon:Size(36, 36) - btn.Check:SetTexture(nil) + btn.Check:SetTexture(0,0,0,0) btn.icon:SetTexCoord(0.1, 0.9, 0.1, 0.9) btn.icon:SetPoint("LEFT", btn, "LEFT", 4, 0) hooksecurefunc(btn.icon, "SetPoint", function(f, g, h, i, j, k, X) @@ -315,7 +315,7 @@ local function CharacterFrameStyle() e:Formula409() e:SetButtonTemplate() texture:SetTexCoord(0.1, 0.9, 0.1, 0.9) - _G["GearManagerDialogPopupButton"..i.."Icon"]:SetTexture(nil) + _G["GearManagerDialogPopupButton"..i.."Icon"]:SetTexture(0,0,0,0) texture:FillInner() e:SetFrameLevel(e:GetFrameLevel() + 2) if not e.Panel then diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/friends.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/friends.lua index 29409bb..265edb6 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/friends.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/friends.lua @@ -89,9 +89,9 @@ local function TabCustomHelper(this) if not this then return end; for _,prop in pairs(FrameSuffix) do local frame = _G[this:GetName()..prop] - frame:SetTexture(nil) + frame:SetTexture(0,0,0,0) end; - this:GetHighlightTexture():SetTexture(nil) + this:GetHighlightTexture():SetTexture(0,0,0,0) this.backdrop = CreateFrame("Frame", nil, this) this.backdrop:SetFixedPanelTemplate("Default") this.backdrop:SetFrameLevel(this:GetFrameLevel()-1) @@ -149,7 +149,7 @@ local function FriendsFrameStyle() for u = 1, FriendsFrame:GetNumRegions()do local a1 = select(u, FriendsFrame:GetRegions()) if a1:GetObjectType() == "Texture"then - a1:SetTexture(nil) + a1:SetTexture(0,0,0,0) a1:SetAlpha(0) end end; @@ -247,9 +247,9 @@ local function FriendsFrameStyle() ScrollOfResurrectionFrame:Formula409() ScrollOfResurrectionFrameAcceptButton:SetButtonTemplate() ScrollOfResurrectionFrameCancelButton:SetButtonTemplate() - ScrollOfResurrectionFrameTargetEditBoxLeft:SetTexture(nil) - ScrollOfResurrectionFrameTargetEditBoxMiddle:SetTexture(nil) - ScrollOfResurrectionFrameTargetEditBoxRight:SetTexture(nil) + ScrollOfResurrectionFrameTargetEditBoxLeft:SetTexture(0,0,0,0) + ScrollOfResurrectionFrameTargetEditBoxMiddle:SetTexture(0,0,0,0) + ScrollOfResurrectionFrameTargetEditBoxRight:SetTexture(0,0,0,0) ScrollOfResurrectionFrameNoteFrame:Formula409() ScrollOfResurrectionFrameNoteFrame:SetFixedPanelTemplate() ScrollOfResurrectionFrameTargetEditBox:SetFixedPanelTemplate() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua index e61a90b..f8f177e 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua @@ -191,7 +191,7 @@ local function GuildBankStyle() local icon = _G["GuildBankColumn"..b.."Button"..d.."IconTexture"] local texture = _G["GuildBankColumn"..b.."Button"..d.."NormalTexture"] if texture then - texture:SetTexture(nil) + texture:SetTexture(0,0,0,0) end; e:SetSlotTemplate() icon:FillInner() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/help.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/help.lua index 2bee717..0fe3c18 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/help.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/help.lua @@ -57,11 +57,9 @@ local function HelpFrameStyle() if SuperVillain.db.SVStyle.blizzard.enable ~= true or SuperVillain.db.SVStyle.blizzard.help ~= true then return end; - if SuperVillain.build >= 15595 then - tinsert(HelpFrameButtonList, "HelpFrameButton16") - tinsert(HelpFrameButtonList, "HelpFrameSubmitSuggestionSubmit") - tinsert(HelpFrameButtonList, "HelpFrameReportBugSubmit") - end; + tinsert(HelpFrameButtonList, "HelpFrameButton16") + tinsert(HelpFrameButtonList, "HelpFrameSubmitSuggestionSubmit") + tinsert(HelpFrameButtonList, "HelpFrameReportBugSubmit") for d = 1, #HelpFrameList do _G[HelpFrameList[d]]:Formula409(true) _G[HelpFrameList[d]]:SetPanelTemplate("Default") diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/lfd.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/lfd.lua index f304941..37f4541 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/lfd.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/lfd.lua @@ -207,7 +207,7 @@ local function LFDFrameStyle() for u = 1, 4 do local v = GroupFinderFrame["groupButton"..u] v.ring:Hide() - v.bg:SetTexture("") + v.bg:SetTexture(0,0,0,0) v.bg:SetAllPoints() v:SetFixedPanelTemplate('Button') v:SetButtonTemplate() @@ -247,7 +247,7 @@ local function LFDFrameStyle() FlexRaidFrameScrollFrame:Formula409() FlexRaidFrameBottomInset:Formula409() hooksecurefunc("FlexRaidFrame_Update", function() - FlexRaidFrame.ScrollFrame.Background:SetTexture(nil) + FlexRaidFrame.ScrollFrame.Background:SetTexture(0,0,0,0) end) STYLE:ApplyDropdownStyle(FlexRaidFrameSelectionDropDown) FlexRaidFrameStartRaidButton:SetButtonTemplate() @@ -328,12 +328,12 @@ local function LFDFrameStyle() C:SetPanelTemplate() hooksecurefunc(C:GetHighlightTexture(), "SetTexture", function(o, D) if D ~= nil then - o:SetTexture(nil) + o:SetTexture(0,0,0,0) end end) hooksecurefunc(C:GetCheckedTexture(), "SetTexture", function(o, D) if D ~= nil then - o:SetTexture(nil) + o:SetTexture(0,0,0,0) end end) end; diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/macro.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/macro.lua index c6989a5..7d6bae0 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/macro.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/macro.lua @@ -67,9 +67,9 @@ local function MacroUIStyle() MacroPopupScrollFrame.Panel:Point("TOPLEFT", 51, 2) MacroPopupScrollFrame.Panel:Point("BOTTOMRIGHT", -4, 4) MacroPopupEditBox:SetEditboxTemplate() - MacroPopupNameLeft:SetTexture(nil) - MacroPopupNameMiddle:SetTexture(nil) - MacroPopupNameRight:SetTexture(nil) + MacroPopupNameLeft:SetTexture(0,0,0,0) + MacroPopupNameMiddle:SetTexture(0,0,0,0) + MacroPopupNameRight:SetTexture(0,0,0,0) MacroFrameInset:MUNG() MacroEditButton:ClearAllPoints() MacroEditButton:Point("BOTTOMLEFT", MacroFrameSelectedMacroButton, "BOTTOMRIGHT", 10, 0) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/petbattle.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/petbattle.lua index 73c8ebf..4218e8a 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/petbattle.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/petbattle.lua @@ -25,19 +25,19 @@ local PBAB_HEIGHT = 72; local PetBattleActionBar = CreateFrame("Frame", "SVUI_PetBattleActionBar", UIParent) local function PetBattleSetTooltip(frame) - frame.Background:SetTexture(nil) + frame.Background:SetTexture(0,0,0,0) if frame.Delimiter1 then - frame.Delimiter1:SetTexture(nil) - frame.Delimiter2:SetTexture(nil) + frame.Delimiter1:SetTexture(0,0,0,0) + frame.Delimiter2:SetTexture(0,0,0,0) end; - frame.BorderTop:SetTexture(nil) - frame.BorderTopLeft:SetTexture(nil) - frame.BorderTopRight:SetTexture(nil) - frame.BorderLeft:SetTexture(nil) - frame.BorderRight:SetTexture(nil) - frame.BorderBottom:SetTexture(nil) - frame.BorderBottomRight:SetTexture(nil) - frame.BorderBottomLeft:SetTexture(nil) + frame.BorderTop:SetTexture(0,0,0,0) + frame.BorderTopLeft:SetTexture(0,0,0,0) + frame.BorderTopRight:SetTexture(0,0,0,0) + frame.BorderLeft:SetTexture(0,0,0,0) + frame.BorderRight:SetTexture(0,0,0,0) + frame.BorderBottom:SetTexture(0,0,0,0) + frame.BorderBottomRight:SetTexture(0,0,0,0) + frame.BorderBottomLeft:SetTexture(0,0,0,0) frame:SetFixedPanelTemplate("Transparent", true) end; diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/petjournal.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/petjournal.lua index 8e0a297..7442216 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/petjournal.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/petjournal.lua @@ -280,19 +280,19 @@ local function PetJournalStyle() PetJournalPetCardPetInfo.Panel:WrapOuter(PetJournalPetCardPetInfoIcon) PetJournalPetCardPetInfoIcon:SetParent(PetJournalPetCardPetInfo.Panel) PetJournalPetCardPetInfo.level:SetParent(PetJournalPetCardPetInfo.Panel) - local R = PetJournalPrimaryAbilityTooltip;R.Background:SetTexture(nil) + local R = PetJournalPrimaryAbilityTooltip;R.Background:SetTexture(0,0,0,0) if R.Delimiter1 then - R.Delimiter1:SetTexture(nil) - R.Delimiter2:SetTexture(nil) + R.Delimiter1:SetTexture(0,0,0,0) + R.Delimiter2:SetTexture(0,0,0,0) end - R.BorderTop:SetTexture(nil) - R.BorderTopLeft:SetTexture(nil) - R.BorderTopRight:SetTexture(nil) - R.BorderLeft:SetTexture(nil) - R.BorderRight:SetTexture(nil) - R.BorderBottom:SetTexture(nil) - R.BorderBottomRight:SetTexture(nil) - R.BorderBottomLeft:SetTexture(nil) + R.BorderTop:SetTexture(0,0,0,0) + R.BorderTopLeft:SetTexture(0,0,0,0) + R.BorderTopRight:SetTexture(0,0,0,0) + R.BorderLeft:SetTexture(0,0,0,0) + R.BorderRight:SetTexture(0,0,0,0) + R.BorderBottom:SetTexture(0,0,0,0) + R.BorderBottomRight:SetTexture(0,0,0,0) + R.BorderBottomLeft:SetTexture(0,0,0,0) R:SetFixedPanelTemplate("Transparent", true) for b = 1, 6 do local S = _G['PetJournalPetCardSpell'..b] diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/reforging.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/reforging.lua index 990e6fe..4f437f2 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/reforging.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/reforging.lua @@ -39,7 +39,7 @@ local function ReforgingStyle() if x then ReforgingFrame.ItemButton.IconTexture:SetTexCoord(0.1, 0.9, 0.1, 0.9) else - ReforgingFrame.ItemButton.IconTexture:SetTexture(nil) + ReforgingFrame.ItemButton.IconTexture:SetTexture(0,0,0,0) end end) STYLE:ApplyCloseButtonStyle(ReforgingFrameCloseButton) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/spellbook.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/spellbook.lua index c6249b4..e5149df 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/spellbook.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/spellbook.lua @@ -49,12 +49,12 @@ local function ChangeTabHelper(this) this:HookScript("OnLeave",Tab_OnLeave) hooksecurefunc(this:GetHighlightTexture(), "SetTexture", function(i, w) if w ~= nil then - i:SetTexture(nil) + i:SetTexture(0,0,0,0) end end) hooksecurefunc(this:GetCheckedTexture(), "SetTexture", function(i, w) if w ~= nil then - i:SetTexture(nil) + i:SetTexture(0,0,0,0) end end) local a,b,c,d,e = this:GetPoint() @@ -97,7 +97,7 @@ local function AbilityButtonHelper(j) local N = select(j, i:GetRegions()) if N:GetObjectType() == "Texture"then if N:GetTexture() ~= "Interface\\Buttons\\ActionBarFlyoutButton" then - N:SetTexture(nil) + N:SetTexture(0,0,0,0) end end end; @@ -133,7 +133,7 @@ local function ButtonUpdateHelper(k, M) local N = select(j, i:GetRegions()) if N:GetObjectType() == "Texture"then if N ~= i.FlyoutArrow then - N:SetTexture(nil) + N:SetTexture(0,0,0,0) end end end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/supervillain.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/supervillain.lua index 40778ed..efe594f 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/supervillain.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/supervillain.lua @@ -28,15 +28,15 @@ local function Widget_OnLeave(b) end; local function Widget_ScrollStyle(e, f) if _G[e:GetName().."BG"]then - _G[e:GetName().."BG"]:SetTexture(nil) + _G[e:GetName().."BG"]:SetTexture(0,0,0,0) end; if _G[e:GetName().."Track"]then - _G[e:GetName().."Track"]:SetTexture(nil) + _G[e:GetName().."Track"]:SetTexture(0,0,0,0) end; if _G[e:GetName().."Top"]then - _G[e:GetName().."Top"]:SetTexture(nil) - _G[e:GetName().."Bottom"]:SetTexture(nil) - _G[e:GetName().."Middle"]:SetTexture(nil) + _G[e:GetName().."Top"]:SetTexture(0,0,0,0) + _G[e:GetName().."Bottom"]:SetTexture(0,0,0,0) + _G[e:GetName().."Middle"]:SetTexture(0,0,0,0) end; if _G[e:GetName().."ScrollUpButton"] and _G[e:GetName().."ScrollDownButton"] then _G[e:GetName().."ScrollUpButton"]:Formula409() @@ -216,9 +216,16 @@ local function SVUICoreStyle(postLoad) elseif n == "EditBox" then local e = widget.editbox; local o = widget.button; - _G[e:GetName().."Left"]:MUNG() - _G[e:GetName().."Middle"]:MUNG() - _G[e:GetName().."Right"]:MUNG() + local boxName = e:GetName() + if(_G[boxName.."Left"]) then + _G[boxName.."Left"]:MUNG() + end + if(_G[boxName.."Middle"]) then + _G[boxName.."Middle"]:MUNG() + end + if(_G[boxName.."Right"]) then + _G[boxName.."Right"]:MUNG() + end e:Height(17) e:SetFixedPanelTemplate("Inset") local level = e:GetFrameLevel() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/system.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/system.lua index 7d336e5..1a1f7f2 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/system.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/system.lua @@ -580,7 +580,7 @@ local function SystemPanelQue() GhostFrame:ClearAllPoints() GhostFrame:SetPoint("TOP", SuperVillain.UIParent, "TOP", 0, -150) GhostFrameContentsFrame:SetButtonTemplate() - GhostFrameContentsFrameIcon:SetTexture(nil) + GhostFrameContentsFrameIcon:SetTexture(0,0,0,0) local x = CreateFrame("Frame", nil, GhostFrame) x:SetFrameStrata("MEDIUM") x:SetFixedPanelTemplate("Default") @@ -593,7 +593,7 @@ local function SystemPanelQue() for i = 1, #SystemFrameList5 do local this = _G[SystemFrameList5[i].."Header"] if(this) then - this:SetTexture("") + this:SetTexture(0,0,0,0) this:ClearAllPoints() if this == _G["GameMenuFrameHeader"] then this:SetPoint("TOP", GameMenuFrame, 0, 7) @@ -642,7 +642,7 @@ local function SystemPanelQue() end) if IsMacClient() then MacOptionsFrame:SetFixedPanelTemplate("Default") - MacOptionsFrameHeader:SetTexture("") + MacOptionsFrameHeader:SetTexture(0,0,0,0) MacOptionsFrameHeader:ClearAllPoints() MacOptionsFrameHeader:SetPoint("TOP", MacOptionsFrame, 0, 0) MacOptionsFrameMovieRecording:SetFixedPanelTemplate("Default") diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/tabard.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/tabard.lua index ea094ec..6b9730d 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/tabard.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/tabard.lua @@ -29,11 +29,11 @@ local function cleanT(a,b) if b and type(b)=='boolean'then d:MUNG() elseif d:GetDrawLayer()==b then - d:SetTexture(nil) + d:SetTexture(0,0,0,0) elseif b and type(b)=='string'and d:GetTexture()~=b then - d:SetTexture(nil) + d:SetTexture(0,0,0,0) else - d:SetTexture(nil) + d:SetTexture(0,0,0,0) end end end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/talents.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/talents.lua index 41dba3a..1ab650e 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/talents.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/talents.lua @@ -147,12 +147,12 @@ local function TalentFrameStyle() PseudoTabStyle(v) hooksecurefunc(v:GetHighlightTexture(), "SetTexture", function(i, w) if w ~= nil then - i:SetTexture(nil) + i:SetTexture(0,0,0,0) end end) hooksecurefunc(v:GetCheckedTexture(), "SetTexture", function(i, w) if w ~= nil then - i:SetTexture(nil) + i:SetTexture(0,0,0,0) end end) end; diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DBM.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DBM.lua index a6eab61..9c711cf 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DBM.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DBM.lua @@ -37,183 +37,169 @@ DBM ########################################################## ]]-- local function StyleDBM(event, addon) - if event == 'PLAYER_ENTERING_WORLD' then - local croprwicons = true - local buttonsize = 22 - local function StyleBars(self) - for bar in self:GetBarIterator() do - if not bar.injected then - bar.ApplyStyle = function() - local frame = bar.frame - local tbar = _G[frame:GetName()..'Bar'] - local spark = _G[frame:GetName()..'BarSpark'] - local texture = _G[frame:GetName()..'BarTexture'] - local icon1 = _G[frame:GetName()..'BarIcon1'] - local icon2 = _G[frame:GetName()..'BarIcon2'] - local name = _G[frame:GetName()..'BarName'] - local timer = _G[frame:GetName()..'BarTimer'] - if not icon1.overlay then - icon1.overlay = CreateFrame('Frame', '$parentIcon1Overlay', tbar) - icon1.overlay:SetFixedPanelTemplate() - icon1.overlay:SetFrameLevel(0) - icon1.overlay:Size(buttonsize) - icon1.overlay:Point('BOTTOMRIGHT', frame, 'BOTTOMLEFT', -2, 0) - end - if not icon2.overlay then - icon2.overlay = CreateFrame('Frame', '$parentIcon2Overlay', tbar) - icon2.overlay:SetFixedPanelTemplate() - icon2.overlay:SetFrameLevel(0) - icon2.overlay:Size(buttonsize) - icon2.overlay:Point('BOTTOMLEFT', frame, 'BOTTOMRIGHT', 2, 0) - end - if bar.color then - tbar:SetStatusBarColor(bar.color.r, bar.color.g, bar.color.b) - else - tbar:SetStatusBarColor(bar.owner.options.StartColorR, bar.owner.options.StartColorG, bar.owner.options.StartColorB) - end - if bar.enlarged then - frame:SetWidth(bar.owner.options.HugeWidth) - tbar:SetWidth(bar.owner.options.HugeWidth) - frame:SetScale(bar.owner.options.HugeScale) - else - frame:SetWidth(bar.owner.options.Width) - tbar:SetWidth(bar.owner.options.Width) - frame:SetScale(bar.owner.options.Scale) - end - spark:SetAlpha(0) - spark:SetTexture(nil) - icon1:SetTexCoord(0.1,0.9,0.1,0.9) - icon1:ClearAllPoints() - icon1:FillInner(icon1.overlay) - icon2:SetTexCoord(0.1,0.9,0.1,0.9) - icon2:ClearAllPoints() - icon2:FillInner(icon2.overlay) - texture:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - tbar:FillInner(frame) - frame:SetFixedPanelTemplate() - name:ClearAllPoints() - name:SetWidth(165) - name:SetHeight(8) - name:SetJustifyH('LEFT') - name:SetShadowColor(0, 0, 0, 0) - timer:ClearAllPoints() - timer:SetJustifyH('RIGHT') - timer:SetShadowColor(0, 0, 0, 0) - frame:SetHeight(buttonsize) - name:Point('LEFT', frame, 'LEFT', 4, 0) - timer:Point('RIGHT', frame, 'RIGHT', -4, 0) - name:SetFontTemplate(SuperVillain.Media.font.default, 12, 'OUTLINE') - timer:SetFontTemplate(SuperVillain.Media.font.default, 12, 'OUTLINE') - name:SetTextColor(bar.owner.options.TextColorR, bar.owner.options.TextColorG, bar.owner.options.TextColorB) - timer:SetTextColor(bar.owner.options.TextColorR, bar.owner.options.TextColorG, bar.owner.options.TextColorB) - if bar.owner.options.IconLeft then icon1:Show() icon1.overlay:Show() else icon1:Hide() icon1.overlay:Hide() end - if bar.owner.options.IconRight then icon2:Show() icon2.overlay:Show() else icon2:Hide() icon2.overlay:Hide() end - tbar:SetAlpha(1) - frame:SetAlpha(1) - texture:SetAlpha(1) - frame:Show() - bar:Update(0) - bar.injected = true + local croprwicons = true + local buttonsize = 22 + local function StyleBars(self) + for bar in self:GetBarIterator() do + if not bar.injected then + bar.ApplyStyle = function() + local frame = bar.frame + local tbar = _G[frame:GetName()..'Bar'] + local spark = _G[frame:GetName()..'BarSpark'] + local texture = _G[frame:GetName()..'BarTexture'] + local icon1 = _G[frame:GetName()..'BarIcon1'] + local icon2 = _G[frame:GetName()..'BarIcon2'] + local name = _G[frame:GetName()..'BarName'] + local timer = _G[frame:GetName()..'BarTimer'] + if not icon1.overlay then + icon1.overlay = CreateFrame('Frame', '$parentIcon1Overlay', tbar) + icon1.overlay:Size(buttonsize) + icon1.overlay:SetPanelTemplate("Button") + icon1.overlay:SetFrameLevel(0) + icon1.overlay:Point('BOTTOMRIGHT', frame, 'BOTTOMLEFT', -2, 0) end - bar:ApplyStyle() - end - end - end - local StyleBossTitle = function() - local anchor = DBMBossHealthDropdown:GetParent() - if not anchor.styled then - local header = {anchor:GetRegions()} - if header[1]:IsObjectType('FontString') then - header[1]:SetFontTemplate(SuperVillain.Media.font.default, 12, 'OUTLINE') - header[1]:SetTextColor(1, 1, 1) - header[1]:SetShadowColor(0, 0, 0, 0) - anchor.styled = true - end - header = nil - end - anchor = nil - end - local StyleBoss = function() - local count = 1 - while _G[format('DBM_BossHealth_Bar_%d', count)] do - local bar = _G[format('DBM_BossHealth_Bar_%d', count)] - local background = _G[bar:GetName()..'BarBorder'] - local progress = _G[bar:GetName()..'Bar'] - local name = _G[bar:GetName()..'BarName'] - local timer = _G[bar:GetName()..'BarTimer'] - local prev = _G[format('DBM_BossHealth_Bar_%d', count-1)] - local _, anch, _ ,_, _ = bar:GetPoint() - bar:ClearAllPoints() - if count == 1 then - if DBM_SavedOptions.HealthFrameGrowUp then - bar:Point('BOTTOM', anch, 'TOP' , 0 , 12) + if not icon2.overlay then + icon2.overlay = CreateFrame('Frame', '$parentIcon2Overlay', tbar) + icon2.overlay:Size(buttonsize) + icon2.overlay:SetPanelTemplate("Button") + icon2.overlay:SetFrameLevel(0) + icon2.overlay:Point('BOTTOMLEFT', frame, 'BOTTOMRIGHT', 2, 0) + end + if bar.color then + tbar:SetStatusBarColor(bar.color.r, bar.color.g, bar.color.b) else - bar:Point('TOP', anch, 'BOTTOM' , 0, -buttonsize) + tbar:SetStatusBarColor(bar.owner.options.StartColorR, bar.owner.options.StartColorG, bar.owner.options.StartColorB) end - else - if DBM_SavedOptions.HealthFrameGrowUp then - bar:Point('TOPLEFT', prev, 'TOPLEFT', 0, buttonsize + 4) + if bar.enlarged then + frame:SetWidth(bar.owner.options.HugeWidth) + tbar:SetWidth(bar.owner.options.HugeWidth) + frame:SetScale(bar.owner.options.HugeScale) else - bar:Point('TOPLEFT', prev, 'TOPLEFT', 0, -(buttonsize + 4)) + frame:SetWidth(bar.owner.options.Width) + tbar:SetWidth(bar.owner.options.Width) + frame:SetScale(bar.owner.options.Scale) end + spark:SetAlpha(0) + spark:SetTexture(0,0,0,0) + icon1:SetTexCoord(0.1,0.9,0.1,0.9) + icon1:ClearAllPoints() + icon1:SetAllPoints(icon1.overlay) + icon2:SetTexCoord(0.1,0.9,0.1,0.9) + icon2:ClearAllPoints() + icon2:SetAllPoints(icon2.overlay) + texture:SetTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) + tbar:SetAllPoints(frame) + frame:SetPanelTemplate("Bar") + name:ClearAllPoints() + name:SetWidth(165) + name:SetHeight(8) + name:SetJustifyH('LEFT') + name:SetShadowColor(0, 0, 0, 0) + timer:ClearAllPoints() + timer:SetJustifyH('RIGHT') + timer:SetShadowColor(0, 0, 0, 0) + frame:SetHeight(buttonsize) + name:Point('LEFT', frame, 'LEFT', 4, 0) + timer:Point('RIGHT', frame, 'RIGHT', -4, 0) + name:SetFontTemplate(SuperVillain.Media.font.default, 12, 'OUTLINE') + timer:SetFontTemplate(SuperVillain.Media.font.default, 12, 'OUTLINE') + name:SetTextColor(bar.owner.options.TextColorR, bar.owner.options.TextColorG, bar.owner.options.TextColorB) + timer:SetTextColor(bar.owner.options.TextColorR, bar.owner.options.TextColorG, bar.owner.options.TextColorB) + if bar.owner.options.IconLeft then icon1:Show() icon1.overlay:Show() else icon1:Hide() icon1.overlay:Hide() end + if bar.owner.options.IconRight then icon2:Show() icon2.overlay:Show() else icon2:Hide() icon2.overlay:Hide() end + tbar:SetAlpha(1) + frame:SetAlpha(1) + texture:SetAlpha(1) + frame:Show() + bar:Update(0) + bar.injected = true end - bar:SetFixedPanelTemplate('Transparent') - background:SetNormalTexture(nil) - progress:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) - progress:ClearAllPoints() - progress:FillInner(bar) - name:ClearAllPoints() - name:SetJustifyH('LEFT') - name:SetShadowColor(0, 0, 0, 0) - timer:ClearAllPoints() - timer:SetJustifyH('RIGHT') - timer:SetShadowColor(0, 0, 0, 0) - bar:SetHeight(buttonsize) - name:Point('LEFT', bar, 'LEFT', 4, 0) - timer:Point('RIGHT', bar, 'RIGHT', -4, 0) - name:SetFontTemplate(SuperVillain.Media.font.default, 12, 'OUTLINE') - timer:SetFontTemplate(SuperVillain.Media.font.default, 12, 'OUTLINE') - count = count + 1 + bar:ApplyStyle() end end - hooksecurefunc(DBT, 'CreateBar', StyleBars) - hooksecurefunc(DBM.BossHealth, 'Show', StyleBossTitle) - hooksecurefunc(DBM.BossHealth, 'AddBoss', StyleBoss) - hooksecurefunc(DBM.BossHealth, 'UpdateSettings', StyleBoss) - if not DBM_SavedOptions['DontShowRangeFrame'] then - DBM.RangeCheck:Show() - DBM.RangeCheck:Hide() - DBMRangeCheck:HookScript('OnShow', function(self) self:SetFixedPanelTemplate('Transparent') end) - DBMRangeCheckRadar:SetFixedPanelTemplate('Transparent') - end - if not DBM_SavedOptions['DontShowInfoFrame'] then - DBM.InfoFrame:Show(5, 'test') - DBM.InfoFrame:Hide() - DBMInfoFrame:HookScript('OnShow', function(self) self:SetFixedPanelTemplate('Transparent') end) + end + local StyleBossTitle = function() + local anchor = DBMBossHealthDropdown:GetParent() + if not anchor.styled then + local header = {anchor:GetRegions()} + if header[1]:IsObjectType('FontString') then + header[1]:SetFontTemplate(SuperVillain.Media.font.default, 12, 'OUTLINE') + header[1]:SetTextColor(1, 1, 1) + header[1]:SetShadowColor(0, 0, 0, 0) + anchor.styled = true + end + header = nil end - if croprwicons then - local RaidNotice_AddMessage_ = RaidNotice_AddMessage - RaidNotice_AddMessage = function(noticeFrame, textString, colorInfo) - if textString:find(' |T') then - textString = gsub(textString,'(:12:12)',':18:18:0:0:64:64:5:59:5:59') + anchor = nil + end + local StyleBoss = function() + local count = 1 + while _G[format('DBM_BossHealth_Bar_%d', count)] do + local bar = _G[format('DBM_BossHealth_Bar_%d', count)] + local background = _G[bar:GetName()..'BarBorder'] + local progress = _G[bar:GetName()..'Bar'] + local name = _G[bar:GetName()..'BarName'] + local timer = _G[bar:GetName()..'BarTimer'] + local prev = _G[format('DBM_BossHealth_Bar_%d', count-1)] + local _, anch, _ ,_, _ = bar:GetPoint() + bar:ClearAllPoints() + if count == 1 then + if DBM_SavedOptions.HealthFrameGrowUp then + bar:Point('BOTTOM', anch, 'TOP' , 0 , 12) + else + bar:Point('TOP', anch, 'BOTTOM' , 0, -buttonsize) + end + else + if DBM_SavedOptions.HealthFrameGrowUp then + bar:Point('TOPLEFT', prev, 'TOPLEFT', 0, buttonsize + 4) + else + bar:Point('TOPLEFT', prev, 'TOPLEFT', 0, -(buttonsize + 4)) end - return RaidNotice_AddMessage_(noticeFrame, textString, colorInfo) end + bar:SetFixedPanelTemplate('Transparent') + background:SetNormalTexture(nil) + progress:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) + progress:ClearAllPoints() + progress:FillInner(bar) + name:ClearAllPoints() + name:SetJustifyH('LEFT') + name:SetShadowColor(0, 0, 0, 0) + timer:ClearAllPoints() + timer:SetJustifyH('RIGHT') + timer:SetShadowColor(0, 0, 0, 0) + bar:SetHeight(buttonsize) + name:Point('LEFT', bar, 'LEFT', 4, 0) + timer:Point('RIGHT', bar, 'RIGHT', -4, 0) + name:SetFontTemplate(SuperVillain.Media.font.default, 12, 'OUTLINE') + timer:SetFontTemplate(SuperVillain.Media.font.default, 12, 'OUTLINE') + count = count + 1 end end - if addon == 'DBM-GUI' then - DBM_GUI_OptionsFrame:HookScript('OnShow', function() - STYLE:ApplyFrameStyle(DBM_GUI_OptionsFrame) - STYLE:ApplyFrameStyle(DBM_GUI_OptionsFrameBossMods) - STYLE:ApplyFrameStyle(DBM_GUI_OptionsFrameDBMOptions) - STYLE:ApplyFrameStyle(DBM_GUI_OptionsFramePanelContainer, 'Transparent', true) - end) - STYLE:ApplyTabStyle(DBM_GUI_OptionsFrameTab1) - STYLE:ApplyTabStyle(DBM_GUI_OptionsFrameTab2) - DBM_GUI_OptionsFrameOkay:SetButtonTemplate() - DBM_GUI_OptionsFrameWebsiteButton:SetButtonTemplate() - STYLE:ApplyScrollStyle(DBM_GUI_OptionsFramePanelContainerFOVScrollBar) - STYLE:SafeEventRemoval("DBM", event) + hooksecurefunc(DBT, 'CreateBar', StyleBars) + hooksecurefunc(DBM.BossHealth, 'Show', StyleBossTitle) + hooksecurefunc(DBM.BossHealth, 'AddBoss', StyleBoss) + hooksecurefunc(DBM.BossHealth, 'UpdateSettings', StyleBoss) + if not DBM_SavedOptions['DontShowRangeFrame'] then + DBM.RangeCheck:Show() + DBM.RangeCheck:Hide() + DBMRangeCheck:HookScript('OnShow', function(self) self:SetFixedPanelTemplate('Transparent') end) + DBMRangeCheckRadar:SetFixedPanelTemplate('Transparent') + end + if not DBM_SavedOptions['DontShowInfoFrame'] then + DBM.InfoFrame:Show(5, 'test') + DBM.InfoFrame:Hide() + DBMInfoFrame:HookScript('OnShow', function(self) self:SetFixedPanelTemplate('Transparent') end) + end + if croprwicons then + local RaidNotice_AddMessage_ = RaidNotice_AddMessage + RaidNotice_AddMessage = function(noticeFrame, textString, colorInfo) + if textString:find(' |T') then + textString = gsub(textString,'(:12:12)',':18:18:0:0:64:64:5:59:5:59') + end + return RaidNotice_AddMessage_(noticeFrame, textString, colorInfo) + end end + STYLE:SafeEventRemoval("DBM-Core", event) end -STYLE:SaveAddonStyle("DBM", StyleDBM, 'ADDON_LOADED') \ No newline at end of file + +STYLE:SaveAddonStyle("DBM-Core", StyleDBM, false, false, "PLAYER_ENTERING_WORLD", "ADDON_LOADED") \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DXE.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DXE.lua index 4d2480e..c6e53c5 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DXE.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DXE.lua @@ -31,6 +31,9 @@ GET ADDON DATA ]]-- local SuperVillain, L = unpack(SVUI); local STYLE = _G.StyleVillain; +local playerName = UnitName("player"); +local playerRealm = GetRealmName(); +local playerKey = ("%s - %s"):format(playerName, playerRealm) --[[ ########################################################## DXE @@ -40,7 +43,7 @@ LoadAddOn("DXE") local function StyleDXE() local function StyleDXEBar(bar) bar:SetFixedPanelTemplate("Transparent") - bar.bg:SetTexture(nil) + bar.bg:SetTexture(0,0,0,0) bar.border.Show = SuperVillain.fubar bar.border:Hide() bar.statusbar:SetStatusBarTexture([[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]]) @@ -109,12 +112,12 @@ local function StyleDXE() DXE.Alerts:RefreshBars() if not DXEDB then DXEDB = {} end if not DXEDB["profiles"] then DXEDB["profiles"] = {} end - if not DXEDB["profiles"][SuperVillain.name.." - "..SuperVillain.realm] then DXEDB["profiles"][SuperVillain.name.." - "..SuperVillain.realm] = {} end - if not DXEDB["profiles"][SuperVillain.name.." - "..SuperVillain.realm]["Globals"] then DXEDB["profiles"][SuperVillain.name.." - "..SuperVillain.realm]["Globals"] = {} end - DXEDB["profiles"][SuperVillain.name.." - "..SuperVillain.realm]["Globals"]["BackgroundTexture"] = [[Interface\BUTTONS\WHITE8X8]] - DXEDB["profiles"][SuperVillain.name.." - "..SuperVillain.realm]["Globals"]["BarTexture"] = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]] - DXEDB["profiles"][SuperVillain.name.." - "..SuperVillain.realm]["Globals"]["Border"] = "None" - DXEDB["profiles"][SuperVillain.name.." - "..SuperVillain.realm]["Globals"]["Font"] = SuperVillain.Media.font.default - DXEDB["profiles"][SuperVillain.name.." - "..SuperVillain.realm]["Globals"]["TimerFont"] = SuperVillain.Media.font.default + if not DXEDB["profiles"][playerKey] then DXEDB["profiles"][playerKey] = {} end + if not DXEDB["profiles"][playerKey]["Globals"] then DXEDB["profiles"][playerKey]["Globals"] = {} end + DXEDB["profiles"][playerKey]["Globals"]["BackgroundTexture"] = [[Interface\BUTTONS\WHITE8X8]] + DXEDB["profiles"][playerKey]["Globals"]["BarTexture"] = [[Interface\AddOns\SVUI\assets\artwork\Template\DEFAULT]] + DXEDB["profiles"][playerKey]["Globals"]["Border"] = "None" + DXEDB["profiles"][playerKey]["Globals"]["Font"] = SuperVillain.Media.font.default + DXEDB["profiles"][playerKey]["Globals"]["TimerFont"] = SuperVillain.Media.font.default end STYLE:SaveAddonStyle("DXE", StyleDXE) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Recount.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Recount.lua index 44e69f5..b1e52bc 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Recount.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Recount.lua @@ -42,7 +42,7 @@ local function NoColor(a) if q:GetObjectType()=='Texture'then q:SetDesaturated(true) if q:GetTexture()=='Interface\\DialogFrame\\UI-DialogBox-Corner'then - q:SetTexture(nil) + q:SetTexture(0,0,0,0) q:MUNG() end end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/VEM.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/VEM.lua index 598c158..cf5721a 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/VEM.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/VEM.lua @@ -81,7 +81,7 @@ local function StyleVEM(event, addon) frame:SetScale(bar.owner.options.Scale) end spark:SetAlpha(0) - spark:SetTexture(nil) + spark:SetTexture(0,0,0,0) icon1:SetTexCoord(0.1,0.9,0.1,0.9) icon1:ClearAllPoints() icon1:FillInner(icon1.overlay) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/worldmap.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/worldmap.lua index a069454..b68b500 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/worldmap.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/worldmap.lua @@ -80,7 +80,7 @@ local function WorldMap_OnShow() if not SuperVillain.db.SVMap.tinyWorldMap then BlackoutWorld:SetTexture(0, 0, 0, 1) else - BlackoutWorld:SetTexture(nil) + BlackoutWorld:SetTexture(0,0,0,0) end if WORLDMAP_SETTINGS.size == WORLDMAP_FULLMAP_SIZE then WorldMap_FullView() diff --git a/Interface/AddOns/SVUI_StyleOMatic/common/methods.lua b/Interface/AddOns/SVUI_StyleOMatic/common/methods.lua index 4646cb4..14d10f6 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/common/methods.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/common/methods.lua @@ -110,19 +110,19 @@ end function STYLE:ApplyScrollStyle(this) if(not this or (this and this.appliedStyle)) then return end if _G[this:GetName().."BG"]then - _G[this:GetName().."BG"]:SetTexture(nil) + _G[this:GetName().."BG"]:SetTexture(0,0,0,0) end if _G[this:GetName().."Track"]then - _G[this:GetName().."Track"]:SetTexture(nil) + _G[this:GetName().."Track"]:SetTexture(0,0,0,0) end if _G[this:GetName().."Top"]then - _G[this:GetName().."Top"]:SetTexture(nil) + _G[this:GetName().."Top"]:SetTexture(0,0,0,0) end if _G[this:GetName().."Bottom"]then - _G[this:GetName().."Bottom"]:SetTexture(nil) + _G[this:GetName().."Bottom"]:SetTexture(0,0,0,0) end if _G[this:GetName().."Middle"]then - _G[this:GetName().."Middle"]:SetTexture(nil) + _G[this:GetName().."Middle"]:SetTexture(0,0,0,0) end if _G[this:GetName().."ScrollUpButton"] and _G[this:GetName().."ScrollDownButton"]then _G[this:GetName().."ScrollUpButton"]:Formula409() @@ -194,12 +194,12 @@ local function TabHelper(this) this:HookScript("OnLeave",Tab_OnLeave) hooksecurefunc(this:GetHighlightTexture(), "SetTexture", function(i, w) if w ~= nil then - i:SetTexture(nil) + i:SetTexture(0,0,0,0) end end) hooksecurefunc(this:GetCheckedTexture(), "SetTexture", function(i, w) if w ~= nil then - i:SetTexture(nil) + i:SetTexture(0,0,0,0) end end) local a,b,c,d,e = this:GetPoint() @@ -210,15 +210,15 @@ function STYLE:ApplyTabStyle(this, full) if(not this or (this and this.appliedStyle)) then return end local tab = this:GetName(); - if _G[tab.."Left"] then _G[tab.."Left"]:SetTexture(nil) end - if _G[tab.."LeftDisabled"] then _G[tab.."LeftDisabled"]:SetTexture(nil) end - if _G[tab.."Right"] then _G[tab.."Right"]:SetTexture(nil) end - if _G[tab.."RightDisabled"] then _G[tab.."RightDisabled"]:SetTexture(nil) end - if _G[tab.."Middle"] then _G[tab.."Middle"]:SetTexture(nil) end - if _G[tab.."MiddleDisabled"] then _G[tab.."MiddleDisabled"]:SetTexture(nil) end + if _G[tab.."Left"] then _G[tab.."Left"]:SetTexture(0,0,0,0) end + if _G[tab.."LeftDisabled"] then _G[tab.."LeftDisabled"]:SetTexture(0,0,0,0) end + if _G[tab.."Right"] then _G[tab.."Right"]:SetTexture(0,0,0,0) end + if _G[tab.."RightDisabled"] then _G[tab.."RightDisabled"]:SetTexture(0,0,0,0) end + if _G[tab.."Middle"] then _G[tab.."Middle"]:SetTexture(0,0,0,0) end + if _G[tab.."MiddleDisabled"] then _G[tab.."MiddleDisabled"]:SetTexture(0,0,0,0) end if this.GetHighlightTexture and this:GetHighlightTexture()then - this:GetHighlightTexture():SetTexture(nil) + this:GetHighlightTexture():SetTexture(0,0,0,0) else this:Formula409() end