mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-27 01:00:13 +00:00
feat: add distance indicator to focus frame for range awareness
This commit is contained in:
parent
b44ff09b63
commit
6d21a8cb8d
1 changed files with 10 additions and 0 deletions
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue