ScummVM API documentation
metaengine.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef ULTIMA4_META_ENGINE
23 #define ULTIMA4_META_ENGINE
24 
25 #include "backends/keymapper/keymapper.h"
26 
27 namespace Ultima {
28 namespace Ultima4 {
29 
30 enum KeybindingAction {
31  KEYBIND_UP, KEYBIND_DOWN, KEYBIND_LEFT, KEYBIND_RIGHT,
32  KEYBIND_ATTACK, KEYBIND_BOARD, KEYBIND_CAST, KEYBIND_CLIMB,
33  KEYBIND_DESCEND, KEYBIND_ENTER, KEYBIND_EXIT, KEYBIND_FIRE,
34  KEYBIND_GET, KEYBIND_HOLE_UP, KEYBIND_IGNITE, KEYBIND_JIMMY,
35  KEYBIND_LOCATE, KEYBIND_MIX, KEYBIND_NEW_ORDER,
36  KEYBIND_OPEN_DOOR, KEYBIND_PASS, KEYBIND_PEER,
37  KEYBIND_QUIT_SAVE, KEYBIND_READY_WEAPON, KEYBIND_SEARCH,
38  KEYBIND_STATS, KEYBIND_TALK, KEYBIND_USE, KEYBIND_WEAR,
39  KEYBIND_YELL, KEYBIND_INTERACT, KEYBIND_ESCAPE,
40 
41  KEYBIND_SPEED_UP, KEYBIND_SPEED_DOWN, KEYBIND_SPEED_NORMAL,
42  KEYBIND_COMBATSPEED_UP, KEYBIND_COMBATSPEED_DOWN,
43  KEYBIND_COMBATSPEED_NORMAL,
44 
45  KEYBIND_PARTY0, KEYBIND_PARTY1, KEYBIND_PARTY2, KEYBIND_PARTY3,
46  KEYBIND_PARTY4, KEYBIND_PARTY5, KEYBIND_PARTY6, KEYBIND_PARTY7,
47  KEYBIND_PARTY8,
48 
49  KEYBIND_CHEAT_COLLISIONS, KEYBIND_CHEAT_DESTROY,
50  KEYBIND_CHEAT_DESTROY_CREATURES, KEYBIND_CHEAT_EQUIPMENT,
51  KEYBIND_CHEAT_FLEE, KEYBIND_CHEAT_GOTO, KEYBIND_CHEAT_HELP,
52  KEYBIND_CHEAT_ITEMS, KEYBIND_CHEAT_KARMA, KEYBIND_CHEAT_LEAVE,
53  KEYBIND_CHEAT_MIXTURES, KEYBIND_CHEAT_NO_COMBAT,
54  KEYBIND_CHEAT_OVERHEAD, KEYBIND_CHEAT_PARTY, KEYBIND_CHEAT_REAGENTS,
55  KEYBIND_CHEAT_STATS, KEYBIND_CHEAT_TRANSPORT, KEYBIND_CHEAT_UP,
56  KEYBIND_CHEAT_DOWN, KEYBIND_CHEAT_VIRTUE, KEYBIND_CHEAT_WIND,
57 
58  KEYBIND_NONE
59 };
60 
61 enum KeybindingMode {
62  KBMODE_NORMAL,
63  KBMODE_MINIMAL,
64  KBMODE_DIRECTION,
65  KBMODE_MENU,
66  KBMODE_COMBAT
67 };
68 
69 class MetaEngine {
70 private:
74  static Common::String getMethod(KeybindingAction keyAction);
75 
79  static void addMouseClickActions(Common::Keymap &keyMap);
80 public:
84  static Common::KeymapArray initKeymaps(KeybindingMode mode = KBMODE_NORMAL);
85 
89  static void executeAction(KeybindingAction keyAction);
90 
94  static void setKeybindingMode(KeybindingMode mode);
95 };
96 
97 } // End of namespace Ultima4
98 } // End of namespace Ultima
99 
100 #endif
Definition: keymap.h:66
Definition: str.h:59
Definition: array.h:52
static void setKeybindingMode(KeybindingMode mode)
Definition: detection.h:27
Definition: metaengine.h:69
static Common::KeymapArray initKeymaps(KeybindingMode mode=KBMODE_NORMAL)
static void executeAction(KeybindingAction keyAction)