1
0
Fork 0

Compare commits

...

3 Commits

Author SHA1 Message Date
SamuXarick 17601c03a1
Merge 3c44d5ba5a into 8675d7b498 2025-07-29 04:48:30 +00:00
translators 8675d7b498 Update: Translations from eints
chinese (simplified): 5 changes by WenSimEHRP
2025-07-29 04:48:22 +00:00
SamuXarick 3c44d5ba5a Add: [Script] GetBaseStationID
Added ScriptBaseStation::GetBaseStationID to get the StationID of a tile, if there is a basestation (Station or Waypoint).
2025-05-22 14:04:24 +01:00
5 changed files with 22 additions and 0 deletions

View File

@ -634,8 +634,11 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}在货
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}切换显示货物
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
STR_GRAPH_INDUSTRY_CAPTION :{WHITE}{INDUSTRY} - 货物历史
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :已生产
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :已运输
STR_GRAPH_INDUSTRY_RANGE_DELIVERED :已送抵
STR_GRAPH_INDUSTRY_RANGE_WAITING :库存
STR_GRAPH_PERFORMANCE_DETAIL_TOOLTIP :{BLACK}查看详细数据
@ -4023,6 +4026,8 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}上月
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}上分钟产量:
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK}(已运输 {COMMA}%
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}将屏幕中心移动到当前工业的位置。按住 <Ctrl> 键点选会在新视点中显示工业位置
STR_INDUSTRY_VIEW_CARGO_GRAPH :{BLACK}货物图表
STR_INDUSTRY_VIEW_CARGO_GRAPH_TOOLTIP :{BLACK}显示工业货物历史图表
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}生产等级:{YELLOW}{COMMA}%
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}此工业已经宣布即刻停业倒闭!

View File

@ -28,6 +28,7 @@
* \li AICargo::CC_POTABLE
* \li AICargo::CC_NON_POTABLE
* \li AIVehicleList_Waypoint
* \li AIBaseStation::GetBaseStationID
*
* Other changes:
* \li AIBridge::GetBridgeID renamed to AIBridge::GetBridgeType

View File

@ -29,6 +29,7 @@
* \li GSCargo::CC_NON_POTABLE
* \li GSVehicleList_Waypoint
* \li GSBaseStation::GetOwner
* \li GSBaseStation::GetBaseStationID
*
* Other changes:
* \li GSBridge::GetBridgeID renamed to GSBridge::GetBridgeType

View File

@ -34,6 +34,12 @@
return ScriptCompany::ToScriptCompanyID(::BaseStation::Get(station_id)->owner);
}
/* static */ StationID ScriptBaseStation::GetBaseStationID(TileIndex tile)
{
if (!::IsValidTile(tile) || !::IsTileType(tile, MP_STATION) || ::BaseStation::GetByTile(tile) == nullptr) return StationID::Invalid();
return ::GetStationIndex(tile);
}
/* static */ std::optional<std::string> ScriptBaseStation::GetName(StationID station_id)
{
if (!IsValidBaseStation(station_id)) return std::nullopt;

View File

@ -42,6 +42,15 @@ public:
*/
static ScriptCompany::CompanyID GetOwner(StationID station_id);
/**
* Get the StationID of a tile, if there is a basestation.
* @param tile The tile to find the StationID of.
* @pre IsValidTile(tile).
* @return StationID of the basestation.
* @post Use IsValidBaseStation() to see if the basestation is valid.
*/
static StationID GetBaseStationID(TileIndex tile);
/**
* Get the name of a basestation.
* @param station_id The basestation to get the name of.