From 41b9479a0afb6f9536e15f0ef20fe60e5f3fb8bb Mon Sep 17 00:00:00 2001 From: Florian Berthold Date: Sun, 24 May 2026 18:26:43 +0200 Subject: [PATCH] feat: HideCooldownErrors / MuteErrorSpeech option Adds the 'Hide Ability not ready warnings' option to FasterLootPanel and wires up a hook on UIErrorsFrame.AddMessage that suppresses the red 'Ability not ready', 'Spell is not ready' and 'Another action is in progress' messages when the option is on. Other errors (out of range, line of sight, etc.) still appear normally. Includes the saved-var loaders / setters in eventHandler and the default 'Off' init in LeaPlusLC:Isolated(). --- Leatrix_Plus.lua | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/Leatrix_Plus.lua b/Leatrix_Plus.lua index 3d828ee..5b553bb 100644 --- a/Leatrix_Plus.lua +++ b/Leatrix_Plus.lua @@ -1784,6 +1784,8 @@ function LeaPlusLC:Isolated() LeaPlusLC:MakeCB(FasterLootPanel, "SmallerErrorFrame", "Smaller Error Frame", 16, -92, false, "If checked, your red error text frame, will be only one line long.") LeaPlusLC:MakeCB(FasterLootPanel, "FasterErrorFrame", "Faster Error Frame", 16, -112, false, "If checked, your red error text frame, will be faster to fade|n(1 second instead of 5).") LeaPlusLC:MakeCB(FasterLootPanel, "NoLootWorldforged", "Skip auto-loot for Worldforged items", 16, -132, false, "If checked, worldforged items will be left in the loot window instead of being auto-looted, so you can decide which ones to keep.") + LeaPlusLC:MakeCB(FasterLootPanel, "HideCooldownErrors", "Hide 'Ability not ready' warnings", 16, -152, false, "If checked, the red 'Ability not ready', 'Spell is not ready' and 'Another action is in progress' messages are suppressed.|nOther errors (out of range, line of sight, etc.) still appear.") + LeaPlusLC:MakeCB(FasterLootPanel, "MuteErrorSpeech", "Mute error sound", 16, -172, false, "If checked, the spoken error sound (e.g. \"I can't do that yet\") is silenced.|nToggles the Sound_EnableErrorSpeech CVar.") LeaPlusLC:MakeTx(FasterLootPanel, "Full Inventory Sound", 356, -72) LeaPlusLC:MakeSL(FasterLootPanel, "FullInvSound", "Drag to set the desired sound played when your inventory is Full. Set 0 to disable sound.", 0, 3, 1, 356, -92, "%.0f") @@ -1824,9 +1826,35 @@ function LeaPlusLC:Isolated() end SetErroFrameFadeTime() + --===== Hook UIErrorsFrame.AddMessage once to suppress cooldown nag when toggled on =====-- + if not LeaPlusLC.cooldownErrorFilterInstalled then + local origAddMessage = UIErrorsFrame.AddMessage + UIErrorsFrame.AddMessage = function(self, msg, ...) + if LeaPlusLC["HideCooldownErrors"] == "On" + and (msg == SPELL_FAILED_NOT_READY + or msg == ERR_ABILITY_COOLDOWN + or msg == SPELL_FAILED_SPELL_IN_PROGRESS + or msg == SPELL_FAILED_ITEM_NOT_READY) then + return + end + return origAddMessage(self, msg, ...) + end + LeaPlusLC.cooldownErrorFilterInstalled = true + end + + local function SetMuteErrorSpeech() + if LeaPlusLC["MuteErrorSpeech"] == "On" then + SetCVar("Sound_EnableErrorSpeech", 0) + else + SetCVar("Sound_EnableErrorSpeech", 1) + end + end + SetMuteErrorSpeech() + LeaPlusCB["FullInvSound"]:HookScript("OnValueChanged", SetFullInvSliderText) LeaPlusCB["SmallerErrorFrame"]:HookScript("OnClick", SetErrorFrameHeight) LeaPlusCB["FasterErrorFrame"]:HookScript("OnClick", SetErroFrameFadeTime) + LeaPlusCB["MuteErrorSpeech"]:HookScript("OnClick", SetMuteErrorSpeech) @@ -1848,9 +1876,12 @@ function LeaPlusLC:Isolated() LeaPlusLC["SmallerErrorFrame"] = "Off" LeaPlusLC["FasterErrorFrame"] = "Off" LeaPlusLC["NoLootWorldforged"] = "Off" + LeaPlusLC["HideCooldownErrors"] = "Off" + LeaPlusLC["MuteErrorSpeech"] = "Off" LeaPlusLC["FullInvSound"] = 1 UIErrorsFrame:SetHeight(60) UIErrorsFrame:SetTimeVisible(5) + SetCVar("Sound_EnableErrorSpeech", 1) -- Refresh panel FasterLootPanel:Hide(); FasterLootPanel:Show() @@ -17097,9 +17128,11 @@ local function eventHandler(self, event, arg1, arg2, ...) LeaPlusLC:LoadVarNum("ViewPortResizeBottom", 0, 0, 300) -- Resize bottom border LeaPlusLC:LoadVarNum("ViewPortAlpha", 0, 0, 0.9) -- Border alpha LeaPlusLC:LoadVarNum("FullInvSound", 1, 0, 3) - LeaPlusLC:LoadVarChk("SmallerErrorFrame", "Off") -- Release in PvP Exclude Alterac Valley - LeaPlusLC:LoadVarChk("FasterErrorFrame", "Off") -- Release in PvP Exclude Alterac Valley + LeaPlusLC:LoadVarChk("SmallerErrorFrame", "Off") -- Smaller error frame + LeaPlusLC:LoadVarChk("FasterErrorFrame", "Off") -- Faster error frame LeaPlusLC:LoadVarChk("NoLootWorldforged", "Off") -- CoA: skip auto-loot for worldforged items + LeaPlusLC:LoadVarChk("HideCooldownErrors", "Off") -- Hide "Ability not ready" red text + LeaPlusLC:LoadVarChk("MuteErrorSpeech", "Off") -- Mute spoken error sound LeaPlusLC:LoadVarChk("NoRestedEmotes", "Off") -- Silence rested emotes @@ -17551,8 +17584,10 @@ local function eventHandler(self, event, arg1, arg2, ...) LeaPlusDB["ViewPortAlpha"] = LeaPlusLC["ViewPortAlpha"] LeaPlusDB["FullInvSound"] = LeaPlusLC["FullInvSound"] LeaPlusDB["SmallerErrorFrame"] = LeaPlusLC["SmallerErrorFrame"] - LeaPlusDB["FasterErrorFrame"] = LeaPlusLC["SmallerErrorFrame"] + LeaPlusDB["FasterErrorFrame"] = LeaPlusLC["FasterErrorFrame"] LeaPlusDB["NoLootWorldforged"] = LeaPlusLC["NoLootWorldforged"] + LeaPlusDB["HideCooldownErrors"] = LeaPlusLC["HideCooldownErrors"] + LeaPlusDB["MuteErrorSpeech"] = LeaPlusLC["MuteErrorSpeech"] LeaPlusDB["NoRestedEmotes"] = LeaPlusLC["NoRestedEmotes"] LeaPlusDB["MuteGameSounds"] = LeaPlusLC["MuteGameSounds"]