introduces a new cl_unpaused_scvis cvar to unpause the cli.

This commit is contained in:
David Carlier 2023-01-07 21:10:07 +00:00
parent 6c18d819d3
commit f394209c75
4 changed files with 13 additions and 0 deletions

View File

@ -133,6 +133,9 @@ Set `0` by default.
loading. If set to `0` pause mode is never entered, this is the
Vanilla Quake II behaviour.
* **cl_unpaused_scvis**: If set to `1` (the default) the client unpause
when the screen becomes visible.
* **cl_r1q2_lightstyle**: Since the first release Yamagi Quake II used
the R1Q2 colors for the dynamic lights of rockets. Set to `0` to get
the Vanilla Quake II colors. Defaults to `1`.

View File

@ -57,6 +57,7 @@ cvar_t *cl_showclamp;
cvar_t *cl_paused;
cvar_t *cl_loadpaused;
cvar_t *cl_audiopaused;
cvar_t *cl_unpaused_scvis;
cvar_t *cl_lightlevel;
cvar_t *cl_r1q2_lightstyle;
@ -518,6 +519,7 @@ CL_InitLocal(void)
cl_paused = Cvar_Get("paused", "0", 0);
cl_loadpaused = Cvar_Get("cl_loadpaused", "1", CVAR_ARCHIVE);
cl_audiopaused = Cvar_Get("cl_audiopaused", "1", CVAR_ARCHIVE);
cl_unpaused_scvis = Cvar_Get("cl_unpaused_scvis", "1", CVAR_ARCHIVE);
gl1_stereo = Cvar_Get( "gl1_stereo", "0", CVAR_ARCHIVE );
gl1_stereo_separation = Cvar_Get( "gl1_stereo_separation", "1", CVAR_ARCHIVE );

View File

@ -306,6 +306,7 @@ extern cvar_t *cl_lightlevel;
extern cvar_t *cl_paused;
extern cvar_t *cl_loadpaused;
extern cvar_t *cl_audiopaused;
extern cvar_t *cl_unpaused_scvis;
extern cvar_t *cl_timedemo;
extern cvar_t *cl_vwep;
extern cvar_t *horplus;

View File

@ -681,6 +681,13 @@ IN_Update(void)
// be on another display now!
glimp_refreshRate = -1;
}
else if (event.window.event == SDL_WINDOWEVENT_SHOWN)
{
if (cl_unpaused_scvis->value > 0)
{
Cvar_SetValue("paused", 0);
}
}
else if (event.window.event == SDL_WINDOWEVENT_MINIMIZED ||
event.window.event == SDL_WINDOWEVENT_HIDDEN)
{