Codechange: Reorganise hotkey initialisation. (#10951)

Hotkeys are now initialized inline, and use std::vector instead of
separate static C-arrays and std::string instead of char *. The list end
marker is no longer required.
This commit is contained in:
PeterN
2023-06-05 18:12:30 +01:00
committed by GitHub
parent 921f5afc4d
commit f814c86389
15 changed files with 410 additions and 502 deletions

View File

@@ -3264,15 +3264,11 @@ public:
::ShowNewGRFInspectWindow(GetGrfSpecFeature(Vehicle::Get(this->window_number)->type), this->window_number);
}
static HotkeyList hotkeys;
static inline HotkeyList hotkeys{"vehicleview", {
Hotkey('H', "honk", WID_VV_HONK_HORN),
}};
};
static Hotkey vehicleview_hotkeys[] = {
Hotkey('H', "honk", WID_VV_HONK_HORN),
HOTKEY_LIST_END
};
HotkeyList VehicleViewWindow::hotkeys("vehicleview", vehicleview_hotkeys);
/** Vehicle view window descriptor for all vehicles but trains. */
static WindowDesc _vehicle_view_desc(
WDP_AUTO, "view_vehicle", 250, 116,