Hide drawing the console until explicitly told to

This commit is contained in:
Ian 2023-10-25 10:23:21 -04:00
parent e53e0d48aa
commit 80fd4b1cd9
4 changed files with 14 additions and 1 deletions

View file

@ -64,6 +64,7 @@ int con_notifylines; // scan lines to clear for notify lines
extern void M_Menu_Main_f (void);
extern qboolean console_enabled;
/*
================
Con_ToggleConsole_f
@ -76,11 +77,13 @@ void Con_ToggleConsole_f (void)
if (cls.state == ca_connected)
{
key_dest = key_game;
console_enabled = false;
key_lines[edit_line][1] = 0; // clear any typing
key_linepos = 1;
}
else
{
console_enabled = false;
M_Menu_Main_f ();
}
}
@ -577,6 +580,7 @@ Draws the console with the solid background
The typing input line at the bottom should only be drawn if typing is allowed
================
*/
qboolean console_enabled;
void Con_DrawConsole (int lines, qboolean drawinput)
{
int i, x, y;
@ -589,6 +593,8 @@ void Con_DrawConsole (int lines, qboolean drawinput)
// draw the background
Draw_ConsoleBackground (lines);
if (!console_enabled && !developer.value)
return;
// draw the text
con_vislines = lines;

View file

@ -120,6 +120,8 @@ void IN_Move (usercmd_t *cmd)
if (!new3ds_flag)
speed -= 2;
else
speed += 8;
// cut look speed in half when facing enemy, unless mag is empty
if ((in_aimassist.value) && (sv_player->v.facingenemy == 1) && cl.stats[STAT_CURRENTMAG] > 0) {

View file

@ -204,6 +204,7 @@ Key_Console
Interactive line editing and console scrollback
====================
*/
extern qboolean console_enabled;
void Key_Console (int key)
{
char *cmd;
@ -311,6 +312,7 @@ void Key_Console (int key)
if (key == K_END)
{
console_enabled = false;
con_backscroll = 0;
return;
}
@ -353,6 +355,7 @@ void Key_Message (int key)
if (key == K_ESCAPE)
{
console_enabled = false;
key_dest = key_game;
chat_bufferlen = 0;
chat_buffer[0] = 0;
@ -800,6 +803,7 @@ void Key_Event (int key, qboolean down)
break;
case key_game:
case key_console:
console_enabled = false;
M_ToggleMenu_f ();
break;
default:

View file

@ -1410,7 +1410,7 @@ void M_Options_Draw (void)
M_DrawCharacter (200, 32 + options_cursor*8, 12+((int)(realtime*4)&1));
}
extern qboolean console_enabled;
void M_Options_Key (int k)
{
switch (k)
@ -1424,6 +1424,7 @@ void M_Options_Key (int k)
M_Menu_Keys_f ();
break;
case 1:
console_enabled = true;
m_state = m_none;
Con_ToggleConsole_f ();
break;