|
|
|
@ -1232,8 +1232,8 @@ public:
|
|
|
|
|
case WID_BRAS_PLATFORM_DIR_X:
|
|
|
|
|
case WID_BRAS_PLATFORM_DIR_Y:
|
|
|
|
|
case WID_BRAS_IMAGE:
|
|
|
|
|
size->width = ScaleGUITrad(64) + 2;
|
|
|
|
|
size->height = ScaleGUITrad(58) + 2;
|
|
|
|
|
size->width = ScaleGUITrad(64) + WD_BEVEL_LEFT + WD_BEVEL_RIGHT;
|
|
|
|
|
size->height = ScaleGUITrad(58) + WD_BEVEL_TOP + WD_BEVEL_BOTTOM;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case WID_BRAS_COVERAGE_TEXTS:
|
|
|
|
@ -1257,8 +1257,8 @@ public:
|
|
|
|
|
if (FillDrawPixelInfo(&tmp_dpi, r.left, r.top, r.Width(), r.Height())) {
|
|
|
|
|
DrawPixelInfo *old_dpi = _cur_dpi;
|
|
|
|
|
_cur_dpi = &tmp_dpi;
|
|
|
|
|
int x = ScaleGUITrad(31) + 1;
|
|
|
|
|
int y = r.bottom - r.top - ScaleGUITrad(31);
|
|
|
|
|
int x = (r.Width() - ScaleGUITrad(64)) / 2 + ScaleGUITrad(31);
|
|
|
|
|
int y = (r.Height() + ScaleGUITrad(58)) / 2 - ScaleGUITrad(31);
|
|
|
|
|
if (!DrawStationTile(x, y, _cur_railtype, AXIS_X, _railstation.station_class, _railstation.station_type)) {
|
|
|
|
|
StationPickerDrawSprite(x, y, STATION_RAIL, _cur_railtype, INVALID_ROADTYPE, 2);
|
|
|
|
|
}
|
|
|
|
@ -1271,8 +1271,8 @@ public:
|
|
|
|
|
if (FillDrawPixelInfo(&tmp_dpi, r.left, r.top, r.Width(), r.Height())) {
|
|
|
|
|
DrawPixelInfo *old_dpi = _cur_dpi;
|
|
|
|
|
_cur_dpi = &tmp_dpi;
|
|
|
|
|
int x = ScaleGUITrad(31) + 1;
|
|
|
|
|
int y = r.bottom - r.top - ScaleGUITrad(31);
|
|
|
|
|
int x = (r.Width() - ScaleGUITrad(64)) / 2 + ScaleGUITrad(31);
|
|
|
|
|
int y = (r.Height() + ScaleGUITrad(58)) / 2 - ScaleGUITrad(31);
|
|
|
|
|
if (!DrawStationTile(x, y, _cur_railtype, AXIS_Y, _railstation.station_class, _railstation.station_type)) {
|
|
|
|
|
StationPickerDrawSprite(x, y, STATION_RAIL, _cur_railtype, INVALID_ROADTYPE, 3);
|
|
|
|
|
}
|
|
|
|
@ -1308,8 +1308,8 @@ public:
|
|
|
|
|
if (FillDrawPixelInfo(&tmp_dpi, r.left, r.top, r.Width(), r.Height())) {
|
|
|
|
|
DrawPixelInfo *old_dpi = _cur_dpi;
|
|
|
|
|
_cur_dpi = &tmp_dpi;
|
|
|
|
|
int x = ScaleGUITrad(31) + 1;
|
|
|
|
|
int y = r.bottom - r.top - ScaleGUITrad(31);
|
|
|
|
|
int x = (r.Width() - ScaleGUITrad(64)) / 2 + ScaleGUITrad(31);
|
|
|
|
|
int y = (r.Height() + ScaleGUITrad(58)) / 2 - ScaleGUITrad(31);
|
|
|
|
|
if (!DrawStationTile(x, y, _cur_railtype, _railstation.orientation, _railstation.station_class, type)) {
|
|
|
|
|
StationPickerDrawSprite(x, y, STATION_RAIL, _cur_railtype, INVALID_ROADTYPE, 2 + _railstation.orientation);
|
|
|
|
|
}
|
|
|
|
@ -1929,15 +1929,23 @@ struct BuildRailDepotWindow : public PickerWindowBase {
|
|
|
|
|
{
|
|
|
|
|
if (!IsInsideMM(widget, WID_BRAD_DEPOT_NE, WID_BRAD_DEPOT_NW + 1)) return;
|
|
|
|
|
|
|
|
|
|
size->width = ScaleGUITrad(64) + 2;
|
|
|
|
|
size->height = ScaleGUITrad(48) + 2;
|
|
|
|
|
size->width = ScaleGUITrad(64) + WD_BEVEL_LEFT + WD_BEVEL_RIGHT;
|
|
|
|
|
size->height = ScaleGUITrad(48) + WD_BEVEL_TOP + WD_BEVEL_BOTTOM;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void DrawWidget(const Rect &r, int widget) const override
|
|
|
|
|
{
|
|
|
|
|
if (!IsInsideMM(widget, WID_BRAD_DEPOT_NE, WID_BRAD_DEPOT_NW + 1)) return;
|
|
|
|
|
|
|
|
|
|
DrawTrainDepotSprite(r.left + 1 + ScaleGUITrad(31), r.bottom - ScaleGUITrad(31), widget - WID_BRAD_DEPOT_NE + DIAGDIR_NE, _cur_railtype);
|
|
|
|
|
DrawPixelInfo tmp_dpi;
|
|
|
|
|
if (FillDrawPixelInfo(&tmp_dpi, r.left, r.top, r.Width(), r.Height())) {
|
|
|
|
|
DrawPixelInfo *old_dpi = _cur_dpi;
|
|
|
|
|
_cur_dpi = &tmp_dpi;
|
|
|
|
|
int x = (r.Width() - ScaleGUITrad(64)) / 2 + ScaleGUITrad(31);
|
|
|
|
|
int y = (r.Height() + ScaleGUITrad(48)) / 2 - ScaleGUITrad(31);
|
|
|
|
|
DrawTrainDepotSprite(x, y, widget - WID_BRAD_DEPOT_NE + DIAGDIR_NE, _cur_railtype);
|
|
|
|
|
_cur_dpi = old_dpi;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OnClick(Point pt, int widget, int click_count) override
|
|
|
|
@ -2028,8 +2036,8 @@ struct BuildRailWaypointWindow : PickerWindowBase {
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case WID_BRW_WAYPOINT:
|
|
|
|
|
size->width = ScaleGUITrad(64) + 2;
|
|
|
|
|
size->height = ScaleGUITrad(58) + 2;
|
|
|
|
|
size->width = ScaleGUITrad(64) + WD_BEVEL_LEFT + WD_BEVEL_RIGHT;
|
|
|
|
|
size->height = ScaleGUITrad(58) + WD_BEVEL_TOP + WD_BEVEL_BOTTOM;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -2040,7 +2048,16 @@ struct BuildRailWaypointWindow : PickerWindowBase {
|
|
|
|
|
case WID_BRW_WAYPOINT: {
|
|
|
|
|
byte type = GB(widget, 16, 16);
|
|
|
|
|
const StationSpec *statspec = StationClass::Get(STAT_CLASS_WAYP)->GetSpec(type);
|
|
|
|
|
DrawWaypointSprite(r.left + 1 + ScaleGUITrad(31), r.bottom - ScaleGUITrad(31), type, _cur_railtype);
|
|
|
|
|
|
|
|
|
|
DrawPixelInfo tmp_dpi;
|
|
|
|
|
if (FillDrawPixelInfo(&tmp_dpi, r.left, r.top, r.Width(), r.Height())) {
|
|
|
|
|
DrawPixelInfo *old_dpi = _cur_dpi;
|
|
|
|
|
_cur_dpi = &tmp_dpi;
|
|
|
|
|
int x = (r.Width() - ScaleGUITrad(64)) / 2 + ScaleGUITrad(31);
|
|
|
|
|
int y = (r.Height() + ScaleGUITrad(58)) / 2 - ScaleGUITrad(31);
|
|
|
|
|
DrawWaypointSprite(x, y, type, _cur_railtype);
|
|
|
|
|
_cur_dpi = old_dpi;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!IsStationAvailable(statspec)) {
|
|
|
|
|
GfxFillRect(r.Shrink(WD_BEVEL_LEFT, WD_BEVEL_TOP, WD_BEVEL_RIGHT, WD_BEVEL_BOTTOM), PC_BLACK, FILLRECT_CHECKER);
|
|
|
|
|