@@ -53,6 +53,7 @@ cvar_t *con_animationSpeed;
5353cvar_t *con_animationType;
5454
5555cvar_t *con_autoclear;
56+ Cvar::Cvar<bool > con_persistOnMapChange ( " con_persistOnMapChange" , " Current console input will be saved when changing map" , Cvar::NONE, false );
5657
5758/* *
5859 * 0: no scroll lock at all, scroll down on any message arriving
@@ -97,11 +98,13 @@ Con_ToggleConsole_f
9798void Con_ToggleConsole_f ()
9899{
99100 // ydnar: persistent console input is more useful
100- if ( con_autoclear->integer )
101+ if ( con_autoclear->integer && !( con_persistOnMapChange. Get () && consoleState. changedMap ) )
101102 {
102103 g_consoleField.Clear ();
103104 }
104105
106+ consoleState.changedMap = false ;
107+
105108 g_consoleField.SetWidth (g_console_field_width);
106109
107110 if (consoleState.isOpened ) {
@@ -413,7 +416,9 @@ void Con_Init()
413416
414417 // Done defining cvars for console colors
415418
416- g_consoleField.Clear ();
419+ if ( !con_persistOnMapChange.Get () ) {
420+ g_consoleField.Clear ();
421+ }
417422 g_consoleField.SetWidth (g_console_field_width);
418423
419424 Cmd_AddCommand ( " toggleConsole" , Con_ToggleConsole_f );
@@ -1299,9 +1304,12 @@ void Con_Close()
12991304 return ;
13001305 }
13011306
1302- g_consoleField.Clear ();
1307+ if ( !con_persistOnMapChange.Get () ) {
1308+ g_consoleField.Clear ();
1309+ }
13031310 cls.keyCatchers &= ~KEYCATCH_CONSOLE;
13041311 consoleState.isOpened = false ;
1312+ consoleState.changedMap = true ;
13051313
13061314 // instant disappearance, if we need it for situations where this is not called by the user
13071315 consoleState.currentAnimationFraction = 0 ;
0 commit comments