mirror of https://github.com/OpenTTD/OpenTTD
Compare commits
10 Commits
8318c1911b
...
82bfa4e1d4
Author | SHA1 | Date |
---|---|---|
|
82bfa4e1d4 | |
|
ae917cb8c6 | |
|
5e984eec1a | |
|
a48f491f09 | |
|
3ef5783bf9 | |
|
7f6b5d3103 | |
|
5a1a8adb3f | |
|
1000875f88 | |
|
1f5ae37e2c | |
|
3be979cc05 |
35
src/bridge.h
35
src/bridge.h
|
@ -37,6 +37,30 @@ constexpr uint SPRITES_PER_BRIDGE_PIECE = 32; ///< Number of sprites there are p
|
|||
|
||||
typedef uint BridgeType; ///< Bridge spec number.
|
||||
|
||||
/**
|
||||
* Actions that can be performed when the vehicle enters the depot.
|
||||
*/
|
||||
enum class BridgePiecePillarFlag : uint8_t {
|
||||
BPPF_CORNER_W = 1 << 0,
|
||||
BPPF_CORNER_S = 1 << 1,
|
||||
BPPF_CORNER_E = 1 << 2,
|
||||
BPPF_CORNER_N = 1 << 3,
|
||||
BPPF_ALL_CORNERS = 0xF,
|
||||
BPPF_EDGE_NE = 1 << 4,
|
||||
BPPF_EDGE_SE = 1 << 5,
|
||||
BPPF_EDGE_SW = 1 << 6,
|
||||
BPPF_EDGE_NW = 1 << 7,
|
||||
};
|
||||
using BridgePiecePillarFlags = EnumBitSet<BridgePiecePillarFlag, uint8_t>;
|
||||
|
||||
enum class BridgeSpecCtrlFlag : uint8_t{
|
||||
BSCF_CUSTOM_PILLAR_FLAGS,
|
||||
BSCF_INVALID_PILLAR_FLAGS,
|
||||
BSCF_NOT_AVAILABLE_TOWN,
|
||||
BSCF_NOT_AVAILABLE_AI_GS,
|
||||
};
|
||||
using BridgeSpecCtrlFlags = EnumBitSet<BridgeSpecCtrlFlag, uint8_t>;
|
||||
|
||||
/**
|
||||
* Struct containing information about a single bridge type
|
||||
*/
|
||||
|
@ -52,6 +76,8 @@ struct BridgeSpec {
|
|||
StringID transport_name[2]; ///< description of the bridge, when built for road or rail
|
||||
std::vector<std::vector<PalSpriteID>> sprite_table; ///< table of sprites for drawing the bridge
|
||||
uint8_t flags; ///< bit 0 set: disable drawing of far pillars.
|
||||
BridgeSpecCtrlFlags ctrl_flags; ///< control flags
|
||||
std::array<BridgePiecePillarFlags, 12> pillar_flags; ///< bridge pillar flags: 6 x pairs of x and y flags
|
||||
};
|
||||
|
||||
extern BridgeSpec _bridge[MAX_BRIDGES];
|
||||
|
@ -75,6 +101,15 @@ void DrawBridgeMiddle(const TileInfo *ti);
|
|||
CommandCost CheckBridgeAvailability(BridgeType bridge_type, uint bridge_len, DoCommandFlags flags = {});
|
||||
int CalcBridgeLenCostFactor(int x);
|
||||
|
||||
BridgePiecePillarFlags GetBridgeTilePillarFlags(TileIndex tile, TileIndex northern_bridge_end, TileIndex southern_bridge_end, BridgeType bridge_type, TransportType bridge_transport_type);
|
||||
|
||||
struct BridgePieceDebugInfo {
|
||||
BridgePieces piece;
|
||||
BridgePiecePillarFlags pillar_flags;
|
||||
uint pillar_index;
|
||||
};
|
||||
BridgePieceDebugInfo GetBridgePieceDebugInfo(TileIndex tile);
|
||||
|
||||
void ResetBridges();
|
||||
|
||||
#endif /* BRIDGE_H */
|
||||
|
|
|
@ -382,6 +382,8 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo
|
|||
StringID errmsg = INVALID_STRING_ID;
|
||||
CommandCost ret = Command<CMD_BUILD_BRIDGE>::Do(CommandFlagsToDCFlags(GetCommandFlags<CMD_BUILD_BRIDGE>()) | DoCommandFlag::QueryCost, end, start, transport_type, 0, road_rail_type);
|
||||
|
||||
const bool query_per_bridge_type = ret.Failed() && (ret.GetErrorMessage() == STR_ERROR_BRIDGE_TOO_LOW_FOR_STATION || ret.GetErrorMessage() == STR_ERROR_BRIDGE_PILLARS_OBSTRUCT_STATION);
|
||||
|
||||
GUIBridgeList bl;
|
||||
if (ret.Failed()) {
|
||||
errmsg = ret.GetErrorMessage();
|
||||
|
@ -415,11 +417,13 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo
|
|||
}
|
||||
|
||||
bool any_available = false;
|
||||
StringID type_errmsg = INVALID_STRING_ID;
|
||||
CommandCost type_check;
|
||||
/* loop for all bridgetypes */
|
||||
for (BridgeType brd_type = 0; brd_type != MAX_BRIDGES; brd_type++) {
|
||||
type_check = CheckBridgeAvailability(brd_type, bridge_len);
|
||||
if (type_check.Succeeded()) {
|
||||
if (query_per_bridge_type && Command<CMD_BUILD_BRIDGE>::Do(CommandFlagsToDCFlags(GetCommandFlags<CMD_BUILD_BRIDGE>()) | DoCommandFlag::QueryCost, end, start, transport_type, brd_type, road_rail_type).Failed()) continue;
|
||||
/* bridge is accepted, add to list */
|
||||
BuildBridgeData &item = bl.emplace_back();
|
||||
item.index = brd_type;
|
||||
|
@ -428,10 +432,12 @@ void ShowBuildBridgeWindow(TileIndex start, TileIndex end, TransportType transpo
|
|||
* bridge itself (not computed with DoCommandFlag::QueryCost) */
|
||||
item.cost = ret.GetCost() + (((int64_t)tot_bridgedata_len * _price[PR_BUILD_BRIDGE] * item.spec->price) >> 8) + infra_cost;
|
||||
any_available = true;
|
||||
} else if (type_check.GetErrorMessage() != INVALID_STRING_ID && !query_per_bridge_type) {
|
||||
type_errmsg = type_check.GetErrorMessage();
|
||||
}
|
||||
}
|
||||
/* give error cause if no bridges available here*/
|
||||
if (!any_available)
|
||||
if (!any_available && type_errmsg != INVALID_STRING_ID) errmsg = type_errmsg;
|
||||
{
|
||||
errmsg = type_check.GetErrorMessage();
|
||||
}
|
||||
|
|
|
@ -5244,6 +5244,8 @@ STR_ERROR_START_AND_END_MUST_BE_IN :{WHITE}Start an
|
|||
STR_ERROR_ENDS_OF_BRIDGE_MUST_BOTH :{WHITE}... ends of bridge must both be on land
|
||||
STR_ERROR_BRIDGE_TOO_LONG :{WHITE}... bridge too long
|
||||
STR_ERROR_BRIDGE_THROUGH_MAP_BORDER :{WHITE}Bridge would end out of the map
|
||||
STR_ERROR_BRIDGE_TOO_LOW_FOR_STATION :{WHITE}Bridge is too low for station
|
||||
STR_ERROR_BRIDGE_PILLARS_OBSTRUCT_STATION :{WHITE}Bridge pillars obstruct station
|
||||
|
||||
# Tunnel related errors
|
||||
STR_ERROR_CAN_T_BUILD_TUNNEL_HERE :{WHITE}Can't build tunnel here...
|
||||
|
|
|
@ -267,6 +267,7 @@ STR_UNITS_YEARS :{NUM}{NBSP}năm
|
|||
STR_UNITS_PERIODS :{NUM}{NBSP}kỳ
|
||||
|
||||
STR_LIST_SEPARATOR :,{SPACE}
|
||||
STR_TRUNCATION_ELLIPSIS :...
|
||||
|
||||
# Common window strings
|
||||
STR_LIST_FILTER_TITLE :{BLACK}Lọc:
|
||||
|
@ -285,7 +286,7 @@ STR_TOOLTIP_CLOSE_WINDOW :{BLACK}Đóng c
|
|||
STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS :{BLACK}Tiêu đề cửa sổ - kéo nó để di chuyển cửa số
|
||||
STR_TOOLTIP_SHADE :{BLACK}Thu gọn cửa sổ - Chỉ hiển thị thanh tiêu đề
|
||||
STR_TOOLTIP_DEBUG :{BLACK}Hiện thông tin debug của NewGRF
|
||||
STR_TOOLTIP_DEFSIZE :{BLACK}Chuyển cửa sổ về kích thước mặc định. Ctrl+Click để lưu kích thước hiện tại làm mặc định
|
||||
STR_TOOLTIP_DEFSIZE :{BLACK}Chuyển cửa sổ về kích thước mặc định. Ctrl+Click để lưu kích thước hiện tại làm mặc định. Ctri+Click kép để thiết lập lại mặc định cũ.
|
||||
STR_TOOLTIP_STICKY :{BLACK}Đánh dấu không-thể-đóng khi bấm nút "Đóng Tất Cả Cửa Sổ". Ctrl+Click để lưu thành trạng thái mặc định
|
||||
STR_TOOLTIP_RESIZE :{BLACK}Click và kéo để thay đổi kích thước cửa sổ
|
||||
STR_TOOLTIP_TOGGLE_LARGE_SMALL_WINDOW :{BLACK}Bật kích cỡ cửa sổ lớn/nhỏ
|
||||
|
@ -451,6 +452,12 @@ STR_SETTINGS_MENU_SANDBOX_OPTIONS :Tuỳ chọn Sa
|
|||
STR_SETTINGS_MENU_TRANSPARENCY_OPTIONS :Thiết lập hiệu ứng trong suốt
|
||||
STR_SETTINGS_MENU_TOWN_NAMES_DISPLAYED :Hiển thị tên thị trấn
|
||||
STR_SETTINGS_MENU_STATION_NAMES_DISPLAYED :Hiển thị tên nhà ga
|
||||
STR_SETTINGS_MENU_STATION_NAMES_TRAIN :Ga tàu
|
||||
STR_SETTINGS_MENU_STATION_NAMES_LORRY :Trạm xe tải
|
||||
STR_SETTINGS_MENU_STATION_NAMES_BUS :Trạm xe buýt
|
||||
STR_SETTINGS_MENU_STATION_NAMES_SHIP :Cảng
|
||||
STR_SETTINGS_MENU_STATION_NAMES_PLANE :Sân bay
|
||||
STR_SETTINGS_MENU_STATION_NAMES_GHOST :Trạm ma
|
||||
STR_SETTINGS_MENU_WAYPOINTS_DISPLAYED :Hiển thị tên điểm mốc
|
||||
STR_SETTINGS_MENU_SIGNS_DISPLAYED :Hiển thị ký hiệu
|
||||
STR_SETTINGS_MENU_SHOW_COMPETITOR_SIGNS :Hiển thị biển hiệu và tên của đối thủ
|
||||
|
@ -627,8 +634,11 @@ STR_GRAPH_CARGO_TOOLTIP_DISABLE_ALL :{BLACK}Không h
|
|||
STR_GRAPH_CARGO_PAYMENT_TOGGLE_CARGO :{BLACK}Bật/tắt đồ thị cho hàng hóa này
|
||||
STR_GRAPH_CARGO_PAYMENT_CARGO :{TINY_FONT}{BLACK}{STRING}
|
||||
|
||||
STR_GRAPH_INDUSTRY_CAPTION :{WHITE}{INDUSTRY} - Lịch sử hàng hóa
|
||||
STR_GRAPH_INDUSTRY_RANGE_PRODUCED :Đã cung cấp
|
||||
STR_GRAPH_INDUSTRY_RANGE_TRANSPORTED :Đã vận chuyển
|
||||
STR_GRAPH_INDUSTRY_RANGE_DELIVERED :Đã giao
|
||||
STR_GRAPH_INDUSTRY_RANGE_WAITING :Đang chờ...
|
||||
|
||||
STR_GRAPH_PERFORMANCE_DETAIL_TOOLTIP :{BLACK}Hiện chi tiết đánh giá chỉ số năng suất
|
||||
|
||||
|
@ -830,7 +840,7 @@ STR_STATUSBAR_INFINITE_MONEY :{WHITE}(tiền
|
|||
# News message history
|
||||
STR_MESSAGE_HISTORY :{WHITE}Lịch Sử Thông Điệp
|
||||
STR_MESSAGE_HISTORY_TOOLTIP :{BLACK}Danh sách những tin tức gần đây
|
||||
STR_MESSAGE_NEWS_FORMAT :{STRING} - {STRING}
|
||||
STR_MESSAGE_NEWS_FORMAT :{STRING} - {STRING}
|
||||
|
||||
STR_NEWS_MESSAGE_CAPTION :{WHITE}Thông Điệp
|
||||
|
||||
|
@ -958,11 +968,14 @@ STR_GAME_OPTIONS_TAB_SOUND :Âm thanh
|
|||
STR_GAME_OPTIONS_TAB_SOUND_TOOLTIP :Lựa chọn thiết lập cho âm thanh và nhạc
|
||||
STR_GAME_OPTIONS_TAB_SOCIAL :Xã hội
|
||||
STR_GAME_OPTIONS_TAB_SOCIAL_TOOLTIP :Chọn thiết lập các tích hợp xã hội
|
||||
STR_GAME_OPTIONS_TAB_ADVANCED :Tùy chọn nâng cao
|
||||
STR_GAME_OPTIONS_TAB_ADVANCED_TOOLTIP :Thay đổi tùy chọn nâng cao
|
||||
|
||||
STR_GAME_OPTIONS_VOLUME :Âm lượng
|
||||
STR_GAME_OPTIONS_SFX_VOLUME :Hiệu ứng âm thanh
|
||||
STR_GAME_OPTIONS_MUSIC_VOLUME :Âm nhạc
|
||||
|
||||
STR_GAME_OPTIONS_SETTING :{STRING}: {ORANGE}{STRING}
|
||||
|
||||
STR_GAME_OPTIONS_VOLUME_MARK :{NUM}%
|
||||
|
||||
|
@ -1016,6 +1029,7 @@ STR_GAME_OPTIONS_CURRENCY_IDR :Rupiah Indonesi
|
|||
STR_GAME_OPTIONS_CURRENCY_MYR :Ringgit Malaysia
|
||||
STR_GAME_OPTIONS_CURRENCY_LVL :Lát-vi-a Lats
|
||||
STR_GAME_OPTIONS_CURRENCY_PTE :Escudo Bồ Đào Nha
|
||||
STR_GAME_OPTIONS_CURRENCY_UAH :Hryvnia Ukraina
|
||||
|
||||
STR_GAME_OPTIONS_AUTOSAVE_FRAME :Lưu tự động
|
||||
STR_GAME_OPTIONS_AUTOSAVE_DROPDOWN_TOOLTIP :Lựa chọn khoảng thời gian tự động lưu
|
||||
|
@ -1049,6 +1063,7 @@ STR_GAME_OPTIONS_VIDEO_VSYNC_TOOLTIP :Đánh dấu v
|
|||
|
||||
STR_GAME_OPTIONS_VIDEO_DRIVER_INFO :Trình điều khiển hiện tại: {STRING}
|
||||
|
||||
STR_GAME_OPTIONS_INTERFACE :Giao diện
|
||||
|
||||
STR_GAME_OPTIONS_GUI_SCALE_FRAME :Kích thước giao diện
|
||||
STR_GAME_OPTIONS_GUI_SCALE_TOOLTIP :Kéo thanh trượt để điều chỉnh kích thước giao diện. Giữ Ctrl để điều chỉnh liên tục
|
||||
|
@ -1073,6 +1088,7 @@ STR_GAME_OPTIONS_PARTICIPATE_SURVEY_LINK_TOOLTIP :Sẽ mở trìn
|
|||
STR_GAME_OPTIONS_PARTICIPATE_SURVEY_PREVIEW :Xem trước kết quả khảo sát
|
||||
STR_GAME_OPTIONS_PARTICIPATE_SURVEY_PREVIEW_TOOLTIP :Hiển thị kết quả khảo sát ở ván chơi hiện tại
|
||||
|
||||
STR_GAME_OPTIONS_DISPLAY :Hiển thị
|
||||
|
||||
STR_GAME_OPTIONS_REFRESH_RATE :Tần số quét màn hình
|
||||
STR_GAME_OPTIONS_REFRESH_RATE_TOOLTIP :Chọn tần số quét màn hình
|
||||
|
@ -1094,7 +1110,7 @@ STR_GAME_OPTIONS_BASE_MUSIC_DESCRIPTION_TOOLTIP :Thông tin thê
|
|||
STR_GAME_OPTIONS_ONLINE_CONTENT :Tải Nội Dung
|
||||
STR_GAME_OPTIONS_ONLINE_CONTENT_TOOLTIP :Kiểm tra những nội dung mới & cập nhật để tải về
|
||||
|
||||
STR_GAME_OPTIONS_SOCIAL_PLUGINS_NONE :{LTBLUE}(không có plugins được cài đặt để tích hợp vào nền tảng xã hội)
|
||||
STR_GAME_OPTIONS_SOCIAL_PLUGINS_NONE :(không có plugins được cài đặt để tích hợp vào nền tảng xã hội)
|
||||
|
||||
STR_GAME_OPTIONS_SOCIAL_PLUGIN_TITLE :{STRING} ({STRING})
|
||||
STR_GAME_OPTIONS_SOCIAL_PLUGIN_PLATFORM :Nền tảng:
|
||||
|
@ -1288,6 +1304,9 @@ STR_CONFIG_SETTING_INTEREST_RATE_HELPTEXT :Lãi xuất vay
|
|||
STR_CONFIG_SETTING_RUNNING_COSTS :Chi phí hoạt động: {STRING}
|
||||
STR_CONFIG_SETTING_RUNNING_COSTS_HELPTEXT :Thiết lập mức độ tính chi phí bảo trì và vận hành đối với phương tiện và hạ tầng giao thông
|
||||
###length 3
|
||||
STR_CONFIG_SETTING_RUNNING_COSTS_LOW :Thấp
|
||||
STR_CONFIG_SETTING_RUNNING_COSTS_MEDIUM :Trung bình
|
||||
STR_CONFIG_SETTING_RUNNING_COSTS_HIGH :Cao
|
||||
|
||||
STR_CONFIG_SETTING_CONSTRUCTION_SPEED :Tốc độ xây dựng: {STRING}
|
||||
STR_CONFIG_SETTING_CONSTRUCTION_SPEED_HELPTEXT :Giới hạn hành động xây dựng của AI
|
||||
|
@ -1310,6 +1329,9 @@ STR_CONFIG_SETTING_SUBSIDY_DURATION_DISABLED :Không có tr
|
|||
STR_CONFIG_SETTING_CONSTRUCTION_COSTS :Chi phí xây dựng: {STRING}
|
||||
STR_CONFIG_SETTING_CONSTRUCTION_COSTS_HELPTEXT :Thiết lập mức độ xây dựng và chi phí mua sắm
|
||||
###length 3
|
||||
STR_CONFIG_SETTING_CONSTRUCTION_COSTS_LOW :Thấp
|
||||
STR_CONFIG_SETTING_CONSTRUCTION_COSTS_MEDIUM :Trung bình
|
||||
STR_CONFIG_SETTING_CONSTRUCTION_COSTS_HIGH :Cao
|
||||
|
||||
STR_CONFIG_SETTING_RECESSIONS :Suy thoái: {STRING}
|
||||
STR_CONFIG_SETTING_RECESSIONS_HELPTEXT :Nếu bật, thì các đợt suy thoái sẽ xảy ra vài năm một lần. Trong suy thoái tất cả sản xuất sẽ giảm mạnh (và sẽ trở lại như cũ sau khi suy thoái kết thúc)
|
||||
|
@ -1979,8 +2001,12 @@ STR_CONFIG_SETTING_TOWN_FOUNDING_FORBIDDEN :không cho phé
|
|||
STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED :cho phép
|
||||
STR_CONFIG_SETTING_TOWN_FOUNDING_ALLOWED_CUSTOM_LAYOUT :cho phép, tùy chọn bố trí đô thị
|
||||
|
||||
STR_CONFIG_SETTING_HOUSE_PLACER :Đật từng ngôi nhà: {STRING}
|
||||
STR_CONFIG_SETTING_HOUSE_PLACER_HELPTEXT :Bật tùy chọn này cho phép người chơi đặt nhà cửa bằng tay
|
||||
###length 3
|
||||
STR_CONFIG_SETTING_HOUSE_PLACER_FORBIDDEN :Không cho phép
|
||||
STR_CONFIG_SETTING_HOUSE_PLACER_ALLOWED :Cho phép
|
||||
STR_CONFIG_SETTING_HOUSE_PLACER_FULLY_CONSTRUCTED :Cho phép, đã hoàn thành thi công
|
||||
|
||||
STR_CONFIG_SETTING_TOWN_CARGOGENMODE :Nhu cầu vận chuyển hàng đô thị: {STRING}
|
||||
STR_CONFIG_SETTING_TOWN_CARGOGENMODE_HELPTEXT :Lượng hàng hoá cần vận chuyển ở trong đô thị, tỉ lệ với tổng dân số của độ thị.{}Tăng tỉ lệ bình phương: một đô thị to gấp 2 sẽ tăng 4 lần số hành khách.{}Tăng tỉ lệ thuận: một đô thị tăng gấp 2 sẽ tăng gấp 2 lần số hành khách
|
||||
|
@ -2009,7 +2035,7 @@ STR_CONFIG_SETTING_SOFT_LIMIT :Giới hạn s
|
|||
STR_CONFIG_SETTING_SOFT_LIMIT_HELPTEXT :Số lượng cửa sổ chưa neo (tối đa) trước khi tự động đóng để nhường chỗ khi mở cửa sổ mới
|
||||
STR_CONFIG_SETTING_SOFT_LIMIT_VALUE :{COMMA}
|
||||
###setting-zero-is-special
|
||||
STR_CONFIG_SETTING_SOFT_LIMIT_DISABLED :tắt
|
||||
STR_CONFIG_SETTING_SOFT_LIMIT_DISABLED :Tắt
|
||||
|
||||
STR_CONFIG_SETTING_ZOOM_MIN :Độ phóng to tối đa: {STRING}
|
||||
STR_CONFIG_SETTING_ZOOM_MIN_HELPTEXT :Độ phóng to tối đa của cửa sổ. Độ càng cao thì yêu cầu bộ nhớ càng nhiều
|
||||
|
@ -2061,9 +2087,9 @@ STR_CONFIG_SETTING_DISTRIBUTION_ARMOURED_HELPTEXT :Loại hàng h
|
|||
STR_CONFIG_SETTING_DISTRIBUTION_DEFAULT :Chế độ phân phối đối với các loại hàng hóa mặc định: {STRING}
|
||||
STR_CONFIG_SETTING_DISTRIBUTION_DEFAULT_HELPTEXT :"Không đối xứng" có nghĩa là số lượng hàng hóa tùy ý có thể được gửi theo một trong hai hướng. "Thủ công" có nghĩa là những loại hàng hóa đó sẽ không được phân phối tự động
|
||||
###length 3
|
||||
STR_CONFIG_SETTING_DISTRIBUTION_MANUAL :bằng tay
|
||||
STR_CONFIG_SETTING_DISTRIBUTION_ASYMMETRIC :bất đối xứng
|
||||
STR_CONFIG_SETTING_DISTRIBUTION_SYMMETRIC :đối xứng
|
||||
STR_CONFIG_SETTING_DISTRIBUTION_MANUAL :Bằng tay
|
||||
STR_CONFIG_SETTING_DISTRIBUTION_ASYMMETRIC :Bất đối xứng
|
||||
STR_CONFIG_SETTING_DISTRIBUTION_SYMMETRIC :Đối xứng
|
||||
|
||||
STR_CONFIG_SETTING_LINKGRAPH_ACCURACY :Độ chính xác phân phối: {STRING}
|
||||
STR_CONFIG_SETTING_LINKGRAPH_ACCURACY_HELPTEXT :Mức chính xác tính toán đồ thị, nếu giá trị càng cao càng tốn CPU và trò chơi có thể chậm phản ứng, tuy nhiên giá trị thấp sẽ khiến việc phân phối sẽ giảm sự chính xác và bạn sẽ thấy sự khác biệt là hàng hóa không gửi đến chỗ cần đến
|
||||
|
@ -2124,7 +2150,7 @@ STR_CONFIG_SETTING_LOCALISATION_UNITS_HEIGHT_SI :SI (m)
|
|||
STR_CONFIG_SETTING_LOCALISATION :Tiêu Chuẩn Đo Lường
|
||||
STR_CONFIG_SETTING_GRAPHICS :Đồ họa
|
||||
STR_CONFIG_SETTING_SOUND :Âm thanh
|
||||
STR_CONFIG_SETTING_INTERFACE :Giao Diện
|
||||
STR_CONFIG_SETTING_INTERFACE :Giao diện
|
||||
STR_CONFIG_SETTING_INTERFACE_GENERAL :Tổng quát
|
||||
STR_CONFIG_SETTING_INTERFACE_VIEWPORTS :Vùng nhìn
|
||||
STR_CONFIG_SETTING_INTERFACE_CONSTRUCTION :Xây Dựng
|
||||
|
@ -2178,6 +2204,8 @@ STR_VIDEO_DRIVER_ERROR_NO_HARDWARE_ACCELERATION :{WHITE}... khô
|
|||
STR_VIDEO_DRIVER_ERROR_HARDWARE_ACCELERATION_CRASH :{WHITE}... trình điều khiển GPU đã làm trò chơi bị lỗi. Tăng tốc phần cứng đã được tắt
|
||||
|
||||
# Intro window
|
||||
STR_INTRO_CAPTION :{WHITE}OpenTTD
|
||||
STR_INTRO_VERSION :OpenTTD {REV}
|
||||
|
||||
STR_INTRO_NEW_GAME :{BLACK}Màn Chơi Mới
|
||||
STR_INTRO_LOAD_GAME :{BLACK}Nạp Ván Chơi
|
||||
|
@ -2311,16 +2339,19 @@ STR_FACE_SIMPLE_TOOLTIP :{BLACK}Trình c
|
|||
STR_FACE_LOAD :{BLACK}Nạp
|
||||
STR_FACE_LOAD_TOOLTIP :{BLACK}Chọn vẻ mặt ưa thích
|
||||
STR_FACE_LOAD_DONE :{WHITE}Vẻ mặt ưa thích đã được nạp từ file thiết lập của OpenTTD.
|
||||
STR_FACE_FACECODE :{BLACK}Khuôn mặt thứ.
|
||||
STR_FACE_FACECODE_TOOLTIP :{BLACK}Xem và/hoặc sửa số vẻ mặt của chủ tịch công ty
|
||||
STR_FACE_FACECODE_CAPTION :{WHITE}Xem và/hoặc chọn số bộ mặt người chơi
|
||||
STR_FACE_FACECODE_SET :{WHITE}Mã số gương mặt mới được thiết lập.
|
||||
STR_FACE_FACECODE_ERR :{WHITE}Không thể thiết lập mã số gương mặt - mã số phải trong khoảng từ 0 đến 4,294,967,295!
|
||||
STR_FACE_FACECODE :{BLACK}Mã số khuôn mặt
|
||||
STR_FACE_FACECODE_TOOLTIP :{BLACK}Xem và/hoặc sửa mã số gương mặt của chủ tịch công ty
|
||||
STR_FACE_FACECODE_CAPTION :{WHITE}Xem và/hoặc chọn mã số gương mặt người chơi
|
||||
STR_FACE_FACECODE_SET :{WHITE}Gương mặt người chơi mới được thiết lập.
|
||||
STR_FACE_FACECODE_ERR :{WHITE}Không thể thiết lập mã số gương mặt - Nhãn và mã số phải hợp lệ
|
||||
STR_FACE_SAVE :{BLACK}Lưu
|
||||
STR_FACE_SAVE_TOOLTIP :{BLACK}Lưu gương mặt yêu thích
|
||||
STR_FACE_SAVE_DONE :{WHITE}Gương mặt yêu thích này sẽ được lưu lại trong tập tin cấu hình OpenTTD .
|
||||
STR_FACE_SETTING_TOGGLE :{STRING} {ORANGE}{STRING}
|
||||
STR_FACE_SETTING_NUMERIC :{STRING} {ORANGE}{NUM} / {NUM}
|
||||
STR_FACE_YES :Đồng ý
|
||||
STR_FACE_NO :Không
|
||||
STR_FACE_STYLE :Kiểu:
|
||||
STR_FACE_HAIR :Tóc:
|
||||
STR_FACE_EYEBROWS :Lông mày:
|
||||
STR_FACE_EYECOLOUR :Màu mắt:
|
||||
|
@ -2607,7 +2638,7 @@ STR_NETWORK_MESSAGE_CLIENT_LEFT :*** {STRING} r
|
|||
STR_NETWORK_MESSAGE_NAME_CHANGE :*** {STRING} đã đổi tên thành {STRING}
|
||||
STR_NETWORK_MESSAGE_GIVE_MONEY :*** {STRING} tặng {CURRENCY_LONG} cho {STRING}
|
||||
STR_NETWORK_MESSAGE_SERVER_SHUTDOWN :{WHITE}Server kết thúc phiên
|
||||
STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}Server khởi động lại...{}Xin chờ...
|
||||
STR_NETWORK_MESSAGE_SERVER_REBOOT :{WHITE}Server khởi động lại...{}{}Xin chờ...
|
||||
STR_NETWORK_MESSAGE_KICKED :*** {STRING} đã bị đá khỏi ván chơi. Lý do: ({STRING})
|
||||
|
||||
STR_NETWORK_ERROR_COORDINATOR_REGISTRATION_FAILED :{WHITE}Đăng ký server thất bại
|
||||
|
@ -2793,6 +2824,10 @@ STR_PICKER_MODE_USED_TOOLTIP :Bật/tắt hi
|
|||
STR_PICKER_MODE_SAVED :Đã lưu
|
||||
STR_PICKER_MODE_SAVED_TOOLTIP :Bật/tắt hiển thị những hạng mục được lưu
|
||||
|
||||
STR_PICKER_PREVIEW_SHRINK :-
|
||||
STR_PICKER_PREVIEW_SHRINK_TOOLTIP :Giảm chiều cao của ảnh xem trước. Ctrl+Click để giảm đến mức tối thiểu
|
||||
STR_PICKER_PREVIEW_EXPAND :+
|
||||
STR_PICKER_PREVIEW_EXPAND_TOOLTIP :Tăng chiều cao của ảnh xem trước. Ctrl+Click để tăng đến mức tối đa
|
||||
|
||||
STR_PICKER_STATION_CLASS_TOOLTIP :Chọn loại ga bến cần hiển thị
|
||||
STR_PICKER_STATION_TYPE_TOOLTIP :Chọn loại ga bến để xây. Ctrl+Click để thêm hoặc bớt vào danh sách lưu
|
||||
|
@ -2816,6 +2851,7 @@ STR_HOUSE_PICKER_YEARS_FROM :{BLACK}Năm: {O
|
|||
STR_HOUSE_PICKER_YEARS_UNTIL :{BLACK}Năm: {ORANGE}Đến {NUM}
|
||||
STR_HOUSE_PICKER_SIZE :{BLACK}Kích thước: {ORANGE}{NUM}x{NUM} ô
|
||||
STR_HOUSE_PICKER_CARGO_ACCEPTED :{BLACK}Hàng hóa được chấp nhận: {ORANGE}
|
||||
STR_HOUSE_PICKER_CARGO_PRODUCED :{BLACK}Hàng hóa cung cấp: {ORANGE}{CARGO_LIST}
|
||||
|
||||
STR_HOUSE_PICKER_CLASS_ZONE1 :Ngoài rìa
|
||||
STR_HOUSE_PICKER_CLASS_ZONE2 :Ngoại ô
|
||||
|
@ -2824,6 +2860,7 @@ STR_HOUSE_PICKER_CLASS_ZONE4 :Phía trong ngo
|
|||
STR_HOUSE_PICKER_CLASS_ZONE5 :Nội thành
|
||||
|
||||
STR_HOUSE_PICKER_PROTECT_TITLE :Ngăn chặn nâng cấp
|
||||
STR_HOUSE_PICKER_PROTECT_TOOLTIP :Chọn nếu ngôi nhà này có được bảo vệ khỏi việc bị thay thế hay không khi thị trấn phát triển
|
||||
STR_HOUSE_PICKER_PROTECT_OFF :Tắt
|
||||
STR_HOUSE_PICKER_PROTECT_ON :Bật
|
||||
|
||||
|
@ -3031,6 +3068,11 @@ STR_FOUND_TOWN_INITIAL_SIZE_TOOLTIP :{BLACK}Chọn q
|
|||
STR_FOUND_TOWN_CITY :{BLACK}Đô thị
|
||||
STR_FOUND_TOWN_CITY_TOOLTIP :{BLACK}Thành phố phát triển nhanh hơn thị trấn{}Tuỳ thuộc thiết lập, chúng lớn hơn khi khai sinh
|
||||
|
||||
STR_FOUND_TOWN_EXPAND_MODE :{YELLOW}Mở rộng thị trấn:
|
||||
STR_FOUND_TOWN_EXPAND_BUILDINGS :Công trình
|
||||
STR_FOUND_TOWN_EXPAND_BUILDINGS_TOOLTIP :Tăng số công trình của thị trấn
|
||||
STR_FOUND_TOWN_EXPAND_ROADS :Đường sá
|
||||
STR_FOUND_TOWN_EXPAND_ROADS_TOOLTIP :Tăng số đường sá của thị trấn
|
||||
|
||||
STR_FOUND_TOWN_ROAD_LAYOUT :{YELLOW}Quy hoạch đường đô thị:
|
||||
STR_FOUND_TOWN_SELECT_LAYOUT_TOOLTIP :{BLACK}Chọn để quy hoạch đường bộ trong đô thị
|
||||
|
@ -3103,6 +3145,8 @@ STR_LANG_AREA_INFORMATION_TRAM_TYPE :{BLACK}Kiểu x
|
|||
STR_LANG_AREA_INFORMATION_RAIL_SPEED_LIMIT :{BLACK}Giới hạn tốc độ đường ray: {LTBLUE}{VELOCITY}
|
||||
STR_LANG_AREA_INFORMATION_ROAD_SPEED_LIMIT :{BLACK}Hạn chế tốc độ đường bộ: {LTBLUE}{VELOCITY}
|
||||
STR_LANG_AREA_INFORMATION_TRAM_SPEED_LIMIT :{BLACK}Tốc độ xe điện giới hạn: {LTBLUE}{VELOCITY}
|
||||
STR_LAND_AREA_INFORMATION_TOWN_CAN_UPGRADE :{BLACK}Nâng cấp thị trấn: {LTBLUE}Có thể
|
||||
STR_LAND_AREA_INFORMATION_TOWN_CANNOT_UPGRADE :{BLACK}Nâng cấp thị trấn: {LTBLUE}Không thể
|
||||
|
||||
# Description of land area of different tiles
|
||||
STR_LAI_CLEAR_DESCRIPTION_ROCKS :Đá
|
||||
|
@ -3111,6 +3155,9 @@ STR_LAI_CLEAR_DESCRIPTION_BARE_LAND :Đất trống
|
|||
STR_LAI_CLEAR_DESCRIPTION_GRASS :Bãi cỏ
|
||||
STR_LAI_CLEAR_DESCRIPTION_FIELDS :Cánh đồng
|
||||
STR_LAI_CLEAR_DESCRIPTION_DESERT :Hoang mạc
|
||||
STR_LAI_CLEAR_DESCRIPTION_SNOWY_ROCKS :Đá có tuyết phủ
|
||||
STR_LAI_CLEAR_DESCRIPTION_SNOWY_ROUGH_LAND :Đất gồ ghề có tuyết phủ
|
||||
STR_LAI_CLEAR_DESCRIPTION_SNOWY_GRASS :Cỏ có tuyết phủ
|
||||
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK :Đường ray
|
||||
STR_LAI_RAIL_DESCRIPTION_TRACK_WITH_NORMAL_SIGNALS :Đường ray với đèn hiệu khóa
|
||||
|
@ -3579,17 +3626,17 @@ STR_NEWGRF_LIST_COMPATIBLE :{YELLOW}Đã t
|
|||
STR_NEWGRF_LIST_MISSING :{RED}Thiếu files
|
||||
|
||||
# NewGRF 'it's broken' warnings
|
||||
STR_NEWGRF_BROKEN :{WHITE}Hoạt động của NewGRF '{0:STRING}' có thể gây mất đồng bộ hoặc bị treo.
|
||||
STR_NEWGRF_BROKEN_POWERED_WAGON :{WHITE}Trạng thái đầu kéo '{1:ENGINE}' được thay đổi khi không ở trong xưởng sửa chữa.
|
||||
STR_NEWGRF_BROKEN_VEHICLE_LENGTH :{WHITE}Nó cắt ngắn độ dài của đoàn tàu '{1:ENGINE}' nếu không ở trong xưởng.
|
||||
STR_NEWGRF_BROKEN_CAPACITY :{WHITE}Sức chứa của phương tiện bị thay đổi '{1:ENGINE}' khi không ở trong xưởng hoặc vì cải biến
|
||||
STR_NEWGRF_BROKEN :{WHITE}Hoạt động của NewGRF '{PUSH_COLOUR}{0:STRING}{POP_COLOUR}' có thể gây mất đồng bộ hoặc bị treo.
|
||||
STR_NEWGRF_BROKEN_POWERED_WAGON :{WHITE}Trạng thái đầu kéo '{PUSH_COLOUR}{1:ENGINE}{POP_COLOUR}' được thay đổi khi không ở trong xưởng sửa chữa.
|
||||
STR_NEWGRF_BROKEN_VEHICLE_LENGTH :{WHITE}Nó cắt ngắn độ dài của đoàn tàu '{PUSH_COLOUR}{1:ENGINE}{POP_COLOUR}' nếu không ở trong xưởng.
|
||||
STR_NEWGRF_BROKEN_CAPACITY :{WHITE}Sức chứa của phương tiện bị thay đổi '{PUSH_COLOUR}{1:ENGINE}{POP_COLOUR}' khi không ở trong xưởng hoặc vì cải biến
|
||||
STR_BROKEN_VEHICLE_LENGTH :{WHITE}Đoàn tàu '{VEHICLE}' của '{COMPANY}' có độ dài không hợp lệ. Sự cố có thể có căn nguyên từ NewGRFs. Ván chơi có thể mất đồng bộ hoặc bị treo
|
||||
|
||||
STR_NEWGRF_BUGGY :{WHITE}NewGRF '{0:STRING}' không hợp lệ.
|
||||
STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}Danh mục hàng hoá/cải biến được cho '{1:ENGINE}' khác với danh mục mua được sau khi đã có. Việc này khiến cho việc tự thay thế hay là tự cải biến không chính xác.
|
||||
STR_NEWGRF_BUGGY_ENDLESS_PRODUCTION_CALLBACK :{WHITE}'{1:STRING}' gây ra một vòng lặp vô tận khi gọi hàm callback.
|
||||
STR_NEWGRF_BUGGY :{WHITE}NewGRF '{PUSH_COLOUR}{0:STRING}{POP_COLOUR}' không hợp lệ.
|
||||
STR_NEWGRF_BUGGY_ARTICULATED_CARGO :{WHITE}Danh mục hàng hoá/cải biến được cho '{PUSH_COLOUR}{1:ENGINE}{POP_COLOUR}' khác với danh mục mua được sau khi đã có. Việc này khiến cho việc tự thay thế hay là tự cải biến không chính xác.
|
||||
STR_NEWGRF_BUGGY_ENDLESS_PRODUCTION_CALLBACK :{WHITE}'{PUSH_COLOUR}{1:STRING}{POP_COLOUR}' gây ra một vòng lặp vô tận khi gọi hàm callback.
|
||||
STR_NEWGRF_BUGGY_UNKNOWN_CALLBACK_RESULT :{WHITE}Hàm callback {1:HEX} gửi trả kết quả sai/không rõ {2:HEX}
|
||||
STR_NEWGRF_BUGGY_INVALID_CARGO_PRODUCTION_CALLBACK :{WHITE}'{1:STRING}' trả về loại hàng hoá sản xuất không hợp lệ khi gọi lại tại {2:HEX}
|
||||
STR_NEWGRF_BUGGY_INVALID_CARGO_PRODUCTION_CALLBACK :{WHITE}'{PUSH_COLOUR}{1:STRING}{POP_COLOUR}' trả về loại hàng hoá sản xuất không hợp lệ khi gọi lại tại {2:HEX}
|
||||
|
||||
# 'User removed essential NewGRFs'-placeholders for stuff without specs
|
||||
STR_NEWGRF_INVALID_CARGO :<sai kiểu hàng>
|
||||
|
@ -3650,6 +3697,10 @@ STR_TOWN_VIEW_RENAME_TOOLTIP :{BLACK}Đổi t
|
|||
|
||||
STR_TOWN_VIEW_EXPAND_BUTTON :{BLACK}Mở rộng
|
||||
STR_TOWN_VIEW_EXPAND_TOOLTIP :{BLACK}Tăng quy mô đô thị
|
||||
STR_TOWN_VIEW_EXPAND_BUILDINGS_BUTTON :{BLACK}Mở rộng công trình
|
||||
STR_TOWN_VIEW_EXPAND_BUILDINGS_TOOLTIP :{BLACK}Tăng số công trình của thị trấn
|
||||
STR_TOWN_VIEW_EXPAND_ROADS_BUTTON :{BLACK}Mở rộng đường
|
||||
STR_TOWN_VIEW_EXPAND_ROADS_TOOLTIP :{BLACK}Tăng số đường sá của thị trấn
|
||||
STR_TOWN_VIEW_DELETE_BUTTON :{BLACK}Xoá
|
||||
STR_TOWN_VIEW_DELETE_TOOLTIP :{BLACK}Xoá bỏ đô thị này hoàn toàn
|
||||
|
||||
|
@ -3975,6 +4026,8 @@ STR_INDUSTRY_VIEW_PRODUCTION_LAST_MONTH_TITLE :{BLACK}Sản l
|
|||
STR_INDUSTRY_VIEW_PRODUCTION_LAST_MINUTE_TITLE :{BLACK}Sản lượng phút trước:
|
||||
STR_INDUSTRY_VIEW_TRANSPORTED :{YELLOW}{CARGO_LONG}{STRING}{BLACK} ({COMMA}% đã vận chuyển)
|
||||
STR_INDUSTRY_VIEW_LOCATION_TOOLTIP :{BLACK}Xem vị trí trung tâm của nhà máy. Ctrl+Click mở cửa sổ mới để xem
|
||||
STR_INDUSTRY_VIEW_CARGO_GRAPH :{BLACK}Đồ thị hàng hóa
|
||||
STR_INDUSTRY_VIEW_CARGO_GRAPH_TOOLTIP :{BLACK}Xem đồ thị lịch sử kinh doanh hàng hóa
|
||||
STR_INDUSTRY_VIEW_PRODUCTION_LEVEL :{BLACK}Mức sản lượng: {YELLOW}{COMMA}%
|
||||
STR_INDUSTRY_VIEW_INDUSTRY_ANNOUNCED_CLOSURE :{YELLOW}Nhà máy này đã thông báo sắp đóng cửa!
|
||||
|
||||
|
@ -4386,10 +4439,10 @@ STR_VEHICLE_VIEW_SHIP_ORDERS_TOOLTIP :{BLACK}Hiện l
|
|||
STR_VEHICLE_VIEW_AIRCRAFT_ORDERS_TOOLTIP :{BLACK}Hiện lộ trình máy bay. Ctrl+Click để hiện lịch trình
|
||||
|
||||
###length VEHICLE_TYPES
|
||||
STR_VEHICLE_VIEW_TRAIN_SHOW_DETAILS_TOOLTIP :{BLACK}Hiện chi tiết tàu hoả
|
||||
STR_VEHICLE_VIEW_ROAD_VEHICLE_SHOW_DETAILS_TOOLTIP :{BLACK}Hiện chi tiết xe
|
||||
STR_VEHICLE_VIEW_SHIP_SHOW_DETAILS_TOOLTIP :{BLACK}Hiện chi tiết tàu thuỷ
|
||||
STR_VEHICLE_VIEW_AIRCRAFT_SHOW_DETAILS_TOOLTIP :{BLACK}Hiện chi tiết máy bay
|
||||
STR_VEHICLE_VIEW_TRAIN_SHOW_DETAILS_TOOLTIP :{BLACK}Hiện chi tiết tàu hoả. Ctrl+Click vào để hiện nhóm của tàu hỏa
|
||||
STR_VEHICLE_VIEW_ROAD_VEHICLE_SHOW_DETAILS_TOOLTIP :{BLACK}Hiện chi tiết xe. Ctrl+Click để hiện nhóm phương tiện
|
||||
STR_VEHICLE_VIEW_SHIP_SHOW_DETAILS_TOOLTIP :{BLACK}Hiện chi tiết tàu thuỷ. Ctrl+Click vào để hiện nhóm của tàu thủy
|
||||
STR_VEHICLE_VIEW_AIRCRAFT_SHOW_DETAILS_TOOLTIP :{BLACK}Hiện chi tiết máy bay. Ctrl+Click để hiện nhóm của máy bay
|
||||
|
||||
###length VEHICLE_TYPES
|
||||
STR_VEHICLE_VIEW_TRAIN_STATUS_START_STOP_TOOLTIP :{BLACK}Tác động đến tàu hỏa hiện tại - bấm để dừng/chạy tàu hỏa
|
||||
|
@ -4644,55 +4697,56 @@ STR_ORDER_ROAD_VEHICLE_DEPOT :Xưởng xe
|
|||
STR_ORDER_SHIP_DEPOT :Xưởng tàu thuỷ
|
||||
###next-name-looks-similar
|
||||
|
||||
STR_ORDER_GO_TO_NEAREST_HANGAR_FORMAT :{STRING} xưởng sân bay gần nhất
|
||||
STR_ORDER_GO_TO_NEAREST_DEPOT_FORMAT :{STRING} gần {STRING} nhất
|
||||
STR_ORDER_GO_TO_DEPOT_FORMAT :{STRING} {DEPOT}
|
||||
|
||||
STR_ORDER_REFIT_ORDER :(Cải biến thành {STRING})
|
||||
STR_ORDER_REFIT_STOP_ORDER :(Cải biến thành {STRING} và dừng)
|
||||
STR_ORDER_STOP_ORDER :(Dừng)
|
||||
STR_ORDER_REFIT_ORDER :{SPACE}(Cải biến thành {STRING})
|
||||
STR_ORDER_REFIT_STOP_ORDER :{SPACE}(Cải biến thành {STRING} và dừng)
|
||||
STR_ORDER_STOP_ORDER :{SPACE}(Dừng)
|
||||
|
||||
STR_ORDER_WAIT_TO_UNBUNCH :(Chờ để gỡ gộp)
|
||||
STR_ORDER_WAIT_TO_UNBUNCH :{SPACE}(Chờ để gỡ gộp)
|
||||
|
||||
STR_ORDER_GO_TO_STATION :{STRING} {STATION}
|
||||
STR_ORDER_GO_TO_STATION_CAN_T_USE_STATION :{PUSH_COLOUR}{RED}(Không thể sử dụng trạm){POP_COLOUR} {STRING} {STATION}
|
||||
|
||||
STR_ORDER_IMPLICIT :(Chạy ngầm)
|
||||
STR_ORDER_IMPLICIT :{SPACE}(Chạy ngầm)
|
||||
|
||||
STR_ORDER_FULL_LOAD :(Bốc đầy hàng)
|
||||
STR_ORDER_FULL_LOAD_ANY :(Bốc đủ bất kỳ hàng nào)
|
||||
STR_ORDER_NO_LOAD :(Không bốc xếp)
|
||||
STR_ORDER_UNLOAD :(Dỡ và lấy hàng khác)
|
||||
STR_ORDER_UNLOAD_FULL_LOAD :(Dỡ tất hàng và chờ bốc đầy hàng)
|
||||
STR_ORDER_UNLOAD_FULL_LOAD_ANY :(Dỡ tất hàng và chờ bốc đủ bất kỳ hàng nào)
|
||||
STR_ORDER_UNLOAD_NO_LOAD :(Dỡ tất hàng và để trống)
|
||||
STR_ORDER_TRANSFER :(Trung chuyển hàng và lấy hàng khác)
|
||||
STR_ORDER_TRANSFER_FULL_LOAD :(Trung chuyển và chờ bốc đầy hàng)
|
||||
STR_ORDER_TRANSFER_FULL_LOAD_ANY :(Trung chuyển và chờ bốc đủ hàng bất kỳ)
|
||||
STR_ORDER_TRANSFER_NO_LOAD :(Trung chuyển và để trống)
|
||||
STR_ORDER_NO_UNLOAD :(Không dỡ và lấy hàng)
|
||||
STR_ORDER_NO_UNLOAD_FULL_LOAD :(Không dỡ và chờ lấy thêm đầy hàng)
|
||||
STR_ORDER_NO_UNLOAD_FULL_LOAD_ANY :(Không dỡ và chờ lấy đủ hàng bất kỳ)
|
||||
STR_ORDER_NO_UNLOAD_NO_LOAD :(Không bốc hàng và không dỡ hàng)
|
||||
STR_ORDER_FULL_LOAD :{SPACE}(Bốc đầy hàng)
|
||||
STR_ORDER_FULL_LOAD_ANY :{SPACE}(Bốc đủ bất kỳ hàng nào)
|
||||
STR_ORDER_NO_LOAD :{SPACE}(Không bốc xếp)
|
||||
STR_ORDER_UNLOAD :{SPACE}(Dỡ và lấy hàng khác)
|
||||
STR_ORDER_UNLOAD_FULL_LOAD :{SPACE}(Dỡ tất hàng và chờ bốc đầy hàng)
|
||||
STR_ORDER_UNLOAD_FULL_LOAD_ANY :{SPACE}(Dỡ tất hàng và chờ bốc đủ bất kỳ hàng nào)
|
||||
STR_ORDER_UNLOAD_NO_LOAD :{SPACE}(Dỡ tất hàng và để trống)
|
||||
STR_ORDER_TRANSFER :{SPACE}(Trung chuyển hàng và lấy hàng khác)
|
||||
STR_ORDER_TRANSFER_FULL_LOAD :{SPACE}(Trung chuyển và chờ bốc đầy hàng)
|
||||
STR_ORDER_TRANSFER_FULL_LOAD_ANY :{SPACE}(Trung chuyển và chờ bốc đủ hàng bất kỳ)
|
||||
STR_ORDER_TRANSFER_NO_LOAD :{SPACE}(Trung chuyển và để trống)
|
||||
STR_ORDER_NO_UNLOAD :{SPACE}(Không dỡ và lấy hàng)
|
||||
STR_ORDER_NO_UNLOAD_FULL_LOAD :{SPACE}(Không dỡ và chờ lấy thêm đầy hàng)
|
||||
STR_ORDER_NO_UNLOAD_FULL_LOAD_ANY :{SPACE}(Không dỡ và chờ lấy đủ hàng bất kỳ)
|
||||
STR_ORDER_NO_UNLOAD_NO_LOAD :{SPACE}(Không bốc hàng và không dỡ hàng)
|
||||
|
||||
STR_ORDER_AUTO_REFIT :(Tự cải biến thành {STRING})
|
||||
STR_ORDER_FULL_LOAD_REFIT :(Tự cải biến và chất đầy {STRING})
|
||||
STR_ORDER_FULL_LOAD_ANY_REFIT :(Tự cải biến và chất đầy bất kỳ {STRING})
|
||||
STR_ORDER_UNLOAD_REFIT :(Dỡ hàng và tự cải biến để lấy {STRING})
|
||||
STR_ORDER_UNLOAD_FULL_LOAD_REFIT :(Dỡ hàng và tự cải biến đề bốc đầy {STRING})
|
||||
STR_ORDER_UNLOAD_FULL_LOAD_ANY_REFIT :(Dỡ hàng và tự cải biến để bốc đầy bất kỳ {STRING})
|
||||
STR_ORDER_TRANSFER_REFIT :(Trung chuyển và tự cải biến để lấy {STRING})
|
||||
STR_ORDER_TRANSFER_FULL_LOAD_REFIT :(Trung chuyển và tự cải biến đề bốc đầy {STRING})
|
||||
STR_ORDER_TRANSFER_FULL_LOAD_ANY_REFIT :(Trung chuyển và tự cải biến để bốc đầy bất kỳ {STRING})
|
||||
STR_ORDER_NO_UNLOAD_REFIT :(Không dỡ hàng và tự cái biến để lấy {STRING})
|
||||
STR_ORDER_NO_UNLOAD_FULL_LOAD_REFIT :(Không dỡ hàng và tự cải biến để bốc đầy {STRING})
|
||||
STR_ORDER_NO_UNLOAD_FULL_LOAD_ANY_REFIT :(Không dỡ hàng và tự cải biến để bốc đầy bất kỳ {STRING})
|
||||
STR_ORDER_AUTO_REFIT :{SPACE}(Tự cải biến thành {STRING})
|
||||
STR_ORDER_FULL_LOAD_REFIT :{SPACE}(Tự cải biến và chất đầy {STRING})
|
||||
STR_ORDER_FULL_LOAD_ANY_REFIT :{SPACE}(Tự cải biến và chất đầy bất kỳ {STRING})
|
||||
STR_ORDER_UNLOAD_REFIT :{SPACE}(Dỡ hàng và tự cải biến để lấy {STRING})
|
||||
STR_ORDER_UNLOAD_FULL_LOAD_REFIT :{SPACE}(Dỡ hàng và tự cải biến đề bốc đầy {STRING})
|
||||
STR_ORDER_UNLOAD_FULL_LOAD_ANY_REFIT :{SPACE}(Dỡ hàng và tự cải biến để bốc đầy bất kỳ {STRING})
|
||||
STR_ORDER_TRANSFER_REFIT :{SPACE}(Trung chuyển và tự cải biến để lấy {STRING})
|
||||
STR_ORDER_TRANSFER_FULL_LOAD_REFIT :{SPACE}(Trung chuyển và tự cải biến đề bốc đầy {STRING})
|
||||
STR_ORDER_TRANSFER_FULL_LOAD_ANY_REFIT :{SPACE}(Trung chuyển và tự cải biến để bốc đầy bất kỳ {STRING})
|
||||
STR_ORDER_NO_UNLOAD_REFIT :{SPACE}(Không dỡ hàng và tự cái biến để lấy {STRING})
|
||||
STR_ORDER_NO_UNLOAD_FULL_LOAD_REFIT :{SPACE}(Không dỡ hàng và tự cải biến để bốc đầy {STRING})
|
||||
STR_ORDER_NO_UNLOAD_FULL_LOAD_ANY_REFIT :{SPACE}(Không dỡ hàng và tự cải biến để bốc đầy bất kỳ {STRING})
|
||||
|
||||
STR_ORDER_AUTO_REFIT_ANY :hàng hóa sẵn có
|
||||
|
||||
###length 3
|
||||
STR_ORDER_STOP_LOCATION_NEAR_END :[đỗ ở đầu gần]
|
||||
STR_ORDER_STOP_LOCATION_MIDDLE :[đỗ ở giữa]
|
||||
STR_ORDER_STOP_LOCATION_FAR_END :[đỗ ở đầu xa]
|
||||
STR_ORDER_STOP_LOCATION_NEAR_END :{SPACE}[đỗ ở đầu gần]
|
||||
STR_ORDER_STOP_LOCATION_MIDDLE :{SPACE}[đỗ ở giữa]
|
||||
STR_ORDER_STOP_LOCATION_FAR_END :{SPACE}[đỗ ở đầu xa]
|
||||
|
||||
STR_ORDER_OUT_OF_RANGE :{RED} (Điểm đến kế tiếp ngoài tầm xa)
|
||||
|
||||
|
@ -4712,14 +4766,15 @@ STR_TIMETABLE_TOOLTIP :{BLACK}Lịch t
|
|||
STR_TIMETABLE_NO_TRAVEL :Không di chuyển
|
||||
STR_TIMETABLE_NOT_TIMETABLEABLE :Hành trình (tự động; tính thời gian theo lịch trình thủ công kế tiếp)
|
||||
STR_TIMETABLE_TRAVEL_NOT_TIMETABLED :Di chuyển (không bó buộc theo lịch trình)
|
||||
STR_TIMETABLE_TRAVEL_NOT_TIMETABLED_SPEED :Hành trình với tốc độ tối đa là {VELOCITY} (chưa dựng lịch trình)
|
||||
STR_TIMETABLE_TRAVEL_FOR :Di chuyển trong {STRING}
|
||||
STR_TIMETABLE_TRAVEL_FOR_SPEED :Lộ trình {STRING} với tốc độ tối đa {VELOCITY}
|
||||
STR_TIMETABLE_TRAVEL_FOR_ESTIMATED :Lộ trình (cho {STRING}, chưa có lịch trình)
|
||||
STR_TIMETABLE_TRAVEL_FOR_SPEED_ESTIMATED :Lộ trình (cho {STRING}, chưa có lịch trình) với tốc độ đối đa {VELOCITY}
|
||||
STR_TIMETABLE_STAY_FOR_ESTIMATED :(ở lại {STRING}, chưa có lịch trình)
|
||||
STR_TIMETABLE_AND_TRAVEL_FOR_ESTIMATED :(di chuyển đến {STRING}, chưa có lịch trình)
|
||||
STR_TIMETABLE_STAY_FOR :và ở lại trong {STRING}
|
||||
STR_TIMETABLE_AND_TRAVEL_FOR :và di chuyển trong {STRING}
|
||||
STR_TIMETABLE_STAY_FOR_ESTIMATED :{SPACE}(ở lại {STRING}, chưa có lịch trình)
|
||||
STR_TIMETABLE_AND_TRAVEL_FOR_ESTIMATED :{SPACE}(di chuyển đến {STRING}, chưa có lịch trình)
|
||||
STR_TIMETABLE_STAY_FOR :{SPACE}và ở lại trong {STRING}
|
||||
STR_TIMETABLE_AND_TRAVEL_FOR :{SPACE}và di chuyển trong {STRING}
|
||||
|
||||
STR_TIMETABLE_APPROX_TIME :{BLACK}Lịch trình này sẽ mất khoảng {STRING} để hoàn thành
|
||||
STR_TIMETABLE_TOTAL_TIME :{BLACK}Lịch trình này sẽ mất {STRING} để hoàn thành
|
||||
|
@ -4738,12 +4793,14 @@ STR_TIMETABLE_START_SECONDS_QUERY :Số giây cho
|
|||
|
||||
STR_TIMETABLE_CHANGE_TIME :{BLACK}Đổi thời gian
|
||||
STR_TIMETABLE_WAIT_TIME_TOOLTIP :{BLACK}Thay đổi thời lượng của điểm lộ trình được phép sử dụng. Ctrl+Click đặt thời gian cho mọi lộ trình
|
||||
STR_TIMETABLE_CHANGE_TIME_QUERY :Thay đổi thời gian
|
||||
|
||||
STR_TIMETABLE_CLEAR_TIME :{BLACK}Xoá thời gian
|
||||
STR_TIMETABLE_CLEAR_TIME_TOOLTIP :{BLACK}Xóa thời lượng áp dụng cho điểm lộ trình. Ctrl+Click xoá tất cả thời gian cho mọi lộ trình
|
||||
|
||||
STR_TIMETABLE_CHANGE_SPEED :{BLACK}Thay Đổi Giới Hạn Tốc Độ
|
||||
STR_TIMETABLE_CHANGE_SPEED_TOOLTIP :{BLACK}Thay đổi tốc độ tối đa của lộ trình được chọn. Ctrl+Click đặt tốc độ cho mọi lộ trình
|
||||
STR_TIMETABLE_CHANGE_SPEED_QUERY :Thay đổi giới hạn tốc độ
|
||||
|
||||
STR_TIMETABLE_CLEAR_SPEED :{BLACK}Xóa Giới Hạn Tốc Độ
|
||||
STR_TIMETABLE_CLEAR_SPEED_TOOLTIP :{BLACK}Xóa tốc độ đối đa đối với lộ trình được chọn. Ctrl+Click xoá tốc độ cho mọi lộ trình
|
||||
|
@ -4907,7 +4964,7 @@ STR_GAME_SAVELOAD_NOT_AVAILABLE :<không có s
|
|||
STR_WARNING_LOADGAME_REMOVED_TRAMS :{WHITE}Lưu ván chơi sẽ không có xe điện. Những công trình cho xe điện sẽ bị xoá bỏ
|
||||
|
||||
# Map generation messages
|
||||
STR_ERROR_COULD_NOT_CREATE_TOWN :{WHITE}Sinh bản đồ bị ngưng...{}... không có nơi đặt đô thị
|
||||
STR_ERROR_COULD_NOT_CREATE_TOWN :{WHITE}Sinh bản đồ bị ngưng...{}{}... không có nơi đặt đô thị
|
||||
STR_ERROR_NO_TOWN_IN_SCENARIO :{WHITE}... không có đô thị nào ở màn chơi kịch bản này
|
||||
|
||||
STR_ERROR_PNGMAP :{WHITE}Không thể nạp nền từ file PNG...
|
||||
|
@ -4946,6 +5003,7 @@ STR_ERROR_FLAT_LAND_REQUIRED :{WHITE}Yêu c
|
|||
STR_ERROR_LAND_SLOPED_IN_WRONG_DIRECTION :{WHITE}Tạo dốc bị sai hướng
|
||||
STR_ERROR_CAN_T_DO_THIS :{WHITE}Không làm thế này được...
|
||||
STR_ERROR_BUILDING_MUST_BE_DEMOLISHED :{WHITE}Cần giải toả nhà cửa trước
|
||||
STR_ERROR_BUILDING_IS_PROTECTED :{WHITE}... công trình được bảo vệ
|
||||
STR_ERROR_CAN_T_CLEAR_THIS_AREA :{WHITE}Không thể dọn dẹp khu vực này...
|
||||
STR_ERROR_SITE_UNSUITABLE :{WHITE}... điểm không phù hợp
|
||||
STR_ERROR_ALREADY_BUILT :{WHITE}... đã xây rồi
|
||||
|
@ -4998,7 +5056,7 @@ STR_ERROR_TOO_CLOSE_TO_ANOTHER_TOWN :{WHITE}... quá
|
|||
STR_ERROR_TOO_MANY_TOWNS :{WHITE}... quá nhiều đô thị
|
||||
STR_ERROR_NO_SPACE_FOR_TOWN :{WHITE}... không còn khoảng trống nào trên bản đồ
|
||||
STR_ERROR_ROAD_WORKS_IN_PROGRESS :{WHITE}Xây dựng cầu đường đang tiến hành
|
||||
STR_ERROR_TOWN_CAN_T_DELETE :{WHITE}Không thể xoá đo thị này...{}Có một ga, bến hoặc xưởng thuộc đô thị hoặc là 1 ô đất của đô thị không thể xoá được.
|
||||
STR_ERROR_TOWN_CAN_T_DELETE :{WHITE}Không thể xoá đo thị này...{}{}Có một ga, bến hoặc xưởng thuộc đô thị hoặc là 1 ô đất của đô thị không thể xoá được.
|
||||
STR_ERROR_STATUE_NO_SUITABLE_PLACE :{WHITE}... không có nơi nào hợp lý để dựng tượng đài ở trung tâm đô thị này
|
||||
STR_ERROR_CAN_T_BUILD_HOUSE :{WHITE}Không thể xây dựng nhà...
|
||||
|
||||
|
@ -5825,6 +5883,7 @@ STR_CURRENCY_SHORT_GIGA :{NBSP}tỷ
|
|||
STR_CURRENCY_SHORT_TERA :{NBSP}ktỷ
|
||||
|
||||
STR_JUST_CARGO :{CARGO_LONG}
|
||||
STR_JUST_LEFT_ARROW :{LEFT_ARROW}
|
||||
STR_JUST_RIGHT_ARROW :{RIGHT_ARROW}
|
||||
STR_JUST_CHECKMARK :{CHECKMARK}
|
||||
STR_JUST_COMMA :{COMMA}
|
||||
|
@ -5864,3 +5923,11 @@ STR_SHIP :{BLACK}{SHIP}
|
|||
STR_TOOLBAR_RAILTYPE_VELOCITY :{STRING} ({VELOCITY})
|
||||
|
||||
STR_BADGE_NAME_LIST :{STRING}: {GOLD}{STRING}
|
||||
STR_BADGE_CONFIG_MENU_TOOLTIP :Mở thiết lập phù hiệu
|
||||
STR_BADGE_CONFIG_RESET :Thiêt lập lại
|
||||
STR_BADGE_CONFIG_ICONS :{WHITE}Ảnh phù hiệu
|
||||
STR_BADGE_CONFIG_FILTERS :{WHITE}Bộ lọc phù hiệu
|
||||
STR_BADGE_CONFIG_PREVIEW :Ảnh xem trước
|
||||
STR_BADGE_CONFIG_NAME :Tên
|
||||
STR_BADGE_FILTER_ANY_LABEL :Bất cứ {STRING} nào
|
||||
STR_BADGE_FILTER_IS_LABEL :{STRING} là {STRING}
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#ifndef NEWGRF_ROADSTATION_H
|
||||
#define NEWGRF_ROADSTATION_H
|
||||
|
||||
#include "bridge.h"
|
||||
#include "newgrf_animation_type.h"
|
||||
#include "newgrf_spritegroup.h"
|
||||
#include "newgrf_badge_type.h"
|
||||
|
@ -71,6 +72,12 @@ enum class RoadStopSpecFlag : uint8_t {
|
|||
};
|
||||
using RoadStopSpecFlags = EnumBitSet<RoadStopSpecFlag, uint8_t>;
|
||||
|
||||
enum class RoadStopSpecIntlFlag : uint8_t {
|
||||
BridgeHeightsSet, ///< bridge_height[6] is set.
|
||||
BridgeDisallowedPillarsSet, ///< bridge_disallowed_pillars[6] is set.
|
||||
};
|
||||
using RoadStopSpecIntlFlags = EnumBitSet<RoadStopSpecIntlFlag, uint8_t>;
|
||||
|
||||
enum RoadStopView : uint8_t {
|
||||
RSV_BAY_NE = 0, ///< Bay road stop, facing Northeast
|
||||
RSV_BAY_SE = 1, ///< Bay road stop, facing Southeast
|
||||
|
@ -133,17 +140,20 @@ struct RoadStopSpec : NewGRFSpecBase<RoadStopClassID> {
|
|||
RoadStopDrawModes draw_mode = {RoadStopDrawMode::Road, RoadStopDrawMode::Overlay};
|
||||
RoadStopCallbackMasks callback_mask{};
|
||||
RoadStopSpecFlags flags{};
|
||||
RoadStopSpecIntlFlags internal_flags{};
|
||||
|
||||
CargoTypes cargo_triggers = 0; ///< Bitmask of cargo types which cause trigger re-randomizing
|
||||
|
||||
AnimationInfo<StationAnimationTriggers> animation;
|
||||
|
||||
uint8_t bridge_height[6]; ///< Minimum height for a bridge above, 0 for none
|
||||
uint8_t bridge_disallowed_pillars[6]; ///< Disallowed pillar flags for a bridge above
|
||||
BridgePiecePillarFlags bridge_disallowed_pillars[6]; ///< Disallowed pillar flags for a bridge above
|
||||
|
||||
uint8_t build_cost_multiplier = 16; ///< Build cost multiplier per tile.
|
||||
uint8_t clear_cost_multiplier = 16; ///< Clear cost multiplier per tile.
|
||||
|
||||
uint8_t height; ///< The height of this structure, in heightlevels; max MAX_TILE_HEIGHT.
|
||||
|
||||
std::vector<BadgeID> badges;
|
||||
|
||||
/**
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#ifndef NEWGRF_STATION_H
|
||||
#define NEWGRF_STATION_H
|
||||
|
||||
#include "bridge.h"
|
||||
#include "core/enum_type.hpp"
|
||||
#include "newgrf_animation_type.h"
|
||||
#include "newgrf_badge_type.h"
|
||||
|
@ -118,6 +119,12 @@ enum class StationSpecFlag : uint8_t {
|
|||
};
|
||||
using StationSpecFlags = EnumBitSet<StationSpecFlag, uint8_t>;
|
||||
|
||||
enum class StationSpecIntlFlag : uint8_t {
|
||||
BridgeHeightsSet, ///< bridge_height[8] is set.
|
||||
BridgeDisallowedPillarsSet, ///< bridge_disallowed_pillars[8] is set.
|
||||
};
|
||||
using StationSpecIntlFlags = EnumBitSet<StationSpecIntlFlag, uint8_t>;
|
||||
|
||||
/** Station specification. */
|
||||
struct StationSpec : NewGRFSpecBase<StationClassID> {
|
||||
StationSpec() : name(0),
|
||||
|
@ -162,6 +169,12 @@ struct StationSpec : NewGRFSpecBase<StationClassID> {
|
|||
|
||||
StationSpecFlags flags; ///< Bitmask of flags, bit 0: use different sprite set; bit 1: divide cargo about by station size
|
||||
|
||||
struct BridgeAboveFlags {
|
||||
uint8_t height = UINT8_MAX; ///< Minimum height for a bridge above, 0 for none
|
||||
BridgePiecePillarFlags disallowed_pillars = {}; ///< Disallowed pillar flags for a bridge above
|
||||
};
|
||||
std::vector<BridgeAboveFlags> bridge_above_flags; ///< List of bridge above flags.
|
||||
|
||||
enum class TileFlag : uint8_t {
|
||||
Pylons = 0, ///< Tile should contain catenary pylons.
|
||||
NoWires = 1, ///< Tile should NOT contain catenary wires.
|
||||
|
@ -172,10 +185,18 @@ struct StationSpec : NewGRFSpecBase<StationClassID> {
|
|||
|
||||
AnimationInfo<StationAnimationTriggers> animation;
|
||||
|
||||
StationSpecIntlFlags internal_flags{}; ///< Bitmask of internal spec flags
|
||||
|
||||
/** Custom platform layouts, keyed by platform and length combined. */
|
||||
std::unordered_map<uint16_t, std::vector<uint8_t>> layouts;
|
||||
|
||||
std::vector<BadgeID> badges;
|
||||
|
||||
BridgeAboveFlags GetBridgeAboveFlags(uint gfx) const
|
||||
{
|
||||
if (gfx < this->bridge_above_flags.size()) return this->bridge_above_flags[gfx];
|
||||
return {};
|
||||
}
|
||||
};
|
||||
|
||||
/** Class containing information relating to station classes. */
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
/** @file station_cmd.cpp Handling of station tiles. */
|
||||
|
||||
#include "core/enum_type.hpp"
|
||||
#include "stdafx.h"
|
||||
#include "core/flatset_type.hpp"
|
||||
#include "aircraft.h"
|
||||
|
@ -949,125 +950,6 @@ static CommandCost CheckFlatLandRailStation(TileIndex tile_cur, TileIndex north_
|
|||
return cost;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a road stop can be built at the given tile.
|
||||
* @param cur_tile Tile to check.
|
||||
* @param allowed_z Height allowed for the tile. If allowed_z is negative, it will be set to the height of this tile.
|
||||
* @param flags Operation to perform.
|
||||
* @param invalid_dirs Prohibited directions (set of DiagDirections).
|
||||
* @param is_drive_through True if trying to build a drive-through station.
|
||||
* @param station_type Station type (bus, truck or road waypoint).
|
||||
* @param axis Axis of a drive-through road stop.
|
||||
* @param station StationID to be queried and returned if available.
|
||||
* @param rt Road type to build, may be INVALID_ROADTYPE if an existing road is required.
|
||||
* @return The cost in case of success, or an error code if it failed.
|
||||
*/
|
||||
static CommandCost CheckFlatLandRoadStop(TileIndex cur_tile, int &allowed_z, DoCommandFlags flags, DiagDirections invalid_dirs, bool is_drive_through, StationType station_type, Axis axis, StationID *station, RoadType rt)
|
||||
{
|
||||
CommandCost cost(EXPENSES_CONSTRUCTION);
|
||||
|
||||
CommandCost ret = CheckBuildableTile(cur_tile, invalid_dirs, allowed_z, !is_drive_through);
|
||||
if (ret.Failed()) return ret;
|
||||
cost.AddCost(ret.GetCost());
|
||||
|
||||
/* If station is set, then we have special handling to allow building on top of already existing stations.
|
||||
* Station points to StationID::Invalid() if we can build on any station.
|
||||
* Or it points to a station if we're only allowed to build on exactly that station. */
|
||||
if (station != nullptr && IsTileType(cur_tile, MP_STATION)) {
|
||||
if (!IsAnyRoadStop(cur_tile)) {
|
||||
return ClearTile_Station(cur_tile, DoCommandFlag::Auto); // Get error message.
|
||||
} else {
|
||||
if (station_type != GetStationType(cur_tile) ||
|
||||
is_drive_through != IsDriveThroughStopTile(cur_tile)) {
|
||||
return ClearTile_Station(cur_tile, DoCommandFlag::Auto); // Get error message.
|
||||
}
|
||||
/* Drive-through station in the wrong direction. */
|
||||
if (is_drive_through && IsDriveThroughStopTile(cur_tile) && GetDriveThroughStopAxis(cur_tile) != axis) {
|
||||
return CommandCost(STR_ERROR_DRIVE_THROUGH_DIRECTION);
|
||||
}
|
||||
StationID st = GetStationIndex(cur_tile);
|
||||
if (*station == StationID::Invalid()) {
|
||||
*station = st;
|
||||
} else if (*station != st) {
|
||||
return CommandCost(STR_ERROR_ADJOINS_MORE_THAN_ONE_EXISTING);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
bool build_over_road = is_drive_through && IsNormalRoadTile(cur_tile);
|
||||
/* Road bits in the wrong direction. */
|
||||
RoadBits rb = IsNormalRoadTile(cur_tile) ? GetAllRoadBits(cur_tile) : ROAD_NONE;
|
||||
if (build_over_road && (rb & (axis == AXIS_X ? ROAD_Y : ROAD_X)) != 0) {
|
||||
/* Someone was pedantic and *NEEDED* three fracking different error messages. */
|
||||
switch (CountBits(rb)) {
|
||||
case 1:
|
||||
return CommandCost(STR_ERROR_DRIVE_THROUGH_DIRECTION);
|
||||
|
||||
case 2:
|
||||
if (rb == ROAD_X || rb == ROAD_Y) return CommandCost(STR_ERROR_DRIVE_THROUGH_DIRECTION);
|
||||
return CommandCost(STR_ERROR_DRIVE_THROUGH_CORNER);
|
||||
|
||||
default: // 3 or 4
|
||||
return CommandCost(STR_ERROR_DRIVE_THROUGH_JUNCTION);
|
||||
}
|
||||
}
|
||||
|
||||
if (build_over_road) {
|
||||
/* There is a road, check if we can build road+tram stop over it. */
|
||||
RoadType road_rt = GetRoadType(cur_tile, RTT_ROAD);
|
||||
if (road_rt != INVALID_ROADTYPE) {
|
||||
Owner road_owner = GetRoadOwner(cur_tile, RTT_ROAD);
|
||||
if (road_owner == OWNER_TOWN) {
|
||||
if (!_settings_game.construction.road_stop_on_town_road) return CommandCost(STR_ERROR_DRIVE_THROUGH_ON_TOWN_ROAD);
|
||||
} else if (!_settings_game.construction.road_stop_on_competitor_road && road_owner != OWNER_NONE) {
|
||||
ret = CheckOwnership(road_owner);
|
||||
if (ret.Failed()) return ret;
|
||||
}
|
||||
uint num_pieces = CountBits(GetRoadBits(cur_tile, RTT_ROAD));
|
||||
|
||||
if (rt != INVALID_ROADTYPE && RoadTypeIsRoad(rt) && !HasPowerOnRoad(rt, road_rt)) return CommandCost(STR_ERROR_NO_SUITABLE_ROAD);
|
||||
|
||||
if (GetDisallowedRoadDirections(cur_tile) != DRD_NONE && road_owner != OWNER_TOWN) {
|
||||
ret = CheckOwnership(road_owner);
|
||||
if (ret.Failed()) return ret;
|
||||
}
|
||||
|
||||
cost.AddCost(RoadBuildCost(road_rt) * (2 - num_pieces));
|
||||
} else if (rt != INVALID_ROADTYPE && RoadTypeIsRoad(rt)) {
|
||||
cost.AddCost(RoadBuildCost(rt) * 2);
|
||||
}
|
||||
|
||||
/* There is a tram, check if we can build road+tram stop over it. */
|
||||
RoadType tram_rt = GetRoadType(cur_tile, RTT_TRAM);
|
||||
if (tram_rt != INVALID_ROADTYPE) {
|
||||
Owner tram_owner = GetRoadOwner(cur_tile, RTT_TRAM);
|
||||
if (Company::IsValidID(tram_owner) &&
|
||||
(!_settings_game.construction.road_stop_on_competitor_road ||
|
||||
/* Disallow breaking end-of-line of someone else
|
||||
* so trams can still reverse on this tile. */
|
||||
HasExactlyOneBit(GetRoadBits(cur_tile, RTT_TRAM)))) {
|
||||
ret = CheckOwnership(tram_owner);
|
||||
if (ret.Failed()) return ret;
|
||||
}
|
||||
uint num_pieces = CountBits(GetRoadBits(cur_tile, RTT_TRAM));
|
||||
|
||||
if (rt != INVALID_ROADTYPE && RoadTypeIsTram(rt) && !HasPowerOnRoad(rt, tram_rt)) return CommandCost(STR_ERROR_NO_SUITABLE_ROAD);
|
||||
|
||||
cost.AddCost(RoadBuildCost(tram_rt) * (2 - num_pieces));
|
||||
} else if (rt != INVALID_ROADTYPE && RoadTypeIsTram(rt)) {
|
||||
cost.AddCost(RoadBuildCost(rt) * 2);
|
||||
}
|
||||
} else if (rt == INVALID_ROADTYPE) {
|
||||
return CommandCost(STR_ERROR_THERE_IS_NO_ROAD);
|
||||
} else {
|
||||
ret = Command<CMD_LANDSCAPE_CLEAR>::Do(flags, cur_tile);
|
||||
if (ret.Failed()) return ret;
|
||||
cost.AddCost(ret.GetCost());
|
||||
cost.AddCost(RoadBuildCost(rt) * 2);
|
||||
}
|
||||
}
|
||||
|
||||
return cost;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check whether we can expand the rail part of the given station.
|
||||
|
@ -1324,6 +1206,230 @@ void SetRailStationTileFlags(TileIndex tile, const StationSpec *statspec)
|
|||
SetStationTileHaveWires(tile, !flags.Test(StationSpec::TileFlag::NoWires));
|
||||
}
|
||||
|
||||
CommandCost IsRailStationBridgeAboveOk(TileIndex tile, const StationSpec *statspec, uint8_t layout, TileIndex northern_bridge_end, TileIndex southern_bridge_end, int bridge_height,
|
||||
BridgeType bridge_type, TransportType bridge_transport_type)
|
||||
{
|
||||
if (statspec != nullptr && statspec->internal_flags.Test(StationSpecIntlFlag::BridgeHeightsSet)) {
|
||||
int height_above = statspec->GetBridgeAboveFlags(layout).height;
|
||||
if (height_above == 0) return CommandCost(INVALID_STRING_ID);
|
||||
if (GetTileMaxZ(tile) + height_above > bridge_height) {
|
||||
return CommandCost(STR_ERROR_BRIDGE_TOO_LOW_FOR_STATION);
|
||||
}
|
||||
} else if (!statspec) {
|
||||
/* Default stations/waypoints */
|
||||
const int height = layout < 4 ? 2 : 5;
|
||||
if (GetTileMaxZ(tile) + height > bridge_height) return CommandCost(STR_ERROR_BRIDGE_TOO_LOW_FOR_STATION);
|
||||
} else {
|
||||
return CommandCost(INVALID_STRING_ID);
|
||||
}
|
||||
|
||||
BridgePiecePillarFlags disallowed_pillar_flags;
|
||||
if (statspec != nullptr && statspec->internal_flags.Test(StationSpecIntlFlag::BridgeDisallowedPillarsSet)) {
|
||||
/* Pillar flags set by NewGRF */
|
||||
disallowed_pillar_flags = statspec->GetBridgeAboveFlags(layout).disallowed_pillars;
|
||||
} else if (!statspec) {
|
||||
/* Default stations/waypoints */
|
||||
if (layout < 8) {
|
||||
static const BridgePiecePillarFlags st_flags[8] = {
|
||||
{BridgePiecePillarFlag::BPPF_EDGE_SW, BridgePiecePillarFlag::BPPF_EDGE_NE}, //0x50,
|
||||
{BridgePiecePillarFlag::BPPF_EDGE_NW, BridgePiecePillarFlag::BPPF_EDGE_SE}, //0xA0,
|
||||
{BridgePiecePillarFlag::BPPF_EDGE_SW, BridgePiecePillarFlag::BPPF_EDGE_NE}, //0x50,
|
||||
{BridgePiecePillarFlag::BPPF_EDGE_NW, BridgePiecePillarFlag::BPPF_EDGE_SE}, //0xA0,
|
||||
{BridgePiecePillarFlag::BPPF_EDGE_SW, BridgePiecePillarFlag::BPPF_EDGE_NE, BridgePiecePillarFlag::BPPF_EDGE_SE, BridgePiecePillarFlag::BPPF_CORNER_E, BridgePiecePillarFlag::BPPF_CORNER_S}, //0x50 | 0x26,
|
||||
{BridgePiecePillarFlag::BPPF_EDGE_NW, BridgePiecePillarFlag::BPPF_EDGE_SE, BridgePiecePillarFlag::BPPF_EDGE_NE, BridgePiecePillarFlag::BPPF_CORNER_N, BridgePiecePillarFlag::BPPF_CORNER_E}, //0xA0 | 0x1C,
|
||||
{BridgePiecePillarFlag::BPPF_EDGE_NW, BridgePiecePillarFlag::BPPF_EDGE_SE, BridgePiecePillarFlag::BPPF_EDGE_NW, BridgePiecePillarFlag::BPPF_CORNER_N, BridgePiecePillarFlag::BPPF_CORNER_W}, //0x50 | 0x89,
|
||||
{BridgePiecePillarFlag::BPPF_EDGE_NW, BridgePiecePillarFlag::BPPF_EDGE_SE, BridgePiecePillarFlag::BPPF_EDGE_SW, BridgePiecePillarFlag::BPPF_CORNER_S, BridgePiecePillarFlag::BPPF_CORNER_W} //0xA0 | 0x43
|
||||
};
|
||||
|
||||
disallowed_pillar_flags = st_flags[layout];
|
||||
} else {
|
||||
disallowed_pillar_flags = {};
|
||||
}
|
||||
} else if (GetStationTileFlags(layout, statspec).Test(StationSpec::TileFlag::Blocked)) {
|
||||
/* Non-track station tiles */
|
||||
disallowed_pillar_flags = {};
|
||||
} else {
|
||||
/* Tracked station tiles */
|
||||
const Axis axis = HasBit(layout, 0) ? AXIS_Y : AXIS_X;
|
||||
disallowed_pillar_flags = axis == AXIS_X ? BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_EDGE_SW, BridgePiecePillarFlag::BPPF_EDGE_NE}) : BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_EDGE_NW, BridgePiecePillarFlag::BPPF_EDGE_SE}); //0x50, 0xA0
|
||||
}
|
||||
|
||||
if (!(GetBridgeTilePillarFlags(tile, northern_bridge_end, southern_bridge_end, bridge_type, bridge_transport_type) & disallowed_pillar_flags).Any()) return CommandCost(STR_ERROR_BRIDGE_PILLARS_OBSTRUCT_STATION);
|
||||
|
||||
return CommandCost();
|
||||
}
|
||||
|
||||
CommandCost IsRailStationBridgeAboveOk(TileIndex tile, const StationSpec *statspec, uint8_t layout)
|
||||
{
|
||||
if (!IsBridgeAbove(tile)) return CommandCost();
|
||||
|
||||
TileIndex southern_bridge_end = GetSouthernBridgeEnd(tile);
|
||||
TileIndex northern_bridge_end = GetNorthernBridgeEnd(tile);
|
||||
return IsRailStationBridgeAboveOk(tile, statspec, layout, northern_bridge_end, southern_bridge_end, GetBridgeHeight(southern_bridge_end),
|
||||
GetBridgeType(southern_bridge_end), GetTunnelBridgeTransportType(southern_bridge_end));
|
||||
}
|
||||
|
||||
CommandCost IsRoadStopBridgeAboveOK(TileIndex tile, const RoadStopSpec *spec, bool drive_through, DiagDirection entrance,
|
||||
TileIndex northern_bridge_end, TileIndex southern_bridge_end, int bridge_height,
|
||||
BridgeType bridge_type, TransportType bridge_transport_type)
|
||||
{
|
||||
if (spec != nullptr && spec->internal_flags.Test(RoadStopSpecIntlFlag::BridgeHeightsSet)) {
|
||||
int height = spec->bridge_height[drive_through ? (GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET + DiagDirToAxis(entrance)) : entrance];
|
||||
if (height == 0) return CommandCost(INVALID_STRING_ID);
|
||||
if (GetTileMaxZ(tile) + height > bridge_height) {
|
||||
return CommandCost(STR_ERROR_BRIDGE_TOO_LOW_FOR_STATION);
|
||||
}
|
||||
} else {
|
||||
return CommandCost(INVALID_STRING_ID);
|
||||
|
||||
if (GetTileMaxZ(tile) + (drive_through ? 1 : 2) > bridge_height) {
|
||||
return CommandCost(STR_ERROR_BRIDGE_TOO_LOW_FOR_STATION);
|
||||
}
|
||||
}
|
||||
|
||||
BridgePiecePillarFlags disallowed_pillar_flags = {};
|
||||
if (spec != nullptr && spec->internal_flags.Test(RoadStopSpecIntlFlag::BridgeDisallowedPillarsSet)) {
|
||||
disallowed_pillar_flags = spec->bridge_disallowed_pillars[drive_through ? (GFX_TRUCK_BUS_DRIVETHROUGH_OFFSET + DiagDirToAxis(entrance)) : entrance];
|
||||
} else if (drive_through) {
|
||||
disallowed_pillar_flags = DiagDirToAxis(entrance) == AXIS_X ? BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_EDGE_SW, BridgePiecePillarFlag::BPPF_EDGE_NE}) : BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_EDGE_NW, BridgePiecePillarFlag::BPPF_EDGE_SE}); //0x50, 0xA0
|
||||
} else {
|
||||
disallowed_pillar_flags.Set((BridgePiecePillarFlags) (4 + entrance));
|
||||
}
|
||||
if (!(GetBridgeTilePillarFlags(tile, northern_bridge_end, southern_bridge_end, bridge_type, bridge_transport_type) & disallowed_pillar_flags).Any()) return CommandCost(STR_ERROR_BRIDGE_PILLARS_OBSTRUCT_STATION);
|
||||
|
||||
return CommandCost();
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a road stop can be built at the given tile.
|
||||
* @param cur_tile Tile to check.
|
||||
* @param allowed_z Height allowed for the tile. If allowed_z is negative, it will be set to the height of this tile.
|
||||
* @param flags Operation to perform.
|
||||
* @param invalid_dirs Prohibited directions (set of DiagDirections).
|
||||
* @param is_drive_through True if trying to build a drive-through station.
|
||||
* @param station_type Station type (bus, truck or road waypoint).
|
||||
* @param axis Axis of a drive-through road stop.
|
||||
* @param station StationID to be queried and returned if available.
|
||||
* @param rt Road type to build, may be INVALID_ROADTYPE if an existing road is required.
|
||||
* @return The cost in case of success, or an error code if it failed.
|
||||
*/
|
||||
static CommandCost CheckFlatLandRoadStop(TileIndex cur_tile, int &allowed_z, const RoadStopSpec *spec, DoCommandFlags flags, DiagDirections invalid_dirs, bool is_drive_through, StationType station_type, Axis axis, StationID *station, RoadType rt)
|
||||
{
|
||||
CommandCost cost(EXPENSES_CONSTRUCTION);
|
||||
|
||||
bool allow_under_bridge = spec != nullptr && spec->internal_flags.Test(RoadStopSpecIntlFlag::BridgeHeightsSet);
|
||||
CommandCost ret = CheckBuildableTile(cur_tile, invalid_dirs, allowed_z, !is_drive_through, true);
|
||||
if (ret.Failed()) return ret;
|
||||
cost.AddCost(ret.GetCost());
|
||||
|
||||
if (allow_under_bridge && IsBridgeAbove(cur_tile)) {
|
||||
TileIndex southern_bridge_end = GetSouthernBridgeEnd(cur_tile);
|
||||
TileIndex northern_bridge_end = GetNorthernBridgeEnd(cur_tile);
|
||||
CommandCost bridge_ret = IsRoadStopBridgeAboveOK(cur_tile, spec, is_drive_through, DiagDirection::DIAGDIR_NE /*obviously wrong, but how do you get the "first bit" from invalid_dirs? and how would that be correct?? */,
|
||||
northern_bridge_end, southern_bridge_end, GetBridgeHeight(southern_bridge_end),
|
||||
GetBridgeType(southern_bridge_end), GetTunnelBridgeTransportType(southern_bridge_end));
|
||||
if (bridge_ret.Failed()) return bridge_ret;
|
||||
}
|
||||
|
||||
/* If station is set, then we have special handling to allow building on top of already existing stations.
|
||||
* Station points to StationID::Invalid() if we can build on any station.
|
||||
* Or it points to a station if we're only allowed to build on exactly that station. */
|
||||
if (station != nullptr && IsTileType(cur_tile, MP_STATION)) {
|
||||
if (!IsAnyRoadStop(cur_tile)) {
|
||||
return ClearTile_Station(cur_tile, DoCommandFlag::Auto); // Get error message.
|
||||
} else {
|
||||
if (station_type != GetStationType(cur_tile) ||
|
||||
is_drive_through != IsDriveThroughStopTile(cur_tile)) {
|
||||
return ClearTile_Station(cur_tile, DoCommandFlag::Auto); // Get error message.
|
||||
}
|
||||
/* Drive-through station in the wrong direction. */
|
||||
if (is_drive_through && IsDriveThroughStopTile(cur_tile) && GetDriveThroughStopAxis(cur_tile) != axis) {
|
||||
return CommandCost(STR_ERROR_DRIVE_THROUGH_DIRECTION);
|
||||
}
|
||||
StationID st = GetStationIndex(cur_tile);
|
||||
if (*station == StationID::Invalid()) {
|
||||
*station = st;
|
||||
} else if (*station != st) {
|
||||
return CommandCost(STR_ERROR_ADJOINS_MORE_THAN_ONE_EXISTING);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
bool build_over_road = is_drive_through && IsNormalRoadTile(cur_tile);
|
||||
/* Road bits in the wrong direction. */
|
||||
RoadBits rb = IsNormalRoadTile(cur_tile) ? GetAllRoadBits(cur_tile) : ROAD_NONE;
|
||||
if (build_over_road && (rb & (axis == AXIS_X ? ROAD_Y : ROAD_X)) != 0) {
|
||||
/* Someone was pedantic and *NEEDED* three fracking different error messages. */
|
||||
switch (CountBits(rb)) {
|
||||
case 1:
|
||||
return CommandCost(STR_ERROR_DRIVE_THROUGH_DIRECTION);
|
||||
|
||||
case 2:
|
||||
if (rb == ROAD_X || rb == ROAD_Y) return CommandCost(STR_ERROR_DRIVE_THROUGH_DIRECTION);
|
||||
return CommandCost(STR_ERROR_DRIVE_THROUGH_CORNER);
|
||||
|
||||
default: // 3 or 4
|
||||
return CommandCost(STR_ERROR_DRIVE_THROUGH_JUNCTION);
|
||||
}
|
||||
}
|
||||
|
||||
if (build_over_road) {
|
||||
/* There is a road, check if we can build road+tram stop over it. */
|
||||
RoadType road_rt = GetRoadType(cur_tile, RTT_ROAD);
|
||||
if (road_rt != INVALID_ROADTYPE) {
|
||||
Owner road_owner = GetRoadOwner(cur_tile, RTT_ROAD);
|
||||
if (road_owner == OWNER_TOWN) {
|
||||
if (!_settings_game.construction.road_stop_on_town_road) return CommandCost(STR_ERROR_DRIVE_THROUGH_ON_TOWN_ROAD);
|
||||
} else if (!_settings_game.construction.road_stop_on_competitor_road && road_owner != OWNER_NONE) {
|
||||
ret = CheckOwnership(road_owner);
|
||||
if (ret.Failed()) return ret;
|
||||
}
|
||||
uint num_pieces = CountBits(GetRoadBits(cur_tile, RTT_ROAD));
|
||||
|
||||
if (rt != INVALID_ROADTYPE && RoadTypeIsRoad(rt) && !HasPowerOnRoad(rt, road_rt)) return CommandCost(STR_ERROR_NO_SUITABLE_ROAD);
|
||||
|
||||
if (GetDisallowedRoadDirections(cur_tile) != DRD_NONE && road_owner != OWNER_TOWN) {
|
||||
ret = CheckOwnership(road_owner);
|
||||
if (ret.Failed()) return ret;
|
||||
}
|
||||
|
||||
cost.AddCost(RoadBuildCost(road_rt) * (2 - num_pieces));
|
||||
} else if (rt != INVALID_ROADTYPE && RoadTypeIsRoad(rt)) {
|
||||
cost.AddCost(RoadBuildCost(rt) * 2);
|
||||
}
|
||||
|
||||
/* There is a tram, check if we can build road+tram stop over it. */
|
||||
RoadType tram_rt = GetRoadType(cur_tile, RTT_TRAM);
|
||||
if (tram_rt != INVALID_ROADTYPE) {
|
||||
Owner tram_owner = GetRoadOwner(cur_tile, RTT_TRAM);
|
||||
if (Company::IsValidID(tram_owner) &&
|
||||
(!_settings_game.construction.road_stop_on_competitor_road ||
|
||||
/* Disallow breaking end-of-line of someone else
|
||||
* so trams can still reverse on this tile. */
|
||||
HasExactlyOneBit(GetRoadBits(cur_tile, RTT_TRAM)))) {
|
||||
ret = CheckOwnership(tram_owner);
|
||||
if (ret.Failed()) return ret;
|
||||
}
|
||||
uint num_pieces = CountBits(GetRoadBits(cur_tile, RTT_TRAM));
|
||||
|
||||
if (rt != INVALID_ROADTYPE && RoadTypeIsTram(rt) && !HasPowerOnRoad(rt, tram_rt)) return CommandCost(STR_ERROR_NO_SUITABLE_ROAD);
|
||||
|
||||
cost.AddCost(RoadBuildCost(tram_rt) * (2 - num_pieces));
|
||||
} else if (rt != INVALID_ROADTYPE && RoadTypeIsTram(rt)) {
|
||||
cost.AddCost(RoadBuildCost(rt) * 2);
|
||||
}
|
||||
} else if (rt == INVALID_ROADTYPE) {
|
||||
return CommandCost(STR_ERROR_THERE_IS_NO_ROAD);
|
||||
} else {
|
||||
ret = Command<CMD_LANDSCAPE_CLEAR>::Do(flags, cur_tile);
|
||||
if (ret.Failed()) return ret;
|
||||
cost.AddCost(ret.GetCost());
|
||||
cost.AddCost(RoadBuildCost(rt) * 2);
|
||||
}
|
||||
}
|
||||
|
||||
return cost;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build rail station
|
||||
* @param flags operation to perform
|
||||
|
@ -1362,6 +1468,9 @@ CommandCost CmdBuildRailStation(DoCommandFlags flags, TileIndex tile_org, RailTy
|
|||
w_org = numtracks;
|
||||
}
|
||||
|
||||
/* Check if the first tile and the last tile are valid */
|
||||
if (!IsValidTile(tile_org) || TileAddWrap(tile_org, w_org - 1, h_org - 1) == INVALID_TILE) return CMD_ERROR;
|
||||
|
||||
bool reuse = (station_to_join != NEW_STATION);
|
||||
if (!reuse) station_to_join = StationID::Invalid();
|
||||
bool distant_join = (station_to_join != StationID::Invalid());
|
||||
|
@ -1376,6 +1485,7 @@ CommandCost CmdBuildRailStation(DoCommandFlags flags, TileIndex tile_org, RailTy
|
|||
/* Make sure the area below consists of clear tiles. (OR tiles belonging to a certain rail station) */
|
||||
StationID est = StationID::Invalid();
|
||||
std::vector<Train *> affected_vehicles;
|
||||
|
||||
/* Add construction and clearing expenses. */
|
||||
CommandCost cost = CalculateRailStationCost(new_location, flags, axis, &est, rt, affected_vehicles, spec_class, spec_index, plat_len, numtracks);
|
||||
if (cost.Failed()) return cost;
|
||||
|
@ -1423,23 +1533,30 @@ CommandCost CmdBuildRailStation(DoCommandFlags flags, TileIndex tile_org, RailTy
|
|||
st->cached_anim_triggers.Set(statspec->animation.triggers);
|
||||
}
|
||||
|
||||
TileIndexDiff tile_delta = TileOffsByAxis(axis); // offset to go to the next platform tile
|
||||
TileIndexDiff track_delta = TileOffsByAxis(OtherAxis(axis)); // offset to go to the next track
|
||||
Track track = AxisToTrack(axis);
|
||||
|
||||
std::vector<uint8_t> layouts(numtracks * plat_len);
|
||||
GetStationLayout(layouts.data(), numtracks, plat_len, statspec);
|
||||
|
||||
TileIndexDiff tile_delta = TileOffsByAxis(axis); // offset to go to the next platform tile
|
||||
TileIndexDiff track_delta = TileOffsByAxis(OtherAxis(axis)); // offset to go to the next track
|
||||
Track track = AxisToTrack(axis);
|
||||
uint8_t numtracks_orig = numtracks;
|
||||
|
||||
Company *c = Company::Get(st->owner);
|
||||
size_t layout_idx = 0;
|
||||
TileIndex tile_track = tile_org;
|
||||
|
||||
do {
|
||||
TileIndex tile = tile_track;
|
||||
int w = plat_len;
|
||||
do {
|
||||
uint8_t layout = layouts[layout_idx++];
|
||||
|
||||
ret = IsRailStationBridgeAboveOk(tile, statspec, layout);
|
||||
if (ret.Failed()) {
|
||||
//return CommandCost::DualErrorMessage(STR_ERROR_MUST_DEMOLISH_BRIDGE_FIRST, ret.GetErrorMessage()); //FIXME
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (IsRailStationTile(tile) && HasStationReservation(tile)) {
|
||||
/* Check for trains having a reservation for this tile. */
|
||||
Train *v = GetTrainForReservation(tile, AxisToTrack(GetRailStationAxis(tile)));
|
||||
|
@ -1913,7 +2030,7 @@ static CommandCost FindJoiningRoadStop(StationID existing_stop, StationID statio
|
|||
* @param unit_cost The cost to build one road stop of the current type.
|
||||
* @return The cost in case of success, or an error code if it failed.
|
||||
*/
|
||||
CommandCost CalculateRoadStopCost(TileArea tile_area, DoCommandFlags flags, bool is_drive_through, StationType station_type, Axis axis, DiagDirection ddir, StationID *est, RoadType rt, Money unit_cost)
|
||||
CommandCost CalculateRoadStopCost(TileArea tile_area, DoCommandFlags flags, bool is_drive_through, StationType station_type, const RoadStopSpec *roadstopspec, Axis axis, DiagDirection ddir, StationID *est, RoadType rt, Money unit_cost)
|
||||
{
|
||||
DiagDirections invalid_dirs{};
|
||||
if (is_drive_through) {
|
||||
|
@ -1927,7 +2044,7 @@ CommandCost CalculateRoadStopCost(TileArea tile_area, DoCommandFlags flags, bool
|
|||
int allowed_z = -1;
|
||||
CommandCost cost(EXPENSES_CONSTRUCTION);
|
||||
for (TileIndex cur_tile : tile_area) {
|
||||
CommandCost ret = CheckFlatLandRoadStop(cur_tile, allowed_z, flags, invalid_dirs, is_drive_through, station_type, axis, est, rt);
|
||||
CommandCost ret = CheckFlatLandRoadStop(cur_tile, allowed_z, roadstopspec, flags, invalid_dirs, is_drive_through, station_type, axis, est, rt);
|
||||
if (ret.Failed()) return ret;
|
||||
|
||||
bool is_preexisting_roadstop = IsTileType(cur_tile, MP_STATION) && IsAnyRoadStop(cur_tile);
|
||||
|
@ -2008,7 +2125,7 @@ CommandCost CmdBuildRoadStop(DoCommandFlags flags, TileIndex tile, uint8_t width
|
|||
unit_cost = _price[is_truck_stop ? PR_BUILD_STATION_TRUCK : PR_BUILD_STATION_BUS];
|
||||
}
|
||||
StationID est = StationID::Invalid();
|
||||
CommandCost cost = CalculateRoadStopCost(roadstop_area, flags, is_drive_through, is_truck_stop ? StationType::Truck : StationType::Bus, axis, ddir, &est, rt, unit_cost);
|
||||
CommandCost cost = CalculateRoadStopCost(roadstop_area, flags, is_drive_through, is_truck_stop ? StationType::Truck : StationType::Bus, roadstopspec, axis, ddir, &est, rt, unit_cost);
|
||||
if (cost.Failed()) return cost;
|
||||
|
||||
Station *st = nullptr;
|
||||
|
@ -3380,6 +3497,7 @@ draw_default_foundation:
|
|||
}
|
||||
|
||||
DrawRailTileSeq(ti, t, TO_BUILDINGS, total_offset, relocation, palette);
|
||||
DrawBridgeMiddle(ti);
|
||||
}
|
||||
|
||||
void StationPickerDrawSprite(int x, int y, StationType st, RailType railtype, RoadType roadtype, int image)
|
||||
|
|
|
@ -740,8 +740,53 @@ static const std::span<const std::span<const PalSpriteID>> _bridge_sprite_table[
|
|||
* @param nrl description of the rail bridge in query tool
|
||||
* @param nrd description of the road bridge in query tool
|
||||
*/
|
||||
#define MBR(y, mnl, mxl, p, mxs, spr, plt, dsc, nrl, nrd) \
|
||||
{TimerGameCalendar::Year{y}, mnl, mxl, p, mxs, spr, plt, dsc, { nrl, nrd }, {}, 0}
|
||||
#define MBR(y, mnl, mxl, p, mxs, spr, plt, dsc, nrl, nrd, pillars) \
|
||||
{TimerGameCalendar::Year{y}, mnl, mxl, p, mxs, spr, plt, dsc, { nrl, nrd }, {}, 0, BridgeSpecCtrlFlags(), pillars}
|
||||
|
||||
static constexpr std::array<BridgePiecePillarFlags, 12> all_pillars = {
|
||||
BridgePiecePillarFlag::BPPF_ALL_CORNERS, //0x0F,
|
||||
BridgePiecePillarFlag::BPPF_ALL_CORNERS, //0x0F,
|
||||
BridgePiecePillarFlag::BPPF_ALL_CORNERS, //0x0F,
|
||||
BridgePiecePillarFlag::BPPF_ALL_CORNERS, //0x0F,
|
||||
BridgePiecePillarFlag::BPPF_ALL_CORNERS, //0x0F,
|
||||
BridgePiecePillarFlag::BPPF_ALL_CORNERS, //0x0F,
|
||||
BridgePiecePillarFlag::BPPF_ALL_CORNERS, //0x0F,
|
||||
BridgePiecePillarFlag::BPPF_ALL_CORNERS, //0x0F,
|
||||
BridgePiecePillarFlag::BPPF_ALL_CORNERS, //0x0F,
|
||||
BridgePiecePillarFlag::BPPF_ALL_CORNERS, //0x0F,
|
||||
BridgePiecePillarFlag::BPPF_ALL_CORNERS, //0x0F,
|
||||
BridgePiecePillarFlag::BPPF_ALL_CORNERS, //0x0F
|
||||
};
|
||||
|
||||
static constexpr std::array<BridgePiecePillarFlags, 12> susp_pillars = {
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_CORNER_W, BridgePiecePillarFlag::BPPF_CORNER_S}), //0x03,
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_CORNER_S, BridgePiecePillarFlag::BPPF_CORNER_E}), //0x06,
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_CORNER_E, BridgePiecePillarFlag::BPPF_CORNER_N}), //0x0C,
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_CORNER_W, BridgePiecePillarFlag::BPPF_CORNER_N}), //0x09,
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_CORNER_E, BridgePiecePillarFlag::BPPF_CORNER_N}), //0x0C,
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_CORNER_W, BridgePiecePillarFlag::BPPF_CORNER_N}), //0x09,
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_CORNER_W, BridgePiecePillarFlag::BPPF_CORNER_S}), //0x03,
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_CORNER_S, BridgePiecePillarFlag::BPPF_CORNER_E}), //0x06,
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_ALL_CORNERS}), //0x0F,
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_ALL_CORNERS}), //0x0F,
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag()}), //0x00,
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag()}), //0x00
|
||||
};
|
||||
|
||||
static constexpr std::array<BridgePiecePillarFlags, 12> cant_pillars = {
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag()}), //0x00,
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag()}), //0x00,
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_CORNER_E, BridgePiecePillarFlag::BPPF_CORNER_N}), //0x0C,
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_CORNER_W, BridgePiecePillarFlag::BPPF_CORNER_N}), //0x09,
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_CORNER_E, BridgePiecePillarFlag::BPPF_CORNER_N}), //0x0C,
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_CORNER_W, BridgePiecePillarFlag::BPPF_CORNER_N}), //0x09,
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_CORNER_E, BridgePiecePillarFlag::BPPF_CORNER_N}), //0x0C,
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_CORNER_W, BridgePiecePillarFlag::BPPF_CORNER_N}), //0x09,
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_CORNER_E, BridgePiecePillarFlag::BPPF_CORNER_N}), //0x0C,
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_CORNER_W, BridgePiecePillarFlag::BPPF_CORNER_N}), //0x09,
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_CORNER_E, BridgePiecePillarFlag::BPPF_CORNER_N}), //0x0C,
|
||||
BridgePiecePillarFlags({BridgePiecePillarFlag::BPPF_CORNER_W, BridgePiecePillarFlag::BPPF_CORNER_N}), //0x09
|
||||
};
|
||||
|
||||
const BridgeSpec _orig_bridge[] = {
|
||||
/*
|
||||
|
@ -755,43 +800,43 @@ const BridgeSpec _orig_bridge[] = {
|
|||
string with description name on rail name on road
|
||||
| | | | */
|
||||
MBR( 0, 0, 0xFFFF, 80, 32, 0xA24, PAL_NONE,
|
||||
STR_BRIDGE_NAME_WOODEN, STR_LAI_BRIDGE_DESCRIPTION_RAIL_WOODEN, STR_LAI_BRIDGE_DESCRIPTION_ROAD_WOODEN),
|
||||
STR_BRIDGE_NAME_WOODEN, STR_LAI_BRIDGE_DESCRIPTION_RAIL_WOODEN, STR_LAI_BRIDGE_DESCRIPTION_ROAD_WOODEN, all_pillars),
|
||||
|
||||
MBR( 0, 0, 2, 112, 48, 0xA26, PALETTE_TO_STRUCT_RED,
|
||||
STR_BRIDGE_NAME_CONCRETE, STR_LAI_BRIDGE_DESCRIPTION_RAIL_CONCRETE, STR_LAI_BRIDGE_DESCRIPTION_ROAD_CONCRETE),
|
||||
STR_BRIDGE_NAME_CONCRETE, STR_LAI_BRIDGE_DESCRIPTION_RAIL_CONCRETE, STR_LAI_BRIDGE_DESCRIPTION_ROAD_CONCRETE, all_pillars),
|
||||
|
||||
MBR(1930, 0, 5, 144, 64, 0xA25, PAL_NONE,
|
||||
STR_BRIDGE_NAME_GIRDER_STEEL, STR_LAI_BRIDGE_DESCRIPTION_RAIL_GIRDER_STEEL, STR_LAI_BRIDGE_DESCRIPTION_ROAD_GIRDER_STEEL),
|
||||
STR_BRIDGE_NAME_GIRDER_STEEL, STR_LAI_BRIDGE_DESCRIPTION_RAIL_GIRDER_STEEL, STR_LAI_BRIDGE_DESCRIPTION_ROAD_GIRDER_STEEL, all_pillars),
|
||||
|
||||
MBR( 0, 2, 10, 168, 80, 0xA22, PALETTE_TO_STRUCT_CONCRETE,
|
||||
STR_BRIDGE_NAME_SUSPENSION_CONCRETE, STR_LAI_BRIDGE_DESCRIPTION_RAIL_SUSPENSION_CONCRETE, STR_LAI_BRIDGE_DESCRIPTION_ROAD_SUSPENSION_CONCRETE),
|
||||
STR_BRIDGE_NAME_SUSPENSION_CONCRETE, STR_LAI_BRIDGE_DESCRIPTION_RAIL_SUSPENSION_CONCRETE, STR_LAI_BRIDGE_DESCRIPTION_ROAD_SUSPENSION_CONCRETE, susp_pillars),
|
||||
|
||||
MBR(1930, 3, 0xFFFF, 185, 96, 0xA22, PAL_NONE,
|
||||
STR_BRIDGE_NAME_SUSPENSION_STEEL, STR_LAI_BRIDGE_DESCRIPTION_RAIL_SUSPENSION_STEEL, STR_LAI_BRIDGE_DESCRIPTION_ROAD_SUSPENSION_STEEL),
|
||||
STR_BRIDGE_NAME_SUSPENSION_STEEL, STR_LAI_BRIDGE_DESCRIPTION_RAIL_SUSPENSION_STEEL, STR_LAI_BRIDGE_DESCRIPTION_ROAD_SUSPENSION_STEEL, susp_pillars),
|
||||
|
||||
MBR(1930, 3, 0xFFFF, 192, 112, 0xA22, PALETTE_TO_STRUCT_YELLOW,
|
||||
STR_BRIDGE_NAME_SUSPENSION_STEEL, STR_LAI_BRIDGE_DESCRIPTION_RAIL_SUSPENSION_STEEL, STR_LAI_BRIDGE_DESCRIPTION_ROAD_SUSPENSION_STEEL),
|
||||
STR_BRIDGE_NAME_SUSPENSION_STEEL, STR_LAI_BRIDGE_DESCRIPTION_RAIL_SUSPENSION_STEEL, STR_LAI_BRIDGE_DESCRIPTION_ROAD_SUSPENSION_STEEL, susp_pillars),
|
||||
|
||||
MBR(1930, 3, 7, 224, 160, 0xA23, PAL_NONE,
|
||||
STR_BRIDGE_NAME_CANTILEVER_STEEL, STR_LAI_BRIDGE_DESCRIPTION_RAIL_CANTILEVER_STEEL, STR_LAI_BRIDGE_DESCRIPTION_ROAD_CANTILEVER_STEEL),
|
||||
STR_BRIDGE_NAME_CANTILEVER_STEEL, STR_LAI_BRIDGE_DESCRIPTION_RAIL_CANTILEVER_STEEL, STR_LAI_BRIDGE_DESCRIPTION_ROAD_CANTILEVER_STEEL, cant_pillars),
|
||||
|
||||
MBR(1930, 3, 8, 232, 208, 0xA23, PALETTE_TO_STRUCT_BROWN,
|
||||
STR_BRIDGE_NAME_CANTILEVER_STEEL, STR_LAI_BRIDGE_DESCRIPTION_RAIL_CANTILEVER_STEEL, STR_LAI_BRIDGE_DESCRIPTION_ROAD_CANTILEVER_STEEL),
|
||||
STR_BRIDGE_NAME_CANTILEVER_STEEL, STR_LAI_BRIDGE_DESCRIPTION_RAIL_CANTILEVER_STEEL, STR_LAI_BRIDGE_DESCRIPTION_ROAD_CANTILEVER_STEEL, cant_pillars),
|
||||
|
||||
MBR(1930, 3, 9, 248, 240, 0xA23, PALETTE_TO_STRUCT_RED,
|
||||
STR_BRIDGE_NAME_CANTILEVER_STEEL, STR_LAI_BRIDGE_DESCRIPTION_RAIL_CANTILEVER_STEEL, STR_LAI_BRIDGE_DESCRIPTION_ROAD_CANTILEVER_STEEL),
|
||||
STR_BRIDGE_NAME_CANTILEVER_STEEL, STR_LAI_BRIDGE_DESCRIPTION_RAIL_CANTILEVER_STEEL, STR_LAI_BRIDGE_DESCRIPTION_ROAD_CANTILEVER_STEEL, cant_pillars),
|
||||
|
||||
MBR(1930, 0, 2, 240, 256, 0xA27, PAL_NONE,
|
||||
STR_BRIDGE_NAME_GIRDER_STEEL, STR_LAI_BRIDGE_DESCRIPTION_RAIL_GIRDER_STEEL, STR_LAI_BRIDGE_DESCRIPTION_ROAD_GIRDER_STEEL),
|
||||
STR_BRIDGE_NAME_GIRDER_STEEL, STR_LAI_BRIDGE_DESCRIPTION_RAIL_GIRDER_STEEL, STR_LAI_BRIDGE_DESCRIPTION_ROAD_GIRDER_STEEL, all_pillars),
|
||||
|
||||
MBR(1995, 2, 0xFFFF, 255, 320, 0xA28, PAL_NONE,
|
||||
STR_BRIDGE_NAME_TUBULAR_STEEL, STR_LAI_BRIDGE_DESCRIPTION_RAIL_TUBULAR_STEEL, STR_LAI_BRIDGE_DESCRIPTION_ROAD_TUBULAR_STEEL),
|
||||
STR_BRIDGE_NAME_TUBULAR_STEEL, STR_LAI_BRIDGE_DESCRIPTION_RAIL_TUBULAR_STEEL, STR_LAI_BRIDGE_DESCRIPTION_ROAD_TUBULAR_STEEL, cant_pillars),
|
||||
|
||||
MBR(2005, 2, 0xFFFF, 380, 512, 0xA28, PALETTE_TO_STRUCT_YELLOW,
|
||||
STR_BRIDGE_NAME_TUBULAR_STEEL, STR_LAI_BRIDGE_DESCRIPTION_RAIL_TUBULAR_STEEL, STR_LAI_BRIDGE_DESCRIPTION_ROAD_TUBULAR_STEEL),
|
||||
STR_BRIDGE_NAME_TUBULAR_STEEL, STR_LAI_BRIDGE_DESCRIPTION_RAIL_TUBULAR_STEEL, STR_LAI_BRIDGE_DESCRIPTION_ROAD_TUBULAR_STEEL, cant_pillars),
|
||||
|
||||
MBR(2010, 2, 0xFFFF, 510, 608, 0xA28, PALETTE_TO_STRUCT_CONCRETE,
|
||||
STR_BRIDGE_TUBULAR_SILICON, STR_LAI_BRIDGE_DESCRIPTION_RAIL_TUBULAR_STEEL, STR_LAI_BRIDGE_DESCRIPTION_ROAD_TUBULAR_STEEL)
|
||||
STR_BRIDGE_TUBULAR_SILICON, STR_LAI_BRIDGE_DESCRIPTION_RAIL_TUBULAR_STEEL, STR_LAI_BRIDGE_DESCRIPTION_ROAD_TUBULAR_STEEL, cant_pillars)
|
||||
};
|
||||
|
||||
#undef MBR
|
||||
|
|
|
@ -39,10 +39,13 @@
|
|||
#include "object_base.h"
|
||||
#include "water.h"
|
||||
#include "company_gui.h"
|
||||
#include "newgrf_roadstop.h"
|
||||
#include "station_func.h"
|
||||
#include "station_map.h"
|
||||
#include "tunnelbridge_cmd.h"
|
||||
#include "landscape_cmd.h"
|
||||
#include "terraform_cmd.h"
|
||||
#include "newgrf_station.h"
|
||||
|
||||
#include "table/strings.h"
|
||||
#include "table/bridge_land.h"
|
||||
|
@ -55,6 +58,12 @@ TileIndex _build_tunnel_endtile; ///< The end of a tunnel; as hidden return from
|
|||
/** Z position of the bridge sprites relative to bridge height (downwards) */
|
||||
static const int BRIDGE_Z_START = 3;
|
||||
|
||||
extern CommandCost IsRailStationBridgeAboveOk(TileIndex tile, const StationSpec *statspec, uint8_t layout, TileIndex northern_bridge_end, TileIndex southern_bridge_end, int bridge_height,
|
||||
BridgeType bridge_type, TransportType bridge_transport_type);
|
||||
|
||||
extern CommandCost IsRoadStopBridgeAboveOK(TileIndex tile, const RoadStopSpec *spec, bool drive_through, DiagDirection entrance,
|
||||
TileIndex northern_bridge_end, TileIndex southern_bridge_end, int bridge_height,
|
||||
BridgeType bridge_type, TransportType bridge_transport_type);
|
||||
|
||||
/**
|
||||
* Mark bridge tiles dirty.
|
||||
|
@ -391,6 +400,43 @@ CommandCost CmdBuildBridge(DoCommandFlags flags, TileIndex tile_end, TileIndex t
|
|||
/* If bridge belonged to bankrupt company, it has a new owner now */
|
||||
is_new_owner = (owner == OWNER_NONE);
|
||||
if (is_new_owner) owner = company;
|
||||
|
||||
TileIndexDiff delta = (direction == AXIS_X ? TileDiffXY(1, 0) : TileDiffXY(0, 1));
|
||||
for (TileIndex tile = tile_start + delta; tile != tile_end; tile += delta) {
|
||||
if (!IsTileType(tile, MP_STATION)) continue;
|
||||
switch (GetStationType(tile)) {
|
||||
case StationType::Rail:
|
||||
case StationType::RailWaypoint: {
|
||||
CommandCost ret = IsRailStationBridgeAboveOk(tile, GetStationSpec(tile), GetStationGfx(tile), tile_start, tile_end, z_start + 1, bridge_type, transport_type);
|
||||
if (ret.Failed()) {
|
||||
if (ret.GetErrorMessage() != INVALID_STRING_ID) return ret;
|
||||
ret = Command<CMD_LANDSCAPE_CLEAR>::Do(flags, tile);
|
||||
if (ret.Failed()) return ret;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case StationType::Bus:
|
||||
case StationType::Truck:
|
||||
case StationType::RoadWaypoint: {
|
||||
CommandCost ret = IsRoadStopBridgeAboveOK(tile, GetRoadStopSpec(tile), IsDriveThroughStopTile(tile), IsDriveThroughStopTile(tile) ? AxisToDiagDir(GetDriveThroughStopAxis(tile)) : GetBayRoadStopDir(tile),
|
||||
tile_start, tile_end, z_start + 1, bridge_type, transport_type);
|
||||
if (ret.Failed()) {
|
||||
if (ret.GetErrorMessage() != INVALID_STRING_ID) return ret;
|
||||
ret = Command<CMD_LANDSCAPE_CLEAR>::Do(flags, tile);
|
||||
if (ret.Failed()) return ret;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case StationType::Buoy:
|
||||
/* Buoys are always allowed */
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* Build a new bridge. */
|
||||
|
||||
|
@ -467,6 +513,45 @@ CommandCost CmdBuildBridge(DoCommandFlags flags, TileIndex tile_end, TileIndex t
|
|||
break;
|
||||
}
|
||||
|
||||
case MP_STATION: {
|
||||
switch (GetStationType(tile)) {
|
||||
case StationType::Airport:
|
||||
goto not_valid_below;
|
||||
|
||||
case StationType::Rail:
|
||||
case StationType::RailWaypoint: {
|
||||
CommandCost ret = IsRailStationBridgeAboveOk(tile, GetStationSpec(tile), GetStationGfx(tile), tile_start, tile_end, z_start + 1, bridge_type, transport_type);
|
||||
if (ret.Failed()) {
|
||||
if (ret.GetErrorMessage() != INVALID_STRING_ID) return ret;
|
||||
goto not_valid_below;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case StationType::Bus:
|
||||
case StationType::Truck:
|
||||
case StationType::RoadWaypoint: {
|
||||
CommandCost ret = IsRoadStopBridgeAboveOK(tile, GetRoadStopSpec(tile), IsDriveThroughStopTile(tile), IsDriveThroughStopTile(tile) ? AxisToDiagDir(GetDriveThroughStopAxis(tile)) : GetBayRoadStopDir(tile),
|
||||
tile_start, tile_end, z_start + 1, bridge_type, transport_type);
|
||||
if (ret.Failed()) {
|
||||
if (ret.GetErrorMessage() != INVALID_STRING_ID) return ret;
|
||||
goto not_valid_below;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case StationType::Buoy:
|
||||
/* Buoys are always allowed */
|
||||
break;
|
||||
|
||||
default:
|
||||
//if (!(GetStationType(tile) == StationType::Dock && _settings_game.construction.allow_docks_under_bridges)) goto not_valid_below;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case MP_CLEAR:
|
||||
break;
|
||||
|
||||
|
@ -1545,6 +1630,49 @@ static BridgePieces CalcBridgePiece(uint north, uint south)
|
|||
}
|
||||
}
|
||||
|
||||
BridgePiecePillarFlags GetBridgeTilePillarFlags(TileIndex tile, TileIndex northern_bridge_end, TileIndex southern_bridge_end, BridgeType bridge_type, TransportType bridge_transport_type)
|
||||
{
|
||||
if (bridge_transport_type == TRANSPORT_WATER) return BridgePiecePillarFlag::BPPF_ALL_CORNERS;
|
||||
|
||||
BridgePieces piece = CalcBridgePiece(
|
||||
GetTunnelBridgeLength(tile, northern_bridge_end) + 1,
|
||||
GetTunnelBridgeLength(tile, southern_bridge_end) + 1
|
||||
);
|
||||
assert(piece < BRIDGE_PIECE_HEAD);
|
||||
|
||||
const BridgeSpec *spec = GetBridgeSpec(bridge_type);
|
||||
const Axis axis = TileX(northern_bridge_end) == TileX(southern_bridge_end) ? AXIS_Y : AXIS_X;
|
||||
if (!spec->ctrl_flags.Test(BridgeSpecCtrlFlag::BSCF_INVALID_PILLAR_FLAGS)) {
|
||||
return spec->pillar_flags[piece * 2 + (axis == AXIS_Y ? 1 : 0)];
|
||||
} else {
|
||||
uint base_offset;
|
||||
if (bridge_transport_type == TRANSPORT_RAIL) {
|
||||
base_offset = GetRailTypeInfo(GetRailType(southern_bridge_end))->bridge_offset;
|
||||
} else {
|
||||
base_offset = 8;
|
||||
}
|
||||
|
||||
const PalSpriteID *psid = &GetBridgeSpriteTable(bridge_type, piece)[base_offset];
|
||||
if (axis == AXIS_Y) psid += 4;
|
||||
return psid[2].sprite != 0 ? BridgePiecePillarFlag::BPPF_ALL_CORNERS : BridgePiecePillarFlags();
|
||||
}
|
||||
}
|
||||
|
||||
BridgePieceDebugInfo GetBridgePieceDebugInfo(TileIndex tile)
|
||||
{
|
||||
TileIndex rampnorth = GetNorthernBridgeEnd(tile);
|
||||
TileIndex rampsouth = GetSouthernBridgeEnd(tile);
|
||||
|
||||
BridgePieces piece = CalcBridgePiece(
|
||||
GetTunnelBridgeLength(tile, rampnorth) + 1,
|
||||
GetTunnelBridgeLength(tile, rampsouth) + 1
|
||||
);
|
||||
BridgePiecePillarFlags pillar_flags = GetBridgeTilePillarFlags(tile, rampnorth, rampsouth, GetBridgeType(rampnorth), GetTunnelBridgeTransportType(rampnorth));
|
||||
const Axis axis = TileX(rampnorth) == TileX(rampsouth) ? AXIS_Y : AXIS_X;
|
||||
uint pillar_index = piece * 2 + (axis == AXIS_Y ? 1 : 0);
|
||||
return { piece, pillar_flags, pillar_index };
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw the middle bits of a bridge.
|
||||
* @param ti Tile information of the tile to draw it on.
|
||||
|
|
|
@ -182,7 +182,9 @@ static CommandCost IsValidTileForWaypoint(TileIndex tile, Axis axis, StationID *
|
|||
extern void GetStationLayout(uint8_t *layout, uint numtracks, uint plat_len, const StationSpec *statspec);
|
||||
extern CommandCost FindJoiningWaypoint(StationID existing_station, StationID station_to_join, bool adjacent, TileArea ta, Waypoint **wp, bool is_road);
|
||||
extern CommandCost CanExpandRailStation(const BaseStation *st, TileArea &new_ta);
|
||||
extern CommandCost CalculateRoadStopCost(TileArea tile_area, DoCommandFlags flags, bool is_drive_through, StationType station_type, Axis axis, DiagDirection ddir, StationID *est, RoadType rt, Money unit_cost);
|
||||
extern CommandCost CalculateRoadStopCost(TileArea tile_area, DoCommandFlags flags, bool is_drive_through, StationType station_type, const RoadStopSpec *roadstopspec, Axis axis, DiagDirection ddir, StationID *est, RoadType rt, Money unit_cost);
|
||||
extern CommandCost IsRailStationBridgeAboveOk(TileIndex tile, const StationSpec *statspec, uint8_t layout);
|
||||
|
||||
extern CommandCost RemoveRoadWaypointStop(TileIndex tile, DoCommandFlags flags, int replacement_spec_index);
|
||||
|
||||
/**
|
||||
|
@ -220,6 +222,17 @@ CommandCost CmdBuildRailWaypoint(DoCommandFlags flags, TileIndex start_tile, Axi
|
|||
|
||||
if (distant_join && (!_settings_game.station.distant_join_stations || !Waypoint::IsValidID(station_to_join))) return CMD_ERROR;
|
||||
|
||||
const StationSpec *spec = StationClass::Get(spec_class)->GetSpec(spec_index);
|
||||
std::vector<uint8_t> layout_ptr;
|
||||
layout_ptr.resize(count);
|
||||
if (spec == nullptr) {
|
||||
/* The layout must be 0 for the 'normal' waypoints by design. */
|
||||
//memset(layout_ptr, 0, count); //FIXME
|
||||
} else {
|
||||
/* But for NewGRF waypoints we like to have their style. */
|
||||
GetStationLayout(&layout_ptr[0], count, 1, spec);
|
||||
}
|
||||
|
||||
TileArea new_location(start_tile, width, height);
|
||||
|
||||
/* only AddCost for non-existing waypoints */
|
||||
|
@ -237,6 +250,10 @@ CommandCost CmdBuildRailWaypoint(DoCommandFlags flags, TileIndex start_tile, Axi
|
|||
TileIndex tile = start_tile + i * offset;
|
||||
CommandCost ret = IsValidTileForWaypoint(tile, axis, &est);
|
||||
if (ret.Failed()) return ret;
|
||||
ret = IsRailStationBridgeAboveOk(tile, spec, layout_ptr[i]);
|
||||
if (ret.Failed()) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
Waypoint *wp = nullptr;
|
||||
|
@ -364,7 +381,7 @@ CommandCost CmdBuildRoadWaypoint(DoCommandFlags flags, TileIndex start_tile, Axi
|
|||
unit_cost = _price[PR_BUILD_STATION_TRUCK];
|
||||
}
|
||||
StationID est = StationID::Invalid();
|
||||
CommandCost cost = CalculateRoadStopCost(roadstop_area, flags, true, StationType::RoadWaypoint, axis, AxisToDiagDir(axis), &est, INVALID_ROADTYPE, unit_cost);
|
||||
CommandCost cost = CalculateRoadStopCost(roadstop_area, flags, true, StationType::RoadWaypoint, roadstopspec, axis, AxisToDiagDir(axis), &est, INVALID_ROADTYPE, unit_cost);
|
||||
if (cost.Failed()) return cost;
|
||||
|
||||
Waypoint *wp = nullptr;
|
||||
|
|
Loading…
Reference in New Issue