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:
Peter Nelson
2023-12-29 19:11:59 +00:00
committed by Peter Nelson
parent fd84f73323
commit a0dfb76e34
77 changed files with 666 additions and 657 deletions

View File

@@ -60,7 +60,7 @@
* @param mode Tile highlighting mode, e.g. drawing a rectangle or a dot on the ground
* @return true if the button is clicked, false if it's unclicked
*/
bool HandlePlacePushButton(Window *w, int widget, CursorID cursor, HighLightStyle mode)
bool HandlePlacePushButton(Window *w, WidgetID widget, CursorID cursor, HighLightStyle mode)
{
if (w->IsWidgetDisabled(widget)) return false;
@@ -448,7 +448,7 @@ struct MainWindow : Window
}
}
bool OnTooltip([[maybe_unused]] Point pt, int widget, TooltipCloseCondition close_cond) override
bool OnTooltip([[maybe_unused]] Point pt, WidgetID widget, TooltipCloseCondition close_cond) override
{
if (widget != WID_M_VIEWPORT) return false;
return this->viewport->overlay->ShowTooltip(pt, close_cond);