diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -384,7 +384,7 @@ static const StringID _variety[] = { static_assert(lengthof(_num_inds) == ID_END + 1); struct GenerateLandscapeWindow : public Window { - uint widget_id; + WidgetID widget_id; uint x; uint y; std::string name; @@ -415,7 +415,7 @@ struct GenerateLandscapeWindow : public } - void SetStringParameters(int widget) const override + void SetStringParameters(WidgetID widget) const override { switch (widget) { case WID_GL_START_DATE_TEXT: SetDParam(0, TimerGameCalendar::ConvertYMDToDate(_settings_newgame.game_creation.starting_year, 0, 1)); break; @@ -570,7 +570,7 @@ struct GenerateLandscapeWindow : public } - void UpdateWidgetSize(int widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override + void UpdateWidgetSize(WidgetID widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override { Dimension d{0, (uint)GetCharacterHeight(FS_NORMAL)}; const StringID *strs = nullptr; @@ -669,7 +669,7 @@ struct GenerateLandscapeWindow : public *size = maxdim(*size, d); } - void OnClick([[maybe_unused]] Point pt, int widget, [[maybe_unused]] int click_count) override + void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override { switch (widget) { case WID_GL_TEMPERATE: @@ -879,7 +879,7 @@ struct GenerateLandscapeWindow : public } } - void OnDropdownSelect(int widget, int index) override + void OnDropdownSelect(WidgetID widget, int index) override { switch (widget) { case WID_GL_MAPSIZE_X_PULLDOWN: _settings_newgame.game_creation.map_x = index; break; @@ -1076,7 +1076,7 @@ void StartNewGameWithoutGUI(uint32_t see struct CreateScenarioWindow : public Window { - uint widget_id; + WidgetID widget_id; CreateScenarioWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc) { @@ -1084,7 +1084,7 @@ struct CreateScenarioWindow : public Win this->LowerWidget(_settings_newgame.game_creation.landscape + WID_CS_TEMPERATE); } - void SetStringParameters(int widget) const override + void SetStringParameters(WidgetID widget) const override { switch (widget) { case WID_CS_START_DATE_TEXT: @@ -1120,7 +1120,7 @@ struct CreateScenarioWindow : public Win this->DrawWidgets(); } - void UpdateWidgetSize(int widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override + void UpdateWidgetSize(WidgetID widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override { StringID str = STR_JUST_INT; switch (widget) { @@ -1153,7 +1153,7 @@ struct CreateScenarioWindow : public Win *size = maxdim(*size, d); } - void OnClick([[maybe_unused]] Point pt, int widget, [[maybe_unused]] int click_count) override + void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override { switch (widget) { case WID_CS_TEMPERATE: @@ -1223,7 +1223,7 @@ struct CreateScenarioWindow : public Win this->RaiseWidgetsWhenLowered(WID_CS_START_DATE_DOWN, WID_CS_START_DATE_UP, WID_CS_FLAT_LAND_HEIGHT_DOWN, WID_CS_FLAT_LAND_HEIGHT_UP); } - void OnDropdownSelect(int widget, int index) override + void OnDropdownSelect(WidgetID widget, int index) override { switch (widget) { case WID_CS_MAPSIZE_X_PULLDOWN: _settings_newgame.game_creation.map_x = index; break; @@ -1389,7 +1389,7 @@ struct GenerateProgressWindow : public W this->InitNested(); } - void OnClick([[maybe_unused]] Point pt, int widget, [[maybe_unused]] int click_count) override + void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override { switch (widget) { case WID_GP_ABORT: @@ -1404,7 +1404,7 @@ struct GenerateProgressWindow : public W } } - void UpdateWidgetSize(int widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override + void UpdateWidgetSize(WidgetID widget, Dimension *size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension *fill, [[maybe_unused]] Dimension *resize) override { switch (widget) { case WID_GP_PROGRESS_BAR: { @@ -1425,7 +1425,7 @@ struct GenerateProgressWindow : public W } } - void DrawWidget(const Rect &r, int widget) const override + void DrawWidget(const Rect &r, WidgetID widget) const override { switch (widget) { case WID_GP_PROGRESS_BAR: {