From c433188edbad18f83190f36787b596bed7163b9b Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 11 Mar 2026 23:21:27 -0700 Subject: [PATCH] Show AFK/DND status badge on player frame Adds a yellow or orange label next to the player name when those modes are active, with a tooltip explaining how to cancel. --- include/game/game_handler.hpp | 2 ++ src/ui/game_screen.cpp | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/include/game/game_handler.hpp b/include/game/game_handler.hpp index dadc30ae..4821c4b0 100644 --- a/include/game/game_handler.hpp +++ b/include/game/game_handler.hpp @@ -447,6 +447,8 @@ public: // AFK/DND status void toggleAfk(const std::string& message = ""); void toggleDnd(const std::string& message = ""); + bool isAfk() const { return afkStatus_; } + bool isDnd() const { return dndStatus_; } void replyToLastWhisper(const std::string& message); std::string getLastWhisperSender() const { return lastWhisperSender_; } void setLastWhisperSender(const std::string& name) { lastWhisperSender_ = name; } diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index e59444fe..97351e7f 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -2074,6 +2074,15 @@ void GameScreen::renderPlayerFrame(game::GameHandler& gameHandler) { ImGui::SameLine(); ImGui::TextColored(ImVec4(0.9f, 0.2f, 0.2f, 1.0f), "DEAD"); } + if (gameHandler.isAfk()) { + ImGui::SameLine(); + ImGui::TextColored(ImVec4(0.8f, 0.8f, 0.3f, 1.0f), ""); + if (ImGui::IsItemHovered()) ImGui::SetTooltip("Away from keyboard — /afk to cancel"); + } else if (gameHandler.isDnd()) { + ImGui::SameLine(); + ImGui::TextColored(ImVec4(0.9f, 0.5f, 0.2f, 1.0f), ""); + if (ImGui::IsItemHovered()) ImGui::SetTooltip("Do not disturb — /dnd to cancel"); + } // Try to get real HP/mana from the player entity auto playerEntity = gameHandler.getEntityManager().getEntity(gameHandler.getPlayerGuid());