From 18a3a0fd01a5e8f4fd2bc08e6ed48ec0cc4d6b75 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Mon, 9 Mar 2026 17:13:31 -0700 Subject: [PATCH] Add XP_GAIN combat text type; show '+N XP' in purple on kills XP gain was previously shown as a HEAL entry (green +N) which conflates it with actual healing. New XP_GAIN type renders as purple '+N XP' in the outgoing column, matching WoW's floating XP style. --- include/game/spell_defines.hpp | 2 +- src/game/game_handler.cpp | 2 +- src/ui/game_screen.cpp | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/game/spell_defines.hpp b/include/game/spell_defines.hpp index dd563f9b..3d1e871f 100644 --- a/include/game/spell_defines.hpp +++ b/include/game/spell_defines.hpp @@ -51,7 +51,7 @@ struct CombatTextEntry { enum Type : uint8_t { MELEE_DAMAGE, SPELL_DAMAGE, HEAL, MISS, DODGE, PARRY, BLOCK, CRIT_DAMAGE, CRIT_HEAL, PERIODIC_DAMAGE, PERIODIC_HEAL, ENVIRONMENTAL, - ENERGIZE + ENERGIZE, XP_GAIN }; Type type; int32_t amount = 0; diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 29b5e0ba..3ba9d106 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -14461,7 +14461,7 @@ void GameHandler::handleXpGain(network::Packet& packet) { // Server already updates PLAYER_XP via update fields, // but we can show combat text for XP gains - addCombatText(CombatTextEntry::HEAL, static_cast(data.totalXp), 0, true); + addCombatText(CombatTextEntry::XP_GAIN, static_cast(data.totalXp), 0, true); std::string msg = "You gain " + std::to_string(data.totalXp) + " experience."; if (data.groupBonus > 0) { diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 2bbee10b..2959f6a2 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -4519,6 +4519,10 @@ void GameScreen::renderCombatText(game::GameHandler& gameHandler) { snprintf(text, sizeof(text), "+%d", entry.amount); color = ImVec4(0.3f, 0.6f, 1.0f, alpha); // Blue for mana/energy break; + case game::CombatTextEntry::XP_GAIN: + snprintf(text, sizeof(text), "+%d XP", entry.amount); + color = ImVec4(0.7f, 0.3f, 1.0f, alpha); // Purple for XP + break; default: snprintf(text, sizeof(text), "%d", entry.amount); color = ImVec4(1.0f, 1.0f, 1.0f, alpha);