Skip to content

Commit

Permalink
feat: add hud angles modes
Browse files Browse the repository at this point in the history
  • Loading branch information
0atsy committed Jan 15, 2025
1 parent f7e68b2 commit f112cb7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/cvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
|sar_give_fly|cmd|sar_give_fly [n] - gives the player in slot n (0 by default) preserved crouchfly.|
|sar_groundframes_reset|cmd|sar_groundframes_reset - reset recorded groundframe statistics.|
|sar_groundframes_total|cmd|sar_groundframes_total [slot] - output a summary of groundframe counts for the given player slot.|
|sar_hud_angles|0|Draws absolute view angles of the client.<br>0 = Default,<br>1 = XY,<br>2 = XYZ.|
|sar_hud_angles|0|Draws absolute view angles of the client.<br>0 = Default,<br>1 = XY,<br>2 = XYZ,<br>3 = X,<br>4 = Y.|
|sar_hud_avg|0|Draws calculated average of timer.|
|sar_hud_bg|0|Enable the SAR HUD background.|
|sar_hud_cps|0|Draws latest checkpoint of timer.|
Expand Down
12 changes: 9 additions & 3 deletions src/Features/Hud/Hud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,11 +638,13 @@ HUD_ELEMENT_MODE2(position, "0", 0, 2,
ctx->DrawElement("pos: -");
}
}
HUD_ELEMENT_MODE2(angles, "0", 0, 2,
HUD_ELEMENT_MODE2(angles, "0", 0, 4,
"Draws absolute view angles of the client.\n"
"0 = Default,\n"
"1 = XY,\n"
"2 = XYZ.\n",
"2 = XYZ,\n"
"3 = X,\n"
"4 = Y.\n",
HudType_InGame | HudType_Paused | HudType_LoadingScreen) {
// When we're orange (and not splitscreen), for some fucking reason,
// the *engine* thinks we're slot 0, but everything else thinks
Expand All @@ -651,8 +653,12 @@ HUD_ELEMENT_MODE2(angles, "0", 0, 2,
int p = getPrecision();
if (mode == 1) {
ctx->DrawElement("ang: %.*f %.*f", p, ang.x, p, ang.y);
} else {
} else if (mode == 2) {
ctx->DrawElement("ang: %.*f %.*f %.*f", p, ang.x, p, ang.y, p, ang.z);
} else if (mode == 3) {
ctx->DrawElement("ang: %.*f", p, ang.x);
} else {
ctx->DrawElement("ang: %.*f", p, ang.y);
}
}
HUD_ELEMENT_MODE2(velocity, "0", 0, 5,
Expand Down

0 comments on commit f112cb7

Please sign in to comment.