From 71aaed860b092f2ca8da48ff1eb50c71ac57b68d Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Sun, 14 Jan 2024 16:47:10 +0000 Subject: [PATCH] Codechange: Missing some conversions to WidgetID. (#11773) --- src/build_vehicle_gui.cpp | 2 +- src/engine_gui.h | 2 +- src/help_gui.cpp | 2 +- src/osk_gui.cpp | 2 +- src/window_gui.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 0427125399..d71763ff00 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1095,7 +1095,7 @@ void DrawEngineList(VehicleType type, const Rect &r, const GUIEngineList &eng_li * @param selected Currently selected sort criterium. * @param button Widget button. */ -void DisplayVehicleSortDropDown(Window *w, VehicleType vehicle_type, int selected, int button) +void DisplayVehicleSortDropDown(Window *w, VehicleType vehicle_type, int selected, WidgetID button) { uint32_t hidden_mask = 0; /* Disable sorting by power or tractive effort when the original acceleration model for road vehicles is being used. */ diff --git a/src/engine_gui.h b/src/engine_gui.h index 21e09b0f9d..c6a20cb327 100644 --- a/src/engine_gui.h +++ b/src/engine_gui.h @@ -51,6 +51,6 @@ extern const StringID _engine_sort_listing[][12]; extern EngList_SortTypeFunction * const _engine_sort_functions[][11]; uint GetEngineListHeight(VehicleType type); -void DisplayVehicleSortDropDown(Window *w, VehicleType vehicle_type, int selected, int button); +void DisplayVehicleSortDropDown(Window *w, VehicleType vehicle_type, int selected, WidgetID button); #endif /* ENGINE_GUI_H */ diff --git a/src/help_gui.cpp b/src/help_gui.cpp index 60fde1db92..3c34b0fb0a 100644 --- a/src/help_gui.cpp +++ b/src/help_gui.cpp @@ -160,7 +160,7 @@ struct HelpWindow : public Window { } private: - void EnableTextfileButton(std::string_view filename, int button_widget) + void EnableTextfileButton(std::string_view filename, WidgetID button_widget) { this->GetWidget(button_widget)->SetDisabled(!FindGameManualFilePath(filename).has_value()); } diff --git a/src/osk_gui.cpp b/src/osk_gui.cpp index bdd1e0f0e3..bb3d49bf6a 100644 --- a/src/osk_gui.cpp +++ b/src/osk_gui.cpp @@ -42,7 +42,7 @@ struct OskWindow : public Window { std::string orig_str; ///< Original string. bool shift; ///< Is the shift effectively pressed? - OskWindow(WindowDesc *desc, Window *parent, int button) : Window(desc) + OskWindow(WindowDesc *desc, Window *parent, WidgetID button) : Window(desc) { this->parent = parent; assert(parent != nullptr); diff --git a/src/window_gui.h b/src/window_gui.h index 1243239c6a..3464af8a51 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -258,7 +258,7 @@ public: ViewportData *viewport; ///< Pointer to viewport data, if present. const NWidgetCore *nested_focus; ///< Currently focused nested widget, or \c nullptr if no nested widget has focus. - std::map querystrings; ///< QueryString associated to WWT_EDITBOX widgets. + std::map querystrings; ///< QueryString associated to WWT_EDITBOX widgets. std::unique_ptr nested_root; ///< Root of the nested tree. WidgetLookup widget_lookup; ///< Indexed access to the nested widget tree. Do not access directly, use #Window::GetWidget() instead. NWidgetStacked *shade_select; ///< Selection widget (#NWID_SELECTION) to use for shading the window. If \c nullptr, window cannot shade.