Skip to content

Commit 9fec738

Browse files
committed
Add an option to hide all glows when out of combat
1 parent d783477 commit 9fec738

14 files changed

Lines changed: 62 additions & 7 deletions

HideButtonGlow.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
local addonName, HideButtonGlow = ...
22

3-
local CreateFrame, GetActionInfo, DEFAULT_CHAT_FRAME, Settings, GetSpellName = CreateFrame, GetActionInfo, DEFAULT_CHAT_FRAME, Settings, C_Spell.GetSpellName
3+
local CreateFrame, GetActionInfo, DEFAULT_CHAT_FRAME, Settings, GetSpellName, InCombatLockdown = CreateFrame, GetActionInfo, DEFAULT_CHAT_FRAME, Settings, C_Spell.GetSpellName, InCombatLockdown
44
local L = LibStub("AceLocale-3.0"):GetLocale("HideButtonGlow")
55

66
local EventFrame = CreateFrame("Frame")
@@ -19,6 +19,9 @@ function EventFrame:PLAYER_LOGIN(event)
1919
if type(HideButtonGlowDB.hideAll) ~= "boolean" then
2020
HideButtonGlowDB.hideAll = false
2121
end
22+
if type(HideButtonGlowDB.hideOutOfCombat) ~= "boolean" then
23+
HideButtonGlowDB.hideOutOfCombat = false
24+
end
2225
if type(HideButtonGlowDB.debugMode) ~= "boolean" then
2326
HideButtonGlowDB.debugMode = false
2427
end
@@ -78,6 +81,10 @@ do
7881
end
7982

8083
function HideButtonGlow:ShouldHideGlow(spellId)
84+
if HideButtonGlowDB.hideOutOfCombat and not InCombatLockdown() then
85+
self:AddDebugMessageWithSpell(L.debug_combat:format(L.debug_filtered), spellId)
86+
return true
87+
end
8188
-- check if the "hide all" option is set
8289
if HideButtonGlowDB.hideAll then
8390
if HideButtonGlowDB.allowed[spellId] then

HideButtonGlow.toc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323
Locales\enUS.lua
2424
Locales\[TextLocale].lua [AllowLoadTextLocale deDE, esES, esMX, frFR, itIT, koKR, ptBR, ruRU, zhCN, zhTW]
2525
HideButtonGlow.lua
26-
options.lua
26+
Options.lua

Locales/deDE.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ local L = LibStub("AceLocale-3.0"):NewLocale("HideButtonGlow", "deDE")
22

33
--L.debug_allowed = "Allowing glow for '%s' (ID %d)."
44
--L.debug_filtered = "Filtered glow for '%s' (ID %d)."
5+
--L.debug_combat = "Not in combat: %s"
56
--L.options = "Options"
67
--L.hide_all = "Hide all glows"
78
--L.hide_all_desc = "Hide all spell glows, except for those under \"Allowed Spells\"."
89
--L.debug_mode = "Debug mode"
910
--L.debug_mode_desc = "Prints all filtered/unfiltered spells to chat. Useful for finding spell IDs, or checking how your settings work."
11+
--L.hide_out_of_combat = "Hide all when out of combat"
12+
--L.hide_out_of_combat_desc = "Always hide all spell glows if you are out of combat. Ignores the allow list."
1013
--L.filtered_spells = "Filtered Spells"
1114
--L.filtered_spells_desc = "Input spell names or spell IDs to prevent button glow for those abilities."
1215
--L.add_filter = "Add Spell to Filter List"

Locales/enUS.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ local L = LibStub("AceLocale-3.0"):NewLocale("HideButtonGlow", "enUS", true)
22

33
L.debug_allowed = "Allowing glow for '%s' (ID %d)."
44
L.debug_filtered = "Filtered glow for '%s' (ID %d)."
5+
L.debug_combat = "Not in combat: %s"
56
L.options = "Options"
67
L.hide_all = "Hide all glows"
78
L.hide_all_desc = "Hide all spell glows, except for those under \"Allowed Spells\"."
89
L.debug_mode = "Debug mode"
910
L.debug_mode_desc = "Prints all filtered/unfiltered spells to chat. Useful for finding spell IDs, or checking how your settings work."
11+
L.hide_out_of_combat = "Hide all when out of combat"
12+
L.hide_out_of_combat_desc = "Always hide all spell glows if you are out of combat. Ignores the allow list."
1013
L.filtered_spells = "Filtered Spells"
1114
L.filtered_spells_desc = "Input spell names or spell IDs to prevent button glow for those abilities."
1215
L.add_filter = "Add Spell to Filter List"

Locales/esES.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ local L = LibStub("AceLocale-3.0"):NewLocale("HideButtonGlow", "esES")
22

33
--L.debug_allowed = "Allowing glow for '%s' (ID %d)."
44
--L.debug_filtered = "Filtered glow for '%s' (ID %d)."
5+
--L.debug_combat = "Not in combat: %s"
56
--L.options = "Options"
67
--L.hide_all = "Hide all glows"
78
--L.hide_all_desc = "Hide all spell glows, except for those under \"Allowed Spells\"."
89
--L.debug_mode = "Debug mode"
910
--L.debug_mode_desc = "Prints all filtered/unfiltered spells to chat. Useful for finding spell IDs, or checking how your settings work."
11+
--L.hide_out_of_combat = "Hide all when out of combat"
12+
--L.hide_out_of_combat_desc = "Always hide all spell glows if you are out of combat. Ignores the allow list."
1013
--L.filtered_spells = "Filtered Spells"
1114
--L.filtered_spells_desc = "Input spell names or spell IDs to prevent button glow for those abilities."
1215
--L.add_filter = "Add Spell to Filter List"

Locales/esMX.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ local L = LibStub("AceLocale-3.0"):NewLocale("HideButtonGlow", "esMX")
22

33
--L.debug_allowed = "Allowing glow for '%s' (ID %d)."
44
--L.debug_filtered = "Filtered glow for '%s' (ID %d)."
5+
--L.debug_combat = "Not in combat: %s"
56
--L.options = "Options"
67
--L.hide_all = "Hide all glows"
78
--L.hide_all_desc = "Hide all spell glows, except for those under \"Allowed Spells\"."
89
--L.debug_mode = "Debug mode"
910
--L.debug_mode_desc = "Prints all filtered/unfiltered spells to chat. Useful for finding spell IDs, or checking how your settings work."
11+
--L.hide_out_of_combat = "Hide all when out of combat"
12+
--L.hide_out_of_combat_desc = "Always hide all spell glows if you are out of combat. Ignores the allow list."
1013
--L.filtered_spells = "Filtered Spells"
1114
--L.filtered_spells_desc = "Input spell names or spell IDs to prevent button glow for those abilities."
1215
--L.add_filter = "Add Spell to Filter List"

Locales/frFR.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ local L = LibStub("AceLocale-3.0"):NewLocale("HideButtonGlow", "frFR")
22

33
--L.debug_allowed = "Allowing glow for '%s' (ID %d)."
44
--L.debug_filtered = "Filtered glow for '%s' (ID %d)."
5+
--L.debug_combat = "Not in combat: %s"
56
--L.options = "Options"
67
--L.hide_all = "Hide all glows"
78
--L.hide_all_desc = "Hide all spell glows, except for those under \"Allowed Spells\"."
89
--L.debug_mode = "Debug mode"
910
--L.debug_mode_desc = "Prints all filtered/unfiltered spells to chat. Useful for finding spell IDs, or checking how your settings work."
11+
--L.hide_out_of_combat = "Hide all when out of combat"
12+
--L.hide_out_of_combat_desc = "Always hide all spell glows if you are out of combat. Ignores the allow list."
1013
--L.filtered_spells = "Filtered Spells"
1114
--L.filtered_spells_desc = "Input spell names or spell IDs to prevent button glow for those abilities."
1215
--L.add_filter = "Add Spell to Filter List"

Locales/itIT.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ local L = LibStub("AceLocale-3.0"):NewLocale("HideButtonGlow", "itIT")
22

33
--L.debug_allowed = "Allowing glow for '%s' (ID %d)."
44
--L.debug_filtered = "Filtered glow for '%s' (ID %d)."
5+
--L.debug_combat = "Not in combat: %s"
56
--L.options = "Options"
67
--L.hide_all = "Hide all glows"
78
--L.hide_all_desc = "Hide all spell glows, except for those under \"Allowed Spells\"."
89
--L.debug_mode = "Debug mode"
910
--L.debug_mode_desc = "Prints all filtered/unfiltered spells to chat. Useful for finding spell IDs, or checking how your settings work."
11+
--L.hide_out_of_combat = "Hide all when out of combat"
12+
--L.hide_out_of_combat_desc = "Always hide all spell glows if you are out of combat. Ignores the allow list."
1013
--L.filtered_spells = "Filtered Spells"
1114
--L.filtered_spells_desc = "Input spell names or spell IDs to prevent button glow for those abilities."
1215
--L.add_filter = "Add Spell to Filter List"

Locales/koKR.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ local L = LibStub("AceLocale-3.0"):NewLocale("HideButtonGlow", "koKR")
22

33
--L.debug_allowed = "Allowing glow for '%s' (ID %d)."
44
--L.debug_filtered = "Filtered glow for '%s' (ID %d)."
5+
--L.debug_combat = "Not in combat: %s"
56
--L.options = "Options"
67
--L.hide_all = "Hide all glows"
78
--L.hide_all_desc = "Hide all spell glows, except for those under \"Allowed Spells\"."
89
--L.debug_mode = "Debug mode"
910
--L.debug_mode_desc = "Prints all filtered/unfiltered spells to chat. Useful for finding spell IDs, or checking how your settings work."
11+
--L.hide_out_of_combat = "Hide all when out of combat"
12+
--L.hide_out_of_combat_desc = "Always hide all spell glows if you are out of combat. Ignores the allow list."
1013
--L.filtered_spells = "Filtered Spells"
1114
--L.filtered_spells_desc = "Input spell names or spell IDs to prevent button glow for those abilities."
1215
--L.add_filter = "Add Spell to Filter List"

Locales/ptBR.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@ local L = LibStub("AceLocale-3.0"):NewLocale("HideButtonGlow", "ptBR")
22

33
--L.debug_allowed = "Allowing glow for '%s' (ID %d)."
44
--L.debug_filtered = "Filtered glow for '%s' (ID %d)."
5+
--L.debug_combat = "Not in combat: %s"
56
--L.options = "Options"
67
--L.hide_all = "Hide all glows"
78
--L.hide_all_desc = "Hide all spell glows, except for those under \"Allowed Spells\"."
89
--L.debug_mode = "Debug mode"
910
--L.debug_mode_desc = "Prints all filtered/unfiltered spells to chat. Useful for finding spell IDs, or checking how your settings work."
11+
--L.hide_out_of_combat = "Hide all when out of combat"
12+
--L.hide_out_of_combat_desc = "Always hide all spell glows if you are out of combat. Ignores the allow list."
1013
--L.filtered_spells = "Filtered Spells"
1114
--L.filtered_spells_desc = "Input spell names or spell IDs to prevent button glow for those abilities."
1215
--L.add_filter = "Add Spell to Filter List"

0 commit comments

Comments
 (0)