Fix: Draw unavailable mask over picker sprite instead of behind it.
This makes these disabled picker buttons consistent with other disabled buttons.
This commit is contained in:

committed by
Peter Nelson

parent
712a4bb40b
commit
7466c3c39e
@@ -1289,9 +1289,6 @@ public:
|
||||
assert(type < _railstation.station_count);
|
||||
/* Check station availability callback */
|
||||
const StationSpec *statspec = StationClass::Get(_railstation.station_class)->GetSpec(type);
|
||||
if (!IsStationAvailable(statspec)) {
|
||||
GfxFillRect(r.Shrink(WidgetDimensions::scaled.bevel), PC_BLACK, FILLRECT_CHECKER);
|
||||
}
|
||||
|
||||
/* Set up a clipping area for the station preview. */
|
||||
Rect ir = r.Shrink(WidgetDimensions::scaled.bevel);
|
||||
@@ -1303,6 +1300,9 @@ public:
|
||||
StationPickerDrawSprite(x, y, STATION_RAIL, _cur_railtype, INVALID_ROADTYPE, 2 + _railstation.orientation);
|
||||
}
|
||||
}
|
||||
if (!IsStationAvailable(statspec)) {
|
||||
GfxFillRect(ir, PC_BLACK, FILLRECT_CHECKER);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2110,7 +2110,7 @@ struct BuildRailWaypointWindow : PickerWindowBase {
|
||||
}
|
||||
|
||||
if (!IsStationAvailable(statspec)) {
|
||||
GfxFillRect(r.Shrink(WidgetDimensions::scaled.bevel), PC_BLACK, FILLRECT_CHECKER);
|
||||
GfxFillRect(ir, PC_BLACK, FILLRECT_CHECKER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user