mirror of https://github.com/OpenTTD/OpenTTD
(svn r26025) [1.3] -Fix: get hotkeys working again
parent
10fdf41107
commit
8d90a3f417
|
@ -1303,7 +1303,7 @@ struct AIDebugWindow : public Window {
|
|||
}
|
||||
}
|
||||
|
||||
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
|
||||
virtual EventState OnKeyPress(WChar key, uint16 keycode)
|
||||
{
|
||||
EventState state = ES_NOT_HANDLED;
|
||||
int num = CheckHotkeyMatch(aidebug_hotkeys, keycode, this);
|
||||
|
@ -1514,7 +1514,7 @@ Window *ShowAIDebugWindow(CompanyID show_company)
|
|||
/**
|
||||
* Handler for global AI debug window hotkeys.
|
||||
*/
|
||||
EventState AIDebugGlobalHotkeys(uint16 key, uint16 keycode)
|
||||
EventState AIDebugGlobalHotkeys(WChar key, uint16 keycode)
|
||||
{
|
||||
int num = CheckHotkeyMatch<AIDebugWindow>(_aidebug_hotkeys, keycode, NULL, true);
|
||||
if (num == -1) return ES_NOT_HANDLED;
|
||||
|
|
|
@ -99,7 +99,7 @@ struct BuildAirToolbarWindow : Window {
|
|||
}
|
||||
|
||||
|
||||
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
|
||||
virtual EventState OnKeyPress(WChar key, uint16 keycode)
|
||||
{
|
||||
int num = CheckHotkeyMatch(airtoolbar_hotkeys, keycode, this);
|
||||
if (num == -1) return ES_NOT_HANDLED;
|
||||
|
@ -187,7 +187,7 @@ Window *ShowBuildAirToolbar()
|
|||
return AllocateWindowDescFront<BuildAirToolbarWindow>(&_air_toolbar_desc, TRANSPORT_AIR);
|
||||
}
|
||||
|
||||
EventState AirportToolbarGlobalHotkeys(uint16 key, uint16 keycode)
|
||||
EventState AirportToolbarGlobalHotkeys(WChar key, uint16 keycode)
|
||||
{
|
||||
if (!CanBuildVehicleInfrastructure(VEH_AIRCRAFT)) return ES_NOT_HANDLED;
|
||||
int num = CheckHotkeyMatch<BuildAirToolbarWindow>(_airtoolbar_hotkeys, keycode, NULL, true);
|
||||
|
|
|
@ -163,7 +163,7 @@ struct BuildDocksToolbarWindow : Window {
|
|||
this->last_clicked_widget = (DockToolbarWidgets)widget;
|
||||
}
|
||||
|
||||
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
|
||||
virtual EventState OnKeyPress(WChar key, uint16 keycode)
|
||||
{
|
||||
int num = CheckHotkeyMatch(dockstoolbar_hotkeys, keycode, this);
|
||||
if (num == -1) return ES_NOT_HANDLED;
|
||||
|
@ -335,7 +335,7 @@ Window *ShowBuildDocksToolbar()
|
|||
return AllocateWindowDescFront<BuildDocksToolbarWindow>(&_build_docks_toolbar_desc, TRANSPORT_WATER);
|
||||
}
|
||||
|
||||
EventState DockToolbarGlobalHotkeys(uint16 key, uint16 keycode)
|
||||
EventState DockToolbarGlobalHotkeys(WChar key, uint16 keycode)
|
||||
{
|
||||
int num = CheckHotkeyMatch<BuildDocksToolbarWindow>(_dockstoolbar_hotkeys, keycode, NULL, true);
|
||||
if (num == -1) return ES_NOT_HANDLED;
|
||||
|
|
|
@ -294,7 +294,7 @@ void SaveHotkeysToConfig()
|
|||
SaveLoadHotkeys(true);
|
||||
}
|
||||
|
||||
typedef EventState GlobalHotkeyHandler(uint16, uint16);
|
||||
typedef EventState GlobalHotkeyHandler(WChar, uint16);
|
||||
|
||||
GlobalHotkeyHandler RailToolbarGlobalHotkeys;
|
||||
GlobalHotkeyHandler DockToolbarGlobalHotkeys;
|
||||
|
|
|
@ -269,7 +269,7 @@ struct MainWindow : Window
|
|||
}
|
||||
}
|
||||
|
||||
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
|
||||
virtual EventState OnKeyPress(WChar key, uint16 keycode)
|
||||
{
|
||||
int num = CheckHotkeyMatch(global_hotkeys, keycode, this);
|
||||
if (num == GHK_QUIT) {
|
||||
|
|
|
@ -1440,7 +1440,7 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
|
||||
virtual EventState OnKeyPress(WChar key, uint16 keycode)
|
||||
{
|
||||
if (this->vehicle->owner != _local_company) return ES_NOT_HANDLED;
|
||||
|
||||
|
|
|
@ -597,7 +597,7 @@ struct BuildRailToolbarWindow : Window {
|
|||
if (_ctrl_pressed) RailToolbar_CtrlChanged(this);
|
||||
}
|
||||
|
||||
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
|
||||
virtual EventState OnKeyPress(WChar key, uint16 keycode)
|
||||
{
|
||||
int num = CheckHotkeyMatch(railtoolbar_hotkeys, keycode, this);
|
||||
if (num == -1) return ES_NOT_HANDLED;
|
||||
|
@ -847,7 +847,7 @@ Window *ShowBuildRailToolbar(RailType railtype)
|
|||
return new BuildRailToolbarWindow(&_build_rail_desc, railtype);
|
||||
}
|
||||
|
||||
EventState RailToolbarGlobalHotkeys(uint16 key, uint16 keycode)
|
||||
EventState RailToolbarGlobalHotkeys(WChar key, uint16 keycode)
|
||||
{
|
||||
if (!CanBuildVehicleInfrastructure(VEH_TRAIN)) return ES_NOT_HANDLED;
|
||||
extern RailType _last_built_railtype;
|
||||
|
|
|
@ -473,7 +473,7 @@ struct BuildRoadToolbarWindow : Window {
|
|||
if (_ctrl_pressed) RoadToolbar_CtrlChanged(this);
|
||||
}
|
||||
|
||||
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
|
||||
virtual EventState OnKeyPress(WChar key, uint16 keycode)
|
||||
{
|
||||
int num = CheckHotkeyMatch(roadtoolbar_hotkeys, keycode, this);
|
||||
if (num == -1 || this->GetWidget<NWidgetBase>(num) == NULL) return ES_NOT_HANDLED;
|
||||
|
@ -775,7 +775,7 @@ Window *ShowBuildRoadToolbar(RoadType roadtype)
|
|||
return AllocateWindowDescFront<BuildRoadToolbarWindow>(roadtype == ROADTYPE_ROAD ? &_build_road_desc : &_build_tramway_desc, TRANSPORT_ROAD);
|
||||
}
|
||||
|
||||
EventState RoadToolbarGlobalHotkeys(uint16 key, uint16 keycode)
|
||||
EventState RoadToolbarGlobalHotkeys(WChar key, uint16 keycode)
|
||||
{
|
||||
extern RoadType _last_built_roadtype;
|
||||
int num = CheckHotkeyMatch<BuildRoadToolbarWindow>(_roadtoolbar_hotkeys, keycode, NULL, true);
|
||||
|
@ -829,7 +829,7 @@ Window *ShowBuildRoadScenToolbar()
|
|||
return AllocateWindowDescFront<BuildRoadToolbarWindow>(&_build_road_scen_desc, TRANSPORT_ROAD);
|
||||
}
|
||||
|
||||
EventState RoadToolbarEditorGlobalHotkeys(uint16 key, uint16 keycode)
|
||||
EventState RoadToolbarEditorGlobalHotkeys(WChar key, uint16 keycode)
|
||||
{
|
||||
int num = CheckHotkeyMatch<BuildRoadToolbarWindow>(_roadtoolbar_hotkeys, keycode, NULL, true);
|
||||
if (num == -1) return ES_NOT_HANDLED;
|
||||
|
|
|
@ -281,7 +281,7 @@ struct SignListWindow : Window, SignList {
|
|||
}
|
||||
}
|
||||
|
||||
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
|
||||
virtual EventState OnKeyPress(WChar key, uint16 keycode)
|
||||
{
|
||||
EventState state = ES_NOT_HANDLED;
|
||||
if (CheckHotkeyMatch(signlist_hotkeys, keycode, this) == SLHK_FOCUS_FILTER_BOX) {
|
||||
|
@ -386,7 +386,7 @@ Window *ShowSignList()
|
|||
return AllocateWindowDescFront<SignListWindow>(&_sign_list_desc, 0);
|
||||
}
|
||||
|
||||
EventState SignListGlobalHotkeys(uint16 key, uint16 keycode)
|
||||
EventState SignListGlobalHotkeys(WChar key, uint16 keycode)
|
||||
{
|
||||
int num = CheckHotkeyMatch<SignListWindow>(_signlist_hotkeys, keycode, NULL, true);
|
||||
if (num == -1) return ES_NOT_HANDLED;
|
||||
|
|
|
@ -218,7 +218,7 @@ struct TerraformToolbarWindow : Window {
|
|||
}
|
||||
}
|
||||
|
||||
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
|
||||
virtual EventState OnKeyPress(WChar key, uint16 keycode)
|
||||
{
|
||||
int num = CheckHotkeyMatch(terraform_hotkeys, keycode, this);
|
||||
if (num == -1) return ES_NOT_HANDLED;
|
||||
|
@ -377,7 +377,7 @@ Window *ShowTerraformToolbar(Window *link)
|
|||
return w;
|
||||
}
|
||||
|
||||
EventState TerraformToolbarGlobalHotkeys(uint16 key, uint16 keycode)
|
||||
EventState TerraformToolbarGlobalHotkeys(WChar key, uint16 keycode)
|
||||
{
|
||||
int num = CheckHotkeyMatch<TerraformToolbarWindow>(_terraform_hotkeys, keycode, NULL, true);
|
||||
if (num == -1) return ES_NOT_HANDLED;
|
||||
|
@ -571,7 +571,7 @@ struct ScenarioEditorLandscapeGenerationWindow : Window {
|
|||
} while (--n);
|
||||
}
|
||||
|
||||
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
|
||||
virtual EventState OnKeyPress(WChar key, uint16 keycode)
|
||||
{
|
||||
int num = CheckHotkeyMatch(terraform_editor_hotkeys, keycode, this);
|
||||
if (num == -1) return ES_NOT_HANDLED;
|
||||
|
@ -755,7 +755,7 @@ Window *ShowEditorTerraformToolbar()
|
|||
return AllocateWindowDescFront<ScenarioEditorLandscapeGenerationWindow>(&_scen_edit_land_gen_desc, 0);
|
||||
}
|
||||
|
||||
EventState TerraformToolbarEditorGlobalHotkeys(uint16 key, uint16 keycode)
|
||||
EventState TerraformToolbarEditorGlobalHotkeys(WChar key, uint16 keycode)
|
||||
{
|
||||
int num = CheckHotkeyMatch<ScenarioEditorLandscapeGenerationWindow>(_terraform_editor_hotkeys, keycode, NULL, true);
|
||||
if (num == -1) return ES_NOT_HANDLED;
|
||||
|
|
|
@ -1587,7 +1587,7 @@ struct MainToolbarWindow : Window {
|
|||
if (cbf != CBF_NONE) this->last_started_action = cbf;
|
||||
}
|
||||
|
||||
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
|
||||
virtual EventState OnKeyPress(WChar key, uint16 keycode)
|
||||
{
|
||||
switch (CheckHotkeyMatch(maintoolbar_hotkeys, keycode, this)) {
|
||||
case MTHK_PAUSE: ToolbarPauseClick(this); break;
|
||||
|
@ -1925,7 +1925,7 @@ struct ScenarioEditorToolbarWindow : Window {
|
|||
if (_settings_client.sound.click_beep) SndPlayFx(SND_15_BEEP);
|
||||
}
|
||||
|
||||
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
|
||||
virtual EventState OnKeyPress(WChar key, uint16 keycode)
|
||||
{
|
||||
CallBackFunction cbf = CBF_NONE;
|
||||
switch (CheckHotkeyMatch(scenedit_maintoolbar_hotkeys, keycode, this)) {
|
||||
|
|
Loading…
Reference in New Issue