@@ -53,6 +53,7 @@ cvar_t *con_animationSpeed;
53
53
cvar_t *con_animationType;
54
54
55
55
cvar_t *con_autoclear;
56
+ Cvar::Cvar<bool > con_persistOnMapChange ( " con_persistOnMapChange" , " Current console input will be saved when changing map" , Cvar::NONE, false );
56
57
57
58
/* *
58
59
* 0: no scroll lock at all, scroll down on any message arriving
@@ -97,11 +98,13 @@ Con_ToggleConsole_f
97
98
void Con_ToggleConsole_f ()
98
99
{
99
100
// ydnar: persistent console input is more useful
100
- if ( con_autoclear->integer )
101
+ if ( con_autoclear->integer && !( con_persistOnMapChange. Get () && consoleState. changedMap ) )
101
102
{
102
103
g_consoleField.Clear ();
103
104
}
104
105
106
+ consoleState.changedMap = false ;
107
+
105
108
g_consoleField.SetWidth (g_console_field_width);
106
109
107
110
if (consoleState.isOpened ) {
@@ -413,7 +416,9 @@ void Con_Init()
413
416
414
417
// Done defining cvars for console colors
415
418
416
- g_consoleField.Clear ();
419
+ if ( !con_persistOnMapChange.Get () ) {
420
+ g_consoleField.Clear ();
421
+ }
417
422
g_consoleField.SetWidth (g_console_field_width);
418
423
419
424
Cmd_AddCommand ( " toggleConsole" , Con_ToggleConsole_f );
@@ -1299,9 +1304,12 @@ void Con_Close()
1299
1304
return ;
1300
1305
}
1301
1306
1302
- g_consoleField.Clear ();
1307
+ if ( !con_persistOnMapChange.Get () ) {
1308
+ g_consoleField.Clear ();
1309
+ }
1303
1310
cls.keyCatchers &= ~KEYCATCH_CONSOLE;
1304
1311
consoleState.isOpened = false ;
1312
+ consoleState.changedMap = true ;
1305
1313
1306
1314
// instant disappearance, if we need it for situations where this is not called by the user
1307
1315
consoleState.currentAnimationFraction = 0 ;
0 commit comments