Add airport tile variables to get airport type local ID and layout
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "debug.h"
|
||||
#include "newgrf_airporttiles.h"
|
||||
#include "newgrf_extension.h"
|
||||
#include "newgrf_spritegroup.h"
|
||||
#include "newgrf_sound.h"
|
||||
#include "station_base.h"
|
||||
@@ -192,6 +193,12 @@ static uint32 GetAirportTileIDAtOffset(TileIndex tile, const Station *st, uint32
|
||||
|
||||
/* Get airport tile ID at offset */
|
||||
case 0x62: return GetAirportTileIDAtOffset(GetNearbyTile(parameter, this->tile), this->st, this->ro.grffile->grfid);
|
||||
|
||||
case A2VRI_AIRPORTTILES_AIRPORT_LAYOUT:
|
||||
return this->st->airport.layout;
|
||||
|
||||
case A2VRI_AIRPORTTILES_AIRPORT_ID:
|
||||
return this->st->airport.GetSpec()->grf_prop.local_id;
|
||||
}
|
||||
|
||||
DEBUG(grf, 1, "Unhandled airport tile variable 0x%X", variable);
|
||||
|
@@ -61,6 +61,7 @@ extern const GRFFeatureInfo _grf_feature_list[] = {
|
||||
GRFFeatureInfo("action0_object_edge_foundation_mode", 2),
|
||||
GRFFeatureInfo("action0_object_flood_resistant", 1),
|
||||
GRFFeatureInfo("action0_object_viewport_map_tile_type", 1),
|
||||
GRFFeatureInfo("varaction2_airporttiles_airport_info", 1),
|
||||
GRFFeatureInfo("road_stops", 9, GFTOF_ROAD_STOPS),
|
||||
GRFFeatureInfo("new_landscape", 2),
|
||||
GRFFeatureInfo("more_objects_per_grf", 1),
|
||||
@@ -179,6 +180,8 @@ extern const GRFVariableMapDefinition _grf_action2_remappable_variables[] = {
|
||||
GRFVariableMapDefinition(GSF_SIGNALS, A2VRI_SIGNALS_SIGNAL_STYLE, "signals_signal_style"),
|
||||
GRFVariableMapDefinition(GSF_SIGNALS, A2VRI_SIGNALS_SIGNAL_SIDE, "signals_signal_side"),
|
||||
GRFVariableMapDefinition(GSF_SIGNALS, A2VRI_SIGNALS_SIGNAL_VERTICAL_CLEARANCE, "signals_signal_vertical_clearance"),
|
||||
GRFVariableMapDefinition(GSF_AIRPORTTILES, A2VRI_AIRPORTTILES_AIRPORT_LAYOUT, "airporttiles_airport_layout"),
|
||||
GRFVariableMapDefinition(GSF_AIRPORTTILES, A2VRI_AIRPORTTILES_AIRPORT_ID, "airporttiles_airport_id"),
|
||||
GRFVariableMapDefinition(GSF_FAKE_TOWNS, A2VRI_TOWNS_HOUSE_COUNT, "town_house_count"),
|
||||
GRFVariableMapDefinition(GSF_FAKE_TOWNS, A2VRI_TOWNS_POPULATION, "town_population"),
|
||||
GRFVariableMapDefinition(GSF_FAKE_TOWNS, A2VRI_TOWNS_ZONE_0, "town_zone_0_radius_square"),
|
||||
|
@@ -91,6 +91,8 @@ enum Action2VariableRemapIds {
|
||||
A2VRI_SIGNALS_SIGNAL_STYLE,
|
||||
A2VRI_SIGNALS_SIGNAL_SIDE,
|
||||
A2VRI_SIGNALS_SIGNAL_VERTICAL_CLEARANCE,
|
||||
A2VRI_AIRPORTTILES_AIRPORT_LAYOUT,
|
||||
A2VRI_AIRPORTTILES_AIRPORT_ID,
|
||||
A2VRI_TOWNS_HOUSE_COUNT,
|
||||
A2VRI_TOWNS_POPULATION,
|
||||
A2VRI_TOWNS_ZONE_0,
|
||||
|
@@ -1702,6 +1702,19 @@ static const NICallback _nic_airporttiles[] = {
|
||||
NIC_END()
|
||||
};
|
||||
|
||||
static const NIVariable _niv_airporttiles[] = {
|
||||
NIV(0x41, "ground type"),
|
||||
NIV(0x42, "current town zone in nearest town"),
|
||||
NIV(0x43, "relative position"),
|
||||
NIV(0x44, "animation frame"),
|
||||
NIV(0x60, "land info of nearby tiles"),
|
||||
NIV(0x61, "animation stage of nearby tiles"),
|
||||
NIV(0x62, "get industry or airport tile ID at offset"),
|
||||
NIV(A2VRI_AIRPORTTILES_AIRPORT_LAYOUT, "airport layout"),
|
||||
NIV(A2VRI_AIRPORTTILES_AIRPORT_ID, "airport local ID"),
|
||||
NIV_END()
|
||||
};
|
||||
|
||||
class NIHAirportTile : public NIHelper {
|
||||
bool IsInspectable(uint index) const override { return AirportTileSpec::Get(GetAirportGfx(index))->grf_prop.grffile != nullptr; }
|
||||
uint GetParent(uint index) const override { return GetTownInspectWindowNumber(Station::GetByTile(index)->town); }
|
||||
@@ -1733,7 +1746,7 @@ class NIHAirportTile : public NIHelper {
|
||||
static const NIFeature _nif_airporttile = {
|
||||
nullptr,
|
||||
_nic_airporttiles,
|
||||
_niv_industrytiles, // Yes, they share this (at least now)
|
||||
_niv_airporttiles,
|
||||
new NIHAirportTile(),
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user