From b9d571e14bc0238eb02e6792bd28f01fd88ac6d3 Mon Sep 17 00:00:00 2001 From: James R Date: Sat, 23 Dec 2023 13:07:36 -0800 Subject: [PATCH] Sound options: disable and hide Z button during Goner, until profile is set --- src/menus/options-sound.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/menus/options-sound.cpp b/src/menus/options-sound.cpp index 60c52bd91..63528fab9 100644 --- a/src/menus/options-sound.cpp +++ b/src/menus/options-sound.cpp @@ -6,8 +6,10 @@ #include "../v_draw.hpp" +#include "../doomstat.h" #include "../console.h" #include "../k_menu.h" +#include "../m_cond.h" #include "../s_sound.h" // sounds consvars #include "../g_game.h" // cv_chatnotifications @@ -18,6 +20,12 @@ using srb2::Draw; namespace { +bool basic_options() +{ + // M_GameTrulyStarted + return gamedata && gamestartchallenge < MAXUNLOCKABLES && !netgame && gamedata->gonerlevel <= GDGONER_PROFILE; +} + int flip_delay = 0; struct Slider @@ -51,7 +59,10 @@ struct Slider arrows.x(-10 - ofs).text("\x1C"); arrows.x(kWidth + 2 + ofs).text("\x1D"); - h.xy(kWidth + 9, -3).small_button(Draw::Button::z, false); + if (!basic_options()) + { + h.xy(kWidth + 9, -3).small_button(Draw::Button::z, false); + } } h = h.y(1); @@ -197,7 +208,7 @@ boolean input_routine(INT32) const menuitem_t& it = currentMenu->menuitems[itemOn]; - if (M_MenuButtonPressed(pid, MBT_Z) && (it.status & IT_TYPE) == IT_ARROWS) + if (M_MenuButtonPressed(pid, MBT_Z) && (it.status & IT_TYPE) == IT_ARROWS && !basic_options()) { sliders.at(it.mvar2).toggle_(true); return true;