mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-02 15:53:51 +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
|
// Clicking the focus frame targets it
|
||||||
if (ImGui::IsWindowHovered() && ImGui::IsMouseClicked(0)) {
|
if (ImGui::IsWindowHovered() && ImGui::IsMouseClicked(0)) {
|
||||||
gameHandler.setTarget(focus->getGuid());
|
gameHandler.setTarget(focus->getGuid());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue