From 4d5a9f00dbc488bf087629ab2b39f668735e7b79 Mon Sep 17 00:00:00 2001 From: Karrz1 <127596890+Karrz1@users.noreply.github.com> Date: Mon, 16 Nov 2026 21:17:43 +0000 Subject: [PATCH] ForeverBots: say "the bot window opens when combat ends" once per fight hf-01372 (Karrz): pressing the window key or the minimap button again and again in a fight printed the line eight times. The wait is now said once per fight for each wish (open or close), like the tab wait already was; the flag clears when combat ends. Opening and closing work as before. --- .../PlayerbotV2/Addon/ForeverBots/ForeverBots.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/modules/PlayerbotV2/Addon/ForeverBots/ForeverBots.lua b/src/modules/PlayerbotV2/Addon/ForeverBots/ForeverBots.lua index 81e99f4239..55866c48cc 100644 --- a/src/modules/PlayerbotV2/Addon/ForeverBots/ForeverBots.lua +++ b/src/modules/PlayerbotV2/Addon/ForeverBots/ForeverBots.lua @@ -2114,19 +2114,25 @@ function UI.StopDrag(self) end -- Opens or closes the window, or says it will once combat ends. The window is built out of combat only: it creates the secure --- order buttons and sets their macros. +-- order buttons and sets their macros. The wait is said once per fight and wish (hf-01372: a key pressed again and again in a fight +-- printed "opens when combat ends" eight times); UI.windowWaitSaid is cleared when combat ends. +local function SayWindowWait(show) + if UI.windowWaitSaid == show then return end + UI.windowWaitSaid = show + Print(show and L["the bot window opens when combat ends."] or L["the bot window closes when combat ends."]) +end function UI.SetWindowShown(show) if not frame then if not show then UI.buildAfterCombat = nil; return end if InCombatLockdown and InCombatLockdown() then UI.buildAfterCombat = true - Print(L["the bot window opens when combat ends."]) + SayWindowWait(true) return end BuildFrame() end if not UI.SetShown(frame, show) and UI.afterCombat[frame] ~= nil then - Print(show and L["the bot window opens when combat ends."] or L["the bot window closes when combat ends."]) + SayWindowWait(show) end end @@ -2166,6 +2172,7 @@ combatFrame:SetScript("OnEvent", function(_, event) end if UI.pendingTab then ShowTab(UI.pendingTab) end tabWaitSaid = nil + UI.windowWaitSaid = nil for f, show in pairs(UI.afterCombat) do UI.afterCombat[f] = nil if show then f:Show() else f:Hide() end