2 * nazghul - an old-school RPG engine
3 * Copyright (C) 2008 Gordon McNutt
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the Free
7 * Software Foundation; either version 2 of the License, or (at your option)
10 * This program is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * You should have received a copy of the GNU General Public License along with
16 * this program; if not, write to the Free Foundation, Inc., 59 Temple Place,
17 * Suite 330, Boston, MA 02111-1307 USA
20 * gmcnutt@users.sourceforge.net
30 static struct KeyHandler esc_key_hndlr;
32 static void esc_help(void)
34 log_begin("F)ollow mode\n");
35 log_continue("Q)uit\n");
36 log_continue("[1-9] Solo mode\n");
37 log_continue("CTRL-R)eload\n");
38 log_continue("CTRL-S)ave\n");
39 log_end("ESC to continue game\n");
42 static int esc_menu_key_fx(struct KeyHandler *kh, int key, int keymod)
46 cmdToggleFollowMode();
60 cmdSetSoloMode(key - SDLK_1);
78 //log_msg("Sorry, %d is not a valid command.");
84 static int esc_key_fx(struct KeyHandler *esckh, int key, int keymod)
88 if (SDLK_ESCAPE != key) {
92 log_banner("ESC mode - press '?' for help");
94 kh.fx = esc_menu_key_fx;
95 eventPushKeyHandler(&kh);
101 void escape_start_handler(void)
103 esc_key_hndlr.fx = esc_key_fx;
104 eventPushKeyHandler(&esc_key_hndlr);
107 void escape_stop_handler(void)
109 eventPopKeyHandler();