| 1197 | } |
| 1198 | |
| 1199 | void DrawWidget(const Rect &r, WidgetID widget) const override |
| 1200 | { |
| 1201 | DrawPixelInfo tmp_dpi; |
| 1202 | |
| 1203 | switch (widget) { |
| 1204 | case WID_BRAS_PLATFORM_DIR_X: { |
| 1205 | /* Set up a clipping area for the '/' station preview */ |
| 1206 | Rect ir = r.Shrink(WidgetDimensions::scaled.bevel); |
| 1207 | if (FillDrawPixelInfo(&tmp_dpi, ir)) { |
| 1208 | AutoRestoreBackup dpi_backup(_cur_dpi, &tmp_dpi); |
| 1209 | int x = (ir.Width() - ScaleSpriteTrad(PREVIEW_WIDTH)) / 2 + ScaleSpriteTrad(PREVIEW_LEFT); |
| 1210 | int y = (ir.Height() + ScaleSpriteTrad(PREVIEW_HEIGHT)) / 2 - ScaleSpriteTrad(PREVIEW_BOTTOM); |
| 1211 | if (!DrawStationTile(x, y, _cur_railtype, AXIS_X, _station_gui.sel_class, _station_gui.sel_type)) { |
| 1212 | StationPickerDrawSprite(x, y, StationType::Rail, _cur_railtype, INVALID_ROADTYPE, 2); |
| 1213 | } |
| 1214 | } |
| 1215 | break; |
| 1216 | } |
| 1217 | |
| 1218 | case WID_BRAS_PLATFORM_DIR_Y: { |
| 1219 | /* Set up a clipping area for the '\' station preview */ |
| 1220 | Rect ir = r.Shrink(WidgetDimensions::scaled.bevel); |
| 1221 | if (FillDrawPixelInfo(&tmp_dpi, ir)) { |
| 1222 | AutoRestoreBackup dpi_backup(_cur_dpi, &tmp_dpi); |
| 1223 | int x = (ir.Width() - ScaleSpriteTrad(PREVIEW_WIDTH)) / 2 + ScaleSpriteTrad(PREVIEW_LEFT); |
| 1224 | int y = (ir.Height() + ScaleSpriteTrad(PREVIEW_HEIGHT)) / 2 - ScaleSpriteTrad(PREVIEW_BOTTOM); |
| 1225 | if (!DrawStationTile(x, y, _cur_railtype, AXIS_Y, _station_gui.sel_class, _station_gui.sel_type)) { |
| 1226 | StationPickerDrawSprite(x, y, StationType::Rail, _cur_railtype, INVALID_ROADTYPE, 3); |
| 1227 | } |
| 1228 | } |
| 1229 | break; |
| 1230 | } |
| 1231 | |
| 1232 | default: |
| 1233 | this->PickerWindow::DrawWidget(r, widget); |
| 1234 | break; |
| 1235 | } |
| 1236 | } |
| 1237 | |
| 1238 | void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override |
| 1239 | { |
nothing calls this directly
no test coverage detected