feat: add distance indicator to focus frame for range awareness

This commit is contained in:
Kelsi 2026-03-12 14:34:21 -07:00
parent b44ff09b63
commit 6d21a8cb8d

View file

@ -4305,6 +4305,16 @@ void GameScreen::renderFocusFrame(game::GameHandler& gameHandler) {
}
}
// Distance to focus target
{
const auto& mv = gameHandler.getMovementInfo();
float fdx = focus->getX() - mv.x;
float fdy = focus->getY() - mv.y;
float fdz = focus->getZ() - mv.z;
float fdist = std::sqrt(fdx * fdx + fdy * fdy + fdz * fdz);
ImGui::TextDisabled("%.1f yd", fdist);
}
// Clicking the focus frame targets it
if (ImGui::IsWindowHovered() && ImGui::IsMouseClicked(0)) {
gameHandler.setTarget(focus->getGuid());