diff --git a/Interface/AddOns/SVUI/License.txt b/Interface/AddOns/SVUI/License.txt index a1eb750..5bd9961 100644 --- a/Interface/AddOns/SVUI/License.txt +++ b/Interface/AddOns/SVUI/License.txt @@ -35,4 +35,4 @@ the copyright holders. You can write Munglunch at Wowinterface.com for reporting abuse / bugs. You can contact Tukz or Elv at Tukui.org for details regarding -grants allowed for this license. \ No newline at end of file +grants allowed for their respective licenses. \ No newline at end of file diff --git a/Interface/AddOns/SVUI/SVUI.toc b/Interface/AddOns/SVUI/SVUI.toc index d532552..535ac86 100644 --- a/Interface/AddOns/SVUI/SVUI.toc +++ b/Interface/AddOns/SVUI/SVUI.toc @@ -1,6 +1,6 @@ ## Interface: 60000 ## Author: Munglunch -## Version: 4.6 +## Version: 4.7 ## 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 6bc9be8..4a6cce4 100644 --- a/Interface/AddOns/SVUI/SVUI.xml +++ b/Interface/AddOns/SVUI/SVUI.xml @@ -1,9 +1,6 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> <Include file="libs\libs.xml"/> - <Include file="xml\system.xml"/> - - <Script file="SVUI.lua"/> <Script file="language\english_ui.lua"/> <Script file="language\italian_ui.lua"/> @@ -16,6 +13,10 @@ <Script file="language\chinese_ui.lua"/> <Script file="language\portuguese_ui.lua"/> + <Include file="xml\system.xml"/> + + <Script file="SVUI.lua"/> + <Script file="setup\configs.lua"/> <Script file="setup\installer.lua"/> <Script file="setup\presets.lua"/> diff --git a/Interface/AddOns/SVUI/docs/schema.lua b/Interface/AddOns/SVUI/docs/schema.lua index a89fc2e..61dffa4 100644 --- a/Interface/AddOns/SVUI/docs/schema.lua +++ b/Interface/AddOns/SVUI/docs/schema.lua @@ -95,7 +95,7 @@ local Schema = PKG.Schema The benefit here is this: - Let's use SVUI_Laborer for example. If by default this LOD addon is Disabled, we can't read + Let's use SVUI_CraftOMatic for example. If by default this LOD addon is Disabled, we can't read on any lua code inside the addon. This prevents the ability to set config variables and therefore build config options. Before we would have had to add a button to allow the player to click and "Enable" it. This is fine but what if we also want to make the choice to keep it enabled every time we log in? diff --git a/Interface/AddOns/SVUI/language/chinese_ui.lua b/Interface/AddOns/SVUI/language/chinese_ui.lua index 696746b..6ce4bc7 100644 --- a/Interface/AddOns/SVUI/language/chinese_ui.lua +++ b/Interface/AddOns/SVUI/language/chinese_ui.lua @@ -1,4 +1,3 @@ -local SVUI_ADDON_NAME, SV = ... local L = LibSuperVillain:Lang("zhCN"); if not L then return end --[[REACTION TEXTS]]-- diff --git a/Interface/AddOns/SVUI/language/english_ui.lua b/Interface/AddOns/SVUI/language/english_ui.lua index 11a1479..fdff64a 100644 --- a/Interface/AddOns/SVUI/language/english_ui.lua +++ b/Interface/AddOns/SVUI/language/english_ui.lua @@ -1,4 +1,3 @@ -local SVUI_ADDON_NAME, SV = ... local L = LibSuperVillain:Lang("enUS", true); if not L then return; end --[[REACTION TEXTS]]-- @@ -373,8 +372,8 @@ L["FadeIn Delay"]=true; L["The time to wait before fading the minimap back in after combat hide. (0 = Disabled)"]=true; L["Minimap Button Bar"]=true; L["Style Buttons"]=true; -L["SVStyle the minimap buttons in SV UI style."]=true; -L["Style Style"]=true; +L["Customize the minimap buttons in SVUI style."]=true; +L["SVUI Style"]=true; L["Change settings for how the minimap buttons are styled."]=true; L["The size of the minimap buttons."]=true; L["No Anchor Bar"]=true; diff --git a/Interface/AddOns/SVUI/language/french_ui.lua b/Interface/AddOns/SVUI/language/french_ui.lua index e04f100..5767ed6 100644 --- a/Interface/AddOns/SVUI/language/french_ui.lua +++ b/Interface/AddOns/SVUI/language/french_ui.lua @@ -1,4 +1,3 @@ -local SVUI_ADDON_NAME, SV = ... local L = LibSuperVillain:Lang("frFR"); if not L then return; end --[[REACTION TEXTS]]-- @@ -469,8 +468,8 @@ L["Hide minimap while in combat."]="Cacher la minicarte quand vous êtes en comb L["FadeIn Delay"]="Délais d'estompage" L["The time to wait before fading the minimap back in after combat hide. (0 = Disabled)"]="Le temps à attendre avant que la minicarte s'estompe avec que le combat ait commencé. (0 = désactié)" L["Style Buttons"]="Boutons Style" -L["SVStyle the minimap buttons in SV UI style."]="Habillez les boutons de la minicarte avec le style SVUI." -L["Style Style"]="Style Style" +L["Customize the minimap buttons in SVUI style."]="Habillez les boutons de la minicarte avec le style SVUI." +L["SVUI Style"]="SVUI Style" L["Change settings for how the minimap buttons are styled."]="Change les réglages pour comment sont habillés les boutons." L["The size of the minimap buttons."]="Taille des boutons de la minicarte." L["No Anchor Bar"]="Ne pas ancré à une Barre" diff --git a/Interface/AddOns/SVUI/language/german_ui.lua b/Interface/AddOns/SVUI/language/german_ui.lua index d011d04..1b597e7 100644 --- a/Interface/AddOns/SVUI/language/german_ui.lua +++ b/Interface/AddOns/SVUI/language/german_ui.lua @@ -1,4 +1,3 @@ -local SVUI_ADDON_NAME, SV = ... local L = LibSuperVillain:Lang("deDE"); if not L then return end --[[REACTION TEXTS]]-- @@ -468,8 +467,8 @@ L["Hide minimap while in combat."]="Ausblenden der Minimap während des Kampfes. L["FadeIn Delay"]="Einblendungsverzögerung" L["The time to wait before fading the minimap back in after combat hide. (0 = Disabled)"]="Die Zeit vor dem wieder Einblenden der Minimap nach dem Kampf. (0 = deaktiviert)" L["Style Buttons"]="Style Buttons" -L["SVStyle the minimap buttons in SV UI style."]='Stylene die Minimap-Buttons im SVUI-Stil.' -L["Style Style"]="Style Stil" +L["Customize the minimap buttons in SVUI style."]='Stylene die Minimap-Buttons im SVUI-Stil.' +L["SVUI Style"]="Style Stil" L["Change settings for how the minimap buttons are styled."]="Ändern der Einstellungen, wie die Minimap-Buttons gestylent werden." L["The size of the minimap buttons."]="Die Größe der Minimap-Buttons." L["No Anchor Bar"]="Keine Ankerleiste" diff --git a/Interface/AddOns/SVUI/language/italian_ui.lua b/Interface/AddOns/SVUI/language/italian_ui.lua index f9b8568..09c14a2 100644 --- a/Interface/AddOns/SVUI/language/italian_ui.lua +++ b/Interface/AddOns/SVUI/language/italian_ui.lua @@ -1,4 +1,3 @@ -local SVUI_ADDON_NAME, SV = ... local L = LibSuperVillain:Lang("itIT"); if not L then return; end --[[REACTION TEXTS]]-- @@ -470,8 +469,8 @@ L["FadeIn Delay"]=true; L["The time to wait before fading the minimap back in after combat hide. (0 = Disabled)"]=true; L["Minimap Button Bar"]=true; L["Style Buttons"]=true; -L["SVStyle the minimap buttons in SV UI style."]=true; -L["Style Style"]=true; +L["Customize the minimap buttons in SVUI style."]=true; +L["SVUI Style"]=true; L["Change settings for how the minimap buttons are styled."]=true; L["The size of the minimap buttons."]=true; L["No Anchor Bar"]=true; diff --git a/Interface/AddOns/SVUI/language/korean_ui.lua b/Interface/AddOns/SVUI/language/korean_ui.lua index 6a7406c..5fb983b 100644 --- a/Interface/AddOns/SVUI/language/korean_ui.lua +++ b/Interface/AddOns/SVUI/language/korean_ui.lua @@ -1,4 +1,3 @@ -local SVUI_ADDON_NAME, SV = ... local L = LibSuperVillain:Lang("koKR"); if not L then return; end --[[REACTION TEXTS]]-- @@ -470,8 +469,8 @@ L["FadeIn Delay"]=true; L["The time to wait before fading the minimap back in after combat hide. (0 = Disabled)"]=true; L["Minimap Button Bar"]=true; L["Style Buttons"]=true; -L["SVStyle the minimap buttons in SV UI style."]=true; -L["Style Style"]=true; +L["Customize the minimap buttons in SVUI style."]=true; +L["SVUI Style"]=true; L["Change settings for how the minimap buttons are styled."]=true; L["The size of the minimap buttons."]=true; L["No Anchor Bar"]=true; diff --git a/Interface/AddOns/SVUI/language/portuguese_ui.lua b/Interface/AddOns/SVUI/language/portuguese_ui.lua index 52312bd..2b55f4c 100644 --- a/Interface/AddOns/SVUI/language/portuguese_ui.lua +++ b/Interface/AddOns/SVUI/language/portuguese_ui.lua @@ -1,4 +1,3 @@ -local SVUI_ADDON_NAME, SV = ... local L = LibSuperVillain:Lang("ptBR"); if not L then return; end --[[REACTION TEXTS]]-- @@ -469,8 +468,8 @@ L["Hide minimap while in combat."]=true; L["FadeIn Delay"]=true; L["The time to wait before fading the minimap back in after combat hide. (0 = Disabled)"]=true; L["Style Buttons"]="Customizar Botões" -L["SVStyle the minimap buttons in SV UI style."]="Customiza os botões do minimapa no estilo do SV UI." -L["Style Style"]="Estilo de Customização" +L["Customize the minimap buttons in SVUI style."]="Customiza os botões do minimapa no estilo do SVUI." +L["SVUI Style"]="Estilo de Customização" L["Change settings for how the minimap buttons are styled."]="Mudar definições de como os botões do minimapa são customizados." L["The size of the minimap buttons."]="O tamanho dos botões do minimapa." L["No Anchor Bar"]="Sem Ancora de Barra" diff --git a/Interface/AddOns/SVUI/language/russian_ui.lua b/Interface/AddOns/SVUI/language/russian_ui.lua index 70076dc..78a0df3 100644 --- a/Interface/AddOns/SVUI/language/russian_ui.lua +++ b/Interface/AddOns/SVUI/language/russian_ui.lua @@ -1,4 +1,3 @@ -local SVUI_ADDON_NAME, SV = ... local L = LibSuperVillain:Lang("ruRU"); if not L then return; end --[[REACTION TEXTS]]-- @@ -470,8 +469,8 @@ L["FadeIn Delay"]=true; L["The time to wait before fading the minimap back in after combat hide. (0 = Disabled)"]=true; L["Minimap Button Bar"]=true; L["Style Buttons"]=true; -L["SVStyle the minimap buttons in SV UI style."]=true; -L["Style Style"]=true; +L["Customize the minimap buttons in SVUI style."]=true; +L["SVUI Style"]=true; L["Change settings for how the minimap buttons are styled."]=true; L["The size of the minimap buttons."]=true; L["No Anchor Bar"]=true; diff --git a/Interface/AddOns/SVUI/language/spanish_ui.lua b/Interface/AddOns/SVUI/language/spanish_ui.lua index 966a553..64a3e0c 100644 --- a/Interface/AddOns/SVUI/language/spanish_ui.lua +++ b/Interface/AddOns/SVUI/language/spanish_ui.lua @@ -1,4 +1,3 @@ -local SVUI_ADDON_NAME, SV = ... local L = LibSuperVillain:Lang("esES"); if not L then L = LibSuperVillain:Lang("esMX") @@ -473,8 +472,8 @@ L["FadeIn Delay"]=true; L["The time to wait before fading the minimap back in after combat hide. (0 = Disabled)"]=true; L["Minimap Button Bar"]=true; L["Style Buttons"]=true; -L["SVStyle the minimap buttons in SV UI style."]=true; -L["Style Style"]=true; +L["Customize the minimap buttons in SVUI style."]=true; +L["SVUI Style"]=true; L["Change settings for how the minimap buttons are styled."]=true; L["The size of the minimap buttons."]=true; L["No Anchor Bar"]=true; diff --git a/Interface/AddOns/SVUI/language/taiwanese_ui.lua b/Interface/AddOns/SVUI/language/taiwanese_ui.lua index 8e4663b..759aebe 100644 --- a/Interface/AddOns/SVUI/language/taiwanese_ui.lua +++ b/Interface/AddOns/SVUI/language/taiwanese_ui.lua @@ -1,4 +1,3 @@ -local SVUI_ADDON_NAME, SV = ... local L = LibSuperVillain:Lang("zhTW"); if not L then return; end --[[REACTION TEXTS]]-- @@ -470,8 +469,8 @@ L["FadeIn Delay"]="隱藏延遲" L["The time to wait before fading the minimap back in after combat hide. (0 = Disabled)"]="戰鬥開始後隱藏小地圖前的延遲時間 (0=停用)" L["Minimap Button Bar"]="小地圖按鈕整合列" L["Style Buttons"]="美化按鈕" -L["SVStyle the minimap buttons in SV UI style."]="將小地圖圖標美化成SVUI風格." -L["Style Style"]="美化風格" +L["Customize the minimap buttons in SVUI style."]="將小地圖圖標美化成SVUI風格." +L["SVUI Style"]="美化風格" L["Change settings for how the minimap buttons are styled."]="改變美化設定." L["The size of the minimap buttons."]="小地圖圖標尺寸." L["No Anchor Bar"]="沒有錨點" diff --git a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/LibSuperVillain-1.0.lua b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/LibSuperVillain-1.0.lua index ac60d58..294908d 100644 --- a/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/LibSuperVillain-1.0.lua +++ b/Interface/AddOns/SVUI/libs/LibSuperVillain-1.0/LibSuperVillain-1.0.lua @@ -80,10 +80,10 @@ local GLOBAL_FILENAME = CoreName.."_Global"; local PROFILE_FILENAME = CoreName.."_Profile"; local CACHE_FILENAME = CoreName.."_Cache"; local SOURCE_KEY = 1; -local GLOBAL_SV, PROFILE_SV, CACHE_SV; +local GLOBAL_SV, PROFILE_SV, CACHE_SV, PLUGINS, MODULES; local PluginString = "" -local AllowedIndexes, Modules, LoadOnDemand = {},{},{}; -local Callbacks, ModuleQueue, ScriptQueue = {},{},{}; +local AllowedIndexes, LoadOnDemand = {},{}; +local Callbacks, ScriptQueue = {},{}; AllowedIndexes.G = {} AllowedIndexes.C = {} @@ -347,28 +347,6 @@ local function removedefaults(db, src, nometa) end end -local ResetToDefaults = function(self, sub, sub2) - local data = self.db - local sv = rawget(data, "data") - local src = rawget(data, "defaults") - local targetData - if(sub2 and sv and sv[sub]) then - targetData = sv[sub][sub2] - elseif(sub and sv) then - targetData = sv[sub] - else - targetData = sv - end - if(targetData) then - for k,v in pairs(targetData) do - targetData[k] = nil - end - else - sv = {} - end - tablecopy(sv, src) -end - --DATABASE META METHODS local meta_database = { __index = function(t, k) @@ -417,20 +395,18 @@ end function lib:ImportDatabase(key) if(not GLOBAL_SV.profiles[key]) then GLOBAL_SV.profiles[key] = {} end; local import = GLOBAL_SV.profiles[key]; - local saved = rawget(CoreObject.db, "data"); + local saved = CoreObject.db; import.importTest = true; --Testing value, will be removed next time the UI is reloaded - for k,v in pairs(import) do - saved[k] = v - end + tablecopy(saved, import); --Ensure that import was successful if(not CoreObject.db.importTest) then --If no test value found, might need reloading --Not the most clever thing in the world but.... - print("Profile Error") - else ReloadUI() + else + print("Profile Successfully Copied") end end @@ -520,11 +496,6 @@ function lib:CheckData(schema, key) print("______SAVED_____") end -function lib:NewDatabase(obj) - local schema = obj.Schema - obj.db = CoreObject.db[schema] or {} -end - function lib:NewCache(index) index = index or CoreObject.Schema AllowedIndexes.C[index] = true @@ -565,7 +536,7 @@ core add-ins functioning outside of the core object. --REGISTRY LOCAL HELPERS local changeDBVar = function(self, value, key, sub1, sub2, sub3) - local db = self.db or CoreObject.db[self.Schema] + local db = CoreObject.db[self.Schema] if((sub1 and sub2 and sub3) and (db[sub1] and db[sub1][sub2] and db[sub1][sub2][sub3])) then db[sub1][sub2][sub3][key] = value elseif((sub1 and sub2) and (db[sub1] and db[sub1][sub2])) then @@ -674,140 +645,7 @@ local function SetPluginString(addonName) return INFO_FORMAT:format(name, version, author) end -local function SetInternalModule(obj, schema, noCopy) - local addonmeta = {} - local oldmeta = getmetatable(obj) - if oldmeta then - for k, v in pairs(oldmeta) do addonmeta[k] = v end - end - addonmeta.__tostring = rootstring - setmetatable( obj, addonmeta ) - - local addonName = ("SVUI [%s]"):format(schema) - - obj.NameID = addonName - obj.Schema = schema - obj.TitleID = schema - - if(not noCopy and (not obj.db)) then obj.db = {} end - - obj.initialized = false - obj.CombatLocked = false - obj.ChangeDBVar = changeDBVar - obj.RegisterEvent = registerEvent - obj.UnregisterEvent = unregisterEvent - obj.RegisterUpdate = registerUpdate - obj.UnregisterUpdate = unregisterUpdate - - return obj -end - -local function SetExternalModule(obj, schema, addonName, header, lod) - local addonmeta = {} - local oldmeta = getmetatable(obj) - if oldmeta then - for k, v in pairs(oldmeta) do addonmeta[k] = v end - end - addonmeta.__tostring = rootstring - setmetatable( obj, addonmeta ) - - obj.NameID = addonName - obj.Schema = schema - obj.TitleID = header - obj.LoD = lod - - if not obj.db then obj.db = {} end - - obj.initialized = false - obj.CombatLocked = false - obj.ChangeDBVar = changeDBVar - obj.RegisterEvent = registerEvent - obj.UnregisterEvent = unregisterEvent - obj.RegisterUpdate = registerUpdate - obj.UnregisterUpdate = unregisterUpdate - obj.AddOption = appendOptions - - if(IsAddOnLoaded(addonName) and not lod) then - CoreObject.Options.args.plugins.args.pluginOptions.args[schema] = { - type = "group", - name = header, - childGroups = "tree", - args = { - enable = { - order = 1, - type = "toggle", - name = "Enable", - get = function() return obj.db.enable end, - set = function(key, value) obj:ChangeDBVar(value, "enable"); CoreObject:StaticPopup_Show("RL_CLIENT") end, - } - } - } - end - - return obj -end - --REGISTRY PUBLIC METHODS -function lib:NewCallback(fn) - if(fn and type(fn) == "function") then - Callbacks[#Callbacks+1] = fn - end -end - -function lib:NewScript(fn) - if(fn and type(fn) == "function") then - ScriptQueue[#ScriptQueue+1] = fn - end -end - -function lib:NewPackage(obj, schema, noCopy) - if(CoreObject[schema]) then return end - - ModuleQueue[#ModuleQueue+1] = schema - Modules[#Modules+1] = schema - AllowedIndexes.P[schema] = true - - CoreObject[schema] = SetInternalModule(obj, schema, noCopy) - - if(CoreObject.AddonLaunched and not CoreObject[schema].initialized) then - if(CoreObject[schema].db) then self:NewDatabase(CoreObject[schema]) end - if(CoreObject[schema].Load) then - CoreObject[schema]:Load() - end - CoreObject[schema].initialized = true - end -end - -function lib:NewPlugin(obj) - local coreName = CoreObject.NameID - local addonName = obj.NameID - - if(addonName and addonName ~= coreName) then - local header = GetAddOnMetadata(addonName, HeaderFromMeta) - local schema = GetAddOnMetadata(addonName, SchemaFromMeta) - local lod = IsAddOnLoadOnDemand(addonName) - if(not schema) then return end - - ModuleQueue[#ModuleQueue+1] = schema - Modules[#Modules+1] = schema - - local infoString = SetPluginString(addonName) - local oldString = PluginString - - PluginString = ("%s%s\n"):format(oldString, infoString) - - CoreObject[schema] = SetExternalModule(obj, schema, addonName, header, lod) - - if(not lod and CoreObject.AddonLaunched and not CoreObject[schema].initialized) then - --print("NewPlugin - " .. schema .. ": New Database") - self:NewDatabase(CoreObject[schema]) - if(CoreObject[schema].Load) then - CoreObject[schema]:Load() - end - CoreObject[schema].initialized = true - end - end -end function lib:RunCallbacks() for i=1, #Callbacks do @@ -826,7 +664,7 @@ function lib:Update(schema) end function lib:UpdateAll() - for _,schema in pairs(Modules) do + for _,schema in pairs(MODULES) do local obj = CoreObject[schema] if obj and obj.ReLoad then obj:ReLoad() @@ -834,31 +672,17 @@ function lib:UpdateAll() end end -function lib:NewPrototype(name) - local version = GetAddOnMetadata(name, "Version") - local schema = GetAddOnMetadata(name, SchemaFromMeta) - - local obj = { - NameID = name, - Version = version, - Schema = schema - } - - local mt = {} - local old = getmetatable(obj) - if old then - for k, v in pairs(old) do mt[k] = v end +function lib:UpdatePlugins() + for _,schema in pairs(PLUGINS) do + local obj = _G[schema] + if obj and obj.ReLoad then + obj:ReLoad() + end end - mt.__tostring = rootstring - setmetatable(obj, mt) - - CoreObject[schema] = obj - - return CoreObject[schema] end function lib:GetModuletable() - return Modules + return MODULES end function lib:GetPlugins() @@ -879,33 +703,46 @@ function lib:ToggleDualProfile(enabled) end end ---[[ CONSTRUCTORS ]]-- - function lib:LoadQueuedModules() - if ModuleQueue then - for i=1,#ModuleQueue do - local schema = ModuleQueue[i] + if MODULES then + for i=1,#MODULES do + local schema = MODULES[i] local obj = CoreObject[schema] if obj and not obj.initialized then obj.initialized = true; local halt = false - - if(obj.db) then - self:NewDatabase(obj) - if(obj.db.incompatible) then - for addon,_ in pairs(obj.db.incompatible) do - if IsAddOnLoaded(addon) then halt = true end - end + local data = CoreObject.db[schema] + if(data and data.incompatible) then + for addon,_ in pairs(data.incompatible) do + if IsAddOnLoaded(addon) then halt = true end end - else - if(CoreObject.db[schema].incompatible) then - for addon,_ in pairs(CoreObject.db[schema].incompatible) do - if IsAddOnLoaded(addon) then halt = true end - end + end + if(obj.Load) then + if(not halt) then + obj:Load() + obj.Load = nil end end + end + end + end +end - if obj.Load then +function lib:LoadQueuedPlugins() + if PLUGINS then + for i=1,#PLUGINS do + local schema = PLUGINS[i] + local obj = _G[schema] + if obj and not obj.initialized then + obj.initialized = true; + local halt = false + local data = CoreObject.db[schema] + if(data and data.incompatible) then + for addon,_ in pairs(data.incompatible) do + if IsAddOnLoaded(addon) then halt = true end + end + end + if(obj.Load) then if(not halt) then obj:Load() obj.Load = nil @@ -913,9 +750,73 @@ function lib:LoadQueuedModules() end end end + end +end + +--[[ CONSTRUCTORS ]]-- + +function lib:NewPlugin(addonName, addonObject) + local version = GetAddOnMetadata(addonName, "Version") + local header = GetAddOnMetadata(addonName, HeaderFromMeta) + local schema = GetAddOnMetadata(addonName, SchemaFromMeta) + local lod = IsAddOnLoadOnDemand(addonName) + + local addonmeta = {} + local oldmeta = getmetatable(addonObject) + if oldmeta then + for k, v in pairs(oldmeta) do addonmeta[k] = v end + end + addonmeta.__tostring = rootstring + setmetatable( addonObject, addonmeta ) + + addonObject.Version = version + addonObject.NameID = addonName + addonObject.TitleID = header + addonObject.Schema = schema + addonObject.LoD = lod + addonObject.initialized = false + addonObject.CombatLocked = false + addonObject.ChangeDBVar = changeDBVar + addonObject.RegisterEvent = registerEvent + addonObject.UnregisterEvent = unregisterEvent + addonObject.RegisterUpdate = registerUpdate + addonObject.UnregisterUpdate = unregisterUpdate + addonObject.AddOption = appendOptions - twipe(ModuleQueue) + if(IsAddOnLoaded(addonName) and not lod) then + CoreObject.Options.args.plugins.args.pluginOptions.args[schema] = { + type = "group", + name = header, + childGroups = "tree", + args = { + enable = { + order = 1, + type = "toggle", + name = "Enable", + get = function() + return CoreObject.db[schema].enable + end, + set = function(key, value) + addonObject:ChangeDBVar(value, "enable"); + CoreObject:StaticPopup_Show("RL_CLIENT") + end, + } + } + } end + + _G[schema] = addonObject + + if(not PLUGINS) then PLUGINS = {} end + + PLUGINS[#PLUGINS+1] = schema + AllowedIndexes.P[schema] = true + + local infoString = SetPluginString(addonName) + local oldString = PluginString + PluginString = ("%s%s\n"):format(oldString, infoString) + + return addonObject end local function NewLoadOnDemand(addonName, schema, header) @@ -942,7 +843,7 @@ local function NewLoadOnDemand(addonName, schema, header) if(not IsAddOnLoaded(addonName)) then local loaded, reason = LoadAddOn(addonName) PROFILE_SV.SAFEDATA[schema].enable = true - lib:LoadQueuedModules() + lib:LoadQueuedPlugins() else PROFILE_SV.SAFEDATA[schema].enable = false CoreObject:StaticPopup_Show("RL_CLIENT") @@ -968,15 +869,78 @@ local DataBase_OnEvent = function(self, event) end end -function lib:NewCore(gfile, pfile, cfile) - --internals - CoreObject.NameID = CoreName; - CoreObject.Version = AddonVersion; - CoreObject.GameVersion = tonumber(InterfaceVersion); - CoreObject.DebugMode = false; - CoreObject.Schema = GetAddOnMetadata(CoreName, SchemaFromMeta); - CoreObject.TitleID = GetAddOnMetadata(CoreName, HeaderFromMeta); +-- CORE OBJECT CONSTRUCT +local Core_NewCallback = function(self, fn) + if(fn and type(fn) == "function") then + Callbacks[#Callbacks+1] = fn + end +end +local Core_NewScript = function(self, fn) + if(fn and type(fn) == "function") then + ScriptQueue[#ScriptQueue+1] = fn + end +end + +local Core_NewPackage = function(self, schema, header) + if(self[schema]) then return end + + if(not MODULES) then MODULES = {} end + MODULES[#MODULES+1] = schema + + AllowedIndexes.P[schema] = true + + local addonName = ("SVUI [%s]"):format(schema) + + local obj = { + NameID = addonName, + TitleID = header, + Schema = schema, + initialized = false, + CombatLocked = false, + ChangeDBVar = changeDBVar, + RegisterEvent = registerEvent, + UnregisterEvent = unregisterEvent, + RegisterUpdate = registerUpdate, + UnregisterUpdate = unregisterUpdate + } + + 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 ) + + self[schema] = obj + + return self[schema] +end + +local Core_ResetData = function(self, sub, sub2) + local data = self.db + local sv = rawget(data, "data") + local src = rawget(data, "defaults") + local targetData + if(sub2 and sv and sv[sub]) then + targetData = sv[sub][sub2] + elseif(sub and sv) then + targetData = sv[sub] + else + targetData = sv + end + if(targetData) then + for k,v in pairs(targetData) do + targetData[k] = nil + end + else + sv = {} + end + tablecopy(sv, src) +end + +function lib:NewCore(gfile, pfile, cfile) --meta assurance local mt = {}; local old = getmetatable(CoreObject); @@ -985,10 +949,12 @@ function lib:NewCore(gfile, pfile, cfile) end mt.__tostring = rootstring; setmetatable(CoreObject, mt); + --database GLOBAL_FILENAME = gfile or GLOBAL_FILENAME PROFILE_FILENAME = pfile or PROFILE_FILENAME CACHE_FILENAME = cfile or CACHE_FILENAME + --events if(not self.EventManager.Initialized) then self.EventManager:RegisterEvent("PLAYER_LOGOUT") @@ -996,18 +962,31 @@ function lib:NewCore(gfile, pfile, cfile) self.EventManager.Initialized = true end - CoreObject.db = tablesplice(CoreObject.configs, {}) + --internals + CoreObject.NameID = CoreName; + CoreObject.Version = AddonVersion; + CoreObject.GameVersion = tonumber(InterfaceVersion); + CoreObject.DebugMode = false; + CoreObject.Schema = GetAddOnMetadata(CoreName, SchemaFromMeta); + CoreObject.TitleID = GetAddOnMetadata(CoreName, HeaderFromMeta); + CoreObject.NewCallback = Core_NewCallback + CoreObject.NewScript = Core_NewScript + CoreObject.NewPackage = Core_NewPackage + CoreObject.ResetData = Core_ResetData + CoreObject.db = tablesplice(CoreObject.configs, {}) + CoreObject.L = self:Lang() --set global _G[CoreName] = CoreObject; - return CoreObject + + return _G[CoreName] end -function lib:Initialize() - local coreSchema = CoreObject.Schema +-- INITIALIZE AND LAUNCH +function lib:Initialize() + local coreSchema = CoreObject.Schema --GLOBAL SAVED VARIABLES - if not _G[GLOBAL_FILENAME] then _G[GLOBAL_FILENAME] = {} end GLOBAL_SV = _G[GLOBAL_FILENAME] @@ -1057,7 +1036,7 @@ function lib:Initialize() end --Attempt to copy any prior variables, even outdated - if(PROFILE_SV.system or (ModuleQueue[1] and PROFILE_SV[ModuleQueue[1]])) then + if(PROFILE_SV.system or (MODULES[1] and PROFILE_SV[MODULES[1]])) then for k,v in pairs(PROFILE_SV) do if(k == "system") then tablecopy(v, PROFILE_SV.STORED[1][coreSchema]) @@ -1098,12 +1077,10 @@ function lib:Initialize() end --construct core dataset - local db = setmetatable({}, meta_database) - db.data = PROFILE_SV.STORED[SOURCE_KEY] - db.defaults = CoreObject.configs - - CoreObject.ResetData = ResetToDefaults - CoreObject.db = db + local db = setmetatable({}, meta_database) + db.data = PROFILE_SV.STORED[SOURCE_KEY] + db.defaults = CoreObject.configs + CoreObject.db = db --check for LOD plugins local addonCount = GetNumAddOns() @@ -1135,6 +1112,7 @@ function lib:Launch() end self:LoadQueuedModules() + self:LoadQueuedPlugins() if ScriptQueue then for i=1, #ScriptQueue do diff --git a/Interface/AddOns/SVUI/libs/libs.xml b/Interface/AddOns/SVUI/libs/libs.xml index 0715887..5b4ca2f 100644 --- a/Interface/AddOns/SVUI/libs/libs.xml +++ b/Interface/AddOns/SVUI/libs/libs.xml @@ -1,6 +1,6 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> - <Script file="LibStub\LibStub.lua"/> <Script file="LibSuperVillain-1.0\LibSuperVillain-1.0.lua"/> + <Script file="LibStub\LibStub.lua"/> <Script file="CallbackHandler-1.0\CallbackHandler-1.0.lua"/> <Script file="LibSharedMedia-3.0\LibSharedMedia-3.0.lua"/> <Script file="LibActionButton-1.0\LibActionButton-1.0.lua"/> diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ActionPanel/oUF_ActionPanel.toc b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ActionPanel/oUF_ActionPanel.toc index 0d51ad9..017ed59 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ActionPanel/oUF_ActionPanel.toc +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ActionPanel/oUF_ActionPanel.toc @@ -2,7 +2,7 @@ ## Title: oUF ActionPanel ## Notes: Adds a backing to all unit frames that provides many utilities. ## Author: Munglunch -## Version: 4.6 +## Version: 4.7 ## X-Category: oUF ## Dependencies: oUF diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Afflicted/oUF_Afflicted.toc b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Afflicted/oUF_Afflicted.toc index 7a62ddf..85eec06 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Afflicted/oUF_Afflicted.toc +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Afflicted/oUF_Afflicted.toc @@ -2,7 +2,7 @@ ## Title: oUF Afflicted ## Notes: Adds Custom Debuff Highlighting to oUF. ## Author: Munglunch -## Version: 4.6 +## Version: 4.7 ## X-Category: oUF ## Dependencies: oUF diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc index 7fb26c5..afd78ed 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_ArcaneCharge/oUF_ArcaneCharge.toc @@ -2,7 +2,7 @@ ## Title: oUF Arcane Charge ## Notes: Adds support for arcane charge indicators to oUF. ## Author: Munglunch -## Version: 4.6 +## Version: 4.7 ## Dependencies: oUF oUF_ArcaneCharge.lua \ No newline at end of file diff --git a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Combatant/oUF_Combatant.toc b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Combatant/oUF_Combatant.toc index 0945cc2..4d49a4a 100644 --- a/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Combatant/oUF_Combatant.toc +++ b/Interface/AddOns/SVUI/libs/oUF_Villain/Plugins/oUF_Combatant/oUF_Combatant.toc @@ -2,7 +2,7 @@ ## Title: oUF Combatant ## Notes: Adds PvP trinket status and spec icons to oUF frames. ## Author: Munglunch -## Version: 4.60 +## Version: 4.70 ## X-Category: oUF ## Dependencies: oUF diff --git a/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua b/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua index 4c16d47..a37c248 100644 --- a/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua +++ b/Interface/AddOns/SVUI/packages/actionbar/KeyBind.lua @@ -36,8 +36,8 @@ local tonumber = tonumber; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibSuperVillain:Lang(); +local SV = select(2, ...) +local L = SV.L; local MOD = SV.SVBar; local _G = getfenv(0); diff --git a/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua b/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua index 1a018a3..35531aa 100644 --- a/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua +++ b/Interface/AddOns/SVUI/packages/actionbar/SVBar.lua @@ -33,12 +33,11 @@ local ceil = math.ceil; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() - +local SV = select(2, ...) +local L = SV.L local LSM = LibStub("LibSharedMedia-3.0") -local MOD = {}; + +local MOD = SV:NewPackage("SVBar", L["ActionBars"]); MOD.ButtonCache = {}; --[[ ########################################################## @@ -1584,6 +1583,4 @@ function MOD:Load() SetSpellFlyoutHook() self.IsLoaded = true -end - -SVLib:NewPackage(MOD, "SVBar", true) \ No newline at end of file +end \ 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 962b3fe..a849539 100644 --- a/Interface/AddOns/SVUI/packages/aura/SVAura.lua +++ b/Interface/AddOns/SVUI/packages/aura/SVAura.lua @@ -42,11 +42,10 @@ local tremove, twipe = table.remove, table.wipe; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() +local SV = select(2, ...) +local L = SV.L local LSM = LibStub("LibSharedMedia-3.0") -local MOD = {}; +local MOD = SV:NewPackage("SVAura", BUFFOPTIONS_LABEL); --[[ ########################################################## LOCAL VARS @@ -595,10 +594,4 @@ function MOD:Load() self:Update_ConsolidatedBuffsSettings() SV.Mentalo:Add(auras, L["Auras Frame"]) -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -SVLib:NewPackage(MOD, "SVAura", true) \ No newline at end of file +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/bag/SVBag.lua b/Interface/AddOns/SVUI/packages/bag/SVBag.lua index 43c5200..1070fdf 100644 --- a/Interface/AddOns/SVUI/packages/bag/SVBag.lua +++ b/Interface/AddOns/SVUI/packages/bag/SVBag.lua @@ -40,10 +40,9 @@ local twipe = table.wipe; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() -local MOD = {}; +local SV = select(2, ...) +local L = SV.L +local MOD = SV:NewPackage("SVBag", L["Bags"]); local TTIP = SV.SVTip; --[[ ########################################################## @@ -343,12 +342,12 @@ function MOD:FlushSlotFading(this) end function MOD:Layout(isBank, isReagent) - if self.db.enable ~= true then return; end + if SV.db.SVBag.enable ~= true then return; end local f = MOD:GetContainerFrame(isBank, isReagent); if not f then return; end - local buttonSize = isBank and MOD.db.bankSize or MOD.db.bagSize; + local buttonSize = isBank and SV.db.SVBag.bankSize or SV.db.SVBag.bagSize; local buttonSpacing = 8; - local containerWidth = (MOD.db.alignToChat == true and (isBank and (SV.db.SVDock.dockLeftWidth - 14) or (SV.db.SVDock.dockRightWidth - 14))) or (isBank and MOD.db.bankWidth) or MOD.db.bagWidth + local containerWidth = (SV.db.SVBag.alignToChat == true and (isBank and (SV.db.SVDock.dockLeftWidth - 14) or (SV.db.SVDock.dockRightWidth - 14))) or (isBank and SV.db.SVBag.bankWidth) or SV.db.SVBag.bagWidth local numContainerColumns = floor(containerWidth / (buttonSize + buttonSpacing)); local holderWidth = ((buttonSize + buttonSpacing) * numContainerColumns) - buttonSpacing; local numContainerRows = 0; @@ -557,17 +556,17 @@ function MOD:VendorGrays(arg1, arg2, arg3) end function MOD:ModifyBags() - local docked = self.db.alignToChat + local docked = SV.db.SVBag.alignToChat local anchor, x, y if self.BagFrame then local parent = docked and RightSuperDock or SV.UIParent - local anchor, x, y = self.db.bags.point, self.db.bags.xOffset, self.db.bags.yOffset + local anchor, x, y = SV.db.SVBag.bags.point, SV.db.SVBag.bags.xOffset, SV.db.SVBag.bags.yOffset self.BagFrame:ClearAllPoints() self.BagFrame:Point(anchor, parent, anchor, x, y) end if self.BankFrame then local parent = docked and LeftSuperDock or SV.UIParent - local anchor, x, y = self.db.bank.point, self.db.bank.xOffset, self.db.bank.yOffset + local anchor, x, y = SV.db.SVBag.bank.point, SV.db.SVBag.bank.xOffset, SV.db.SVBag.bank.yOffset self.BankFrame:ClearAllPoints() self.BankFrame:Point(anchor, parent, anchor, x, y) end @@ -575,12 +574,12 @@ end do local function Bags_OnEnter() - if MOD.db.bagBar.mouseover ~= true then return end + if SV.db.SVBag.bagBar.mouseover ~= true then return end SV:SecureFadeIn(SVUI_BagBar, 0.2, SVUI_BagBar:GetAlpha(), 1) end local function Bags_OnLeave() - if MOD.db.bagBar.mouseover ~= true then return end + if SV.db.SVBag.bagBar.mouseover ~= true then return end SV:SecureFadeOut(SVUI_BagBar, 0.2, SVUI_BagBar:GetAlpha(), 0) end @@ -635,21 +634,21 @@ do end function MOD:ModifyBagBar() - if not self.db.bagBar.enable then return end + if not SV.db.SVBag.bagBar.enable then return end if not self.BagBarLoaded then LoadBagBar() end - if self.db.bagBar.mouseover then + if SV.db.SVBag.bagBar.mouseover then SVUI_BagBar:SetAlpha(0) else SVUI_BagBar:SetAlpha(1) end - local showBy = self.db.bagBar.showBy - local sortDir = self.db.bagBar.sortDirection - local bagSize = self.db.bagBar.size - local bagSpacing = self.db.bagBar.spacing + local showBy = SV.db.SVBag.bagBar.showBy + local sortDir = SV.db.SVBag.bagBar.sortDirection + local bagSize = SV.db.SVBag.bagBar.size + local bagSpacing = SV.db.SVBag.bagBar.spacing for i = 1, #SVUI_BagBar.buttons do local button = SVUI_BagBar.buttons[i] @@ -697,7 +696,7 @@ do SV.Mentalo:Add(SVUI_BagBar, L["Bags Bar"]) end - if self.db.bagBar.showBackdrop then + if SV.db.SVBag.bagBar.showBackdrop then SVUI_BagBar.Panel:Show() else SVUI_BagBar.Panel:Hide() @@ -1262,9 +1261,9 @@ function MOD:RefreshTokens() set:ClearAllPoints() if name then set.icon:SetTexture(icon) - if MOD.db.currencyFormat == 'ICON_TEXT' then + if SV.db.SVBag.currencyFormat == 'ICON_TEXT' then set.text:SetText(name..': '..count) - elseif MOD.db.currencyFormat == 'ICON' then + elseif SV.db.SVBag.currencyFormat == 'ICON' then set.text:SetText(count) end set.currencyID = currencyID; @@ -1401,7 +1400,7 @@ BUILD FUNCTION / UPDATE ########################################################## ]]-- function MOD:ReLoad() - if not self.db.enable then return end + if not SV.db.SVBag.enable then return end self:Layout(); self:ModifyBags(); self:ModifyBagBar(); @@ -1411,7 +1410,7 @@ function MOD:Load() if IsAddOnLoaded("AdiBags") then return end - if not self.db.enable then return end + if not SV.db.SVBag.enable then return end self:ModifyBagBar() SV.bags = self; self.BagFrames = {} @@ -1429,10 +1428,4 @@ function MOD:Load() if(SV.GameVersion >= 60000) then self:RegisterEvent("PLAYERBANKBAGSLOTS_CHANGED"); end StackSplitFrame:SetFrameStrata("DIALOG") self.BagFrame:RefreshBagsSlots() -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -SVLib:NewPackage(MOD, "SVBag"); \ No newline at end of file +end \ 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 146dc67..ff08004 100644 --- a/Interface/AddOns/SVUI/packages/bag/tools/breakstuff.lua +++ b/Interface/AddOns/SVUI/packages/bag/tools/breakstuff.lua @@ -32,8 +32,8 @@ local tremove, tcopy, twipe, tsort, tcat = table.remove, table.copy, table.wipe, GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibSuperVillain:Lang(); +local SV = select(2, ...) +local L = SV.L; local MOD = SV.SVBag; local TTIP = SV.SVTip; --[[ diff --git a/Interface/AddOns/SVUI/packages/bag/tools/sorting.lua b/Interface/AddOns/SVUI/packages/bag/tools/sorting.lua index 56f07cf..b1dc03e 100644 --- a/Interface/AddOns/SVUI/packages/bag/tools/sorting.lua +++ b/Interface/AddOns/SVUI/packages/bag/tools/sorting.lua @@ -42,8 +42,8 @@ local tremove, tcopy, twipe, tsort = table.remove, table.copy, table.wipe, table GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibSuperVillain:Lang(); +local SV = select(2, ...) +local L = SV.L; local MOD = SV.SVBag; --[[ ########################################################## diff --git a/Interface/AddOns/SVUI/packages/chat/SVChat.lua b/Interface/AddOns/SVUI/packages/chat/SVChat.lua index 2ad257d..bb31726 100644 --- a/Interface/AddOns/SVUI/packages/chat/SVChat.lua +++ b/Interface/AddOns/SVUI/packages/chat/SVChat.lua @@ -34,11 +34,10 @@ local twipe = table.wipe; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() +local SV = select(2, ...) +local L = SV.L local LSM = LibStub("LibSharedMedia-3.0") -local MOD = {}; +local MOD = SV:NewPackage("SVChat", L["Chat"]); --[[ ########################################################## LOCAL VARS @@ -905,34 +904,34 @@ end function MOD:UpdateLocals() CHAT_WIDTH = (SV.db.SVDock.dockLeftWidth or 350) - 10; CHAT_HEIGHT = (SV.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 = LSM:Fetch("font", self.db.font); + CHAT_THROTTLE = SV.db.SVChat.throttleInterval; + CHAT_ALLOW_URL = SV.db.SVChat.url; + CHAT_HOVER_URL = SV.db.SVChat.hyperlinkHover; + CHAT_STICKY = SV.db.SVChat.sticky; + CHAT_FONT = LSM:Fetch("font", SV.db.SVChat.font); CHAT_FONTSIZE = SV.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 = LSM:Fetch("font", self.db.tabFont); - TAB_FONTSIZE = self.db.tabFontSize; - TAB_FONTOUTLINE = self.db.tabFontOutline; - CHAT_FADING = self.db.fade; - CHAT_PSST = LSM:Fetch("sound", self.db.psst); - TIME_STAMP_MASK = self.db.timeStampFormat; + CHAT_FONTOUTLINE = SV.db.SVChat.fontOutline; + TAB_WIDTH = SV.db.SVChat.tabWidth; + TAB_HEIGHT = SV.db.SVChat.tabHeight; + TAB_SKINS = SV.db.SVChat.tabStyled; + TAB_FONT = LSM:Fetch("font", SV.db.SVChat.tabFont); + TAB_FONTSIZE = SV.db.SVChat.tabFontSize; + TAB_FONTOUTLINE = SV.db.SVChat.tabFontOutline; + CHAT_FADING = SV.db.SVChat.fade; + CHAT_PSST = LSM:Fetch("sound", SV.db.SVChat.psst); + TIME_STAMP_MASK = SV.db.SVChat.timeStampFormat; if(CHAT_THROTTLE and CHAT_THROTTLE == 0) then twipe(THROTTLE_CACHE) end end function MOD:ReLoad() - if(not self.db.enable) then return end + if(not SV.db.SVChat.enable) then return end self:RefreshChatFrames(true) end function MOD:Load() - if(not self.db.enable) then return end + if(not SV.db.SVChat.enable) then return end ScrollIndicator:SetParent(SuperDockWindowLeft) ScrollIndicator:SetSize(20,20) @@ -966,10 +965,4 @@ function MOD:Load() _G.InterfaceOptionsSocialPanelChatStyle:EnableMouse(false) _G.InterfaceOptionsSocialPanelChatStyleButton:Hide() _G.InterfaceOptionsSocialPanelChatStyle:SetAlpha(0) -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -SVLib:NewPackage(MOD, "SVChat") \ No newline at end of file +end \ 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 e0c47e4..ac1f6e7 100644 --- a/Interface/AddOns/SVUI/packages/dock/SVDock.lua +++ b/Interface/AddOns/SVUI/packages/dock/SVDock.lua @@ -33,16 +33,16 @@ local format, gsub, strfind, strmatch, tonumber = format, gsub, strfind, strmatc GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() -local MOD, DOCKLET_CACHE, TOOL_CACHE, SAFETY_CACHE = {}, {}, {}, {}; -local PREV_TOOL, DEFAULT_DOCKLET; +local SV = select(2, ...) +local L = SV.L +local MOD = SV:NewPackage("SVDock", L["Docks"]); --[[ ########################################################## LOCAL VARS ########################################################## ]]-- +local DOCKLET_CACHE, TOOL_CACHE, SAFETY_CACHE = {}, {}, {}; +local PREV_TOOL, DEFAULT_DOCKLET; local AddOnButton = CreateFrame("Button", "SVUI_AddonDocklet", UIParent); local SuperDockletMain = CreateFrame('Frame', 'SuperDockletMain', UIParent); local SuperDockletExtra = CreateFrame('Frame', 'SuperDockletExtra', UIParent); @@ -426,16 +426,16 @@ local function BorderColorUpdates() SVUIBottomPanel:SetBackdropBorderColor(0,0,0,1) end -SVLib:NewCallback(BorderColorUpdates) +SV:NewCallback(BorderColorUpdates) function MOD:CreateDockPanels() - local leftWidth = self.db.dockLeftWidth or 350; - local leftHeight = self.db.dockLeftHeight or 180; - local rightWidth = self.db.dockRightWidth or 350; - local rightHeight = self.db.dockRightHeight or 180; - local buttonsize = self.db.buttonSize or 22; - local spacing = self.db.buttonSpacing or 4; - local statBarWidth = self.db.dockStatWidth or defaultStatBarWidth + local leftWidth = SV.db.SVDock.dockLeftWidth or 350; + local leftHeight = SV.db.SVDock.dockLeftHeight or 180; + local rightWidth = SV.db.SVDock.dockRightWidth or 350; + local rightHeight = SV.db.SVDock.dockRightHeight or 180; + local buttonsize = SV.db.SVDock.buttonSize or 22; + local spacing = SV.db.SVDock.buttonSpacing or 4; + local statBarWidth = SV.db.SVDock.dockStatWidth or defaultStatBarWidth local STATS = SV.SVStats; -- [[ CORNER BUTTON ]] -- @@ -891,13 +891,13 @@ BUILD/UPDATE ########################################################## ]]-- function MOD:UpdateSuperDock() - local leftWidth = self.db.dockLeftWidth or 350; - local leftHeight = self.db.dockLeftHeight or 180; - local rightWidth = self.db.dockRightWidth or 350; - local rightHeight = self.db.dockRightHeight or 180; - local buttonsize = self.db.buttonSize or 22; - local spacing = self.db.buttonSpacing or 4; - local statBarWidth = self.db.dockStatWidth or defaultStatBarWidth + local leftWidth = SV.db.SVDock.dockLeftWidth or 350; + local leftHeight = SV.db.SVDock.dockLeftHeight or 180; + local rightWidth = SV.db.SVDock.dockRightWidth or 350; + local rightHeight = SV.db.SVDock.dockRightHeight or 180; + local buttonsize = SV.db.SVDock.buttonSize or 22; + local spacing = SV.db.SVDock.buttonSpacing or 4; + local statBarWidth = SV.db.SVDock.dockStatWidth or defaultStatBarWidth _G["LeftSuperDock"]:Size(leftWidth, leftHeight) _G["SuperDockAlertLeft"]:Width(leftWidth) @@ -916,14 +916,14 @@ function MOD:UpdateSuperDock() end function MOD:UpdateDockBackdrops() - if self.db.rightDockBackdrop then + if SV.db.SVDock.rightDockBackdrop then RightSuperDock.backdrop:Show() RightSuperDock.backdrop:ClearAllPoints() RightSuperDock.backdrop:WrapOuter(RightSuperDock, 4, 4) else RightSuperDock.backdrop:Hide() end - if self.db.leftDockBackdrop then + if SV.db.SVDock.leftDockBackdrop then LeftSuperDock.backdrop:Show() LeftSuperDock.backdrop:ClearAllPoints() LeftSuperDock.backdrop:WrapOuter(LeftSuperDock, 4, 4) @@ -933,7 +933,7 @@ function MOD:UpdateDockBackdrops() end function MOD:BottomPanelVisibility() - if self.db.bottomPanel then + if SV.db.SVDock.bottomPanel then self.BottomPanel:Show() else self.BottomPanel:Hide() @@ -941,7 +941,7 @@ function MOD:BottomPanelVisibility() end function MOD:TopPanelVisibility() - if self.db.topPanel then + if SV.db.SVDock.topPanel then self.TopPanel:Show() else self.TopPanel:Hide() @@ -958,7 +958,7 @@ function MOD:ReLoad() end function MOD:Load() - self.Cache = SVLib:NewCache("Docks") + self.Cache = LibSuperVillain:NewCache("Docks") if(not self.Cache.SuperDockFaded) then self.Cache.SuperDockFaded = false end @@ -999,10 +999,4 @@ function MOD:Load() SuperDockletExtra:SetScript("OnShow", DockletFrame_OnShow) SV:ReloadDocklets(true) SV.Timers:ExecuteTimer(self.LoadToolBarProfessions, 5) -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -SVLib:NewPackage(MOD, "SVDock") \ No newline at end of file +end \ 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 24a47eb..e1c3edc 100644 --- a/Interface/AddOns/SVUI/packages/gear/SVGear.lua +++ b/Interface/AddOns/SVUI/packages/gear/SVGear.lua @@ -32,10 +32,9 @@ local ceil, floor, round = math.ceil, math.floor, math.round; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() -local MOD = {}; +local SV = select(2, ...) +local L = SV.L +local MOD = SV:NewPackage("SVGear", L["Gear Managment"]); --[[ ########################################################## LOCAL VARS @@ -255,9 +254,9 @@ end 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 + SHOW_LEVEL = SV.db.SVGear.itemlevel.enable + SHOW_DURABILITY = SV.db.SVGear.durability.enable + ONLY_DAMAGED = SV.db.SVGear.durability.onlydamaged MAX_LEVEL, AVG_LEVEL = GetAverageItemLevel() LoadAddOn("Blizzard_InspectUI") SetDisplayStats("Character") @@ -278,9 +277,9 @@ local GearSwapComplete = function() end function MOD:UpdateLocals() - SHOW_LEVEL = self.db.itemlevel.enable - SHOW_DURABILITY = self.db.durability.enable - ONLY_DAMAGED = self.db.durability.onlydamaged + SHOW_LEVEL = SV.db.SVGear.itemlevel.enable + SHOW_DURABILITY = SV.db.SVGear.durability.enable + ONLY_DAMAGED = SV.db.SVGear.durability.onlydamaged MAX_LEVEL, AVG_LEVEL = GetAverageItemLevel() end @@ -299,10 +298,4 @@ function MOD:Load() self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED", GearSwap) self:RegisterEvent("EQUIPMENT_SWAP_FINISHED", GearSwapComplete) self:RegisterEvent("PLAYER_ENTERING_WORLD") -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -SVLib:NewPackage(MOD, "SVGear"); \ No newline at end of file +end \ 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 96debda..eba7b36 100644 --- a/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua +++ b/Interface/AddOns/SVUI/packages/henchmen/SVHenchmen.lua @@ -13,10 +13,9 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() -local MOD = {} +local SV = select(2, ...) +local L = SV.L +local MOD = SV:NewPackage("SVHenchmen", L["Henchmen"]); --[[ ########################################################## LOCAL VARS @@ -691,7 +690,7 @@ INVITE AUTOMATONS ########################################################## ]]-- function MOD:PARTY_INVITE_REQUEST(event, arg) - if not self.db.autoAcceptInvite then return end + if not SV.db.SVHenchmen.autoAcceptInvite then return end if IsInGroup() or QueueStatusMinimapButton:IsShown() then return end @@ -752,8 +751,8 @@ REPAIR AUTOMATONS ########################################################## ]]-- function MOD:MERCHANT_SHOW() - if self.db.vendorGrays then SV.SVBag:VendorGrays(nil,true) end - local autoRepair = self.db.autoRepair; + if SV.db.SVHenchmen.vendorGrays then SV.SVBag:VendorGrays(nil,true) end + local autoRepair = SV.db.SVHenchmen.autoRepair; if IsShiftKeyDown() or autoRepair == "NONE" or not CanMerchantRepair() then return end local repairCost,canRepair=GetRepairAllCost() local loan=GetGuildBankWithdrawMoney() @@ -778,7 +777,7 @@ REP AUTOMATONS ########################################################## ]]-- function MOD:CHAT_MSG_COMBAT_FACTION_CHANGE(event, msg) - if not self.db.autorepchange then return end + if not SV.db.SVHenchmen.autorepchange then return end local _, _, faction, amount = msg:find(incpat) if not faction then _, _, faction, amount = msg:find(changedpat) or msg:find(decpat) @@ -803,13 +802,13 @@ QUEST AUTOMATONS ]]-- function MOD:AutoQuestProxy() if(IsShiftKeyDown()) then return false; end - if((not QuestIsDaily() or not QuestIsWeekly()) and (self.db.autodailyquests)) then return false; end - if(QuestFlagsPVP() and (not self.db.autopvpquests)) then return false; end + if((not QuestIsDaily() or not QuestIsWeekly()) and (SV.db.SVHenchmen.autodailyquests)) then return false; end + if(QuestFlagsPVP() and (not SV.db.SVHenchmen.autopvpquests)) then return false; end return true end function MOD:QUEST_GREETING() - if(self.db.autoquestaccept == true and self:AutoQuestProxy()) then + if(SV.db.SVHenchmen.autoquestaccept == true and self:AutoQuestProxy()) then local active,available = GetNumActiveQuests(), GetNumAvailableQuests() if(active + available == 0) then return end if(available > 0) then @@ -822,7 +821,7 @@ function MOD:QUEST_GREETING() end function MOD:GOSSIP_SHOW() - if(self.db.autoquestaccept == true and self:AutoQuestProxy()) then + if(SV.db.SVHenchmen.autoquestaccept == true and self:AutoQuestProxy()) then if GetGossipAvailableQuests() then SelectGossipAvailableQuest(1) elseif GetGossipActiveQuests() then @@ -832,7 +831,7 @@ function MOD:GOSSIP_SHOW() end function MOD:QUEST_DETAIL() - if(self.db.autoquestaccept == true and self:AutoQuestProxy()) then + if(SV.db.SVHenchmen.autoquestaccept == true and self:AutoQuestProxy()) then if not QuestGetAutoAccept() then AcceptQuest() else @@ -842,7 +841,7 @@ function MOD:QUEST_DETAIL() end function MOD:QUEST_ACCEPT_CONFIRM() - if(self.db.autoquestaccept == true and self:AutoQuestProxy()) then + if(SV.db.SVHenchmen.autoquestaccept == true and self:AutoQuestProxy()) then ConfirmAcceptQuest() StaticPopup_Hide("QUEST_ACCEPT_CONFIRM") end @@ -850,19 +849,19 @@ end function MOD:QUEST_PROGRESS() if(IsShiftKeyDown()) then return false; end - if(self.db.autoquestcomplete == true and IsQuestCompletable()) then + if(SV.db.SVHenchmen.autoquestcomplete == true and IsQuestCompletable()) then CompleteQuest() end end function MOD:QUEST_COMPLETE() - if(not self.db.autoquestcomplete and (not self.db.autoquestreward)) then return end + if(not SV.db.SVHenchmen.autoquestcomplete and (not SV.db.SVHenchmen.autoquestreward)) then return end if(IsShiftKeyDown()) then return false; end local rewards = GetNumQuestChoices() if rewards > 1 then local auto_select = QuestFrameRewardPanel.itemChoice or QuestInfoFrame.itemChoice; local selection, value = 1, 0; - if self.db.autoquestreward == true then + if SV.db.SVHenchmen.autoquestreward == true then for i = 1, rewards do local iLink = GetQuestItemLink("choice", i) if iLink then @@ -883,11 +882,11 @@ function MOD:QUEST_COMPLETE() end end auto_select = selection - if self.db.autoquestcomplete == true then + if SV.db.SVHenchmen.autoquestcomplete == true then GetQuestReward(auto_select) end else - if(self.db.autoquestcomplete == true) then + if(SV.db.SVHenchmen.autoquestcomplete == true) then GetQuestReward(GetNumQuestChoices()) end end @@ -918,7 +917,7 @@ function MOD:Load() bubble:SetScript('OnShow', Speech_OnShow) if IsAddOnLoaded("Postal") then - self.db.mailOpener = false + SV.db.SVHenchmen.mailOpener = false else self:LoadMailMinions() self:ToggleMailMinions() @@ -930,7 +929,7 @@ function MOD:Load() self:RegisterEvent(event) end - if self.db.pvpautorelease then + if SV.db.SVHenchmen.pvpautorelease then local autoReleaseHandler = CreateFrame("frame") autoReleaseHandler:RegisterEvent("PLAYER_DEAD") autoReleaseHandler:SetScript("OnEvent",function(self,event) @@ -965,10 +964,4 @@ function MOD:Load() PlayMovie_hook(...) end end -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -SVLib:NewPackage(MOD, "SVHenchmen") \ No newline at end of file +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 2867584..fe2fdc8 100644 --- a/Interface/AddOns/SVUI/packages/map/SVMap.lua +++ b/Interface/AddOns/SVUI/packages/map/SVMap.lua @@ -36,10 +36,9 @@ local parsefloat = math.parsefloat; -- Uncommon GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() -local MOD = {}; +local SV = select(2, ...) +local L = SV.L +local MOD = SV:NewPackage("SVMap", L["Minimap"]); MOD.MinimapButtons = {} --[[ ########################################################## @@ -986,10 +985,4 @@ function MOD:Load() self:RegisterEvent('PLAYER_REGEN_DISABLED') self:RegisterEvent("ZONE_CHANGED") self:RegisterEvent("ZONE_CHANGED_NEW_AREA") -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -SVLib:NewPackage(MOD, "SVMap", true) \ No newline at end of file +end \ 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 0470d60..65bfac9 100644 --- a/Interface/AddOns/SVUI/packages/override/SVOverride.lua +++ b/Interface/AddOns/SVUI/packages/override/SVOverride.lua @@ -33,11 +33,10 @@ local abs, ceil, floor, round = math.abs, math.ceil, math.floor, math.round; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() +local SV = select(2, ...) +local L = SV.L local LSM = LibStub("LibSharedMedia-3.0") -local MOD = {}; +local MOD = SV:NewPackage("SVOverride", "Overrides"); MOD.LewtRollz = {}; --[[ ########################################################## @@ -300,7 +299,7 @@ local AlertFramePostMove_Hook = function(forced) YOFFSET = 10; SVUI_AlertFrame_MOVE:SetText(SVUI_AlertFrame_MOVE.textString.." (Grow Up)") end - if MOD.db.lootRoll then + if SV.db.SVOverride.lootRoll then local f, g; for h, i in pairs(MOD.LewtRollz) do i:ClearAllPoints() @@ -455,8 +454,8 @@ LOOTING ########################################################## ]]-- local function UpdateLootUpvalues() - LOOT_WIDTH = MOD.db.lootRollWidth - LOOT_HEIGHT = MOD.db.lootRollHeight + LOOT_WIDTH = SV.db.SVOverride.lootRollWidth + LOOT_HEIGHT = SV.db.SVOverride.lootRollHeight end local Loot_OnHide = function(self) @@ -1072,7 +1071,7 @@ function MOD:Load() self:RegisterEvent("LOOT_CLOSED", LootSimpleEventsHandler); self:RegisterEvent("OPEN_MASTER_LOOT_LIST", LootSimpleEventsHandler); self:RegisterEvent("UPDATE_MASTER_LOOT_LIST", LootSimpleEventsHandler); - if self.db.lootRoll then + if SV.db.SVOverride.lootRoll then self:RegisterEvent("LOOT_HISTORY_ROLL_CHANGED", LootComplexEventsHandler); self:RegisterEvent("START_LOOT_ROLL", LootComplexEventsHandler); UIParent:UnregisterEvent("START_LOOT_ROLL"); @@ -1124,10 +1123,4 @@ function MOD:Load() NewHook("UIParent_ManageFramePositions", CaptureBarHandler) SV.Mentalo:Add(LossOfControlFrame, L["Loss Control Icon"], nil, nil, nil, nil, "LoC") -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -SVLib:NewPackage(MOD, "SVOverride"); \ No newline at end of file +end \ 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 1787263..b00c06e 100644 --- a/Interface/AddOns/SVUI/packages/plates/SVPlate.lua +++ b/Interface/AddOns/SVUI/packages/plates/SVPlate.lua @@ -49,11 +49,10 @@ local tremove, tcopy, twipe, tsort, tconcat = table.remove, table.copy, table.wi GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() +local SV = select(2, ...) +local L = SV.L local LSM = LibStub("LibSharedMedia-3.0") -local MOD = {}; +local MOD = SV:NewPackage("SVPlate", L["NamePlates"]); --[[ ########################################################## LOCALIZED GLOBALS @@ -1470,7 +1469,7 @@ UPDATE AND BUILD ########################################################## ]]-- function MOD:UpdateLocals() - local db = self.db + local db = SV.db.SVPlate if not db then return end NPClassRole = SV.ClassRole; @@ -1567,7 +1566,7 @@ function MOD:ReLoad() end function MOD:Load() - if self.db.enable ~= true then return end + if SV.db.SVPlate.enable ~= true then return end self:UpdateLocals() self:RegisterEvent("PLAYER_ENTERING_WORLD") self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") @@ -1576,10 +1575,4 @@ function MOD:Load() self:RegisterEvent("UPDATE_MOUSEOVER_UNIT") WorldFrame:HookScript('OnUpdate', WorldFrameUpdateHook) self:CombatToggle(true) -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -SVLib:NewPackage(MOD, "SVPlate") \ No newline at end of file +end \ 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 1ff86b4..5cef80f 100644 --- a/Interface/AddOns/SVUI/packages/stats/SVStats.lua +++ b/Interface/AddOns/SVUI/packages/stats/SVStats.lua @@ -33,12 +33,12 @@ local min = math.min; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() +local SV = select(2, ...) +local L = SV.L local LSM = LibStub("LibSharedMedia-3.0") local LDB = LibStub("LibDataBroker-1.1") -local MOD = {}; +local MOD = SV:NewPackage("SVStats", L["Statistics"]); + MOD.Anchors = {}; MOD.Statistics = {}; MOD.StatListing = {[""] = "None"}; @@ -683,7 +683,7 @@ function MOD:Load() local hexClass = classColor.colorStr BGStatString = "|cff" .. hexHighlight .. "%s: |c" .. hexClass .. "%s|r"; - self.Accountant = SVLib:NewGlobal("Accountant") + self.Accountant = LibSuperVillain:NewGlobal("Accountant") self.Accountant = self.Accountant or {}; self.Accountant[playerRealm] = self.Accountant[playerRealm] or {}; @@ -706,18 +706,8 @@ function MOD:Load() self.tooltip:SetFrameStrata("DIALOG") self.tooltip:HookScript("OnShow", _hook_TooltipOnShow) - if(GetCVar("scriptProfile") == "1") then - self.DebugList = SVLib:GetModuletable() - end - self:Generate() self:RegisterEvent("PLAYER_ENTERING_WORLD", "Generate") myName = UnitName("player"); -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -SVLib:NewPackage(MOD, "SVStats", true) \ No newline at end of file +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/bags.lua b/Interface/AddOns/SVUI/packages/stats/stats/bags.lua index 3d000ef..0d79b1f 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/bags.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/bags.lua @@ -49,9 +49,8 @@ local twipe, tsort = table.wipe, table.sort; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() +local SV = select(2, ...) +local L = SV.L local MOD = SV.SVStats; --[[ ########################################################## @@ -100,5 +99,5 @@ local BagsColorUpdate = function() end end -SVLib:NewCallback(BagsColorUpdate) +SV:NewCallback(BagsColorUpdate) MOD:Extend("Bags", StatEvents, bags_events, nil, bags_click, bags_focus); \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/cta.lua b/Interface/AddOns/SVUI/packages/stats/stats/cta.lua index 65f045e..3a195b1 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/cta.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/cta.lua @@ -49,9 +49,8 @@ local twipe, tsort = table.wipe, table.sort; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() +local SV = select(2, ...) +local L = SV.L local MOD = SV.SVStats; --[[ ########################################################## @@ -156,6 +155,6 @@ local CTAColorUpdate = function() CTA_OnEvent(currentObject) end end -SVLib:NewCallback(CTAColorUpdate) +SV:NewCallback(CTAColorUpdate) MOD:Extend('Call to Arms', StatEvents, CTA_OnEvent, nil, CTA_OnClick, CTA_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/dps.lua b/Interface/AddOns/SVUI/packages/stats/stats/dps.lua index eeb4aa0..bee4c11 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/dps.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/dps.lua @@ -31,9 +31,8 @@ local match, sub, join = string.match, string.sub, string.join; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() +local SV = select(2, ...) +local L = SV.L local MOD = SV.SVStats; --[[ ########################################################## @@ -125,5 +124,5 @@ local DPSColorUpdate = function() end end -SVLib:NewCallback(DPSColorUpdate) +SV:NewCallback(DPSColorUpdate) MOD:Extend('DPS', StatEvents, DPS_OnEvent, nil, DPS_OnClick, DPS_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/durability.lua b/Interface/AddOns/SVUI/packages/stats/stats/durability.lua index 9e6401b..d2c817f 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/durability.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/durability.lua @@ -49,9 +49,8 @@ local twipe, tsort = table.wipe, table.sort; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() +local SV = select(2, ...) +local L = SV.L local LSM = LibStub("LibSharedMedia-3.0") local MOD = SV.SVStats; --[[ @@ -145,7 +144,7 @@ local DurColorUpdate = function() Durability_OnEvent(currentObject) end end -SVLib:NewCallback(DurColorUpdate) +SV:NewCallback(DurColorUpdate) MOD:Extend("Durability", StatEvents, Durability_OnEvent, nil, Durability_OnClick, Durability_OnEnter) MOD:Extend("Durability Bar", StatEvents, DurabilityBar_OnEvent, nil, Durability_OnClick, Durability_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/experience.lua b/Interface/AddOns/SVUI/packages/stats/stats/experience.lua index b0bc7f3..76746e1 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/experience.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/experience.lua @@ -32,8 +32,8 @@ local gsub = string.gsub; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibSuperVillain:Lang(); +local SV = select(2, ...) +local L = SV.L; local LSM = LibStub("LibSharedMedia-3.0") local MOD = SV.SVStats; --[[ diff --git a/Interface/AddOns/SVUI/packages/stats/stats/friends.lua b/Interface/AddOns/SVUI/packages/stats/stats/friends.lua index b4372bd..b0fc852 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/friends.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/friends.lua @@ -49,9 +49,8 @@ local twipe, tsort = table.wipe, table.sort; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() +local SV = select(2, ...) +local L = SV.L local MOD = SV.SVStats; --[[ ########################################################## @@ -381,6 +380,6 @@ local FriendsColorUpdate = function() end end -SVLib:NewCallback(FriendsColorUpdate) +SV:NewCallback(FriendsColorUpdate) MOD:Extend('Friends', StatEvents, OnEvent, nil, Click, OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/gold.lua b/Interface/AddOns/SVUI/packages/stats/stats/gold.lua index 28d931d..1a59fcf 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/gold.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/gold.lua @@ -49,8 +49,8 @@ local twipe, tsort = table.wipe, table.sort; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibSuperVillain:Lang(); +local SV = select(2, ...) +local L = SV.L; local MOD = SV.SVStats; --[[ ########################################################## diff --git a/Interface/AddOns/SVUI/packages/stats/stats/guild.lua b/Interface/AddOns/SVUI/packages/stats/stats/guild.lua index 4c0573b..8990323 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/guild.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/guild.lua @@ -36,9 +36,8 @@ local twipe, tsort = table.wipe, table.sort; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() +local SV = select(2, ...) +local L = SV.L local MOD = SV.SVStats; --[[ ########################################################## @@ -306,6 +305,6 @@ local GuildColorUpdate = function() Guild_OnEvent(currentObject, 'SVUI_COLOR_UPDATE') end end -SVLib:NewCallback(GuildColorUpdate) +SV:NewCallback(GuildColorUpdate) MOD:Extend('Guild', StatEvents, Guild_OnEvent, nil, Guild_OnClick, Guild_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/hps.lua b/Interface/AddOns/SVUI/packages/stats/stats/hps.lua index 7389d6e..1375031 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/hps.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/hps.lua @@ -32,9 +32,8 @@ local max = math.max; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() +local SV = select(2, ...) +local L = SV.L local MOD = SV.SVStats; --[[ ########################################################## @@ -132,5 +131,5 @@ local HPSColorUpdate = function() end end -SVLib:NewCallback(HPSColorUpdate) +SV:NewCallback(HPSColorUpdate) MOD:Extend('HPS', StatEvents, HPS_OnEvent, nil, HPS_OnClick, HPS_OnEnter) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/reputation.lua b/Interface/AddOns/SVUI/packages/stats/stats/reputation.lua index 934db63..86a7c8d 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/reputation.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/reputation.lua @@ -33,8 +33,8 @@ local format, gsub = string.format, string.gsub; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibSuperVillain:Lang(); +local SV = select(2, ...) +local L = SV.L; local MOD = SV.SVStats; --[[ ########################################################## diff --git a/Interface/AddOns/SVUI/packages/stats/stats/system.lua b/Interface/AddOns/SVUI/packages/stats/stats/system.lua index e7ecd28..83586c7 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/system.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/system.lua @@ -37,9 +37,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang(); +local SV = select(2, ...) +local L = SV.L; local MOD = SV.SVStats; --[[ ########################################################## diff --git a/Interface/AddOns/SVUI/packages/stats/stats/time.lua b/Interface/AddOns/SVUI/packages/stats/stats/time.lua index fee8ae4..39755a5 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/time.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/time.lua @@ -35,9 +35,8 @@ local floor = math.floor; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() +local SV = select(2, ...) +local L = SV.L local MOD = SV.SVStats; --[[ ########################################################## @@ -233,6 +232,6 @@ local ColorUpdate = function() end end -SVLib:NewCallback(ColorUpdate) +SV:NewCallback(ColorUpdate) MOD:Extend('Time', {"UPDATE_INSTANCE_INFO"}, OnEvent, Update, Click, OnEnter, OnLeave) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/packages/stats/stats/tokens.lua b/Interface/AddOns/SVUI/packages/stats/stats/tokens.lua index e3e34fe..17ded7f 100644 --- a/Interface/AddOns/SVUI/packages/stats/stats/tokens.lua +++ b/Interface/AddOns/SVUI/packages/stats/stats/tokens.lua @@ -31,8 +31,8 @@ local twipe = table.wipe; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibSuperVillain:Lang(); +local SV = select(2, ...) +local L = SV.L; local MOD = SV.SVStats; --[[ ########################################################## diff --git a/Interface/AddOns/SVUI/packages/tip/SVTip.lua b/Interface/AddOns/SVUI/packages/tip/SVTip.lua index 451a544..6a92e5f 100644 --- a/Interface/AddOns/SVUI/packages/tip/SVTip.lua +++ b/Interface/AddOns/SVUI/packages/tip/SVTip.lua @@ -36,11 +36,10 @@ local twipe, tconcat = table.wipe, table.concat; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() +local SV = select(2, ...) +local L = SV.L local LSM = LibStub("LibSharedMedia-3.0") -local MOD = {}; +local MOD = SV:NewPackage("SVTip", L["Tooltip"]); --[[ ########################################################## LOCAL VARIABLES @@ -908,10 +907,4 @@ function MOD:Load() GameTooltip:HookScript("OnTooltipSetUnit", _hook_GameTooltip_OnTooltipSetUnit) GameTooltipStatusBar:HookScript("OnValueChanged", _hook_GameTooltipStatusBar_OnValueChanged) self:RegisterEvent("MODIFIER_STATE_CHANGED", TooltipModifierChangeHandler) -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -SVLib:NewPackage(MOD, "SVTip", true) \ No newline at end of file +end \ 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 a02bfc4..4b04436 100644 --- a/Interface/AddOns/SVUI/packages/unit/SVUnit.lua +++ b/Interface/AddOns/SVUI/packages/unit/SVUnit.lua @@ -52,20 +52,19 @@ local NewHook = hooksecurefunc; GET ADDON DATA AND TEST FOR oUF ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF assert(oUF_Villain, "SVUI was unable to locate oUF.") -local SVLib = LibSuperVillain; -local L = SVLib:Lang(); +local L = SV.L; local LSM = LibStub("LibSharedMedia-3.0"); --[[ ########################################################## MODULE AND INNER CLASSES ########################################################## ]]-- -local MOD = {} +local MOD = SV:NewPackage("SVUnit", L["UnitFrames"]) MOD.Units = {} MOD.Headers = {} @@ -1497,10 +1496,4 @@ function MOD:Load() rDebuffs.ShowDispelableDebuff = true; rDebuffs.FilterDispellableDebuff = true; rDebuffs.MatchBySpellName = true; -end ---[[ -########################################################## -DEFINE CONFIG AND REGISTER -########################################################## -]]-- -SVLib:NewPackage(MOD, "SVUnit", true) \ No newline at end of file +end \ 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 8d3365f..3d0fc2e 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/auras.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/auras.lua @@ -53,14 +53,15 @@ local tremove = table.remove; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF assert(oUF_Villain, "SVUI was unable to locate oUF."); -local L = LibSuperVillain:Lang(); +local L = SV.L; local LSM = LibStub("LibSharedMedia-3.0") local MOD = SV.SVUnit + if(not MOD) then return end local CustomAuraFilter,CustomBarFilter; @@ -297,7 +298,7 @@ do end CustomAuraFilter = function(self, unit, icon, name, _, _, _, debuffType, duration, _, caster, isStealable, shouldConsolidate, spellID, canApplyAura, isBossAura) - local db = SV.db.SVUnit[self.unitKey] + local db = SV.db.SVUnit[self.___key] local auraType = self.type; if(not auraType) then return true end if((not db) or (db and not db[auraType]) or (spellID == 65148)) then @@ -361,8 +362,10 @@ do filtered = false end pass = true - end + end + local active = auraDB.useFilter + if active and active ~= "" and SV.db.filter[active] then local spellDB = SV.db.filter[active]; if active ~= "Blocked" then @@ -383,8 +386,7 @@ do end CustomBarFilter = function(self, unit, name, _, _, _, debuffType, duration, _, caster, isStealable, shouldConsolidate, spellID) - local key = self.___key - local db = SV.db.SVUnit[key] + local db = SV.db.SVUnit[self.___key] if((not db) or (db and not db.aurabar) or (spellID == 65148)) then return false; end @@ -457,7 +459,7 @@ BUILD FUNCTION ]]-- function MOD:CreateBuffs(frame, unit) local aura = CreateFrame("Frame", nil, frame) - aura.unitKey = unit + aura.___key = unit aura.spacing = 2; aura.PostCreateIcon = PostCreateAuraIcon; aura.PostUpdateIcon = PostUpdateAuraIcon; @@ -472,7 +474,7 @@ end function MOD:CreateDebuffs(frame, unit) local aura = CreateFrame("Frame", nil, frame) - aura.unitKey = unit + aura.___key = unit aura.spacing = 2; aura.PostCreateIcon = PostCreateAuraIcon; aura.PostUpdateIcon = PostUpdateAuraIcon; @@ -565,7 +567,6 @@ end UPDATE ########################################################## ]]-- -local WATCH_CACHE = {} function MOD:UpdateAuraWatch(frame, key, override) local AW = frame.AuraWatch if not SV.db.SVUnit[key] then return end @@ -579,13 +580,14 @@ function MOD:UpdateAuraWatch(frame, key, override) AW:Show() end - local bwSize = db.size; + local WATCH_CACHE if key == "pet" and not override then local petBW = SV.db.filter["PetBuffWatch"] if(petBW) then + WATCH_CACHE = {} for _, buff in pairs(petBW)do - if buff.style == "text" then + if(buff.style == "text") then buff.style = "NONE" end tinsert(WATCH_CACHE, buff) @@ -594,149 +596,153 @@ function MOD:UpdateAuraWatch(frame, key, override) else local unitBW = SV.db.filter["BuffWatch"] if(unitBW) then + WATCH_CACHE = {} for _, buff in pairs(unitBW)do - if buff.style == "text" then + if(buff.style == "text") then buff.style = "NONE" end tinsert(WATCH_CACHE, buff) end end - end - - if AW.icons then - for i = 1, #AW.icons do - local iconTest = false; - for j = 1, #WATCH_CACHE do - if #WATCH_CACHE[j].id and #WATCH_CACHE[j].id == AW.icons[i] then - iconTest = true; - break + end + + if WATCH_CACHE then + local fontFile = LSM:Fetch("font", SV.db.SVUnit.auraFont) + local fontSize = SV.db.SVUnit.auraFontSize + local fontOutline = SV.db.SVUnit.auraFontOutline + + if AW.icons then + for i = 1, #AW.icons do + local iconTest = false; + for j = 1, #WATCH_CACHE do + if(#WATCH_CACHE[j].id and #WATCH_CACHE[j].id == AW.icons[i]) then + iconTest = true; + break + end + end + if not iconTest then + AW.icons[i]:Hide() + AW.icons[i] = nil end end - if not iconTest then - AW.icons[i]:Hide() - AW.icons[i] = nil - end - end - end + end - local fontFile = LSM:Fetch("font", SV.db.SVUnit.auraFont) - local fontSize = SV.db.SVUnit.auraFontSize - local fontOutline = SV.db.SVUnit.auraFontOutline - - for i = 1, #WATCH_CACHE do - if WATCH_CACHE[i].id then - local buffName, _, buffTexture = GetSpellInfo(WATCH_CACHE[i].id) - if buffName then - local watchedAura; - if not AW.icons[WATCH_CACHE[i].id]then - watchedAura = CreateFrame("Frame", nil, AW) - else - watchedAura = AW.icons[WATCH_CACHE[i].id] - end - watchedAura.name = buffName; - watchedAura.image = buffTexture; - watchedAura.spellID = WATCH_CACHE[i].id; - watchedAura.anyUnit = WATCH_CACHE[i].anyUnit; - watchedAura.style = WATCH_CACHE[i].style; - watchedAura.onlyShowMissing = WATCH_CACHE[i].onlyShowMissing; - watchedAura.presentAlpha = watchedAura.onlyShowMissing and 0 or 1; - watchedAura.missingAlpha = watchedAura.onlyShowMissing and 1 or 0; - watchedAura.textThreshold = WATCH_CACHE[i].textThreshold or -1; - watchedAura.displayText = WATCH_CACHE[i].displayText; - 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") - watchedAura.icon:SetAllPoints(watchedAura) - end - if not watchedAura.text then - local awText = CreateFrame("Frame", nil, watchedAura) - awText:SetFrameLevel(watchedAura:GetFrameLevel() + 50) - watchedAura.text = awText:CreateFontString(nil, "BORDER") - end - if not watchedAura.border then - watchedAura.border = watchedAura:CreateTexture(nil, "BACKGROUND") - watchedAura.border:Point("TOPLEFT", -1, 1) - watchedAura.border:Point("BOTTOMRIGHT", 1, -1) - watchedAura.border:SetTexture([[Interface\BUTTONS\WHITE8X8]]) - watchedAura.border:SetVertexColor(0, 0, 0) - end - if not watchedAura.cd then - watchedAura.cd = CreateFrame("Cooldown", nil, watchedAura) - watchedAura.cd:SetAllPoints(watchedAura) - watchedAura.cd:SetReverse(true) - watchedAura.cd:SetFrameLevel(watchedAura:GetFrameLevel()) - end - if watchedAura.style == "coloredIcon"then - watchedAura.icon:SetTexture([[Interface\BUTTONS\WHITE8X8]]) - if WATCH_CACHE[i]["color"]then - watchedAura.icon:SetVertexColor(WATCH_CACHE[i]["color"].r, WATCH_CACHE[i]["color"].g, WATCH_CACHE[i]["color"].b) + for i = 1, #WATCH_CACHE do + if WATCH_CACHE[i].id then + local buffName, _, buffTexture = GetSpellInfo(WATCH_CACHE[i].id) + if buffName then + local watchedAura; + if not AW.icons[WATCH_CACHE[i].id]then + watchedAura = CreateFrame("Frame", nil, AW) else - watchedAura.icon:SetVertexColor(0.8, 0.8, 0.8) + watchedAura = AW.icons[WATCH_CACHE[i].id] end - watchedAura.icon:Show() - watchedAura.border:Show() - watchedAura.cd:SetAlpha(1) - elseif watchedAura.style == "texturedIcon" then - watchedAura.icon:SetVertexColor(1, 1, 1) - watchedAura.icon:SetTexCoord(.18, .82, .18, .82) - watchedAura.icon:SetTexture(watchedAura.image) - watchedAura.icon:Show() - watchedAura.border:Show() - watchedAura.cd:SetAlpha(1) - else - watchedAura.border:Hide() - watchedAura.icon:Hide() - watchedAura.cd:SetAlpha(0) - end - if watchedAura.displayText then - watchedAura.text:Show() - local r, g, b = 1, 1, 1; - if WATCH_CACHE[i].textColor then - r, g, b = WATCH_CACHE[i].textColor.r, WATCH_CACHE[i].textColor.g, WATCH_CACHE[i].textColor.b + watchedAura.name = buffName; + watchedAura.image = buffTexture; + watchedAura.spellID = WATCH_CACHE[i].id; + watchedAura.anyUnit = WATCH_CACHE[i].anyUnit; + watchedAura.style = WATCH_CACHE[i].style; + watchedAura.onlyShowMissing = WATCH_CACHE[i].onlyShowMissing; + watchedAura.presentAlpha = watchedAura.onlyShowMissing and 0 or 1; + watchedAura.missingAlpha = watchedAura.onlyShowMissing and 1 or 0; + watchedAura.textThreshold = WATCH_CACHE[i].textThreshold or -1; + watchedAura.displayText = WATCH_CACHE[i].displayText; + watchedAura:Width(db.size) + watchedAura:Height(db.size) + 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") + watchedAura.icon:SetAllPoints(watchedAura) end - watchedAura.text:SetTextColor(r, g, b) - else - watchedAura.text:Hide() - end - if not watchedAura.count then - watchedAura.count = watchedAura:CreateFontString(nil, "OVERLAY") - end - watchedAura.count:ClearAllPoints() - if watchedAura.displayText then - local anchor, relative, x, y = unpack(textCounterOffsets[WATCH_CACHE[i].point]) - watchedAura.count:SetPoint(anchor, watchedAura.text, relative, x, y) - else - watchedAura.count:SetPoint("CENTER", unpack(counterOffsets[WATCH_CACHE[i].point])) - end - - watchedAura.count:SetFont(fontFile, fontSize, fontOutline) - watchedAura.text:SetFont(fontFile, fontSize, fontOutline) - watchedAura.text:ClearAllPoints() - watchedAura.text:SetPoint(WATCH_CACHE[i].point, watchedAura, WATCH_CACHE[i].point) - if WATCH_CACHE[i].enabled then - AW.icons[WATCH_CACHE[i].id] = watchedAura; - if AW.watched then - AW.watched[WATCH_CACHE[i].id] = watchedAura + if not watchedAura.text then + local awText = CreateFrame("Frame", nil, watchedAura) + awText:SetFrameLevel(watchedAura:GetFrameLevel() + 50) + watchedAura.text = awText:CreateFontString(nil, "BORDER") + end + if not watchedAura.border then + watchedAura.border = watchedAura:CreateTexture(nil, "BACKGROUND") + watchedAura.border:Point("TOPLEFT", -1, 1) + watchedAura.border:Point("BOTTOMRIGHT", 1, -1) + watchedAura.border:SetTexture([[Interface\BUTTONS\WHITE8X8]]) + watchedAura.border:SetVertexColor(0, 0, 0) + end + if not watchedAura.cd then + watchedAura.cd = CreateFrame("Cooldown", nil, watchedAura) + watchedAura.cd:SetAllPoints(watchedAura) + watchedAura.cd:SetReverse(true) + watchedAura.cd:SetFrameLevel(watchedAura:GetFrameLevel()) + end + if watchedAura.style == "coloredIcon"then + watchedAura.icon:SetTexture([[Interface\BUTTONS\WHITE8X8]]) + if WATCH_CACHE[i]["color"]then + watchedAura.icon:SetVertexColor(WATCH_CACHE[i]["color"].r, WATCH_CACHE[i]["color"].g, WATCH_CACHE[i]["color"].b) + else + watchedAura.icon:SetVertexColor(0.8, 0.8, 0.8) + end + watchedAura.icon:Show() + watchedAura.border:Show() + watchedAura.cd:SetAlpha(1) + elseif watchedAura.style == "texturedIcon" then + watchedAura.icon:SetVertexColor(1, 1, 1) + watchedAura.icon:SetTexCoord(.18, .82, .18, .82) + watchedAura.icon:SetTexture(watchedAura.image) + watchedAura.icon:Show() + watchedAura.border:Show() + watchedAura.cd:SetAlpha(1) + else + watchedAura.border:Hide() + watchedAura.icon:Hide() + watchedAura.cd:SetAlpha(0) end - else - AW.icons[WATCH_CACHE[i].id] = nil; - if AW.watched then - AW.watched[WATCH_CACHE[i].id] = nil + if watchedAura.displayText then + watchedAura.text:Show() + local r, g, b = 1, 1, 1; + if WATCH_CACHE[i].textColor then + r, g, b = WATCH_CACHE[i].textColor.r, WATCH_CACHE[i].textColor.g, WATCH_CACHE[i].textColor.b + end + watchedAura.text:SetTextColor(r, g, b) + else + watchedAura.text:Hide() + end + if not watchedAura.count then + watchedAura.count = watchedAura:CreateFontString(nil, "OVERLAY") + end + watchedAura.count:ClearAllPoints() + if watchedAura.displayText then + local anchor, relative, x, y = unpack(textCounterOffsets[WATCH_CACHE[i].point]) + watchedAura.count:SetPoint(anchor, watchedAura.text, relative, x, y) + else + watchedAura.count:SetPoint("CENTER", unpack(counterOffsets[WATCH_CACHE[i].point])) + end + + watchedAura.count:SetFont(fontFile, fontSize, fontOutline) + watchedAura.text:SetFont(fontFile, fontSize, fontOutline) + watchedAura.text:ClearAllPoints() + watchedAura.text:SetPoint(WATCH_CACHE[i].point, watchedAura, WATCH_CACHE[i].point) + if WATCH_CACHE[i].enabled then + AW.icons[WATCH_CACHE[i].id] = watchedAura; + if AW.watched then + AW.watched[WATCH_CACHE[i].id] = watchedAura + end + else + AW.icons[WATCH_CACHE[i].id] = nil; + if AW.watched then + AW.watched[WATCH_CACHE[i].id] = nil + end + watchedAura:Hide() + watchedAura = nil end - watchedAura:Hide() - watchedAura = nil end end - end - end + end + + WATCH_CACHE = nil + end if frame.AuraWatch.Update then frame.AuraWatch.Update(frame) end - wipe(WATCH_CACHE) end function MOD:UpdateGroupAuraWatch(header, override) diff --git a/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua b/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua index acfa654..f47c6f4 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/castbar.lua @@ -53,14 +53,14 @@ local parsefloat = math.parsefloat; -- Uncommon GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = assert; + assert(oUF_Villain, "SVUI was unable to locate oUF."); -local L = LibSuperVillain:Lang(); +local L = SV.L; local MOD = SV.SVUnit + if(not MOD) then return end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua b/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua index 15e5dc6..4eb14f4 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/essentials.lua @@ -30,15 +30,15 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = assert; + assert(oUF_Villain, "SVUI was unable to locate oUF."); -local L = LibSuperVillain:Lang(); +local L = SV.L; local LSM = LibStub("LibSharedMedia-3.0") local MOD = SV.SVUnit + if(not MOD) then return end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI/packages/unit/elements/misc.lua b/Interface/AddOns/SVUI/packages/unit/elements/misc.lua index a938728..581fe67 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/misc.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/misc.lua @@ -20,13 +20,14 @@ local assert = assert; --BLIZZARD local _G = _G; -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF assert(oUF_Villain, "SVUI was unable to locate oUF."); -local L = LibSuperVillain:Lang(); +local L = SV.L; local MOD = SV.SVUnit + if(not MOD) then return end --[[ ########################################################## diff --git a/Interface/AddOns/SVUI/packages/unit/elements/tags.lua b/Interface/AddOns/SVUI/packages/unit/elements/tags.lua index a76006d..8737477 100644 --- a/Interface/AddOns/SVUI/packages/unit/elements/tags.lua +++ b/Interface/AddOns/SVUI/packages/unit/elements/tags.lua @@ -31,8 +31,8 @@ local twipe = _G.wipe; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibSuperVillain:Lang(); +local SV = select(2, ...) +local L = SV.L; local oUF_Villain = SV.oUF assert(oUF_Villain, "SVUI was unable to locate oUF.") diff --git a/Interface/AddOns/SVUI/packages/unit/frames.lua b/Interface/AddOns/SVUI/packages/unit/frames.lua index e4d8d7b..7561c1e 100644 --- a/Interface/AddOns/SVUI/packages/unit/frames.lua +++ b/Interface/AddOns/SVUI/packages/unit/frames.lua @@ -47,12 +47,12 @@ local table = table; local tsort = table.sort; local tremove = table.remove; -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibSuperVillain:Lang(); +local L = SV.L; local LSM = LibStub("LibSharedMedia-3.0") local MOD = SV.SVUnit diff --git a/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua b/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua index 55aeda8..29908af 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/deathknight.lua @@ -27,6 +27,7 @@ local error = _G.error; local pcall = _G.pcall; local tostring = _G.tostring; local tonumber = _G.tonumber; +local assert = _G.assert; local math = _G.math; --[[ MATH METHODS ]]-- local random = math.random; @@ -35,13 +36,12 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = assert; + assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibSuperVillain:Lang(); +local L = SV.L; if(SV.class ~= "DEATHKNIGHT") then return end local MOD = SV.SVUnit if(not MOD) then return end diff --git a/Interface/AddOns/SVUI/packages/unit/resources/druid.lua b/Interface/AddOns/SVUI/packages/unit/resources/druid.lua index 8730a52..a51ffbe 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/druid.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/druid.lua @@ -27,6 +27,7 @@ local error = _G.error; local pcall = _G.pcall; local tostring = _G.tostring; local tonumber = _G.tonumber; +local assert = _G.assert; local math = _G.math; --[[ MATH METHODS ]]-- local random,floor = math.random, math.floor; @@ -35,13 +36,12 @@ local random,floor = math.random, math.floor; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = assert; + assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibSuperVillain:Lang(); +local L = SV.L; local LSM = LibStub("LibSharedMedia-3.0") if(SV.class ~= "DRUID") then return end local MOD = SV.SVUnit diff --git a/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua b/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua index a873c14..f35072b 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/hunter.lua @@ -25,13 +25,13 @@ local select = _G.select; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = assert; + +local assert = _G.assert; assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibSuperVillain:Lang(); +local L = SV.L; if(SV.class ~= "HUNTER") then return end local MOD = SV.SVUnit if(not MOD) then return end diff --git a/Interface/AddOns/SVUI/packages/unit/resources/mage.lua b/Interface/AddOns/SVUI/packages/unit/resources/mage.lua index eb696bd..eca1a28 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/mage.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/mage.lua @@ -27,6 +27,7 @@ local error = _G.error; local pcall = _G.pcall; local tostring = _G.tostring; local tonumber = _G.tonumber; +local assert = _G.assert; local math = _G.math; --[[ MATH METHODS ]]-- local random = math.random; @@ -35,13 +36,12 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = assert; + assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibSuperVillain:Lang(); +local L = SV.L; if(SV.class ~= "MAGE") then return end local MOD = SV.SVUnit if(not MOD) then return end diff --git a/Interface/AddOns/SVUI/packages/unit/resources/monk.lua b/Interface/AddOns/SVUI/packages/unit/resources/monk.lua index 6d6f7b0..99c4bf8 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/monk.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/monk.lua @@ -27,6 +27,7 @@ local error = _G.error; local pcall = _G.pcall; local tostring = _G.tostring; local tonumber = _G.tonumber; +local assert = _G.assert; local math = _G.math; --[[ MATH METHODS ]]-- local random = math.random; @@ -35,13 +36,12 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = assert; + assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibSuperVillain:Lang(); +local L = SV.L; if(SV.class ~= "MONK") then return end local MOD = SV.SVUnit if(not MOD) then return end diff --git a/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua b/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua index 1b0fbd8..89f056a 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/paladin.lua @@ -27,6 +27,7 @@ local error = _G.error; local pcall = _G.pcall; local tostring = _G.tostring; local tonumber = _G.tonumber; +local assert = _G.assert; local math = _G.math; --[[ MATH METHODS ]]-- local random = math.random; @@ -35,13 +36,12 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = assert; + assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibSuperVillain:Lang(); +local L = SV.L; if(SV.class ~= "PALADIN") then return end local MOD = SV.SVUnit if(not MOD) then return end diff --git a/Interface/AddOns/SVUI/packages/unit/resources/priest.lua b/Interface/AddOns/SVUI/packages/unit/resources/priest.lua index ca3a44d..cd84430 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/priest.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/priest.lua @@ -27,6 +27,7 @@ local error = _G.error; local pcall = _G.pcall; local tostring = _G.tostring; local tonumber = _G.tonumber; +local assert = _G.assert; local math = _G.math; --[[ MATH METHODS ]]-- local random = math.random; @@ -35,13 +36,12 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = assert; + assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibSuperVillain:Lang(); +local L = SV.L; if(SV.class ~= "PRIEST") then return end local MOD = SV.SVUnit if(not MOD) then return end diff --git a/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua b/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua index 87eee9e..0a9c5f9 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/rogue.lua @@ -27,6 +27,7 @@ local error = _G.error; local pcall = _G.pcall; local tostring = _G.tostring; local tonumber = _G.tonumber; +local assert = _G.assert; local math = _G.math; --[[ MATH METHODS ]]-- local random = math.random; @@ -35,13 +36,12 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = assert; + assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibSuperVillain:Lang(); +local L = SV.L; if(SV.class ~= "ROGUE") then return end local MOD = SV.SVUnit if(not MOD) then return end diff --git a/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua b/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua index d728882..0549aef 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/shaman.lua @@ -27,6 +27,7 @@ local error = _G.error; local pcall = _G.pcall; local tostring = _G.tostring; local tonumber = _G.tonumber; +local assert = _G.assert; local math = _G.math; --[[ MATH METHODS ]]-- local random = math.random; @@ -35,13 +36,12 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = assert; + assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibSuperVillain:Lang(); +local L = SV.L; if(SV.class ~= "SHAMAN") then return end local MOD = SV.SVUnit if(not MOD) then return end diff --git a/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua b/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua index eeed8cd..e02887b 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/warlock.lua @@ -27,6 +27,7 @@ local error = _G.error; local pcall = _G.pcall; local tostring = _G.tostring; local tonumber = _G.tonumber; +local assert = _G.assert; local math = _G.math; --[[ MATH METHODS ]]-- local random = math.random; @@ -35,13 +36,12 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- -local assert = assert; + assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibSuperVillain:Lang(); +local L = SV.L; if(SV.class ~= "WARLOCK") then return end local MOD = SV.SVUnit if(not MOD) then return end diff --git a/Interface/AddOns/SVUI/packages/unit/resources/warrior.lua b/Interface/AddOns/SVUI/packages/unit/resources/warrior.lua index d0e88f6..bf8280d 100644 --- a/Interface/AddOns/SVUI/packages/unit/resources/warrior.lua +++ b/Interface/AddOns/SVUI/packages/unit/resources/warrior.lua @@ -25,12 +25,13 @@ local select = _G.select; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local oUF_Villain = SV.oUF ---[[ MUNGLUNCH's FASTER ASSERT FUNCTION ]]-- + local assert = assert; assert(oUF_Villain, "SVUI was unable to locate oUF.") -local L = LibSuperVillain:Lang(); + +local L = SV.L; if(SV.class ~= "WARRIOR") then return end local MOD = SV.SVUnit if(not MOD) then return end diff --git a/Interface/AddOns/SVUI/scripts/comix.lua b/Interface/AddOns/SVUI/scripts/comix.lua index 9a712b8..c00c9d1 100644 --- a/Interface/AddOns/SVUI/scripts/comix.lua +++ b/Interface/AddOns/SVUI/scripts/comix.lua @@ -28,9 +28,8 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() +local SV = select(2, ...) +local L = SV.L local Comix = CreateFrame("Frame"); --[[ ########################################################## @@ -222,4 +221,5 @@ local function LoadSVComix() Comix:ReadyState(true) SV:ToggleComix() end -SVLib:NewScript(LoadSVComix) \ No newline at end of file + +SV:NewScript(LoadSVComix) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/ego.lua b/Interface/AddOns/SVUI/scripts/ego.lua index d499646..4cbf1b5 100644 --- a/Interface/AddOns/SVUI/scripts/ego.lua +++ b/Interface/AddOns/SVUI/scripts/ego.lua @@ -28,24 +28,11 @@ local random = math.random; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() +local SV = select(2, ...) +local L = SV.L local EgoFrame = CreateFrame("Frame", "EgoFrame", UIParent); ---[[ -########################################################## -LOCAL VARS -########################################################## -]]-- -local animReady = true; -local playerGUID; ---[[ -########################################################## -CORE FUNCTIONS -########################################################## -]]-- local LaunchPopup = function(self, emote) local size = SVUIParent:GetHeight() self.Model:Show() @@ -104,4 +91,4 @@ local function LoadSVEgo() SlashCmdList["SVUI_BADASS"] = BeAwesome; end -SVLib:NewScript(LoadSVEgo) \ No newline at end of file +SV:NewScript(LoadSVEgo) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/misc.lua b/Interface/AddOns/SVUI/scripts/misc.lua index 92d10e8..c51e038 100644 --- a/Interface/AddOns/SVUI/scripts/misc.lua +++ b/Interface/AddOns/SVUI/scripts/misc.lua @@ -31,9 +31,8 @@ local cos, deg, rad, sin = math.cos, math.deg, math.rad, math.sin; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() +local SV = select(2, ...) +local L = SV.L local toonclass = select(2, UnitClass('player')) --[[ ########################################################## @@ -125,7 +124,7 @@ local function LoadStyledChatBubbles() end end -SVLib:NewScript(LoadStyledChatBubbles) +SV:NewScript(LoadStyledChatBubbles) --[[ ########################################################## DRESSUP HELPERS by: Leatrix @@ -285,7 +284,7 @@ local function LoadDressupHelper() CharacterModelFrame:HookScript("OnShow", SetVanityPlacement) end -SVLib:NewScript(LoadDressupHelper) +SV:NewScript(LoadDressupHelper) --[[ ########################################################## RAIDMARKERS @@ -542,7 +541,7 @@ local function CreateTotemBar() SV.Mentalo:Add(TotemBar, frame_name) end -SVLib:NewScript(CreateTotemBar) +SV:NewScript(CreateTotemBar) --[[ ########################################################## THREAT THERMOMETER @@ -653,4 +652,4 @@ local function LoadThreatBar() end end -SVLib:NewScript(LoadThreatBar); \ No newline at end of file +SV:NewScript(LoadThreatBar); \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/mounts.lua b/Interface/AddOns/SVUI/scripts/mounts.lua index 4efd278..423d4b6 100644 --- a/Interface/AddOns/SVUI/scripts/mounts.lua +++ b/Interface/AddOns/SVUI/scripts/mounts.lua @@ -33,11 +33,8 @@ local twipe,band = table.wipe, bit.band; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() --- MountCache.types --- MountCache.names +local SV = select(2, ...) +local L = SV.L --[[ ########################################################## LOCAL VARIABLES @@ -235,7 +232,7 @@ ADDING CHECKBOXES TO JOURNAL ########################################################## ]]-- local function SetMountCheckButtons() - MountCache = SVLib:NewCache("Mounts") + MountCache = LibSuperVillain:NewCache("Mounts") if not MountCache.types then MountCache.types = { ["GROUND"] = false, @@ -447,4 +444,4 @@ end LOADER ########################################################## ]]-- -SVLib:NewScript(SetMountCheckButtons); \ No newline at end of file +SV:NewScript(SetMountCheckButtons); \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/questwatch.lua b/Interface/AddOns/SVUI/scripts/questwatch.lua index e90e764..e4e9627 100644 --- a/Interface/AddOns/SVUI/scripts/questwatch.lua +++ b/Interface/AddOns/SVUI/scripts/questwatch.lua @@ -51,9 +51,8 @@ local tremove, tcopy, twipe, tsort, tconcat = table.remove, table.copy, table.wi GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() +local SV = select(2, ...) +local L = SV.L local QuestDocklet = CreateFrame("Frame", "SVQuestFrameEventListener", UIParent) --[[ ########################################################## @@ -469,4 +468,4 @@ local function CreateQuestDocklet() end end -SVLib:NewScript(CreateQuestDocklet) \ No newline at end of file +SV:NewScript(CreateQuestDocklet) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/raid.lua b/Interface/AddOns/SVUI/scripts/raid.lua index 2377df6..6278c36 100644 --- a/Interface/AddOns/SVUI/scripts/raid.lua +++ b/Interface/AddOns/SVUI/scripts/raid.lua @@ -26,9 +26,8 @@ local pairs = _G.pairs; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() +local SV = select(2, ...) +local L = SV.L --[[ ########################################################## RAID UTILITY By: Elv @@ -260,4 +259,4 @@ local function LoadRaidUtility() end end end -SVLib:NewScript(LoadRaidUtility); \ No newline at end of file +SV:NewScript(LoadRaidUtility); \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/reactions.lua b/Interface/AddOns/SVUI/scripts/reactions.lua index 7548547..aa97378 100644 --- a/Interface/AddOns/SVUI/scripts/reactions.lua +++ b/Interface/AddOns/SVUI/scripts/reactions.lua @@ -32,9 +32,8 @@ local format, gsub = string.format, string.gsub; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() +local SV = select(2, ...) +local L = SV.L --[[ ########################################################## LOCALS (from ShestakUI by:Shestak) @@ -328,4 +327,4 @@ local function LoadReactions() SV:ToggleReactions() end -SVLib:NewScript(LoadReactions) \ No newline at end of file +SV:NewScript(LoadReactions) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/scripts/spellbind.lua b/Interface/AddOns/SVUI/scripts/spellbind.lua index 7f75675..122d625 100644 --- a/Interface/AddOns/SVUI/scripts/spellbind.lua +++ b/Interface/AddOns/SVUI/scripts/spellbind.lua @@ -16,6 +16,7 @@ S U P E R - V I L L A I N - U I By: Munglunch # LOCALIZED LUA FUNCTIONS ########################################################## ]]-- +local SV = select(2, ...) --[[ GLOBALS ]]-- local _G = _G; local unpack = _G.unpack; @@ -455,4 +456,4 @@ local function LoadSpellBinder() SpellBinder:SetScript("OnEvent", SpellBind_OnEvent) end -SVLib:NewScript(LoadSpellBinder) \ No newline at end of file +SV:NewScript(LoadSpellBinder) \ No newline at end of file diff --git a/Interface/AddOns/SVUI/setup/configs.lua b/Interface/AddOns/SVUI/setup/configs.lua index 655ef10..fc10475 100644 --- a/Interface/AddOns/SVUI/setup/configs.lua +++ b/Interface/AddOns/SVUI/setup/configs.lua @@ -16,7 +16,7 @@ S U P E R - V I L L A I N - U I By: Munglunch # GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local playerClass = select(2, UnitClass("player")); @@ -39,676 +39,110 @@ end SV.configs = {} -local BUFFWATCH_BY_CLASS = { - PRIEST = { - {-- Weakened Soul - ["enabled"] = true, - ["id"] = 6788, - ["point"] = "TOPRIGHT", - ["color"] = {["r"] = 1, ["g"] = 0, ["b"] = 0}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Prayer of Mending - ["enabled"] = true, - ["id"] = 41635, - ["point"] = "BOTTOMRIGHT", - ["color"] = {["r"] = 0.2, ["g"] = 0.7, ["b"] = 0.2}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Renew - ["enabled"] = true, - ["id"] = 139, - ["point"] = "BOTTOMLEFT", - ["color"] = {["r"] = 0.4, ["g"] = 0.7, ["b"] = 0.2}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Power Word: Shield - ["enabled"] = true, - ["id"] = 17, - ["point"] = "TOPLEFT", - ["color"] = {["r"] = 0.81, ["g"] = 0.85, ["b"] = 0.1}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Power Word: Shield Power Insight - ["enabled"] = true, - ["id"] = 123258, - ["point"] = "TOPLEFT", - ["color"] = {["r"] = 0.81, ["g"] = 0.85, ["b"] = 0.1}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Power Infusion - ["enabled"] = true, - ["id"] = 10060, - ["point"] = "RIGHT", - ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Guardian Spirit - ["enabled"] = true, - ["id"] = 47788, - ["point"] = "LEFT", - ["color"] = {["r"] = 0.86, ["g"] = 0.44, ["b"] = 0}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Pain Suppression - ["enabled"] = true, - ["id"] = 33206, - ["point"] = "LEFT", - ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - }, - DRUID = { - {-- Rejuvenation - ["enabled"] = true, - ["id"] = 774, - ["point"] = "TOPRIGHT", - ["color"] = {["r"] = 0.8, ["g"] = 0.4, ["b"] = 0.8}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Regrowth - ["enabled"] = true, - ["id"] = 8936, - ["point"] = "BOTTOMLEFT", - ["color"] = {["r"] = 0.2, ["g"] = 0.8, ["b"] = 0.2}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Lifebloom - ["enabled"] = true, - ["id"] = 33763, - ["point"] = "TOPLEFT", - ["color"] = {["r"] = 0.4, ["g"] = 0.8, ["b"] = 0.2}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Wild Growth - ["enabled"] = true, - ["id"] = 48438, - ["point"] = "BOTTOMRIGHT", - ["color"] = {["r"] = 0.8, ["g"] = 0.4, ["b"] = 0}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - }, - PALADIN = { - {-- Beacon of Light - ["enabled"] = true, - ["id"] = 53563, - ["point"] = "TOPRIGHT", - ["color"] = {["r"] = 0.7, ["g"] = 0.3, ["b"] = 0.7}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Hand of Protection - ["enabled"] = true, - ["id"] = 1022, - ["point"] = "BOTTOMRIGHT", - ["color"] = {["r"] = 0.2, ["g"] = 0.2, ["b"] = 1}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Hand of Freedom - ["enabled"] = true, - ["id"] = 1044, - ["point"] = "BOTTOMRIGHT", - ["color"] = {["r"] = 0.89, ["g"] = 0.45, ["b"] = 0}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Hand of Salvation - ["enabled"] = true, - ["id"] = 1038, - ["point"] = "BOTTOMRIGHT", - ["color"] = {["r"] = 0.93, ["g"] = 0.75, ["b"] = 0}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Hand of Sacrifice - ["enabled"] = true, - ["id"] = 6940, - ["point"] = "BOTTOMRIGHT", - ["color"] = {["r"] = 0.89, ["g"] = 0.1, ["b"] = 0.1}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 +SV.configs["general"] = { + ["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, + ["reactionChat"] = false, + ["reactionEmote"] = false, + ["sharingiscaring"] = false, + ["arenadrink"] = true, + ["stupidhat"] = true, +} + +SV.configs["LAYOUT"] = { + mediastyle = "default", + barstyle = "default", + unitstyle = "default", + groupstyle = "default", + aurastyle = "default" +} + +SV.configs["totems"] = { + ["enable"] = true, + ["showBy"] = "VERTICAL", + ["sortDirection"] = "ASCENDING", + ["size"] = 40, + ["spacing"] = 4 +} + +SV.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, + }, + ["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}, }, - {-- Hand of Purity - ["enabled"] = true, - ["id"] = 114039, - ["point"] = "BOTTOMRIGHT", - ["color"] = {["r"] = 0.64, ["g"] = 0.41, ["b"] = 0.72}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Sacred Shield - ["enabled"] = true, - ["id"] = 20925, - ["point"] = "TOPLEFT", - ["color"] = {["r"] = 0.93, ["g"] = 0.75, ["b"] = 0}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Eternal Flame - ["enabled"] = true, - ["id"] = 114163, - ["point"] = "BOTTOMLEFT", - ["color"] = {["r"] = 0.87, ["g"] = 0.7, ["b"] = 0.03}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - }, - SHAMAN = { - {-- Riptide - ["enabled"] = true, - ["id"] = 61295, - ["point"] = "TOPRIGHT", - ["color"] = {["r"] = 0.7, ["g"] = 0.3, ["b"] = 0.7}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Earth Shield - ["enabled"] = true, - ["id"] = 974, - ["point"] = "BOTTOMLEFT", - ["color"] = {["r"] = 0.2, ["g"] = 0.7, ["b"] = 0.2}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Earthliving - ["enabled"] = true, - ["id"] = 51945, - ["point"] = "BOTTOMRIGHT", - ["color"] = {["r"] = 0.7, ["g"] = 0.4, ["b"] = 0.4}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - }, - MONK = { - {--Renewing Mist - ["enabled"] = true, - ["id"] = 119611, - ["point"] = "TOPLEFT", - ["color"] = {["r"] = 0.8, ["g"] = 0.4, ["b"] = 0.8}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Life Cocoon - ["enabled"] = true, - ["id"] = 116849, - ["point"] = "TOPRIGHT", - ["color"] = {["r"] = 0.2, ["g"] = 0.8, ["b"] = 0.2}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Enveloping Mist - ["enabled"] = true, - ["id"] = 132120, - ["point"] = "BOTTOMLEFT", - ["color"] = {["r"] = 0.4, ["g"] = 0.8, ["b"] = 0.2}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Zen Sphere - ["enabled"] = true, - ["id"] = 124081, - ["point"] = "BOTTOMRIGHT", - ["color"] = {["r"] = 0.7, ["g"] = 0.4, ["b"] = 0}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - }, - ROGUE = { - {-- Tricks of the Trade - ["enabled"] = true, - ["id"] = 57934, - ["point"] = "TOPRIGHT", - ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - }, - MAGE = { - {-- Ice Ward - ["enabled"] = true, - ["id"] = 111264, - ["point"] = "TOPLEFT", - ["color"] = {["r"] = 0.2, ["g"] = 0.2, ["b"] = 1}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - }, - WARRIOR = { - {-- Vigilance - ["enabled"] = true, - ["id"] = 114030, - ["point"] = "TOPLEFT", - ["color"] = {["r"] = 0.2, ["g"] = 0.2, ["b"] = 1}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Intervene - ["enabled"] = true, - ["id"] = 3411, - ["point"] = "TOPRIGHT", - ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Safe Guard - ["enabled"] = true, - ["id"] = 114029, - ["point"] = "TOPRIGHT", - ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - }, - DEATHKNIGHT = { - {-- Unholy Frenzy - ["enabled"] = true, - ["id"] = 49016, - ["point"] = "TOPRIGHT", - ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, - ["anyUnit"] = false, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - }, - NONE = {} -} - -local FilterIDs = { - ["Blocked"] = [[36900,36901,36893,114216,97821,36032,132365,8733,57724,25771,57723,36032,58539,26013,6788,71041,41425,55711,8326,23445,24755,25163,80354,95809,95223,124275,124274,124273,117870,123981,15007,113942,89140]], - ["Allowed"] = [[31821,2825,32182,80353,90355,47788,33206,116849,22812,1490,116202,123059,136431,137332,137375,144351,142863,142864,142865,143198]], - ["Strict"] = [[123059,136431,137332,137375,144351,142863,142864,142865,143198]], - ["CC"] = [[47476,91800,91807,91797,108194,115001,33786,2637,339,78675,22570,5211,9005,102359,99,127797,45334,102795,114238,113004,3355,1513,19503,34490,24394,64803,19386,117405,128405,50519,91644,90337,54706,4167,90327,56626,50245,50541,96201,96201,31661,118,55021,122,82691,118271,44572,33395,102051,20066,10326,853,105593,31935,105421,605,64044,8122,9484,15487,114404,88625,113792,87194,2094,1776,6770,1833,51722,1330,408,88611,115197,113953,51514,64695,63685,76780,118905,118345,710,6789,118699,5484,6358,30283,24259,115782,115268,118093,89766,137143,20511,7922,676,105771,107566,132168,107570,118895,18498,116706,117368,115078,122242,119392,119381,120086,116709,123407,140023,25046,20549,107079]], - ["Shield"] = [[17,47515,45243,45438,115610,48797,48792,49039,87256,55233,50461,33206,47788,62618,47585,104773,110913,108359,22812,102342,106922,61336,19263,53480,1966,31224,74001,5277,45182,98007,30823,108271,1022,6940,114039,31821,498,642,86659,31850,118038,55694,97463,12975,114029,871,114030,120954,131523,122783,122278,115213,116849,20594]], - ["Player"] = [[17,47515,45243,45438,45438,115610,110909,12051,12472,80353,12042,32612,110960,108839,111264,108843,48797,48792,49039,87256,49222,55233,50461,49016,51271,96268,33206,47788,62618,47585,6346,10060,114239,119032,27827,104773,110913,108359,113860,113861,113858,88448,22812,102342,106922,61336,117679,102543,102558,102560,16689,132158,106898,1850,106951,29166,52610,69369,112071,124974,19263,53480,51755,54216,34471,3045,3584,131894,90355,90361,31224,74001,5277,45182,51713,114018,2983,121471,11327,108212,57933,79140,13750,98007,30823,108271,16188,2825,79206,16191,8178,58875,108281,108271,16166,114896,1044,1022,1038,6940,114039,31821,498,642,86659,20925,31850,31884,53563,31842,54428,105809,85499,118038,55694,97463,12975,114029,871,114030,18499,1719,23920,114028,46924,3411,107574,120954,131523,122783,122278,115213,116849,125174,116841,20594,59545,20572,26297,68992]], - ["Raid"] = [[116281,116784,116417,116942,116161,117708,118303,118048,118135,117878,117949,116835,116778,116525,122761,122760,122740,123812,123180,123474,122835,123081,122125,121885,121949,117436,118091,117519,122752,123011,116161,123121,119985,119086,119775,122151,138349,137371,136767,137641,137359,137972,136903,136753,137633,137731,133767,133768,136050,138569,134691,137440,137408,137360,135000,143436,143579,147383,146124,144851,144358,144774,147207,144215,143990,144330,143494,142990,143919,143766,143773,146589,143777,143385,143974,145183]] -} - -local FilterOverrides = { - ["45438"] = 5, ["48797"] = 5, ["87256"] = 4, - ["33206"] = 3, ["47585"] = 5, ["22812"] = 2, - ["102342"] = 2, ["19263"] = 5, ["5277"] = 5, - ["1022"] = 5, ["31821"] = 3, ["498"] = 2, - ["642"] = 5, ["86659"] = 4, ["31850"] = 4, - ["118038"] = 5, ["114029"] = 2, ["871"] = 3, - ["120954"] = 2, ["131523"] = 5 + ["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"] = { + [safename(2825)] = {0.98, 0.57, 0.11}, --Bloodlust + [safename(32182)] = {0.98, 0.57, 0.11}, --Heroism + [safename(80353)] = {0.98, 0.57, 0.11}, --Time Warp + [safename(90355)] = {0.98, 0.57, 0.11}, --Ancient Hysteria + [safename(84963)] = {0.98, 0.57, 0.11}, --Inquisition + [safename(86659)] = {0.98, 0.57, 0.11}, --Guardian of Ancient Kings + } + } } ---[[ CACHE DATA ]]-- - -SV.configs = { - ["general"] = { - ["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, - ["reactionChat"] = false, - ["reactionEmote"] = false, - ["sharingiscaring"] = false, - ["arenadrink"] = true, - ["stupidhat"] = true, - }, - ["LAYOUT"] = { - mediastyle = "default", - barstyle = "default", - unitstyle = "default", - groupstyle = "default", - aurastyle = "default" - }, - ["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"] = { - [safename(2825)] = {0.98, 0.57, 0.11}, --Bloodlust - [safename(32182)] = {0.98, 0.57, 0.11}, --Heroism - [safename(80353)] = {0.98, 0.57, 0.11}, --Time Warp - [safename(90355)] = {0.98, 0.57, 0.11}, --Ancient Hysteria - [safename(84963)] = {0.98, 0.57, 0.11}, --Inquisition - [safename(86659)] = {0.98, 0.57, 0.11}, --Guardian of Ancient Kings - } - } - } -} - -local FILTERS = { - ["CC"] = {}, - ["Shield"] = {}, - ["Player"] = {}, - ["Blocked"] = {}, - ["Allowed"] = {}, - ["Strict"] = {}, - ["Raid"] = {}, - ["BuffWatch"] = BUFFWATCH_BY_CLASS[filterClass], - ["PetBuffWatch"] = { - {-- Frenzy - ["enabled"] = true, - ["id"] = 19615, - ["point"] = "TOPLEFT", - ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - {-- Mend Pet - ["enabled"] = true, - ["id"] = 136, - ["point"] = "TOPRIGHT", - ["color"] = {["r"] = 0.2, ["g"] = 0.8, ["b"] = 0.2}, - ["anyUnit"] = true, - ["onlyShowMissing"] = false, - ['style'] = 'coloredIcon', - ['displayText'] = false, - ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, - ['textThreshold'] = -1, - ['xOffset'] = 0, - ['yOffset'] = 0 - }, - } -} - -for k, x in pairs(FilterIDs) do - local src = {}; - for id in x:gmatch("([^,]+)") do - if(id) then - local saved - local n = safename(id); - local p = FilterOverrides[tostring(id)] or 0; - if k == "Strict" then - saved = {['enable'] = true, ['spellID'] = id, ['priority'] = p} - else - saved = {['enable'] = true, ['priority'] = p} - end - src[n] = saved - end - end - FILTERS[k] = src -end - -SV.configs["filter"] = FILTERS - SV.configs["SVBar"] = { ["enable"] = true, ["font"] = "Roboto", @@ -3654,4 +3088,571 @@ SV.configs["SVUnit"] = { ["height"] = 28, }, } -} \ No newline at end of file +} + +--[[ CACHE DATA ]]-- + +local BUFFWATCH_BY_CLASS = { + PRIEST = { + {-- Weakened Soul + ["enabled"] = true, + ["id"] = 6788, + ["point"] = "TOPRIGHT", + ["color"] = {["r"] = 1, ["g"] = 0, ["b"] = 0}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Prayer of Mending + ["enabled"] = true, + ["id"] = 41635, + ["point"] = "BOTTOMRIGHT", + ["color"] = {["r"] = 0.2, ["g"] = 0.7, ["b"] = 0.2}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Renew + ["enabled"] = true, + ["id"] = 139, + ["point"] = "BOTTOMLEFT", + ["color"] = {["r"] = 0.4, ["g"] = 0.7, ["b"] = 0.2}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Power Word: Shield + ["enabled"] = true, + ["id"] = 17, + ["point"] = "TOPLEFT", + ["color"] = {["r"] = 0.81, ["g"] = 0.85, ["b"] = 0.1}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Power Word: Shield Power Insight + ["enabled"] = true, + ["id"] = 123258, + ["point"] = "TOPLEFT", + ["color"] = {["r"] = 0.81, ["g"] = 0.85, ["b"] = 0.1}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Power Infusion + ["enabled"] = true, + ["id"] = 10060, + ["point"] = "RIGHT", + ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Guardian Spirit + ["enabled"] = true, + ["id"] = 47788, + ["point"] = "LEFT", + ["color"] = {["r"] = 0.86, ["g"] = 0.44, ["b"] = 0}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Pain Suppression + ["enabled"] = true, + ["id"] = 33206, + ["point"] = "LEFT", + ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + }, + DRUID = { + {-- Rejuvenation + ["enabled"] = true, + ["id"] = 774, + ["point"] = "TOPRIGHT", + ["color"] = {["r"] = 0.8, ["g"] = 0.4, ["b"] = 0.8}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Regrowth + ["enabled"] = true, + ["id"] = 8936, + ["point"] = "BOTTOMLEFT", + ["color"] = {["r"] = 0.2, ["g"] = 0.8, ["b"] = 0.2}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Lifebloom + ["enabled"] = true, + ["id"] = 33763, + ["point"] = "TOPLEFT", + ["color"] = {["r"] = 0.4, ["g"] = 0.8, ["b"] = 0.2}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Wild Growth + ["enabled"] = true, + ["id"] = 48438, + ["point"] = "BOTTOMRIGHT", + ["color"] = {["r"] = 0.8, ["g"] = 0.4, ["b"] = 0}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + }, + PALADIN = { + {-- Beacon of Light + ["enabled"] = true, + ["id"] = 53563, + ["point"] = "TOPRIGHT", + ["color"] = {["r"] = 0.7, ["g"] = 0.3, ["b"] = 0.7}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Hand of Protection + ["enabled"] = true, + ["id"] = 1022, + ["point"] = "BOTTOMRIGHT", + ["color"] = {["r"] = 0.2, ["g"] = 0.2, ["b"] = 1}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Hand of Freedom + ["enabled"] = true, + ["id"] = 1044, + ["point"] = "BOTTOMRIGHT", + ["color"] = {["r"] = 0.89, ["g"] = 0.45, ["b"] = 0}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Hand of Salvation + ["enabled"] = true, + ["id"] = 1038, + ["point"] = "BOTTOMRIGHT", + ["color"] = {["r"] = 0.93, ["g"] = 0.75, ["b"] = 0}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Hand of Sacrifice + ["enabled"] = true, + ["id"] = 6940, + ["point"] = "BOTTOMRIGHT", + ["color"] = {["r"] = 0.89, ["g"] = 0.1, ["b"] = 0.1}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Hand of Purity + ["enabled"] = true, + ["id"] = 114039, + ["point"] = "BOTTOMRIGHT", + ["color"] = {["r"] = 0.64, ["g"] = 0.41, ["b"] = 0.72}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Sacred Shield + ["enabled"] = true, + ["id"] = 20925, + ["point"] = "TOPLEFT", + ["color"] = {["r"] = 0.93, ["g"] = 0.75, ["b"] = 0}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Eternal Flame + ["enabled"] = true, + ["id"] = 114163, + ["point"] = "BOTTOMLEFT", + ["color"] = {["r"] = 0.87, ["g"] = 0.7, ["b"] = 0.03}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + }, + SHAMAN = { + {-- Riptide + ["enabled"] = true, + ["id"] = 61295, + ["point"] = "TOPRIGHT", + ["color"] = {["r"] = 0.7, ["g"] = 0.3, ["b"] = 0.7}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Earth Shield + ["enabled"] = true, + ["id"] = 974, + ["point"] = "BOTTOMLEFT", + ["color"] = {["r"] = 0.2, ["g"] = 0.7, ["b"] = 0.2}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Earthliving + ["enabled"] = true, + ["id"] = 51945, + ["point"] = "BOTTOMRIGHT", + ["color"] = {["r"] = 0.7, ["g"] = 0.4, ["b"] = 0.4}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + }, + MONK = { + {--Renewing Mist + ["enabled"] = true, + ["id"] = 119611, + ["point"] = "TOPLEFT", + ["color"] = {["r"] = 0.8, ["g"] = 0.4, ["b"] = 0.8}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Life Cocoon + ["enabled"] = true, + ["id"] = 116849, + ["point"] = "TOPRIGHT", + ["color"] = {["r"] = 0.2, ["g"] = 0.8, ["b"] = 0.2}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Enveloping Mist + ["enabled"] = true, + ["id"] = 132120, + ["point"] = "BOTTOMLEFT", + ["color"] = {["r"] = 0.4, ["g"] = 0.8, ["b"] = 0.2}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Zen Sphere + ["enabled"] = true, + ["id"] = 124081, + ["point"] = "BOTTOMRIGHT", + ["color"] = {["r"] = 0.7, ["g"] = 0.4, ["b"] = 0}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + }, + ROGUE = { + {-- Tricks of the Trade + ["enabled"] = true, + ["id"] = 57934, + ["point"] = "TOPRIGHT", + ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + }, + MAGE = { + {-- Ice Ward + ["enabled"] = true, + ["id"] = 111264, + ["point"] = "TOPLEFT", + ["color"] = {["r"] = 0.2, ["g"] = 0.2, ["b"] = 1}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + }, + WARRIOR = { + {-- Vigilance + ["enabled"] = true, + ["id"] = 114030, + ["point"] = "TOPLEFT", + ["color"] = {["r"] = 0.2, ["g"] = 0.2, ["b"] = 1}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Intervene + ["enabled"] = true, + ["id"] = 3411, + ["point"] = "TOPRIGHT", + ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Safe Guard + ["enabled"] = true, + ["id"] = 114029, + ["point"] = "TOPRIGHT", + ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + }, + DEATHKNIGHT = { + {-- Unholy Frenzy + ["enabled"] = true, + ["id"] = 49016, + ["point"] = "TOPRIGHT", + ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, + ["anyUnit"] = false, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + }, + HUNTER = {}, + WARLOCK = {}, + NONE = {} +} + +local FilterIDs = { + ["Blocked"] = [[36900,36901,36893,114216,97821,36032,132365,8733,57724,25771,57723,36032,58539,26013,6788,71041,41425,55711,8326,23445,24755,25163,80354,95809,95223,124275,124274,124273,117870,123981,15007,113942,89140]], + ["Allowed"] = [[31821,2825,32182,80353,90355,47788,33206,116849,22812,1490,116202,123059,136431,137332,137375,144351,142863,142864,142865,143198]], + ["Strict"] = [[123059,136431,137332,137375,144351,142863,142864,142865,143198]], + ["CC"] = [[47476,91800,91807,91797,108194,115001,33786,2637,339,78675,22570,5211,9005,102359,99,127797,45334,102795,114238,113004,3355,1513,19503,34490,24394,64803,19386,117405,128405,50519,91644,90337,54706,4167,90327,56626,50245,50541,96201,96201,31661,118,55021,122,82691,118271,44572,33395,102051,20066,10326,853,105593,31935,105421,605,64044,8122,9484,15487,114404,88625,113792,87194,2094,1776,6770,1833,51722,1330,408,88611,115197,113953,51514,64695,63685,76780,118905,118345,710,6789,118699,5484,6358,30283,24259,115782,115268,118093,89766,137143,20511,7922,676,105771,107566,132168,107570,118895,18498,116706,117368,115078,122242,119392,119381,120086,116709,123407,140023,25046,20549,107079]], + ["Shield"] = [[17,47515,45243,45438,115610,48797,48792,49039,87256,55233,50461,33206,47788,62618,47585,104773,110913,108359,22812,102342,106922,61336,19263,53480,1966,31224,74001,5277,45182,98007,30823,108271,1022,6940,114039,31821,498,642,86659,31850,118038,55694,97463,12975,114029,871,114030,120954,131523,122783,122278,115213,116849,20594]], + ["Player"] = [[17,47515,45243,45438,45438,115610,110909,12051,12472,80353,12042,32612,110960,108839,111264,108843,48797,48792,49039,87256,49222,55233,50461,49016,51271,96268,33206,47788,62618,47585,6346,10060,114239,119032,27827,104773,110913,108359,113860,113861,113858,88448,22812,102342,106922,61336,117679,102543,102558,102560,16689,132158,106898,1850,106951,29166,52610,69369,112071,124974,19263,53480,51755,54216,34471,3045,3584,131894,90355,90361,31224,74001,5277,45182,51713,114018,2983,121471,11327,108212,57933,79140,13750,98007,30823,108271,16188,2825,79206,16191,8178,58875,108281,108271,16166,114896,1044,1022,1038,6940,114039,31821,498,642,86659,20925,31850,31884,53563,31842,54428,105809,85499,118038,55694,97463,12975,114029,871,114030,18499,1719,23920,114028,46924,3411,107574,120954,131523,122783,122278,115213,116849,125174,116841,20594,59545,20572,26297,68992]], + ["Raid"] = [[116281,116784,116417,116942,116161,117708,118303,118048,118135,117878,117949,116835,116778,116525,122761,122760,122740,123812,123180,123474,122835,123081,122125,121885,121949,117436,118091,117519,122752,123011,116161,123121,119985,119086,119775,122151,138349,137371,136767,137641,137359,137972,136903,136753,137633,137731,133767,133768,136050,138569,134691,137440,137408,137360,135000,143436,143579,147383,146124,144851,144358,144774,147207,144215,143990,144330,143494,142990,143919,143766,143773,146589,143777,143385,143974,145183]] +} + +local FilterOverrides = { + ["45438"] = 5, ["48797"] = 5, ["87256"] = 4, + ["33206"] = 3, ["47585"] = 5, ["22812"] = 2, + ["102342"] = 2, ["19263"] = 5, ["5277"] = 5, + ["1022"] = 5, ["31821"] = 3, ["498"] = 2, + ["642"] = 5, ["86659"] = 4, ["31850"] = 4, + ["118038"] = 5, ["114029"] = 2, ["871"] = 3, + ["120954"] = 2, ["131523"] = 5 +} + +SV.configs["filter"] = { + ["CC"] = {}, + ["Shield"] = {}, + ["Player"] = {}, + ["Blocked"] = {}, + ["Allowed"] = {}, + ["Strict"] = {}, + ["Raid"] = {}, + ["BuffWatch"] = BUFFWATCH_BY_CLASS[filterClass], + ["PetBuffWatch"] = { + {-- Frenzy + ["enabled"] = true, + ["id"] = 19615, + ["point"] = "TOPLEFT", + ["color"] = {["r"] = 0.89, ["g"] = 0.09, ["b"] = 0.05}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + {-- Mend Pet + ["enabled"] = true, + ["id"] = 136, + ["point"] = "TOPRIGHT", + ["color"] = {["r"] = 0.2, ["g"] = 0.8, ["b"] = 0.2}, + ["anyUnit"] = true, + ["onlyShowMissing"] = false, + ['style'] = 'coloredIcon', + ['displayText'] = false, + ['textColor'] = {["r"] = 1, ["g"] = 1, ["b"] = 1}, + ['textThreshold'] = -1, + ['xOffset'] = 0, + ['yOffset'] = 0 + }, + } +} + +for k, x in pairs(FilterIDs) do + local src = {}; + for id in x:gmatch("([^,]+)") do + if(id) then + local saved + local n = safename(id); + local p = FilterOverrides[tostring(id)] or 0; + if k == "Strict" then + saved = {['enable'] = true, ['spellID'] = id, ['priority'] = p} + else + saved = {['enable'] = true, ['priority'] = p} + end + src[n] = saved + end + end + SV.configs["filter"][k] = src +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI/setup/installer.lua b/Interface/AddOns/SVUI/setup/installer.lua index a669208..267adcc 100644 --- a/Interface/AddOns/SVUI/setup/installer.lua +++ b/Interface/AddOns/SVUI/setup/installer.lua @@ -30,9 +30,9 @@ local tcopy = table.copy; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local SVLib = LibSuperVillain; -local L = SVLib:Lang(); +local L = SV.L; --[[ ########################################################## LOCAL VARS diff --git a/Interface/AddOns/SVUI/setup/presets.lua b/Interface/AddOns/SVUI/setup/presets.lua index c1b859c..a2d61a8 100644 --- a/Interface/AddOns/SVUI/setup/presets.lua +++ b/Interface/AddOns/SVUI/setup/presets.lua @@ -30,9 +30,9 @@ local tcopy = table.copy; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local SVLib = LibSuperVillain -local L = SVLib:Lang(); +local L = SV.L; --[[ ########################################################## LOCAL VARS diff --git a/Interface/AddOns/SVUI/system/alerts.lua b/Interface/AddOns/SVUI/system/alerts.lua index 143188f..35131c5 100644 --- a/Interface/AddOns/SVUI/system/alerts.lua +++ b/Interface/AddOns/SVUI/system/alerts.lua @@ -41,9 +41,9 @@ local assert = assert; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local SVLib = LibSuperVillain; -local L = SVLib:Lang(); +local L = SV.L; --[[ ########################################################## LOCAL VARS diff --git a/Interface/AddOns/SVUI/system/animate.lua b/Interface/AddOns/SVUI/system/animate.lua index 2ebbf69..5208c28 100644 --- a/Interface/AddOns/SVUI/system/animate.lua +++ b/Interface/AddOns/SVUI/system/animate.lua @@ -25,9 +25,8 @@ local select = _G.select; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() +local SV = select(2, ...) +local L = SV.L --[[ ########################################################## LOCALS diff --git a/Interface/AddOns/SVUI/system/common.lua b/Interface/AddOns/SVUI/system/common.lua index 9417a91..cc63c59 100644 --- a/Interface/AddOns/SVUI/system/common.lua +++ b/Interface/AddOns/SVUI/system/common.lua @@ -42,9 +42,8 @@ local tremove, tcopy, twipe, tsort, tconcat, tdump = table.remove, table.copy, t GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang() +local SV = select(2, ...) +local L = SV.L --[[ ########################################################## LOCAL VARS @@ -342,7 +341,7 @@ function SV:UpdateFontTemplates() FontTemplateUpdates() end -SVLib:NewCallback(FontTemplateUpdates) +SV:NewCallback(FontTemplateUpdates) --[[ ########################################################## APPENDED TEMPLATING METHODS @@ -1562,7 +1561,7 @@ local function FrameTemplateUpdates() end end -SVLib:NewCallback(FrameTemplateUpdates) +SV:NewCallback(FrameTemplateUpdates) --[[ ########################################################## ENUMERATION diff --git a/Interface/AddOns/SVUI/system/load.lua b/Interface/AddOns/SVUI/system/load.lua index a4bd3ec..78e6330 100644 --- a/Interface/AddOns/SVUI/system/load.lua +++ b/Interface/AddOns/SVUI/system/load.lua @@ -35,9 +35,9 @@ local tcopy = table.copy; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local SVLib = LibSuperVillain -local L = SVLib:Lang() +local L = SV.L --[[ ########################################################## LOCALS @@ -254,7 +254,8 @@ local Consuela = CreateFrame("Frame") Consuela:RegisterAllEvents() Consuela:SetScript("OnEvent", function(self, event) LemonPledge = LemonPledge + 1 - if(not InCombatLockdown() and (LemonPledge > 10000)) then + if(InCombatLockdown()) then return end; + if(LemonPledge > 10000) then collectgarbage("collect"); LemonPledge = 0; end diff --git a/Interface/AddOns/SVUI/system/media.lua b/Interface/AddOns/SVUI/system/media.lua index 27114bc..9a620c8 100644 --- a/Interface/AddOns/SVUI/system/media.lua +++ b/Interface/AddOns/SVUI/system/media.lua @@ -37,9 +37,9 @@ local twipe, tsort = table.wipe, table.sort; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... +local SV = select(2, ...) local SVLib = LibSuperVillain -local L = SVLib:Lang() +local L = SV.L local LSM = LibStub("LibSharedMedia-3.0") --[[ ########################################################## diff --git a/Interface/AddOns/SVUI/system/mentalo.lua b/Interface/AddOns/SVUI/system/mentalo.lua index 772e13a..e7c7761 100644 --- a/Interface/AddOns/SVUI/system/mentalo.lua +++ b/Interface/AddOns/SVUI/system/mentalo.lua @@ -33,9 +33,8 @@ local parsefloat = math.parsefloat; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang(); +local SV = select(2, ...) +local L = SV.L; local Mentalo = {} @@ -848,7 +847,7 @@ function Mentalo:Initialize() SVUI_MentaloPrecisionLeftButton:SetButtonTemplate() SVUI_MentaloPrecisionRightButton:SetButtonTemplate() - self.Anchors = SVLib:NewCache("Anchors") + self.Anchors = LibSuperVillain:NewCache("Anchors") for name, _ in pairs(self.Frames)do local parent, text, overlay, snapoffset, postdrag; diff --git a/Interface/AddOns/SVUI/system/moveable.lua b/Interface/AddOns/SVUI/system/moveable.lua index 07a401a..9a32207 100644 --- a/Interface/AddOns/SVUI/system/moveable.lua +++ b/Interface/AddOns/SVUI/system/moveable.lua @@ -33,9 +33,8 @@ local parsefloat = math.parsefloat; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local SVLib = LibSuperVillain -local L = SVLib:Lang(); +local SV = select(2, ...) +local L = SV.L; local Movable = CreateFrame("Frame", nil) local MovableFrames = {} diff --git a/Interface/AddOns/SVUI/system/slash.lua b/Interface/AddOns/SVUI/system/slash.lua index 9955b09..43def94 100644 --- a/Interface/AddOns/SVUI/system/slash.lua +++ b/Interface/AddOns/SVUI/system/slash.lua @@ -13,8 +13,8 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SVUI_ADDON_NAME, SV = ... -local L = LibSuperVillain:Lang(); +local SV = select(2, ...) +local L = SV.L; --[[ ########################################################## LOCAL VARS diff --git a/Interface/AddOns/SVUI/system/timers.lua b/Interface/AddOns/SVUI/system/timers.lua index ab8e44b..88ecd49 100644 --- a/Interface/AddOns/SVUI/system/timers.lua +++ b/Interface/AddOns/SVUI/system/timers.lua @@ -36,8 +36,8 @@ local tremove = table.remove; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibSuperVillain:Lang(); +local SV = select(2, ...) +local L = SV.L; --[[ ########################################################## LOCAL VARS diff --git a/Interface/AddOns/SVUI/system/utilities.lua b/Interface/AddOns/SVUI/system/utilities.lua index c3080ed..40c6df7 100644 --- a/Interface/AddOns/SVUI/system/utilities.lua +++ b/Interface/AddOns/SVUI/system/utilities.lua @@ -37,19 +37,13 @@ local iLevelFilter = ITEM_LEVEL:gsub( "%%d", "(%%d+)" ) GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibSuperVillain:Lang() +local SV = select(2, ...) +local L = SV.L --[[ ########################################################## MISC UTILITY FUNCTIONS ########################################################## ]]-- - ---[[ -########################################################## -DISPEL MECHANICS -########################################################## -]]-- local RefClassRoles, RefUnitRoles; local RefMagicSpec; local PlayerClass = select(2,UnitClass("player")); diff --git a/Interface/AddOns/SVUI/system/visibility.lua b/Interface/AddOns/SVUI/system/visibility.lua index be6b39b..e8b0f91 100644 --- a/Interface/AddOns/SVUI/system/visibility.lua +++ b/Interface/AddOns/SVUI/system/visibility.lua @@ -26,8 +26,8 @@ local pairs = _G.pairs; GET ADDON DATA ########################################################## ]]-- -local SVUI_ADDON_NAME, SV = ... -local L = LibSuperVillain:Lang(); +local SV = select(2, ...) +local L = SV.L; --[[ ########################################################## LOCALS diff --git a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua deleted file mode 100644 index 84dac60..0000000 --- a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.lua +++ /dev/null @@ -1,1001 +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 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 SV = SVUI -local SVLib = LibSuperVillain -local L = SVLib:Lang() -local NewHook = hooksecurefunc; - -PLUGIN = SVLib:NewPrototype(SVUIAddOnName) -local Schema = PLUGIN.Schema; - -_G["WhisperVillain"] = PLUGIN; - -local PlayersName = UnitName("player") - -SV.configs[Schema] = { - ["enable"] = true, - ["autoAnswer"] = false, - ["prefix"] = true -} ---[[ -########################################################## -LOCAL VARS -########################################################## -]]-- -local playerName = UnitName("player"); -local playerRealm = GetRealmName(); - -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 PhoneLines = {}; -local ResponseQueue = {}; - -local ICON_FILE = [[Interface\AddOns\SVUI_AnsweringService\artwork\DOCK-CALL]] -local DEFAULT_GRADIENT = {"VERTICAL", 0.08, 0.08, 0.08, 0.22, 0.22, 0.22} -local GREEN_GRADIENT = {"VERTICAL", 0.08, 0.5, 0, 0.25, 0.9, 0.08} -local YELLOW_GRADIENT = {"VERTICAL", 1, 0.3, 0, 1, 1, 0} ---[[ -########################################################## -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 = PLUGIN.db.prefix == true and "Minion Answering Service" or ""; - print("|cffffcc1a" .. msgFrom .. ":|r", msg) -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 ---[[ -########################################################## -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 - if(PLUGIN.db.prefix == true) then - return ("%s's Answering Service: %s"):format(PlayersName, outbound) - else - return outbound - end - end - - function PLUGIN:TakeAMessage(caller, inbound) - ClearResponses(caller) - local data = PhoneLines[caller]; - 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 - -function PLUGIN:AddCaller(caller) - local state_text = "now on hold."; - local call_answered = false - PhoneLines[caller] = { - Line = 1, - InUse = false, - FirstResponse = true, - Caller = caller, - InBound = "", - OutBound = "", - LastKey = 1, - TimeStamp = 0 - }; - for x = 1, 5, 1 do - local btn = _G["HenchmenPhoneLine"..x]; - if(btn.Text:GetText() ~= caller) then - btn.Text:SetText(caller); - PhoneLines[caller].Line = x - call_answered = true - if self.db.autoAnswer == true then - PhoneLines[caller].InUse = true; - btn:SetPanelColor("green"); - self.Docklet:SetPanelColor("green"); - self.Docklet.stateColor = GREEN_GRADIENT - state_text = "on the line."; - PlaySoundFile("Sound\\interface\\iQuestUpdate.wav") - end - break; - end - end - if(not call_answered) then - ServiceMessage("All lines are busy. New caller ("..caller..") was disconnected.") - else - ServiceMessage("New caller ("..caller..") is "..state_text) - end -end - -function PLUGIN:GetServiceState() - local inUse = false - local onHold = false - for x = 1, 5, 1 do - local btn = _G["HenchmenPhoneLine"..x]; - local caller = btn.Text:GetText() - if(PhoneLines[caller]) then - inUse = true - if(not PhoneLines[caller].InUse) then - onHold = true - end - end - end - - if inUse then - if onHold then - self.Docklet:SetPanelColor("yellow") - self.Docklet.icon:SetGradient(unpack(YELLOW_GRADIENT)) - self.Docklet.stateColor = YELLOW_GRADIENT - else - self.Docklet:SetPanelColor("green") - self.Docklet.icon:SetGradient(unpack(GREEN_GRADIENT)) - self.Docklet.stateColor = GREEN_GRADIENT - end - else - self.Docklet:SetPanelColor("default") - self.Docklet.stateColor = DEFAULT_GRADIENT - end - return inUse,onHold -end - -function PLUGIN:HangUp(caller,ignored) - RemoveCaller(caller) - local inUse,onHold = self:GetServiceState() - - if inUse == false then - self.Window:Hide() - elseif onHold == true then - self.Window:Show() - else - self.Window:Show() - end - - if(ignored) then - ServiceMessage(caller.." is now ignoring you! MwaaHaHa!") - PlaySoundFile("Sound\\interface\\RaidWarning.wav") - end -end ---[[ -########################################################## -EVENTS -########################################################## -]]-- -function PLUGIN:PhoneTimeUpdate() - local timer = 300; - local ttime = GetTime() - if #ResponseQueue > 0 then - for x = 1, #ResponseQueue, 1 do - if ResponseQueue[x] then - if ResponseQueue[x].ETA < ttime then - SendChatMessage(ResponseQueue[x].MSG, "WHISPER", nil, ResponseQueue[x].CID) - tremove(ResponseQueue, x) - end - end - end - end - if ttime > timer then - for x = 1, 5, 1 do - local btn = _G["HenchmenPhoneLine"..x]; - local caller = btn.Text:GetText() - if(PhoneLines[caller]) then - if PhoneLines[caller].TimeStamp < (ttime - timer) then - self:HangUp(caller) - end - end - end - end -end - -function PLUGIN:CHAT_MSG_IGNORED(event, inbound_message, caller, ...) - if(PhoneLines[caller] and PhoneLines[caller].InUse) then - self:HangUp(caller,true) - end -end - -function PLUGIN:CHAT_MSG_WHISPER(event, inbound_message, caller) - if not UnitIsAFK("player") and not UnitIsDND("player") then - if (not PhoneLines[caller]) then - self:AddCaller(caller) - end - self:TakeAMessage(caller, inbound_message) - end -end - -function PLUGIN:CHAT_MSG_BN_WHISPER(event, inbound_message, sender, _, _, _, _, _, _, _, _, _, _, presenceID) - if(not presenceID) then return end - if not UnitIsAFK("player") and not UnitIsDND("player") then - local _, bnToon = BNGetToonInfo(presenceID); - local caller = bnToon or sender; - if (not PhoneLines[caller]) then - self:AddCaller(caller) - end - self:TakeAMessage(caller, inbound_message) - end -end ---[[ -########################################################## -OTHER HANDLERS -########################################################## -]]-- -local AnsweringOnClick = function() - if(not PLUGIN.Window) then return end - if(PLUGIN.Window:IsShown()) then - PLUGIN.Window:Hide() - else - PLUGIN.Window:Show() - end -end - -local PhoneLineClick = function(self, button) - local caller = self.Text:GetText() - if((caller == "Empty Phone Line") or not PhoneLines[caller]) then return; end - 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 - PLUGIN:HangUp(caller) - end - PLUGIN:GetServiceState() -end ---[[ -########################################################## -LOAD AND CONSTRUCT -########################################################## -]]-- -function PLUGIN:Load() - if(not self.db.enable) then return end - - self.db = self.db - - self:RegisterEvent("CHAT_MSG_WHISPER") - self:RegisterEvent("CHAT_MSG_BN_WHISPER") - self:RegisterEvent("CHAT_MSG_IGNORED") - self:RegisterUpdate("PhoneTimeUpdate", 4) - - local buttonsize = SuperDockToolBarLeft.currentSize - - local docklet = CreateFrame("Button", nil, UIParent) - docklet:SetParent(SuperDockToolBarLeft) - docklet:Point("LEFT", SuperDockToolBarLeft, "LEFT", 3, 0) - docklet:Size(buttonsize, buttonsize) - docklet:SetFramedButtonTemplate() - docklet.icon = docklet:CreateTexture(nil, "OVERLAY") - docklet.icon:FillInner(docklet,2,2) - docklet.icon:SetTexture(ICON_FILE) - docklet.stateColor = {"VERTICAL", 0.33, 0.25, 0.13, 0.47, 0.39, 0.27} - docklet.TText = L["Show / Hide Phone Lines"] - docklet:RegisterForClicks("AnyUp") - - SV.SVDock:ActivateDockletButton(docklet, AnsweringOnClick) - - SuperDockToolBarLeft:SetWidth(buttonsize + 4) - - self.Docklet = docklet - - local window = CreateFrame("Frame", nil, UIParent) - window:SetFrameStrata("MEDIUM") - window:SetWidth(128) - window:SetHeight(145) - window:SetScript("OnDragStart", function(this) this:StartMoving() end) - window:SetScript("OnDragStop", function(this) this:StopMovingOrSizing() end) - window:SetPoint("BOTTOMRIGHT", LeftSuperDock, "TOPRIGHT", 0, 6) - window:SetFixedPanelTemplate("Transparent") - window:SetMovable(true) - window:EnableMouse(true) - window:SetClampedToScreen(true) - window:RegisterForDrag("LeftButton") - - local title = window:CreateFontString("HenchmenOperatorText") - title:SetWidth(128) - title:SetHeight(50) - title:SetFontObject(GameFontNormal) - title:SetTextColor(0.5, 0.5, 1, 1) - title:SetJustifyH("CENTER") - title:SetJustifyV("TOP") - title:SetPoint("TOP", window, "TOP", 0, -2) - title:SetText("Henchman Answering Service") - - for x = 1, 5, 1 do - local phLn = CreateFrame("Button", "HenchmenPhoneLine"..x, window) - phLn:SetWidth(124) - phLn:SetHeight(20) - phLn:SetPoint("TOPLEFT", window, "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 - - self.Window = window - self.Window:Hide() - - - local strMsg - if self.db.autoAnswer == true then - strMsg = "The Henchmen Operators Are Screening Your Calls.." - else - strMsg = "The Henchmen Operators Are Standing By.." - end - SV:AddonMessage(strMsg) - - local option = { - order = 2, - type = "toggle", - name = "Auto Answer", - get = function(a) return self.db.autoAnswer end, - set = function(a,b) self.db.autoAnswer = b end - }; - self:AddOption("autoAnswer", option) - - option = { - order = 3, - type = "toggle", - name = "Prefix Messages", - get = function(a) return self.db.prefix end, - set = function(a,b) self.db.prefix = b end - }; - self:AddOption("prefix", option) -end - -SVLib:NewPlugin(PLUGIN) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.toc b/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.toc deleted file mode 100644 index ab2aa07..0000000 --- a/Interface/AddOns/SVUI_AnsweringService/SVUI_AnsweringService.toc +++ /dev/null @@ -1,11 +0,0 @@ -## Interface: 60000 -## Author: Munglunch -## Version: 4.6 -## Title: |cffFF9900SVUI |r|cffFFEF00Answering Service|r -## Notes: Supervillain UI [|cff9911FFAutomatic Whispers|r] -## RequiredDeps: SVUI -## LoadOnDemand: 1 -## X-SVUI-Header: Answering Service -## X-SVUI-Schema: SVAnswer - -SVUI_AnsweringService.lua diff --git a/Interface/AddOns/SVUI_AnsweringService/artwork/DOCK-CALL.blp b/Interface/AddOns/SVUI_AnsweringService/artwork/DOCK-CALL.blp deleted file mode 100644 index de23af0..0000000 Binary files a/Interface/AddOns/SVUI_AnsweringService/artwork/DOCK-CALL.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI_ArtOfWar/Bindings.xml b/Interface/AddOns/SVUI_ArtOfWar/Bindings.xml deleted file mode 100644 index 78f0b62..0000000 --- a/Interface/AddOns/SVUI_ArtOfWar/Bindings.xml +++ /dev/null @@ -1,5 +0,0 @@ -<Bindings> - <Binding name="SVUIAOW_RADIO" category="ADDONS" 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 deleted file mode 100644 index 4301228..0000000 --- a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.lua +++ /dev/null @@ -1,1171 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- - ---[[ CONSTANTS ]]-- - -BINDING_HEADER_SVUIAOW = "Supervillain UI: Art of War"; -BINDING_NAME_SVUIAOW_RADIO = "Call Out Incoming"; - ---[[ 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 SV = SVUI -local SVLib = LibSuperVillain -local L = SVLib:Lang() -local NewHook = hooksecurefunc; - -PLUGIN = SVLib:NewPrototype(SVUIAddOnName) -local Schema = PLUGIN.Schema; - -_G["WarVillain"] = PLUGIN; ---[[ -########################################################## -GLOBAL SLASH FUNCTIONS -########################################################## -]]-- -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 ---[[ -########################################################## -MUNGLUNCH's FAVORITE EMOTE GENERATOR -########################################################## -]]-- -local SpecialEmotes = { - "ROFL", - "CACKLE", - "GIGGLE", - "GRIN", - "SMIRK", - "MOON", - "LICK", - "YAWN", - "FLEX", - "TICKLE", - "TAUNT", - "SHOO", - "PRAY", - "SPIT", - "MOCK", - "GLOAT", - "PITY", - "VIOLIN", - "BYE", -} - -local LowHealthPlayerEmotes = { - "ROFL", - "CACKLE", - "GIGGLE", - "GRIN", - "SMIRK", - "MOON", - "LICK", - "YAWN", - "BITE", - "NOSEPICK" -} - -local LowHealthTargetEmotes = { - "ROFL", - "CACKLE", - "FLEX", - "TICKLE", - "TAUNT", - "SHOO", - "PRAY", - "SPIT", - "MOCK", - "GLOAT", - "PITY", - "VIOLIN", - "BYE", -} - -local KOSEmotes = { - "THREATEN", - "CRACK", - "POINT", - "GRIN", - "SMIRK", - "TAUNT", - "CHICKEN" -} - -local StealthEmotes = { - "CURIOUS", - "EYE", - "GASP", - "GAZE", - "MOCK", - "NOSEPICK", - "PEER", - "POINT", - "READY", - "STARE", - "TAP", -} - - -function SVUIEmote() - local index = random(1,#SpecialEmotes) - DoEmote(SpecialEmotes[index]) -end - -local function LowHealth_PlayerEmote() - local index = random(1,#LowHealthPlayerEmotes) - DoEmote(LowHealthPlayerEmotes[index]) -end - -local function LowHealth_TargetEmote() - local index = random(1,#LowHealthTargetEmotes) - DoEmote(LowHealthTargetEmotes[index]) -end - -local function KOS_Emote() - local index = random(1,#KOSEmotes) - DoEmote(KOSEmotes[index]) -end - -local function Stealth_Emote(name) - local index = random(1,#StealthEmotes) - DoEmote(StealthEmotes[index], name) -end ---[[ -########################################################## -CORE FUNCTIONS -########################################################## -]]-- -SV.configs[Schema] = { - ["enable"] = true -} - -local EnemyCache, AlertedCache = {},{} - -local playerGUID = UnitGUID('player') -local playerFaction = UnitFactionGroup("player") -local classColor = RAID_CLASS_COLORS -local classColors = SVUI_CLASS_COLORS[SV.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 = "" ---[[ ICONS ]]-- -local INFO_ICON = [[Interface\AddOns\SVUI_ArtOfWar\artwork\PVP-INFO]] -local UTILITY_ICON = [[Interface\AddOns\SVUI_ArtOfWar\artwork\PVP-UTILITIES]] -local RADIO_ICON = [[Interface\AddOns\SVUI_ArtOfWar\artwork\PVP-RADIO]] -local SCANNER_ICON = [[Interface\AddOns\SVUI_ArtOfWar\artwork\PVP-SCANNER]] -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 PVP_LOST = [[Interface\WorldMap\Skull_64Red]] -local linkString = "|Hplayer:%s:1|h%s|h" ---[[ BG MAP DATA ]]-- -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 PVP_POI = { --- [401] = { --Alterac Valley (15) --- "Stormpike Aid Station", "Dun Baldar North Bunker", "Dun Baldar South Bunker", --- "Stormpike Graveyard", "Icewing Bunker", "Stonehearth Graveyard", --- "Stonehearth Bunker", "Snowfall Graveyard", "Iceblood Tower", --- "Iceblood Graveyard", "Tower Point", "Frostwolf Graveyard", --- "West Frostwolf Tower", "East Frostwolf Tower", "Frostwolf Relief Hut" --- }, --- [935] = { --Deepwind Gorge (2) --- "Horde Cart", "Alliance Cart" --- }, --- [482] = { --Eye of the Storm (1) --- "Flag" --- }, --- [860] = { --Silvershard Mines (1) --- "Cart" --- }, --- [512] = { --Strand of the Ancients (5) --- "Green Emerald", "Blue Sapphire", "Purple Amethyst", "Red Sun", "Yellow Moon" --- }, --- [540] = { --Isle of Conquest (5) --- "Quarry", "Hangar", "Workshop", "Docks", "Refinery" --- }, --- [856] = { --Temple of Kotmogu (4) --- "Red Orb", "Blue Orb", "Orange Orb", "Purple Orb" --- }, --- [626] = { --Twin Peaks (2) --- "Horde Flag", "Alliance Flag" --- }, --- [443] = { --Warsong Gulch (2) --- "Horde Flag", "Alliance Flag" --- }, --- } - -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, classToken, race, raceToken, sex, name, realm = GetPlayerInfoByGUID(guid) - local colors = classColor[classToken] or fallbackColor - EnemyCache[guid] = { - ["name"] = name, - ["realm"] = realm, - ["class"] = class, - ["race"] = race, - ["sex"] = sex, - ["colors"] = colors, - ["time"] = timestamp - } - PLUGIN:ScannerLog(EnemyCache[guid]) - return EnemyCache[guid]; -end - -local function SaveEnemyScan(guid, timestamp) - local enemy = EnemyCache[guid] - if(not enemy) then enemy = AddEnemyScan(guid, timestamp) end - SVAOW_Cache[guid] = { - ["name"] = enemy.name, - ["realm"] = enemy.realm, - ["class"] = enemy.class, - ["race"] = enemy.race, - ["sex"] = enemy.sex, - ["colors"] = enemy.colors, - ["time"] = enemy.timestamp - } - local msg = ("Killed By: %s"):format(enemy.name); - HeadsUpAlarm(msg, CombatText_StandardScroll, enemy.colors.r, enemy.colors.g, enemy.colors.b, "sticky"); - PLUGIN:UpdateSummary() -end - -local function KilledEnemyHandler(guid) - local enemy = SVAOW_Cache[guid] - if(enemy) then - HeadsUpAlarm(("Killed Mortal Enemy: %s"):format(enemy.name), CombatText_StandardScroll, 0.2, 1, 0.1, "sticky"); - end - enemy = EnemyCache[guid] - if(enemy) then - HeadsUpAlarm(("Killed Enemy: %s"):format(enemy.name), CombatText_StandardScroll, 0.1, 0.8, 0); - end -end - -local function ClearCacheScans() - wipe(EnemyCache) - wipe(AlertedCache) - if(PLUGIN.LOG and PLUGIN.LOG.Output) then PLUGIN.LOG.Output:Clear() end -end - -local function ClearSavedScans() - SVAOW_Cache = {} -end - -local function EnemyAlarm(name, class, colors, kos) - if not name then return end - 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) - elseif(class and colors) then - msg = ("%s Detected"):format(class); - HeadsUpAlarm(msg, CombatText_StandardScroll, colors.r, colors.g, colors.b) - end - AlertedCache[name] = true - end -end - -local function StealthAlarm(spell, name) - local msg = ("%s Detected!"):format(spell); - HeadsUpAlarm(msg, CombatText_StandardScroll, 1, 0.5, 0); - print(("%s has %sed nearby!"):format(name, spell)) - --Stealth_Emote(name) -end - -function PLUGIN:UpdateSummary() - self.Summary: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.Summary:AddMessage(("You Have |cffff5500%s|r Mortal Enemies"):format(amount), 0.8, 0.8, 0.8); -end - -function PLUGIN:ResetLogs() - wipe(EnemyCache) - self.Title:Clear(); - self.Summary:Clear(); - self.LOG.Output:Clear(); - self.Title:AddMessage(("Scanning %s"):format(ACTIVE_ZONE), 1, 1, 0); - self.Switch:Show() - 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.Summary:AddMessage(("You Have |cffff5500%s|r Mortal Enemies"):format(amount), 0.8, 0.8, 0.8) - collectgarbage("collect") -end - -function PLUGIN:PopulateKOS() - self.Title:Clear(); - self.Summary:Clear(); - self.LOG.Output:Clear(); - self.Title:AddMessage(("Scanning %s"):format(ACTIVE_ZONE), 1, 1, 0); - self.Switch:Show() - local stored = SVAOW_Cache; - local amount = 0 - for _,data in pairs(stored) do - if type(data) == "table" and data.name and data.class and data.race then - amount = amount + 1; - local nameLink = linkString:format(data.name, data.name) - local hex = ("%s - %s %s"):format(nameLink, data.race, data.class) - self.LOG.Output:AddMessage(hex, data.colors.r, data.colors.g, data.colors.b); - end - end - self.Summary:AddMessage(("You Have |cffff5500%s|r Mortal Enemies"):format(amount), 0.8, 0.8, 0.8) -end - -function PLUGIN:PopulateScans() - self.COMM.Unavailable:Hide() - self.Title:Clear(); - self.Summary:Clear(); - self.LOG.Output:Clear(); - self.Title:AddMessage(("Scanning %s"):format(ACTIVE_ZONE), 1, 1, 0); - self.Switch:Show() - 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.Summary:AddMessage(("You Have |cffff5500%s|r Mortal Enemies"):format(amount), 0.8, 0.8, 0.8); - for _,data in pairs(EnemyCache) do - if type(data) == "table" and data.name and data.class and data.race then - local nameLink = linkString:format(data.name, data.name) - local hex = ("%s - %s %s"):format(nameLink, data.race, data.class) - self.LOG.Output:AddMessage(hex, data.colors.r, data.colors.g, data.colors.b); - end - end -end - -function PLUGIN:PauseScanner() - if(not self.InPVP) then - self.Title:Clear(); - self.Summary:Clear(); - self.LOG.Output:Clear(); - self.Title:AddMessage("Scanning Paused", 1, 0.1, 0); - self.Summary:AddMessage(ACTIVE_ZONE, 1, 0.75, 0); - self.Switch:Hide() - self.LOG.Output:AddMessage(" ", 1, 1, 1); - self.LOG.Output:AddMessage(" ", 1, 1, 1); - self.LOG.Output:AddMessage("The Enenmy Scanner Will Resume", 0.8, 0.8, 0.8); - self.LOG.Output:AddMessage("When You Leave This BattleGround", 0.8, 0.8, 0.8); - else - self:PopulateScans() - end -end - -function PLUGIN:ScannerLog(enemy) - if(not enemy.name or not enemy.race or not enemy.class) then return end - local nameLink = linkString:format(enemy.name, enemy.name) - local hex = ("%s - %s %s"):format(nameLink, enemy.race, enemy.class) - self.LOG.Output:AddMessage(hex, enemy.colors.r, enemy.colors.g, enemy.colors.b); - EnemyAlarm(enemy.name, enemy.class, enemy.colors) -end - -function PLUGIN:UpdateCommunicator() - if(not self.InPVP) then - local mapID = GetCurrentMapAreaID() - if(mapID) then - local points = PVP_NODES[mapID] - if(points) then - self.COMM.Unavailable:Hide() - 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 - self:UnregisterEvent("UPDATE_BATTLEFIELD_SCORE") - self.Scanning = false - self:PauseScanner() - end - end - elseif(self.InPVP) then - self.COMM.Unavailable:Show() - 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 - self:RegisterEvent("UPDATE_BATTLEFIELD_SCORE") - self.Scanning = true - - self:PopulateScans() - end -end - -function PLUGIN:UpdateZoneStatus() - if PLUGIN.ZoneTimer then return end - local zoneText = GetRealZoneText() or GetZoneText() - if(not zoneText or zoneText == "") then - PLUGIN.ZoneTimer = SV.Timers:ExecuteTimer(PLUGIN.UpdateZoneStatus, 5) - return - end - if(zoneText ~= ACTIVE_ZONE) then - ClearCacheScans() - ACTIVE_ZONE = zoneText - PLUGIN.Title:Clear(); - PLUGIN.Title:AddMessage(("Scanning %s"):format(ACTIVE_ZONE), 1, 1, 0); - end - local zonePvP = GetZonePVPInfo() - if(zonePvP == "sanctuary" or zoneText == "") then - PLUGIN.Scanning = false - else - PLUGIN.Scanning = true - local inInstance, instanceType = IsInInstance() - if(inInstance and ((instanceType == "party") or (instanceType == "raid"))) then - PLUGIN.Scanning = false - elseif (not zonePvP or (zonePvP == "friendly") or (not UnitIsPVP("player"))) then - PLUGIN.Scanning = false - elseif(instanceType == "pvp") then - PLUGIN:PauseScanner() - PLUGIN.Scanning = false - if(not PLUGIN.InPVP) then - PLUGIN:UpdateCommunicator() - end - end - end - PLUGIN.ZoneTimer = nil -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 -end - -local function GetSourceType(guid) - if not guid then return end - local subStr, binStr, bitVal, srcType - subStr = guid:sub(3, 5) - binStr = ("0x%s"):format(subStr) - bitVal = tonumber(binStr) - if(not bitVal) then return end - srcType = band(bitVal, 0x00F) - return srcType -end - -function PLUGIN:COMBAT_LOG_EVENT_UNFILTERED(event, timestamp, event, _, srcGUID, srcName, srcFlags, sourceRaidFlags, dstGUID, dstName, dstFlags, destRaidFlags, _, spellName) - if not srcFlags then return end - local flagParse = band(srcFlags, COMBATLOG_OBJECT_REACTION_HOSTILE) - local flagged = flagParse == COMBATLOG_OBJECT_REACTION_HOSTILE - - if(flagged) then - if(srcGUID and srcName) then - local isHostile = CombatLog_Object_IsA(srcFlags, COMBATLOG_FILTER_HOSTILE_PLAYERS) - local srcType = GetSourceType(srcGUID) - if(srcType and (srcType == 0 or srcType == 8) and isHostile) then - if(event == "SPELL_AURA_APPLIED" and (spellName == L["Stealth"] or spellName == L["Prowl"])) then - StealthAlarm(spellName, srcName) - end - if(dstGUID == playerGUID) then - PLUGIN.HitBy = srcGUID - end - if(not PLUGIN.Scanning) then return end - ParseIncomingLog(timestamp, event, srcGUID, srcName, dstGUID) - 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 and (srcType == 0 or srcType == 8) and isHostile) then - ParseIncomingLog(timestamp, event, dstGUID, dstName, srcGUID) - end - end - end - - if(PLUGIN.Scanning and event == "PARTY_KILL") then - if(srcGUID == playerGUID and dstName) then - KilledEnemyHandler(dstGUID) - end - end -end - -function PLUGIN:EventDistributor(event, ...) - local inInstance, instanceType = IsInInstance() - - if(event == "PLAYER_REGEN_ENABLED") then - self.HitBy = false; - if(instanceType == "pvp") then self.Scanning = false end - else - if(instanceType ~= "pvp") then - if(event == "PLAYER_TARGET_CHANGED") then - if(UnitIsPlayer("target") and UnitIsEnemy("target", "player")) then - local guid = UnitGUID("target") - if(not EnemyCache[guid]) then - local timestamp = time() - AddEnemyScan(guid, timestamp) - end - if(SVAOW_Cache[guid]) then - HeadsUpAlarm("Kill On Sight!", CombatText_StandardScroll, 1, 0, 0, "crit") - --KOS_Emote() - end - end - elseif(event == "PLAYER_DEAD") then - local guid = self.HitBy - if(guid and guid ~= "") then - local stamp = time() - SaveEnemyScan(guid, stamp) - end - end - else - self.Scanning = false - end - end -end - -local onMouseWheel = function(self, delta) - if (delta > 0) then - self:ScrollUp() - elseif (delta < 0) then - self:ScrollDown() - end -end - -local function MakeLogWindow() - local frame = CreateFrame("Frame", nil, UIParent) - - frame:SetFrameStrata("MEDIUM") - frame:SetPoint("TOPLEFT", PLUGIN.Summary, "BOTTOMLEFT",0,0) - frame:SetPoint("BOTTOMRIGHT", SVUI_ArtOfWarDock, "BOTTOMRIGHT",0,0) - frame:SetParent(SVUI_ArtOfWarDock) - - local output = CreateFrame("ScrollingMessageFrame", nil, frame) - output:SetSpacing(4) - output:SetClampedToScreen(false) - output:SetFrameStrata("MEDIUM") - output:SetAllPoints(frame) - output:SetFont(SV.Media.font.system, 11, "OUTLINE") - output:SetJustifyH("CENTER") - output:SetJustifyV("MIDDLE") - output:SetShadowColor(0, 0, 0, 0) - output:SetMaxLines(120) - output:EnableMouseWheel(true) - output:SetHyperlinksEnabled(true) - output:SetScript("OnMouseWheel", onMouseWheel) - output:SetFading(false) - output:SetInsertMode('TOP') - - output:SetScript("OnHyperlinkEnter", function(self, linkData, link, button) - local t = link:explode(":") - local name = t[2] or "" - SVUI_TargetScanButton:SetAttribute("macrotext", ("/tar %s"):format(name)) - SVUI_TargetScanButton:EnableMouse(true) - end) - - frame.Output = output - - PLUGIN.LOG = frame - - _G["SVUI_ArtOfWarTool1"].Window = PLUGIN.LOG -end - -local function MakeCommWindow() - - local frame = CreateFrame("Frame", nil, UIParent) - - frame:SetFrameStrata("MEDIUM") - frame:SetPoint("TOPLEFT", PLUGIN.Summary, "BOTTOMLEFT",0,0) - frame:SetPoint("BOTTOMRIGHT", SVUI_ArtOfWarDock, "BOTTOMRIGHT",0,0) - frame:SetParent(SVUI_ArtOfWarDock) - - local fallback = CreateFrame("Frame", nil, frame) - fallback:SetAllPoints(frame) - - local fbText = fallback:CreateFontString(nil, "OVERLAY") - fbText:SetAllPoints(fallback) - fbText:SetFont(SV.Media.font.roboto, 12, "NONE") - fbText:SetText("Nothing To Broadcast Right Now") - - frame.Unavailable = fallback - - local DOCK_WIDTH = frame:GetWidth(); - local DOCK_HEIGHT = frame:GetHeight(); - local BUTTON_SIZE = (DOCK_HEIGHT * 0.25) - 4; - local sectionWidth = (DOCK_WIDTH / 6) - 2 - local sectionHeight = (DOCK_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, frame) - poi:SetSize((DOCK_WIDTH - 2), sectionHeight) - poi:SetPoint("TOP", frame, "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(SV.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 - - PLUGIN.COMM = frame - - _G["SVUI_ArtOfWarTool2"].Window = PLUGIN.COMM - - PLUGIN.COMM:Hide() -end - -local function MakeUtilityWindow() - local frame = CreateFrame("Frame", nil, UIParent) - - frame:SetFrameStrata("MEDIUM") - frame:SetPoint("TOPLEFT", PLUGIN.Summary, "BOTTOMLEFT",0,0) - frame:SetPoint("BOTTOMRIGHT", SVUI_ArtOfWarDock, "BOTTOMRIGHT",0,0) - frame:SetParent(SVUI_ArtOfWarDock) - - local fbText = frame:CreateFontString(nil, "OVERLAY") - fbText:SetAllPoints(frame) - fbText:SetFont(SV.Media.font.roboto, 12, "NONE") - fbText:SetText("Utilities Coming Soon....") - - PLUGIN.TOOL = frame - - _G["SVUI_ArtOfWarTool3"].Window = PLUGIN.TOOL - - PLUGIN.TOOL:Hide() -end - -local function MakeInfoWindow() - local frame = CreateFrame("Frame", nil, UIParent) - - frame:SetFrameStrata("MEDIUM") - frame:SetPoint("TOPLEFT", PLUGIN.Summary, "BOTTOMLEFT",0,0) - frame:SetPoint("BOTTOMRIGHT", SVUI_ArtOfWarDock, "BOTTOMRIGHT",0,0) - frame:SetParent(SVUI_ArtOfWarDock) - - local DATA_WIDTH = (frame:GetWidth() * 0.5) - 2; - local DATA_HEIGHT = frame:GetHeight() - 2; - - local leftColumn = CreateFrame("Frame", "SVUI_ArtOfWarInfoLeft", frame) - leftColumn:Size(DATA_WIDTH, DATA_HEIGHT) - leftColumn:Point("LEFT", frame, "LEFT", 0, 0) - leftColumn.lockedOpen = true - SV.SVStats:NewAnchor(leftColumn, 3, "ANCHOR_CURSOR", nil, "Transparent", true) - leftColumn:SetFrameLevel(0) - - local rightColumn = CreateFrame("Frame", "SVUI_ArtOfWarInfoRight", frame) - rightColumn:Size(DATA_WIDTH, DATA_HEIGHT) - rightColumn:Point("LEFT", leftColumn, "RIGHT", 2, 0) - rightColumn.lockedOpen = true - SV.SVStats:NewAnchor(rightColumn, 3, "ANCHOR_CURSOR", nil, "Transparent", true) - rightColumn:SetFrameLevel(0) - - PLUGIN.INFO = frame - - _G["SVUI_ArtOfWarTool4"].Window = PLUGIN.INFO - - SV.SVStats.BGPanels = { - ["SVUI_ArtOfWarInfoLeft"] = {top = "Honor", middle = "Kills", bottom = "Assists"}, - ["SVUI_ArtOfWarInfoRight"] = {top = "Damage", middle = "Healing", bottom = "Deaths"} - } - - SV.SVStats:Generate() - - PLUGIN.INFO:Hide() -end ---[[ -########################################################## -DOCK ELEMENT HANDLERS -########################################################## -]]-- -local ArtOfWarAlert_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.TText, 1, 1, 0) - GameTooltip:Show() -end - -local ArtOfWarAlert_OnLeave = function(self) - GameTooltip:Hide() - if InCombatLockdown() then return end - self:SetBackdropColor(0.25, 0.52, 0.1) -end - -local ArtOfWarAlert_OnHide = function() - if InCombatLockdown() then - SV:AddonMessage(ERR_NOT_IN_COMBAT); - return; - end - SuperDockAlertRight:Deactivate() -end - -local ArtOfWarAlert_OnShow = function(self) - if InCombatLockdown() then - SV:AddonMessage(ERR_NOT_IN_COMBAT); - self:Hide() - return; - end - SV:SecureFadeIn(self, 0.3, 0, 1) - SuperDockAlertRight:Activate(self) -end - -local ArtOfWarAlert_OnMouseDown = function(self) - -- DO STUFF - SV:SecureFadeOut(self, 0.5, 1, 0, true) -end - -local ArtOfWarTool_OnEnter = function(self) - if InCombatLockdown() then return; end - self.icon:SetGradient(unpack(SV.Media.gradient.yellow)) - GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) - GameTooltip:ClearLines() - GameTooltip:AddLine(self.TText, 1, 1, 1) - GameTooltip:Show() -end - -local ArtOfWarTool_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 ArtOfWarTool_OnMouseDown = function(self) - SV:SecureFadeOut(PLUGIN.LOG, 0.5, 1, 0, true) - SV:SecureFadeOut(PLUGIN.COMM, 0.5, 1, 0, true) - SV:SecureFadeOut(PLUGIN.TOOL, 0.5, 1, 0, true) - SV:SecureFadeOut(PLUGIN.INFO, 0.5, 1, 0, true) - SV:SecureFadeIn(self.Window, 0.3, 0, 1) - PLUGIN.Title:Clear(); - PLUGIN.Title:AddMessage(self.TTitle, 1, 1, 0); -end - -local Scanner_OnMouseDown = function(self) - SV:SecureFadeOut(PLUGIN.LOG, 0.5, 1, 0, true) - SV:SecureFadeOut(PLUGIN.COMM, 0.5, 1, 0, true) - SV:SecureFadeOut(PLUGIN.TOOL, 0.5, 1, 0, true) - SV:SecureFadeOut(PLUGIN.INFO, 0.5, 1, 0, true) - SV:SecureFadeIn(self.Window, 0.3, 0, 1) - PLUGIN:PopulateScans() -end - -local Switch_OnEnter = function(self) - GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) - GameTooltip:ClearLines() - if(self.ShowingKOS) then - GameTooltip:AddDoubleLine("Click", "Show Scan List", 0.1, 1, 0.2, 1, 1, 1) - else - GameTooltip:AddDoubleLine("Click", 'Show "Kill On Sight" List', 0.1, 1, 0.2, 1, 1, 1) - end - GameTooltip:AddDoubleLine("[SHIFT] Click", "Clear All Scans", 0.1, 1, 0.2, 1, 1, 1) - GameTooltip:AddDoubleLine("[CTRL] Click", 'Clear All "Kill On Sight"', 0.1, 1, 0.2, 1, 1, 1) - GameTooltip:Show() -end - -local Switch_OnLeave = function(self) - GameTooltip:Hide() -end - -local Switch_OnClick = function(self, button) - Switch_OnLeave(self) - if(IsControlKeyDown()) then - ClearSavedScans() - PLUGIN:ResetLogs() - elseif(IsShiftKeyDown()) then - ClearCacheScans() - else - if(self.ShowingKOS) then - PLUGIN:PopulateScans() - self.ShowingKOS = false - else - PLUGIN:PopulateKOS() - self.ShowingKOS = true - end - end - Switch_OnEnter(self) -end ---[[ -########################################################## -BUILD FUNCTION -########################################################## -]]-- -function PLUGIN:Load() - if(not self.db.enable) then return end - - local ALERT_HEIGHT = 60; - local DOCK_WIDTH = SuperDockWindowRight:GetWidth(); - local DOCK_HEIGHT = SuperDockWindowRight:GetHeight(); - local BUTTON_SIZE = (DOCK_HEIGHT * 0.25) - 4; - - if(not SVAOW_Data) then SVAOW_Data = {} end - if(not SVAOW_Cache) then SVAOW_Cache = {} end - - self.HitBy = false; - self.Scanning = false; - self.InPVP = false - - local holder = CreateFrame("Frame", "SVUI_ArtOfWarDock", SuperDockWindowRight) - holder:SetFrameStrata("BACKGROUND") - holder:SetWidth(DOCK_WIDTH - 4); - holder:SetHeight(DOCK_HEIGHT - 4); - holder:SetPoint("CENTER",SuperDockWindowRight,"CENTER",0,0); - - local toolBar = CreateFrame("Frame", "SVUI_ArtOfWarToolBar", holder) - toolBar:SetWidth(BUTTON_SIZE + 4); - toolBar:SetHeight((BUTTON_SIZE + 4) * 4); - toolBar:SetPoint("BOTTOMLEFT",holder,"BOTTOMLEFT",0,0); - - local tbDivider = toolBar:CreateTexture(nil,"OVERLAY") - tbDivider:SetTexture(0,0,0,0.5) - tbDivider:SetPoint("TOPRIGHT") - tbDivider:SetPoint("BOTTOMRIGHT") - tbDivider:SetWidth(1) - - local tool4 = CreateFrame("Frame", "SVUI_ArtOfWarTool4", toolBar) - tool4:SetPoint("BOTTOM",toolBar,"BOTTOM",0,0) - tool4:SetSize(BUTTON_SIZE,BUTTON_SIZE) - tool4.icon = tool4:CreateTexture(nil, 'OVERLAY') - tool4.icon:SetTexture(INFO_ICON) - tool4.icon:FillInner(tool4) - tool4.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - tool4.TText = "Stats" - tool4.TTitle = "Statistics and Information" - tool4:SetScript('OnEnter', ArtOfWarTool_OnEnter) - tool4:SetScript('OnLeave', ArtOfWarTool_OnLeave) - tool4:SetScript('OnMouseDown', ArtOfWarTool_OnMouseDown) - - local tool3 = CreateFrame("Frame", "SVUI_ArtOfWarTool3", toolBar) - tool3:SetPoint("BOTTOM",tool4,"TOP",0,2) - tool3:SetSize(BUTTON_SIZE,BUTTON_SIZE) - tool3.icon = tool3:CreateTexture(nil, 'OVERLAY') - tool3.icon:SetTexture(UTILITY_ICON) - tool3.icon:FillInner(tool3) - tool3.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - tool3.TText = "Tools" - tool3.TTitle = "Tools and Utilities" - tool3:SetScript('OnEnter', ArtOfWarTool_OnEnter) - tool3:SetScript('OnLeave', ArtOfWarTool_OnLeave) - tool3:SetScript('OnMouseDown', ArtOfWarTool_OnMouseDown) - - local tool2 = CreateFrame("Frame", "SVUI_ArtOfWarTool2", toolBar) - tool2:SetPoint("BOTTOM",tool3,"TOP",0,2) - tool2:SetSize(BUTTON_SIZE,BUTTON_SIZE) - tool2.icon = tool2:CreateTexture(nil, 'OVERLAY') - tool2.icon:SetTexture(RADIO_ICON) - tool2.icon:FillInner(tool2) - tool2.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - tool2.TText = "Radio" - tool2.TTitle = "Radio Communicator" - tool2:SetScript('OnEnter', ArtOfWarTool_OnEnter) - tool2:SetScript('OnLeave', ArtOfWarTool_OnLeave) - tool2:SetScript('OnMouseDown', ArtOfWarTool_OnMouseDown) - - local tool1 = CreateFrame("Frame", "SVUI_ArtOfWarTool1", toolBar) - tool1:SetPoint("BOTTOM",tool2,"TOP",0,2) - tool1:SetSize(BUTTON_SIZE,BUTTON_SIZE) - tool1.icon = tool1:CreateTexture(nil, 'OVERLAY') - tool1.icon:SetTexture(SCANNER_ICON) - tool1.icon:FillInner(tool1) - tool1.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) - tool1.TText = "Scanner" - tool1.TTitle = "Enemy Scanner" - tool1:SetScript('OnEnter', ArtOfWarTool_OnEnter) - tool1:SetScript('OnLeave', ArtOfWarTool_OnLeave) - tool1:SetScript('OnMouseDown', Scanner_OnMouseDown) - - local title = CreateFrame("ScrollingMessageFrame", nil, holder) - title:SetSpacing(4) - title:SetClampedToScreen(false) - title:SetFrameStrata("MEDIUM") - title:SetPoint("TOPLEFT", toolBar, "TOPRIGHT",0,0) - title:SetPoint("BOTTOMRIGHT", holder, "TOPRIGHT",0,-16) - title:SetFontTemplate(SV.Media.font.names, 16, "OUTLINE", "CENTER", "MIDDLE") - title:SetMaxLines(1) - title:EnableMouseWheel(false) - title:SetFading(false) - title:SetInsertMode('TOP') - - local divider1 = title:CreateTexture(nil,"OVERLAY") - divider1:SetTexture(0,0,0,0.5) - divider1:SetPoint("BOTTOMLEFT") - divider1:SetPoint("BOTTOMRIGHT") - divider1:SetHeight(1) - - self.Title = title - - local listbutton = CreateFrame("Button", nil, holder) - listbutton:SetPoint("TOPLEFT", title, "BOTTOMLEFT",0,0) - listbutton:SetPoint("BOTTOMRIGHT", title, "BOTTOMRIGHT",0,-14) - listbutton:SetButtonTemplate(true) - listbutton.ShowingKOS = false - listbutton:SetScript("OnEnter", Switch_OnEnter) - listbutton:SetScript("OnLeave", Switch_OnLeave) - listbutton:SetScript("OnClick", Switch_OnClick) - - self.Switch = listbutton - - local summary = CreateFrame("ScrollingMessageFrame", nil, holder) - summary:SetSpacing(4) - summary:SetClampedToScreen(false) - summary:SetFrameStrata("MEDIUM") - summary:SetPoint("TOPLEFT", title, "BOTTOMLEFT",0,0) - summary:SetPoint("BOTTOMRIGHT", title, "BOTTOMRIGHT",0,-14) - summary:SetFontTemplate(SV.Media.font.system, 12, "OUTLINE", "CENTER", "MIDDLE") - summary:SetMaxLines(1) - summary:EnableMouse(false) - summary:SetFading(false) - summary:SetInsertMode('TOP') - - self.Summary = summary - - local divider2 = summary:CreateTexture(nil,"OVERLAY") - divider2:SetTexture(0,0,0,0.5) - divider2:SetPoint("BOTTOMLEFT") - divider2:SetPoint("BOTTOMRIGHT") - divider2:SetHeight(1) - - MakeLogWindow() - MakeCommWindow() - MakeUtilityWindow() - MakeInfoWindow() - - SV:RegisterDocklet("SVUI_ArtOfWarDock", "Art of War", ICON_FILE) - - holder:Hide() - - self:ResetLogs() - - local targetButton = CreateFrame("Button", "SVUI_TargetScanButton", UIParent, "SecureActionButtonTemplate") - targetButton:SetAllPoints(self.LOG) - targetButton:SetFrameLevel(99) - targetButton:RegisterForClicks("AnyUp") - targetButton:SetAttribute("type1", "macro") - targetButton:SetAttribute("macrotext", "/tar") - targetButton:EnableMouse(false) - targetButton:HookScript("OnClick", function(this) this:EnableMouse(false) end) - - self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") - - self:RegisterEvent("PLAYER_TARGET_CHANGED", "EventDistributor") - self:RegisterEvent("PLAYER_REGEN_ENABLED", "EventDistributor") - self:RegisterEvent("PLAYER_DEAD", "EventDistributor") - - self:RegisterEvent("ZONE_CHANGED", "UpdateZoneStatus") - self:RegisterEvent("ZONE_CHANGED_NEW_AREA", "UpdateZoneStatus") - self:RegisterEvent("UNIT_FACTION", "UpdateZoneStatus") - - self:RegisterEvent("PLAYER_ENTERING_WORLD", "UpdateCommunicator") - self:RegisterEvent("UPDATE_BATTLEFIELD_SCORE", "UpdateCommunicator") - - --SVUI_Player.Health.LowAlertFunc = LowHealth_PlayerEmote - --SVUI_Target.Health.LowAlertFunc = LowHealth_TargetEmote -end - -SVLib:NewPlugin(PLUGIN) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.toc b/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.toc deleted file mode 100644 index 3444963..0000000 --- a/Interface/AddOns/SVUI_ArtOfWar/SVUI_ArtOfWar.toc +++ /dev/null @@ -1,13 +0,0 @@ -## Interface: 60000 -## Author: Munglunch -## Version: 4.6 -## Title: |cffFF9900SVUI |r|cffFFEF00Art of War|r -## Notes: Supervillain UI [|cff9911FFPvP Tools|r]. -## SavedVariables: SVAOW_Data -## SavedVariablesPerCharacter: SVAOW_Cache -## RequiredDeps: SVUI -## LoadOnDemand: 1 -## X-SVUI-Header: Art of War -## X-SVUI-Schema: SVAOW - -SVUI_ArtOfWar.lua diff --git a/Interface/AddOns/SVUI_ArtOfWar/artwork/DOCK-PVP.blp b/Interface/AddOns/SVUI_ArtOfWar/artwork/DOCK-PVP.blp deleted file mode 100644 index a51de9a..0000000 Binary files a/Interface/AddOns/SVUI_ArtOfWar/artwork/DOCK-PVP.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-INCOMING.blp b/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-INCOMING.blp deleted file mode 100644 index f72c045..0000000 Binary files a/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-INCOMING.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-INFO.blp b/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-INFO.blp deleted file mode 100644 index 112e648..0000000 Binary files a/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-INFO.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-RADIO.blp b/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-RADIO.blp deleted file mode 100644 index 8d38764..0000000 Binary files a/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-RADIO.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-SAFE.blp b/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-SAFE.blp deleted file mode 100644 index 4c84f3e..0000000 Binary files a/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-SAFE.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-SCANNER.blp b/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-SCANNER.blp deleted file mode 100644 index 6bcd5d3..0000000 Binary files a/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-SCANNER.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-UTILITIES.blp b/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-UTILITIES.blp deleted file mode 100644 index eef0a56..0000000 Binary files a/Interface/AddOns/SVUI_ArtOfWar/artwork/PVP-UTILITIES.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI_ChatOMatic/License.txt b/Interface/AddOns/SVUI_ChatOMatic/License.txt new file mode 100644 index 0000000..b9a4d8e --- /dev/null +++ b/Interface/AddOns/SVUI_ChatOMatic/License.txt @@ -0,0 +1,34 @@ +############################################################################### +#_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # +# ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # +# __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # +# ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # +# ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # +# _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # +# __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # +# _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# +# ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################### +# S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################### + +SVUI_ChatOMatic License Copyright 2014 http://wowinterface.com + +The contents of this addon, excluding third-party resources, are +copyrighted to their authors with all rights reserved. + +Authors of this addon hereby grant you the following rights: + +1. You may NOT make any modification inside this addon. If you want + to create your own edited version, please create it from outside. + +2. Do not modify the name of this addon, including the addon folders. + +3. This copyright notice shall be included in all copies or substantial + portions of the Software. + +All rights not explicitly addressed in this license are reserved by +the copyright holders. + +You can write Munglunch at Wowinterface.com for reporting abuse / bugs, +or regarding grants allowed for this license. \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ChatOMatic/Loader.lua b/Interface/AddOns/SVUI_ChatOMatic/Loader.lua new file mode 100644 index 0000000..5021d5b --- /dev/null +++ b/Interface/AddOns/SVUI_ChatOMatic/Loader.lua @@ -0,0 +1,32 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +local AddonName, AddonObject = ... + +assert(LibSuperVillain, AddonName .. " requires LibSuperVillain") + +local PLUGIN = LibSuperVillain:NewPlugin(AddonName, AddonObject) + +local Schema = PLUGIN.Schema; +local SV = _G["SVUI"]; + +SV.configs[Schema] = { + ["enable"] = true, + ["autoAnswer"] = false, + ["prefix"] = true +} \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ChatOMatic/SVUI_ChatOMatic.lua b/Interface/AddOns/SVUI_ChatOMatic/SVUI_ChatOMatic.lua new file mode 100644 index 0000000..fd09ef1 --- /dev/null +++ b/Interface/AddOns/SVUI_ChatOMatic/SVUI_ChatOMatic.lua @@ -0,0 +1,987 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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 PLUGIN = select(2, ...) + +local Schema = PLUGIN.Schema; +local PlayersName = UnitName("player") + +local SV = _G["SVUI"]; +--[[ +########################################################## +LOCAL VARS +########################################################## +]]-- +local playerName = UnitName("player"); +local playerRealm = GetRealmName(); + +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 PhoneLines = {}; +local ResponseQueue = {}; + +local ICON_FILE = [[Interface\AddOns\SVUI_ChatOMatic\artwork\DOCK-CALL]] +local DEFAULT_GRADIENT = {"VERTICAL", 0.08, 0.08, 0.08, 0.22, 0.22, 0.22} +local GREEN_GRADIENT = {"VERTICAL", 0.08, 0.5, 0, 0.25, 0.9, 0.08} +local YELLOW_GRADIENT = {"VERTICAL", 1, 0.3, 0, 1, 1, 0} +--[[ +########################################################## +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 = SV.db[Schema].prefix == true and "Minion Answering Service" or ""; + print("|cffffcc1a" .. msgFrom .. ":|r", msg) +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 +--[[ +########################################################## +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 + if(SV.db[Schema].prefix == true) then + return ("%s's Answering Service: %s"):format(PlayersName, outbound) + else + return outbound + end + end + + function PLUGIN:TakeAMessage(caller, inbound) + ClearResponses(caller) + local data = PhoneLines[caller]; + 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 + +function PLUGIN:AddCaller(caller) + local state_text = "now on hold."; + local call_answered = false + PhoneLines[caller] = { + Line = 1, + InUse = false, + FirstResponse = true, + Caller = caller, + InBound = "", + OutBound = "", + LastKey = 1, + TimeStamp = 0 + }; + for x = 1, 5, 1 do + local btn = _G["HenchmenPhoneLine"..x]; + if(btn.Text:GetText() ~= caller) then + btn.Text:SetText(caller); + PhoneLines[caller].Line = x + call_answered = true + if SV.db[Schema].autoAnswer == true then + PhoneLines[caller].InUse = true; + btn:SetPanelColor("green"); + self.Docklet:SetPanelColor("green"); + self.Docklet.stateColor = GREEN_GRADIENT + state_text = "on the line."; + PlaySoundFile("Sound\\interface\\iQuestUpdate.wav") + end + break; + end + end + if(not call_answered) then + ServiceMessage("All lines are busy. New caller ("..caller..") was disconnected.") + else + ServiceMessage("New caller ("..caller..") is "..state_text) + end +end + +function PLUGIN:GetServiceState() + local inUse = false + local onHold = false + for x = 1, 5, 1 do + local btn = _G["HenchmenPhoneLine"..x]; + local caller = btn.Text:GetText() + if(PhoneLines[caller]) then + inUse = true + if(not PhoneLines[caller].InUse) then + onHold = true + end + end + end + + if inUse then + if onHold then + self.Docklet:SetPanelColor("yellow") + self.Docklet.icon:SetGradient(unpack(YELLOW_GRADIENT)) + self.Docklet.stateColor = YELLOW_GRADIENT + else + self.Docklet:SetPanelColor("green") + self.Docklet.icon:SetGradient(unpack(GREEN_GRADIENT)) + self.Docklet.stateColor = GREEN_GRADIENT + end + else + self.Docklet:SetPanelColor("default") + self.Docklet.stateColor = DEFAULT_GRADIENT + end + return inUse,onHold +end + +function PLUGIN:HangUp(caller,ignored) + RemoveCaller(caller) + local inUse,onHold = self:GetServiceState() + + if inUse == false then + self.Window:Hide() + elseif onHold == true then + self.Window:Show() + else + self.Window:Show() + end + + if(ignored) then + ServiceMessage(caller.." is now ignoring you! MwaaHaHa!") + PlaySoundFile("Sound\\interface\\RaidWarning.wav") + end +end +--[[ +########################################################## +EVENTS +########################################################## +]]-- +function PLUGIN:PhoneTimeUpdate() + local timer = 300; + local ttime = GetTime() + if #ResponseQueue > 0 then + for x = 1, #ResponseQueue, 1 do + if ResponseQueue[x] then + if ResponseQueue[x].ETA < ttime then + SendChatMessage(ResponseQueue[x].MSG, "WHISPER", nil, ResponseQueue[x].CID) + tremove(ResponseQueue, x) + end + end + end + end + if ttime > timer then + for x = 1, 5, 1 do + local btn = _G["HenchmenPhoneLine"..x]; + local caller = btn.Text:GetText() + if(PhoneLines[caller]) then + if PhoneLines[caller].TimeStamp < (ttime - timer) then + self:HangUp(caller) + end + end + end + end +end + +function PLUGIN:CHAT_MSG_IGNORED(event, inbound_message, caller, ...) + if(PhoneLines[caller] and PhoneLines[caller].InUse) then + self:HangUp(caller,true) + end +end + +function PLUGIN:CHAT_MSG_WHISPER(event, inbound_message, caller) + if not UnitIsAFK("player") and not UnitIsDND("player") then + if (not PhoneLines[caller]) then + self:AddCaller(caller) + end + self:TakeAMessage(caller, inbound_message) + end +end + +function PLUGIN:CHAT_MSG_BN_WHISPER(event, inbound_message, sender, _, _, _, _, _, _, _, _, _, _, presenceID) + if(not presenceID) then return end + if not UnitIsAFK("player") and not UnitIsDND("player") then + local _, bnToon = BNGetToonInfo(presenceID); + local caller = bnToon or sender; + if (not PhoneLines[caller]) then + self:AddCaller(caller) + end + self:TakeAMessage(caller, inbound_message) + end +end +--[[ +########################################################## +OTHER HANDLERS +########################################################## +]]-- +local AnsweringOnClick = function() + if(not PLUGIN.Window) then return end + if(PLUGIN.Window:IsShown()) then + PLUGIN.Window:Hide() + else + PLUGIN.Window:Show() + end +end + +local PhoneLineClick = function(self, button) + local caller = self.Text:GetText() + if((caller == "Empty Phone Line") or not PhoneLines[caller]) then return; end + 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 + PLUGIN:HangUp(caller) + end + PLUGIN:GetServiceState() +end +--[[ +########################################################## +LOAD AND CONSTRUCT +########################################################## +]]-- +function PLUGIN:Load() + if(not SV.db[Schema].enable) then return end + + SV.db[Schema] = SV.db[Schema] + + self:RegisterEvent("CHAT_MSG_WHISPER") + self:RegisterEvent("CHAT_MSG_BN_WHISPER") + self:RegisterEvent("CHAT_MSG_IGNORED") + self:RegisterUpdate("PhoneTimeUpdate", 4) + + local buttonsize = SuperDockToolBarLeft.currentSize + + local docklet = CreateFrame("Button", nil, UIParent) + docklet:SetParent(SuperDockToolBarLeft) + docklet:Point("LEFT", SuperDockToolBarLeft, "LEFT", 3, 0) + docklet:Size(buttonsize, buttonsize) + docklet:SetFramedButtonTemplate() + docklet.icon = docklet:CreateTexture(nil, "OVERLAY") + docklet.icon:FillInner(docklet,2,2) + docklet.icon:SetTexture(ICON_FILE) + docklet.stateColor = {"VERTICAL", 0.33, 0.25, 0.13, 0.47, 0.39, 0.27} + docklet.TText = L["Show / Hide Phone Lines"] + docklet:RegisterForClicks("AnyUp") + + SV.SVDock:ActivateDockletButton(docklet, AnsweringOnClick) + + SuperDockToolBarLeft:SetWidth(buttonsize + 4) + + self.Docklet = docklet + + local window = CreateFrame("Frame", nil, UIParent) + window:SetFrameStrata("MEDIUM") + window:SetWidth(128) + window:SetHeight(145) + window:SetScript("OnDragStart", function(this) this:StartMoving() end) + window:SetScript("OnDragStop", function(this) this:StopMovingOrSizing() end) + window:SetPoint("BOTTOMRIGHT", LeftSuperDock, "TOPRIGHT", 0, 6) + window:SetFixedPanelTemplate("Transparent") + window:SetMovable(true) + window:EnableMouse(true) + window:SetClampedToScreen(true) + window:RegisterForDrag("LeftButton") + + local title = window:CreateFontString("HenchmenOperatorText") + title:SetWidth(128) + title:SetHeight(50) + title:SetFontObject(GameFontNormal) + title:SetTextColor(0.5, 0.5, 1, 1) + title:SetJustifyH("CENTER") + title:SetJustifyV("TOP") + title:SetPoint("TOP", window, "TOP", 0, -2) + title:SetText("Henchman Answering Service") + + for x = 1, 5, 1 do + local phLn = CreateFrame("Button", "HenchmenPhoneLine"..x, window) + phLn:SetWidth(124) + phLn:SetHeight(20) + phLn:SetPoint("TOPLEFT", window, "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 + + self.Window = window + self.Window:Hide() + + + local strMsg + if SV.db[Schema].autoAnswer == true then + strMsg = "The Henchmen Operators Are Screening Your Calls.." + else + strMsg = "The Henchmen Operators Are Standing By.." + end + SV:AddonMessage(strMsg) + + local option = { + order = 2, + type = "toggle", + name = "Auto Answer", + get = function(a) return SV.db[Schema].autoAnswer end, + set = function(a,b) SV.db[Schema].autoAnswer = b end + }; + self:AddOption("autoAnswer", option) + + option = { + order = 3, + type = "toggle", + name = "Prefix Messages", + get = function(a) return SV.db[Schema].prefix end, + set = function(a,b) SV.db[Schema].prefix = b end + }; + self:AddOption("prefix", option) +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ChatOMatic/SVUI_ChatOMatic.toc b/Interface/AddOns/SVUI_ChatOMatic/SVUI_ChatOMatic.toc new file mode 100644 index 0000000..9eb5673 --- /dev/null +++ b/Interface/AddOns/SVUI_ChatOMatic/SVUI_ChatOMatic.toc @@ -0,0 +1,12 @@ +## Interface: 60000 +## Author: Munglunch +## Version: 4.7 +## Title: |cffFF9900SVUI |r|cffFFEF00Chat-O-Matic|r +## Notes: Supervillain UI [|cff9911FFAuto-Chat Gadgets|r] +## RequiredDeps: SVUI +## LoadOnDemand: 1 +## X-Email: munglunch@gmail.com +## X-SVUI-Header: Chat-O-Matic +## X-SVUI-Schema: ChatOMatic + +SVUI_ChatOMatic.xml diff --git a/Interface/AddOns/SVUI_ChatOMatic/SVUI_ChatOMatic.xml b/Interface/AddOns/SVUI_ChatOMatic/SVUI_ChatOMatic.xml new file mode 100644 index 0000000..24ce5a6 --- /dev/null +++ b/Interface/AddOns/SVUI_ChatOMatic/SVUI_ChatOMatic.xml @@ -0,0 +1,4 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Script file='Loader.lua'/> + <Script file='SVUI_ChatOMatic.lua'/> +</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ChatOMatic/artwork/DOCK-CALL.blp b/Interface/AddOns/SVUI_ChatOMatic/artwork/DOCK-CALL.blp new file mode 100644 index 0000000..de23af0 Binary files /dev/null and b/Interface/AddOns/SVUI_ChatOMatic/artwork/DOCK-CALL.blp differ diff --git a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua index 9e4e64f..a1375b6 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); +local SV = _G["SVUI"]; +local L = SV.L; local Ace3Config = LibStub("AceConfig-3.0"); local Ace3ConfigDialog = LibStub("AceConfigDialog-3.0"); Ace3Config:RegisterOptionsTable(SV.NameID, SV.Options); @@ -208,8 +208,8 @@ SV.Options.args.common = { order = 2, name = L["General"], childGroups = "tab", - get = function(j)return SV.db[j[#j]]end, - set = function(j, value)SV.db[j[#j]] = value end, + get = function(key) return SV.db[key[#key]] end, + set = function(key, value) SV.db[key[#key]] = value end, args = { commonGroup = { order = 1, @@ -657,10 +657,10 @@ SV.Options.args.common = { } } }, - gear={ + gear = { order = 3, type = 'group', - name = L['Gear Managment'], + name = SV.SVGear.TitleID, get = function(a)return SV.db.SVGear[a[#a]]end, set = function(a,b)SV.db.SVGear[a[#a]]=b;GEAR:ReLoad()end, args={ diff --git a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc index 01ae44c..b303934 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc +++ b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.toc @@ -1,11 +1,12 @@ ## Interface: 60000 ## Author: Munglunch -## Version: 4.6 +## Version: 4.7 ## Title: |cffFF9900SVUI |r|cffFFEF00Config O Matic|r ## Notes: Supervillain UI [|cff9911FFConfig Options|r] ## RequiredDeps: SVUI ## LoadOnDemand: 1 ## X-Notes: Special thanks to Elv and Tukz for their incredible work. ## X-Email: munglunch@gmail.com +## X-SVUI-Header: Config-O-Matic -_load.xml +SVUI_ConfigOMatic.xml diff --git a/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.xml b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.xml new file mode 100644 index 0000000..1157f0d --- /dev/null +++ b/Interface/AddOns/SVUI_ConfigOMatic/SVUI_ConfigOMatic.xml @@ -0,0 +1,6 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Include file='libs\_load.xml'/> + <Include file='language\_load.xml'/> + <Script file='SVUI_ConfigOMatic.lua'/> + <Include file='modules\_load.xml'/> +</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/_load.xml b/Interface/AddOns/SVUI_ConfigOMatic/_load.xml deleted file mode 100644 index 1157f0d..0000000 --- a/Interface/AddOns/SVUI_ConfigOMatic/_load.xml +++ /dev/null @@ -1,6 +0,0 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/"> - <Include file='libs\_load.xml'/> - <Include file='language\_load.xml'/> - <Script file='SVUI_ConfigOMatic.lua'/> - <Include file='modules\_load.xml'/> -</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/language/generic.lua b/Interface/AddOns/SVUI_ConfigOMatic/language/generic.lua index 6346151..4f865ca 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/language/generic.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/language/generic.lua @@ -16,8 +16,8 @@ S U P E R - V I L L A I N - U I By: Munglunch # GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); +local SV = _G["SVUI"]; +local L = SV.L; local gameLocale = GetLocale() if gameLocale == "enUS" then L["AURAS_DESC"] = "Configure the aura icons that appear near the minimap." diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/aura.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/aura.lua index 6924b5f..995723b 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/aura.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/aura.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); +local SV = _G["SVUI"]; +local L = SV.L; local MOD = SV.SVAura; local MAP = SV.SVMap; --[[ @@ -158,7 +158,7 @@ local auraOptionsTemplate = { SV.Options.args.SVAura = { type = "group", - name = BUFFOPTIONS_LABEL, + name = MOD.TitleID, childGroups = "tab", get = function(a)return SV.db.SVAura[a[#a]]end, set = function(a,b) @@ -272,7 +272,12 @@ SV.Options.args.SVAura = { type = "group", name = L["Hyper Buffs"], get = function(b)return SV.db.SVAura.hyperBuffs[b[#b]]end, - set = function(a,b)MOD:ChangeDBVar(b,a[#a],"hyperBuffs");MOD:ToggleConsolidatedBuffs();MAP:ReLoad();MOD:UpdateAuraHeader(SVUI_PlayerBuffs, "buffs")end, + set = function(a,b) + MOD:ChangeDBVar(b,a[#a],"hyperBuffs"); + MOD:ToggleConsolidatedBuffs(); + SV.SVMap:ReLoad(); + MOD:UpdateAuraHeader(SVUI_PlayerBuffs, "buffs") + end, args = { enable = { order = 1, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/bag.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/bag.lua index 9d0f39b..ee248ce 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/bag.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/bag.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); +local SV = _G["SVUI"]; +local L = SV.L; local MOD = SV.SVBag @@ -43,7 +43,7 @@ local pointList = { SV.Options.args.SVBag = { type = 'group', - name = L['Bags'], + name = MOD.TitleID, childGroups = "tab", get = function(a)return SV.db.SVBag[a[#a]]end, set = function(a,b)MOD:ChangeDBVar(b,a[#a]) end, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/bar.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/bar.lua index 91de22a..b6e59a7 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/bar.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/bar.lua @@ -29,9 +29,9 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; +local SV = _G["SVUI"]; local SVLib = LibSuperVillain; -local L = SVLib:Lang(); +local L = SV.L; local MOD = SV.SVBar; --[[ ########################################################## @@ -164,7 +164,6 @@ local function BarConfigLoader() get = function()return SV.db.SVBar["Bar"..d].useCustomPaging end, set = function(e, f) SV.db.SVBar["Bar"..d].useCustomPaging = f; - MOD.db["Bar"..d].useCustomPaging = f; MOD:UpdateBarPagingDefaults(); MOD:RefreshBar("Bar"..d) end @@ -189,7 +188,6 @@ local function BarConfigLoader() get = function(e)return SV.db.SVBar["Bar"..d].customPaging[SV.class] end, set = function(e, f) SV.db.SVBar["Bar"..d].customPaging[SV.class] = f; - MOD.db["Bar"..d].customPaging[SV.class] = f; MOD:UpdateBarPagingDefaults(); MOD:RefreshBar("Bar"..d) end, @@ -203,7 +201,6 @@ local function BarConfigLoader() get = function()return SV.db.SVBar["Bar"..d].useCustomVisibility end, set = function(e, f) SV.db.SVBar["Bar"..d].useCustomVisibility = f; - MOD.db["Bar"..d].useCustomVisibility = f; MOD:UpdateBarPagingDefaults(); MOD:RefreshBar("Bar"..d) end @@ -228,7 +225,6 @@ local function BarConfigLoader() get = function(e)return SV.db.SVBar["Bar"..d].customVisibility end, set = function(e, f) SV.db.SVBar["Bar"..d].customVisibility = f; - MOD.db["Bar"..d].customVisibility = f; MOD:UpdateBarPagingDefaults(); MOD:RefreshBar("Bar"..d) end, @@ -411,7 +407,6 @@ local function BarConfigLoader() get = function()return SV.db.SVBar["Pet"].useCustomVisibility end, set = function(e,f) SV.db.SVBar["Pet"].useCustomVisibility = f; - MOD.db["Pet"].useCustomVisibility = f; MOD:RefreshBar("Pet") end }, @@ -434,7 +429,6 @@ local function BarConfigLoader() get = function(e)return SV.db.SVBar["Pet"].customVisibility end, set = function(e,f) SV.db.SVBar["Pet"].customVisibility = f; - MOD.db["Pet"].customVisibility = f; MOD:RefreshBar("Pet") end, disabled = function()return not SV.db.SVBar["Pet"].useCustomVisibility end, @@ -583,7 +577,6 @@ local function BarConfigLoader() get = function()return SV.db.SVBar["Stance"].useCustomVisibility end, set = function(e,f) SV.db.SVBar["Stance"].useCustomVisibility = f; - MOD.db["Stance"].useCustomVisibility = f; MOD:RefreshBar("Stance") end }, @@ -606,7 +599,6 @@ local function BarConfigLoader() get = function(e)return SV.db.SVBar["Stance"].customVisibility end, set = function(e,f) SV.db.SVBar["Stance"].customVisibility = f; - MOD.db["Stance"].customVisibility = f; MOD:RefreshBar("Stance") end, disabled = function()return not SV.db.SVBar["Stance"].useCustomVisibility end, @@ -619,7 +611,7 @@ end SV.Options.args.SVBar = { type = "group", - name = L["ActionBars"], + name = MOD.TitleID, childGroups = "tab", get = function(key) return SV.db.SVBar[key[#key]] diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/chat.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/chat.lua index c210897..490d6d0 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/chat.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/chat.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); +local SV = _G["SVUI"]; +local L = SV.L; local MOD = SV.SVChat; --[[ ########################################################## @@ -39,7 +39,7 @@ SET PACKAGE OPTIONS ]]-- SV.Options.args.SVChat={ type = "group", - name = L["Chat"], + name = MOD.TitleID, get = function(a)return SV.db.SVChat[a[#a]]end, set = function(a,b)MOD:ChangeDBVar(b,a[#a]); end, args = { diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/dock.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/dock.lua index c3af16e..9e71d08 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/dock.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/dock.lua @@ -29,15 +29,15 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); +local SV = _G["SVUI"]; +local L = SV.L; local MOD = SV.SVDock local CHAT = SV.SVChat local BAG = SV.SVBag SV.Options.args.SVDock = { type = "group", - name = L["Docks"], + name = MOD.TitleID, args = {} } diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/dynamic.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/dynamic.lua index 1f9e9ba..0d4b20b 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/dynamic.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/dynamic.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); +local SV = _G["SVUI"]; +local L = SV.L; local queue = SV.DynamicOptions; do diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/filter.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/filter.lua index 2d9655e..a59fabb 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/filter.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/filter.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); +local SV = _G["SVUI"]; +local L = SV.L; local MOD = SV.SVUnit if(not MOD) then return end local _, ns = ...; diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/henchmen.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/henchmen.lua index 38aaa6a..ae30fcd 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/henchmen.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/henchmen.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); +local SV = _G["SVUI"]; +local L = SV.L; local MOD = SV.SVHenchmen; --[[ ########################################################## @@ -39,7 +39,7 @@ SET PACKAGE OPTIONS ]]-- SV.Options.args.SVHenchmen={ type = "group", - name = L["Henchmen"], + name = MOD.TitleID, get = function(a)return SV.db.SVHenchmen[a[#a]]end, set = function(a,b)MOD:ChangeDBVar(b,a[#a]); end, args = { diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/map.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/map.lua index a6f0b97..8a5a340 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/map.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/map.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); +local SV = _G["SVUI"]; +local L = SV.L; local MOD = SV.SVMap --[[ ########################################################## @@ -55,7 +55,7 @@ OPTIONS TABLE SV.Options.args.SVMap = { type = 'group', childGroups = "tree", - name = L['Minimap'], + name = MOD.TitleID, get = function(a)return SV.db.SVMap[a[#a]]end, set = function(a,b)MOD:ChangeDBVar(b,a[#a]);MOD:ReLoad()end, args={ diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/mode.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/mode.lua deleted file mode 100644 index 7cfb20e..0000000 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/mode.lua +++ /dev/null @@ -1,159 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- ---[[ GLOBALS ]]-- -local _G = _G; -local unpack = _G.unpack; -local pairs = _G.pairs; -local tinsert = _G.tinsert; -local table = _G.table; ---[[ TABLE METHODS ]]-- -local tsort = table.sort; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); -local MOD = SV.SVLaborer -SV.Options.args.SVLaborer = { - type = 'group', - name = L['Laborer'], - get = function(key)return SV.db.SVLaborer[key[#key]]end, - set = function(key, value)MOD: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 SV.db.SVLaborer[key[#key]]end, - set = function(key, value)SV.db.SVLaborer.enable = value;SV: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)MOD:ChangeDBVar(value,j[#j]);MOD: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 SV.db.SVLaborer.fishing[key[#key]]end, - set = function(key, value)MOD: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 SV.db.SVLaborer.cooking[key[#key]]end, - set = function(key, value)MOD:ChangeDBVar(value, key[#key], "cooking")end - } - } - }, - farming = { - order = 6, - type = "group", - name = L["Farming Mode Settings"], - guiInline = true, - get = function(key)return SV.db.SVLaborer.farming[key[#key]]end, - set = function(key, value)SV.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) - MOD:ChangeDBVar(value, key[#key],"farming"); - MOD: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) - MOD:ChangeDBVar(value, key[#key],"farming"); - MOD: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) - MOD:ChangeDBVar(value, key[#key],"farming"); - MOD: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)MOD:ChangeDBVar(value, key[#key],"farming");MOD:RefreshFarmingTools()end, - values = { - ['VERTICAL'] = L['Vertical'], ['HORIZONTAL'] = L['Horizontal'] - } - } - } - } - } -} \ No newline at end of file diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/plate.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/plate.lua index 347aeba..3f5e41c 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/plate.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/plate.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); +local SV = _G["SVUI"]; +local L = SV.L; local MOD = SV.SVPlate; local _, ns = ...; --[[ @@ -125,18 +125,18 @@ local function UpdateFilterGroupOptions() } end -SV.Options.args.SVPlate={ - type="group", - name=L["NamePlates"], - childGroups="tab", - args={ - commonGroup={ - order=1, - type='group', - name=L['NamePlate Options'], - childGroups="tree", - args={ - intro={order=1,type="description",name=L["NAMEPLATE_DESC"]}, +SV.Options.args.SVPlate = { + type = "group", + name = MOD.TitleID, + childGroups = "tab", + args = { + commonGroup = { + order = 1, + type = 'group', + name = L['NamePlate Options'], + childGroups = "tree", + args = { + intro = {order = 1, type = "description", name = L["NAMEPLATE_DESC"]}, enable={ order=2,type="toggle",name=L["Enable"], get=function(d)return SV.db.SVPlate[d[#d]]end, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/profiles.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/profiles.lua index 9953058..d19affc 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/profiles.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/profiles.lua @@ -29,9 +29,9 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; +local SV = _G["SVUI"]; local SVLib = LibSuperVillain; -local L = SVLib:Lang(); +local L = SV.L; local playerRealm = GetRealmName() local playerName = UnitName("player") diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/stat.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/stat.lua index b388085..590e554 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/stat.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/stat.lua @@ -28,8 +28,8 @@ local upper = string.upper; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); +local SV = _G["SVUI"]; +local L = SV.L; local MOD = SV.SVStats; --[[ ########################################################## @@ -38,7 +38,7 @@ SET PACKAGE OPTIONS ]]-- SV.Options.args.SVStats = { type = "group", - name = L["Statistics"], + name = MOD.TitleID, childGroups = "tab", get = function(key) return SV.db.SVStats[key[#key]] end, set = function(key, value) MOD:ChangeDBVar(value, key[#key]); MOD:Generate() end, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/tip.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/tip.lua index 315545e..6fe229a 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/tip.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/tip.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); +local SV = _G["SVUI"]; +local L = SV.L; local MOD = SV.SVTip; local LSM = LibStub("LibSharedMedia-3.0"); --[[ @@ -40,7 +40,7 @@ SET PACKAGE OPTIONS ]]-- SV.Options.args.SVTip = { type = "group", - name = L["Tooltip"], + name = MOD.TitleID, childGroups = "tab", get = function(a)return SV.db.SVTip[a[#a]] end, set = function(a, b)SV.db.SVTip[a[#a]] = b end, diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua index 896839c..8cdabd8 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/core.lua @@ -31,8 +31,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); +local SV = _G["SVUI"]; +local L = SV.L; local MOD = SV.SVUnit if(not MOD) then return end local _, ns = ...; @@ -1460,7 +1460,7 @@ end SV.Options.args.SVUnit = { type = "group", - name = L["UnitFrames"], + name = MOD.TitleID, childGroups = "tree", get = function(key) return SV.db.SVUnit[key[#key]] diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/focus.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/focus.lua index dde1c89..55531c3 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/focus.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/focus.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); +local SV = _G["SVUI"]; +local L = SV.L; local MOD = SV.SVUnit if(not MOD) then return end local _, ns = ... diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/grid.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/grid.lua index df8d2df..ca47fef 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/grid.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/grid.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); +local SV = _G["SVUI"]; +local L = SV.L; local MOD = SV.SVUnit if(not MOD) then return end local _, ns = ... diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/other.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/other.lua index 6a31822..b0e76cb 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/other.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/other.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); +local SV = _G["SVUI"]; +local L = SV.L; local MOD = SV.SVUnit if(not MOD) then return end local _, ns = ... diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/party.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/party.lua index 3b1bc0e..66b399f 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/party.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/party.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); +local SV = _G["SVUI"]; +local L = SV.L; local MOD = SV.SVUnit if(not MOD) then return end local _, ns = ... diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/pet.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/pet.lua index 60293e7..68a370f 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/pet.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/pet.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); +local SV = _G["SVUI"]; +local L = SV.L; local MOD = SV.SVUnit if(not MOD) then return end local _, ns = ... diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/player.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/player.lua index 4dab8aa..5e78f46 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/player.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/player.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); +local SV = _G["SVUI"]; +local L = SV.L; local MOD = SV.SVUnit if(not MOD) then return end local _, ns = ... diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/raid.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/raid.lua index b6dc2f2..927758e 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/raid.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/raid.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); +local SV = _G["SVUI"]; +local L = SV.L; local MOD = SV.SVUnit if(not MOD) then return end local _, ns = ... diff --git a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/target.lua b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/target.lua index 397a494..aeb7efa 100644 --- a/Interface/AddOns/SVUI_ConfigOMatic/modules/units/target.lua +++ b/Interface/AddOns/SVUI_ConfigOMatic/modules/units/target.lua @@ -29,8 +29,8 @@ local tsort = table.sort; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); +local SV = _G["SVUI"]; +local L = SV.L; local MOD = SV.SVUnit if(not MOD) then return end local _, ns = ... diff --git a/Interface/AddOns/SVUI_CraftOMatic/Bindings.xml b/Interface/AddOns/SVUI_CraftOMatic/Bindings.xml new file mode 100644 index 0000000..2a3cd5f --- /dev/null +++ b/Interface/AddOns/SVUI_CraftOMatic/Bindings.xml @@ -0,0 +1,14 @@ +<Bindings> + <Binding name="SVUILABORER_FISH" category="ADDONS" header="SVUILABORER" runOnUp="false"> + SVUIFishingMode() + </Binding> + <Binding name="SVUILABORER_FARM" category="ADDONS" runOnUp="false"> + SVUIFarmingMode() + </Binding> + <Binding name="SVUILABORER_ARCH" category="ADDONS" runOnUp="false"> + SVUIArchaeologyMode() + </Binding> + <Binding name="SVUILABORER_COOK" category="ADDONS" runOnUp="false"> + SVUICookingMode() + </Binding> +</Bindings> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_CraftOMatic/License.txt b/Interface/AddOns/SVUI_CraftOMatic/License.txt new file mode 100644 index 0000000..a90771f --- /dev/null +++ b/Interface/AddOns/SVUI_CraftOMatic/License.txt @@ -0,0 +1,34 @@ +############################################################################### +#_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # +# ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # +# __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # +# ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # +# ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # +# _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # +# __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # +# _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# +# ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################### +# S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################### + +SVUI_CraftOMatic License Copyright 2014 http://wowinterface.com + +The contents of this addon, excluding third-party resources, are +copyrighted to their authors with all rights reserved. + +Authors of this addon hereby grant you the following rights: + +1. You may NOT make any modification inside this addon. If you want + to create your own edited version, please create it from outside. + +2. Do not modify the name of this addon, including the addon folders. + +3. This copyright notice shall be included in all copies or substantial + portions of the Software. + +All rights not explicitly addressed in this license are reserved by +the copyright holders. + +You can write Munglunch at Wowinterface.com for reporting abuse / bugs, +or regarding grants allowed for this license. \ No newline at end of file diff --git a/Interface/AddOns/SVUI_CraftOMatic/Loader.lua b/Interface/AddOns/SVUI_CraftOMatic/Loader.lua new file mode 100644 index 0000000..c5d2f48 --- /dev/null +++ b/Interface/AddOns/SVUI_CraftOMatic/Loader.lua @@ -0,0 +1,44 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +local AddonName, AddonObject = ... + +assert(LibSuperVillain, AddonName .. " requires LibSuperVillain") + +local PLUGIN = LibSuperVillain:NewPlugin(AddonName, AddonObject) + +local Schema = PLUGIN.Schema; +local SV = _G["SVUI"]; + +SV.configs[Schema] = { + ["enable"] = true, + ["fontSize"] = 12, + ["farming"] = { + ["buttonsize"] = 35, + ["buttonspacing"] = 3, + ["onlyactive"] = false, + ["droptools"] = true, + ["toolbardirection"] = "HORIZONTAL", + }, + ["fishing"] = { + ["autoequip"] = true, + }, + ["cooking"] = { + ["autoequip"] = true, + }, +} \ No newline at end of file diff --git a/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.lua b/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.lua new file mode 100644 index 0000000..b98a11b --- /dev/null +++ b/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.lua @@ -0,0 +1,645 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- + +--[[ CONSTANTS ]]-- + +BINDING_HEADER_SVUILABORER = "Supervillain UI: Crafting"; +BINDING_NAME_SVUILABORER_FISH = "Toggle Fishing Mode"; +BINDING_NAME_SVUILABORER_FARM = "Toggle Farming Mode"; +BINDING_NAME_SVUILABORER_COOK = "Toggle Cooking Mode"; +BINDING_NAME_SVUILABORER_ARCH = "Toggle Archaeology Mode"; + +--[[ 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 PLUGIN = select(2, ...) +local Schema = PLUGIN.Schema; + +local SV = _G["SVUI"]; +local L = SV.L +local NewHook = hooksecurefunc; + +local playerGUID = UnitGUID('player') +local classColor = RAID_CLASS_COLORS +--[[ +########################################################## +GLOBAL BINDINGS +########################################################## +]]-- +function SVUIFishingMode() + if InCombatLockdown() then SV: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 SV:AddonMessage(ERR_NOT_IN_COMBAT); return; end + if PLUGIN.CurrentMode and SV.CurrentMode == "Farming" then PLUGIN:EndJobModes() else PLUGIN:SetJobMode("Farming") end +end + +function SVUIArchaeologyMode() + if InCombatLockdown() then SV: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 SV: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[SV.class] +local classR, classG, classB = classColors.r, classColors.g, classColors.b +local classA = 0.35 +local lastClickTime; +local ICON_FILE = [[Interface\AddOns\SVUI_CraftOMatic\artwork\DOCK-LABORER]] +local COOK_ICON = [[Interface\AddOns\SVUI_CraftOMatic\artwork\LABORER-COOKING]] +local FISH_ICON = [[Interface\AddOns\SVUI_CraftOMatic\artwork\LABORER-FISHING]] +local ARCH_ICON = [[Interface\AddOns\SVUI_CraftOMatic\artwork\LABORER-SURVEY]] +local FARM_ICON = [[Interface\AddOns\SVUI_CraftOMatic\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:CraftingReset() + self.TitleWindow:Clear(); + self.LogWindow:Clear(); + self.TitleWindow:AddMessage("Crafting 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:CraftingReset() + end +end + +function PLUGIN:CheckForModeLoot(msg) + local item, amt = SV:DeFormat(msg, LOOT_ITEM_CREATED_SELF) + if not item then + item = SV:DeFormat(msg, LOOT_ITEM_SELF_MULTIPLE) + if not item then + item = SV:DeFormat(msg, LOOT_ITEM_SELF) + if not item then + item = SV:DeFormat(msg, LOOT_ITEM_PUSHED_SELF_MULTIPLE) + if not item then + item, amt = SV: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:CraftingReset() +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(SV.Media.font.system, SV.db[Schema].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(0,0,0,0.5) + title.divider:SetPoint("BOTTOMLEFT") + title.divider:SetPoint("BOTTOMRIGHT") + title.divider:SetHeight(1) + + local topleftline = title:CreateTexture(nil,"OVERLAY") + topleftline:SetTexture(0,0,0,0.5) + 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:SetFontTemplate(nil, SV.db[Schema].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(0,0,0,0.5) + bottomleftline:SetPoint("TOPLEFT") + bottomleftline:SetPoint("BOTTOMLEFT") + bottomleftline:SetWidth(1) + + self.TitleWindow = title + self.LogWindow = log + + self.ListenerEnabled = false; + SV:RegisterDocklet("SVUI_ModesDockFrame", "Crafting Modes", ICON_FILE, false) + self:CraftingReset() +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 + SV:AddonMessage(ERR_NOT_IN_COMBAT); + return; + end + SuperDockAlertRight:Deactivate() +end + +local ModeAlert_OnShow = function(self) + if InCombatLockdown() then + SV:AddonMessage(ERR_NOT_IN_COMBAT); + self:Hide() + return; + end + SV:SecureFadeIn(self, 0.3, 0, 1) + SuperDockAlertRight:Activate(self) +end + +local ModeAlert_OnMouseDown = function(self) + PLUGIN:EndJobModes() + SV: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(SV.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 +########################################################## +]]-- +function PLUGIN:Load() + if(not SV.db[Schema].enable) then return end + + 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(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() + + self.ModeAlert = ModeAlert + + self:MakeLogWindow() + + modesDocklet:Hide() + + self:LoadCookingMode() + self:LoadFishingMode() + self:LoadArchaeologyMode() + self:PrepareFarmingTools() + self:RegisterEvent("SKILL_LINES_CHANGED") + + local option = { + order = 2, + name = L["Font Size"], + desc = L["Set the font size of the log window."], + type = "range", + min = 6, + max = 22, + step = 1, + get = function(key)return SV.db[Schema][key[#key]] end, + set = function(j,value) PLUGIN:ChangeDBVar(value,j[#j]);PLUGIN:UpdateLogWindow()end + } + self:AddOption("fontSize", option) + option = { + order = 3, + type = "group", + name = L["Fishing Mode Settings"], + guiInline = true, + args = { + autoequip = { + type = "toggle", + order = 1, + name = L['AutoEquip'], + desc = L['Enable/Disable automatically equipping fishing gear.'], + get = function(key)return SV.db[Schema].fishing[key[#key]]end, + set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key], "fishing")end + } + } + } + self:AddOption("fishing", option) + option = { + order = 4, + type = "group", + name = L["Cooking Mode Settings"], + guiInline = true, + args = { + autoequip = { + type = "toggle", + order = 1, + name = L['AutoEquip'], + desc = L['Enable/Disable automatically equipping cooking gear.'], + get = function(key)return SV.db[Schema].cooking[key[#key]]end, + set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key], "cooking")end + } + } + } + self:AddOption("cooking", option) + option = { + order = 5, + type = "group", + name = L["Farming Mode Settings"], + guiInline = true, + get = function(key)return SV.db[Schema].farming[key[#key]]end, + set = function(key, value)SV.db[Schema].farming[key[#key]] = value end, + args = { + buttonsize = { + type = 'range', + name = L['Button Size'], + desc = L['The size of the action buttons.'], + min = 15, + max = 60, + step = 1, + order = 1, + set = function(key, value) + PLUGIN:ChangeDBVar(value, key[#key],"farming"); + PLUGIN:RefreshFarmingTools() + end, + }, + buttonspacing = { + type = 'range', + name = L['Button Spacing'], + desc = L['The spacing between buttons.'], + min = 1, + max = 10, + step = 1, + order = 2, + set = function(key, value) + PLUGIN:ChangeDBVar(value, key[#key],"farming"); + PLUGIN:RefreshFarmingTools() + end, + }, + onlyactive = { + order = 3, + type = 'toggle', + name = L['Only active buttons'], + desc = L['Only show the buttons for the seeds, portals, tools you have in your bags.'], + set = function(key, value) + PLUGIN:ChangeDBVar(value, key[#key],"farming"); + PLUGIN:RefreshFarmingTools() + end, + }, + droptools = { + order = 4, + type = 'toggle', + name = L['Drop '], + desc = L['Automatically drop tools from your bags when leaving the farming area.'], + }, + toolbardirection = { + order = 5, + type = 'select', + name = L['Bar Direction'], + desc = L['The direction of the bar buttons (Horizontal or Vertical).'], + set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key],"farming"); PLUGIN:RefreshFarmingTools() end, + values = { + ['VERTICAL'] = L['Vertical'], ['HORIZONTAL'] = L['Horizontal'] + } + } + } + } + self:AddOption("farming", option) +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.toc b/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.toc new file mode 100644 index 0000000..01a991d --- /dev/null +++ b/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.toc @@ -0,0 +1,13 @@ +## Interface: 60000 +## Author: Munglunch +## Version: 4.7 +## Title: |cffFF9900SVUI |r|cffFFEF00Craft-O-Matic|r +## Notes: Supervillain UI [|cff9911FFProfession Tools|r]. +## Interface: 60000 +## RequiredDeps: SVUI +## LoadOnDemand: 1 +## X-Email: munglunch@gmail.com +## X-SVUI-Header: Craft-O-Matic +## X-SVUI-Schema: CraftOMatic + +SVUI_CraftOMatic.xml diff --git a/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.xml b/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.xml new file mode 100644 index 0000000..95c4646 --- /dev/null +++ b/Interface/AddOns/SVUI_CraftOMatic/SVUI_CraftOMatic.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") + CraftOMatic:ChangeModeGear() + self:PostClickHandler() + end + if event == "PLAYER_ENTERING_WORLD" then + if (IsSpellKnown(131474) or IsSpellKnown(80451) or IsSpellKnown(818)) then + WorldFrame:HookScript("OnMouseDown", CraftOMatic.WorldFrameHook) + end + self:UnregisterEvent("PLAYER_ENTERING_WORLD") + end + end) + </OnLoad> + </Scripts> + </Button> + </Frames> + </Frame> + <Script file='Loader.lua'/> + <Script file='SVUI_CraftOMatic.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_CraftOMatic/artwork/DOCK-LABORER.blp b/Interface/AddOns/SVUI_CraftOMatic/artwork/DOCK-LABORER.blp new file mode 100644 index 0000000..9397f22 Binary files /dev/null and b/Interface/AddOns/SVUI_CraftOMatic/artwork/DOCK-LABORER.blp differ diff --git a/Interface/AddOns/SVUI_CraftOMatic/artwork/LABORER-COOKING.blp b/Interface/AddOns/SVUI_CraftOMatic/artwork/LABORER-COOKING.blp new file mode 100644 index 0000000..fe824f0 Binary files /dev/null and b/Interface/AddOns/SVUI_CraftOMatic/artwork/LABORER-COOKING.blp differ diff --git a/Interface/AddOns/SVUI_CraftOMatic/artwork/LABORER-FARMING.blp b/Interface/AddOns/SVUI_CraftOMatic/artwork/LABORER-FARMING.blp new file mode 100644 index 0000000..7127055 Binary files /dev/null and b/Interface/AddOns/SVUI_CraftOMatic/artwork/LABORER-FARMING.blp differ diff --git a/Interface/AddOns/SVUI_CraftOMatic/artwork/LABORER-FISHING.blp b/Interface/AddOns/SVUI_CraftOMatic/artwork/LABORER-FISHING.blp new file mode 100644 index 0000000..76474d1 Binary files /dev/null and b/Interface/AddOns/SVUI_CraftOMatic/artwork/LABORER-FISHING.blp differ diff --git a/Interface/AddOns/SVUI_CraftOMatic/artwork/LABORER-SURVEY.blp b/Interface/AddOns/SVUI_CraftOMatic/artwork/LABORER-SURVEY.blp new file mode 100644 index 0000000..40f68ae Binary files /dev/null and b/Interface/AddOns/SVUI_CraftOMatic/artwork/LABORER-SURVEY.blp differ diff --git a/Interface/AddOns/SVUI_CraftOMatic/modes/archaeology.lua b/Interface/AddOns/SVUI_CraftOMatic/modes/archaeology.lua new file mode 100644 index 0000000..4f5e5b9 --- /dev/null +++ b/Interface/AddOns/SVUI_CraftOMatic/modes/archaeology.lua @@ -0,0 +1,515 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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 SV = _G.SVUI; +local L = SV.L; +local PLUGIN = select(2, ...); +local Schema = PLUGIN.Schema; +--[[ +########################################################## +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 ArchCrafting = CreateFrame("Frame", "SVUI_ArchCrafting", UIParent) +--[[ +########################################################## +DATA +########################################################## +]]-- +PLUGIN.Archaeology = {}; +PLUGIN.Archaeology.Bars = {}; +PLUGIN.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", SV.fubar) + button:SetScript("OnLeave", SV.fubar) + button:SetScript("OnMouseUp", SV.fubar) +end + +local function UpdateArtifactBars(index) + local cache = refArtifacts[index] + local bar = PLUGIN.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 = SV.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() + PLUGIN.TitleWindow:Clear() + PLUGIN.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) + PLUGIN.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) + PLUGIN.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 PLUGIN.Archaeology:Enable() + PLUGIN.Archaeology:Update() + if(not SVUI_ModesDockFrame:IsShown()) then DockButton:Click() end + + PlaySoundFile("Sound\\Item\\UseSounds\\UseCrinklingPaper.wav") + PLUGIN.ModeAlert:SetBackdropColor(0.25, 0.52, 0.1) + if(not IsSpellKnown(80451)) then + PLUGIN: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."); + PLUGIN.TitleWindow:Clear(); + PLUGIN.TitleWindow:AddMessage("WTF is Archaeology?"); + PLUGIN.LogWindow:Clear(); + PLUGIN.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); + PLUGIN.LogWindow:AddMessage(" ", 1, 1, 1); + else + ArchCrafting:Show() + local msg = GetTitleAndSkill() + if surveyIsKnown and CanScanResearchSite() then + PLUGIN: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 + PLUGIN: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 + PLUGIN.TitleWindow:Clear(); + PLUGIN.TitleWindow:AddMessage(msg); + end + EnableListener() + PLUGIN.ModeAlert:Show() + SendModeMessage("Archaeology Mode Enabled", CombatText_StandardScroll, 0.28, 0.9, 0.1); +end + +function PLUGIN.Archaeology:Disable() + DisableListener() + ArchCrafting:Hide() +end + +function PLUGIN.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) + PLUGIN.ModeAlert.HelpText = 'Double-Right-Click anywhere on the screen to survey.' + else + _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") + _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', archSpell) + PLUGIN.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 PLUGIN.Archaeology:Update() + surveyIsKnown = IsSpellKnown(80451); + survey = GetSpellInfo(80451); + local _,_,arch,_,_,_ = GetProfessions(); + if(arch) then + archSpell, _, skillRank, _, _, _, _, skillModifier = GetProfessionInfo(arch) + end +end +--[[ +########################################################## +LOADER +########################################################## +]]-- +function PLUGIN:LoadArchaeologyMode() + ModeLogsFrame = PLUGIN.LogWindow; + DockButton = _G["SVUI_ModesDockFrame_ToolBarButton"]; + + local progressBars = PLUGIN.Archaeology.Bars + + ArchCrafting:SetParent(ModeLogsFrame) + ArchCrafting:SetFrameStrata("MEDIUM") + ArchCrafting:FillInner(ModeLogsFrame) + + local BAR_WIDTH = (ArchCrafting:GetWidth() * 0.5) - 4 + local BAR_HEIGHT = (ArchCrafting:GetHeight() / 6) - 4 + + for i = 1, 12 do + local bar = CreateFrame("StatusBar", nil, ArchCrafting) + 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", ArchCrafting, "TOPRIGHT", -2, -yOffset) + else + yOffset = ((i - 1) * (BAR_HEIGHT + 4)) + 4; + bar:SetPoint("TOPLEFT", ArchCrafting, "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(SV.Media.font.roboto, 12, "OUTLINE") + race:SetText(RACE) + race:SetPoint("LEFT", bar, "LEFT", 2, 0) + + -- Progress Text + progress:SetFont(SV.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(SV.Media.bar.default) + solve.bg:SetVertexColor(0.1,0.5,0) + + solve.text = solve:CreateFontString(nil,"OVERLAY") + solve.text:SetFont(SV.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 + ArchCrafting:Hide() + PLUGIN.Archaeology:Update() + UpdateArtifactCache() +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_CraftOMatic/modes/cooking.lua b/Interface/AddOns/SVUI_CraftOMatic/modes/cooking.lua new file mode 100644 index 0000000..749480d --- /dev/null +++ b/Interface/AddOns/SVUI_CraftOMatic/modes/cooking.lua @@ -0,0 +1,230 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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 SV = _G.SVUI; +local L = SV.L; +local PLUGIN = select(2, ...); +local Schema = PLUGIN.Schema; +--[[ +########################################################## +LOCAL VARS +########################################################## +]]-- +local cookingSpell, campFire, skillRank, skillModifier; +local DockButton; +--[[ +########################################################## +LOCAL FUNCTIONS +########################################################## +]]-- +local function UpdateChefWear() + if(GetItemCount(46349) > 0) then + PLUGIN.WornItems["HEAD"] = GetInventoryItemID("player", INVSLOT_HEAD); + EquipItemByName(46349) + PLUGIN.InModeGear = true + end + if(GetItemCount(86468) > 0) then + PLUGIN.WornItems["TAB"] = GetInventoryItemID("player", INVSLOT_TABARD); + EquipItemByName(86468) + PLUGIN.InModeGear = true + end + if(GetItemCount(86559) > 0) then + PLUGIN.WornItems["MAIN"] = GetInventoryItemID("player", INVSLOT_MAINHAND); + EquipItemByName(86559) + PLUGIN.InModeGear = true + end + if(GetItemCount(86558) > 0) then + PLUGIN.WornItems["OFF"] = GetInventoryItemID("player", INVSLOT_OFFHAND); + EquipItemByName(86558) + PLUGIN.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 +########################################################## +]]-- +PLUGIN.Cooking = {}; +PLUGIN.Cooking.Log = {}; +PLUGIN.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() + PLUGIN.TitleWindow:Clear() + PLUGIN.TitleWindow:AddMessage(msg) + elseif(event == "CHAT_MSG_LOOT") then + local item, amt = PLUGIN: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 PLUGIN.Cooking.Log[name] then + PLUGIN.Cooking.Log[name] = {amount = 0, texture = ""}; + end + local r, g, b, hex = GetItemQualityColor(rarity); + local stored = PLUGIN.Cooking.Log + local mod = stored[name]; + local newAmt = mod.amount + 1; + if amt >= 2 then newAmt = mod.amount + amt end + PLUGIN.Cooking.Log[name].amount = newAmt; + PLUGIN.Cooking.Log[name].texture = tex; + PLUGIN.LogWindow:Clear(); + for name,data in pairs(stored) do + if type(data) == "table" and data.amount and data.texture then + PLUGIN.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 + PLUGIN.LogWindow:AddMessage("----------------", 0, 0, 0); + PLUGIN.LogWindow:AddMessage("Cooked So Far...", 0, 1, 1); + PLUGIN.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 PLUGIN.Cooking:Enable() + PLUGIN.Cooking:Update() + if(not SVUI_ModesDockFrame:IsShown()) then DockButton:Click() end + if(SV.db[Schema].cooking.autoequip) then + UpdateChefWear(); + end + PlaySoundFile("Sound\\Spells\\Tradeskills\\CookingPrepareA.wav") + PLUGIN.ModeAlert:SetBackdropColor(0.25, 0.52, 0.1) + + if(not IsSpellKnown(818)) then + PLUGIN: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 + PLUGIN: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 + PLUGIN: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() + PLUGIN.ModeAlert:Show() + SendModeMessage("Cooking Mode Enabled", CombatText_StandardScroll, 0.28, 0.9, 0.1); +end + +function PLUGIN.Cooking:Disable() + DisableListener() +end + +function PLUGIN.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) + PLUGIN.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 PLUGIN.Cooking:Update() + campFire = GetSpellInfo(818); + local _,_,_,_,cook,_ = GetProfessions(); + if cook ~= nil then + cookingSpell, _, skillRank, _, _, _, _, skillModifier = GetProfessionInfo(cook) + end +end +--[[ +########################################################## +LOADER +########################################################## +]]-- +function PLUGIN:LoadCookingMode() + DockButton = _G["SVUI_ModesDockFrame_ToolBarButton"]; +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_CraftOMatic/modes/farming.lua b/Interface/AddOns/SVUI_CraftOMatic/modes/farming.lua new file mode 100644 index 0000000..fc802b1 --- /dev/null +++ b/Interface/AddOns/SVUI_CraftOMatic/modes/farming.lua @@ -0,0 +1,615 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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 SV = _G.SVUI; +local L = SV.L; +local PLUGIN = select(2, ...); +local Schema = PLUGIN.Schema; +--[[ +########################################################## +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 PLUGIN.Farming.ToolsLoaded and PLUGIN.ModeAlert:IsShown() then + PLUGIN.TitleWindow:Clear() + PLUGIN.TitleWindow:AddMessage("|cff22ff11Farming Mode|r") + end + return true + else + if PLUGIN.Farming.ToolsLoaded and PLUGIN.ModeAlert:IsShown() then + PLUGIN.TitleWindow:Clear() + PLUGIN.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 SV.db[Schema].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 + + PLUGIN: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(SV.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 + PLUGIN.TitleWindow:AddMessage("|cffffff11Loading Farm Tools...|r|cffff1111PLEASE WAIT|r") + SV.Timers:ExecuteTimer(LoadFarmingModeTools, 5) + else + local horizontal = SV.db[Schema].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 + + PLUGIN.Farming.Loaded = true + SV.Timers:ExecuteTimer(PLUGIN.Farming.Enable, 1.5) + end + end +end +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +PLUGIN.Farming = {}; +PLUGIN.Farming.Loaded = false; +PLUGIN.Farming.ToolsLoaded = false; + +function PLUGIN.Farming:Enable() + if InCombatLockdown() then return end + + PLUGIN:ModeLootLoader("Farming", "Farming Mode", "This mode will provide you \nwith fast-access buttons for each \nof your seeds and farming tools."); + + PLUGIN.TitleWindow:Clear() + if(not PLUGIN.Farming.Loaded) then + PLUGIN.TitleWindow:AddMessage("|cffffff11Loading Farm Tools...|r") + LoadFarmingModeTools() + return + else + if not PLUGIN.Farming.ToolsLoaded then + PlaySoundFile("Sound\\Effects\\DeathImpacts\\mDeathImpactColossalDirtA.wav") + PLUGIN.TitleWindow:AddMessage("|cff22ff11Farming Mode|r") + PLUGIN.ModeAlert:Show() + InventoryUpdate() + PLUGIN.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 PLUGIN.Farming:Disable() + if(InCombatLockdown() or (not PLUGIN.Farming.Loaded) or (not PLUGIN.Farming.ToolsLoaded)) then + DisableListener() + return + end + if SV.db[Schema].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 + PLUGIN.Farming.ToolsLoaded = false + DisableListener() +end +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +function PLUGIN:RefreshFarmingTools() + local count, horizontal = 0, SV.db[Schema].farming.toolbardirection == 'HORIZONTAL' + local BUTTONSPACE = SV.db[Schema].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 SV.db[Schema].farming.onlyactive or (SV.db[Schema].farming.onlyactive and button.items > 0)) then + button.icon:SetVertexColor(1,1,1) + count = count + 1 + elseif (not SV.db[Schema].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(SV.db[Schema].farming.onlyactive and not SV.db[Schema].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 SV.db[Schema].farming.onlyactive or (SV.db[Schema].farming.onlyactive and button.items > 0)) then + button:Show() + button.icon:SetVertexColor(1,1,1) + count = count + 1 + elseif (not SV.db[Schema].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(SV.db[Schema].farming.onlyactive and not SV.db[Schema].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 SV.db[Schema].farming.onlyactive or (SV.db[Schema].farming.onlyactive and button.items > 0)) then + button:Show() + button.icon:SetVertexColor(1,1,1) + count = count + 1 + elseif (not SV.db[Schema].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(SV.db[Schema].farming.onlyactive) then + if count==0 then + FarmPortalBar:Hide() + else + FarmPortalBar:Show() + end + end +end + +function PLUGIN:PrepareFarmingTools() + local horizontal = SV.db[Schema].farming.toolbardirection == "HORIZONTAL" + local BUTTONSPACE = SV.db[Schema].farming.buttonspacing or 2; + + ModeLogsFrame = PLUGIN.LogWindow; + DockButton = _G["SVUI_ModesDockFrame_ToolBarButton"] + + if not SV.db[Schema].farming.undocked then + local bgTex = [[Interface\BUTTONS\WHITE8X8]] + local bdTex = SV.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 = SV.db[Schema].farming.buttonsize or 35; + + -- SEEDS + local farmSeedBarAnchor = CreateFrame("Frame", "FarmSeedBarAnchor", SV.UIParent) + farmSeedBarAnchor:Point("TOPRIGHT", SV.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 + SV.Mentalo:Add(farmSeedBarAnchor, "Farming Seeds") + + -- FARM TOOLS + local farmToolBarAnchor = CreateFrame("Frame", "FarmToolBarAnchor", SV.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; + SV.Mentalo:Add(farmToolBarAnchor, "Farming Tools") + + -- PORTALS + local farmPortalBarAnchor = CreateFrame("Frame", "FarmPortalBarAnchor", SV.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; + SV.Mentalo:Add(farmPortalBarAnchor, "Farming Portals") + end +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_CraftOMatic/modes/fishing.lua b/Interface/AddOns/SVUI_CraftOMatic/modes/fishing.lua new file mode 100644 index 0000000..995b328 --- /dev/null +++ b/Interface/AddOns/SVUI_CraftOMatic/modes/fishing.lua @@ -0,0 +1,382 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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 SV = _G.SVUI; +local L = SV.L; +local PLUGIN = select(2, ...); +local Schema = PLUGIN.Schema; +--[[ +########################################################## +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 + PLUGIN.WornItems["HEAD"] = HelmetID + end + EquipItemByName(fishingHat) + PLUGIN.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 + PLUGIN.WornItems["MAIN"] = MainHandID + end + + local OffHandID = GetInventoryItemID("player", INVSLOT_OFFHAND); + if(OffHandID) then + PLUGIN.WornItems["OFF"] = OffHandID; + end + + EquipItemByName(fishingPole) + PLUGIN.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 +########################################################## +]]-- +PLUGIN.Fishing = {}; +PLUGIN.Fishing.Log = {}; +PLUGIN.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() + PLUGIN.TitleWindow:Clear() + PLUGIN.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 = PLUGIN: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 PLUGIN.Fishing.Log[name] then + PLUGIN.Fishing.Log[name] = {amount = 0, texture = ""}; + end + local r, g, b, hex = GetItemQualityColor(rarity); + local stored = PLUGIN.Fishing.Log + local mod = stored[name]; + local newAmt = mod.amount + 1; + if amt >= 2 then newAmt = mod.amount + amt end + PLUGIN.Fishing.Log[name].amount = newAmt; + PLUGIN.Fishing.Log[name].texture = tex; + PLUGIN.LogWindow:Clear(); + + for name,data in pairs(stored) do + if type(data) == "table" and data.amount and data.texture then + PLUGIN.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 + PLUGIN.LogWindow:AddMessage("----------------", 0, 0, 0); + PLUGIN.LogWindow:AddMessage("Caught So Far...", 0, 1, 1); + PLUGIN.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 PLUGIN.Fishing:Enable() + PLUGIN:UpdateFishingMode() + if(not SVUI_ModesDockFrame:IsShown()) then DockButton:Click() end + UpdateFishingGear(SV.db[Schema].fishing.autoequip); + PlaySoundFile("Sound\\Spells\\Tradeskills\\FishCast.wav") + PLUGIN.ModeAlert:SetBackdropColor(0.25, 0.52, 0.1) + if(not IsSpellKnown(131474)) then + PLUGIN: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(); + PLUGIN:ModeLootLoader("Fishing", msg, "Double-Right-Click anywhere on the screen \nto cast your fishing line."); + end + EnableListener() + PLUGIN.ModeAlert:Show() + SendModeMessage("Fishing Mode Enabled", CombatText_StandardScroll, 0.28, 0.9, 0.1); +end + +function PLUGIN.Fishing:Disable() + DisableListener() +end + +function PLUGIN.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) + PLUGIN.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) + PLUGIN.ModeAlert.HelpText = 'Double-Right-Click to fish.' + else + PLUGIN.ModeAlert.HelpText = 'Double-Right-Click to apply fishing enchants.' + end + else + _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") + _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', fishingSpell) + PLUGIN.ModeAlert.HelpText = 'Double-Right-Click to fish.' + end + else + _G["SVUI_ModeCaptureWindow"]:SetAttribute("type", "spell") + _G["SVUI_ModeCaptureWindow"]:SetAttribute('spell', fishingSpell) + PLUGIN.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 PLUGIN:UpdateFishingMode() + fishingIsKnown = IsSpellKnown(131474); + fishingSpell = GetSpellInfo(131474); +end + +function PLUGIN:LoadFishingMode() + DockButton = _G["SVUI_ModesDockFrame_ToolBarButton"] + PLUGIN:UpdateFishingMode() +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_FightOMatic/Bindings.xml b/Interface/AddOns/SVUI_FightOMatic/Bindings.xml new file mode 100644 index 0000000..78f0b62 --- /dev/null +++ b/Interface/AddOns/SVUI_FightOMatic/Bindings.xml @@ -0,0 +1,5 @@ +<Bindings> + <Binding name="SVUIAOW_RADIO" category="ADDONS" header="SVUIAOW" runOnUp="false"> + SVUISayIncoming() + </Binding> +</Bindings> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_FightOMatic/License.txt b/Interface/AddOns/SVUI_FightOMatic/License.txt new file mode 100644 index 0000000..cc92e9b --- /dev/null +++ b/Interface/AddOns/SVUI_FightOMatic/License.txt @@ -0,0 +1,34 @@ +############################################################################### +#_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # +# ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # +# __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # +# ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # +# ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # +# _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # +# __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # +# _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# +# ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################### +# S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################### + +SVUI_FightOMatic License Copyright 2014 http://wowinterface.com + +The contents of this addon, excluding third-party resources, are +copyrighted to their authors with all rights reserved. + +Authors of this addon hereby grant you the following rights: + +1. You may NOT make any modification inside this addon. If you want + to create your own edited version, please create it from outside. + +2. Do not modify the name of this addon, including the addon folders. + +3. This copyright notice shall be included in all copies or substantial + portions of the Software. + +All rights not explicitly addressed in this license are reserved by +the copyright holders. + +You can write Munglunch at Wowinterface.com for reporting abuse / bugs, +or regarding grants allowed for this license. \ No newline at end of file diff --git a/Interface/AddOns/SVUI_FightOMatic/Loader.lua b/Interface/AddOns/SVUI_FightOMatic/Loader.lua new file mode 100644 index 0000000..970c5cd --- /dev/null +++ b/Interface/AddOns/SVUI_FightOMatic/Loader.lua @@ -0,0 +1,30 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +local AddonName, AddonObject = ... + +assert(LibSuperVillain, AddonName .. " requires LibSuperVillain") + +local PLUGIN = LibSuperVillain:NewPlugin(AddonName, AddonObject) + +local Schema = PLUGIN.Schema; +local SV = _G["SVUI"]; + +SV.configs[Schema] = { + ["enable"] = true, +} \ No newline at end of file diff --git a/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua b/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua new file mode 100644 index 0000000..a288ec2 --- /dev/null +++ b/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.lua @@ -0,0 +1,1164 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +--[[ CONSTANTS ]]-- + +BINDING_HEADER_SVUIAOW = "Supervillain UI: Fight-O-Matic"; +BINDING_NAME_SVUIAOW_RADIO = "Call Out Incoming"; + +--[[ 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 PLUGIN = select(2, ...) +local Schema = PLUGIN.Schema; + +local SV = _G["SVUI"]; +local L = SV.L; + +local NewHook = hooksecurefunc; +--[[ +########################################################## +GLOBAL SLASH FUNCTIONS +########################################################## +]]-- +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 +--[[ +########################################################## +MUNGLUNCH's FAVORITE EMOTE GENERATOR +########################################################## +]]-- +local SpecialEmotes = { + "ROFL", + "CACKLE", + "GIGGLE", + "GRIN", + "SMIRK", + "MOON", + "LICK", + "YAWN", + "FLEX", + "TICKLE", + "TAUNT", + "SHOO", + "PRAY", + "SPIT", + "MOCK", + "GLOAT", + "PITY", + "VIOLIN", + "BYE", +} + +local LowHealthPlayerEmotes = { + "ROFL", + "CACKLE", + "GIGGLE", + "GRIN", + "SMIRK", + "MOON", + "LICK", + "YAWN", + "BITE", + "NOSEPICK" +} + +local LowHealthTargetEmotes = { + "ROFL", + "CACKLE", + "FLEX", + "TICKLE", + "TAUNT", + "SHOO", + "PRAY", + "SPIT", + "MOCK", + "GLOAT", + "PITY", + "VIOLIN", + "BYE", +} + +local KOSEmotes = { + "THREATEN", + "CRACK", + "POINT", + "GRIN", + "SMIRK", + "TAUNT", + "CHICKEN" +} + +local StealthEmotes = { + "CURIOUS", + "EYE", + "GASP", + "GAZE", + "MOCK", + "NOSEPICK", + "PEER", + "POINT", + "READY", + "STARE", + "TAP", +} + + +function SVUIEmote() + local index = random(1,#SpecialEmotes) + DoEmote(SpecialEmotes[index]) +end + +local function LowHealth_PlayerEmote() + local index = random(1,#LowHealthPlayerEmotes) + DoEmote(LowHealthPlayerEmotes[index]) +end + +local function LowHealth_TargetEmote() + local index = random(1,#LowHealthTargetEmotes) + DoEmote(LowHealthTargetEmotes[index]) +end + +local function KOS_Emote() + local index = random(1,#KOSEmotes) + DoEmote(KOSEmotes[index]) +end + +local function Stealth_Emote(name) + local index = random(1,#StealthEmotes) + DoEmote(StealthEmotes[index], name) +end +--[[ +########################################################## +CORE FUNCTIONS +########################################################## +]]-- +local EnemyCache, AlertedCache = {},{} + +local playerGUID = UnitGUID('player') +local playerFaction = UnitFactionGroup("player") +local classColor = RAID_CLASS_COLORS +local classColors = SVUI_CLASS_COLORS[SV.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 = "" +--[[ ICONS ]]-- +local INFO_ICON = [[Interface\AddOns\SVUI_FightOMatic\artwork\PVP-INFO]] +local UTILITY_ICON = [[Interface\AddOns\SVUI_FightOMatic\artwork\PVP-UTILITIES]] +local RADIO_ICON = [[Interface\AddOns\SVUI_FightOMatic\artwork\PVP-RADIO]] +local SCANNER_ICON = [[Interface\AddOns\SVUI_FightOMatic\artwork\PVP-SCANNER]] +local ICON_FILE = [[Interface\AddOns\SVUI_FightOMatic\artwork\DOCK-PVP]] +local PVP_SAFE = [[Interface\AddOns\SVUI_FightOMatic\artwork\PVP-SAFE]] +local PVP_HELP = [[Interface\AddOns\SVUI_FightOMatic\artwork\PVP-INCOMING]] +local PVP_LOST = [[Interface\WorldMap\Skull_64Red]] +local linkString = "|Hplayer:%s:1|h%s|h" +--[[ BG MAP DATA ]]-- +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 PVP_POI = { +-- [401] = { --Alterac Valley (15) +-- "Stormpike Aid Station", "Dun Baldar North Bunker", "Dun Baldar South Bunker", +-- "Stormpike Graveyard", "Icewing Bunker", "Stonehearth Graveyard", +-- "Stonehearth Bunker", "Snowfall Graveyard", "Iceblood Tower", +-- "Iceblood Graveyard", "Tower Point", "Frostwolf Graveyard", +-- "West Frostwolf Tower", "East Frostwolf Tower", "Frostwolf Relief Hut" +-- }, +-- [935] = { --Deepwind Gorge (2) +-- "Horde Cart", "Alliance Cart" +-- }, +-- [482] = { --Eye of the Storm (1) +-- "Flag" +-- }, +-- [860] = { --Silvershard Mines (1) +-- "Cart" +-- }, +-- [512] = { --Strand of the Ancients (5) +-- "Green Emerald", "Blue Sapphire", "Purple Amethyst", "Red Sun", "Yellow Moon" +-- }, +-- [540] = { --Isle of Conquest (5) +-- "Quarry", "Hangar", "Workshop", "Docks", "Refinery" +-- }, +-- [856] = { --Temple of Kotmogu (4) +-- "Red Orb", "Blue Orb", "Orange Orb", "Purple Orb" +-- }, +-- [626] = { --Twin Peaks (2) +-- "Horde Flag", "Alliance Flag" +-- }, +-- [443] = { --Warsong Gulch (2) +-- "Horde Flag", "Alliance Flag" +-- }, +-- } + +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, classToken, race, raceToken, sex, name, realm = GetPlayerInfoByGUID(guid) + local colors = classColor[classToken] or fallbackColor + EnemyCache[guid] = { + ["name"] = name, + ["realm"] = realm, + ["class"] = class, + ["race"] = race, + ["sex"] = sex, + ["colors"] = colors, + ["time"] = timestamp + } + PLUGIN:ScannerLog(EnemyCache[guid]) + return EnemyCache[guid]; +end + +local function SaveEnemyScan(guid, timestamp) + local enemy = EnemyCache[guid] + if(not enemy) then enemy = AddEnemyScan(guid, timestamp) end + FightOMatic_Cache[guid] = { + ["name"] = enemy.name, + ["realm"] = enemy.realm, + ["class"] = enemy.class, + ["race"] = enemy.race, + ["sex"] = enemy.sex, + ["colors"] = enemy.colors, + ["time"] = enemy.timestamp + } + local msg = ("Killed By: %s"):format(enemy.name); + HeadsUpAlarm(msg, CombatText_StandardScroll, enemy.colors.r, enemy.colors.g, enemy.colors.b, "sticky"); + PLUGIN:UpdateSummary() +end + +local function KilledEnemyHandler(guid) + local enemy = FightOMatic_Cache[guid] + if(enemy) then + HeadsUpAlarm(("Killed Mortal Enemy: %s"):format(enemy.name), CombatText_StandardScroll, 0.2, 1, 0.1, "sticky"); + end + enemy = EnemyCache[guid] + if(enemy) then + HeadsUpAlarm(("Killed Enemy: %s"):format(enemy.name), CombatText_StandardScroll, 0.1, 0.8, 0); + end +end + +local function ClearCacheScans() + wipe(EnemyCache) + wipe(AlertedCache) + if(PLUGIN.LOG and PLUGIN.LOG.Output) then PLUGIN.LOG.Output:Clear() end +end + +local function ClearSavedScans() + FightOMatic_Cache = {} +end + +local function EnemyAlarm(name, class, colors, kos) + if not name then return end + 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) + elseif(class and colors) then + msg = ("%s Detected"):format(class); + HeadsUpAlarm(msg, CombatText_StandardScroll, colors.r, colors.g, colors.b) + end + AlertedCache[name] = true + end +end + +local function StealthAlarm(spell, name) + local msg = ("%s Detected!"):format(spell); + HeadsUpAlarm(msg, CombatText_StandardScroll, 1, 0.5, 0); + print(("%s has %sed nearby!"):format(name, spell)) + --Stealth_Emote(name) +end + +function PLUGIN:UpdateSummary() + self.Summary:Clear(); + local stored = FightOMatic_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.Summary:AddMessage(("You Have |cffff5500%s|r Mortal Enemies"):format(amount), 0.8, 0.8, 0.8); +end + +function PLUGIN:ResetLogs() + wipe(EnemyCache) + self.Title:Clear(); + self.Summary:Clear(); + self.LOG.Output:Clear(); + self.Title:AddMessage(("Scanning %s"):format(ACTIVE_ZONE), 1, 1, 0); + self.Switch:Show() + local stored = FightOMatic_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.Summary:AddMessage(("You Have |cffff5500%s|r Mortal Enemies"):format(amount), 0.8, 0.8, 0.8) + collectgarbage("collect") +end + +function PLUGIN:PopulateKOS() + self.Title:Clear(); + self.Summary:Clear(); + self.LOG.Output:Clear(); + self.Title:AddMessage(("Scanning %s"):format(ACTIVE_ZONE), 1, 1, 0); + self.Switch:Show() + local stored = FightOMatic_Cache; + local amount = 0 + for _,data in pairs(stored) do + if type(data) == "table" and data.name and data.class and data.race then + amount = amount + 1; + local nameLink = linkString:format(data.name, data.name) + local hex = ("%s - %s %s"):format(nameLink, data.race, data.class) + self.LOG.Output:AddMessage(hex, data.colors.r, data.colors.g, data.colors.b); + end + end + self.Summary:AddMessage(("You Have |cffff5500%s|r Mortal Enemies"):format(amount), 0.8, 0.8, 0.8) +end + +function PLUGIN:PopulateScans() + self.COMM.Unavailable:Hide() + self.Title:Clear(); + self.Summary:Clear(); + self.LOG.Output:Clear(); + self.Title:AddMessage(("Scanning %s"):format(ACTIVE_ZONE), 1, 1, 0); + self.Switch:Show() + local stored = FightOMatic_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.Summary:AddMessage(("You Have |cffff5500%s|r Mortal Enemies"):format(amount), 0.8, 0.8, 0.8); + for _,data in pairs(EnemyCache) do + if type(data) == "table" and data.name and data.class and data.race then + local nameLink = linkString:format(data.name, data.name) + local hex = ("%s - %s %s"):format(nameLink, data.race, data.class) + self.LOG.Output:AddMessage(hex, data.colors.r, data.colors.g, data.colors.b); + end + end +end + +function PLUGIN:PauseScanner() + if(not self.InPVP) then + self.Title:Clear(); + self.Summary:Clear(); + self.LOG.Output:Clear(); + self.Title:AddMessage("Scanning Paused", 1, 0.1, 0); + self.Summary:AddMessage(ACTIVE_ZONE, 1, 0.75, 0); + self.Switch:Hide() + self.LOG.Output:AddMessage(" ", 1, 1, 1); + self.LOG.Output:AddMessage(" ", 1, 1, 1); + self.LOG.Output:AddMessage("The Enenmy Scanner Will Resume", 0.8, 0.8, 0.8); + self.LOG.Output:AddMessage("When You Leave This BattleGround", 0.8, 0.8, 0.8); + else + self:PopulateScans() + end +end + +function PLUGIN:ScannerLog(enemy) + if(not enemy.name or not enemy.race or not enemy.class) then return end + local nameLink = linkString:format(enemy.name, enemy.name) + local hex = ("%s - %s %s"):format(nameLink, enemy.race, enemy.class) + self.LOG.Output:AddMessage(hex, enemy.colors.r, enemy.colors.g, enemy.colors.b); + EnemyAlarm(enemy.name, enemy.class, enemy.colors) +end + +function PLUGIN:UpdateCommunicator() + if(not self.InPVP) then + local mapID = GetCurrentMapAreaID() + if(mapID) then + local points = PVP_NODES[mapID] + if(points) then + self.COMM.Unavailable:Hide() + 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 + self:UnregisterEvent("UPDATE_BATTLEFIELD_SCORE") + self.Scanning = false + self:PauseScanner() + end + end + elseif(self.InPVP) then + self.COMM.Unavailable:Show() + 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 + self:RegisterEvent("UPDATE_BATTLEFIELD_SCORE") + self.Scanning = true + + self:PopulateScans() + end +end + +function PLUGIN:UpdateZoneStatus() + if PLUGIN.ZoneTimer then return end + local zoneText = GetRealZoneText() or GetZoneText() + if(not zoneText or zoneText == "") then + PLUGIN.ZoneTimer = SV.Timers:ExecuteTimer(PLUGIN.UpdateZoneStatus, 5) + return + end + if(zoneText ~= ACTIVE_ZONE) then + ClearCacheScans() + ACTIVE_ZONE = zoneText + PLUGIN.Title:Clear(); + PLUGIN.Title:AddMessage(("Scanning %s"):format(ACTIVE_ZONE), 1, 1, 0); + end + local zonePvP = GetZonePVPInfo() + if(zonePvP == "sanctuary" or zoneText == "") then + PLUGIN.Scanning = false + else + PLUGIN.Scanning = true + local inInstance, instanceType = IsInInstance() + if(inInstance and ((instanceType == "party") or (instanceType == "raid"))) then + PLUGIN.Scanning = false + elseif (not zonePvP or (zonePvP == "friendly") or (not UnitIsPVP("player"))) then + PLUGIN.Scanning = false + elseif(instanceType == "pvp") then + PLUGIN:PauseScanner() + PLUGIN.Scanning = false + if(not PLUGIN.InPVP) then + PLUGIN:UpdateCommunicator() + end + end + end + PLUGIN.ZoneTimer = nil +end + +local function ParseIncomingLog(timestamp, event, eGuid, eName, pGuid) + local cached = FightOMatic_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 +end + +local function GetSourceType(guid) + if not guid then return end + local subStr, binStr, bitVal, srcType + subStr = guid:sub(3, 5) + binStr = ("0x%s"):format(subStr) + bitVal = tonumber(binStr) + if(not bitVal) then return end + srcType = band(bitVal, 0x00F) + return srcType +end + +function PLUGIN:COMBAT_LOG_EVENT_UNFILTERED(event, timestamp, event, _, srcGUID, srcName, srcFlags, sourceRaidFlags, dstGUID, dstName, dstFlags, destRaidFlags, _, spellName) + if not srcFlags then return end + local flagParse = band(srcFlags, COMBATLOG_OBJECT_REACTION_HOSTILE) + local flagged = flagParse == COMBATLOG_OBJECT_REACTION_HOSTILE + + if(flagged) then + if(srcGUID and srcName) then + local isHostile = CombatLog_Object_IsA(srcFlags, COMBATLOG_FILTER_HOSTILE_PLAYERS) + local srcType = GetSourceType(srcGUID) + if(srcType and (srcType == 0 or srcType == 8) and isHostile) then + if(event == "SPELL_AURA_APPLIED" and (spellName == L["Stealth"] or spellName == L["Prowl"])) then + StealthAlarm(spellName, srcName) + end + if(dstGUID == playerGUID) then + PLUGIN.HitBy = srcGUID + end + if(not PLUGIN.Scanning) then return end + ParseIncomingLog(timestamp, event, srcGUID, srcName, dstGUID) + 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 and (srcType == 0 or srcType == 8) and isHostile) then + ParseIncomingLog(timestamp, event, dstGUID, dstName, srcGUID) + end + end + end + + if(PLUGIN.Scanning and event == "PARTY_KILL") then + if(srcGUID == playerGUID and dstName) then + KilledEnemyHandler(dstGUID) + end + end +end + +function PLUGIN:EventDistributor(event, ...) + local inInstance, instanceType = IsInInstance() + + if(event == "PLAYER_REGEN_ENABLED") then + self.HitBy = false; + if(instanceType == "pvp") then self.Scanning = false end + else + if(instanceType ~= "pvp") then + if(event == "PLAYER_TARGET_CHANGED") then + if(UnitIsPlayer("target") and UnitIsEnemy("target", "player")) then + local guid = UnitGUID("target") + if(not EnemyCache[guid]) then + local timestamp = time() + AddEnemyScan(guid, timestamp) + end + if(FightOMatic_Cache[guid]) then + HeadsUpAlarm("Kill On Sight!", CombatText_StandardScroll, 1, 0, 0, "crit") + --KOS_Emote() + end + end + elseif(event == "PLAYER_DEAD") then + local guid = self.HitBy + if(guid and guid ~= "") then + local stamp = time() + SaveEnemyScan(guid, stamp) + end + end + else + self.Scanning = false + end + end +end + +local onMouseWheel = function(self, delta) + if (delta > 0) then + self:ScrollUp() + elseif (delta < 0) then + self:ScrollDown() + end +end + +local function MakeLogWindow() + local frame = CreateFrame("Frame", nil, UIParent) + + frame:SetFrameStrata("MEDIUM") + frame:SetPoint("TOPLEFT", PLUGIN.Summary, "BOTTOMLEFT",0,0) + frame:SetPoint("BOTTOMRIGHT", SVUI_FightOMaticDock, "BOTTOMRIGHT",0,0) + frame:SetParent(SVUI_FightOMaticDock) + + local output = CreateFrame("ScrollingMessageFrame", nil, frame) + output:SetSpacing(4) + output:SetClampedToScreen(false) + output:SetFrameStrata("MEDIUM") + output:SetAllPoints(frame) + output:SetFont(SV.Media.font.system, 11, "OUTLINE") + output:SetJustifyH("CENTER") + output:SetJustifyV("MIDDLE") + output:SetShadowColor(0, 0, 0, 0) + output:SetMaxLines(120) + output:EnableMouseWheel(true) + output:SetHyperlinksEnabled(true) + output:SetScript("OnMouseWheel", onMouseWheel) + output:SetFading(false) + output:SetInsertMode('TOP') + + output:SetScript("OnHyperlinkEnter", function(self, linkData, link, button) + local t = link:explode(":") + local name = t[2] or "" + SVUI_TargetScanButton:SetAttribute("macrotext", ("/tar %s"):format(name)) + SVUI_TargetScanButton:EnableMouse(true) + end) + + frame.Output = output + + PLUGIN.LOG = frame + + _G["SVUI_FightOMaticTool1"].Window = PLUGIN.LOG +end + +local function MakeCommWindow() + + local frame = CreateFrame("Frame", nil, UIParent) + + frame:SetFrameStrata("MEDIUM") + frame:SetPoint("TOPLEFT", PLUGIN.Summary, "BOTTOMLEFT",0,0) + frame:SetPoint("BOTTOMRIGHT", SVUI_FightOMaticDock, "BOTTOMRIGHT",0,0) + frame:SetParent(SVUI_FightOMaticDock) + + local fallback = CreateFrame("Frame", nil, frame) + fallback:SetAllPoints(frame) + + local fbText = fallback:CreateFontString(nil, "OVERLAY") + fbText:SetAllPoints(fallback) + fbText:SetFont(SV.Media.font.roboto, 12, "NONE") + fbText:SetText("Nothing To Broadcast Right Now") + + frame.Unavailable = fallback + + local DOCK_WIDTH = frame:GetWidth(); + local DOCK_HEIGHT = frame:GetHeight(); + local BUTTON_SIZE = (DOCK_HEIGHT * 0.25) - 4; + local sectionWidth = (DOCK_WIDTH / 6) - 2 + local sectionHeight = (DOCK_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, frame) + poi:SetSize((DOCK_WIDTH - 2), sectionHeight) + poi:SetPoint("TOP", frame, "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(SV.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 + + PLUGIN.COMM = frame + + _G["SVUI_FightOMaticTool2"].Window = PLUGIN.COMM + + PLUGIN.COMM:Hide() +end + +local function MakeUtilityWindow() + local frame = CreateFrame("Frame", nil, UIParent) + + frame:SetFrameStrata("MEDIUM") + frame:SetPoint("TOPLEFT", PLUGIN.Summary, "BOTTOMLEFT",0,0) + frame:SetPoint("BOTTOMRIGHT", SVUI_FightOMaticDock, "BOTTOMRIGHT",0,0) + frame:SetParent(SVUI_FightOMaticDock) + + local fbText = frame:CreateFontString(nil, "OVERLAY") + fbText:SetAllPoints(frame) + fbText:SetFont(SV.Media.font.roboto, 12, "NONE") + fbText:SetText("Utilities Coming Soon....") + + PLUGIN.TOOL = frame + + _G["SVUI_FightOMaticTool3"].Window = PLUGIN.TOOL + + PLUGIN.TOOL:Hide() +end + +local function MakeInfoWindow() + local frame = CreateFrame("Frame", nil, UIParent) + + frame:SetFrameStrata("MEDIUM") + frame:SetPoint("TOPLEFT", PLUGIN.Summary, "BOTTOMLEFT",0,0) + frame:SetPoint("BOTTOMRIGHT", SVUI_FightOMaticDock, "BOTTOMRIGHT",0,0) + frame:SetParent(SVUI_FightOMaticDock) + + local DATA_WIDTH = (frame:GetWidth() * 0.5) - 2; + local DATA_HEIGHT = frame:GetHeight() - 2; + + local leftColumn = CreateFrame("Frame", "SVUI_FightOMaticInfoLeft", frame) + leftColumn:Size(DATA_WIDTH, DATA_HEIGHT) + leftColumn:Point("LEFT", frame, "LEFT", 0, 0) + leftColumn.lockedOpen = true + SV.SVStats:NewAnchor(leftColumn, 3, "ANCHOR_CURSOR", nil, "Transparent", true) + leftColumn:SetFrameLevel(0) + + local rightColumn = CreateFrame("Frame", "SVUI_FightOMaticInfoRight", frame) + rightColumn:Size(DATA_WIDTH, DATA_HEIGHT) + rightColumn:Point("LEFT", leftColumn, "RIGHT", 2, 0) + rightColumn.lockedOpen = true + SV.SVStats:NewAnchor(rightColumn, 3, "ANCHOR_CURSOR", nil, "Transparent", true) + rightColumn:SetFrameLevel(0) + + PLUGIN.INFO = frame + + _G["SVUI_FightOMaticTool4"].Window = PLUGIN.INFO + + SV.SVStats.BGPanels = { + ["SVUI_FightOMaticInfoLeft"] = {top = "Honor", middle = "Kills", bottom = "Assists"}, + ["SVUI_FightOMaticInfoRight"] = {top = "Damage", middle = "Healing", bottom = "Deaths"} + } + + SV.SVStats:Generate() + + PLUGIN.INFO:Hide() +end +--[[ +########################################################## +DOCK ELEMENT HANDLERS +########################################################## +]]-- +local FightOMaticAlert_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.TText, 1, 1, 0) + GameTooltip:Show() +end + +local FightOMaticAlert_OnLeave = function(self) + GameTooltip:Hide() + if InCombatLockdown() then return end + self:SetBackdropColor(0.25, 0.52, 0.1) +end + +local FightOMaticAlert_OnHide = function() + if InCombatLockdown() then + SV:AddonMessage(ERR_NOT_IN_COMBAT); + return; + end + SuperDockAlertRight:Deactivate() +end + +local FightOMaticAlert_OnShow = function(self) + if InCombatLockdown() then + SV:AddonMessage(ERR_NOT_IN_COMBAT); + self:Hide() + return; + end + SV:SecureFadeIn(self, 0.3, 0, 1) + SuperDockAlertRight:Activate(self) +end + +local FightOMaticAlert_OnMouseDown = function(self) + -- DO STUFF + SV:SecureFadeOut(self, 0.5, 1, 0, true) +end + +local FightOMaticTool_OnEnter = function(self) + if InCombatLockdown() then return; end + self.icon:SetGradient(unpack(SV.Media.gradient.yellow)) + GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) + GameTooltip:ClearLines() + GameTooltip:AddLine(self.TText, 1, 1, 1) + GameTooltip:Show() +end + +local FightOMaticTool_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 FightOMaticTool_OnMouseDown = function(self) + SV:SecureFadeOut(PLUGIN.LOG, 0.5, 1, 0, true) + SV:SecureFadeOut(PLUGIN.COMM, 0.5, 1, 0, true) + SV:SecureFadeOut(PLUGIN.TOOL, 0.5, 1, 0, true) + SV:SecureFadeOut(PLUGIN.INFO, 0.5, 1, 0, true) + SV:SecureFadeIn(self.Window, 0.3, 0, 1) + PLUGIN.Title:Clear(); + PLUGIN.Title:AddMessage(self.TTitle, 1, 1, 0); +end + +local Scanner_OnMouseDown = function(self) + SV:SecureFadeOut(PLUGIN.LOG, 0.5, 1, 0, true) + SV:SecureFadeOut(PLUGIN.COMM, 0.5, 1, 0, true) + SV:SecureFadeOut(PLUGIN.TOOL, 0.5, 1, 0, true) + SV:SecureFadeOut(PLUGIN.INFO, 0.5, 1, 0, true) + SV:SecureFadeIn(self.Window, 0.3, 0, 1) + PLUGIN:PopulateScans() +end + +local Switch_OnEnter = function(self) + GameTooltip:SetOwner(self, "ANCHOR_TOPLEFT", 0, 4) + GameTooltip:ClearLines() + if(self.ShowingKOS) then + GameTooltip:AddDoubleLine("Click", "Show Scan List", 0.1, 1, 0.2, 1, 1, 1) + else + GameTooltip:AddDoubleLine("Click", 'Show "Kill On Sight" List', 0.1, 1, 0.2, 1, 1, 1) + end + GameTooltip:AddDoubleLine("[SHIFT] Click", "Clear All Scans", 0.1, 1, 0.2, 1, 1, 1) + GameTooltip:AddDoubleLine("[CTRL] Click", 'Clear All "Kill On Sight"', 0.1, 1, 0.2, 1, 1, 1) + GameTooltip:Show() +end + +local Switch_OnLeave = function(self) + GameTooltip:Hide() +end + +local Switch_OnClick = function(self, button) + Switch_OnLeave(self) + if(IsControlKeyDown()) then + ClearSavedScans() + PLUGIN:ResetLogs() + elseif(IsShiftKeyDown()) then + ClearCacheScans() + else + if(self.ShowingKOS) then + PLUGIN:PopulateScans() + self.ShowingKOS = false + else + PLUGIN:PopulateKOS() + self.ShowingKOS = true + end + end + Switch_OnEnter(self) +end +--[[ +########################################################## +BUILD FUNCTION +########################################################## +]]-- +function PLUGIN:Load() + if SVAOW_Data then SVAOW_Data = nil end + if SVAOW_Cache then SVAOW_Cache = nil end + + if(not SV.db[Schema].enable) then return end + + local ALERT_HEIGHT = 60; + local DOCK_WIDTH = SuperDockWindowRight:GetWidth(); + local DOCK_HEIGHT = SuperDockWindowRight:GetHeight(); + local BUTTON_SIZE = (DOCK_HEIGHT * 0.25) - 4; + + if(not FightOMatic_Data) then FightOMatic_Data = {} end + if(not FightOMatic_Cache) then FightOMatic_Cache = {} end + + self.HitBy = false; + self.Scanning = false; + self.InPVP = false + + local holder = CreateFrame("Frame", "SVUI_FightOMaticDock", SuperDockWindowRight) + holder:SetFrameStrata("BACKGROUND") + holder:SetWidth(DOCK_WIDTH - 4); + holder:SetHeight(DOCK_HEIGHT - 4); + holder:SetPoint("CENTER",SuperDockWindowRight,"CENTER",0,0); + + local toolBar = CreateFrame("Frame", "SVUI_FightOMaticToolBar", holder) + toolBar:SetWidth(BUTTON_SIZE + 4); + toolBar:SetHeight((BUTTON_SIZE + 4) * 4); + toolBar:SetPoint("BOTTOMLEFT",holder,"BOTTOMLEFT",0,0); + + local tbDivider = toolBar:CreateTexture(nil,"OVERLAY") + tbDivider:SetTexture(0,0,0,0.5) + tbDivider:SetPoint("TOPRIGHT") + tbDivider:SetPoint("BOTTOMRIGHT") + tbDivider:SetWidth(1) + + local tool4 = CreateFrame("Frame", "SVUI_FightOMaticTool4", toolBar) + tool4:SetPoint("BOTTOM",toolBar,"BOTTOM",0,0) + tool4:SetSize(BUTTON_SIZE,BUTTON_SIZE) + tool4.icon = tool4:CreateTexture(nil, 'OVERLAY') + tool4.icon:SetTexture(INFO_ICON) + tool4.icon:FillInner(tool4) + tool4.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + tool4.TText = "Stats" + tool4.TTitle = "Statistics and Information" + tool4:SetScript('OnEnter', FightOMaticTool_OnEnter) + tool4:SetScript('OnLeave', FightOMaticTool_OnLeave) + tool4:SetScript('OnMouseDown', FightOMaticTool_OnMouseDown) + + local tool3 = CreateFrame("Frame", "SVUI_FightOMaticTool3", toolBar) + tool3:SetPoint("BOTTOM",tool4,"TOP",0,2) + tool3:SetSize(BUTTON_SIZE,BUTTON_SIZE) + tool3.icon = tool3:CreateTexture(nil, 'OVERLAY') + tool3.icon:SetTexture(UTILITY_ICON) + tool3.icon:FillInner(tool3) + tool3.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + tool3.TText = "Tools" + tool3.TTitle = "Tools and Utilities" + tool3:SetScript('OnEnter', FightOMaticTool_OnEnter) + tool3:SetScript('OnLeave', FightOMaticTool_OnLeave) + tool3:SetScript('OnMouseDown', FightOMaticTool_OnMouseDown) + + local tool2 = CreateFrame("Frame", "SVUI_FightOMaticTool2", toolBar) + tool2:SetPoint("BOTTOM",tool3,"TOP",0,2) + tool2:SetSize(BUTTON_SIZE,BUTTON_SIZE) + tool2.icon = tool2:CreateTexture(nil, 'OVERLAY') + tool2.icon:SetTexture(RADIO_ICON) + tool2.icon:FillInner(tool2) + tool2.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + tool2.TText = "Radio" + tool2.TTitle = "Radio Communicator" + tool2:SetScript('OnEnter', FightOMaticTool_OnEnter) + tool2:SetScript('OnLeave', FightOMaticTool_OnLeave) + tool2:SetScript('OnMouseDown', FightOMaticTool_OnMouseDown) + + local tool1 = CreateFrame("Frame", "SVUI_FightOMaticTool1", toolBar) + tool1:SetPoint("BOTTOM",tool2,"TOP",0,2) + tool1:SetSize(BUTTON_SIZE,BUTTON_SIZE) + tool1.icon = tool1:CreateTexture(nil, 'OVERLAY') + tool1.icon:SetTexture(SCANNER_ICON) + tool1.icon:FillInner(tool1) + tool1.icon:SetGradient("VERTICAL", 0.5, 0.53, 0.55, 0.8, 0.8, 1) + tool1.TText = "Scanner" + tool1.TTitle = "Enemy Scanner" + tool1:SetScript('OnEnter', FightOMaticTool_OnEnter) + tool1:SetScript('OnLeave', FightOMaticTool_OnLeave) + tool1:SetScript('OnMouseDown', Scanner_OnMouseDown) + + local title = CreateFrame("ScrollingMessageFrame", nil, holder) + title:SetSpacing(4) + title:SetClampedToScreen(false) + title:SetFrameStrata("MEDIUM") + title:SetPoint("TOPLEFT", toolBar, "TOPRIGHT",0,0) + title:SetPoint("BOTTOMRIGHT", holder, "TOPRIGHT",0,-16) + title:SetFontTemplate(SV.Media.font.names, 16, "OUTLINE", "CENTER", "MIDDLE") + title:SetMaxLines(1) + title:EnableMouseWheel(false) + title:SetFading(false) + title:SetInsertMode('TOP') + + local divider1 = title:CreateTexture(nil,"OVERLAY") + divider1:SetTexture(0,0,0,0.5) + divider1:SetPoint("BOTTOMLEFT") + divider1:SetPoint("BOTTOMRIGHT") + divider1:SetHeight(1) + + self.Title = title + + local listbutton = CreateFrame("Button", nil, holder) + listbutton:SetPoint("TOPLEFT", title, "BOTTOMLEFT",0,0) + listbutton:SetPoint("BOTTOMRIGHT", title, "BOTTOMRIGHT",0,-14) + listbutton:SetButtonTemplate(true) + listbutton.ShowingKOS = false + listbutton:SetScript("OnEnter", Switch_OnEnter) + listbutton:SetScript("OnLeave", Switch_OnLeave) + listbutton:SetScript("OnClick", Switch_OnClick) + + self.Switch = listbutton + + local summary = CreateFrame("ScrollingMessageFrame", nil, holder) + summary:SetSpacing(4) + summary:SetClampedToScreen(false) + summary:SetFrameStrata("MEDIUM") + summary:SetPoint("TOPLEFT", title, "BOTTOMLEFT",0,0) + summary:SetPoint("BOTTOMRIGHT", title, "BOTTOMRIGHT",0,-14) + summary:SetFontTemplate(SV.Media.font.system, 12, "OUTLINE", "CENTER", "MIDDLE") + summary:SetMaxLines(1) + summary:EnableMouse(false) + summary:SetFading(false) + summary:SetInsertMode('TOP') + + self.Summary = summary + + local divider2 = summary:CreateTexture(nil,"OVERLAY") + divider2:SetTexture(0,0,0,0.5) + divider2:SetPoint("BOTTOMLEFT") + divider2:SetPoint("BOTTOMRIGHT") + divider2:SetHeight(1) + + MakeLogWindow() + MakeCommWindow() + MakeUtilityWindow() + MakeInfoWindow() + + SV:RegisterDocklet("SVUI_FightOMaticDock", "Art of War", ICON_FILE) + + holder:Hide() + + self:ResetLogs() + + local targetButton = CreateFrame("Button", "SVUI_TargetScanButton", UIParent, "SecureActionButtonTemplate") + targetButton:SetAllPoints(self.LOG) + targetButton:SetFrameLevel(99) + targetButton:RegisterForClicks("AnyUp") + targetButton:SetAttribute("type1", "macro") + targetButton:SetAttribute("macrotext", "/tar") + targetButton:EnableMouse(false) + targetButton:HookScript("OnClick", function(this) this:EnableMouse(false) end) + + self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED") + + self:RegisterEvent("PLAYER_TARGET_CHANGED", "EventDistributor") + self:RegisterEvent("PLAYER_REGEN_ENABLED", "EventDistributor") + self:RegisterEvent("PLAYER_DEAD", "EventDistributor") + + self:RegisterEvent("ZONE_CHANGED", "UpdateZoneStatus") + self:RegisterEvent("ZONE_CHANGED_NEW_AREA", "UpdateZoneStatus") + self:RegisterEvent("UNIT_FACTION", "UpdateZoneStatus") + + self:RegisterEvent("PLAYER_ENTERING_WORLD", "UpdateCommunicator") + self:RegisterEvent("UPDATE_BATTLEFIELD_SCORE", "UpdateCommunicator") + + --SVUI_Player.Health.LowAlertFunc = LowHealth_PlayerEmote + --SVUI_Target.Health.LowAlertFunc = LowHealth_TargetEmote +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.toc b/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.toc new file mode 100644 index 0000000..cfb7232 --- /dev/null +++ b/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.toc @@ -0,0 +1,14 @@ +## Interface: 60000 +## Author: Munglunch +## Version: 4.7 +## Title: |cffFF9900SVUI |r|cffFFEF00Fight O Matic|r +## Notes: Supervillain UI [|cff9911FFPvP Tools|r]. +## SavedVariables: FightOMatic_Data +## SavedVariablesPerCharacter: FightOMatic_Cache +## RequiredDeps: SVUI +## LoadOnDemand: 1 +## X-Email: munglunch@gmail.com +## X-SVUI-Header: Fight-O-Matic +## X-SVUI-Schema: FightOMatic + +SVUI_FightOMatic.xml diff --git a/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.xml b/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.xml new file mode 100644 index 0000000..7bef3c2 --- /dev/null +++ b/Interface/AddOns/SVUI_FightOMatic/SVUI_FightOMatic.xml @@ -0,0 +1,4 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Script file='Loader.lua'/> + <Script file='SVUI_FightOMatic.lua'/> +</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_FightOMatic/artwork/DOCK-PVP.blp b/Interface/AddOns/SVUI_FightOMatic/artwork/DOCK-PVP.blp new file mode 100644 index 0000000..a51de9a Binary files /dev/null and b/Interface/AddOns/SVUI_FightOMatic/artwork/DOCK-PVP.blp differ diff --git a/Interface/AddOns/SVUI_FightOMatic/artwork/PVP-INCOMING.blp b/Interface/AddOns/SVUI_FightOMatic/artwork/PVP-INCOMING.blp new file mode 100644 index 0000000..f72c045 Binary files /dev/null and b/Interface/AddOns/SVUI_FightOMatic/artwork/PVP-INCOMING.blp differ diff --git a/Interface/AddOns/SVUI_FightOMatic/artwork/PVP-INFO.blp b/Interface/AddOns/SVUI_FightOMatic/artwork/PVP-INFO.blp new file mode 100644 index 0000000..112e648 Binary files /dev/null and b/Interface/AddOns/SVUI_FightOMatic/artwork/PVP-INFO.blp differ diff --git a/Interface/AddOns/SVUI_FightOMatic/artwork/PVP-RADIO.blp b/Interface/AddOns/SVUI_FightOMatic/artwork/PVP-RADIO.blp new file mode 100644 index 0000000..8d38764 Binary files /dev/null and b/Interface/AddOns/SVUI_FightOMatic/artwork/PVP-RADIO.blp differ diff --git a/Interface/AddOns/SVUI_FightOMatic/artwork/PVP-SAFE.blp b/Interface/AddOns/SVUI_FightOMatic/artwork/PVP-SAFE.blp new file mode 100644 index 0000000..4c84f3e Binary files /dev/null and b/Interface/AddOns/SVUI_FightOMatic/artwork/PVP-SAFE.blp differ diff --git a/Interface/AddOns/SVUI_FightOMatic/artwork/PVP-SCANNER.blp b/Interface/AddOns/SVUI_FightOMatic/artwork/PVP-SCANNER.blp new file mode 100644 index 0000000..6bcd5d3 Binary files /dev/null and b/Interface/AddOns/SVUI_FightOMatic/artwork/PVP-SCANNER.blp differ diff --git a/Interface/AddOns/SVUI_FightOMatic/artwork/PVP-UTILITIES.blp b/Interface/AddOns/SVUI_FightOMatic/artwork/PVP-UTILITIES.blp new file mode 100644 index 0000000..eef0a56 Binary files /dev/null and b/Interface/AddOns/SVUI_FightOMatic/artwork/PVP-UTILITIES.blp differ diff --git a/Interface/AddOns/SVUI_Laborer/Bindings.xml b/Interface/AddOns/SVUI_Laborer/Bindings.xml deleted file mode 100644 index 2a3cd5f..0000000 --- a/Interface/AddOns/SVUI_Laborer/Bindings.xml +++ /dev/null @@ -1,14 +0,0 @@ -<Bindings> - <Binding name="SVUILABORER_FISH" category="ADDONS" header="SVUILABORER" runOnUp="false"> - SVUIFishingMode() - </Binding> - <Binding name="SVUILABORER_FARM" category="ADDONS" runOnUp="false"> - SVUIFarmingMode() - </Binding> - <Binding name="SVUILABORER_ARCH" category="ADDONS" runOnUp="false"> - SVUIArchaeologyMode() - </Binding> - <Binding name="SVUILABORER_COOK" category="ADDONS" 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 deleted file mode 100644 index bae6d5f..0000000 --- a/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.lua +++ /dev/null @@ -1,669 +0,0 @@ ---[[ -############################################################################## -_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # - ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # - __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # - ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # - ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # - _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # - __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # - _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# - ___\///////////___________\///___________\/////////_____\///////////_# -############################################################################## -S U P E R - V I L L A I N - U I By: Munglunch # -############################################################################## -########################################################## -LOCALIZED LUA FUNCTIONS -########################################################## -]]-- - ---[[ CONSTANTS ]]-- - -BINDING_HEADER_SVUILABORER = "Supervillain UI: Laborer"; -BINDING_NAME_SVUILABORER_FISH = "Toggle Fishing Mode"; -BINDING_NAME_SVUILABORER_FARM = "Toggle Farming Mode"; -BINDING_NAME_SVUILABORER_COOK = "Toggle Cooking Mode"; -BINDING_NAME_SVUILABORER_ARCH = "Toggle Archaeology Mode"; - ---[[ 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 SV = SVUI -local SVLib = LibSuperVillain -local L = SVLib:Lang() -local NewHook = hooksecurefunc; - -local playerGUID = UnitGUID('player') -local classColor = RAID_CLASS_COLORS - -PLUGIN = SVLib:NewPrototype(SVUIAddOnName) -local Schema = PLUGIN.Schema; - -_G["LaborVillain"] = PLUGIN; ---[[ -########################################################## -GLOBAL BINDINGS -########################################################## -]]-- -function SVUIFishingMode() - if InCombatLockdown() then SV: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 SV:AddonMessage(ERR_NOT_IN_COMBAT); return; end - if PLUGIN.CurrentMode and SV.CurrentMode == "Farming" then PLUGIN:EndJobModes() else PLUGIN:SetJobMode("Farming") end -end - -function SVUIArchaeologyMode() - if InCombatLockdown() then SV: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 SV: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[SV.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 = SV:DeFormat(msg, LOOT_ITEM_CREATED_SELF) - if not item then - item = SV:DeFormat(msg, LOOT_ITEM_SELF_MULTIPLE) - if not item then - item = SV:DeFormat(msg, LOOT_ITEM_SELF) - if not item then - item = SV:DeFormat(msg, LOOT_ITEM_PUSHED_SELF_MULTIPLE) - if not item then - item, amt = SV: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(SV.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(0,0,0,0.5) - title.divider:SetPoint("BOTTOMLEFT") - title.divider:SetPoint("BOTTOMRIGHT") - title.divider:SetHeight(1) - - local topleftline = title:CreateTexture(nil,"OVERLAY") - topleftline:SetTexture(0,0,0,0.5) - 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:SetFontTemplate(nil, 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(0,0,0,0.5) - bottomleftline:SetPoint("TOPLEFT") - bottomleftline:SetPoint("BOTTOMLEFT") - bottomleftline:SetWidth(1) - - self.TitleWindow = title - self.LogWindow = log - - self.ListenerEnabled = false; - SV: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 - SV:AddonMessage(ERR_NOT_IN_COMBAT); - return; - end - SuperDockAlertRight:Deactivate() -end - -local ModeAlert_OnShow = function(self) - if InCombatLockdown() then - SV:AddonMessage(ERR_NOT_IN_COMBAT); - self:Hide() - return; - end - SV:SecureFadeIn(self, 0.3, 0, 1) - SuperDockAlertRight:Activate(self) -end - -local ModeAlert_OnMouseDown = function(self) - PLUGIN:EndJobModes() - SV: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(SV.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 -########################################################## -]]-- -function PLUGIN:Load() - if(not self.db.enable) then return end - - 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(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() - - self.ModeAlert = ModeAlert - - self:MakeLogWindow() - - modesDocklet:Hide() - - self:LoadCookingMode() - self:LoadFishingMode() - self:LoadArchaeologyMode() - self:PrepareFarmingTools() - self:RegisterEvent("SKILL_LINES_CHANGED") - - local option = { - order = 2, - name = L["Font Size"], - desc = L["Set the font size of the log window."], - type = "range", - min = 6, - max = 22, - step = 1, - get = function(key)return self.db[key[#key]] end, - set = function(j,value) PLUGIN:ChangeDBVar(value,j[#j]);PLUGIN:UpdateLogWindow()end - } - self:AddOption("fontSize", option) - option = { - order = 3, - type = "group", - name = L["Fishing Mode Settings"], - guiInline = true, - args = { - autoequip = { - type = "toggle", - order = 1, - name = L['AutoEquip'], - desc = L['Enable/Disable automatically equipping fishing gear.'], - get = function(key)return self.db.fishing[key[#key]]end, - set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key], "fishing")end - } - } - } - self:AddOption("fishing", option) - option = { - order = 4, - type = "group", - name = L["Cooking Mode Settings"], - guiInline = true, - args = { - autoequip = { - type = "toggle", - order = 1, - name = L['AutoEquip'], - desc = L['Enable/Disable automatically equipping cooking gear.'], - get = function(key)return self.db.cooking[key[#key]]end, - set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key], "cooking")end - } - } - } - self:AddOption("cooking", option) - option = { - order = 5, - type = "group", - name = L["Farming Mode Settings"], - guiInline = true, - get = function(key)return self.db.farming[key[#key]]end, - set = function(key, value)self.db.farming[key[#key]] = value end, - args = { - buttonsize = { - type = 'range', - name = L['Button Size'], - desc = L['The size of the action buttons.'], - min = 15, - max = 60, - step = 1, - order = 1, - set = function(key, value) - PLUGIN:ChangeDBVar(value, key[#key],"farming"); - PLUGIN:RefreshFarmingTools() - end, - }, - buttonspacing = { - type = 'range', - name = L['Button Spacing'], - desc = L['The spacing between buttons.'], - min = 1, - max = 10, - step = 1, - order = 2, - set = function(key, value) - PLUGIN:ChangeDBVar(value, key[#key],"farming"); - PLUGIN:RefreshFarmingTools() - end, - }, - onlyactive = { - order = 3, - type = 'toggle', - name = L['Only active buttons'], - desc = L['Only show the buttons for the seeds, portals, tools you have in your bags.'], - set = function(key, value) - PLUGIN:ChangeDBVar(value, key[#key],"farming"); - PLUGIN:RefreshFarmingTools() - end, - }, - droptools = { - order = 4, - type = 'toggle', - name = L['Drop '], - desc = L['Automatically drop tools from your bags when leaving the farming area.'], - }, - toolbardirection = { - order = 5, - type = 'select', - name = L['Bar Direction'], - desc = L['The direction of the bar buttons (Horizontal or Vertical).'], - set = function(key, value)PLUGIN:ChangeDBVar(value, key[#key],"farming"); PLUGIN:RefreshFarmingTools() end, - values = { - ['VERTICAL'] = L['Vertical'], ['HORIZONTAL'] = L['Horizontal'] - } - } - } - } - self:AddOption("farming", option) -end - -SV.configs[Schema] = { - ["enable"] = true, - ["fontSize"] = 12, - ["farming"] = { - ["buttonsize"] = 35, - ["buttonspacing"] = 3, - ["onlyactive"] = false, - ["droptools"] = true, - ["toolbardirection"] = "HORIZONTAL", - }, - ["fishing"] = { - ["autoequip"] = true, - }, - ["cooking"] = { - ["autoequip"] = true, - }, -} - -SVLib:NewPlugin(PLUGIN) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.toc b/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.toc deleted file mode 100644 index 6f78be9..0000000 --- a/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.toc +++ /dev/null @@ -1,13 +0,0 @@ -## Interface: 60000 -## Author: Munglunch -## Version: 4.6 -## Title: |cffFF9900SVUI |r|cffFFEF00Laborer|r -## Notes: Supervillain UI [|cff9911FFProfession Tools|r]. -## SavedVariables: LABOR_Data -## SavedVariablesPerCharacter: LABOR_Cache -## RequiredDeps: SVUI -## LoadOnDemand: 1 -## X-SVUI-Header: Laborer -## X-SVUI-Schema: SVLaborer - -SVUI_Laborer.xml diff --git a/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.xml b/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.xml deleted file mode 100644 index ed6483d..0000000 --- a/Interface/AddOns/SVUI_Laborer/SVUI_Laborer.xml +++ /dev/null @@ -1,43 +0,0 @@ -<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 deleted file mode 100644 index 9397f22..0000000 Binary files a/Interface/AddOns/SVUI_Laborer/artwork/DOCK-LABORER.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI_Laborer/artwork/LABORER-COOKING.blp b/Interface/AddOns/SVUI_Laborer/artwork/LABORER-COOKING.blp deleted file mode 100644 index fe824f0..0000000 Binary files a/Interface/AddOns/SVUI_Laborer/artwork/LABORER-COOKING.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI_Laborer/artwork/LABORER-FARMING.blp b/Interface/AddOns/SVUI_Laborer/artwork/LABORER-FARMING.blp deleted file mode 100644 index 7127055..0000000 Binary files a/Interface/AddOns/SVUI_Laborer/artwork/LABORER-FARMING.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI_Laborer/artwork/LABORER-FISHING.blp b/Interface/AddOns/SVUI_Laborer/artwork/LABORER-FISHING.blp deleted file mode 100644 index 76474d1..0000000 Binary files a/Interface/AddOns/SVUI_Laborer/artwork/LABORER-FISHING.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI_Laborer/artwork/LABORER-SURVEY.blp b/Interface/AddOns/SVUI_Laborer/artwork/LABORER-SURVEY.blp deleted file mode 100644 index 40f68ae..0000000 Binary files a/Interface/AddOns/SVUI_Laborer/artwork/LABORER-SURVEY.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI_Laborer/modes/archaeology.lua b/Interface/AddOns/SVUI_Laborer/modes/archaeology.lua deleted file mode 100644 index 6f8d267..0000000 --- a/Interface/AddOns/SVUI_Laborer/modes/archaeology.lua +++ /dev/null @@ -1,514 +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 SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -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", SV.fubar) - button:SetScript("OnLeave", SV.fubar) - button:SetScript("OnMouseUp", SV.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 = SV.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(SV.Media.font.roboto, 12, "OUTLINE") - race:SetText(RACE) - race:SetPoint("LEFT", bar, "LEFT", 2, 0) - - -- Progress Text - progress:SetFont(SV.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(SV.Media.bar.default) - solve.bg:SetVertexColor(0.1,0.5,0) - - solve.text = solve:CreateFontString(nil,"OVERLAY") - solve.text:SetFont(SV.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 deleted file mode 100644 index 76378ab..0000000 --- a/Interface/AddOns/SVUI_Laborer/modes/cooking.lua +++ /dev/null @@ -1,229 +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 SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -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 deleted file mode 100644 index 8ad898b..0000000 --- a/Interface/AddOns/SVUI_Laborer/modes/farming.lua +++ /dev/null @@ -1,614 +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 SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -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(SV.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") - SV.Timers: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 - SV.Timers: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 = SV.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", SV.UIParent) - farmSeedBarAnchor:Point("TOPRIGHT", SV.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 - SV.Mentalo:Add(farmSeedBarAnchor, "Farming Seeds") - - -- FARM TOOLS - local farmToolBarAnchor = CreateFrame("Frame", "FarmToolBarAnchor", SV.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; - SV.Mentalo:Add(farmToolBarAnchor, "Farming Tools") - - -- PORTALS - local farmPortalBarAnchor = CreateFrame("Frame", "FarmPortalBarAnchor", SV.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; - SV.Mentalo:Add(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 deleted file mode 100644 index ac099e6..0000000 --- a/Interface/AddOns/SVUI_Laborer/modes/fishing.lua +++ /dev/null @@ -1,381 +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 SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -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/Loader.lua b/Interface/AddOns/SVUI_LogOMatic/Loader.lua new file mode 100644 index 0000000..611ee7f --- /dev/null +++ b/Interface/AddOns/SVUI_LogOMatic/Loader.lua @@ -0,0 +1,31 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +local AddonName, AddonObject = ... + +assert(LibSuperVillain, AddonName .. " requires LibSuperVillain") + +local PLUGIN = LibSuperVillain:NewPlugin(AddonName, AddonObject) + +local Schema = PLUGIN.Schema; +local SV = _G["SVUI"]; + +SV.configs[Schema] = { + ["enable"] = true, + ["saveChats"] = false +} \ 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 3252914..de0bd0e 100644 --- a/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua +++ b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.lua @@ -37,17 +37,14 @@ local twipe,tcopy,tsort = table.wipe, table.copy, table.sort; GET ADDON DATA ########################################################## ]]-- -local SVUIAddOnName, PLUGIN = ...; -local SV = SVUI -local SVLib = LibSuperVillain -local L = SVLib:Lang() -local NewHook = hooksecurefunc; - -PLUGIN = SVLib:NewPrototype(SVUIAddOnName) +local PLUGIN = select(2, ...) local Schema = PLUGIN.Schema; -_G["LogVillain"] = PLUGIN; +local SV = _G["SVUI"]; +local L = SV.L local CHAT = SV.SVChat; + +local NewHook = hooksecurefunc; --[[ ########################################################## LOCAL VARIABLES @@ -86,10 +83,6 @@ PLUGIN.stash = {}; PLUGIN.myStash = {}; PLUGIN.BagItemCache = {}; PLUGIN.HasAltInventory = false; -SV.configs[Schema] = { - ["enable"] = true, - ["saveChats"] = false -} --[[ ########################################################## LOCAL FUNCTIONS @@ -184,7 +177,7 @@ local GameTooltip_LogTooltipSetItem = function(self) self:AddLine(" ") self:AddDoubleLine("|cFFFFDD3C[Character]|r","|cFFFFDD3C[Count]|r") for alt,amt in pairs(PLUGIN.BagItemCache[key]) do - local hexString = SVLOG_Data[realmKey]["info"][alt] or "|cffCC1410" + local hexString = LogOMatic_Data[realmKey]["info"][alt] or "|cffCC1410" local name = ("%s%s|r"):format(hexString, alt) local result = ("%s%s|r"):format(hexString, amt) self:AddDoubleLine(name,result) @@ -200,14 +193,14 @@ CORE FUNCTIONS ]]-- function CHAT:LoadSavedChatLog() local temp, data = {} - for id, _ in pairs(SVLOG_Cache["chat"]) do + for id, _ in pairs(LogOMatic_Cache["chat"]) do tinsert(temp, tonumber(id)) end tsort(temp, function(a, b) return a < b end) for i = 1, #temp do - data = SVLOG_Cache["chat"][tostring(temp[i])] + data = LogOMatic_Cache["chat"][tostring(temp[i])] if type(data) == "table" and data[20] ~= nil then self.timeOverride = temp[i] ChatFrame_MessageEventHandler(DEFAULT_CHAT_FRAME, data[20], unpack(data)) @@ -224,30 +217,30 @@ function CHAT:LogCurrentChat(event, ...) temp[20] = event local randomTime = select(2, ("."):split(GetTime() or "0."..random(1, 999), 2)) or 0; local timeForMessage = time().."."..randomTime; - SVLOG_Cache["chat"][timeForMessage] = temp + LogOMatic_Cache["chat"][timeForMessage] = temp local c, k = 0 - for id, data in pairs(SVLOG_Cache["chat"]) do + for id, data in pairs(LogOMatic_Cache["chat"]) do c = c + 1 if (not k) or k > id then k = id end end if c > 128 then - SVLOG_Cache["chat"][k] = nil + LogOMatic_Cache["chat"][k] = nil end end end function CHAT:PLAYER_ENTERING_WORLD() local temp, data = {} - for id, _ in pairs(SVLOG_Cache["chat"]) do + for id, _ in pairs(LogOMatic_Cache["chat"]) do tinsert(temp, tonumber(id)) end tsort(temp, function(a, b) return a < b end) for i = 1, #temp do - data = SVLOG_Cache["chat"][tostring(temp[i])] + data = LogOMatic_Cache["chat"][tostring(temp[i])] if type(data) == "table" and data[20] ~= nil then ChatFrame_MessageEventHandler(DEFAULT_CHAT_FRAME, data[20], unpack(data)) end @@ -263,7 +256,7 @@ function PLUGIN:AppendBankFunctions() end function PLUGIN:AppendChatFunctions() - if SV.db.SVChat.enable and self.db.saveChats then + if SV.db.SVChat.enable and SV.db[Schema].saveChats then for _,event in pairs(LoggingEvents) do SV.SVChat:RegisterEvent(event, "LogCurrentChat") end @@ -276,11 +269,11 @@ CORE FUNCTIONS ########################################################## ]]-- local function ResetAllLogs() - 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 + if LogOMatic_Data[realmKey] then + if LogOMatic_Data[realmKey]["bags"] and LogOMatic_Data[realmKey]["bags"][nameKey] then LogOMatic_Data[realmKey]["bags"][nameKey] = {} end + if LogOMatic_Data[realmKey]["gold"] and LogOMatic_Data[realmKey]["gold"][nameKey] then LogOMatic_Data[realmKey]["gold"][nameKey] = 0 end end - if SVLOG_Cache then SVLOG_Cache = {} end + if LogOMatic_Cache then LogOMatic_Cache = {} end end --[[ ########################################################## @@ -288,33 +281,36 @@ BUILD FUNCTION ########################################################## ]]-- function PLUGIN:Load() - if IsAddOnLoaded("Altoholic") or not self.db.enable then return end + if SVLOG_Data then SVLOG_Data = nil end + if SVLOG_Cache then SVLOG_Cache = nil end + + if IsAddOnLoaded("Altoholic") or not SV.db[Schema].enable then return end 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) - if not SVLOG_Cache then SVLOG_Cache = {} end - SVLOG_Data = SVLOG_Data or {} - SVLOG_Data[realmKey] = SVLOG_Data[realmKey] or {} - SVLOG_Data[realmKey]["bags"] = SVLOG_Data[realmKey]["bags"] or {}; - SVLOG_Data[realmKey]["info"] = SVLOG_Data[realmKey]["info"] or {}; - SVLOG_Data[realmKey]["info"][nameKey] = hexString; - SVLOG_Data[realmKey]["bags"][nameKey] = SVLOG_Data[realmKey]["bags"][nameKey] or {}; + if not LogOMatic_Cache then LogOMatic_Cache = {} end + LogOMatic_Data = LogOMatic_Data or {} + LogOMatic_Data[realmKey] = LogOMatic_Data[realmKey] or {} + LogOMatic_Data[realmKey]["bags"] = LogOMatic_Data[realmKey]["bags"] or {}; + LogOMatic_Data[realmKey]["info"] = LogOMatic_Data[realmKey]["info"] or {}; + LogOMatic_Data[realmKey]["info"][nameKey] = hexString; + LogOMatic_Data[realmKey]["bags"][nameKey] = LogOMatic_Data[realmKey]["bags"][nameKey] or {}; - self.stash = SVLOG_Data[realmKey]["bags"]; - self.myStash = SVLOG_Data[realmKey]["bags"][nameKey]; + self.stash = LogOMatic_Data[realmKey]["bags"]; + self.myStash = LogOMatic_Data[realmKey]["bags"][nameKey]; - SVLOG_Data[realmKey]["quests"] = SVLOG_Data[realmKey]["quests"] or {}; - SVLOG_Data[realmKey]["quests"][nameKey] = SVLOG_Data[realmKey]["quests"][nameKey] or {}; + LogOMatic_Data[realmKey]["quests"] = LogOMatic_Data[realmKey]["quests"] or {}; + LogOMatic_Data[realmKey]["quests"][nameKey] = LogOMatic_Data[realmKey]["quests"][nameKey] or {}; - self.chronicle = SVLOG_Data[realmKey]["quests"][nameKey]; + self.chronicle = LogOMatic_Data[realmKey]["quests"][nameKey]; NewHook(SV, "ResetAllUI", ResetAllLogs); - if not SVLOG_Cache["chat"] then SVLOG_Cache["chat"] = {} end + if not LogOMatic_Cache["chat"] then LogOMatic_Cache["chat"] = {} end - for alt,_ in pairs(SVLOG_Data[realmKey]["bags"]) do - for bag,items in pairs(SVLOG_Data[realmKey]["bags"][alt]) do + for alt,_ in pairs(LogOMatic_Data[realmKey]["bags"]) do + for bag,items in pairs(LogOMatic_Data[realmKey]["bags"][alt]) do for id,amt in pairs(items) do self.BagItemCache[id] = self.BagItemCache[id] or {} self.BagItemCache[id][alt] = amt @@ -344,10 +340,8 @@ function PLUGIN:Load() type = "toggle", name = L["Save Chats"], desc = L["Retain chat messages even after logging out."], - get = function(a)return self.db.saveChats end, - set = function(a,b) self.db.saveChats = b; SV:StaticPopup_Show("RL_CLIENT") end + get = function(a)return SV.db[Schema].saveChats end, + set = function(a,b) SV.db[Schema].saveChats = b; SV:StaticPopup_Show("RL_CLIENT") end } self:AddOption("saveChats", saveChats) -end - -SVLib:NewPlugin(PLUGIN) \ No newline at end of file +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.toc b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.toc index 18495c0..726cdca 100644 --- a/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.toc +++ b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.toc @@ -1,13 +1,14 @@ ## Interface: 60000 ## Author: Munglunch -## Version: 4.6 +## Version: 4.7 ## Title: |cffFF9900SVUI |r|cffFFEF00Log O Matic|r ## Notes: Supervillain UI [|cff9911FFData Logging|r]. -## SavedVariables: SVLOG_Data -## SavedVariablesPerCharacter: SVLOG_Cache +## SavedVariables: LogOMatic_Data +## SavedVariablesPerCharacter: LogOMatic_Cache ## RequiredDeps: SVUI ## LoadOnDemand: 1 -## X-SVUI-Header: Log O Matic -## X-SVUI-Schema: SVLogs +## X-Email: munglunch@gmail.com +## X-SVUI-Header: Log-O-Matic +## X-SVUI-Schema: LogOMatic -SVUI_LogOMatic.lua +SVUI_LogOMatic.xml diff --git a/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.xml b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.xml new file mode 100644 index 0000000..d0b6bb5 --- /dev/null +++ b/Interface/AddOns/SVUI_LogOMatic/SVUI_LogOMatic.xml @@ -0,0 +1,4 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Script file='Loader.lua'/> + <Script file='SVUI_LogOMatic.lua'/> +</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_StyleOMatic/License.txt b/Interface/AddOns/SVUI_StyleOMatic/License.txt index b1a26dc..25cfd6f 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/License.txt +++ b/Interface/AddOns/SVUI_StyleOMatic/License.txt @@ -14,7 +14,7 @@ SVUI_StyleOMatic SVUI License Copyright 2014 http://wowinterface.com -(Adapted with permissions from AddOnSkins for ElvUI) Copyright 2014 http://www.tukui.org +(Adapted with permissions from AddOnSkins for ElvUI) Copyright 2014 Azilroka http://www.tukui.org The contents of this addon, excluding third-party resources, are copyrighted to their authors with all rights reserved. diff --git a/Interface/AddOns/SVUI_StyleOMatic/Loader.lua b/Interface/AddOns/SVUI_StyleOMatic/Loader.lua new file mode 100644 index 0000000..1428f3f --- /dev/null +++ b/Interface/AddOns/SVUI_StyleOMatic/Loader.lua @@ -0,0 +1,112 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +local AddonName, AddonObject = ... + +assert(LibSuperVillain, AddonName .. " requires LibSuperVillain") + +local PLUGIN = LibSuperVillain:NewPlugin(AddonName, AddonObject) + +local Schema = PLUGIN.Schema; +local SV = _G["SVUI"]; + +SV.configs[Schema] = { + ["enable"] = true, + ["blizzard"] = { + ["enable"] = true, + ["bags"] = true, + ["bmah"] = true, + ["chat"] = 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, + ["Quartz"] = true, + ["TomTom"] = true, + ["TinyDPS"] = true, + ["Clique"] = true, + ["CoolLine"] = true, + ["ACP"] = true, + ["DXE"] = true, + ["DBM-Core"] = true, + ["VEM"] = true, + ["MogIt"] = true, + ["alDamageMeter"] = true, + ["Omen"] = true, + ["TradeSkillDW"] = true, + } +}; \ 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 2af5434..3653c8f 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.lua @@ -37,17 +37,13 @@ local twipe, tcopy = table.wipe, table.copy; GET ADDON DATA ########################################################## ]]-- -local SVUIAddOnName, PLUGIN = ...; -local SV = _G.SVUI -local SVLib = LibSuperVillain -local L = SVLib:Lang() -local NewHook = hooksecurefunc; - -PLUGIN = SVLib:NewPrototype(SVUIAddOnName) +local PLUGIN = select(2, ...) local Schema = PLUGIN.Schema; local VERSION = PLUGIN.Version; -_G["StyleVillain"] = PLUGIN; +local SV = _G.SVUI +local L = SV.L +local NewHook = hooksecurefunc; --[[ ########################################################## CORE DATA @@ -64,9 +60,9 @@ PLUGIN.OptionsCache = { order = 4, type = "group", name = "Addon Styling", - get = function(a)return PLUGIN.db.addons[a[#a]] end, - set = function(a,b) PLUGIN.db.addons[a[#a]] = b; SV:StaticPopup_Show("RL_CLIENT")end, - disabled = function()return not PLUGIN.db.addons.enable end, + get = function(a)return SV.db[Schema].addons[a[#a]] end, + set = function(a,b) SV.db[Schema].addons[a[#a]] = b; SV:StaticPopup_Show("RL_CLIENT")end, + disabled = function()return not SV.db[Schema].addons.enable end, guiInline = true, args = { ace3 = { @@ -127,14 +123,14 @@ function PLUGIN:Style(style, fn, ...) end function PLUGIN:IsAddonReady(addon, ...) - if not self.db.addons then return end + if not SV.db[Schema].addons then return end for i = 1, select('#', ...) do local a = select(i, ...) if not a then break end if not IsAddOnLoaded(a) then return false end end - return self.db.addons[addon] + return SV.db[Schema].addons[addon] end function PLUGIN:SaveAddonStyle(addon, fn, force, passive, ...) @@ -148,8 +144,8 @@ function PLUGIN:SaveAddonStyle(addon, fn, force, passive, ...) self:DefineEventFunction(event, addon) end end - if(self.db.addons and self.db.addons[addon] == nil) then - self.db.addons[addon] = true + if(SV.db[Schema].addons and SV.db[Schema].addons[addon] == nil) then + SV.db[Schema].addons[addon] = true end if force then @@ -237,10 +233,10 @@ end function PLUGIN:PLAYER_ENTERING_WORLD(event, ...) for name,fn in pairs(self.OnLoadAddons) do - if(self.db.blizzard[name] == nil) then - self.db.blizzard[name] = true + if(SV.db[Schema].blizzard[name] == nil) then + SV.db[Schema].blizzard[name] = true end - if(IsAddOnLoaded(name) and (self.db.blizzard[name] or self.db.addons[name])) then + if(IsAddOnLoaded(name) and (SV.db[Schema].blizzard[name] or SV.db[Schema].addons[name])) then self:Style(name, fn, event, ...) self.OnLoadAddons[name] = nil end @@ -255,8 +251,8 @@ function PLUGIN:PLAYER_ENTERING_WORLD(event, ...) local listener = self.EventListeners[event] for name,fn in pairs(self.AddOnQueue)do self:AppendAddonOption(name) - if(self.db.addons[name] == nil) then - self.db.addons[name] = true + if(SV.db[Schema].addons[name] == nil) then + SV.db[Schema].addons[name] = true end if(listener[name] and self:IsAddonReady(name)) then self:Style(name, fn, event, ...) @@ -381,7 +377,7 @@ BUILD FUNCTION ########################################################## ]]-- function PLUGIN:Load() - if(not self.db.enable) then return end + if(not SV.db[Schema].enable) then return end local alert = CreateFrame('Frame', nil, UIParent); alert:SetFixedPanelTemplate('Transparent'); @@ -419,8 +415,8 @@ function PLUGIN:Load() order = 2, type = "toggle", name = "Standard UI Styling", - get = function(a)return self.db.blizzard.enable end, - set = function(a,b) self.db.blizzard.enable = b; SV:StaticPopup_Show("RL_CLIENT") end + get = function(a)return SV.db[Schema].blizzard.enable end, + set = function(a,b) SV.db[Schema].blizzard.enable = b; SV:StaticPopup_Show("RL_CLIENT") end } self:AddOption("blizzardEnable", option) @@ -428,8 +424,8 @@ function PLUGIN:Load() order = 3, type = "toggle", name = "Addon Styling", - get = function(a)return self.db.addons.enable end, - set = function(a,b) self.db.addons.enable = b; SV:StaticPopup_Show("RL_CLIENT") end + get = function(a)return SV.db[Schema].addons.enable end, + set = function(a,b) SV.db[Schema].addons.enable = b; SV:StaticPopup_Show("RL_CLIENT") end } self:AddOption("addonEnable", option) @@ -437,9 +433,9 @@ function PLUGIN:Load() order = 300, type = "group", name = "Individual Mods", - get = function(a)return self.db.blizzard[a[#a]]end, - set = function(a,b) self.db.blizzard[a[#a]] = b; SV:StaticPopup_Show("RL_CLIENT") end, - disabled = function() return not self.db.blizzard.enable end, + get = function(a)return SV.db[Schema].blizzard[a[#a]]end, + set = function(a,b) SV.db[Schema].blizzard[a[#a]] = b; SV:StaticPopup_Show("RL_CLIENT") end, + disabled = function() return not SV.db[Schema].blizzard.enable end, guiInline = true, args = { bmah = { @@ -724,92 +720,4 @@ function PLUGIN:Load() self:RegisterEvent("PLAYER_ENTERING_WORLD"); self:RegisterEvent("ADDON_LOADED"); -end - -SV.configs[Schema] = { - ["enable"] = true, - ["blizzard"] = { - ["enable"] = true, - ["bags"] = true, - ["bmah"] = true, - ["chat"] = 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, - ["Quartz"] = true, - ["TomTom"] = true, - ["TinyDPS"] = true, - ["Clique"] = true, - ["CoolLine"] = true, - ["ACP"] = true, - ["DXE"] = true, - ["DBM-Core"] = true, - ["VEM"] = true, - ["MogIt"] = true, - ["alDamageMeter"] = true, - ["Omen"] = true, - ["TradeSkillDW"] = true, - } -}; - -SVLib:NewPlugin(PLUGIN) \ No newline at end of file +end \ 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 c4f678c..319dae5 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc +++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.toc @@ -1,11 +1,12 @@ ## Interface: 60000 ## Author: Munglunch, Azilroka, Sortokk -## Version: 4.6 +## Version: 4.7 ## Title: |cffFF9900SVUI |r|cffFFEF00Style O Matic|r ## Notes: Supervillain UI [|cff9911FFAddon Skins|r]. ## RequiredDeps: SVUI ## OptionalDeps: Blizzard_DebugTools, Blizzard_PetJournal, SharedMedia -## X-SVUI-Header: Style O Matic -## X-SVUI-Schema: SVStyle +## X-Email: munglunch@gmail.com +## X-SVUI-Header: Style-O-Matic +## X-SVUI-Schema: StyleOMatic SVUI_StyleOMatic.xml diff --git a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.xml b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.xml index 5d27072..64f1abf 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.xml +++ b/Interface/AddOns/SVUI_StyleOMatic/SVUI_StyleOMatic.xml @@ -1,4 +1,5 @@ <Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Script file='Loader.lua'/> <Script file='SVUI_StyleOMatic.lua'/> <Script file='common\methods.lua'/> <Include file='addons\_load.xml'/> diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/achievement.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/achievement.lua index 7236a6c..8f4ed77 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/achievement.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/achievement.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -134,7 +135,7 @@ ACHIEVEMENTFRAME STYLER ########################################################## ]]-- local function AchievementStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.achievement ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.achievement ~= true then return end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/alert.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/alert.lua index 7d22c28..a75a1c5 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/alert.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/alert.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -32,7 +33,7 @@ ALERTFRAME STYLER ########################################################## ]]-- local function AlertStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.alertframes ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.alertframes ~= true then return end for i = 1, 4 do local alert = _G["SVUI_SystemAlert"..i]; diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/archeology.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/archeology.lua index f1b3089..251045e 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/archeology.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/archeology.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## ARCHEOLOGYFRAME STYLER @@ -28,7 +29,7 @@ progressBarHolder:SetPoint("BOTTOM", CastingBarFrame, "TOP", 0, 10) SV.Mentalo:Add(progressBarHolder, "Archeology Progress Bar") local function ArchaeologyStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.archaeology ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.archaeology ~= true then return end ArchaeologyFrame:RemoveTextures() ArchaeologyFrameInset:RemoveTextures() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/auctionhouse.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/auctionhouse.lua index b9c77ce..f7e4f24 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/auctionhouse.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/auctionhouse.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -80,7 +81,7 @@ AUCTIONFRAME STYLER ]]-- local function AuctionStyle() --STYLE.Debugging = true - if(SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.auctionhouse ~= true) then return end + if(SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.auctionhouse ~= true) then return end STYLE:ApplyWindowStyle(AuctionFrame, false, true) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/barbershop.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/barbershop.lua index 4c6fb91..c2ad149 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/barbershop.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/barbershop.lua @@ -14,15 +14,16 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## BARBERSHOP STYLER ########################################################## ]]-- local function BarberShopStyle() - if SV.db.SVStyle.blizzard.enable~=true or SV.db.SVStyle.blizzard.barber~=true then return end + if SV.db[Schema].blizzard.enable~=true or SV.db[Schema].blizzard.barber~=true then return end local buttons = {"BarberShopFrameOkayButton", "BarberShopFrameCancelButton", "BarberShopFrameResetButton"} BarberShopFrameOkayButton:Point("RIGHT", BarberShopFrameSelector4, "BOTTOM", 2, -50) for b = 1, #buttons do diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/battlefield.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/battlefield.lua index 117de87..044ff6c 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/battlefield.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/battlefield.lua @@ -14,15 +14,16 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## BATTLEFIELD STYLER ########################################################## ]]-- local function BattlefieldStyle() - if SV.db.SVStyle.blizzard.enable~=true or SV.db.SVStyle.blizzard.bgmap~=true then return end + if SV.db[Schema].blizzard.enable~=true or SV.db[Schema].blizzard.bgmap~=true then return end BattlefieldMinimap:SetClampedToScreen(true) BattlefieldMinimapCorner:Die() BattlefieldMinimapBackground:Die() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/blackmarket.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/blackmarket.lua index 7e2f2ca..88bc2c6 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/blackmarket.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/blackmarket.lua @@ -14,15 +14,16 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## BLACKMARKET STYLER ########################################################## ]]-- local function BlackMarketStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.bmah ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.bmah ~= true then return end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/calendar.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/calendar.lua index 4163aa6..ba4091f 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/calendar.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/calendar.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -33,7 +34,7 @@ CALENDAR STYLER ########################################################## ]]-- local function CalendarStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.calendar ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.calendar ~= true then return end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/challenges.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/challenges.lua index 5a4964e..bfcfe58 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/challenges.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/challenges.lua @@ -14,15 +14,16 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## CHALLENGES UI STYLER ########################################################## ]]-- local function ChallengesFrameStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.lfg ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.lfg ~= true then return end ChallengesFrameInset:RemoveTextures() ChallengesFrameInsetBg:Hide() ChallengesFrameDetails.bg:Hide() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/character.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/character.lua index 2cd582b..ea9fc7c 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/character.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/character.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -179,7 +180,7 @@ CHARACTERFRAME STYLER ########################################################## ]]-- local function CharacterFrameStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.character ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.character ~= true then return end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/chat.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/chat.lua index 16df601..5f11298 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/chat.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/chat.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## FRAME LISTS @@ -345,7 +346,7 @@ CHAT STYLER ########################################################## ]]-- local function ChatStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.chat ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.chat ~= true then return end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/dressup.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/dressup.lua index 8f9e312..0f6f3b5 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/dressup.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/dressup.lua @@ -14,15 +14,16 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## DRESSUP STYLER ########################################################## ]]-- local function DressUpStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.dressingroom ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.dressingroom ~= true then return end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/encounterjournal.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/encounterjournal.lua index de8a6d4..3920bb7 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/encounterjournal.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/encounterjournal.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## ENCOUNTERJOURNAL STYLER @@ -99,7 +100,7 @@ local function Outline(frame, noHighlight) end local function EncounterJournalStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.encounterjournal ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.encounterjournal ~= true then return end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/friends.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/friends.lua index 5705b58..5c8c50f 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/friends.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/friends.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -116,7 +117,7 @@ FRIENDSFRAME STYLER ########################################################## ]]--FriendsFrameBattlenetFrameScrollFrame local function FriendsFrameStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.friends ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.friends ~= true then return end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/gossip.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/gossip.lua index 7d8c91f..d45542a 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/gossip.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/gossip.lua @@ -14,15 +14,16 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## GOSSIP STYLER ########################################################## ]]-- local function GossipStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.gossip ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.gossip ~= true then return end ItemTextFrame:RemoveTextures(true) ItemTextScrollFrame:RemoveTextures() STYLE:ApplyCloseButtonStyle(GossipFrameCloseButton) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua index abf2d0f..6d1c9c0 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/guild.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -162,7 +163,7 @@ GUILDFRAME STYLERS ########################################################## ]]-- local function GuildBankStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.gbank ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.gbank ~= true then return end @@ -284,7 +285,7 @@ local function GuildBankStyle() end local function GuildFrameStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.guild ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.guild ~= true then return end @@ -530,7 +531,7 @@ local function GuildFrameStyle() end local function GuildControlStyle() - if SV.db.SVStyle.blizzard.enable~=true or SV.db.SVStyle.blizzard.guildcontrol~=true then return end + if SV.db[Schema].blizzard.enable~=true or SV.db[Schema].blizzard.guildcontrol~=true then return end GuildControlUI:RemoveTextures() GuildControlUIHbar:RemoveTextures() @@ -602,7 +603,7 @@ end local function GuildRegistrarStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.guildregistrar ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.guildregistrar ~= true then return end @@ -641,7 +642,7 @@ local function GuildRegistrarStyle() end local function LFGuildFrameStyle() - if(SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.lfguild ~= true) then return end + if(SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.lfguild ~= true) then return end STYLE:ApplyWindowStyle(LookingForGuildFrame, true) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/help.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/help.lua index edc6f5d..bf38890 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/help.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/help.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -63,7 +64,7 @@ HELPFRAME STYLER ########################################################## ]]-- local function HelpFrameStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.help ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.help ~= true then return end tinsert(HelpFrameButtonList, "HelpFrameButton16") diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/inspect.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/inspect.lua index 47daa68..f0ed23f 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/inspect.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/inspect.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -47,7 +48,7 @@ INSPECT UI STYLER ########################################################## ]]-- local function InspectStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.inspect ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.inspect ~= true then return end InspectFrame:RemoveTextures(true) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/itemsocketing.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/itemsocketing.lua index 919bf10..b4c53f2 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/itemsocketing.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/itemsocketing.lua @@ -14,15 +14,16 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## ITEMSOCKETING STYLER ########################################################## ]]-- local function ItemSocketStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.socket ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.socket ~= true then return end ItemSocketingFrame:RemoveTextures() ItemSocketingFrame:SetPanelTemplate("Action") ItemSocketingFrameInset:Die() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/itemupgrade.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/itemupgrade.lua index 5c539a2..86aab3e 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/itemupgrade.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/itemupgrade.lua @@ -14,15 +14,16 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## ITEMUPGRADE UI STYLER ########################################################## ]]-- local function ItemUpgradeStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.itemUpgrade ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.itemUpgrade ~= true then return end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/keybinding.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/keybinding.lua index 3f7c999..bd456a5 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/keybinding.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/keybinding.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## KEYBINDING STYLER @@ -29,7 +30,7 @@ local BindButtons = { } local function BindingStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.binding ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.binding ~= true then return end for _, gName in pairs(BindButtons)do local btn = _G[gName] diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/lfd.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/lfd.lua index 1c402be..19859c9 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/lfd.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/lfd.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -107,7 +108,7 @@ LFD STYLER ########################################################## ]]-- local function LFDFrameStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.lfg ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.lfg ~= true then return end STYLE:ApplyWindowStyle(PVEFrame, true) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/loothistory.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/loothistory.lua index 79d89ce..6294540 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/loothistory.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/loothistory.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -59,7 +60,7 @@ LOOTHISTORY STYLER ]]-- local function LootHistoryStyle() LootHistoryFrame:SetFrameStrata('HIGH') - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.loot ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.loot ~= true then return end local M = MissingLootFrame; M:RemoveTextures() M:SetPanelTemplate("Pattern") diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/lossofcontrol.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/lossofcontrol.lua index e72c845..b96660e 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/lossofcontrol.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/lossofcontrol.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## LOSSOFCONTROL STYLER @@ -42,7 +43,7 @@ local _hook_LossOfControl = function(self, ...) end local function LossOfControlStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.losscontrol ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.losscontrol ~= true then return end local IconBackdrop = CreateFrame("Frame", nil, LossOfControlFrame) IconBackdrop:WrapOuter(LossOfControlFrame.Icon) IconBackdrop:SetFrameLevel(LossOfControlFrame:GetFrameLevel()-1) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/macro.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/macro.lua index 2ee24c7..67f8299 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/macro.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/macro.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -33,7 +34,7 @@ MACRO UI STYLER ########################################################## ]]-- local function MacroUIStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.macro ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.macro ~= true then return end STYLE:ApplyCloseButtonStyle(MacroFrameCloseButton) STYLE:ApplyScrollFrameStyle(MacroButtonScrollFrameScrollBar) STYLE:ApplyScrollFrameStyle(MacroFrameScrollFrameScrollBar) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/mailbox.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/mailbox.lua index 4250ff4..972bf14 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/mailbox.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/mailbox.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -42,7 +43,7 @@ MAILBOX STYLER ########################################################## ]]-- local function MailBoxStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.mail ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.mail ~= true then return end STYLE:ApplyWindowStyle(MailFrame) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/merchant.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/merchant.lua index f6d95ba..ee68517 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/merchant.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/merchant.lua @@ -14,15 +14,16 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## FRAME STYLER ########################################################## ]]-- local function MerchantStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.merchant ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.merchant ~= true then return end MerchantFrame:RemoveTextures(true) MerchantFrame:SetPanelTemplate("Halftone", false, nil, 2, 4) local level = MerchantFrame:GetFrameLevel() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/petbattle.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/petbattle.lua index 40b2ccb..807a9c5 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/petbattle.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/petbattle.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -43,7 +44,7 @@ PETBATTLE STYLER ########################################################## ]]-- local function PetBattleStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.petbattleui ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.petbattleui ~= true then return end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/petition.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/petition.lua index 4b27106..ec4aecb 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/petition.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/petition.lua @@ -14,15 +14,16 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## PETITIONFRAME STYLER ########################################################## ]]-- local function PetitionFrameStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.petition ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.petition ~= true then return end PetitionFrame:RemoveTextures(true) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/petjournal.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/petjournal.lua index 9248ad6..fac1626 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/petjournal.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/petjournal.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -88,7 +89,7 @@ FRAME STYLER ########################################################## ]]-- local function PetJournalStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.mounts ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.mounts ~= true then return end STYLE:ApplyWindowStyle(PetJournalParent) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/petstable.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/petstable.lua index 444fdb7..e296f8e 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/petstable.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/petstable.lua @@ -14,15 +14,16 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## PETSTABLE STYLER ########################################################## ]]-- local function PetStableStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.stable ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.stable ~= true then return end PetStableFrame:RemoveTextures() PetStableFrameInset:RemoveTextures() PetStableLeftInset:RemoveTextures() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/pvp.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/pvp.lua index 1c80ace..f7d643e 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/pvp.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/pvp.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## PVP STYLER @@ -24,7 +25,7 @@ PVP STYLER -- LoadAddOn("Blizzard_PVPUI") local function PVPFrameStyle() - if (SV.db.SVStyle and (SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.pvp ~= true)) then + if (SV.db[Schema] and (SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.pvp ~= true)) then return end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua index df3bb90..8e2ceb7 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/quest.lua @@ -16,8 +16,9 @@ credit: Elv. original logic from ElvUI. Adapted to SVUI # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -105,7 +106,7 @@ QUEST STYLERS ########################################################## ]]-- local function QuestGreetingStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.greeting ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.greeting ~= true then return end @@ -117,7 +118,7 @@ local function QuestGreetingStyle() end local function QuestFrameStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.quest ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.quest ~= true then return end STYLE:ApplyWindowStyle(QuestFrame, true, true) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/raid.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/raid.lua index 2176623..05c420e 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/raid.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/raid.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -46,7 +47,7 @@ RAID STYLERS ]]-- local function RaidUIStyle() if InCombatLockdown() then return end - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.raid ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.raid ~= true then return end for _,group in pairs(RaidGroupList)do if _G[group] then _G[group]:RemoveTextures() @@ -63,7 +64,7 @@ local function RaidUIStyle() end local function RaidInfoStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.nonraid ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.nonraid ~= true then return end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/reforging.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/reforging.lua index ed6ccf6..6ea57b8 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/reforging.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/reforging.lua @@ -14,15 +14,16 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## REFORGING STYLER ########################################################## ]]-- local function ReforgingStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.reforge ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.reforge ~= true then return end STYLE:ApplyWindowStyle(ReforgingFrame, true) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/spellbook.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/spellbook.lua index e134e57..ea1731a 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/spellbook.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/spellbook.lua @@ -13,9 +13,10 @@ _____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] -local SV = SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain +local SV = _G["SVUI"]; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## FRAME LISTS @@ -222,7 +223,7 @@ SPELLBOOK STYLER ########################################################## ]]-- local function SpellBookStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.spellbook ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.spellbook ~= true then return end STYLE:ApplyWindowStyle(SpellBookFrame) STYLE:ApplyCloseButtonStyle(SpellBookFrameCloseButton) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/store.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/store.lua index 7100517..d4c8056 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/store.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/store.lua @@ -14,15 +14,16 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## TAXIFRAME STYLER ########################################################## ]]-- local function StoreStyle() - -- if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.store ~= true then + -- if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.store ~= true then -- return -- end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/supervillain.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/supervillain.lua index 4bf07cb..eb8977d 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/supervillain.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/supervillain.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/system.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/system.lua index 86c9441..39f1ff1 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/system.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/system.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; local ceil = math.ceil --[[ ########################################################## @@ -393,7 +394,7 @@ SYSTEM WIDGET STYLERS ########################################################## ]]-- local function SystemPanelQue() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.misc ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.misc ~= true then return end QueueStatusFrame:RemoveTextures() diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/tabard.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/tabard.lua index 2ecf13f..663f239 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/tabard.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/tabard.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -45,7 +46,7 @@ TABARDFRAME STYLER ########################################################## ]]-- local function TabardFrameStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.tabard ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.tabard ~= true then return end cleanT(TabardFrame, true) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/talents.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/talents.lua index fa0f537..f9fcfa4 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/talents.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/talents.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -106,7 +107,7 @@ TALENTFRAME STYLER ########################################################## ]]-- local function TalentFrameStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.talent ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.talent ~= true then return end STYLE:ApplyWindowStyle(PlayerTalentFrame) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/taxi.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/taxi.lua index e00eec4..2e3c82a 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/taxi.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/taxi.lua @@ -14,15 +14,16 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## TAXIFRAME STYLER ########################################################## ]]-- local function TaxiStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.taxi ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.taxi ~= true then return end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/ACP.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/ACP.lua index c4dd143..63c6fc2 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/ACP.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/ACP.lua @@ -27,8 +27,9 @@ GET ADDON DATA ########################################################## ]]-- local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## ACP diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AdiBags.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AdiBags.lua index f4c48b2..b5c95cd 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AdiBags.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AdiBags.lua @@ -30,8 +30,9 @@ GET ADDON DATA ########################################################## ]]-- local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## ADIBAGS diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Altoholic.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Altoholic.lua index bfa4aa9..a6ca1d9 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Altoholic.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Altoholic.lua @@ -30,8 +30,9 @@ GET ADDON DATA ########################################################## ]]-- local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## ALTOHOLIC diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AtlasLoot.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AtlasLoot.lua index 6d6c7b9..9ae8e8c 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AtlasLoot.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AtlasLoot.lua @@ -27,8 +27,9 @@ GET ADDON DATA ########################################################## ]]-- local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## ATLASLOOT diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AuctionLite.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AuctionLite.lua index b52d15e..3fe7bb3 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AuctionLite.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/AuctionLite.lua @@ -29,9 +29,10 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain +local SV = _G["SVUI"]; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## AUCTIONLITE diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/BigWigs.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/BigWigs.lua index 25a4451..f005058 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/BigWigs.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/BigWigs.lua @@ -25,9 +25,10 @@ local select = _G.select; GET ADDON DATA ########################################################## ]]-- -local SV = SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain +local SV = _G["SVUI"]; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## BIGWIGS diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Bugsack.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Bugsack.lua index cb1cf98..502fb49 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Bugsack.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Bugsack.lua @@ -30,8 +30,9 @@ GET ADDON DATA ########################################################## ]]-- local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## BUGSACK diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Clique.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Clique.lua index 347e359..ac2eca7 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Clique.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Clique.lua @@ -30,8 +30,9 @@ GET ADDON DATA ########################################################## ]]-- local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## CLIQUE diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Cooline.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Cooline.lua index 6502047..807be7f 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Cooline.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Cooline.lua @@ -30,8 +30,9 @@ GET ADDON DATA ########################################################## ]]-- local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## COOLINE diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DBM.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DBM.lua index 3f3f3cf..d89d5fb 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DBM.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DBM.lua @@ -30,8 +30,9 @@ GET ADDON DATA ########################################################## ]]-- local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## DBM diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DXE.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DXE.lua index 4cffae3..95a0088 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DXE.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/DXE.lua @@ -30,8 +30,9 @@ GET ADDON DATA ########################################################## ]]-- local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; local playerName = UnitName("player"); local playerRealm = GetRealmName(); local playerKey = ("%s - %s"):format(playerName, playerRealm) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/LightHeaded.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/LightHeaded.lua index fdaa5fd..24d67c3 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/LightHeaded.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/LightHeaded.lua @@ -30,8 +30,9 @@ GET ADDON DATA ########################################################## ]]-- local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## LIGHTHEADED diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Mogit.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Mogit.lua index eca7409..7489024 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Mogit.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Mogit.lua @@ -30,8 +30,9 @@ GET ADDON DATA ########################################################## ]]-- local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## MOGIT diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Omen.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Omen.lua index 53d6f10..7d03c80 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Omen.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Omen.lua @@ -29,7 +29,8 @@ local format = string.format; GET ADDON DATA ########################################################## ]]-- -local STYLE = _G.StyleVillain; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## OMEN diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Outfitter.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Outfitter.lua index adf5158..6b08d87 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Outfitter.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Outfitter.lua @@ -30,8 +30,9 @@ GET ADDON DATA ########################################################## ]]-- local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## OUTFITTER diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Postal.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Postal.lua index b9697e6..a5ace41 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Postal.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Postal.lua @@ -30,8 +30,9 @@ GET ADDON DATA ########################################################## ]]-- local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## POSTAL diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Quartz.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Quartz.lua index b239af3..48d8db9 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Quartz.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Quartz.lua @@ -30,8 +30,9 @@ GET ADDON DATA ########################################################## ]]-- local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## QUARTZ diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Recount.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Recount.lua index 97e7833..bc14641 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Recount.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Recount.lua @@ -30,8 +30,9 @@ GET ADDON DATA ########################################################## ]]-- local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## RECOUNT diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/SexyCooldown.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/SexyCooldown.lua index 09eb99d..ad5fd29 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/SexyCooldown.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/SexyCooldown.lua @@ -30,8 +30,9 @@ GET ADDON DATA ########################################################## ]]-- local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## SEXYCOOLDOWN diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Skada.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Skada.lua index f1df7e2..225a11e 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Skada.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/Skada.lua @@ -30,7 +30,8 @@ local twipe = table.wipe; GET ADDON DATA ########################################################## ]]-- -local STYLE = _G.StyleVillain; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; local activePanels = {}; --[[ ########################################################## diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TinyDPS.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TinyDPS.lua index 57ba57f..ec46d7d 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TinyDPS.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TinyDPS.lua @@ -30,8 +30,9 @@ GET ADDON DATA ########################################################## ]]-- local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## TINYDPS diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TomTom.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TomTom.lua index 7a718fd..52397c3 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TomTom.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TomTom.lua @@ -30,8 +30,9 @@ GET ADDON DATA ########################################################## ]]-- local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## TOMTOM diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TradeSkillDW.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TradeSkillDW.lua index 63c30c7..f904b36 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TradeSkillDW.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/TradeSkillDW.lua @@ -30,8 +30,9 @@ GET ADDON DATA ########################################################## ]]-- local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## TSDW diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/VEM.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/VEM.lua index 3422ebc..5942c5f 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/VEM.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/VEM.lua @@ -30,8 +30,9 @@ GET ADDON DATA ########################################################## ]]-- local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## VEM diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/alDamageMeter.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/alDamageMeter.lua index 68ca64e..dc09a34 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/alDamageMeter.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/thirdparty/alDamageMeter.lua @@ -30,8 +30,9 @@ GET ADDON DATA ########################################################## ]]-- local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## ALDAMAGEMETER diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/timemanager.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/timemanager.lua index 176d650..0a49a23 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/timemanager.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/timemanager.lua @@ -14,15 +14,16 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## TIMEMANAGER STYLER ########################################################## ]]-- local function TimeManagerStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.timemanager ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.timemanager ~= true then return end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/trade.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/trade.lua index 21e96bb..a724c3f 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/trade.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/trade.lua @@ -14,15 +14,16 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## TRADEFRAME STYLER ########################################################## ]]-- local function TradeFrameStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.trade ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.trade ~= true then return end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/tradeskill.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/tradeskill.lua index bdd96e0..77634d4 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/tradeskill.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/tradeskill.lua @@ -14,15 +14,16 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## TRADESKILL STYLER ########################################################## ]]-- local function TradeSkillStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.tradeskill ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.tradeskill ~= true then return end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/trainer.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/trainer.lua index d23403b..f5dbb31 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/trainer.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/trainer.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -41,7 +42,7 @@ TRAINER STYLER ########################################################## ]]-- local function TrainerStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.trainer ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.trainer ~= true then return end ClassTrainerFrame:SetHeight(ClassTrainerFrame:GetHeight() + 42) STYLE:ApplyWindowStyle(ClassTrainerFrame) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/transmog.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/transmog.lua index ea32382..a91f476 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/transmog.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/transmog.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -49,7 +50,7 @@ TRANSMOG STYLER ########################################################## ]]-- local function TransmogStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.transmogrify ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.transmogrify ~= true then return end STYLE:ApplyWindowStyle(TransmogrifyFrame, true) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/voidstorage.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/voidstorage.lua index c6c5389..981f67e 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/voidstorage.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/voidstorage.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -36,7 +37,7 @@ VOIDSTORAGE STYLER ########################################################## ]]-- local function VoidStorageStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.voidstorage ~= true then + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.voidstorage ~= true then return end diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/worldmap.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/worldmap.lua index 702e532..c38c8b2 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/worldmap.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/worldmap.lua @@ -14,8 +14,9 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## HELPERS @@ -179,7 +180,7 @@ WORLDMAP STYLER ########################################################## ]]-- local function WorldMapStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.worldmap ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.worldmap ~= true then return end WorldMapFrame:SetFrameLevel(4) STYLE:ApplyWindowStyle(WorldMapFrame, true, true) diff --git a/Interface/AddOns/SVUI_StyleOMatic/addons/worldstate.lua b/Interface/AddOns/SVUI_StyleOMatic/addons/worldstate.lua index abfd1d6..29182bd 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/addons/worldstate.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/addons/worldstate.lua @@ -14,15 +14,16 @@ S U P E R - V I L L A I N - U I By: Munglunch # ############################################################################## --]] local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; --[[ ########################################################## WORLDSTATE STYLER ########################################################## ]]-- local function WorldStateStyle() - if SV.db.SVStyle.blizzard.enable ~= true or SV.db.SVStyle.blizzard.bgscore ~= true then return end + if SV.db[Schema].blizzard.enable ~= true or SV.db[Schema].blizzard.bgscore ~= true then return end WorldStateScoreScrollFrame:RemoveTextures() WorldStateScoreFrame:RemoveTextures() WorldStateScoreFrame:SetPanelTemplate("Halftone") diff --git a/Interface/AddOns/SVUI_StyleOMatic/common/methods.lua b/Interface/AddOns/SVUI_StyleOMatic/common/methods.lua index bb9da49..110e7c0 100644 --- a/Interface/AddOns/SVUI_StyleOMatic/common/methods.lua +++ b/Interface/AddOns/SVUI_StyleOMatic/common/methods.lua @@ -36,8 +36,9 @@ GET ADDON DATA ########################################################## ]]-- local SV = _G.SVUI; -local L = LibSuperVillain:Lang(); -local STYLE = _G.StyleVillain; +local L = SV.L; +local STYLE = select(2, ...); +local Schema = STYLE.Schema; local LSM = LibStub("LibSharedMedia-3.0") local NewHook = hooksecurefunc; --[[ diff --git a/Interface/AddOns/SVUI_TrackOMatic/License.txt b/Interface/AddOns/SVUI_TrackOMatic/License.txt new file mode 100644 index 0000000..6832ca7 --- /dev/null +++ b/Interface/AddOns/SVUI_TrackOMatic/License.txt @@ -0,0 +1,34 @@ +############################################################################### +#_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # +# ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # +# __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # +# ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # +# ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # +# _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # +# __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # +# _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# +# ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################### +# S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################### + +SVUI_TrackOMatic License Copyright 2014 http://wowinterface.com + +The contents of this addon, excluding third-party resources, are +copyrighted to their authors with all rights reserved. + +Authors of this addon hereby grant you the following rights: + +1. You may NOT make any modification inside this addon. If you want + to create your own edited version, please create it from outside. + +2. Do not modify the name of this addon, including the addon folders. + +3. This copyright notice shall be included in all copies or substantial + portions of the Software. + +All rights not explicitly addressed in this license are reserved by +the copyright holders. + +You can write Munglunch at Wowinterface.com for reporting abuse / bugs, +or regarding grants allowed for this license. \ No newline at end of file diff --git a/Interface/AddOns/SVUI_TrackOMatic/Loader.lua b/Interface/AddOns/SVUI_TrackOMatic/Loader.lua new file mode 100644 index 0000000..6c2a78f --- /dev/null +++ b/Interface/AddOns/SVUI_TrackOMatic/Loader.lua @@ -0,0 +1,34 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +S U P E R - V I L L A I N - U I By: Munglunch # +############################################################################## +########################################################## +LOCALIZED LUA FUNCTIONS +########################################################## +]]-- +local AddonName, AddonObject = ... + +assert(LibSuperVillain, AddonName .. " requires LibSuperVillain") + +local PLUGIN = LibSuperVillain:NewPlugin(AddonName, AddonObject) + +local Schema = PLUGIN.Schema; +local SV = _G["SVUI"]; + +SV.configs[Schema] = { + ["enable"] = true, + ["size"] = 75, + ["fontSize"] = 12, + ["groups"] = true, + ["proximity"] = false, +} \ No newline at end of file diff --git a/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.lua b/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.lua new file mode 100644 index 0000000..8978fc6 --- /dev/null +++ b/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.lua @@ -0,0 +1,737 @@ +--[[ +############################################################################## +_____/\\\\\\\\\\\____/\\\________/\\\__/\\\________/\\\__/\\\\\\\\\\\_ # + ___/\\\/////////\\\_\/\\\_______\/\\\_\/\\\_______\/\\\_\/////\\\///__ # + __\//\\\______\///__\//\\\______/\\\__\/\\\_______\/\\\_____\/\\\_____ # + ___\////\\\__________\//\\\____/\\\___\/\\\_______\/\\\_____\/\\\_____ # + ______\////\\\________\//\\\__/\\\____\/\\\_______\/\\\_____\/\\\_____ # + _________\////\\\______\//\\\/\\\_____\/\\\_______\/\\\_____\/\\\_____ # + __/\\\______\//\\\______\//\\\\\______\//\\\______/\\\______\/\\\_____ # + _\///\\\\\\\\\\\/________\//\\\________\///\\\\\\\\\/____/\\\\\\\\\\\_# + ___\///////////___________\///___________\/////////_____\///////////_# +############################################################################## +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 type = _G.type; +local tostring = _G.tostring; +local tonumber = _G.tonumber; +local tinsert = _G.tinsert; +local tremove = _G.tremove; +local string = _G.string; +local math = _G.math; +local bit = _G.bit; +local table = _G.table; +--[[ STRING METHODS ]]-- +local format, find, lower, match = string.format, string.find, string.lower, string.match; +--[[ 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 min, huge, random = math.min, math.huge, math.random; -- Uncommon +local sqrt2, max = math.sqrt(2), math.max; +--[[ TABLE METHODS ]]-- +local tcopy, twipe, tsort, tconcat, tdump = table.copy, table.wipe, table.sort, table.concat, table.dump; +--[[ BINARY METHODS ]]-- +local band = bit.band; +--[[ +########################################################## +GET ADDON DATA +########################################################## +]]-- +local PLUGIN = LibSuperVillain:NewPlugin(...) +local Schema = PLUGIN.Schema; +local VERSION = PLUGIN.Version; + +local SV = _G["SVUI"]; +local L = SV.L; +--[[ +########################################################## +LOCALS AND BINDING +########################################################## +]]-- +BINDING_HEADER_SVUITRACK = "Supervillain UI: Tracking Device"; + +local NewHook = hooksecurefunc; +local playerGUID = UnitGUID('player') +local classColor = RAID_CLASS_COLORS +local radian90 = (3.141592653589793 / 2) * -1; +local GetDistance, GetTarget, GetFromPlayer; +--[[ +########################################################## +BUILD +########################################################## +]]-- +function SVUI_TrackingDoodad_OnLoad() + local frame = _G["SVUI_TrackingDoodad"] + --frame.Border:SetGradient(unpack(SV.Media.gradient.dark)) + frame.Arrow:SetVertexColor(0.1, 0.8, 0.8) + frame.Range:SetFont(SV.Media.font.roboto, 14, "OUTLINE") + frame.Range:SetTextColor(1, 1, 1, 0.75) + SV.Animate:Orbit(frame.Radar, 8, true) + frame:RegisterForDrag("LeftButton"); + frame:Hide() +end + +do + local WORLDMAPAREA_DEFAULT_DUNGEON_FLOOR_IS_TERRAIN = 0x00000004 + local WORLDMAPAREA_VIRTUAL_CONTINENT = 0x00000008 + local DUNGEONMAP_MICRO_DUNGEON = 0x00000001 + local _failsafe, _cache, _dungeons, _transform = {}, {}, {}, {}; + + local _mapdata = { + [0] = { + height = 22266.74312, + system = -1, + width = 33400.121, + xOffset = 0, + yOffset = 0, + [1] = { + xOffset = -10311.71318, + yOffset = -19819.33898, + scale = 0.56089997291565, + }, + [0] = { + xOffset = -48226.86993, + yOffset = -16433.90283, + scale = 0.56300002336502, + }, + [571] = { + xOffset = -29750.89905, + yOffset = -11454.50802, + scale = 0.5949000120163, + }, + [870] = { + xOffset = -27693.71178, + yOffset = -29720.0585, + scale = 0.65140002965927, + }, + }, + } + + local _failsafeFunc = function(tbl, key) + if(type(key) == "number") then + return _failsafe; + else + return rawget(_failsafe, key); + end + end + + setmetatable(_failsafe, { xOffset = 0, height = 1, yOffset = 0, width = 1, __index = _failsafeFunc }); + setmetatable(_mapdata, _failsafe); + + for _, ID in ipairs(GetWorldMapTransforms()) do + local terrain, newterrain, _, _, transformMinY, transformMaxY, transformMinX, transformMaxX, offsetY, offsetX = GetWorldMapTransformInfo(ID) + if ( offsetX ~= 0 or offsetY ~= 0 ) then + _transform[ID] = { + terrain = terrain, + newterrain = newterrain, + BRy = -transformMinY, + TLy = -transformMaxY, + BRx = -transformMinX, + TLx = -transformMaxX, + offsetY = offsetY, + offsetX = offsetX, + } + end + end + + local function _getmapdata(t) + local chunk = {} + local mapName = GetMapInfo(); + local id = GetCurrentMapAreaID(); + local numFloors = GetNumDungeonMapLevels(); + chunk.mapName = mapName; + chunk.cont = (GetCurrentMapContinent()) or -100; + chunk.zone = (GetCurrentMapZone()) or -100; + chunk.numFloors = numFloors; + local _, TLx, TLy, BRx, BRy = GetCurrentMapZone(); + if(TLx and TLy and BRx and BRy and (TLx~=0 or TLy~=0 or BRx~=0 or BRy~=0)) then + chunk[0] = {}; + chunk[0].TLx = TLx; + chunk[0].TLy = TLy; + chunk[0].BRx = BRx; + chunk[0].BRy = BRy; + end + if(not chunk[0] and numFloors == 0 and (GetCurrentMapDungeonLevel()) == 1) then + numFloors = 1; + chunk.hiddenFloor = true; + end + if(numFloors > 0) then + for f = 1, numFloors do + SetDungeonMapLevel(f); + local _, TLx, TLy, BRx, BRy = GetCurrentMapDungeonLevel(); + if(TLx and TLy and BRx and BRy) then + chunk[f] = {}; + chunk[f].TLx = TLx; + chunk[f].TLy = TLy; + chunk[f].BRx = BRx; + chunk[f].BRy = BRy; + end + end + end + + t[id] = chunk; + end + + do + local continents = { GetMapContinents() }; + for C in pairs(continents) do + local zones = { GetMapZones(C) }; + continents[C] = zones; + local pass, error = pcall(SetMapZoom, C, 0) + if(pass) then + zones[0] = GetCurrentMapAreaID(); + _getmapdata(_cache); + for Z in ipairs(zones) do + SetMapZoom(C, Z); + zones[Z] = GetCurrentMapAreaID(); + _getmapdata(_cache); + end + end + end + + for _, id in ipairs(GetAreaMaps()) do + if not (_cache[id]) then + if(SetMapByID(id)) then + _getmapdata(_cache); + end + end + end + end + + for id, map in pairs(_cache) do + local terrain, _, _, _, _, _, _, _, _, flags = GetAreaMapInfo(id) + local origin = terrain; + local chunk = _mapdata[id]; + if not (chunk) then chunk = {}; end + if(map.numFloors > 0 or map.hiddenFloor) then + for f, coords in pairs(map) do + if(type(f) == "number" and f > 0) then + if not (chunk[f]) then + chunk[f] = {}; + end + local flr = chunk[f] + local TLx, TLy, BRx, BRy = -coords.BRx, -coords.BRy, -coords.TLx, -coords.TLy + if not (flr.width) then + flr.width = BRx - TLx + end + if not (flr.height) then + flr.height = BRy - TLy + end + if not (flr.xOffset) then + flr.xOffset = TLx + end + if not (flr.yOffset) then + flr.yOffset = TLy + end + end + end + for f = 1, map.numFloors do + if not (chunk[f]) then + if(f == 1 and map[0] and map[0].TLx and map[0].TLy and map[0].BRx and map[0].BRy and + band(flags, WORLDMAPAREA_DEFAULT_DUNGEON_FLOOR_IS_TERRAIN) == WORLDMAPAREA_DEFAULT_DUNGEON_FLOOR_IS_TERRAIN) then + chunk[f] = {}; + local flr = chunk[f] + local coords = map[0] + local TLx, TLy, BRx, BRy = -coords.TLx, -coords.TLy, -coords.BRx, -coords.BRy + flr.width = BRx - TLx + flr.height = BRy - TLy + flr.xOffset = TLx + flr.yOffset = TLy + end + end + end + if(map.hiddenFloor) then + chunk.width = chunk[1].width + chunk.height = chunk[1].height + chunk.xOffset = chunk[1].xOffset + chunk.yOffset = chunk[1].yOffset + end + else + local coords = map[0] + if(coords ~= nil) then + local TLx, TLy, BRx, BRy = -coords.TLx, -coords.TLy, -coords.BRx, -coords.BRy + for _, trans in pairs(_transform) do + if(trans.terrain == terrain) then + if((trans.TLx < TLx and BRx < trans.BRx) and (trans.TLy < TLy and BRy < trans.BRy)) then + TLx = TLx - trans.offsetX; + BRx = BRx - trans.offsetX; + BRy = BRy - trans.offsetY; + TLy = TLy - trans.offsetY; + terrain = trans.newterrain; + break; + end + end + end + if not (TLx==0 and TLy==0 and BRx==0 and BRy==0) then + if not (TLx < BRx) then + printError("Bad x-axis Orientation (Zone): ", id, TLx, BRx); + end + if not (TLy < BRy) then + printError("Bad y-axis Orientation (Zone): ", id, TLy, BRy); + end + end + if not (chunk.width) then + chunk.width = BRx - TLx + end + if not (chunk.height) then + chunk.height = BRy - TLy + end + if not (chunk.xOffset) then + chunk.xOffset = TLx + end + if not (chunk.yOffset) then + chunk.yOffset = TLy + end + end + end + if not (next(chunk, nil)) then + chunk = { xOffset = 0, height = 1, yOffset = 0, width = 1 }; + end + if not (chunk.origin) then + chunk.origin = origin; + end + _mapdata[id] = chunk; + if(chunk and chunk ~= _failsafe) then + if not (chunk.system) then + chunk.system = terrain; + end + if(map.cont > 0 and map.zone > 0) then + _dungeons[terrain] = {} + end + setmetatable(chunk, _failsafe); + end + end + + local function _getpos(map, mapFloor, x, y) + if not map then return end + if (mapFloor ~= 0) then + map = rawget(map, mapFloor) or _dungeons[map.origin][mapFloor]; + end + x = x * map.width + map.xOffset; + y = y * map.height + map.yOffset; + return x, y; + end + + function GetDistance(map1, floor1, x1, y1, map2, floor2, x2, y2) + if not (map1 and map2) then return end + floor1 = floor1 or min(#_mapdata[map1], 1); + floor2 = floor2 or min(#_mapdata[map2], 1); + local dist, xDelta, yDelta, angle; + if(map1 == map2 and floor1 == floor2) then + local chunk = _mapdata[map1]; + local tmp = chunk + if(floor1 ~= 0) then + tmp = rawget(chunk, floor1) + end + local w,h = 1,1 + if(not tmp) then + if(_dungeons[chunk.origin] and _dungeons[chunk.origin][floor1]) then + chunk = _dungeons[chunk.origin][floor1] + w = chunk.width + h = chunk.height + else + w = 1 + h = 1 + end + else + w = chunk.width + h = chunk.height + end + xDelta = (x2 - x1) * (w or 1); + yDelta = (y2 - y1) * (h or 1); + else + local map1 = _mapdata[map1]; + local map2 = _mapdata[map2]; + if(map1.system == map2.system) then + x1, y1 = _getpos(map1, floor1, x1, y1); + x2, y2 = _getpos(map2, floor2, x2, y2); + xDelta = (x2 - x1); + yDelta = (y2 - y1); + else + local s1 = map1.system; + local s2 = map2.system; + if((map1==0 or _mapdata[0][s1]) and (map2 == 0 or _mapdata[0][s2])) then + x1, y1 = _getpos(map1, floor1, x1, y1); + x2, y2 = _getpos(map2, floor2, x2, y2); + if(map1 ~= 0) then + local cont1 = _mapdata[0][s1]; + x1 = (x1 - cont1.xOffset) * cont1.scale; + y1 = (y1 - cont1.yOffset) * cont1.scale; + end + if(map2 ~= 0) then + local cont2 = _mapdata[0][s2]; + x2 = (x2 - cont2.xOffset) * cont2.scale; + y2 = (y2 - cont2.yOffset) * cont2.scale; + end + xDelta = x2 - x1; + yDelta = y2 - y1; + end + end + end + + if(xDelta and yDelta) then + local playerAngle = GetPlayerFacing() + dist = sqrt(xDelta * xDelta + yDelta * yDelta); + angle = (radian90 - playerAngle) - atan2(yDelta, xDelta) + end + + return dist, angle; + end +end + +do + local function _findunit(unit, doNotCheckMap) + local x, y = GetPlayerMapPosition(unit); + if(x <= 0 and y <= 0) then + if(doNotCheckMap) then return; end + local lastMapID, lastFloor = GetCurrentMapAreaID(), GetCurrentMapDungeonLevel(); + SetMapToCurrentZone(); + x, y = GetPlayerMapPosition(unit); + if(x <= 0 and y <= 0) then + if(ZoomOut()) then + elseif(GetCurrentMapZone() ~= WORLDMAP_WORLD_ID) then + SetMapZoom(GetCurrentMapContinent()); + else + SetMapZoom(WORLDMAP_WORLD_ID); + end + x, y = GetPlayerMapPosition(unit); + if(x <= 0 and y <= 0) then + return; + end + end + local thisMapID, thisFloor = GetCurrentMapAreaID(), GetCurrentMapDungeonLevel(); + if(thisMapID ~= lastMapID or thisFloor ~= lastFloor) then + SetMapByID(lastMapID); + SetDungeonMapLevel(lastFloor); + end + return thisMapID, thisFloor, x, y; + end + return GetCurrentMapAreaID(), GetCurrentMapDungeonLevel(), x, y; + end + + local function _findplayer() + local x, y = GetPlayerMapPosition("player"); + if(x <= 0 and y <= 0) then + if(WorldMap and WorldMap:IsShown()) then return end + SetMapToCurrentZone(); + x, y = GetPlayerMapPosition("player"); + if(x <= 0 and y <= 0) then + if(ZoomOut()) then + elseif(GetCurrentMapZone() ~= WORLDMAP_WORLD_ID) then + SetMapZoom(GetCurrentMapContinent()); + else + SetMapZoom(WORLDMAP_WORLD_ID); + end + x, y = GetPlayerMapPosition("player"); + if(x <= 0 and y <= 0) then + return; + end + end + end + return GetCurrentMapAreaID(), GetCurrentMapDungeonLevel(), x, y; + end + + function GetTarget(unit, doNotCheckMap) + local plot1, plot2, plot3, plot4; + if unit == "player" or UnitIsUnit("player", unit) then + plot1, plot2, plot3, plot4 = _findplayer() + else + plot1, plot2, plot3, plot4 = _findunit(unit, doNotCheckMap or WorldMapFrame:IsVisible()) + end + if not (plot1 and plot4) then + return false + else + return true, plot1, plot2, plot3, plot4 + end + end + + function GetFromPlayer(unit, noMapLocation) + if(WorldMap and WorldMap:IsShown()) then return end + local plot3, plot4 = GetPlayerMapPosition("player"); + if(plot3 <= 0 and plot4 <= 0) then + SetMapToCurrentZone(); + plot3, plot4 = GetPlayerMapPosition("player"); + if(plot3 <= 0 and plot4 <= 0) then + if(ZoomOut()) then + elseif(GetCurrentMapZone() ~= WORLDMAP_WORLD_ID) then + SetMapZoom(GetCurrentMapContinent()); + else + SetMapZoom(WORLDMAP_WORLD_ID); + end + plot3, plot4 = GetPlayerMapPosition("player"); + if(plot3 <= 0 and plot4 <= 0) then + return; + end + end + end + + local plot1 = GetCurrentMapAreaID() + local plot2 = GetCurrentMapDungeonLevel() + + local plot5, plot6; + local plot7, plot8 = GetPlayerMapPosition(unit); + + if(noMapLocation and (plot7 <= 0 and plot8 <= 0)) then + local lastMapID, lastFloor = GetCurrentMapAreaID(), GetCurrentMapDungeonLevel(); + SetMapToCurrentZone(); + plot7, plot8 = GetPlayerMapPosition(unit); + if(plot7 <= 0 and plot8 <= 0) then + if(ZoomOut()) then + elseif(GetCurrentMapZone() ~= WORLDMAP_WORLD_ID) then + SetMapZoom(GetCurrentMapContinent()); + else + SetMapZoom(WORLDMAP_WORLD_ID); + end + plot7, plot8 = GetPlayerMapPosition(unit); + if(plot7 <= 0 and plot8 <= 0) then + return; + end + end + plot5, plot6 = GetCurrentMapAreaID(), GetCurrentMapDungeonLevel(); + if(plot5 ~= lastMapID or plot6 ~= lastFloor) then + SetMapByID(lastMapID); + SetDungeonMapLevel(lastFloor); + end + local distance, angle = GetDistance(plot1, plot2, plot3, plot4, plot5, plot6, plot7, plot8) + return distance, angle + end + + local distance, angle = GetDistance(plot1, plot2, plot3, plot4, plot1, plot2, plot7, plot8) + return distance, angle + end +end + +function Triangulate(unit, noMapLocation) + local distance, angle = GetFromPlayer(unit, noMapLocation) + return distance, angle +end +--[[ +########################################################## +MAIN MOVABLE TRACKER +########################################################## +]]-- +function PLUGIN:PLAYER_TARGET_CHANGED() + if not SVUI_TrackingDoodad then return end + if((UnitInParty("target") or UnitInRaid("target")) and not UnitIsUnit("target", "player")) then + SVUI_TrackingDoodad.Trackable = true + SVUI_TrackingDoodad:Show() + else + SVUI_TrackingDoodad.Trackable = false + end +end + +local Rotate_Arrow = function(self, angle) + local radius, ULx, ULy, LLx, LLy, URx, URy, LRx, LRy + + radius = angle - 0.785398163 + URx = 0.5 + cos(radius) / sqrt2 + URy = 0.5 + sin(radius) / sqrt2 + -- (-1) + radius = angle + 0.785398163 + LRx = 0.5 + cos(radius) / sqrt2 + LRy = 0.5 + sin(radius) / sqrt2 + -- 1 + radius = angle + 2.35619449 + LLx = 0.5 + cos(radius) / sqrt2 + LLy = 0.5 + sin(radius) / sqrt2 + -- 3 + radius = angle + 3.92699082 + ULx = 0.5 + cos(radius) / sqrt2 + ULy = 0.5 + sin(radius) / sqrt2 + -- 5 + + self.Arrow:SetTexCoord(ULx, ULy, LLx, LLy, URx, URy, LRx, LRy); +end + +local TargetFrame_OnChange = function() + if not SVUI_TrackingDoodad then return end + if((UnitInParty("target") or UnitInRaid("target")) and not UnitIsUnit("target", "player")) then + SVUI_TrackingDoodad.Trackable = true + SVUI_TrackingDoodad:Show() + else + SVUI_TrackingDoodad.Trackable = false + end +end + +local Tracker_OnUpdate = function(self, elapsed) + if self.elapsed and self.elapsed > (self.throttle or 0.02) then + if(self.Trackable) then + local distance, angle = Triangulate("target", true) + local _ARROW = self.Arrow + local _SPINNER = self.Radar + local _TEXT = self.Range + local _BG = self.BG + if not angle then + self.throttle = 4 + _ARROW:SetAlpha(0) + _SPINNER:SetVertexColor(0.8,0.1,0.1,0.15) + _BG:SetVertexColor(1,0,0,0.15) + else + self.throttle = 0.02 + local out = floor(tonumber(distance)) + self:Spin(angle) + if(out > 100) then + _ARROW:SetVertexColor(1,0.1,0.1,0.4) + _SPINNER:SetVertexColor(0.8,0.1,0.1,0.25) + _BG:SetVertexColor(0.8,0.4,0.1,0.25) + elseif(out > 40) then + _ARROW:SetVertexColor(1,0.8,0.1,0.6) + _SPINNER:SetVertexColor(0.8,0.8,0.1,0.5) + _BG:SetVertexColor(0.4,0.8,0.1,0.5) + elseif(out > 5) then + _ARROW:SetVertexColor(0.1,1,0.8,0.9) + _SPINNER:SetVertexColor(0.1,0.8,0.8,0.75) + _BG:SetVertexColor(0.1,0.8,0.1,0.75) + end + _ARROW:SetAlpha(1) + _TEXT:SetText(out) + end + else + self:Hide() + end + self.elapsed = 0 + else + self.elapsed = (self.elapsed or 0) + elapsed + end +end +--[[ +########################################################## +GROUP UNIT TRACKERS +########################################################## +]]-- +local GPS_Triangulate = function(self, unit) + local available = (self.OnlyProximity == false and self.onMouseOver == false) + local distance, angle = Triangulate(unit, available) + return distance, angle +end + +local RefreshGPS = function(self, frame, template) + if(frame.GPS) then + local config = SV.db[Schema] + if(config.groups) then + frame.GPS.OnlyProximity = config.proximity + local actualSz = min(frame.GPS.DefaultSize, (frame:GetHeight() - 2)) + if(not frame:IsElementEnabled("GPS")) then + frame:EnableElement("GPS") + end + else + if(frame:IsElementEnabled("GPS")) then + frame:DisableElement("GPS") + end + end + end +end + +function PLUGIN:CreateGPS(frame) + if not frame then return end + local size = 32 + + local gps = CreateFrame("Frame", nil, frame.InfoPanel) + gps:SetFrameLevel(99) + gps:Size(size, size) + gps.DefaultSize = size + gps:Point("RIGHT", frame, "RIGHT", 0, 0) + + gps.Arrow = gps:CreateTexture(nil, "OVERLAY", nil, 7) + gps.Arrow:SetTexture([[Interface\AddOns\SVUI_TrackOMatic\artwork\GPS-ARROW]]) + gps.Arrow:Size(size, size) + gps.Arrow:SetPoint("CENTER", gps, "CENTER", 0, 0) + gps.Arrow:SetVertexColor(0.1, 0.8, 0.8) + gps.Arrow:SetBlendMode("ADD") + + gps.onMouseOver = true + gps.OnlyProximity = false + + gps.Spin = Rotate_Arrow + + frame.GPS = gps + + --frame.GPS:Hide() +end +--[[ +########################################################## +CORE +########################################################## +]]-- +function PLUGIN:ReLoad() + if(not SV.db[Schema].enable) then return end + + local frameSize = SV.db[Schema].size or 70 + local arrowSize = frameSize * 0.5 + local fontSize = SV.db[Schema].fontSize or 14 + local frame = _G["SVUI_TrackingDoodad"] + + frame:SetSize(frameSize, frameSize) + frame.Arrow:SetSize(arrowSize, arrowSize) + frame.Range:SetFont(SV.Media.font.roboto, fontSize, "OUTLINE") +end + +function PLUGIN:Load() + if(not SV.db[Schema].enable) then return end + + local _TRACKER = SVUI_TrackingDoodad + local _TARGET = SVUI_Target + + if(_TRACKER) then + + _TRACKER.Spin = Rotate_Arrow + _TRACKER:SetParent(SVUI_Target) + _TRACKER:SetScript("OnUpdate", Tracker_OnUpdate) + + self:RegisterEvent("PLAYER_TARGET_CHANGED") + end + + if(_TARGET) then + local frame = _G["SVUI_TrackingDoodad"] + frame:SetPoint("LEFT", _TARGET, "RIGHT", 2, 0) + _TARGET:HookScript("OnShow", TargetFrame_OnChange) + end + + NewHook(SV.SVUnit, "RefreshUnitLayout", RefreshGPS) + + local options = { + order = 3, + name = L["GPS"], + desc = L["Use group frame GPS elements"], + type = "toggle", + get = function() return SV.db[Schema].groups end, + set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); PLUGIN:UpdateLogWindow() end + } + + self:AddOption("groups", options) + + options = { + order = 4, + name = L["GPS Proximity"], + desc = L["Only point to closest low health unit"], + type = "toggle", + get = function() return SV.db[Schema].proximity end, + set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); PLUGIN:UpdateLogWindow() end + } + + self:AddOption("proximity", options) + + options = { + order = 5, + name = L["Font Size"], + desc = L["Set the font size of the range text"], + type = "range", + min = 6, + max = 22, + step = 1, + get = function() return SV.db[Schema].fontSize end, + set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); PLUGIN:UpdateLogWindow() end + } + + self:AddOption("fontSize", options) +end \ No newline at end of file diff --git a/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.toc b/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.toc new file mode 100644 index 0000000..6257485 --- /dev/null +++ b/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.toc @@ -0,0 +1,13 @@ +## Interface: 60000 +## Author: Munglunch +## Version: 4.7 +## Title: |cffFF9900SVUI |r|cffFFEF00Track O Matic|r +## Notes: Supervillain UI [|cff9911FFRaid & Party Member Tracking|r]. +## RequiredDeps: SVUI +## LoadOnDemand: 1 +## X-Email: munglunch@gmail.com +## X-oUF: oUF_Villain +## X-SVUI-Header: Track-O-Matic +## X-SVUI-Schema: TrackOMatic + +SVUI_TrackOMatic.xml diff --git a/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.xml b/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.xml new file mode 100644 index 0000000..da2b28d --- /dev/null +++ b/Interface/AddOns/SVUI_TrackOMatic/SVUI_TrackOMatic.xml @@ -0,0 +1,47 @@ +<Ui xmlns="http://www.blizzard.com/wow/ui/"> + <Script file='Loader.lua'/> + <Script file='SVUI_TrackOMatic.lua'/> + <Script file='libs\oUF_GPS\oUF_GPS.lua'/> + + <Frame name="SVUI_TrackingDoodad" movable="true" frameStrata="DIALOG"> + <Size x="70" y="70"/> + <Anchors> + <Anchor point="CENTER" relativeTo="UIParent" relativePoint="CENTER"/> + </Anchors> + <Layers> + <Layer level="BACKGROUND"> + <Texture parentKey="BG" setAllPoints="true" file="Interface\AddOns\SVUI_TrackOMatic\artwork\DOODAD-BG"/> + </Layer> + <Layer level="BORDER"> + <Texture parentKey="Border" setAllPoints="true" file="Interface\AddOns\SVUI_TrackOMatic\artwork\DOODAD-BORDER"/> + <Texture parentKey="Arrow" file="Interface\AddOns\SVUI_TrackOMatic\artwork\DOODAD-ARROW"> + <Size x="35" y="35"/> + <Anchors> + <Anchor point="CENTER" relativeTo="$parent" relativePoint="CENTER"/> + </Anchors> + </Texture> + </Layer> + <Layer level="OVERLAY"> + <Texture parentKey="Radar" setAllPoints="true" file="Interface\AddOns\SVUI_TrackOMatic\artwork\DOODAD-RADAR"/> + </Layer> + <Layer level="ARTWORK"> + <FontString parentKey="Range" inherits="GameFontNormal"> + <Anchors> + <Anchor point="TOP" relativeTo="$parent" relativePoint="BOTTOM"/> + </Anchors> + </FontString> + </Layer> + </Layers> + <Scripts> + <OnLoad function="SVUI_TrackingDoodad_OnLoad"/> + <OnDragStart> + _G["SVUI_TrackingDoodad"].moving = true; + _G["SVUI_TrackingDoodad"]:StartMoving(); + </OnDragStart> + <OnDragStop> + _G["SVUI_TrackingDoodad"].moving = nil; + _G["SVUI_TrackingDoodad"]:StopMovingOrSizing(); + </OnDragStop> + </Scripts> + </Frame> +</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_TrackOMatic/artwork/DOODAD-ARROW.blp b/Interface/AddOns/SVUI_TrackOMatic/artwork/DOODAD-ARROW.blp new file mode 100644 index 0000000..b20f63d Binary files /dev/null and b/Interface/AddOns/SVUI_TrackOMatic/artwork/DOODAD-ARROW.blp differ diff --git a/Interface/AddOns/SVUI_TrackOMatic/artwork/DOODAD-BG.blp b/Interface/AddOns/SVUI_TrackOMatic/artwork/DOODAD-BG.blp new file mode 100644 index 0000000..7f60ca2 Binary files /dev/null and b/Interface/AddOns/SVUI_TrackOMatic/artwork/DOODAD-BG.blp differ diff --git a/Interface/AddOns/SVUI_TrackOMatic/artwork/DOODAD-BORDER.blp b/Interface/AddOns/SVUI_TrackOMatic/artwork/DOODAD-BORDER.blp new file mode 100644 index 0000000..c69bd6a Binary files /dev/null and b/Interface/AddOns/SVUI_TrackOMatic/artwork/DOODAD-BORDER.blp differ diff --git a/Interface/AddOns/SVUI_TrackOMatic/artwork/DOODAD-RADAR.blp b/Interface/AddOns/SVUI_TrackOMatic/artwork/DOODAD-RADAR.blp new file mode 100644 index 0000000..53d920b Binary files /dev/null and b/Interface/AddOns/SVUI_TrackOMatic/artwork/DOODAD-RADAR.blp differ diff --git a/Interface/AddOns/SVUI_TrackOMatic/artwork/GPS-ARROW.blp b/Interface/AddOns/SVUI_TrackOMatic/artwork/GPS-ARROW.blp new file mode 100644 index 0000000..9fb0a32 Binary files /dev/null and b/Interface/AddOns/SVUI_TrackOMatic/artwork/GPS-ARROW.blp differ diff --git a/Interface/AddOns/SVUI_TrackOMatic/libs/oUF_GPS/oUF_GPS.lua b/Interface/AddOns/SVUI_TrackOMatic/libs/oUF_GPS/oUF_GPS.lua new file mode 100644 index 0000000..2cf3bc3 --- /dev/null +++ b/Interface/AddOns/SVUI_TrackOMatic/libs/oUF_GPS/oUF_GPS.lua @@ -0,0 +1,211 @@ +local oUF = oUF_Villain or oUF +assert(oUF, 'oUF not loaded') + +local PLUGIN = select(2, ...); + +local max, floor = math.max, math.floor; +local tinsert, tremove, tsort, twipe = table.insert, table.remove, table.sort, table.wipe; + +local playerGUID = UnitGUID("player") +local _FRAMES, _PROXIMITY, OnUpdateFrame = {}, {} +local minThrottle = 0.02 +local numArrows, inRange, GPS +--[[ +########################################################## +oUF TAGS +########################################################## +]]-- +local taggedUnits = {} +local groupTagManager = CreateFrame("Frame") +groupTagManager:RegisterEvent("GROUP_ROSTER_UPDATE") +groupTagManager:SetScript("OnEvent", function() + local group, count; + twipe(taggedUnits) + if IsInRaid() then + group = "raid" + count = GetNumGroupMembers() + elseif IsInGroup() then + group = "party" + count = GetNumGroupMembers() - 1; + taggedUnits["player"] = true + else + group = "solo" + count = 1 + end + for i = 1, count do + local realName = group..i; + if not UnitIsUnit(realName, "player") then + taggedUnits[realName] = true + end + end +end); + +oUF.Tags.OnUpdateThrottle['nearbyplayers:8'] = 0.25 +oUF.Tags.Methods["nearbyplayers:8"] = function(unit) + local unitsInRange, distance = 0; + if UnitIsConnected(unit)then + for taggedUnit, _ in pairs(taggedUnits)do + if not UnitIsUnit(unit, taggedUnit) and UnitIsConnected(taggedUnit)then + distance = Triangulate(unit, taggedUnit, true) + if distance and distance <= 8 then + unitsInRange = unitsInRange + 1 + end + end + end + end + return unitsInRange +end + +oUF.Tags.OnUpdateThrottle['nearbyplayers:10'] = 0.25 +oUF.Tags.Methods["nearbyplayers:10"] = function(unit) + local unitsInRange, distance = 0; + if UnitIsConnected(unit)then + for taggedUnit, _ in pairs(taggedUnits)do + if not UnitIsUnit(unit, taggedUnit) and UnitIsConnected(taggedUnit)then + distance = Triangulate(unit, taggedUnit, true) + if distance and distance <= 10 then + unitsInRange = unitsInRange + 1 + end + end + end + end + return unitsInRange +end + +oUF.Tags.OnUpdateThrottle['nearbyplayers:30'] = 0.25 +oUF.Tags.Methods["nearbyplayers:30"] = function(unit) + local unitsInRange, distance = 0; + if UnitIsConnected(unit)then + for taggedUnit, _ in pairs(taggedUnits)do + if not UnitIsUnit(unit, taggedUnit) and UnitIsConnected(taggedUnit)then + distance = Triangulate(unit, taggedUnit, true) + if distance and distance <= 30 then + unitsInRange = unitsInRange + 1 + end + end + end + end + return unitsInRange +end + +oUF.Tags.OnUpdateThrottle['distance'] = 0.25 +oUF.Tags.Methods["distance"] = function(unit) + if not UnitIsConnected(unit) or UnitIsUnit(unit, "player")then return "" end + local dst = Triangulate("player", unit, true) + if dst and dst > 0 then + return format("%d", dst) + end + return "" +end +--[[ +########################################################## +GPS ELEMENT +########################################################## +]]-- +local sortFunc = function(a,b) return a[1] < b[1] end + +local Update = function(self, elapsed) + if self.elapsed and self.elapsed > (self.throttle or minThrottle) then + numArrows = 0 + twipe(_PROXIMITY) + for _, object in next, _FRAMES do + if(object:IsShown()) then + GPS = object.GPS + local unit = object.unit + if(unit) then + if(GPS.PreUpdate) then GPS:PreUpdate(frame) end + + local outOfRange = GPS.outOfRange and UnitInRange(unit) or false + + if(not unit or not (UnitInParty(unit) or UnitInRaid(unit)) or UnitIsUnit(unit, "player") or not UnitIsConnected(unit) or (not GPS.OnlyProximity and ((GPS.onMouseOver and (GetMouseFocus() ~= object)) or outOfRange))) then + GPS:Hide() + else + local distance, angle = Triangulate(unit) + if not angle then + GPS:Hide() + else + if(GPS.OnlyProximity == false) then + GPS:Show() + else + GPS:Hide() + end + + if GPS.Arrow then + if(distance > 40) then + GPS.Arrow:SetVertexColor(1,0.1,0.1) + else + if(distance > 30) then + GPS.Arrow:SetVertexColor(0.4,0.8,0.1) + else + GPS.Arrow:SetVertexColor(0.1,1,0.1) + end + if(GPS.OnlyProximity and object.Health.percent and object.Health.percent < 80) then + local value = object.Health.percent + distance + _PROXIMITY[#_PROXIMITY + 1] = {value, GPS} + end + end + GPS:Spin(angle) + end + + if GPS.Text then + GPS.Text:SetText(floor(distance)) + end + + if(GPS.PostUpdate) then GPS:PostUpdate(frame, distance, angle) end + numArrows = numArrows + 1 + end + end + else + GPS:Hide() + end + end + end + + if(_PROXIMITY[1]) then + tsort(_PROXIMITY, sortFunc) + if(_PROXIMITY[1][2]) then + _PROXIMITY[1][2]:Show() + end + end + + self.elapsed = 0 + self.throttle = max(minThrottle, 0.005 * numArrows) + else + self.elapsed = (self.elapsed or 0) + elapsed + end +end + +local Enable = function(self) + local unit = self.unit + if(unit:find("raid") or unit:find("party")) then + if not self.GPS then PLUGIN:CreateGPS(self) end + tinsert(_FRAMES, self) + + if not OnUpdateFrame then + OnUpdateFrame = CreateFrame("Frame") + OnUpdateFrame:SetScript("OnUpdate", Update) + end + + OnUpdateFrame:Show() + return true + end +end + +local Disable = function(self) + local GPS = self.GPS + if GPS then + for k, frame in next, _FRAMES do + if(frame == self) then + tremove(_FRAMES, k) + GPS:Hide() + break + end + end + + if #_FRAMES == 0 and OnUpdateFrame then + OnUpdateFrame:Hide() + end + end +end + +oUF:AddElement('GPS', nil, Enable, Disable) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_TrackOMatic/libs/oUF_GPS/oUF_GPS.toc b/Interface/AddOns/SVUI_TrackOMatic/libs/oUF_GPS/oUF_GPS.toc new file mode 100644 index 0000000..cdca787 --- /dev/null +++ b/Interface/AddOns/SVUI_TrackOMatic/libs/oUF_GPS/oUF_GPS.toc @@ -0,0 +1,9 @@ +## Interface: 50001 +## Title: oUF GPS +## Notes: Adds GPS arrow to frames. +## Author: Omega1970, Munglunch +## Version: 1.00 +## X-Category: oUF +## Dependencies: oUF + +oUF_GPS.lua \ No newline at end of file diff --git a/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.lua b/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.lua deleted file mode 100644 index 35c02d3..0000000 --- a/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.lua +++ /dev/null @@ -1,752 +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 type = _G.type; -local tostring = _G.tostring; -local tonumber = _G.tonumber; -local tinsert = _G.tinsert; -local tremove = _G.tremove; -local string = _G.string; -local math = _G.math; -local bit = _G.bit; -local table = _G.table; ---[[ STRING METHODS ]]-- -local format, find, lower, match = string.format, string.find, string.lower, string.match; ---[[ 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 min, huge, random = math.min, math.huge, math.random; -- Uncommon -local sqrt2, max = math.sqrt(2), math.max; ---[[ TABLE METHODS ]]-- -local tcopy, twipe, tsort, tconcat, tdump = table.copy, table.wipe, table.sort, table.concat, table.dump; ---[[ BINARY METHODS ]]-- -local band = bit.band; ---[[ -########################################################## -GET ADDON DATA -########################################################## -]]-- -local SVUIAddOnName, PLUGIN = ...; -local SV = SVUI -local SVLib = LibSuperVillain -local L = SVLib:Lang() - -PLUGIN = SVLib:NewPrototype(SVUIAddOnName) - -_G["TrackingVillain"] = PLUGIN; ---[[ -########################################################## -LOCALS AND BINDING -########################################################## -]]-- -BINDING_HEADER_SVUITRACK = "Supervillain UI: Tracking Device"; - -local NewHook = hooksecurefunc; -local playerGUID = UnitGUID('player') -local classColor = RAID_CLASS_COLORS -local radian90 = (3.141592653589793 / 2) * -1; -local GetDistance, GetTarget, GetFromPlayer; - -local Schema = PLUGIN.Schema; -local VERSION = PLUGIN.Version; ---[[ -########################################################## -BUILD -########################################################## -]]-- -SV.configs[Schema] = { - ["enable"] = true, - ["size"] = 75, - ["fontSize"] = 12, - ["groups"] = true, - ["proximity"] = false, -} - -function SVUI_TrackingDoodad_OnLoad() - local frame = _G["SVUI_TrackingDoodad"] - --frame.Border:SetGradient(unpack(SV.Media.gradient.dark)) - frame.Arrow:SetVertexColor(0.1, 0.8, 0.8) - frame.Range:SetFont(SV.Media.font.roboto, 14, "OUTLINE") - frame.Range:SetTextColor(1, 1, 1, 0.75) - SV.Animate:Orbit(frame.Radar, 8, true) - frame:RegisterForDrag("LeftButton"); - frame:Hide() -end - -do - local WORLDMAPAREA_DEFAULT_DUNGEON_FLOOR_IS_TERRAIN = 0x00000004 - local WORLDMAPAREA_VIRTUAL_CONTINENT = 0x00000008 - local DUNGEONMAP_MICRO_DUNGEON = 0x00000001 - local _failsafe, _cache, _dungeons, _transform = {}, {}, {}, {}; - - local _mapdata = { - [0] = { - height = 22266.74312, - system = -1, - width = 33400.121, - xOffset = 0, - yOffset = 0, - [1] = { - xOffset = -10311.71318, - yOffset = -19819.33898, - scale = 0.56089997291565, - }, - [0] = { - xOffset = -48226.86993, - yOffset = -16433.90283, - scale = 0.56300002336502, - }, - [571] = { - xOffset = -29750.89905, - yOffset = -11454.50802, - scale = 0.5949000120163, - }, - [870] = { - xOffset = -27693.71178, - yOffset = -29720.0585, - scale = 0.65140002965927, - }, - }, - } - - local _failsafeFunc = function(tbl, key) - if(type(key) == "number") then - return _failsafe; - else - return rawget(_failsafe, key); - end - end - - setmetatable(_failsafe, { xOffset = 0, height = 1, yOffset = 0, width = 1, __index = _failsafeFunc }); - setmetatable(_mapdata, _failsafe); - - for _, ID in ipairs(GetWorldMapTransforms()) do - local terrain, newterrain, _, _, transformMinY, transformMaxY, transformMinX, transformMaxX, offsetY, offsetX = GetWorldMapTransformInfo(ID) - if ( offsetX ~= 0 or offsetY ~= 0 ) then - _transform[ID] = { - terrain = terrain, - newterrain = newterrain, - BRy = -transformMinY, - TLy = -transformMaxY, - BRx = -transformMinX, - TLx = -transformMaxX, - offsetY = offsetY, - offsetX = offsetX, - } - end - end - - local function _getmapdata(t) - local chunk = {} - local mapName = GetMapInfo(); - local id = GetCurrentMapAreaID(); - local numFloors = GetNumDungeonMapLevels(); - chunk.mapName = mapName; - chunk.cont = (GetCurrentMapContinent()) or -100; - chunk.zone = (GetCurrentMapZone()) or -100; - chunk.numFloors = numFloors; - local _, TLx, TLy, BRx, BRy = GetCurrentMapZone(); - if(TLx and TLy and BRx and BRy and (TLx~=0 or TLy~=0 or BRx~=0 or BRy~=0)) then - chunk[0] = {}; - chunk[0].TLx = TLx; - chunk[0].TLy = TLy; - chunk[0].BRx = BRx; - chunk[0].BRy = BRy; - end - if(not chunk[0] and numFloors == 0 and (GetCurrentMapDungeonLevel()) == 1) then - numFloors = 1; - chunk.hiddenFloor = true; - end - if(numFloors > 0) then - for f = 1, numFloors do - SetDungeonMapLevel(f); - local _, TLx, TLy, BRx, BRy = GetCurrentMapDungeonLevel(); - if(TLx and TLy and BRx and BRy) then - chunk[f] = {}; - chunk[f].TLx = TLx; - chunk[f].TLy = TLy; - chunk[f].BRx = BRx; - chunk[f].BRy = BRy; - end - end - end - - t[id] = chunk; - end - - do - local continents = { GetMapContinents() }; - for C in pairs(continents) do - local zones = { GetMapZones(C) }; - continents[C] = zones; - local pass, error = pcall(SetMapZoom, C, 0) - if(pass) then - zones[0] = GetCurrentMapAreaID(); - _getmapdata(_cache); - for Z in ipairs(zones) do - SetMapZoom(C, Z); - zones[Z] = GetCurrentMapAreaID(); - _getmapdata(_cache); - end - end - end - - for _, id in ipairs(GetAreaMaps()) do - if not (_cache[id]) then - if(SetMapByID(id)) then - _getmapdata(_cache); - end - end - end - end - - for id, map in pairs(_cache) do - local terrain, _, _, _, _, _, _, _, _, flags = GetAreaMapInfo(id) - local origin = terrain; - local chunk = _mapdata[id]; - if not (chunk) then chunk = {}; end - if(map.numFloors > 0 or map.hiddenFloor) then - for f, coords in pairs(map) do - if(type(f) == "number" and f > 0) then - if not (chunk[f]) then - chunk[f] = {}; - end - local flr = chunk[f] - local TLx, TLy, BRx, BRy = -coords.BRx, -coords.BRy, -coords.TLx, -coords.TLy - if not (flr.width) then - flr.width = BRx - TLx - end - if not (flr.height) then - flr.height = BRy - TLy - end - if not (flr.xOffset) then - flr.xOffset = TLx - end - if not (flr.yOffset) then - flr.yOffset = TLy - end - end - end - for f = 1, map.numFloors do - if not (chunk[f]) then - if(f == 1 and map[0] and map[0].TLx and map[0].TLy and map[0].BRx and map[0].BRy and - band(flags, WORLDMAPAREA_DEFAULT_DUNGEON_FLOOR_IS_TERRAIN) == WORLDMAPAREA_DEFAULT_DUNGEON_FLOOR_IS_TERRAIN) then - chunk[f] = {}; - local flr = chunk[f] - local coords = map[0] - local TLx, TLy, BRx, BRy = -coords.TLx, -coords.TLy, -coords.BRx, -coords.BRy - flr.width = BRx - TLx - flr.height = BRy - TLy - flr.xOffset = TLx - flr.yOffset = TLy - end - end - end - if(map.hiddenFloor) then - chunk.width = chunk[1].width - chunk.height = chunk[1].height - chunk.xOffset = chunk[1].xOffset - chunk.yOffset = chunk[1].yOffset - end - else - local coords = map[0] - if(coords ~= nil) then - local TLx, TLy, BRx, BRy = -coords.TLx, -coords.TLy, -coords.BRx, -coords.BRy - for _, trans in pairs(_transform) do - if(trans.terrain == terrain) then - if((trans.TLx < TLx and BRx < trans.BRx) and (trans.TLy < TLy and BRy < trans.BRy)) then - TLx = TLx - trans.offsetX; - BRx = BRx - trans.offsetX; - BRy = BRy - trans.offsetY; - TLy = TLy - trans.offsetY; - terrain = trans.newterrain; - break; - end - end - end - if not (TLx==0 and TLy==0 and BRx==0 and BRy==0) then - if not (TLx < BRx) then - printError("Bad x-axis Orientation (Zone): ", id, TLx, BRx); - end - if not (TLy < BRy) then - printError("Bad y-axis Orientation (Zone): ", id, TLy, BRy); - end - end - if not (chunk.width) then - chunk.width = BRx - TLx - end - if not (chunk.height) then - chunk.height = BRy - TLy - end - if not (chunk.xOffset) then - chunk.xOffset = TLx - end - if not (chunk.yOffset) then - chunk.yOffset = TLy - end - end - end - if not (next(chunk, nil)) then - chunk = { xOffset = 0, height = 1, yOffset = 0, width = 1 }; - end - if not (chunk.origin) then - chunk.origin = origin; - end - _mapdata[id] = chunk; - if(chunk and chunk ~= _failsafe) then - if not (chunk.system) then - chunk.system = terrain; - end - if(map.cont > 0 and map.zone > 0) then - _dungeons[terrain] = {} - end - setmetatable(chunk, _failsafe); - end - end - - local function _getpos(map, mapFloor, x, y) - if not map then return end - if (mapFloor ~= 0) then - map = rawget(map, mapFloor) or _dungeons[map.origin][mapFloor]; - end - x = x * map.width + map.xOffset; - y = y * map.height + map.yOffset; - return x, y; - end - - function GetDistance(map1, floor1, x1, y1, map2, floor2, x2, y2) - if not (map1 and map2) then return end - floor1 = floor1 or min(#_mapdata[map1], 1); - floor2 = floor2 or min(#_mapdata[map2], 1); - local dist, xDelta, yDelta, angle; - if(map1 == map2 and floor1 == floor2) then - local chunk = _mapdata[map1]; - local tmp = chunk - if(floor1 ~= 0) then - tmp = rawget(chunk, floor1) - end - local w,h = 1,1 - if(not tmp) then - if(_dungeons[chunk.origin] and _dungeons[chunk.origin][floor1]) then - chunk = _dungeons[chunk.origin][floor1] - w = chunk.width - h = chunk.height - else - w = 1 - h = 1 - end - else - w = chunk.width - h = chunk.height - end - xDelta = (x2 - x1) * (w or 1); - yDelta = (y2 - y1) * (h or 1); - else - local map1 = _mapdata[map1]; - local map2 = _mapdata[map2]; - if(map1.system == map2.system) then - x1, y1 = _getpos(map1, floor1, x1, y1); - x2, y2 = _getpos(map2, floor2, x2, y2); - xDelta = (x2 - x1); - yDelta = (y2 - y1); - else - local s1 = map1.system; - local s2 = map2.system; - if((map1==0 or _mapdata[0][s1]) and (map2 == 0 or _mapdata[0][s2])) then - x1, y1 = _getpos(map1, floor1, x1, y1); - x2, y2 = _getpos(map2, floor2, x2, y2); - if(map1 ~= 0) then - local cont1 = _mapdata[0][s1]; - x1 = (x1 - cont1.xOffset) * cont1.scale; - y1 = (y1 - cont1.yOffset) * cont1.scale; - end - if(map2 ~= 0) then - local cont2 = _mapdata[0][s2]; - x2 = (x2 - cont2.xOffset) * cont2.scale; - y2 = (y2 - cont2.yOffset) * cont2.scale; - end - xDelta = x2 - x1; - yDelta = y2 - y1; - end - end - end - - if(xDelta and yDelta) then - local playerAngle = GetPlayerFacing() - dist = sqrt(xDelta * xDelta + yDelta * yDelta); - angle = (radian90 - playerAngle) - atan2(yDelta, xDelta) - end - - return dist, angle; - end -end - -do - local function _findunit(unit, doNotCheckMap) - local x, y = GetPlayerMapPosition(unit); - if(x <= 0 and y <= 0) then - if(doNotCheckMap) then return; end - local lastMapID, lastFloor = GetCurrentMapAreaID(), GetCurrentMapDungeonLevel(); - SetMapToCurrentZone(); - x, y = GetPlayerMapPosition(unit); - if(x <= 0 and y <= 0) then - if(ZoomOut()) then - elseif(GetCurrentMapZone() ~= WORLDMAP_WORLD_ID) then - SetMapZoom(GetCurrentMapContinent()); - else - SetMapZoom(WORLDMAP_WORLD_ID); - end - x, y = GetPlayerMapPosition(unit); - if(x <= 0 and y <= 0) then - return; - end - end - local thisMapID, thisFloor = GetCurrentMapAreaID(), GetCurrentMapDungeonLevel(); - if(thisMapID ~= lastMapID or thisFloor ~= lastFloor) then - SetMapByID(lastMapID); - SetDungeonMapLevel(lastFloor); - end - return thisMapID, thisFloor, x, y; - end - return GetCurrentMapAreaID(), GetCurrentMapDungeonLevel(), x, y; - end - - local function _findplayer() - local x, y = GetPlayerMapPosition("player"); - if(x <= 0 and y <= 0) then - if(WorldMap and WorldMap:IsShown()) then return end - SetMapToCurrentZone(); - x, y = GetPlayerMapPosition("player"); - if(x <= 0 and y <= 0) then - if(ZoomOut()) then - elseif(GetCurrentMapZone() ~= WORLDMAP_WORLD_ID) then - SetMapZoom(GetCurrentMapContinent()); - else - SetMapZoom(WORLDMAP_WORLD_ID); - end - x, y = GetPlayerMapPosition("player"); - if(x <= 0 and y <= 0) then - return; - end - end - end - return GetCurrentMapAreaID(), GetCurrentMapDungeonLevel(), x, y; - end - - function GetTarget(unit, doNotCheckMap) - local plot1, plot2, plot3, plot4; - if unit == "player" or UnitIsUnit("player", unit) then - plot1, plot2, plot3, plot4 = _findplayer() - else - plot1, plot2, plot3, plot4 = _findunit(unit, doNotCheckMap or WorldMapFrame:IsVisible()) - end - if not (plot1 and plot4) then - return false - else - return true, plot1, plot2, plot3, plot4 - end - end - - function GetFromPlayer(unit, noMapLocation) - if(WorldMap and WorldMap:IsShown()) then return end - local plot3, plot4 = GetPlayerMapPosition("player"); - if(plot3 <= 0 and plot4 <= 0) then - SetMapToCurrentZone(); - plot3, plot4 = GetPlayerMapPosition("player"); - if(plot3 <= 0 and plot4 <= 0) then - if(ZoomOut()) then - elseif(GetCurrentMapZone() ~= WORLDMAP_WORLD_ID) then - SetMapZoom(GetCurrentMapContinent()); - else - SetMapZoom(WORLDMAP_WORLD_ID); - end - plot3, plot4 = GetPlayerMapPosition("player"); - if(plot3 <= 0 and plot4 <= 0) then - return; - end - end - end - - local plot1 = GetCurrentMapAreaID() - local plot2 = GetCurrentMapDungeonLevel() - - local plot5, plot6; - local plot7, plot8 = GetPlayerMapPosition(unit); - - if(noMapLocation and (plot7 <= 0 and plot8 <= 0)) then - local lastMapID, lastFloor = GetCurrentMapAreaID(), GetCurrentMapDungeonLevel(); - SetMapToCurrentZone(); - plot7, plot8 = GetPlayerMapPosition(unit); - if(plot7 <= 0 and plot8 <= 0) then - if(ZoomOut()) then - elseif(GetCurrentMapZone() ~= WORLDMAP_WORLD_ID) then - SetMapZoom(GetCurrentMapContinent()); - else - SetMapZoom(WORLDMAP_WORLD_ID); - end - plot7, plot8 = GetPlayerMapPosition(unit); - if(plot7 <= 0 and plot8 <= 0) then - return; - end - end - plot5, plot6 = GetCurrentMapAreaID(), GetCurrentMapDungeonLevel(); - if(plot5 ~= lastMapID or plot6 ~= lastFloor) then - SetMapByID(lastMapID); - SetDungeonMapLevel(lastFloor); - end - local distance, angle = GetDistance(plot1, plot2, plot3, plot4, plot5, plot6, plot7, plot8) - return distance, angle - end - - local distance, angle = GetDistance(plot1, plot2, plot3, plot4, plot1, plot2, plot7, plot8) - return distance, angle - end -end - -function Triangulate(unit, noMapLocation) - local distance, angle = GetFromPlayer(unit, noMapLocation) - return distance, angle -end ---[[ -########################################################## -MAIN MOVABLE TRACKER -########################################################## -]]-- -function PLUGIN:PLAYER_TARGET_CHANGED() - if not SVUI_TrackingDoodad then return end - if((UnitInParty("target") or UnitInRaid("target")) and not UnitIsUnit("target", "player")) then - SVUI_TrackingDoodad.Trackable = true - SVUI_TrackingDoodad:Show() - else - SVUI_TrackingDoodad.Trackable = false - end -end - -local Rotate_Arrow = function(self, angle) - local radius, ULx, ULy, LLx, LLy, URx, URy, LRx, LRy - - radius = angle - 0.785398163 - URx = 0.5 + cos(radius) / sqrt2 - URy = 0.5 + sin(radius) / sqrt2 - -- (-1) - radius = angle + 0.785398163 - LRx = 0.5 + cos(radius) / sqrt2 - LRy = 0.5 + sin(radius) / sqrt2 - -- 1 - radius = angle + 2.35619449 - LLx = 0.5 + cos(radius) / sqrt2 - LLy = 0.5 + sin(radius) / sqrt2 - -- 3 - radius = angle + 3.92699082 - ULx = 0.5 + cos(radius) / sqrt2 - ULy = 0.5 + sin(radius) / sqrt2 - -- 5 - - self.Arrow:SetTexCoord(ULx, ULy, LLx, LLy, URx, URy, LRx, LRy); -end - -local TargetFrame_OnChange = function() - if not SVUI_TrackingDoodad then return end - if((UnitInParty("target") or UnitInRaid("target")) and not UnitIsUnit("target", "player")) then - SVUI_TrackingDoodad.Trackable = true - SVUI_TrackingDoodad:Show() - else - SVUI_TrackingDoodad.Trackable = false - end -end - -local Tracker_OnUpdate = function(self, elapsed) - if self.elapsed and self.elapsed > (self.throttle or 0.02) then - if(self.Trackable) then - local distance, angle = Triangulate("target", true) - local _ARROW = self.Arrow - local _SPINNER = self.Radar - local _TEXT = self.Range - local _BG = self.BG - if not angle then - self.throttle = 4 - _ARROW:SetAlpha(0) - _SPINNER:SetVertexColor(0.8,0.1,0.1,0.15) - _BG:SetVertexColor(1,0,0,0.15) - else - self.throttle = 0.02 - local out = floor(tonumber(distance)) - self:Spin(angle) - if(out > 100) then - _ARROW:SetVertexColor(1,0.1,0.1,0.4) - _SPINNER:SetVertexColor(0.8,0.1,0.1,0.25) - _BG:SetVertexColor(0.8,0.4,0.1,0.25) - elseif(out > 40) then - _ARROW:SetVertexColor(1,0.8,0.1,0.6) - _SPINNER:SetVertexColor(0.8,0.8,0.1,0.5) - _BG:SetVertexColor(0.4,0.8,0.1,0.5) - elseif(out > 5) then - _ARROW:SetVertexColor(0.1,1,0.8,0.9) - _SPINNER:SetVertexColor(0.1,0.8,0.8,0.75) - _BG:SetVertexColor(0.1,0.8,0.1,0.75) - end - _ARROW:SetAlpha(1) - _TEXT:SetText(out) - end - else - self:Hide() - end - self.elapsed = 0 - else - self.elapsed = (self.elapsed or 0) + elapsed - end -end ---[[ -########################################################## -GROUP UNIT TRACKERS -########################################################## -]]-- -local GPS_Triangulate = function(self, unit) - local available = (self.OnlyProximity == false and self.onMouseOver == false) - local distance, angle = Triangulate(unit, available) - return distance, angle -end - -local RefreshGPS = function(self, frame, template) - if(frame.GPS) then - local config = PLUGIN.db - if(config.groups) then - frame.GPS.OnlyProximity = config.proximity - local actualSz = min(frame.GPS.DefaultSize, (frame:GetHeight() - 2)) - if(not frame:IsElementEnabled("GPS")) then - frame:EnableElement("GPS") - end - else - if(frame:IsElementEnabled("GPS")) then - frame:DisableElement("GPS") - end - end - end -end - -function PLUGIN:CreateGPS(frame) - if not frame then return end - local size = 32 - - local gps = CreateFrame("Frame", nil, frame.InfoPanel) - gps:SetFrameLevel(99) - gps:Size(size, size) - gps.DefaultSize = size - gps:Point("RIGHT", frame, "RIGHT", 0, 0) - - gps.Arrow = gps:CreateTexture(nil, "OVERLAY", nil, 7) - gps.Arrow:SetTexture([[Interface\AddOns\SVUI_TrackingDevice\artwork\GPS-ARROW]]) - gps.Arrow:Size(size, size) - gps.Arrow:SetPoint("CENTER", gps, "CENTER", 0, 0) - gps.Arrow:SetVertexColor(0.1, 0.8, 0.8) - gps.Arrow:SetBlendMode("ADD") - - gps.onMouseOver = true - gps.OnlyProximity = false - - gps.Spin = Rotate_Arrow - - frame.GPS = gps - - --frame.GPS:Hide() -end ---[[ -########################################################## -CORE -########################################################## -]]-- -function PLUGIN:ReLoad() - if(not self.db.enable) then return end - - local frameSize = self.db.size or 70 - local arrowSize = frameSize * 0.5 - local fontSize = self.db.fontSize or 14 - local frame = _G["SVUI_TrackingDoodad"] - - frame:SetSize(frameSize, frameSize) - frame.Arrow:SetSize(arrowSize, arrowSize) - frame.Range:SetFont(SV.Media.font.roboto, fontSize, "OUTLINE") -end - -function PLUGIN:Load() - if(not self.db.enable) then return end - - local _TRACKER = SVUI_TrackingDoodad - local _TARGET = SVUI_Target - - if(_TRACKER) then - - _TRACKER.Spin = Rotate_Arrow - _TRACKER:SetParent(SVUI_Target) - _TRACKER:SetScript("OnUpdate", Tracker_OnUpdate) - - self:RegisterEvent("PLAYER_TARGET_CHANGED") - end - - if(_TARGET) then - local frame = _G["SVUI_TrackingDoodad"] - frame:SetPoint("LEFT", _TARGET, "RIGHT", 2, 0) - _TARGET:HookScript("OnShow", TargetFrame_OnChange) - end - - NewHook(SV.SVUnit, "RefreshUnitLayout", RefreshGPS) - - local options = { - order = 3, - name = L["GPS"], - desc = L["Use group frame GPS elements"], - type = "toggle", - get = function() return SV.db.SVTracker.groups end, - set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); PLUGIN:UpdateLogWindow() end - } - - self:AddOption("groups", options) - - options = { - order = 4, - name = L["GPS Proximity"], - desc = L["Only point to closest low health unit"], - type = "toggle", - get = function() return SV.db.SVTracker.proximity end, - set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); PLUGIN:UpdateLogWindow() end - } - - self:AddOption("proximity", options) - - options = { - order = 5, - name = L["Font Size"], - desc = L["Set the font size of the range text"], - type = "range", - min = 6, - max = 22, - step = 1, - get = function() return SV.db.SVTracker.fontSize end, - set = function(key,value) PLUGIN:ChangeDBVar(value, key[#key]); PLUGIN:UpdateLogWindow() end - } - - self:AddOption("fontSize", options) -end - -SVLib:NewPlugin(PLUGIN) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.toc b/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.toc deleted file mode 100644 index 81f67ba..0000000 --- a/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.toc +++ /dev/null @@ -1,12 +0,0 @@ -## Interface: 50400 -## Author: Munglunch -## Version: 4.6 -## Title: |cffFF9900SVUI |r|cffFFEF00Tracking Device|r -## Notes: Supervillain UI [|cff9911FFRaid & Party Member Tracking|r]. -## RequiredDeps: SVUI -## LoadOnDemand: 1 -## X-oUF: oUF_Villain -## X-SVUI-Header: Tracking Device -## X-SVUI-Schema: SVTracker - -SVUI_TrackingDevice.xml diff --git a/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.xml b/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.xml deleted file mode 100644 index f53512c..0000000 --- a/Interface/AddOns/SVUI_TrackingDevice/SVUI_TrackingDevice.xml +++ /dev/null @@ -1,46 +0,0 @@ -<Ui xmlns="http://www.blizzard.com/wow/ui/"> - <Script file='SVUI_TrackingDevice.lua'/> - <Script file='libs\oUF_GPS\oUF_GPS.lua'/> - - <Frame name="SVUI_TrackingDoodad" movable="true" frameStrata="DIALOG"> - <Size x="70" y="70"/> - <Anchors> - <Anchor point="CENTER" relativeTo="UIParent" relativePoint="CENTER"/> - </Anchors> - <Layers> - <Layer level="BACKGROUND"> - <Texture parentKey="BG" setAllPoints="true" file="Interface\AddOns\SVUI_TrackingDevice\artwork\DOODAD-BG"/> - </Layer> - <Layer level="BORDER"> - <Texture parentKey="Border" setAllPoints="true" file="Interface\AddOns\SVUI_TrackingDevice\artwork\DOODAD-BORDER"/> - <Texture parentKey="Arrow" file="Interface\AddOns\SVUI_TrackingDevice\artwork\DOODAD-ARROW"> - <Size x="35" y="35"/> - <Anchors> - <Anchor point="CENTER" relativeTo="$parent" relativePoint="CENTER"/> - </Anchors> - </Texture> - </Layer> - <Layer level="OVERLAY"> - <Texture parentKey="Radar" setAllPoints="true" file="Interface\AddOns\SVUI_TrackingDevice\artwork\DOODAD-RADAR"/> - </Layer> - <Layer level="ARTWORK"> - <FontString parentKey="Range" inherits="GameFontNormal"> - <Anchors> - <Anchor point="TOP" relativeTo="$parent" relativePoint="BOTTOM"/> - </Anchors> - </FontString> - </Layer> - </Layers> - <Scripts> - <OnLoad function="SVUI_TrackingDoodad_OnLoad"/> - <OnDragStart> - _G["SVUI_TrackingDoodad"].moving = true; - _G["SVUI_TrackingDoodad"]:StartMoving(); - </OnDragStart> - <OnDragStop> - _G["SVUI_TrackingDoodad"].moving = nil; - _G["SVUI_TrackingDoodad"]:StopMovingOrSizing(); - </OnDragStop> - </Scripts> - </Frame> -</Ui> \ No newline at end of file diff --git a/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-ARROW.blp b/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-ARROW.blp deleted file mode 100644 index b20f63d..0000000 Binary files a/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-ARROW.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-BG.blp b/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-BG.blp deleted file mode 100644 index 7f60ca2..0000000 Binary files a/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-BG.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-BORDER.blp b/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-BORDER.blp deleted file mode 100644 index c69bd6a..0000000 Binary files a/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-BORDER.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-RADAR.blp b/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-RADAR.blp deleted file mode 100644 index 53d920b..0000000 Binary files a/Interface/AddOns/SVUI_TrackingDevice/artwork/DOODAD-RADAR.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI_TrackingDevice/artwork/GPS-ARROW.blp b/Interface/AddOns/SVUI_TrackingDevice/artwork/GPS-ARROW.blp deleted file mode 100644 index 9fb0a32..0000000 Binary files a/Interface/AddOns/SVUI_TrackingDevice/artwork/GPS-ARROW.blp and /dev/null differ diff --git a/Interface/AddOns/SVUI_TrackingDevice/libs/oUF_GPS/oUF_GPS.lua b/Interface/AddOns/SVUI_TrackingDevice/libs/oUF_GPS/oUF_GPS.lua deleted file mode 100644 index 9bb1282..0000000 --- a/Interface/AddOns/SVUI_TrackingDevice/libs/oUF_GPS/oUF_GPS.lua +++ /dev/null @@ -1,211 +0,0 @@ -local oUF = oUF_Villain or oUF -assert(oUF, 'oUF not loaded') - -local PLUGIN = _G["TrackingVillain"]; - -local max, floor = math.max, math.floor; -local tinsert, tremove, tsort, twipe = table.insert, table.remove, table.sort, table.wipe; - -local playerGUID = UnitGUID("player") -local _FRAMES, _PROXIMITY, OnUpdateFrame = {}, {} -local minThrottle = 0.02 -local numArrows, inRange, GPS ---[[ -########################################################## -oUF TAGS -########################################################## -]]-- -local taggedUnits = {} -local groupTagManager = CreateFrame("Frame") -groupTagManager:RegisterEvent("GROUP_ROSTER_UPDATE") -groupTagManager:SetScript("OnEvent", function() - local group, count; - twipe(taggedUnits) - if IsInRaid() then - group = "raid" - count = GetNumGroupMembers() - elseif IsInGroup() then - group = "party" - count = GetNumGroupMembers() - 1; - taggedUnits["player"] = true - else - group = "solo" - count = 1 - end - for i = 1, count do - local realName = group..i; - if not UnitIsUnit(realName, "player") then - taggedUnits[realName] = true - end - end -end); - -oUF.Tags.OnUpdateThrottle['nearbyplayers:8'] = 0.25 -oUF.Tags.Methods["nearbyplayers:8"] = function(unit) - local unitsInRange, distance = 0; - if UnitIsConnected(unit)then - for taggedUnit, _ in pairs(taggedUnits)do - if not UnitIsUnit(unit, taggedUnit) and UnitIsConnected(taggedUnit)then - distance = Triangulate(unit, taggedUnit, true) - if distance and distance <= 8 then - unitsInRange = unitsInRange + 1 - end - end - end - end - return unitsInRange -end - -oUF.Tags.OnUpdateThrottle['nearbyplayers:10'] = 0.25 -oUF.Tags.Methods["nearbyplayers:10"] = function(unit) - local unitsInRange, distance = 0; - if UnitIsConnected(unit)then - for taggedUnit, _ in pairs(taggedUnits)do - if not UnitIsUnit(unit, taggedUnit) and UnitIsConnected(taggedUnit)then - distance = Triangulate(unit, taggedUnit, true) - if distance and distance <= 10 then - unitsInRange = unitsInRange + 1 - end - end - end - end - return unitsInRange -end - -oUF.Tags.OnUpdateThrottle['nearbyplayers:30'] = 0.25 -oUF.Tags.Methods["nearbyplayers:30"] = function(unit) - local unitsInRange, distance = 0; - if UnitIsConnected(unit)then - for taggedUnit, _ in pairs(taggedUnits)do - if not UnitIsUnit(unit, taggedUnit) and UnitIsConnected(taggedUnit)then - distance = Triangulate(unit, taggedUnit, true) - if distance and distance <= 30 then - unitsInRange = unitsInRange + 1 - end - end - end - end - return unitsInRange -end - -oUF.Tags.OnUpdateThrottle['distance'] = 0.25 -oUF.Tags.Methods["distance"] = function(unit) - if not UnitIsConnected(unit) or UnitIsUnit(unit, "player")then return "" end - local dst = Triangulate("player", unit, true) - if dst and dst > 0 then - return format("%d", dst) - end - return "" -end ---[[ -########################################################## -GPS ELEMENT -########################################################## -]]-- -local sortFunc = function(a,b) return a[1] < b[1] end - -local Update = function(self, elapsed) - if self.elapsed and self.elapsed > (self.throttle or minThrottle) then - numArrows = 0 - twipe(_PROXIMITY) - for _, object in next, _FRAMES do - if(object:IsShown()) then - GPS = object.GPS - local unit = object.unit - if(unit) then - if(GPS.PreUpdate) then GPS:PreUpdate(frame) end - - local outOfRange = GPS.outOfRange and UnitInRange(unit) or false - - if(not unit or not (UnitInParty(unit) or UnitInRaid(unit)) or UnitIsUnit(unit, "player") or not UnitIsConnected(unit) or (not GPS.OnlyProximity and ((GPS.onMouseOver and (GetMouseFocus() ~= object)) or outOfRange))) then - GPS:Hide() - else - local distance, angle = Triangulate(unit) - if not angle then - GPS:Hide() - else - if(GPS.OnlyProximity == false) then - GPS:Show() - else - GPS:Hide() - end - - if GPS.Arrow then - if(distance > 40) then - GPS.Arrow:SetVertexColor(1,0.1,0.1) - else - if(distance > 30) then - GPS.Arrow:SetVertexColor(0.4,0.8,0.1) - else - GPS.Arrow:SetVertexColor(0.1,1,0.1) - end - if(GPS.OnlyProximity and object.Health.percent and object.Health.percent < 80) then - local value = object.Health.percent + distance - _PROXIMITY[#_PROXIMITY + 1] = {value, GPS} - end - end - GPS:Spin(angle) - end - - if GPS.Text then - GPS.Text:SetText(floor(distance)) - end - - if(GPS.PostUpdate) then GPS:PostUpdate(frame, distance, angle) end - numArrows = numArrows + 1 - end - end - else - GPS:Hide() - end - end - end - - if(_PROXIMITY[1]) then - tsort(_PROXIMITY, sortFunc) - if(_PROXIMITY[1][2]) then - _PROXIMITY[1][2]:Show() - end - end - - self.elapsed = 0 - self.throttle = max(minThrottle, 0.005 * numArrows) - else - self.elapsed = (self.elapsed or 0) + elapsed - end -end - -local Enable = function(self) - local unit = self.unit - if(unit:find("raid") or unit:find("party")) then - if not self.GPS then PLUGIN:CreateGPS(self) end - tinsert(_FRAMES, self) - - if not OnUpdateFrame then - OnUpdateFrame = CreateFrame("Frame") - OnUpdateFrame:SetScript("OnUpdate", Update) - end - - OnUpdateFrame:Show() - return true - end -end - -local Disable = function(self) - local GPS = self.GPS - if GPS then - for k, frame in next, _FRAMES do - if(frame == self) then - tremove(_FRAMES, k) - GPS:Hide() - break - end - end - - if #_FRAMES == 0 and OnUpdateFrame then - OnUpdateFrame:Hide() - end - end -end - -oUF:AddElement('GPS', nil, Enable, Disable) \ No newline at end of file diff --git a/Interface/AddOns/SVUI_TrackingDevice/libs/oUF_GPS/oUF_GPS.toc b/Interface/AddOns/SVUI_TrackingDevice/libs/oUF_GPS/oUF_GPS.toc deleted file mode 100644 index cdca787..0000000 --- a/Interface/AddOns/SVUI_TrackingDevice/libs/oUF_GPS/oUF_GPS.toc +++ /dev/null @@ -1,9 +0,0 @@ -## Interface: 50001 -## Title: oUF GPS -## Notes: Adds GPS arrow to frames. -## Author: Omega1970, Munglunch -## Version: 1.00 -## X-Category: oUF -## Dependencies: oUF - -oUF_GPS.lua \ No newline at end of file