Codechange: Replace mishmash of types for widget index with WidgetID.
Indices were stored as int, but often passed around as uint/uint8_t and casts. Now they should all use WidgetID.
This commit is contained in:

committed by
Peter Nelson

parent
fd84f73323
commit
a0dfb76e34
@@ -175,7 +175,7 @@ struct TerraformToolbarWindow : Window {
|
||||
show_object->SetDisplayedPlane(ObjectClass::GetUIClassCount() != 0 ? 0 : SZSP_NONE);
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
if (widget < WID_TT_BUTTONS_START) return;
|
||||
|
||||
@@ -553,7 +553,7 @@ struct ScenarioEditorLandscapeGenerationWindow : Window {
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
if (widget != WID_ETT_DOTS) return;
|
||||
|
||||
@@ -561,7 +561,7 @@ struct ScenarioEditorLandscapeGenerationWindow : Window {
|
||||
size->height = std::max<uint>(size->height, ScaleGUITrad(31));
|
||||
}
|
||||
|
||||
void DrawWidget(const Rect &r, int widget) const override
|
||||
void DrawWidget(const Rect &r, WidgetID widget) const override
|
||||
{
|
||||
if (widget != WID_ETT_DOTS) return;
|
||||
|
||||
@@ -578,7 +578,7 @@ struct ScenarioEditorLandscapeGenerationWindow : Window {
|
||||
} while (--n);
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
if (widget < WID_ETT_BUTTONS_START) return;
|
||||
|
||||
|
Reference in New Issue
Block a user