Show corpse distance on reclaim corpse button

When the player is a ghost, the 'Resurrect from Corpse' popup now shows how many yards away the corpse is, updating in real-time as the ghost moves. Distance is only shown when the corpse is on the same map.
This commit is contained in:
Kelsi 2026-03-11 22:41:26 -07:00
parent 355001c236
commit b2d1edc9db
2 changed files with 16 additions and 0 deletions

View file

@ -8942,6 +8942,14 @@ void GameScreen::renderReclaimCorpseButton(game::GameHandler& gameHandler) {
gameHandler.reclaimCorpse();
}
ImGui::PopStyleColor(2);
float corpDist = gameHandler.getCorpseDistance();
if (corpDist >= 0.0f) {
char distBuf[48];
snprintf(distBuf, sizeof(distBuf), "Corpse: %.0f yards away", corpDist);
float dw = ImGui::CalcTextSize(distBuf).x;
ImGui::SetCursorPosX((btnW + 16.0f - dw) * 0.5f);
ImGui::TextDisabled("%s", distBuf);
}
}
ImGui::End();
ImGui::PopStyleColor();