diff --git a/.luacheckrc b/.luacheckrc index 89e7851..1e491cc 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -95,7 +95,9 @@ read_globals = { "GarrisonShipyardFollowerTooltip", "GetAchievementInfo", "GetArchaeologyRaceInfoByID", + "GetCategoryNumAchievements", "GetCVarBool", + "GetGuildCategoryList", "GetInstanceInfo", "GetLFGCompletionReward", "GetLFGCompletionRewardItem", @@ -132,6 +134,7 @@ read_globals = { "INVSLOT_TRINKET2", "INVSLOT_WAIST", "INVSLOT_WRIST", + "IsInGuild", "IsLoggedIn", "IsModifiedClick", "IsShiftKeyDown", diff --git a/CHANGELOG.md b/CHANGELOG.md index 52109ba..3d2bd3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # CHANGELOG +## Version 110002.01 + +- Added a workaround for buggy guild achievement spam. If your character is in a guild, the addon will add already + completed guild achievements to the blacklist on log in, you still will be able to see guild achievements if they're + earned for the first time. If you join a guild at some point, reload the UI, the achievement API is super laggy, so I + avoid rebuilding the blacklist during the actual game session. +- Added an option to disable tooltips on mouseover. + ## Version 110000.02 - Fixed "[DNT] Worldsoul Memory Score" toasts. diff --git a/ls_Toasts/core/changelog.lua b/ls_Toasts/core/changelog.lua index 0fc47e8..a8607a0 100644 --- a/ls_Toasts/core/changelog.lua +++ b/ls_Toasts/core/changelog.lua @@ -6,5 +6,9 @@ local _G = getfenv(0) -- Mine E.CHANGELOG = [[ -- Fixed "[DNT] Worldsoul Memory Score" toasts. +- Added a workaround for buggy guild achievement spam. If your character is in a guild, the addon will add already + completed guild achievements to the blacklist on log in, you still will be able to see guild achievements if they're + earned for the first time. If you join a guild at some point, reload the UI, the achievement API is super laggy, so I + avoid rebuilding the blacklist during the actual game session. +- Added an option to disable tooltips on mouseover. ]] diff --git a/ls_Toasts/core/config.lua b/ls_Toasts/core/config.lua index 45df7d1..780ab5d 100644 --- a/ls_Toasts/core/config.lua +++ b/ls_Toasts/core/config.lua @@ -185,7 +185,7 @@ function P:CreateConfig() [5] = ITEM_QUALITY_COLORS[5].hex .. ITEM_QUALITY5_DESC .. "|r", }, }, - } + }, }, font = { order = 21, @@ -206,7 +206,7 @@ function P:CreateConfig() C.db.profile.font.name = value P:UpdateFont() - end + end, }, size = { order = 2, diff --git a/ls_Toasts/embeds/AceDB-3.0/AceDB-3.0.lua b/ls_Toasts/embeds/AceDB-3.0/AceDB-3.0.lua index e9c98c1..a0a8936 100644 --- a/ls_Toasts/embeds/AceDB-3.0/AceDB-3.0.lua +++ b/ls_Toasts/embeds/AceDB-3.0/AceDB-3.0.lua @@ -41,7 +41,7 @@ -- @class file -- @name AceDB-3.0.lua -- @release $Id$ -local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 29 +local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 30 local AceDB = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR) if not AceDB then return end -- No upgrade needed @@ -525,6 +525,17 @@ function DBObjectLib:DeleteProfile(name, silent) end end + -- remove from unloaded namespaces + if self.sv.namespaces then + for nsname, data in pairs(self.sv.namespaces) do + if self.children and self.children[nsname] then + -- already a mapped namespace + elseif data.profiles then + data.profiles[name] = nil + end + end + end + -- switch all characters that use this profile back to the default if self.sv.profileKeys then for key, profile in pairs(self.sv.profileKeys) do @@ -570,6 +581,20 @@ function DBObjectLib:CopyProfile(name, silent) end end + -- copy unloaded namespaces + if self.sv.namespaces then + for nsname, data in pairs(self.sv.namespaces) do + if self.children and self.children[nsname] then + -- already a mapped namespace + elseif data.profiles then + -- reset the current profile + data.profiles[self.keys.profile] = {} + -- copy data + copyTable(data.profiles[name], data.profiles[self.keys.profile]) + end + end + end + -- Callback: OnProfileCopied, database, sourceProfileKey self.callbacks:Fire("OnProfileCopied", self, name) end @@ -596,6 +621,18 @@ function DBObjectLib:ResetProfile(noChildren, noCallbacks) end end + -- reset unloaded namespaces + if self.sv.namespaces and not noChildren then + for nsname, data in pairs(self.sv.namespaces) do + if self.children and self.children[nsname] then + -- already a mapped namespace + elseif data.profiles then + -- reset the current profile + data.profiles[self.keys.profile] = nil + end + end + end + -- Callback: OnProfileReset, database if not noCallbacks then self.callbacks:Fire("OnProfileReset", self) diff --git a/ls_Toasts/init.lua b/ls_Toasts/init.lua index 350f4eb..0025011 100644 --- a/ls_Toasts/init.lua +++ b/ls_Toasts/init.lua @@ -117,8 +117,6 @@ E:RegisterEvent("ADDON_LOADED", function(arg1) AddonCompartmentFrame:RegisterAddon({ text = L["LS_TOASTS"], icon = "Interface\\AddOns\\ls_Toasts\\assets\\logo-32", - notCheckable = true, - registerForAnyClick = true, func = function() if not InCombatLockdown() then LibStub("AceConfigDialog-3.0"):Open(addonName) diff --git a/ls_Toasts/locales/enUS.lua b/ls_Toasts/locales/enUS.lua index 800438f..7fbda2e 100644 --- a/ls_Toasts/locales/enUS.lua +++ b/ls_Toasts/locales/enUS.lua @@ -117,6 +117,7 @@ L["SHOW_QUEST_ITEMS"] = "Show Quest Items" L["SHOW_QUEST_ITEMS_DESC"] = "Show quest items regardless of their quality." L["TAINT_WARNING"] = "Enabling this option may cause errors when opening or closing certain UI panels while in combat." L["THRESHOLD"] = "Threshold" +L["TOOLTIPS"] = "Tooltips" L["TRANSMOG_ADDED"] = "Appearance Added" L["TRANSMOG_REMOVED"] = "Appearance Removed" L["TYPE_ACHIEVEMENT"] = "Achievement" diff --git a/ls_Toasts/locales/ruRU.lua b/ls_Toasts/locales/ruRU.lua index c0701b0..8e1055d 100644 --- a/ls_Toasts/locales/ruRU.lua +++ b/ls_Toasts/locales/ruRU.lua @@ -64,6 +64,7 @@ L["SHOW_QUEST_ITEMS"] = "Показывать кв. пр." L["SHOW_QUEST_ITEMS_DESC"] = "Показывать квестовые предметы независимо от их качества." L["TAINT_WARNING"] = "Включение данной настройки может вызвать ошибки при открытии или закрытии определенных панелей интерфейса в бою." L["THRESHOLD"] = "Порог" +L["TOOLTIPS"] = "Подсказки" L["TRANSMOG_ADDED"] = "Модель добавлена" L["TRANSMOG_REMOVED"] = "Модель удалена" L["TYPE_ACHIEVEMENT"] = "Достижение" diff --git a/ls_Toasts/ls_Toasts.toc b/ls_Toasts/ls_Toasts.toc index bf8503c..3f72577 100644 --- a/ls_Toasts/ls_Toasts.toc +++ b/ls_Toasts/ls_Toasts.toc @@ -1,6 +1,6 @@ -## Interface: 110000, 110002 +## Interface: 110002, 110005 ## Author: lightspark -## Version: 110000.02 +## Version: 110002.01 ## Title: LS: |cff00cc99Toasts|r ## Notes: Better toasts, cheers! ## IconTexture: Interface\AddOns\ls_Toasts\assets\logo-64 diff --git a/ls_Toasts/systems/achievement.lua b/ls_Toasts/systems/achievement.lua index 4f02ac6..749e5c9 100644 --- a/ls_Toasts/systems/achievement.lua +++ b/ls_Toasts/systems/achievement.lua @@ -3,8 +3,26 @@ local E, L, C = addonTable.E, addonTable.L, addonTable.C -- Lua local _G = getfenv(0) +local next = _G.next -- Mine +local guildAchievements = {} + +local function updateGuildAchievementList() + if not IsInGuild() then + return + end + + for _, categoryID in next, GetGuildCategoryList() do + for i = 1, (GetCategoryNumAchievements(categoryID)) do + local id, _, _, completed = GetAchievementInfo(categoryID, i) + if id then + guildAchievements[id] = completed + end + end + end +end + local function Toast_OnClick(self) if self._data.ach_id and not InCombatLockdown() then if not AchievementFrame then @@ -37,13 +55,22 @@ local function Toast_OnEnter(self) end end -local function Toast_SetUp(event, achievementID, flag, isCriteria) - local toast = E:GetToast() +local function Toast_SetUp(event, achievementID, eventArg, isCriteria) -- eventArg is alreadyEarned or criteriaString local _, name, points, _, _, _, _, _, _, icon, _, isGuildAchievement = GetAchievementInfo(achievementID) + if isGuildAchievement then + eventArg = guildAchievements[achievementID] + guildAchievements[achievementID] = true + + if eventArg then + return + end + end + + local toast = E:GetToast() if isCriteria then toast.Title:SetText(L["ACHIEVEMENT_PROGRESSED"]) - toast.Text:SetText(flag) + toast.Text:SetText(eventArg) toast.IconText1:SetText("") else @@ -54,7 +81,7 @@ local function Toast_SetUp(event, achievementID, flag, isCriteria) toast:ShowLeaves() end - if flag then + if eventArg then toast.IconText1:SetText("") else if C.db.profile.colors.border then @@ -76,8 +103,11 @@ local function Toast_SetUp(event, achievementID, flag, isCriteria) toast._data.event = event toast._data.ach_id = achievementID + if C.db.profile.types.achievement.tooltip then + toast:HookScript("OnEnter", Toast_OnEnter) + end + toast:HookScript("OnClick", Toast_OnClick) - toast:HookScript("OnEnter", Toast_OnEnter) toast:Spawn(C.db.profile.types.achievement.anchor, C.db.profile.types.achievement.dnd) end @@ -89,33 +119,52 @@ local function CRITERIA_EARNED(achievementID, criteriaString) Toast_SetUp("CRITERIA_EARNED", achievementID, criteriaString, true) end +local function PLAYER_ENTERING_WORLD(isInitialLogin) + -- the achievement data might not be available before the initial login, but it's fully available after /reload + if isInitialLogin then + updateGuildAchievementList() + end + + E:UnregisterEvent("PLAYER_ENTERING_WORLD", PLAYER_ENTERING_WORLD) +end + local function Enable() if C.db.profile.types.achievement.enabled then + updateGuildAchievementList() + E:RegisterEvent("ACHIEVEMENT_EARNED", ACHIEVEMENT_EARNED) E:RegisterEvent("CRITERIA_EARNED", CRITERIA_EARNED) + E:RegisterEvent("PLAYER_ENTERING_WORLD", PLAYER_ENTERING_WORLD) end end local function Disable() E:UnregisterEvent("ACHIEVEMENT_EARNED", ACHIEVEMENT_EARNED) E:UnregisterEvent("CRITERIA_EARNED", CRITERIA_EARNED) + E:UnregisterEvent("PLAYER_ENTERING_WORLD", PLAYER_ENTERING_WORLD) end local function Test() -- new, Shave and a Haircut Toast_SetUp("ACHIEVEMENT_TEST", 545, false) - -- earned, Ten Hit Tunes - Toast_SetUp("ACHIEVEMENT_TEST", 9828, true) + -- earned, Reach Level 10 + Toast_SetUp("ACHIEVEMENT_TEST", 6, true) + + -- guild, Everyone Needs a Logo + local old = guildAchievements[5362] + guildAchievements[5362] = false + + Toast_SetUp("ACHIEVEMENT_TEST", 5362) - -- guild, It All Adds Up - Toast_SetUp("ACHIEVEMENT_TEST", 4913, false) + guildAchievements[5362] = old end E:RegisterOptions("achievement", { enabled = true, anchor = 1, dnd = false, + tooltip = true, }, { name = L["TYPE_ACHIEVEMENT"], get = function(info) @@ -137,7 +186,7 @@ E:RegisterOptions("achievement", { else Disable() end - end + end, }, dnd = { order = 2, @@ -145,6 +194,11 @@ E:RegisterOptions("achievement", { name = L["DND"], desc = L["DND_TOOLTIP"], }, + tooltip = { + order = 3, + type = "toggle", + name = L["TOOLTIPS"], + }, test = { type = "execute", order = 99, diff --git a/ls_Toasts/systems/activities.lua b/ls_Toasts/systems/activities.lua index af6123f..bd723d1 100644 --- a/ls_Toasts/systems/activities.lua +++ b/ls_Toasts/systems/activities.lua @@ -82,7 +82,7 @@ E:RegisterOptions("activities", { else Disable() end - end + end, }, dnd = { order = 2, diff --git a/ls_Toasts/systems/archaeology.lua b/ls_Toasts/systems/archaeology.lua index f42f540..9b37a1e 100644 --- a/ls_Toasts/systems/archaeology.lua +++ b/ls_Toasts/systems/archaeology.lua @@ -37,7 +37,7 @@ end ------ local NO_GAIN_SOURCE = Enum.CurrencySource.Last --- https://wow.tools/dbc/?dbc=currencytypes#colFilter[3]=82 +-- https://wago.tools/db2/CurrencyTypes?filter%5BCategoryID%5D=82 local WHITELIST = { -- 82 (Archaeology) [ 384] = true, -- Dwarf Archaeology Fragment @@ -98,11 +98,14 @@ local function FragmentToast_SetUp(event, link, quantity) toast._data.count = quantity toast._data.event = event toast._data.link = link - toast._data.sound_file = C.db.profile.types.loot_currency.sfx and 31578 -- SOUNDKIT.UI_EPICLOOT_TOAST + toast._data.sound_file = C.db.profile.types.archaeology.sfx and 31578 -- SOUNDKIT.UI_EPICLOOT_TOAST toast._data.tooltip_link = link - toast:HookScript("OnEnter", Toast_OnEnter) - toast:Spawn(C.db.profile.types.loot_currency.anchor, C.db.profile.types.loot_currency.dnd) + if C.db.profile.types.archaeology.tooltip then + toast:HookScript("OnEnter", Toast_OnEnter) + end + + toast:Spawn(C.db.profile.types.archaeology.anchor, C.db.profile.types.archaeology.dnd) else toast:Recycle() end @@ -175,6 +178,7 @@ E:RegisterOptions("archaeology", { anchor = 1, dnd = false, sfx = true, + tooltip = true, }, { name = L["TYPE_ARCHAEOLOGY"], get = function(info) @@ -196,7 +200,7 @@ E:RegisterOptions("archaeology", { else Disable() end - end + end, }, dnd = { order = 2, @@ -209,6 +213,11 @@ E:RegisterOptions("archaeology", { type = "toggle", name = L["SFX"], }, + tooltip = { + order = 4, + type = "toggle", + name = L["TOOLTIPS"], + }, test = { type = "execute", order = 99, diff --git a/ls_Toasts/systems/collection.lua b/ls_Toasts/systems/collection.lua index 61fa6e9..01e8404 100644 --- a/ls_Toasts/systems/collection.lua +++ b/ls_Toasts/systems/collection.lua @@ -188,7 +188,7 @@ E:RegisterOptions("collection", { else Disable() end - end + end, }, dnd = { order = 3, diff --git a/ls_Toasts/systems/garrison.lua b/ls_Toasts/systems/garrison.lua index 4381b7c..f505e94 100644 --- a/ls_Toasts/systems/garrison.lua +++ b/ls_Toasts/systems/garrison.lua @@ -198,7 +198,10 @@ local function FollowerToast_SetUp(event, garrisonType, followerTypeID, follower toast._data.show_arrows = isUpgraded toast._data.sound_file = C.db.profile.types[typeToKey[garrisonType]].sfx and 44296 -- SOUNDKIT.UI_GARRISON_TOAST_FOLLOWER_GAINED - toast:HookScript("OnEnter", FollowerToast_OnEnter) + if C.db.profile.types[typeToKey[garrisonType]].tooltip then + toast:HookScript("OnEnter", FollowerToast_OnEnter) + end + toast:Spawn(C.db.profile.types[typeToKey[garrisonType]].anchor, C.db.profile.types[typeToKey[garrisonType]].dnd) end @@ -265,7 +268,10 @@ local function TalentToast_SetUp(event, garrisonType, talentID) toast._data.talend_id = talentID toast._data.sound_file = C.db.profile.types[typeToKey[garrisonType]].sfx and 73280 -- SOUNDKIT.UI_ORDERHALL_TALENT_READY_TOAST - toast:HookScript("OnEnter", TalentToast_OnEnter) + if C.db.profile.types[typeToKey[garrisonType]].tooltip then + toast:HookScript("OnEnter", TalentToast_OnEnter) + end + toast:Spawn(C.db.profile.types[typeToKey[garrisonType]].anchor, C.db.profile.types[typeToKey[garrisonType]].dnd) end @@ -428,6 +434,7 @@ E:RegisterOptions("garrison_6_0", { anchor = 1, dnd = true, sfx = true, + tooltip = true, }, { name = L["TYPE_GARRISON"], get = function(info) @@ -449,7 +456,7 @@ E:RegisterOptions("garrison_6_0", { else Disable() end - end + end, }, dnd = { order = 2, @@ -462,6 +469,11 @@ E:RegisterOptions("garrison_6_0", { type = "toggle", name = L["SFX"], }, + tooltip = { + order = 4, + type = "toggle", + name = L["TOOLTIPS"], + }, test = { type = "execute", order = 99, @@ -477,6 +489,7 @@ E:RegisterOptions("garrison_7_0", { anchor = 1, dnd = true, sfx = true, + tooltip = true, }, { name = L["TYPE_CLASS_HALL"], get = function(info) @@ -498,7 +511,7 @@ E:RegisterOptions("garrison_7_0", { else Disable() end - end + end, }, dnd = { order = 2, @@ -511,6 +524,11 @@ E:RegisterOptions("garrison_7_0", { type = "toggle", name = L["SFX"], }, + tooltip = { + order = 4, + type = "toggle", + name = L["TOOLTIPS"], + }, test = { type = "execute", order = 99, @@ -526,6 +544,7 @@ E:RegisterOptions("garrison_8_0", { anchor = 1, dnd = true, sfx = true, + tooltip = true, }, { name = L["TYPE_WAR_EFFORT"], get = function(info) @@ -547,7 +566,7 @@ E:RegisterOptions("garrison_8_0", { else Disable() end - end + end, }, dnd = { order = 2, @@ -560,6 +579,11 @@ E:RegisterOptions("garrison_8_0", { type = "toggle", name = L["SFX"], }, + tooltip = { + order = 4, + type = "toggle", + name = L["TOOLTIPS"], + }, test = { type = "execute", order = 99, @@ -575,6 +599,7 @@ E:RegisterOptions("garrison_9_0", { anchor = 1, dnd = true, sfx = true, + tooltip = true, }, { name = L["TYPE_COVENANT"], get = function(info) @@ -596,7 +621,7 @@ E:RegisterOptions("garrison_9_0", { else Disable() end - end + end, }, dnd = { order = 2, @@ -609,6 +634,11 @@ E:RegisterOptions("garrison_9_0", { type = "toggle", name = L["SFX"], }, + tooltip = { + order = 4, + type = "toggle", + name = L["TOOLTIPS"], + }, test = { type = "execute", order = 99, diff --git a/ls_Toasts/systems/instance.lua b/ls_Toasts/systems/instance.lua index 2bd59ee..f0c6fe6 100644 --- a/ls_Toasts/systems/instance.lua +++ b/ls_Toasts/systems/instance.lua @@ -173,7 +173,7 @@ E:RegisterOptions("instance", { else Disable() end - end + end, }, dnd = { order = 2, diff --git a/ls_Toasts/systems/loot_common.lua b/ls_Toasts/systems/loot_common.lua index c2e2e91..730d999 100644 --- a/ls_Toasts/systems/loot_common.lua +++ b/ls_Toasts/systems/loot_common.lua @@ -54,7 +54,6 @@ local function updatePatterns() LOOT_ITEM_PUSHED_MULTIPLE_PATTERN = LOOT_ITEM_PUSHED_SELF_MULTIPLE:gsub("%%s", "(.+)"):gsub("%%d", "(%%d+)"):gsub("^", "^") CACHED_LOOT_ITEM_PUSHED_MULTIPLE = LOOT_ITEM_PUSHED_SELF_MULTIPLE end - end local function delayedUpdatePatterns() @@ -185,8 +184,11 @@ local function Toast_SetUp(event, link, quantity) toast._data.sound_file = C.db.profile.types.loot_common.sfx and soundFile toast._data.tooltip_link = originalLink + if C.db.profile.types.loot_common.tooltip then + toast:HookScript("OnEnter", Toast_OnEnter) + end + toast:HookScript("OnClick", Toast_OnClick) - toast:HookScript("OnEnter", Toast_OnEnter) toast:Spawn(C.db.profile.types.loot_common.anchor, C.db.profile.types.loot_common.dnd) else toast:Release() @@ -277,6 +279,7 @@ E:RegisterOptions("loot_common", { anchor = 1, dnd = false, sfx = true, + tooltip = true, ilvl = true, quest = false, threshold = 1, @@ -306,7 +309,7 @@ E:RegisterOptions("loot_common", { else Disable() end - end + end, }, dnd = { order = 3, @@ -319,14 +322,19 @@ E:RegisterOptions("loot_common", { type = "toggle", name = L["SFX"], }, - ilvl = { + tooltip = { order = 5, type = "toggle", + name = L["TOOLTIPS"], + }, + ilvl = { + order = 6, + type = "toggle", name = L["SHOW_ILVL"], desc = L["SHOW_ILVL_DESC"], }, threshold = { - order = 6, + order = 7, type = "select", name = L["LOOT_THRESHOLD"], values = { @@ -338,7 +346,7 @@ E:RegisterOptions("loot_common", { }, }, quest = { - order = 7, + order = 8, type = "toggle", name = L["SHOW_QUEST_ITEMS"], desc = L["SHOW_QUEST_ITEMS_DESC"], diff --git a/ls_Toasts/systems/loot_currency.lua b/ls_Toasts/systems/loot_currency.lua index 805cbc4..48ccfb4 100644 --- a/ls_Toasts/systems/loot_currency.lua +++ b/ls_Toasts/systems/loot_currency.lua @@ -196,7 +196,7 @@ local BLACKLIST = { [2002] = true, -- Renown-Maruuk Centaur [2016] = true, -- Dragon Racing - Scoreboard - Race Complete Time [2017] = true, -- Dragon Racing - Scoreboard - Race Complete Time - Fraction 1 - [2018] = true, -- Dragon Racing - Scoreboard - Race Quest ID + [2018] = true, -- Dragon Racing - Temp Storage - Race Quest ID [2019] = true, -- Dragon Racing - Scoreboard - Race Complete Time - Silver [2020] = true, -- Dragon Racing - Scoreboard - Race Complete Time - Gold [2021] = true, -- Renown-Dragonscale Expedition @@ -1059,9 +1059,15 @@ local BLACKLIST = { [3088] = true, -- Healer [3094] = true, -- 11.0 Raid - Nerubian - Account Quest Complete Tracker (Hidden) [3099] = true, -- 11.0 Raid - Nerubian - Nerubar Finery Tracking Currency (Hidden) + [3102] = true, -- Bronze Celebration Token [3103] = true, -- 11.0 Delves - System - Seasonal Affix - Events Active [3104] = true, -- 11.0 Delves - System - Seasonal Affix - Events Maximum [3115] = true, -- [DNT] Worldsoul Memory Score + [3142] = true, -- 11.0 Delves - Bountiful Tracker - Brann EXP Cap + [3143] = true, -- 11.0 Delves - Bountiful Tracker - Delver's Journey Cap + [3144] = true, -- 11.0.5 20th Anniversary - Tracker + [3145] = true, -- 11.0.5 20th Anniversary - Tracker + [3146] = true, -- 11.0.5 20th Anniversary - Tracker } local MULT = { @@ -1128,7 +1134,10 @@ local function Toast_SetUp(event, id, quantity) toast._data.sound_file = C.db.profile.types.loot_currency.sfx and 31578 -- SOUNDKIT.UI_EPICLOOT_TOAST toast._data.tooltip_link = link - toast:HookScript("OnEnter", Toast_OnEnter) + if C.db.profile.types.loot_currency.tooltip then + toast:HookScript("OnEnter", Toast_OnEnter) + end + toast:Spawn(C.db.profile.types.loot_currency.anchor, C.db.profile.types.loot_currency.dnd) else toast:Recycle() @@ -1321,6 +1330,7 @@ E:RegisterOptions("loot_currency", { anchor = 1, dnd = false, sfx = true, + tooltip = true, track_loss = false, filters = { [1792] = 25, @@ -1367,31 +1377,36 @@ E:RegisterOptions("loot_currency", { type = "toggle", name = L["SFX"], }, - track_loss = { + tooltip = { order = 4, type = "toggle", + name = L["TOOLTIPS"], + }, + track_loss = { + order = 5, + type = "toggle", name = L["TRACK_LOSS"], }, test = { type = "execute", - order = 7, + order = 6, width = "full", name = L["TEST"], func = Test, }, spacer_1 = { - order = 8, + order = 7, type = "description", name = " ", }, header_1 = { - order = 9, + order = 8, type = "description", name = " |cffffd200".. L["FILTERS"] .. "|r", fontSize = "medium", }, new = { - order = 10, + order = 9, type = "group", name = L["NEW"], args = { @@ -1437,7 +1452,7 @@ E:RegisterOptions("loot_currency", { newID = nil updateFilterOptions() - end + end, }, }, }, diff --git a/ls_Toasts/systems/loot_gold.lua b/ls_Toasts/systems/loot_gold.lua index e0791a9..8bda3bc 100644 --- a/ls_Toasts/systems/loot_gold.lua +++ b/ls_Toasts/systems/loot_gold.lua @@ -122,7 +122,7 @@ E:RegisterOptions("loot_gold", { else Disable() end - end + end, }, dnd = { order = 2, diff --git a/ls_Toasts/systems/loot_special.lua b/ls_Toasts/systems/loot_special.lua index 79994db..293c028 100644 --- a/ls_Toasts/systems/loot_special.lua +++ b/ls_Toasts/systems/loot_special.lua @@ -15,7 +15,7 @@ local rollTypes = { [1] = "need", [2] = "greed", [3] = "disenchant", - [4] = "transmog", -- no idea if it's even a thing, but I'll just assume that it is + [4] = "transmog", } local function Toast_OnClick(self) @@ -145,8 +145,11 @@ local function Toast_SetUp(event, link, quantity, factionGroup, lessAwesome, isU toast._data.sound_file = C.db.profile.types.loot_special.sfx and soundFile toast._data.tooltip_link = originalLink + if C.db.profile.types.loot_special.tooltip then + toast:HookScript("OnEnter", Toast_OnEnter) + end + toast:HookScript("OnClick", Toast_OnClick) - toast:HookScript("OnEnter", Toast_OnEnter) toast:Spawn(C.db.profile.types.loot_special.anchor, C.db.profile.types.loot_special.dnd) else toast:Release() @@ -303,6 +306,7 @@ E:RegisterOptions("loot_special", { anchor = 1, dnd = false, sfx = true, + tooltip = true, ilvl = true, threshold = 1, }, { @@ -331,7 +335,7 @@ E:RegisterOptions("loot_special", { else Disable() end - end + end, }, dnd = { order = 3, @@ -344,6 +348,11 @@ E:RegisterOptions("loot_special", { type = "toggle", name = L["SFX"], }, + tooltip = { + order = 4, + type = "toggle", + name = L["TOOLTIPS"], + }, ilvl = { order = 5, type = "toggle", diff --git a/ls_Toasts/systems/recipe.lua b/ls_Toasts/systems/recipe.lua index ecfb80c..afd2d55 100644 --- a/ls_Toasts/systems/recipe.lua +++ b/ls_Toasts/systems/recipe.lua @@ -57,8 +57,11 @@ local function RecipeToast_SetUp(event, recipeID, recipeLevel) toast._data.sound_file = C.db.profile.types.recipe.sfx and 73919 -- SOUNDKIT.UI_PROFESSIONS_NEW_RECIPE_LEARNED_TOAST toast._data.tradeskill_id = tradeSkillID or skillLineID + if C.db.profile.types.recipe.tooltip then + toast:HookScript("OnEnter", RecipeToast_OnEnter) + end + toast:HookScript("OnClick", RecipeToast_OnClick) - toast:HookScript("OnEnter", RecipeToast_OnEnter) toast:Spawn(C.db.profile.types.recipe.anchor, C.db.profile.types.recipe.dnd) end end @@ -136,6 +139,7 @@ E:RegisterOptions("recipe", { anchor = 1, dnd = false, sfx = true, + tooltip = true, left_click = false, }, { name = L["TYPE_PROFESSION"], @@ -158,7 +162,7 @@ E:RegisterOptions("recipe", { else Disable() end - end + end, }, dnd = { order = 2, @@ -171,9 +175,14 @@ E:RegisterOptions("recipe", { type = "toggle", name = L["SFX"], }, - left_click = { + tooltip = { order = 4, type = "toggle", + name = L["TOOLTIPS"], + }, + left_click = { + order = 5, + type = "toggle", name = L["HANDLE_LEFT_CLICK"], desc = L["TAINT_WARNING"], image = "Interface\\DialogFrame\\UI-Dialog-Icon-AlertNew", diff --git a/ls_Toasts/systems/runecarving.lua b/ls_Toasts/systems/runecarving.lua index 10058ba..b284691 100644 --- a/ls_Toasts/systems/runecarving.lua +++ b/ls_Toasts/systems/runecarving.lua @@ -86,8 +86,11 @@ local function Toast_SetUp(event, powerID) toast._data.runecarving_id = powerID toast._data.sound_file = C.db.profile.types.runecarving.sfx and 166314 -- SOUNDKIT.UI_RUNECARVING_OPEN_MAIN_WINDOW + if C.db.profile.types.runecarving.tooltip then + toast:HookScript("OnEnter", Toast_OnEnter) + end + toast:HookScript("OnClick", Toast_OnClick) - toast:HookScript("OnEnter", Toast_OnEnter) toast:Spawn(C.db.profile.types.runecarving.anchor, C.db.profile.types.runecarving.dnd) end end @@ -121,6 +124,7 @@ E:RegisterOptions("runecarving", { anchor = 1, dnd = false, sfx = true, + tooltip = true, }, { name = L["TYPE_RUNECARVING"], get = function(info) @@ -142,7 +146,7 @@ E:RegisterOptions("runecarving", { else Disable() end - end + end, }, dnd = { order = 2, @@ -155,6 +159,11 @@ E:RegisterOptions("runecarving", { type = "toggle", name = L["SFX"], }, + tooltip = { + order = 4, + type = "toggle", + name = L["TOOLTIPS"], + }, test = { type = "execute", order = 99, diff --git a/ls_Toasts/systems/store.lua b/ls_Toasts/systems/store.lua index 1950694..759699c 100644 --- a/ls_Toasts/systems/store.lua +++ b/ls_Toasts/systems/store.lua @@ -103,8 +103,11 @@ local function Toast_SetUp(event, entitlementType, textureID, name, payloadID, p toast._data.event = event toast._data.sound_file = C.db.profile.types.store.sfx and 39517 -- SOUNDKIT.UI_IG_STORE_PURCHASE_DELIVERED_TOAST_01 + if C.db.profile.types.store.tooltip then + toast:HookScript("OnEnter", Toast_OnEnter) + end + toast:HookScript("OnClick", Toast_OnClick) - toast:HookScript("OnEnter", Toast_OnEnter) toast:Spawn(C.db.profile.types.store.anchor, C.db.profile.types.store.dnd) end @@ -178,6 +181,7 @@ E:RegisterOptions("store", { anchor = 1, dnd = false, sfx = true, + tooltip = true, left_click = false, }, { name = L["BLIZZARD_STORE"], @@ -200,7 +204,7 @@ E:RegisterOptions("store", { else Disable() end - end + end, }, dnd = { order = 2, @@ -213,9 +217,14 @@ E:RegisterOptions("store", { type = "toggle", name = L["SFX"], }, - left_click = { + tooltip = { order = 4, type = "toggle", + name = L["TOOLTIPS"], + }, + left_click = { + order = 5, + type = "toggle", name = L["HANDLE_LEFT_CLICK"], desc = L["TAINT_WARNING"], image = "Interface\\DialogFrame\\UI-Dialog-Icon-AlertNew", diff --git a/ls_Toasts/systems/transmog.lua b/ls_Toasts/systems/transmog.lua index bdb3d71..6fd93e3 100644 --- a/ls_Toasts/systems/transmog.lua +++ b/ls_Toasts/systems/transmog.lua @@ -95,7 +95,6 @@ local function TRANSMOG_COLLECTION_SOURCE_ADDED(sourceID) end C_Timer.After(0.25, function() TRANSMOG_COLLECTION_SOURCE_ADDED(sourceID) end) - elseif result ~= RESULT_YES then Toast_SetUp("TRANSMOG_COLLECTION_SOURCE_ADDED", sourceID, true, 1) end @@ -193,7 +192,7 @@ E:RegisterOptions("transmog", { else Disable() end - end + end, }, dnd = { order = 2, diff --git a/ls_Toasts/systems/world.lua b/ls_Toasts/systems/world.lua index 9561f75..f868d6a 100644 --- a/ls_Toasts/systems/world.lua +++ b/ls_Toasts/systems/world.lua @@ -267,7 +267,7 @@ E:RegisterOptions("world", { else Disable() end - end + end, }, dnd = { order = 2,