Custom bridge heads: Add savegame version and setting.

This commit is contained in:
Jonathan G Rennison
2017-02-05 12:47:34 +00:00
parent 3b45419a16
commit 1f727e9029
7 changed files with 24 additions and 0 deletions

View File

@@ -1701,6 +1701,9 @@ STR_CONFIG_SETTING_PATHFINDER_FOR_SHIPS_HELPTEXT :Path finder to
STR_CONFIG_SETTING_REVERSE_AT_SIGNALS :Automatic reversing at signals: {STRING2} STR_CONFIG_SETTING_REVERSE_AT_SIGNALS :Automatic reversing at signals: {STRING2}
STR_CONFIG_SETTING_REVERSE_AT_SIGNALS_HELPTEXT :Allow trains to reverse on a signal, if they waited there a long time STR_CONFIG_SETTING_REVERSE_AT_SIGNALS_HELPTEXT :Allow trains to reverse on a signal, if they waited there a long time
STR_CONFIG_SETTING_ENABLE_ROAD_CUSTOM_BRIDGE_HEADS :Enable road custom bridge heads: {STRING2}
STR_CONFIG_SETTING_ENABLE_ROAD_CUSTOM_BRIDGE_HEADS_HELPTEXT :Allow road bridges to have custom, non-straight flat entry/exit tiles
STR_CONFIG_SETTING_QUERY_CAPTION :{WHITE}Change setting value STR_CONFIG_SETTING_QUERY_CAPTION :{WHITE}Change setting value
# Config errors # Config errors

View File

@@ -2968,6 +2968,14 @@ bool AfterLoadGame()
#endif #endif
} }
if (SlXvIsFeatureMissing(XSLFI_CUSTOM_BRIDGE_HEADS)) {
/* ensure that previously unused custom bridge-head bits are cleared */
for (TileIndex t = 0; t < map_size; t++) {
if (IsBridgeTile(t) && GetTunnelBridgeTransportType(t) == TRANSPORT_ROAD) {
SB(_m[t].m2, 0, 8, 0);
}
}
}
/* Station acceptance is some kind of cache */ /* Station acceptance is some kind of cache */
if (IsSavegameVersionBefore(127)) { if (IsSavegameVersionBefore(127)) {

View File

@@ -45,6 +45,7 @@ std::vector<uint32> _sl_xv_discardable_chunk_ids; ///< list of chunks
static const uint32 _sl_xv_slxi_chunk_version = 0; ///< current version os SLXI chunk static const uint32 _sl_xv_slxi_chunk_version = 0; ///< current version os SLXI chunk
const SlxiSubChunkInfo _sl_xv_sub_chunk_infos[] = { const SlxiSubChunkInfo _sl_xv_sub_chunk_infos[] = {
{ XSLFI_CUSTOM_BRIDGE_HEADS, XSCF_NULL, 1, 1, "custom_bridge_heads", NULL, NULL, NULL },
{ XSLFI_NULL, XSCF_NULL, 0, 0, NULL, NULL, NULL, NULL },// This is the end marker { XSLFI_NULL, XSCF_NULL, 0, 0, NULL, NULL, NULL, NULL },// This is the end marker
}; };

View File

@@ -21,6 +21,7 @@
*/ */
enum SlXvFeatureIndex { enum SlXvFeatureIndex {
XSLFI_NULL = 0, ///< Unused value, to indicate that no extended feature test is in use XSLFI_NULL = 0, ///< Unused value, to indicate that no extended feature test is in use
XSLFI_CUSTOM_BRIDGE_HEADS, ///< Custom bridge heads
XSLFI_SIZE, ///< Total count of features, including null feature XSLFI_SIZE, ///< Total count of features, including null feature
}; };

View File

@@ -1649,6 +1649,7 @@ static SettingsContainer &GetSettingsTree()
limitations->Add(new SettingEntry("construction.road_stop_on_town_road")); limitations->Add(new SettingEntry("construction.road_stop_on_town_road"));
limitations->Add(new SettingEntry("construction.road_stop_on_competitor_road")); limitations->Add(new SettingEntry("construction.road_stop_on_competitor_road"));
limitations->Add(new SettingEntry("vehicle.disable_elrails")); limitations->Add(new SettingEntry("vehicle.disable_elrails"));
limitations->Add(new SettingEntry("construction.road_custom_bridge_heads"));
} }
SettingsPage *disasters = main->Add(new SettingsPage(STR_CONFIG_SETTING_ACCIDENTS)); SettingsPage *disasters = main->Add(new SettingsPage(STR_CONFIG_SETTING_ACCIDENTS));

View File

@@ -311,6 +311,7 @@ struct ConstructionSettings {
bool freeform_edges; ///< allow terraforming the tiles at the map edges bool freeform_edges; ///< allow terraforming the tiles at the map edges
uint8 extra_tree_placement; ///< (dis)allow building extra trees in-game uint8 extra_tree_placement; ///< (dis)allow building extra trees in-game
uint8 command_pause_level; ///< level/amount of commands that can't be executed while paused uint8 command_pause_level; ///< level/amount of commands that can't be executed while paused
uint8 road_custom_bridge_heads; ///< allow construction of road custom bridge heads
uint32 terraform_per_64k_frames; ///< how many tile heights may, over a long period, be terraformed per 65536 frames? uint32 terraform_per_64k_frames; ///< how many tile heights may, over a long period, be terraformed per 65536 frames?
uint16 terraform_frame_burst; ///< how many tile heights may, over a short period, be terraformed? uint16 terraform_frame_burst; ///< how many tile heights may, over a short period, be terraformed?

View File

@@ -1229,6 +1229,15 @@ str = STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD
strhelp = STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD_HELPTEXT strhelp = STR_CONFIG_SETTING_STOP_ON_COMPETITOR_ROAD_HELPTEXT
cat = SC_BASIC cat = SC_BASIC
[SDT_BOOL]
base = GameSettings
var = construction.road_custom_bridge_heads
def = true
cat = SC_BASIC
str = STR_CONFIG_SETTING_ENABLE_ROAD_CUSTOM_BRIDGE_HEADS
strhelp = STR_CONFIG_SETTING_ENABLE_ROAD_CUSTOM_BRIDGE_HEADS_HELPTEXT
patxname = ""custom_bridge_heads.construction.road_custom_bridge_heads""
[SDT_BOOL] [SDT_BOOL]
base = GameSettings base = GameSettings
var = station.adjacent_stations var = station.adjacent_stations