summaryrefslogtreecommitdiff
path: root/src/toolbar_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-06-15 15:27:33 +0000
committerfrosch <frosch@openttd.org>2013-06-15 15:27:33 +0000
commitd9e9710cb3c4273d3742d0097dbe0b78511a5511 (patch)
treea107a3a43bbd18fb929a32c3298c75bba31ce7b8 /src/toolbar_gui.cpp
parentcd0a57fba30a7d365ab84af9846860c64da6b242 (diff)
downloadopenttd-d9e9710cb3c4273d3742d0097dbe0b78511a5511.tar.xz
(svn r25408) -Codechange: Simplify hotkeys by removing unused stuff.
Diffstat (limited to 'src/toolbar_gui.cpp')
-rw-r--r--src/toolbar_gui.cpp140
1 files changed, 70 insertions, 70 deletions
diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp
index 420079c53..9c5d72b2d 100644
--- a/src/toolbar_gui.cpp
+++ b/src/toolbar_gui.cpp
@@ -1662,7 +1662,7 @@ struct MainToolbarWindow : Window {
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
{
- switch (CheckHotkeyMatch(maintoolbar_hotkeys, keycode, this)) {
+ switch (CheckHotkeyMatch(maintoolbar_hotkeys, keycode)) {
case MTHK_PAUSE: ToolbarPauseClick(this); break;
case MTHK_FASTFORWARD: ToolbarFastForwardClick(this); break;
case MTHK_SETTINGS: ShowGameOptions(); break;
@@ -1759,7 +1759,7 @@ struct MainToolbarWindow : Window {
if (FindWindowById(WC_MAIN_WINDOW, 0) != NULL) HandleZoomMessage(this, FindWindowById(WC_MAIN_WINDOW, 0)->viewport, WID_TN_ZOOM_IN, WID_TN_ZOOM_OUT);
}
- static Hotkey<MainToolbarWindow> maintoolbar_hotkeys[];
+ static Hotkey maintoolbar_hotkeys[];
};
const uint16 _maintoolbar_pause_keys[] = {WKC_F1, WKC_PAUSE, 0};
@@ -1767,50 +1767,50 @@ const uint16 _maintoolbar_zoomin_keys[] = {WKC_NUM_PLUS, WKC_EQUALS, WKC_SHIFT |
const uint16 _maintoolbar_zoomout_keys[] = {WKC_NUM_MINUS, WKC_MINUS, WKC_SHIFT | WKC_MINUS, WKC_SHIFT | WKC_F6, 0};
const uint16 _maintoolbar_smallmap_keys[] = {WKC_F4, 'M', 0};
-Hotkey<MainToolbarWindow> MainToolbarWindow::maintoolbar_hotkeys[] = {
- Hotkey<MainToolbarWindow>(_maintoolbar_pause_keys, "pause", MTHK_PAUSE),
- Hotkey<MainToolbarWindow>((uint16)0, "fastforward", MTHK_FASTFORWARD),
- Hotkey<MainToolbarWindow>(WKC_F2, "settings", MTHK_SETTINGS),
- Hotkey<MainToolbarWindow>(WKC_F3, "saveload", MTHK_SAVEGAME),
- Hotkey<MainToolbarWindow>((uint16)0, "load_game", MTHK_LOADGAME),
- Hotkey<MainToolbarWindow>(_maintoolbar_smallmap_keys, "smallmap", MTHK_SMALLMAP),
- Hotkey<MainToolbarWindow>(WKC_F5, "town_list", MTHK_TOWNDIRECTORY),
- Hotkey<MainToolbarWindow>(WKC_F6, "subsidies", MTHK_SUBSIDIES),
- Hotkey<MainToolbarWindow>(WKC_F7, "station_list", MTHK_STATIONS),
- Hotkey<MainToolbarWindow>(WKC_F8, "finances", MTHK_FINANCES),
- Hotkey<MainToolbarWindow>(WKC_F9, "companies", MTHK_COMPANIES),
- Hotkey<MainToolbarWindow>((uint16)0, "story_book", MTHK_STORY),
- Hotkey<MainToolbarWindow>((uint16)0, "goal_list", MTHK_GOAL),
- Hotkey<MainToolbarWindow>(WKC_F10, "graphs", MTHK_GRAPHS),
- Hotkey<MainToolbarWindow>(WKC_F11, "league", MTHK_LEAGUE),
- Hotkey<MainToolbarWindow>(WKC_F12, "industry_list", MTHK_INDUSTRIES),
- Hotkey<MainToolbarWindow>(WKC_SHIFT | WKC_F1, "train_list", MTHK_TRAIN_LIST),
- Hotkey<MainToolbarWindow>(WKC_SHIFT | WKC_F2, "roadveh_list", MTHK_ROADVEH_LIST),
- Hotkey<MainToolbarWindow>(WKC_SHIFT | WKC_F3, "ship_list", MTHK_SHIP_LIST),
- Hotkey<MainToolbarWindow>(WKC_SHIFT | WKC_F4, "aircraft_list", MTHK_AIRCRAFT_LIST),
- Hotkey<MainToolbarWindow>(_maintoolbar_zoomin_keys, "zoomin", MTHK_ZOOM_IN),
- Hotkey<MainToolbarWindow>(_maintoolbar_zoomout_keys, "zoomout", MTHK_ZOOM_OUT),
- Hotkey<MainToolbarWindow>(WKC_SHIFT | WKC_F7, "build_rail", MTHK_BUILD_RAIL),
- Hotkey<MainToolbarWindow>(WKC_SHIFT | WKC_F8, "build_road", MTHK_BUILD_ROAD),
- Hotkey<MainToolbarWindow>(WKC_SHIFT | WKC_F9, "build_docks", MTHK_BUILD_DOCKS),
- Hotkey<MainToolbarWindow>(WKC_SHIFT | WKC_F10, "build_airport", MTHK_BUILD_AIRPORT),
- Hotkey<MainToolbarWindow>(WKC_SHIFT | WKC_F11, "build_trees", MTHK_BUILD_TREES),
- Hotkey<MainToolbarWindow>(WKC_SHIFT | WKC_F12, "music", MTHK_MUSIC),
- Hotkey<MainToolbarWindow>((uint16)0, "ai_debug", MTHK_AI_DEBUG),
- Hotkey<MainToolbarWindow>(WKC_CTRL | 'S', "small_screenshot", MTHK_SMALL_SCREENSHOT),
- Hotkey<MainToolbarWindow>(WKC_CTRL | 'P', "zoomedin_screenshot", MTHK_ZOOMEDIN_SCREENSHOT),
- Hotkey<MainToolbarWindow>(WKC_CTRL | 'D', "defaultzoom_screenshot", MTHK_DEFAULTZOOM_SCREENSHOT),
- Hotkey<MainToolbarWindow>((uint16)0, "giant_screenshot", MTHK_GIANT_SCREENSHOT),
- Hotkey<MainToolbarWindow>(WKC_CTRL | WKC_ALT | 'C', "cheats", MTHK_CHEATS),
- Hotkey<MainToolbarWindow>('L', "terraform", MTHK_TERRAFORM),
- Hotkey<MainToolbarWindow>('V', "extra_viewport", MTHK_EXTRA_VIEWPORT),
+Hotkey MainToolbarWindow::maintoolbar_hotkeys[] = {
+ Hotkey(_maintoolbar_pause_keys, "pause", MTHK_PAUSE),
+ Hotkey((uint16)0, "fastforward", MTHK_FASTFORWARD),
+ Hotkey(WKC_F2, "settings", MTHK_SETTINGS),
+ Hotkey(WKC_F3, "saveload", MTHK_SAVEGAME),
+ Hotkey((uint16)0, "load_game", MTHK_LOADGAME),
+ Hotkey(_maintoolbar_smallmap_keys, "smallmap", MTHK_SMALLMAP),
+ Hotkey(WKC_F5, "town_list", MTHK_TOWNDIRECTORY),
+ Hotkey(WKC_F6, "subsidies", MTHK_SUBSIDIES),
+ Hotkey(WKC_F7, "station_list", MTHK_STATIONS),
+ Hotkey(WKC_F8, "finances", MTHK_FINANCES),
+ Hotkey(WKC_F9, "companies", MTHK_COMPANIES),
+ Hotkey((uint16)0, "story_book", MTHK_STORY),
+ Hotkey((uint16)0, "goal_list", MTHK_GOAL),
+ Hotkey(WKC_F10, "graphs", MTHK_GRAPHS),
+ Hotkey(WKC_F11, "league", MTHK_LEAGUE),
+ Hotkey(WKC_F12, "industry_list", MTHK_INDUSTRIES),
+ Hotkey(WKC_SHIFT | WKC_F1, "train_list", MTHK_TRAIN_LIST),
+ Hotkey(WKC_SHIFT | WKC_F2, "roadveh_list", MTHK_ROADVEH_LIST),
+ Hotkey(WKC_SHIFT | WKC_F3, "ship_list", MTHK_SHIP_LIST),
+ Hotkey(WKC_SHIFT | WKC_F4, "aircraft_list", MTHK_AIRCRAFT_LIST),
+ Hotkey(_maintoolbar_zoomin_keys, "zoomin", MTHK_ZOOM_IN),
+ Hotkey(_maintoolbar_zoomout_keys, "zoomout", MTHK_ZOOM_OUT),
+ Hotkey(WKC_SHIFT | WKC_F7, "build_rail", MTHK_BUILD_RAIL),
+ Hotkey(WKC_SHIFT | WKC_F8, "build_road", MTHK_BUILD_ROAD),
+ Hotkey(WKC_SHIFT | WKC_F9, "build_docks", MTHK_BUILD_DOCKS),
+ Hotkey(WKC_SHIFT | WKC_F10, "build_airport", MTHK_BUILD_AIRPORT),
+ Hotkey(WKC_SHIFT | WKC_F11, "build_trees", MTHK_BUILD_TREES),
+ Hotkey(WKC_SHIFT | WKC_F12, "music", MTHK_MUSIC),
+ Hotkey((uint16)0, "ai_debug", MTHK_AI_DEBUG),
+ Hotkey(WKC_CTRL | 'S', "small_screenshot", MTHK_SMALL_SCREENSHOT),
+ Hotkey(WKC_CTRL | 'P', "zoomedin_screenshot", MTHK_ZOOMEDIN_SCREENSHOT),
+ Hotkey(WKC_CTRL | 'D', "defaultzoom_screenshot", MTHK_DEFAULTZOOM_SCREENSHOT),
+ Hotkey((uint16)0, "giant_screenshot", MTHK_GIANT_SCREENSHOT),
+ Hotkey(WKC_CTRL | WKC_ALT | 'C', "cheats", MTHK_CHEATS),
+ Hotkey('L', "terraform", MTHK_TERRAFORM),
+ Hotkey('V', "extra_viewport", MTHK_EXTRA_VIEWPORT),
#ifdef ENABLE_NETWORK
- Hotkey<MainToolbarWindow>((uint16)0, "client_list", MTHK_CLIENT_LIST),
+ Hotkey((uint16)0, "client_list", MTHK_CLIENT_LIST),
#endif
- Hotkey<MainToolbarWindow>((uint16)0, "sign_list", MTHK_SIGN_LIST),
- HOTKEY_LIST_END(MainToolbarWindow)
+ Hotkey((uint16)0, "sign_list", MTHK_SIGN_LIST),
+ HOTKEY_LIST_END
};
-Hotkey<MainToolbarWindow> *_maintoolbar_hotkeys = MainToolbarWindow::maintoolbar_hotkeys;
+Hotkey *_maintoolbar_hotkeys = MainToolbarWindow::maintoolbar_hotkeys;
static NWidgetBase *MakeMainToolbar(int *biggest_index)
{
@@ -2009,7 +2009,7 @@ struct ScenarioEditorToolbarWindow : Window {
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
{
CallBackFunction cbf = CBF_NONE;
- switch (CheckHotkeyMatch(scenedit_maintoolbar_hotkeys, keycode, this)) {
+ switch (CheckHotkeyMatch(scenedit_maintoolbar_hotkeys, keycode)) {
case MTEHK_PAUSE: ToolbarPauseClick(this); break;
case MTEHK_FASTFORWARD: ToolbarFastForwardClick(this); break;
case MTEHK_SETTINGS: ShowGameOptions(); break;
@@ -2102,35 +2102,35 @@ struct ScenarioEditorToolbarWindow : Window {
this->SetDirty();
}
- static Hotkey<ScenarioEditorToolbarWindow> scenedit_maintoolbar_hotkeys[];
+ static Hotkey scenedit_maintoolbar_hotkeys[];
};
-Hotkey<ScenarioEditorToolbarWindow> ScenarioEditorToolbarWindow::scenedit_maintoolbar_hotkeys[] = {
- Hotkey<ScenarioEditorToolbarWindow>(_maintoolbar_pause_keys, "pause", MTEHK_PAUSE),
- Hotkey<ScenarioEditorToolbarWindow>((uint16)0, "fastforward", MTEHK_FASTFORWARD),
- Hotkey<ScenarioEditorToolbarWindow>(WKC_F2, "settings", MTEHK_SETTINGS),
- Hotkey<ScenarioEditorToolbarWindow>(WKC_F3, "saveload", MTEHK_SAVEGAME),
- Hotkey<ScenarioEditorToolbarWindow>(WKC_F4, "gen_land", MTEHK_GENLAND),
- Hotkey<ScenarioEditorToolbarWindow>(WKC_F5, "gen_town", MTEHK_GENTOWN),
- Hotkey<ScenarioEditorToolbarWindow>(WKC_F6, "gen_industry", MTEHK_GENINDUSTRY),
- Hotkey<ScenarioEditorToolbarWindow>(WKC_F7, "build_road", MTEHK_BUILD_ROAD),
- Hotkey<ScenarioEditorToolbarWindow>(WKC_F8, "build_docks", MTEHK_BUILD_DOCKS),
- Hotkey<ScenarioEditorToolbarWindow>(WKC_F9, "build_trees", MTEHK_BUILD_TREES),
- Hotkey<ScenarioEditorToolbarWindow>(WKC_F10, "build_sign", MTEHK_SIGN),
- Hotkey<ScenarioEditorToolbarWindow>(WKC_F11, "music", MTEHK_MUSIC),
- Hotkey<ScenarioEditorToolbarWindow>(WKC_F12, "land_info", MTEHK_LANDINFO),
- Hotkey<ScenarioEditorToolbarWindow>(WKC_CTRL | 'S', "small_screenshot", MTEHK_SMALL_SCREENSHOT),
- Hotkey<ScenarioEditorToolbarWindow>(WKC_CTRL | 'P', "zoomedin_screenshot", MTEHK_ZOOMEDIN_SCREENSHOT),
- Hotkey<ScenarioEditorToolbarWindow>(WKC_CTRL | 'D', "defaultzoom_screenshot", MTEHK_DEFAULTZOOM_SCREENSHOT),
- Hotkey<ScenarioEditorToolbarWindow>((uint16)0, "giant_screenshot", MTEHK_GIANT_SCREENSHOT),
- Hotkey<ScenarioEditorToolbarWindow>(_maintoolbar_zoomin_keys, "zoomin", MTEHK_ZOOM_IN),
- Hotkey<ScenarioEditorToolbarWindow>(_maintoolbar_zoomout_keys, "zoomout", MTEHK_ZOOM_OUT),
- Hotkey<ScenarioEditorToolbarWindow>('L', "terraform", MTEHK_TERRAFORM),
- Hotkey<ScenarioEditorToolbarWindow>('M', "smallmap", MTEHK_SMALLMAP),
- Hotkey<ScenarioEditorToolbarWindow>('V', "extra_viewport", MTEHK_EXTRA_VIEWPORT),
- HOTKEY_LIST_END(ScenarioEditorToolbarWindow)
+Hotkey ScenarioEditorToolbarWindow::scenedit_maintoolbar_hotkeys[] = {
+ Hotkey(_maintoolbar_pause_keys, "pause", MTEHK_PAUSE),
+ Hotkey((uint16)0, "fastforward", MTEHK_FASTFORWARD),
+ Hotkey(WKC_F2, "settings", MTEHK_SETTINGS),
+ Hotkey(WKC_F3, "saveload", MTEHK_SAVEGAME),
+ Hotkey(WKC_F4, "gen_land", MTEHK_GENLAND),
+ Hotkey(WKC_F5, "gen_town", MTEHK_GENTOWN),
+ Hotkey(WKC_F6, "gen_industry", MTEHK_GENINDUSTRY),
+ Hotkey(WKC_F7, "build_road", MTEHK_BUILD_ROAD),
+ Hotkey(WKC_F8, "build_docks", MTEHK_BUILD_DOCKS),
+ Hotkey(WKC_F9, "build_trees", MTEHK_BUILD_TREES),
+ Hotkey(WKC_F10, "build_sign", MTEHK_SIGN),
+ Hotkey(WKC_F11, "music", MTEHK_MUSIC),
+ Hotkey(WKC_F12, "land_info", MTEHK_LANDINFO),
+ Hotkey(WKC_CTRL | 'S', "small_screenshot", MTEHK_SMALL_SCREENSHOT),
+ Hotkey(WKC_CTRL | 'P', "zoomedin_screenshot", MTEHK_ZOOMEDIN_SCREENSHOT),
+ Hotkey(WKC_CTRL | 'D', "defaultzoom_screenshot", MTEHK_DEFAULTZOOM_SCREENSHOT),
+ Hotkey((uint16)0, "giant_screenshot", MTEHK_GIANT_SCREENSHOT),
+ Hotkey(_maintoolbar_zoomin_keys, "zoomin", MTEHK_ZOOM_IN),
+ Hotkey(_maintoolbar_zoomout_keys, "zoomout", MTEHK_ZOOM_OUT),
+ Hotkey('L', "terraform", MTEHK_TERRAFORM),
+ Hotkey('M', "smallmap", MTEHK_SMALLMAP),
+ Hotkey('V', "extra_viewport", MTEHK_EXTRA_VIEWPORT),
+ HOTKEY_LIST_END
};
-Hotkey<ScenarioEditorToolbarWindow> *_scenedit_maintoolbar_hotkeys = ScenarioEditorToolbarWindow::scenedit_maintoolbar_hotkeys;
+Hotkey *_scenedit_maintoolbar_hotkeys = ScenarioEditorToolbarWindow::scenedit_maintoolbar_hotkeys;
static const NWidgetPart _nested_toolb_scen_inner_widgets[] = {
NWidget(WWT_IMGBTN, COLOUR_GREY, WID_TE_PAUSE), SetDataTip(SPR_IMG_PAUSE, STR_TOOLBAR_TOOLTIP_PAUSE_GAME),