diff --git a/src/engine.cpp b/src/engine.cpp index 102a284c63..d94a05ebe9 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -966,6 +966,7 @@ static IntervalTimer _calendar_engines_daily({TimerGameCalend c->avail_roadtypes = AddDateIntroducedRoadTypes(c->avail_roadtypes, TimerGameCalendar::date); } + if (!_settings_game.vehicle.offer_vehicle_preview) return; if (TimerGameCalendar::year >= _year_engine_aging_stops) return; for (Engine *e : Engine::Iterate()) { @@ -1160,7 +1161,7 @@ void CalendarEnginesMonthlyLoop() /* Do not introduce invalid engines */ if (!e->IsEnabled()) continue; - if (!e->flags.Test(EngineFlag::Available) && TimerGameCalendar::date >= (e->intro_date + CalendarTime::DAYS_IN_YEAR)) { + if (!e->flags.Test(EngineFlag::Available) && TimerGameCalendar::date >= (e->intro_date + (_settings_game.vehicle.offer_vehicle_preview ? CalendarTime::DAYS_IN_YEAR : 0))) { /* Introduce it to all companies */ NewVehicleAvailable(e); } else if (!e->flags.Any({EngineFlag::Available, EngineFlag::ExclusivePreview}) && TimerGameCalendar::date >= e->intro_date) { diff --git a/src/lang/english.txt b/src/lang/english.txt index 811c38810f..aae384933b 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1508,6 +1508,9 @@ STR_CONFIG_SETTING_WARN_OLD_VEHICLE_HELPTEXT :When enabled, a STR_CONFIG_SETTING_NEVER_EXPIRE_VEHICLES :Vehicles never expire: {STRING2} STR_CONFIG_SETTING_NEVER_EXPIRE_VEHICLES_HELPTEXT :When enabled, all vehicle models remain available forever after their introduction +STR_CONFIG_SETTING_OFFER_VEHICLE_PREVIEW :Show vehicle previews: {STRING2} +STR_CONFIG_SETTING_OFFER_VEHICLE_PREVIEW_HELPTEXT :When enabled, the top performing company is sometimes offered a 1 year exclusive preview of a vehicle + STR_CONFIG_SETTING_TIMEKEEPING_UNITS :Timekeeping: {STRING2} STR_CONFIG_SETTING_TIMEKEEPING_UNITS_HELPTEXT :Select the timekeeping units of the game. This cannot be changed later.{}{}Calendar-based is the classic OpenTTD experience, with a year consisting of 12 months, and each month having 28-31 days.{}{}In Wallclock-based time, cargo production and financials are instead based on one-minute increments, which is about as long as a 30 day month takes in Calendar-based mode. These are grouped into 12-minute periods, equivalent to a year in Calendar-based mode.{}{}In either mode there is always a classic calendar, which is used for introduction dates of vehicles, houses, and other infrastructure ###length 2 diff --git a/src/settingentry_gui.cpp b/src/settingentry_gui.cpp index e48572e13f..8d592714e1 100644 --- a/src/settingentry_gui.cpp +++ b/src/settingentry_gui.cpp @@ -820,6 +820,7 @@ SettingsContainer &GetSettingsTree() limitations->Add(new SettingEntry("construction.max_tunnel_length")); limitations->Add(new SettingEntry("station.never_expire_airports")); limitations->Add(new SettingEntry("vehicle.never_expire_vehicles")); + limitations->Add(new SettingEntry("vehicle.offer_vehicle_preview")); limitations->Add(new SettingEntry("vehicle.max_trains")); limitations->Add(new SettingEntry("vehicle.max_roadveh")); limitations->Add(new SettingEntry("vehicle.max_aircraft")); diff --git a/src/settings_type.h b/src/settings_type.h index f6dd5bc98c..7bfb81f511 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -511,6 +511,7 @@ struct VehicleSettings { uint8_t freight_trains; ///< value to multiply the weight of cargo by bool dynamic_engines; ///< enable dynamic allocation of engine data bool never_expire_vehicles; ///< never expire vehicles + bool offer_vehicle_preview; ///< offer vehicle preview to companies uint8_t extend_vehicle_life; ///< extend vehicle life by this many years uint8_t road_side; ///< the side of the road vehicles drive on uint8_t plane_crashes; ///< number of plane crashes, 0 = none, 1 = reduced, 2 = normal diff --git a/src/table/settings/game_settings.ini b/src/table/settings/game_settings.ini index 0a946940d4..055cf786d3 100644 --- a/src/table/settings/game_settings.ini +++ b/src/table/settings/game_settings.ini @@ -241,6 +241,13 @@ def = false str = STR_CONFIG_SETTING_NEVER_EXPIRE_VEHICLES strhelp = STR_CONFIG_SETTING_NEVER_EXPIRE_VEHICLES_HELPTEXT +[SDT_BOOL] +var = vehicle.offer_vehicle_preview +flags = SettingFlag::NoNetwork +def = true +str = STR_CONFIG_SETTING_OFFER_VEHICLE_PREVIEW +strhelp = STR_CONFIG_SETTING_OFFER_VEHICLE_PREVIEW_HELPTEXT + [SDT_VAR] var = vehicle.max_trains type = SLE_UINT16