mirror of
https://github.com/nzp-team/fteqw.git
synced 2025-01-18 14:31:52 +00:00
There's now a row of console names across the top of the screen.
There's also a load of new bugfixes too. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1925 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
1730d4dc81
commit
56a70d5743
5 changed files with 80 additions and 10 deletions
|
@ -109,7 +109,7 @@ void Con_ResizeCon (console_t *con);
|
|||
|
||||
qboolean Con_IsActive (console_t *con)
|
||||
{
|
||||
return (con == con_current);
|
||||
return (con == con_current) | (con->unseentext*2);
|
||||
}
|
||||
void Con_Destroy (console_t *con)
|
||||
{
|
||||
|
@ -129,8 +129,8 @@ void Con_Destroy (console_t *con)
|
|||
|
||||
BZ_Free(con);
|
||||
|
||||
if (con == con_current)
|
||||
con = &con_main;
|
||||
if (con_current == con)
|
||||
con_current = &con_main;
|
||||
}
|
||||
console_t *Con_FindConsole(char *name)
|
||||
{
|
||||
|
@ -1345,6 +1345,28 @@ void Con_DrawConsole (int lines, qboolean noback)
|
|||
|
||||
y = lines - 30;
|
||||
|
||||
if (lines == scr_conlines && con_main.next)
|
||||
{
|
||||
console_t *con = con_current;
|
||||
rows--;
|
||||
for (x = 0, con = &con_main; con; con = con->next)
|
||||
{
|
||||
if (con == &con_main)
|
||||
txt = "MAIN";
|
||||
else
|
||||
txt = con->name;
|
||||
|
||||
if (x != 0 && x+(strlen(txt)+1)*8 > curcon->linewidth*8)
|
||||
{
|
||||
x = 0;
|
||||
rows--;
|
||||
}
|
||||
Draw_FunString(x, 0, va("^&F%i%s", (con==con_current)+con->unseentext*4, txt));
|
||||
x+=(strlen(txt)+1)*8;
|
||||
}
|
||||
rows--;
|
||||
}
|
||||
|
||||
// draw from the bottom up
|
||||
if (curcon->display != curcon->current)
|
||||
{
|
||||
|
@ -1355,7 +1377,6 @@ void Con_DrawConsole (int lines, qboolean noback)
|
|||
y -= 8;
|
||||
rows--;
|
||||
}
|
||||
|
||||
|
||||
row = curcon->display;
|
||||
for (i=0 ; i<rows ; i++, y-=8, row--)
|
||||
|
|
|
@ -1310,7 +1310,7 @@ void IN_MouseEvent (int mstate)
|
|||
{
|
||||
int i;
|
||||
|
||||
if ((mouseactive || (key_dest != key_console && key_dest != key_game)) && !dinput)
|
||||
if ((mouseactive || (key_dest != key_game)) && !dinput)
|
||||
{
|
||||
// perform button actions
|
||||
for (i=0 ; i<sysmouse.numbuttons ; i++)
|
||||
|
|
|
@ -406,6 +406,37 @@ void Key_Console (int key)
|
|||
con_current->redirect(con_current, key);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((key == K_MOUSE1 || key == K_MOUSE2) && con_main.next)
|
||||
{
|
||||
extern cvar_t vid_conwidth, vid_conheight;
|
||||
extern int mousecursor_x, mousecursor_y;
|
||||
int xpos, ypos;
|
||||
xpos = (int)((mousecursor_x*vid_conwidth.value)/(vid.width*8));
|
||||
ypos = (int)((mousecursor_y*vid_conheight.value)/(vid.height*8));
|
||||
if (ypos == 0)
|
||||
{
|
||||
console_t *con;
|
||||
for (con = &con_main; con; con = con->next)
|
||||
{
|
||||
if (con == &con_main)
|
||||
xpos -= 5;
|
||||
else
|
||||
xpos -= strlen(con->name)+1;
|
||||
if (xpos == -1)
|
||||
break;
|
||||
if (xpos < 0)
|
||||
{
|
||||
if (key == K_MOUSE2)
|
||||
Con_Destroy (con);
|
||||
else
|
||||
con_current = con;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (key == K_ENTER)
|
||||
{ // backslash text are commands, else chat
|
||||
|
@ -1067,6 +1098,13 @@ void Key_Init (void)
|
|||
consolekeys['`'] = false;
|
||||
consolekeys['~'] = false;
|
||||
|
||||
for (i=K_MOUSE1 ; i<K_MOUSE10 ; i++)
|
||||
{
|
||||
consolekeys[i] = true;
|
||||
}
|
||||
consolekeys[K_MWHEELUP] = true;
|
||||
consolekeys[K_MWHEELDOWN] = true;
|
||||
|
||||
for (i=0 ; i<K_MAX ; i++)
|
||||
keyshift[i] = i;
|
||||
for (i='a' ; i<='z' ; i++)
|
||||
|
|
|
@ -127,25 +127,27 @@ void Draw_FunString(int x, int y, unsigned char *str)
|
|||
}
|
||||
else if (*str == '&') // extended code
|
||||
{
|
||||
if (isextendedcode(*str+1) && isextendedcode(*str+2))
|
||||
if (isextendedcode(str[1]) && isextendedcode(str[2]))
|
||||
{
|
||||
str++; // foreground char
|
||||
str++;// '&'
|
||||
if (*str == '-') // default for FG
|
||||
ext = (COLOR_WHITE << CON_FGSHIFT) | (ext&~CON_FGMASK);
|
||||
else if (*str >= 'A')
|
||||
ext = ((*str - ('A' - 10)) << CON_FGSHIFT) | (ext&~CON_FGMASK);
|
||||
else
|
||||
ext = ((*str - '0') << CON_FGSHIFT) | (ext&~CON_FGMASK);
|
||||
str++; // background char
|
||||
str++; // foreground char
|
||||
if (*str == '-') // default (clear) for BG
|
||||
ext &= ~CON_BGMASK & ~CON_NONCLEARBG;
|
||||
else if (*str >= 'A')
|
||||
ext = ((*str - ('A' - 10)) << CON_BGSHIFT) | (ext&~CON_BGMASK) | CON_NONCLEARBG;
|
||||
else
|
||||
ext = ((*str - '0') << CON_BGSHIFT) | (ext&~CON_BGMASK) | CON_NONCLEARBG;
|
||||
str++; // background char
|
||||
continue;
|
||||
}
|
||||
str--; // else invalid code
|
||||
// else invalid code
|
||||
goto messedup;
|
||||
}
|
||||
else if (*str == 'a')
|
||||
{
|
||||
|
@ -199,6 +201,7 @@ void Draw_FunString(int x, int y, unsigned char *str)
|
|||
x += 8;
|
||||
continue;
|
||||
}
|
||||
messedup:
|
||||
Draw_ColouredCharacter (x, y, (*str++) | ext);
|
||||
x += 8;
|
||||
}
|
||||
|
|
|
@ -1699,11 +1699,19 @@ void Plug_Close_f(void)
|
|||
|
||||
void Plug_CloseAll_f(void)
|
||||
{
|
||||
plugin_t *p;
|
||||
if (currentplug)
|
||||
Sys_Error("Plug_CloseAll_f called inside a plugin!\n");
|
||||
while(plugs)
|
||||
{
|
||||
Plug_Close(plugs);
|
||||
p = plugs;
|
||||
while (p->blockcloses)
|
||||
{
|
||||
p = p->next;
|
||||
if (!p)
|
||||
return;
|
||||
}
|
||||
Plug_Close(p);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue