fix: apply skull-red color and "Lv ??" to level-0 mobs in focus frame
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run

Consistent with the target frame fix: focus targets with level 0
(unknown/?? mobs) now show skull-red instead of grey, and display
"Lv ??" instead of "Lv 0".
This commit is contained in:
Kelsi 2026-03-17 14:18:49 -07:00
parent 39f4162ec1
commit 5513c4aad5

View file

@ -4344,6 +4344,9 @@ void GameScreen::renderFocusFrame(game::GameHandler& gameHandler) {
} else if (u->isHostile()) { } else if (u->isHostile()) {
uint32_t playerLv = gameHandler.getPlayerLevel(); uint32_t playerLv = gameHandler.getPlayerLevel();
uint32_t mobLv = u->getLevel(); uint32_t mobLv = u->getLevel();
if (mobLv == 0) {
focusColor = ImVec4(1.0f, 0.1f, 0.1f, 1.0f); // ?? level = skull red
} else {
int32_t diff = static_cast<int32_t>(mobLv) - static_cast<int32_t>(playerLv); int32_t diff = static_cast<int32_t>(mobLv) - static_cast<int32_t>(playerLv);
if (game::GameHandler::killXp(playerLv, mobLv) == 0) if (game::GameHandler::killXp(playerLv, mobLv) == 0)
focusColor = ImVec4(0.6f, 0.6f, 0.6f, 1.0f); focusColor = ImVec4(0.6f, 0.6f, 0.6f, 1.0f);
@ -4355,6 +4358,7 @@ void GameScreen::renderFocusFrame(game::GameHandler& gameHandler) {
focusColor = ImVec4(1.0f, 1.0f, 0.1f, 1.0f); focusColor = ImVec4(1.0f, 1.0f, 0.1f, 1.0f);
else else
focusColor = ImVec4(0.3f, 1.0f, 0.3f, 1.0f); focusColor = ImVec4(0.3f, 1.0f, 0.3f, 1.0f);
}
} else { } else {
focusColor = ImVec4(0.3f, 1.0f, 0.3f, 1.0f); focusColor = ImVec4(0.3f, 1.0f, 0.3f, 1.0f);
} }
@ -4487,6 +4491,9 @@ void GameScreen::renderFocusFrame(game::GameHandler& gameHandler) {
// Level + health on same row // Level + health on same row
ImGui::SameLine(); ImGui::SameLine();
if (unit->getLevel() == 0)
ImGui::TextDisabled("Lv ??");
else
ImGui::TextDisabled("Lv %u", unit->getLevel()); ImGui::TextDisabled("Lv %u", unit->getLevel());
uint32_t hp = unit->getHealth(); uint32_t hp = unit->getHealth();