]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - console.c
vid: implement monitor selection with instant cvar changes
[xonotic/darkplaces.git] / console.c
index cd596418592a0b00fef50a234173c7b65a1bc8b5..58409bef3164a3b9e012ea42b43a04ae8b5ae51d 100644 (file)
--- a/console.c
+++ b/console.c
@@ -711,16 +711,12 @@ void Con_ClearNotify (void)
                        CON_LINES(i).mask |= CON_MASK_HIDENOTIFY;
 }
 
-
-/*
-================
-Con_MessageMode_f
-================
-*/
-static void Con_MessageMode_f(cmd_state_t *cmd)
+static void Con_MsgCmdMode(cmd_state_t *cmd, signed char mode)
 {
+       if (cls.demoplayback && mode >= 0)
+               return;
        key_dest = key_message;
-       chat_mode = 0; // "say"
+       chat_mode = mode;
        if(Cmd_Argc(cmd) > 1)
        {
                dpsnprintf(chat_buffer, sizeof(chat_buffer), "%s ", Cmd_Args(cmd));
@@ -728,21 +724,28 @@ static void Con_MessageMode_f(cmd_state_t *cmd)
        }
 }
 
+/*
+================
+Con_MessageMode_f
+
+"say"
+================
+*/
+static void Con_MessageMode_f(cmd_state_t *cmd)
+{
+       Con_MsgCmdMode(cmd, 0);
+}
 
 /*
 ================
 Con_MessageMode2_f
+
+"say_team"
 ================
 */
 static void Con_MessageMode2_f(cmd_state_t *cmd)
 {
-       key_dest = key_message;
-       chat_mode = 1; // "say_team"
-       if(Cmd_Argc(cmd) > 1)
-       {
-               dpsnprintf(chat_buffer, sizeof(chat_buffer), "%s ", Cmd_Args(cmd));
-               chat_bufferpos = (unsigned int)strlen(chat_buffer);
-       }
+       Con_MsgCmdMode(cmd, 1);
 }
 
 /*
@@ -752,13 +755,7 @@ Con_CommandMode_f
 */
 static void Con_CommandMode_f(cmd_state_t *cmd)
 {
-       key_dest = key_message;
-       if(Cmd_Argc(cmd) > 1)
-       {
-               dpsnprintf(chat_buffer, sizeof(chat_buffer), "%s ", Cmd_Args(cmd));
-               chat_bufferpos = (unsigned int)strlen(chat_buffer);
-       }
-       chat_mode = -1; // command
+       Con_MsgCmdMode(cmd, -1);
 }
 
 /*
@@ -942,7 +939,8 @@ void Con_Shutdown (void)
        if (con_mutex) Thread_LockMutex(con_mutex);
        ConBuffer_Shutdown(&con);
        if (con_mutex) Thread_UnlockMutex(con_mutex);
-       if (con_mutex) Thread_DestroyMutex(con_mutex);con_mutex = NULL;
+       if (con_mutex) Thread_DestroyMutex(con_mutex);
+       con_mutex = NULL;
 }
 
 /*