Sound options: add restart audio button

This commit is contained in:
James R 2023-12-23 13:15:39 -08:00
parent b9d571e14b
commit f7accbb275

View file

@ -164,6 +164,11 @@ void slider_routine(INT32 c)
sliders.at(currentMenu->menuitems[itemOn].mvar2).input(c); sliders.at(currentMenu->menuitems[itemOn].mvar2).input(c);
} }
void restartaudio_routine(INT32)
{
COM_ImmedExecute("restartaudio");
}
void draw_routine() void draw_routine()
{ {
int x = currentMenu->x - (menutransition.tics * 48); int x = currentMenu->x - (menutransition.tics * 48);
@ -248,6 +253,12 @@ menuitem_t OPTIONS_Sound[] =
{IT_STRING | IT_CVAR, "Hear Tabbed-out", "Keep playing game audio when the window is out of focus (FOCUS LOST).", {IT_STRING | IT_CVAR, "Hear Tabbed-out", "Keep playing game audio when the window is out of focus (FOCUS LOST).",
NULL, {.cvar = &cv_bgaudio}, 0, 0}, NULL, {.cvar = &cv_bgaudio}, 0, 0},
{IT_SPACE | IT_NOTHING, NULL, NULL,
NULL, {NULL}, 0, 0},
{IT_STRING | IT_CALL, "\x85" "Restart Audio", "Reboot the game's audio system.",
NULL, {.routine = restartaudio_routine}, 0, 0},
}; };
menu_t OPTIONS_SoundDef = { menu_t OPTIONS_SoundDef = {