From eaf60b4f797504500463601457f72beb5bbb81ba Mon Sep 17 00:00:00 2001 From: Kelsi Date: Thu, 12 Mar 2026 08:50:14 -0700 Subject: [PATCH] feat: apply class color to target-of-target frame player names --- src/ui/game_screen.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 1954f1ab..259b10ad 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -3424,8 +3424,14 @@ void GameScreen::renderTargetFrame(game::GameHandler& gameHandler) { ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoScrollbar)) { std::string totName = getEntityName(totEntity); + // Class color for players; gray for NPCs + ImVec4 totNameColor = ImVec4(0.8f, 0.8f, 0.8f, 1.0f); + if (totEntity->getType() == game::ObjectType::PLAYER) { + uint8_t cid = entityClassId(totEntity.get()); + if (cid != 0) totNameColor = classColorVec4(cid); + } // Selectable so we can attach a right-click context menu - ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.8f, 0.8f, 0.8f, 1.0f)); + ImGui::PushStyleColor(ImGuiCol_Text, totNameColor); ImGui::PushStyleColor(ImGuiCol_Header, ImVec4(0,0,0,0)); ImGui::PushStyleColor(ImGuiCol_HeaderHovered, ImVec4(1,1,1,0.08f)); ImGui::PushStyleColor(ImGuiCol_HeaderActive, ImVec4(1,1,1,0.12f));