converted to scummvm console style

svn-id: r22618
This commit is contained in:
Paweł Kołodziejski 2006-05-24 21:40:24 +00:00
parent 0f5a4b304b
commit 383b598c5c
16 changed files with 307 additions and 1059 deletions

View file

@ -217,7 +217,6 @@ int main_cycle() {
game.vars[29] = mouse.y;
}
#ifdef USE_CONSOLE
if (key == KEY_PRIORITY) {
erase_both();
debug_.priority = !debug_.priority;
@ -232,7 +231,6 @@ int main_cycle() {
write_status();
key = 0;
}
#endif
/* Click-to-walk mouse interface */
if (game.player_control && v->flags & ADJ_EGO_XY) {
@ -244,55 +242,45 @@ int main_cycle() {
kascii = KEY_ASCII(key);
if (!console_keyhandler(key)) {
if (kascii)
setvar(V_key, kascii);
process_key:
switch (game.input_mode) {
case INPUT_NORMAL:
if (!handle_controller(key)) {
if (key == 0 || !game.input_enabled)
break;
handle_keys(key);
if (kascii)
setvar(V_key, kascii);
process_key:
switch (game.input_mode) {
case INPUT_NORMAL:
if (!handle_controller(key)) {
if (key == 0 || !game.input_enabled)
break;
handle_keys(key);
/* if ESC pressed, activate menu before
* accept.input from the interpreter cycle
* sets the input mode to normal again
* (closes: #540856)
*/
if (key == KEY_ESCAPE) {
key = 0;
goto process_key;
}
/* commented out to close bug #438872
* if (key) game.keypress = key;
*/
/* if ESC pressed, activate menu before
* accept.input from the interpreter cycle
* sets the input mode to normal again
* (closes: #540856)
*/
if (key == KEY_ESCAPE) {
key = 0;
goto process_key;
}
break;
case INPUT_GETSTRING:
handle_controller(key);
handle_getstring(key);
setvar(V_key, 0); /* clear ENTER key */
break;
case INPUT_MENU:
menu_keyhandler(key);
console_cycle();
return false;
case INPUT_NONE:
handle_controller(key);
if (key)
game.keypress = key;
break;
}
} else {
if (game.input_mode == INPUT_MENU) {
console_cycle();
return false;
}
}
console_cycle();
/* commented out to close bug #438872
* if (key) game.keypress = key;
*/
}
break;
case INPUT_GETSTRING:
handle_controller(key);
handle_getstring(key);
setvar(V_key, 0); /* clear ENTER key */
break;
case INPUT_MENU:
menu_keyhandler(key);
return false;
case INPUT_NONE:
handle_controller(key);
if (key)
game.keypress = key;
break;
}
if (game.msg_box_ticks > 0)
game.msg_box_ticks--;
@ -327,11 +315,6 @@ static int play_game() {
report("Running AGI script.\n");
#ifdef USE_CONSOLE
console.count = 5;
console_prompt();
#endif
setflag(F_entered_cli, false);
setflag(F_said_accepted_input, false);
game.vars[V_word_not_found] = 0;