| 41 | } |
| 42 | |
| 43 | void DrawWidget(const Rect &r, WidgetID widget) const override |
| 44 | { |
| 45 | switch (widget) { |
| 46 | case WID_TT_SIGNS: |
| 47 | case WID_TT_TREES: |
| 48 | case WID_TT_HOUSES: |
| 49 | case WID_TT_INDUSTRIES: |
| 50 | case WID_TT_BUILDINGS: |
| 51 | case WID_TT_BRIDGES: |
| 52 | case WID_TT_STRUCTURES: |
| 53 | case WID_TT_CATENARY: |
| 54 | case WID_TT_TEXT: { |
| 55 | int i = widget - WID_TT_BEGIN; |
| 56 | if (HasBit(_transparency_lock, i)) DrawSprite(SPR_LOCK, PAL_NONE, r.left + WidgetDimensions::scaled.fullbevel.left, r.top + WidgetDimensions::scaled.fullbevel.top); |
| 57 | break; |
| 58 | } |
| 59 | case WID_TT_BUTTONS: { |
| 60 | const Rect fr = r.Shrink(WidgetDimensions::scaled.framerect); |
| 61 | for (WidgetID i = WID_TT_BEGIN; i < WID_TT_END; i++) { |
| 62 | if (i == WID_TT_TEXT) continue; // Loading and cost/income text has no invisibility button. |
| 63 | |
| 64 | const Rect wr = this->GetWidget<NWidgetBase>(i)->GetCurrentRect().Shrink(WidgetDimensions::scaled.fullbevel); |
| 65 | DrawFrameRect(wr.WithY(fr), COLOUR_PALE_GREEN, |
| 66 | HasBit(_invisibility_opt, i - WID_TT_BEGIN) ? FrameFlag::Lowered : FrameFlags{}); |
| 67 | } |
| 68 | break; |
| 69 | } |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override |
| 74 | { |
nothing calls this directly
no test coverage detected