sv_console.c:

/finally/, the input line works to my satisfaction
sv_main.c:
	call Con_ProcessInput to get the cursor in the right position on the
	screen (yeah, horrible kludge until someone figures out a nice console
	api)
This commit is contained in:
Bill Currie 2001-07-11 03:11:53 +00:00
parent 038e2c9287
commit eb66aa03ee
2 changed files with 22 additions and 20 deletions

View file

@ -259,35 +259,36 @@ Con_ProcessInput (void)
} }
break; break;
} }
curs_x = key_linepos - scroll;
if (curs_x < 1) { i = key_linepos - 1;
scroll += curs_x - 1; if (scroll > i)
curs_x = 1; scroll = i;
} else if (curs_x > screen_x - 2) { if (scroll < i - (screen_x - 2) + 1)
scroll += curs_x - (screen_x - 2); scroll = i - (screen_x - 2) + 1;
curs_x = screen_x - 2; text = key_lines[edit_line] + scroll + 1;
} if ((int)strlen (text) < screen_x - 2) {
text = key_lines[edit_line] + scroll; scroll = strlen (key_lines[edit_line] + 1) - (screen_x - 2);
if (scroll && strlen (text) < screen_x - 2) { if (scroll < 0)
scroll = strlen (key_lines[edit_line]) - (screen_x - 2); scroll = 0;
text = key_lines[edit_line] + scroll; text = key_lines[edit_line] + scroll + 1;
curs_x = key_linepos - scroll;
} }
werase (input); curs_x = key_linepos - scroll;
wmove (input, 0, 0); wmove (input, 0, 0);
i = 0;
#if 0
if (scroll) { if (scroll) {
waddch (input, '<'); waddch (input, '<');
text++; } else {
i++; waddch (input, key_lines[edit_line][0]);
} }
#endif for (i = 0; i < screen_x - 2 && *text; i++)
for (; i < screen_x - 2 && *text; i++)
waddch (input, *text++); waddch (input, *text++);
while (i++ < screen_x - 2)
waddch (input, ' ');
if (*text) { if (*text) {
waddch (input, '>'); waddch (input, '>');
} else {
waddch (input, ' ');
} }
wmove (input, 0, curs_x); wmove (input, 0, curs_x);
touchline (stdscr, screen_y - 1, 1); touchline (stdscr, screen_y - 1, 1);

View file

@ -1552,6 +1552,7 @@ SV_Frame (float time)
svs.stats.packets = 0; svs.stats.packets = 0;
svs.stats.count = 0; svs.stats.count = 0;
} }
Con_ProcessInput (); //XXX evil hack to get the cursor in the right place
} }
/* /*