1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-28 09:14:58 +01:00

Close #22173: Patrol path tiles change colour to show selection. (#22201)

This commit is contained in:
mrmbernardi
2024-06-30 02:54:32 +10:00
committed by GitHub
parent 30a9ade6ae
commit b4a38e42ce
2 changed files with 8 additions and 3 deletions

View File

@@ -858,12 +858,16 @@ static std::pair<int32_t, int32_t> SurfaceGetHeightAboveWater(
std::optional<colour_t> GetPatrolAreaTileColour(const CoordsXY& pos)
{
bool selected = gMapSelectFlags & MAP_SELECT_FLAG_ENABLE && gMapSelectType == MAP_SELECT_TYPE_FULL
&& pos.x >= gMapSelectPositionA.x && pos.x <= gMapSelectPositionB.x && pos.y >= gMapSelectPositionA.y
&& pos.y <= gMapSelectPositionB.y;
auto patrolAreaToRender = GetPatrolAreaToRender();
if (const auto* staffType = std::get_if<StaffType>(&patrolAreaToRender))
{
if (IsPatrolAreaSetForStaffType(*staffType, pos))
{
return COLOUR_GREY;
return selected ? COLOUR_WHITE : COLOUR_GREY;
}
}
else
@@ -874,11 +878,11 @@ std::optional<colour_t> GetPatrolAreaTileColour(const CoordsXY& pos)
{
if (staff->IsPatrolAreaSet(pos))
{
return COLOUR_LIGHT_BLUE;
return selected ? COLOUR_ICY_BLUE : COLOUR_LIGHT_BLUE;
}
else if (IsPatrolAreaSetForStaffType(staff->AssignedStaffType, pos))
{
return COLOUR_GREY;
return selected ? COLOUR_WHITE : COLOUR_GREY;
}
}
}