diff --git a/HealBot.lua b/HealBot.lua index 8fb80b3..f2cbc62 100644 --- a/HealBot.lua +++ b/HealBot.lua @@ -103,6 +103,21 @@ function HealBot_SlashCmd(cmd) HealBot_AddDebug( "Channel active" ); return; end + if (cmd=="debug" or cmd=="dbg") then + if not HealBot_Config then return; end + if HealBot_Config.DebugMode == 1 then + HealBot_Config.DebugMode = 0; + if DEFAULT_CHAT_FRAME then + DEFAULT_CHAT_FRAME:AddMessage("|cFFFFD100HealBot|r: Debug mode |cFFFF0000DISABLED|r."); + end + else + HealBot_Config.DebugMode = 1; + if DEFAULT_CHAT_FRAME then + DEFAULT_CHAT_FRAME:AddMessage("|cFFFFD100HealBot|r: Debug mode |cFF00FF00ENABLED|r."); + end + end + return; + end end -- HealBot_SendAddonMessage moved to HealBot_Controller_Comms.lua diff --git a/HealBot_Controller_Comms.lua b/HealBot_Controller_Comms.lua index 47033dd..dded2b2 100644 --- a/HealBot_Controller_Comms.lua +++ b/HealBot_Controller_Comms.lua @@ -30,8 +30,15 @@ function HealBot_AddChat(msg) end end --- HealBot_AddDebug: Prints debug messages to internal chat channel. +-- HealBot_AddDebug: Prints debug messages to chat or internal debug channel. function HealBot_AddDebug(msg) + if HealBot_Config and HealBot_Config.DebugMode == 1 then + if DEFAULT_CHAT_FRAME then + DEFAULT_CHAT_FRAME:AddMessage("|cFFFFD100[HB Debug]|r " .. msg); + end + return; + end + local chanid = HealBot_Get_DebugChan(); if chanid and HealBot_SpamCnt < 3 then HealBot_SpamCnt = HealBot_SpamCnt + 1; diff --git a/HealBot_Data.lua b/HealBot_Data.lua index 5695567..5894ef4 100644 --- a/HealBot_Data.lua +++ b/HealBot_Data.lua @@ -1,4 +1,5 @@ HealBot_ConfigDefaults = { + DebugMode = 0, ShowManaBars=0, ManaBarsHealersOnly=0, Version = HEALBOT_VERSION, diff --git a/HealBot_Integrations.lua b/HealBot_Integrations.lua index 42ac6c2..e45554f 100644 --- a/HealBot_Integrations.lua +++ b/HealBot_Integrations.lua @@ -21,6 +21,7 @@ function HealBot_Integrations_Toggle() HealBot_Integrations_UnitXP_Active = true; HealBot_AddDebug("UnitXP Integration: ENABLED"); else + Look at the lines that need translation HealBot_Integrations_UnitXP_Active = false; HealBot_AddDebug("UnitXP Integration: DISABLED"); end diff --git a/README.md b/README.md index 75846d3..e81c524 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Default installation path: `C:\Program Files\World of Warcraft\Interface\AddOns\ * `/hb` - Toggles the main HealBot panel on and off * `/hb options` - Toggles the HealBot options panel on and off * `/hb reset` - Resets the contents of the main HealBot panel +* `/hb debug` - Toggles in-game debug message output to the main chat frame ### Key Features & Current Functionality * **MVC & Observer Architecture:** High-performance, reactive engine that updates frames dynamically on state changes, drastically reducing CPU and memory overhead. Features memory recycling pool and event loop decoupling for zero-stutter combat. @@ -54,6 +55,7 @@ Default installation path: `C:\Program Files\World of Warcraft\Interface\AddOns\ * **Performance Fix - Frame Rendering** - Eliminated redundant UI layout recalculations in `HealBot_Action_EnableButton`. The UI no longer forces `SetFont`, `SetWidth`, `SetHeight`, and `GetGlobal` lookups on every single combat tick (which previously caused 4,000+ layout updates per second in 40-man raids). * **Performance Fix - Range Checking** - Greatly reduced CPU stutter caused by range calculations. `HealBot_Range_Check` now caches map positioning math and API calls per-frame, preventing the addon from calculating the exact same `math.sqrt` distance up to 5 times per unit during heavy combat. * **Performance Fix - Unit ID Lookup** - Optimized `HealBot_FindUnitID` by pre-allocating raid unit tokens, preventing massive string concatenation and garbage collection spam during high-frequency combat events like `CHAT_MSG_ADDON` (HealComm). +* **Debug Output Command** - Added `/hb debug` (or `/hb dbg`) slash command to toggle real-time debug message printing directly into the standard chat frame without requiring custom chat channels. **v1.7.3** * **Performance Fix - Table Pooling Part 2** - Fixed remaining un-pooled table allocations in layout updates, macro parsing, nampower integration, and aura tracking by utilizing HealBot_GetTable().