From 7540de40272ac50383ced035fab5c70f8b177d86 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 18 May 2019 16:05:57 +0700 Subject: [PATCH] added a crosshair on/off toggle --- src/g_statusbar/shared_sbar.cpp | 8 ++++++++ wadsrc/static/menudef.txt | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/g_statusbar/shared_sbar.cpp b/src/g_statusbar/shared_sbar.cpp index 0d942f0f3..b1896bea4 100644 --- a/src/g_statusbar/shared_sbar.cpp +++ b/src/g_statusbar/shared_sbar.cpp @@ -123,6 +123,7 @@ CUSTOM_CVAR(Bool, hud_aspectscale, false, CVAR_ARCHIVE) } } +CVAR (Bool, crosshairon, true, CVAR_ARCHIVE); CVAR (Int, crosshair, 0, CVAR_ARCHIVE) CVAR (Bool, crosshairforce, false, CVAR_ARCHIVE) CVAR (Color, crosshaircolor, 0xff0000, CVAR_ARCHIVE); @@ -1029,9 +1030,16 @@ void DBaseStatusBar::DrawCrosshair () double size; int w, h; + if (!crosshairon) + { + return; + } + // Don't draw the crosshair in chasecam mode if (players[consoleplayer].cheats & CF_CHASECAM) + { return; + } ST_LoadCrosshair(); diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index f406b6960..fd599b3d5 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -1012,6 +1012,7 @@ OptionMenu "HUDOptions" protected Submenu "$HUDMNU_FLASH", "FlashOptions" Submenu "$DSPLYMNU_SCOREBOARD", "ScoreboardOptions" StaticText " " + Option "$HUDMNU_CROSSHAIRON", "crosshairon", "OnOff" Option "$HUDMNU_CROSSHAIR", "crosshair", "Crosshairs" Option "$HUDMNU_FORCECROSSHAIR", "crosshairforce", "OnOff" Option "$HUDMNU_GROWCROSSHAIR", "crosshairgrow", "OnOff" @@ -2749,4 +2750,4 @@ OptionMenu "vkoptions" Option "$VKMNU_ENABLE", "vid_enablevulkan", "OnOff" TextField "$VKMNU_DEVICE", vk_device Option "$VKMNU_HDR", "vk_hdr", "OnOff" -} \ No newline at end of file +}