Add a "if breakdowns enabled" mode to the no depot order warn setting
This commit is contained in:
@@ -1496,8 +1496,9 @@ STR_CONFIG_SETTING_ORDER_REVIEW_HELPTEXT :When enabled, t
|
||||
STR_CONFIG_SETTING_ORDER_REVIEW_OFF :No
|
||||
STR_CONFIG_SETTING_ORDER_REVIEW_EXDEPOT :Yes, but exclude stopped vehicles
|
||||
STR_CONFIG_SETTING_ORDER_REVIEW_ON :Of all vehicles
|
||||
STR_CONFIG_SETTING_WARN_NO_DEPOT_ORDER :Warn if a vehicle does not have a depot order in its schedule: {STRING2}
|
||||
STR_CONFIG_SETTING_WARN_NO_DEPOT_ORDER :Warn if a vehicle does not have a depot order: {STRING2}
|
||||
STR_CONFIG_SETTING_WARN_NO_DEPOT_ORDER_HELPTEXT :When enabled and when reviewing vehicle orders is also enabled, a news message gets sent when a train, road vehicle or ship does not have a depot order in its schedule
|
||||
STR_CONFIG_SETTING_WARN_NO_DEPOT_ORDER_IF_BREAKDOWNS_ON :If vehicle breakdowns enabled
|
||||
STR_CONFIG_SETTING_WARN_INCOME_LESS :Warn if a vehicle's income is negative: {STRING2}
|
||||
STR_CONFIG_SETTING_WARN_INCOME_LESS_HELPTEXT :When enabled, a news message gets sent when a vehicle has not made any profit within a calendar year
|
||||
|
||||
|
@@ -2719,7 +2719,12 @@ void CheckOrders(const Vehicle *v)
|
||||
if (v->orders != nullptr) v->orders->DebugCheckSanity();
|
||||
#endif
|
||||
|
||||
if (message == INVALID_STRING_ID && !has_depot_order && v->type != VEH_AIRCRAFT && _settings_client.gui.no_depot_order_warn) message = STR_NEWS_VEHICLE_NO_DEPOT_ORDER;
|
||||
if (message == INVALID_STRING_ID && !has_depot_order && v->type != VEH_AIRCRAFT) {
|
||||
if (_settings_client.gui.no_depot_order_warn == 1 ||
|
||||
(_settings_client.gui.no_depot_order_warn == 2 && _settings_game.difficulty.vehicle_breakdowns != 0)) {
|
||||
message = STR_NEWS_VEHICLE_NO_DEPOT_ORDER;
|
||||
}
|
||||
}
|
||||
|
||||
/* We don't have a problem */
|
||||
if (message == INVALID_STRING_ID) return;
|
||||
|
@@ -122,7 +122,7 @@ struct GUISettings : public TimeSettings {
|
||||
bool lost_vehicle_warn; ///< if a vehicle can't find its destination, show a warning
|
||||
bool restriction_wait_vehicle_warn; ///< if a vehicle is waiting for an extended time due to a routing restriction, show a warning
|
||||
uint8 order_review_system; ///< perform order reviews on vehicles
|
||||
bool no_depot_order_warn; ///< if a non-air vehicle doesn't have at least one depot order, show a warning
|
||||
uint8 no_depot_order_warn; ///< if a non-air vehicle doesn't have at least one depot order, show a warning
|
||||
bool vehicle_income_warn; ///< if a vehicle isn't generating income, show a warning
|
||||
bool show_finances; ///< show finances at end of year
|
||||
bool sg_new_nonstop; ///< ttdpatch compatible nonstop handling read from pre v93 savegames
|
||||
|
@@ -147,6 +147,13 @@ static const SettingDescEnumEntry _disable_water_animation[] = {
|
||||
{ 0, STR_NULL }
|
||||
};
|
||||
|
||||
static const SettingDescEnumEntry _no_depot_order_warn[] = {
|
||||
{ 0, STR_CONFIG_SETTING_OFF },
|
||||
{ 2, STR_CONFIG_SETTING_WARN_NO_DEPOT_ORDER_IF_BREAKDOWNS_ON },
|
||||
{ 1, STR_CONFIG_SETTING_ON },
|
||||
{ 0, STR_NULL }
|
||||
};
|
||||
|
||||
/* Some settings do not need to be synchronised when playing in multiplayer.
|
||||
* These include for example the GUI settings and will not be saved with the
|
||||
* savegame.
|
||||
@@ -5173,10 +5180,12 @@ strhelp = STR_CONFIG_SETTING_ORDER_REVIEW_HELPTEXT
|
||||
strval = STR_CONFIG_SETTING_ORDER_REVIEW_OFF
|
||||
cat = SC_BASIC
|
||||
|
||||
[SDTC_BOOL]
|
||||
[SDTC_ENUM]
|
||||
var = gui.no_depot_order_warn
|
||||
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC
|
||||
def = false
|
||||
type = SLE_UINT8
|
||||
flags = SF_NOT_IN_SAVE | SF_NO_NETWORK_SYNC | SF_CONVERT_BOOL_TO_INT
|
||||
def = 0
|
||||
enumlist = _no_depot_order_warn
|
||||
str = STR_CONFIG_SETTING_WARN_NO_DEPOT_ORDER
|
||||
strhelp = STR_CONFIG_SETTING_WARN_NO_DEPOT_ORDER_HELPTEXT
|
||||
|
||||
|
Reference in New Issue
Block a user