Show AFK/DND status badge on player frame

Adds a yellow <AFK> or orange <DND> label next to the player name
when those modes are active, with a tooltip explaining how to cancel.
This commit is contained in:
Kelsi 2026-03-11 23:21:27 -07:00
parent fe61d6acce
commit c433188edb
2 changed files with 11 additions and 0 deletions

View file

@ -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; }

View file

@ -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), "<AFK>");
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), "<DND>");
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());