Codechange: Missing some conversions to WidgetID. (#11773)

This commit is contained in:
Peter Nelson 2024-01-14 16:47:10 +00:00 committed by GitHub
parent 93ba6d6776
commit 71aaed860b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 5 deletions

View File

@ -1095,7 +1095,7 @@ void DrawEngineList(VehicleType type, const Rect &r, const GUIEngineList &eng_li
* @param selected Currently selected sort criterium. * @param selected Currently selected sort criterium.
* @param button Widget button. * @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; uint32_t hidden_mask = 0;
/* Disable sorting by power or tractive effort when the original acceleration model for road vehicles is being used. */ /* Disable sorting by power or tractive effort when the original acceleration model for road vehicles is being used. */

View File

@ -51,6 +51,6 @@ extern const StringID _engine_sort_listing[][12];
extern EngList_SortTypeFunction * const _engine_sort_functions[][11]; extern EngList_SortTypeFunction * const _engine_sort_functions[][11];
uint GetEngineListHeight(VehicleType type); 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 */ #endif /* ENGINE_GUI_H */

View File

@ -160,7 +160,7 @@ struct HelpWindow : public Window {
} }
private: private:
void EnableTextfileButton(std::string_view filename, int button_widget) void EnableTextfileButton(std::string_view filename, WidgetID button_widget)
{ {
this->GetWidget<NWidgetLeaf>(button_widget)->SetDisabled(!FindGameManualFilePath(filename).has_value()); this->GetWidget<NWidgetLeaf>(button_widget)->SetDisabled(!FindGameManualFilePath(filename).has_value());
} }

View File

@ -42,7 +42,7 @@ struct OskWindow : public Window {
std::string orig_str; ///< Original string. std::string orig_str; ///< Original string.
bool shift; ///< Is the shift effectively pressed? 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; this->parent = parent;
assert(parent != nullptr); assert(parent != nullptr);

View File

@ -258,7 +258,7 @@ public:
ViewportData *viewport; ///< Pointer to viewport data, if present. 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. const NWidgetCore *nested_focus; ///< Currently focused nested widget, or \c nullptr if no nested widget has focus.
std::map<int, QueryString*> querystrings; ///< QueryString associated to WWT_EDITBOX widgets. std::map<WidgetID, QueryString*> querystrings; ///< QueryString associated to WWT_EDITBOX widgets.
std::unique_ptr<NWidgetBase> nested_root; ///< Root of the nested tree. std::unique_ptr<NWidgetBase> 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. 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. NWidgetStacked *shade_select; ///< Selection widget (#NWID_SELECTION) to use for shading the window. If \c nullptr, window cannot shade.