Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add origins to bxt_hud_tas_editor_status #350

Merged
merged 2 commits into from
Oct 14, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions BunnymodXT/hud_custom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ namespace CustomHud

float vel;
float zvel;
float xpos;
float ypos;
float zpos;
float realyaw;
float health;
Expand Down Expand Up @@ -544,9 +546,18 @@ namespace CustomHud
}
else
{
out << "X: " << player.origin[0] << "\n"
<< "Y: " << player.origin[1] << "\n"
<< "Z: " << player.origin[2];
if (frame_bulk_selected)
{
out << "X: " << frame_bulk_status.xpos << "\n"
<< "Y: " << frame_bulk_status.ypos << "\n"
<< "Z: " << frame_bulk_status.zpos;
}
else
{
out << "X: " << player.origin[0] << "\n"
<< "Y: " << player.origin[1] << "\n"
<< "Z: " << player.origin[2];
}
}

DrawMultilineString(x, y, out.str());
Expand Down Expand Up @@ -1321,7 +1332,6 @@ namespace CustomHud

out << "Vel: " << frame_bulk_status.vel << '\n';
out << "Z Vel: " << frame_bulk_status.zvel << '\n';
out << "Z Pos: " << frame_bulk_status.zpos << '\n';

out << "Health: " << frame_bulk_status.health << '\n';
out << "Armor: " << frame_bulk_status.armor << '\n';
Expand Down Expand Up @@ -1746,13 +1756,15 @@ namespace CustomHud
return si;
}

void UpdateTASEditorStatus(const HLTAS::Frame& frame_bulk, const float& player_vel, const float& player_zvel, const float& player_zpos, const float& player_realyaw, const float& player_health, const float& player_armor, const float& player_stamina)
void UpdateTASEditorStatus(const HLTAS::Frame& frame_bulk, const float& player_vel, const float& player_zvel, const float& player_xpos, const float& player_ypos, const float& player_zpos, const float& player_realyaw, const float& player_health, const float& player_armor, const float& player_stamina)
{
frame_bulk_selected = true;
frame_bulk_status = FrameBulkStatus{};

frame_bulk_status.vel = player_vel;
frame_bulk_status.zvel = player_zvel;
frame_bulk_status.xpos = player_xpos;
frame_bulk_status.ypos = player_ypos;
frame_bulk_status.zpos = player_zpos;
frame_bulk_status.realyaw = player_realyaw;

Expand Down
2 changes: 1 addition & 1 deletion BunnymodXT/hud_custom.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ namespace CustomHud

const SCREENINFO& GetScreenInfo();

void UpdateTASEditorStatus(const HLTAS::Frame& frame_bulk, const float& player_vel, const float& player_zvel, const float& player_zpos, const float& player_realyaw, const float& player_health, const float& player_armor, const float& player_stamina);
void UpdateTASEditorStatus(const HLTAS::Frame& frame_bulk, const float& player_vel, const float& player_zvel, const float& player_xpos, const float& player_ypos, const float& player_zpos, const float& player_realyaw, const float& player_health, const float& player_armor, const float& player_stamina);
};
6 changes: 5 additions & 1 deletion BunnymodXT/triangle_drawing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1678,6 +1678,8 @@ namespace TriangleDrawing

float current_player_vel = 0;
float current_player_zvel = 0;
float current_player_xpos = 0;
float current_player_ypos = 0;
float current_player_zpos = 0;
float current_player_realyaw = 0;

Expand All @@ -1692,6 +1694,8 @@ namespace TriangleDrawing

current_player_vel = std::hypotf(current_player_vels[0], current_player_vels[1]);
current_player_zvel = current_player_vels[2];
current_player_xpos = current_player_data.Origin[0];
current_player_ypos = current_player_data.Origin[1];
current_player_zpos = current_player_data.Origin[2];
current_player_realyaw = current_player_data.Viewangles[1];

Expand All @@ -1704,7 +1708,7 @@ namespace TriangleDrawing
// Update the HUD status before any changes, since that's the state that was visualized earlier.
CustomHud::UpdateTASEditorStatus(
frame_bulk,
current_player_vel, current_player_zvel, current_player_zpos,
current_player_vel, current_player_zvel, current_player_xpos, current_player_ypos, current_player_zpos,
current_player_realyaw,
current_player_health, current_player_armor, current_player_stamina);

Expand Down