mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-03 06:20:57 +00:00
Enable messages and says to be 256 chars long, with a scrolling input line across top of screen. Allow tab button in demos.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@237 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
2e871b3f03
commit
e9192f232a
3 changed files with 36 additions and 23 deletions
|
@ -1077,27 +1077,36 @@ void Con_DrawNotify (void)
|
||||||
|
|
||||||
if (key_dest == key_message)
|
if (key_dest == key_message)
|
||||||
{
|
{
|
||||||
char *say_prompt; //johnfitz
|
// modified by S.A to support longer lines
|
||||||
|
|
||||||
|
char c[MAXCMDLINE+1], *say_prompt; // extra space == +1
|
||||||
|
int say_length, len;
|
||||||
|
|
||||||
clearnotify = 0;
|
clearnotify = 0;
|
||||||
|
|
||||||
x = 0;
|
x = 0;
|
||||||
|
|
||||||
//johnfitz -- distinguish say and say_team
|
|
||||||
if (team_message)
|
if (team_message)
|
||||||
say_prompt = "say_team:";
|
say_prompt = "say_team:";
|
||||||
else
|
else
|
||||||
say_prompt = "say:";
|
say_prompt = "say:";
|
||||||
//johnfitz
|
|
||||||
|
say_length = strlen(say_prompt);
|
||||||
|
|
||||||
Draw_String (8, v, say_prompt); //johnfitz
|
Draw_String (8, v, say_prompt); //johnfitz
|
||||||
|
|
||||||
while(chat_buffer[x])
|
text = strcpy(c, chat_buffer);
|
||||||
|
len = strlen(chat_buffer);
|
||||||
|
text[len] = ' ';
|
||||||
|
text[len+1] = 0;
|
||||||
|
if (len >= con_linewidth - say_length)
|
||||||
|
text += 1 + len + say_length - con_linewidth;
|
||||||
|
|
||||||
|
while(*text)
|
||||||
{
|
{
|
||||||
Draw_Character ( (x+strlen(say_prompt)+2)<<3, v, chat_buffer[x]); //johnfitz
|
Draw_Character ( (x+say_length+2)<<3, v, *text); //johnfitz
|
||||||
x++;
|
x++; text++;
|
||||||
}
|
}
|
||||||
Draw_Character ( (x+strlen(say_prompt)+2)<<3, v, 10+((int)(realtime*con_cursorspeed)&1)); //johnfitz
|
Draw_Character ( (x+say_length+1)<<3, v, 10+((int)(realtime*con_cursorspeed)&1));
|
||||||
v += 8;
|
v += 8;
|
||||||
|
|
||||||
scr_tileclear_updates = 0; //johnfitz
|
scr_tileclear_updates = 0; //johnfitz
|
||||||
|
@ -1117,7 +1126,7 @@ void Con_DrawInput (void)
|
||||||
extern double key_blinktime;
|
extern double key_blinktime;
|
||||||
extern int key_insert;
|
extern int key_insert;
|
||||||
int i, len;
|
int i, len;
|
||||||
char c[256], *text;
|
char c[MAXCMDLINE], *text;
|
||||||
|
|
||||||
if (key_dest != key_console && !con_forcedup)
|
if (key_dest != key_console && !con_forcedup)
|
||||||
return; // don't draw anything
|
return; // don't draw anything
|
||||||
|
|
|
@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define MAXCMDLINE 256
|
||||||
|
|
||||||
#include "arch_def.h"
|
#include "arch_def.h"
|
||||||
#include "net_sys.h" /* for net_defs.h */
|
#include "net_sys.h" /* for net_defs.h */
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
@ -1279,7 +1281,7 @@ void Host_Say(qboolean teamonly)
|
||||||
int j;
|
int j;
|
||||||
char *p;
|
char *p;
|
||||||
// removed unsigned keyword -- kristian
|
// removed unsigned keyword -- kristian
|
||||||
char text[64];
|
char text[MAXCMDLINE];
|
||||||
qboolean fromServer = false;
|
qboolean fromServer = false;
|
||||||
|
|
||||||
if (cmd_source == src_command)
|
if (cmd_source == src_command)
|
||||||
|
@ -1355,7 +1357,7 @@ void Host_Tell_f(void)
|
||||||
client_t *save;
|
client_t *save;
|
||||||
int j;
|
int j;
|
||||||
char *p;
|
char *p;
|
||||||
char text[64];
|
char text[MAXCMDLINE];
|
||||||
|
|
||||||
if (cmd_source == src_command)
|
if (cmd_source == src_command)
|
||||||
{
|
{
|
||||||
|
|
12
Quake/keys.c
12
Quake/keys.c
|
@ -267,14 +267,16 @@ void Key_Console (int key)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case K_PGUP:
|
case K_PGUP:
|
||||||
//case K_MWHEELUP:
|
// Mouse events never reach the console, especially in windowed mode
|
||||||
|
// when mouse is released to the window manager
|
||||||
|
// case K_MWHEELUP:
|
||||||
con_backscroll += keydown[K_CTRL] ? ((con_vislines>>3) - 4) : 2;
|
con_backscroll += keydown[K_CTRL] ? ((con_vislines>>3) - 4) : 2;
|
||||||
if (con_backscroll > con_totallines - (vid.height>>3) - 1)
|
if (con_backscroll > con_totallines - (vid.height>>3) - 1)
|
||||||
con_backscroll = con_totallines - (vid.height>>3) - 1;
|
con_backscroll = con_totallines - (vid.height>>3) - 1;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case K_PGDN:
|
case K_PGDN:
|
||||||
//case K_MWHEELDOWN:
|
// case K_MWHEELDOWN:
|
||||||
con_backscroll -= keydown[K_CTRL] ? ((con_vislines>>3) - 4) : 2;
|
con_backscroll -= keydown[K_CTRL] ? ((con_vislines>>3) - 4) : 2;
|
||||||
if (con_backscroll < 0)
|
if (con_backscroll < 0)
|
||||||
con_backscroll = 0;
|
con_backscroll = 0;
|
||||||
|
@ -428,7 +430,7 @@ void Key_Console (int key)
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
char chat_buffer[32];
|
char chat_buffer[MAXCMDLINE];
|
||||||
qboolean team_message = false;
|
qboolean team_message = false;
|
||||||
|
|
||||||
void Key_Message (int key)
|
void Key_Message (int key)
|
||||||
|
@ -471,7 +473,7 @@ void Key_Message (int key)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chat_bufferlen == 31)
|
if (chat_bufferlen == sizeof(chat_buffer)-1)
|
||||||
return; // all full
|
return; // all full
|
||||||
|
|
||||||
chat_buffer[chat_bufferlen++] = key;
|
chat_buffer[chat_bufferlen++] = key;
|
||||||
|
@ -941,7 +943,7 @@ void Key_Event (int key, qboolean down)
|
||||||
//
|
//
|
||||||
// during demo playback, most keys bring up the main menu
|
// during demo playback, most keys bring up the main menu
|
||||||
//
|
//
|
||||||
if (cls.demoplayback && down && consolekeys[key] && key_dest == key_game)
|
if (cls.demoplayback && down && consolekeys[key] && key_dest == key_game && key != K_TAB)
|
||||||
{
|
{
|
||||||
M_ToggleMenu_f ();
|
M_ToggleMenu_f ();
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue