diff --git a/src/transparency_gui.cpp b/src/transparency_gui.cpp --- a/src/transparency_gui.cpp +++ b/src/transparency_gui.cpp @@ -39,7 +39,7 @@ public: this->DrawWidgets(); } - void DrawWidget(const Rect &r, int widget) const override + void DrawWidget(const Rect &r, WidgetID widget) const override { switch (widget) { case WID_TT_SIGNS: @@ -51,13 +51,13 @@ public: case WID_TT_STRUCTURES: case WID_TT_CATENARY: case WID_TT_TEXT: { - uint i = widget - WID_TT_BEGIN; + int i = widget - WID_TT_BEGIN; if (HasBit(_transparency_lock, i)) DrawSprite(SPR_LOCK, PAL_NONE, r.left + WidgetDimensions::scaled.fullbevel.left, r.top + WidgetDimensions::scaled.fullbevel.top); break; } case WID_TT_BUTTONS: { const Rect fr = r.Shrink(WidgetDimensions::scaled.framerect); - for (uint i = WID_TT_BEGIN; i < WID_TT_END; i++) { + for (WidgetID i = WID_TT_BEGIN; i < WID_TT_END; i++) { if (i == WID_TT_TEXT) continue; // Loading and cost/income text has no invisibility button. const Rect wr = this->GetWidget(i)->GetCurrentRect().Shrink(WidgetDimensions::scaled.fullbevel); @@ -69,7 +69,7 @@ public: } } - 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_BEGIN && widget < WID_TT_END) { if (_ctrl_pressed) { @@ -119,7 +119,7 @@ public: void OnInvalidateData([[maybe_unused]] int data = 0, [[maybe_unused]] bool gui_scope = true) override { if (!gui_scope) return; - for (uint i = WID_TT_BEGIN; i < WID_TT_END; i++) { + for (WidgetID i = WID_TT_BEGIN; i < WID_TT_END; i++) { this->SetWidgetLoweredState(i, IsTransparencySet((TransparencyOption)(i - WID_TT_BEGIN))); } }