Add setting to ignore object introduction dates
This commit is contained in:
@@ -2476,6 +2476,9 @@ STR_CONFIG_SETTING_NO_EXPIRE_OBJECTS_AFTER_HELPTEXT :Objects which w
|
|||||||
STR_CONFIG_SETTING_NO_EXPIRE_OBJECTS_AFTER_VALUE :{NUM}
|
STR_CONFIG_SETTING_NO_EXPIRE_OBJECTS_AFTER_VALUE :{NUM}
|
||||||
STR_CONFIG_SETTING_NO_EXPIRE_OBJECTS_AFTER_ZERO :Off
|
STR_CONFIG_SETTING_NO_EXPIRE_OBJECTS_AFTER_ZERO :Off
|
||||||
|
|
||||||
|
STR_CONFIG_SETTING_IGNORE_OBJECT_INTRO_DATES :Ignore object introduction dates: {STRING2}
|
||||||
|
STR_CONFIG_SETTING_IGNORE_OBJECT_INTRO_DATES_HELPTEXT :Set whether players are allowed to build objects before their introduction date.{}Does not apply to objects constructed during map generation.
|
||||||
|
|
||||||
STR_PURCHASE_LAND_PERMITTED_NO :No
|
STR_PURCHASE_LAND_PERMITTED_NO :No
|
||||||
STR_PURCHASE_LAND_PERMITTED_SINGLE :Yes, 1 tile at a time
|
STR_PURCHASE_LAND_PERMITTED_SINGLE :Yes, 1 tile at a time
|
||||||
STR_PURCHASE_LAND_PERMITTED_AREA :Yes, large areas at a time
|
STR_PURCHASE_LAND_PERMITTED_AREA :Yes, large areas at a time
|
||||||
|
@@ -70,7 +70,7 @@ bool ObjectSpec::IsEverAvailable() const
|
|||||||
*/
|
*/
|
||||||
bool ObjectSpec::WasEverAvailable() const
|
bool ObjectSpec::WasEverAvailable() const
|
||||||
{
|
{
|
||||||
return this->IsEverAvailable() && _date > this->introduction_date;
|
return this->IsEverAvailable() && (_date > this->introduction_date || (_settings_game.construction.ignore_object_intro_dates && !_generating_world));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -2089,6 +2089,7 @@ static SettingsContainer &GetSettingsTree()
|
|||||||
limitations->Add(new SettingEntry("construction.purchase_land_permitted"));
|
limitations->Add(new SettingEntry("construction.purchase_land_permitted"));
|
||||||
limitations->Add(new SettingEntry("construction.build_object_area_permitted"));
|
limitations->Add(new SettingEntry("construction.build_object_area_permitted"));
|
||||||
limitations->Add(new SettingEntry("construction.no_expire_objects_after"));
|
limitations->Add(new SettingEntry("construction.no_expire_objects_after"));
|
||||||
|
limitations->Add(new SettingEntry("construction.ignore_object_intro_dates"));
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsPage *disasters = main->Add(new SettingsPage(STR_CONFIG_SETTING_ACCIDENTS));
|
SettingsPage *disasters = main->Add(new SettingsPage(STR_CONFIG_SETTING_ACCIDENTS));
|
||||||
|
@@ -455,6 +455,7 @@ struct ConstructionSettings {
|
|||||||
byte purchase_land_permitted; ///< whether and how purchasing land is permitted
|
byte purchase_land_permitted; ///< whether and how purchasing land is permitted
|
||||||
bool build_object_area_permitted; ///< whether building objects by area is permitted
|
bool build_object_area_permitted; ///< whether building objects by area is permitted
|
||||||
Year no_expire_objects_after; ///< do not expire objects after this year
|
Year no_expire_objects_after; ///< do not expire objects after this year
|
||||||
|
bool ignore_object_intro_dates; ///< allow players to build objects before their introduction dates (does not include during map generation)
|
||||||
|
|
||||||
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?
|
||||||
|
@@ -2093,6 +2093,14 @@ cat = SC_ADVANCED
|
|||||||
patxname = ""construction.no_expire_objects_after""
|
patxname = ""construction.no_expire_objects_after""
|
||||||
post_cb = [](auto) { InvalidateWindowClassesData(WC_BUILD_OBJECT, 0); }
|
post_cb = [](auto) { InvalidateWindowClassesData(WC_BUILD_OBJECT, 0); }
|
||||||
|
|
||||||
|
[SDT_BOOL]
|
||||||
|
var = construction.ignore_object_intro_dates
|
||||||
|
def = false
|
||||||
|
str = STR_CONFIG_SETTING_IGNORE_OBJECT_INTRO_DATES
|
||||||
|
strhelp = STR_CONFIG_SETTING_IGNORE_OBJECT_INTRO_DATES_HELPTEXT
|
||||||
|
patxname = ""construction.ignore_object_intro_dates""
|
||||||
|
post_cb = [](auto) { InvalidateWindowClassesData(WC_BUILD_OBJECT, 0); }
|
||||||
|
|
||||||
[SDT_BOOL]
|
[SDT_BOOL]
|
||||||
var = station.adjacent_stations
|
var = station.adjacent_stations
|
||||||
from = SLV_62
|
from = SLV_62
|
||||||
|
Reference in New Issue
Block a user