Fixed vid_pauseonfocuslost, final.

This commit is contained in:
Rykita 2023-05-25 23:51:58 +02:00
parent 25333274c3
commit cd351a0602
2 changed files with 14 additions and 11 deletions

View file

@ -693,7 +693,7 @@ IN_Update(void)
{
S_Activate(false);
if (windowed_pauseonfocuslost->value != 2)
if (windowed_pauseonfocuslost->value != 1)
{
Cvar_SetValue("paused", 1);
}
@ -710,7 +710,7 @@ IN_Update(void)
{
S_Activate(true);
if (windowed_pauseonfocuslost->value == 0)
if (windowed_pauseonfocuslost->value == 2)
{
Cvar_SetValue("paused", 0);
}
@ -744,12 +744,6 @@ IN_Update(void)
{
Cbuf_AddText("ogg toggle\n");
}
}
else if (event.window.event == SDL_WINDOWEVENT_MINIMIZED ||
event.window.event == SDL_WINDOWEVENT_HIDDEN)
{
Cvar_SetValue("paused", 1);
}
break;
@ -2336,7 +2330,7 @@ IN_Init(void)
gyro_active = true;
}
windowed_pauseonfocuslost = Cvar_Get("w_pauseonfocuslost", "0", CVAR_USERINFO | CVAR_ARCHIVE);
windowed_pauseonfocuslost = Cvar_Get("vid_pauseonfocuslost", "0", CVAR_USERINFO | CVAR_ARCHIVE);
windowed_mouse = Cvar_Get("windowed_mouse", "1", CVAR_USERINFO | CVAR_ARCHIVE);
Cmd_AddCommand("+mlook", IN_MLookDown);

View file

@ -2164,7 +2164,7 @@ CrosshairFunc(void *unused)
static void
PauseFocusFunc()
{
Cvar_SetValue("w_pauseonfocuslost", (float)s_options_pauseonfocus_box.curvalue);
Cvar_SetValue("vid_pauseonfocuslost", (float)s_options_pauseonfocus_box.curvalue);
}
static void
@ -2202,6 +2202,7 @@ ControlsSetMenuItemValues(void)
s_options_lookstrafe_box.curvalue = (lookstrafe->value != 0);
s_options_freelook_box.curvalue = (freelook->value != 0);
s_options_crosshair_box.curvalue = ClampCvar(0, 3, crosshair->value);
s_options_pauseonfocus_box.curvalue = ClampCvar(0, 2, Cvar_VariableValue("vid_pauseonfocuslost"));
}
static void
@ -2341,6 +2342,14 @@ Options_MenuInit(void)
0
};
static const char* pause_names[] =
{
"yes",
"no",
"unpause on re-focus",
0
};
static const char *crosshair_names[] =
{
"none",
@ -2444,7 +2453,7 @@ Options_MenuInit(void)
s_options_pauseonfocus_box.generic.y = (y += 10);
s_options_pauseonfocus_box.generic.name = "pause on minimized";
s_options_pauseonfocus_box.generic.callback = PauseFocusFunc;
s_options_pauseonfocus_box.itemnames = yesno_names;
s_options_pauseonfocus_box.itemnames = pause_names;
y += 10;
if (show_gamepad)