Zoning: Add mode to show restricted signals.
This commit is contained in:
@@ -5531,3 +5531,4 @@ STR_ZONING_CAN_BUILD :Where I can't b
|
|||||||
STR_ZONING_STA_CATCH :Station catchment
|
STR_ZONING_STA_CATCH :Station catchment
|
||||||
STR_ZONING_BUL_UNSER :Unserved buildings
|
STR_ZONING_BUL_UNSER :Unserved buildings
|
||||||
STR_ZONING_IND_UNSER :Unserved industries
|
STR_ZONING_IND_UNSER :Unserved industries
|
||||||
|
STR_ZONING_TRACERESTRICT :Restricted signals
|
||||||
|
@@ -25,6 +25,7 @@ enum ZoningEvaluationMode {
|
|||||||
ZEM_STA_CATCH, ///< Check catchment area for stations
|
ZEM_STA_CATCH, ///< Check catchment area for stations
|
||||||
ZEM_BUL_UNSER, ///< Check for unserved buildings
|
ZEM_BUL_UNSER, ///< Check for unserved buildings
|
||||||
ZEM_IND_UNSER, ///< Check for unserved industries
|
ZEM_IND_UNSER, ///< Check for unserved industries
|
||||||
|
ZEM_TRACERESTRICT, ///< Check for restricted signals
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
#include "station_func.h"
|
#include "station_func.h"
|
||||||
#include "station_map.h"
|
#include "station_map.h"
|
||||||
#include "town.h"
|
#include "town.h"
|
||||||
|
#include "tracerestrict.h"
|
||||||
#include "zoning.h"
|
#include "zoning.h"
|
||||||
|
|
||||||
Zoning _zoning;
|
Zoning _zoning;
|
||||||
@@ -286,6 +287,22 @@ SpriteID TileZoneCheckUnservedIndustriesEvaluation(TileIndex tile, Owner owner)
|
|||||||
return ZONING_INVALID_SPRITE_ID;
|
return ZONING_INVALID_SPRITE_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Detect whether a tile is a restricted signal tile
|
||||||
|
*
|
||||||
|
* @param TileIndex tile
|
||||||
|
* @param Owner owner
|
||||||
|
* @return red if a restricted signal, nothing otherwise
|
||||||
|
*/
|
||||||
|
SpriteID TileZoneCheckTraceRestrictEvaluation(TileIndex tile, Owner owner)
|
||||||
|
{
|
||||||
|
if (IsTileType(tile, MP_RAILWAY) && HasSignals(tile) && IsRestrictedSignal(tile)) {
|
||||||
|
return SPR_ZONING_INNER_HIGHLIGHT_RED;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ZONING_INVALID_SPRITE_ID;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* General evaluation function; calls all the other functions depending on
|
* General evaluation function; calls all the other functions depending on
|
||||||
* evaluation mode.
|
* evaluation mode.
|
||||||
@@ -306,6 +323,7 @@ SpriteID TileZoningSpriteEvaluation(TileIndex tile, Owner owner, ZoningEvaluatio
|
|||||||
case ZEM_STA_CATCH: return TileZoneCheckStationCatchmentEvaluation(tile, owner);
|
case ZEM_STA_CATCH: return TileZoneCheckStationCatchmentEvaluation(tile, owner);
|
||||||
case ZEM_BUL_UNSER: return TileZoneCheckUnservedBuildingsEvaluation(tile, owner);
|
case ZEM_BUL_UNSER: return TileZoneCheckUnservedBuildingsEvaluation(tile, owner);
|
||||||
case ZEM_IND_UNSER: return TileZoneCheckUnservedIndustriesEvaluation(tile, owner);
|
case ZEM_IND_UNSER: return TileZoneCheckUnservedIndustriesEvaluation(tile, owner);
|
||||||
|
case ZEM_TRACERESTRICT: return TileZoneCheckTraceRestrictEvaluation(tile, owner);
|
||||||
default: return ZONING_INVALID_SPRITE_ID;
|
default: return ZONING_INVALID_SPRITE_ID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -40,6 +40,7 @@ static const StringID _zone_type_strings[] = {
|
|||||||
STR_ZONING_STA_CATCH,
|
STR_ZONING_STA_CATCH,
|
||||||
STR_ZONING_BUL_UNSER,
|
STR_ZONING_BUL_UNSER,
|
||||||
STR_ZONING_IND_UNSER,
|
STR_ZONING_IND_UNSER,
|
||||||
|
STR_ZONING_TRACERESTRICT,
|
||||||
INVALID_STRING_ID
|
INVALID_STRING_ID
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -50,6 +51,7 @@ static const ZoningEvaluationMode _zone_type_modes[] = {
|
|||||||
ZEM_STA_CATCH,
|
ZEM_STA_CATCH,
|
||||||
ZEM_BUL_UNSER,
|
ZEM_BUL_UNSER,
|
||||||
ZEM_IND_UNSER,
|
ZEM_IND_UNSER,
|
||||||
|
ZEM_TRACERESTRICT,
|
||||||
};
|
};
|
||||||
|
|
||||||
static ZoningEvaluationMode DropDownIndexToZoningEvaluationMode(int index)
|
static ZoningEvaluationMode DropDownIndexToZoningEvaluationMode(int index)
|
||||||
|
Reference in New Issue
Block a user