From 8c3060f2614f45de5f70a82ac05f742b50ce5ebd Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 17 Mar 2026 12:17:23 -0700 Subject: [PATCH] feat: show XP percentage in experience bar tooltip The XP bar tooltip now displays current progress as a percentage (e.g., "Current: 45000 / 100000 XP (45.0%)"), making it easier to gauge leveling progress at a glance. --- src/ui/game_screen.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index d5e5a320..81b7af77 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -7694,7 +7694,8 @@ void GameScreen::renderXpBar(game::GameHandler& gameHandler) { uint32_t xpToLevel = (currentXp < nextLevelXp) ? (nextLevelXp - currentXp) : 0; ImGui::TextColored(ImVec4(0.9f, 0.85f, 1.0f, 1.0f), "Experience"); ImGui::Separator(); - ImGui::Text("Current: %u / %u XP", currentXp, nextLevelXp); + float xpPct = nextLevelXp > 0 ? (100.0f * currentXp / nextLevelXp) : 0.0f; + ImGui::Text("Current: %u / %u XP (%.1f%%)", currentXp, nextLevelXp, xpPct); ImGui::Text("To next level: %u XP", xpToLevel); if (restedXp > 0) { float restedLevels = static_cast(restedXp) / static_cast(nextLevelXp);