Add hotkeys to remember locations and scroll back to them

This commit is contained in:
dP
2020-05-20 00:19:52 +03:00
parent 1d2c2925d1
commit 9fe35a49a1
6 changed files with 119 additions and 2 deletions

View File

@@ -60,6 +60,8 @@
#include "zoning.h"
#include "watch_gui.h"
#include "citymania/locations.hpp"
#include "safeguards.h"
@@ -2100,6 +2102,7 @@ enum MainToolbarHotkeys {
MTHK_SETTINGS_ADV,
MTHK_NEWGRF,
MTHK_LANDINFO,
CM_LOCATION_HOTKEYS,
};
/** Main toolbar. */
@@ -2215,7 +2218,7 @@ struct MainToolbarWindow : Window {
case MTHK_SETTINGS_ADV: ShowGameSettings(); break;
case MTHK_NEWGRF: ShowNewGRFSettings(!_networking && _settings_client.gui.UserIsAllowedToChangeNewGRFs(), true, true, &_grfconfig); break;
case MTHK_LANDINFO: _last_started_action = PlaceLandBlockInfo(); break;
default: return ES_NOT_HANDLED;
default: return citymania::HandleToolbarHotkey(hotkey);
}
return ES_HANDLED;
}
@@ -2367,6 +2370,7 @@ static Hotkey maintoolbar_hotkeys[] = {
Hotkey((uint16)0, "newgrf_window", MTHK_NEWGRF),
Hotkey((uint16)0, "sign_list", MTHK_SIGN_LIST),
Hotkey((uint16)0, "land_info", MTHK_LANDINFO),
CM_LOCATION_HOTKEYS_DECL,
HOTKEY_LIST_END
};
HotkeyList MainToolbarWindow::hotkeys("maintoolbar", maintoolbar_hotkeys);