X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=console.c;h=b604fe139a0a7e7952628c11314d6791c627fc69;hb=ab9e8a37699390a5dc199e4def9cdbaaa59d82cf;hp=8a3fa90f86ba00af4bf90c3e1e140e3224cb5ace;hpb=1b1a05b13477696088ac74f71a0fdb1277db4f49;p=xonotic%2Fdarkplaces.git diff --git a/console.c b/console.c index 8a3fa90f..b604fe13 100644 --- a/console.c +++ b/console.c @@ -596,6 +596,10 @@ Con_ToggleConsole_f */ void Con_ToggleConsole_f (void) { + if (COM_CheckParm ("-noconsole")) + if (!(key_consoleactive & KEY_CONSOLEACTIVE_USER)) + return; // only allow the key bind to turn off console + // toggle the 'user wants console' bit key_consoleactive ^= KEY_CONSOLEACTIVE_USER; Con_ClearNotify(); @@ -623,8 +627,11 @@ void Con_MessageMode_f (void) { key_dest = key_message; chat_mode = 0; // "say" - chat_bufferlen = 0; - chat_buffer[0] = 0; + if(Cmd_Argc() > 1) + { + dpsnprintf(chat_buffer, sizeof(chat_buffer), "%s ", Cmd_Args()); + chat_bufferlen = strlen(chat_buffer); + } } @@ -637,8 +644,11 @@ void Con_MessageMode2_f (void) { key_dest = key_message; chat_mode = 1; // "say_team" - chat_bufferlen = 0; - chat_buffer[0] = 0; + if(Cmd_Argc() > 1) + { + dpsnprintf(chat_buffer, sizeof(chat_buffer), "%s ", Cmd_Args()); + chat_bufferlen = strlen(chat_buffer); + } } /* @@ -901,7 +911,7 @@ void Con_Rcon_Redirect_Init(lhnetsocket_t *sock, lhnetaddress_t *dest, qboolean rcon_redirect_buffer[2] = 0; rcon_redirect_buffer[3] = 0; // this is a reply to a CCREQ_RCON - rcon_redirect_buffer[4] = CCREP_RCON; + rcon_redirect_buffer[4] = (char)CCREP_RCON; } else memcpy(rcon_redirect_buffer, "\377\377\377\377n", 5); // QW rcon print @@ -1050,8 +1060,6 @@ void Con_MaskPrint(int additionalmask, const char *msg) for (;*msg;msg++) { Con_Rcon_AddChar(*msg); - if (index == 0) - mask |= additionalmask; // if this is the beginning of a new line, print timestamp if (index == 0) { @@ -1096,6 +1104,8 @@ void Con_MaskPrint(int additionalmask, const char *msg) for (;*timestamp;index++, timestamp++) if (index < (int)sizeof(line) - 2) line[index] = *timestamp; + // add the mask + mask |= additionalmask; } // append the character line[index++] = *msg; @@ -1110,10 +1120,10 @@ void Con_MaskPrint(int additionalmask, const char *msg) if (con_initialized && cls.state != ca_dedicated) { Con_PrintToHistory(line, mask); - mask = 0; } // send to terminal or dedicated server window if (!sys_nostdout) + if (developer.integer || !(mask & CON_MASK_DEVELOPER)) { if(sys_specialcharactertranslation.integer) { @@ -1127,7 +1137,7 @@ void Con_MaskPrint(int additionalmask, const char *msg) { *p = qfont_table[ch - 0xE000]; if(q > p+1) - memmove(p+1, q, strlen(q)); + memmove(p+1, q, strlen(q)+1); p = p + 1; } else @@ -1310,6 +1320,7 @@ void Con_MaskPrint(int additionalmask, const char *msg) } // empty the line buffer index = 0; + mask = 0; } } } @@ -2821,11 +2832,11 @@ void Con_CompleteCommandLine (void) } else { - stringlistsort(&resultbuf); // dirbuf is already sorted + stringlistsort(&resultbuf, true); // dirbuf is already sorted Con_Printf("\n%i possible filenames\n", resultbuf.numstrings + dirbuf.numstrings); for(i = 0; i < dirbuf.numstrings; ++i) { - Con_Printf("%s/\n", dirbuf.strings[i]); + Con_Printf("^4%s^7/\n", dirbuf.strings[i]); } for(i = 0; i < resultbuf.numstrings; ++i) {