Let Lua toggle the crosshair

This commit is contained in:
LJ Sonic 2020-12-29 21:36:15 +01:00
parent 0d1050f360
commit 0de3a64b59
3 changed files with 13 additions and 8 deletions

View File

@ -2109,15 +2109,18 @@ void HU_Drawer(void)
return;
// draw the crosshair, not when viewing demos nor with chasecam
if (!automapactive && cv_crosshair.value && !demoplayback &&
(!camera.chase || ticcmd_ztargetfocus[0])
&& !players[displayplayer].spectator)
HU_DrawCrosshair();
if (LUA_HudEnabled(hud_crosshair))
{
if (!automapactive && cv_crosshair.value && !demoplayback &&
(!camera.chase || ticcmd_ztargetfocus[0])
&& !players[displayplayer].spectator)
HU_DrawCrosshair();
if (!automapactive && cv_crosshair2.value && !demoplayback &&
(!camera2.chase || ticcmd_ztargetfocus[1])
&& !players[secondarydisplayplayer].spectator)
HU_DrawCrosshair2();
if (!automapactive && cv_crosshair2.value && !demoplayback &&
(!camera2.chase || ticcmd_ztargetfocus[1])
&& !players[secondarydisplayplayer].spectator)
HU_DrawCrosshair2();
}
// draw desynch text
if (hu_redownloadinggamestate)

View File

@ -13,6 +13,7 @@
enum hud {
hud_stagetitle = 0,
hud_textspectator,
hud_crosshair,
// Singleplayer / Co-op
hud_score,
hud_time,

View File

@ -39,6 +39,7 @@ static UINT8 hudAvailable; // hud hooks field
static const char *const hud_disable_options[] = {
"stagetitle",
"textspectator",
"crosshair",
"score",
"time",