Add news/advice setting to warn if no depot order in vehicle schedule
This commit is contained in:
@@ -858,6 +858,7 @@ STR_NEWS_VEHICLE_HAS_TOO_FEW_ORDERS :{WHITE}{VEHICLE
|
|||||||
STR_NEWS_VEHICLE_HAS_VOID_ORDER :{WHITE}{VEHICLE} has a void order
|
STR_NEWS_VEHICLE_HAS_VOID_ORDER :{WHITE}{VEHICLE} has a void order
|
||||||
STR_NEWS_VEHICLE_HAS_DUPLICATE_ENTRY :{WHITE}{VEHICLE} has duplicate orders
|
STR_NEWS_VEHICLE_HAS_DUPLICATE_ENTRY :{WHITE}{VEHICLE} has duplicate orders
|
||||||
STR_NEWS_VEHICLE_HAS_INVALID_ENTRY :{WHITE}{VEHICLE} has an invalid station in its orders
|
STR_NEWS_VEHICLE_HAS_INVALID_ENTRY :{WHITE}{VEHICLE} has an invalid station in its orders
|
||||||
|
STR_NEWS_VEHICLE_NO_DEPOT_ORDER :{WHITE}{VEHICLE} does not have a depot order in its schedule
|
||||||
STR_NEWS_PLANE_USES_TOO_SHORT_RUNWAY :{WHITE}{VEHICLE} has in its orders an airport whose runway is too short
|
STR_NEWS_PLANE_USES_TOO_SHORT_RUNWAY :{WHITE}{VEHICLE} has in its orders an airport whose runway is too short
|
||||||
|
|
||||||
STR_NEWS_VEHICLE_IS_GETTING_OLD :{WHITE}{VEHICLE} is getting old
|
STR_NEWS_VEHICLE_IS_GETTING_OLD :{WHITE}{VEHICLE} is getting old
|
||||||
@@ -1311,6 +1312,8 @@ STR_CONFIG_SETTING_ORDER_REVIEW_HELPTEXT :When enabled, t
|
|||||||
STR_CONFIG_SETTING_ORDER_REVIEW_OFF :No
|
STR_CONFIG_SETTING_ORDER_REVIEW_OFF :No
|
||||||
STR_CONFIG_SETTING_ORDER_REVIEW_EXDEPOT :Yes, but exclude stopped vehicles
|
STR_CONFIG_SETTING_ORDER_REVIEW_EXDEPOT :Yes, but exclude stopped vehicles
|
||||||
STR_CONFIG_SETTING_ORDER_REVIEW_ON :Of all 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_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_INCOME_LESS :Warn if a vehicle's income is negative: {STRING2}
|
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
|
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
|
||||||
STR_CONFIG_SETTING_NEVER_EXPIRE_VEHICLES :Vehicles never expire: {STRING2}
|
STR_CONFIG_SETTING_NEVER_EXPIRE_VEHICLES :Vehicles never expire: {STRING2}
|
||||||
|
@@ -827,6 +827,7 @@ static void DeleteOrderWarnings(const Vehicle *v)
|
|||||||
DeleteVehicleNews(v->index, STR_NEWS_VEHICLE_HAS_VOID_ORDER);
|
DeleteVehicleNews(v->index, STR_NEWS_VEHICLE_HAS_VOID_ORDER);
|
||||||
DeleteVehicleNews(v->index, STR_NEWS_VEHICLE_HAS_DUPLICATE_ENTRY);
|
DeleteVehicleNews(v->index, STR_NEWS_VEHICLE_HAS_DUPLICATE_ENTRY);
|
||||||
DeleteVehicleNews(v->index, STR_NEWS_VEHICLE_HAS_INVALID_ENTRY);
|
DeleteVehicleNews(v->index, STR_NEWS_VEHICLE_HAS_INVALID_ENTRY);
|
||||||
|
DeleteVehicleNews(v->index, STR_NEWS_VEHICLE_NO_DEPOT_ORDER);
|
||||||
DeleteVehicleNews(v->index, STR_NEWS_PLANE_USES_TOO_SHORT_RUNWAY);
|
DeleteVehicleNews(v->index, STR_NEWS_PLANE_USES_TOO_SHORT_RUNWAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2205,6 +2206,7 @@ void CheckOrders(const Vehicle *v)
|
|||||||
|
|
||||||
/* Check the order list */
|
/* Check the order list */
|
||||||
int n_st = 0;
|
int n_st = 0;
|
||||||
|
bool has_depot_order = false;
|
||||||
|
|
||||||
FOR_VEHICLE_ORDERS(v, order) {
|
FOR_VEHICLE_ORDERS(v, order) {
|
||||||
/* Dummy order? */
|
/* Dummy order? */
|
||||||
@@ -2227,6 +2229,9 @@ void CheckOrders(const Vehicle *v)
|
|||||||
message = STR_NEWS_PLANE_USES_TOO_SHORT_RUNWAY;
|
message = STR_NEWS_PLANE_USES_TOO_SHORT_RUNWAY;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (order->IsType(OT_GOTO_DEPOT)) {
|
||||||
|
has_depot_order = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if the last and the first order are the same */
|
/* Check if the last and the first order are the same */
|
||||||
@@ -2245,6 +2250,8 @@ void CheckOrders(const Vehicle *v)
|
|||||||
if (v->orders.list != nullptr) v->orders.list->DebugCheckSanity();
|
if (v->orders.list != nullptr) v->orders.list->DebugCheckSanity();
|
||||||
#endif
|
#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;
|
||||||
|
|
||||||
/* We don't have a problem */
|
/* We don't have a problem */
|
||||||
if (message == INVALID_STRING_ID) return;
|
if (message == INVALID_STRING_ID) return;
|
||||||
|
|
||||||
|
@@ -1722,6 +1722,7 @@ static SettingsContainer &GetSettingsTree()
|
|||||||
advisors->Add(new SettingEntry("news_display.arrival_other"));
|
advisors->Add(new SettingEntry("news_display.arrival_other"));
|
||||||
advisors->Add(new SettingEntry("news_display.advice"));
|
advisors->Add(new SettingEntry("news_display.advice"));
|
||||||
advisors->Add(new SettingEntry("gui.order_review_system"));
|
advisors->Add(new SettingEntry("gui.order_review_system"));
|
||||||
|
advisors->Add(new SettingEntry("gui.no_depot_order_warn"));
|
||||||
advisors->Add(new SettingEntry("gui.vehicle_income_warn"));
|
advisors->Add(new SettingEntry("gui.vehicle_income_warn"));
|
||||||
advisors->Add(new SettingEntry("gui.lost_vehicle_warn"));
|
advisors->Add(new SettingEntry("gui.lost_vehicle_warn"));
|
||||||
advisors->Add(new SettingEntry("gui.show_finances"));
|
advisors->Add(new SettingEntry("gui.show_finances"));
|
||||||
|
@@ -85,6 +85,7 @@ struct GUISettings {
|
|||||||
bool sg_full_load_any; ///< new full load calculation, any cargo must be full read from pre v93 savegames
|
bool sg_full_load_any; ///< new full load calculation, any cargo must be full read from pre v93 savegames
|
||||||
bool lost_vehicle_warn; ///< if a vehicle can't find its destination, show a warning
|
bool lost_vehicle_warn; ///< if a vehicle can't find its destination, show a warning
|
||||||
uint8 order_review_system; ///< perform order reviews on vehicles
|
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
|
||||||
bool vehicle_income_warn; ///< if a vehicle isn't generating income, 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 show_finances; ///< show finances at end of year
|
||||||
bool sg_new_nonstop; ///< ttdpatch compatible nonstop handling read from pre v93 savegames
|
bool sg_new_nonstop; ///< ttdpatch compatible nonstop handling read from pre v93 savegames
|
||||||
|
@@ -4133,6 +4133,13 @@ strhelp = STR_CONFIG_SETTING_ORDER_REVIEW_HELPTEXT
|
|||||||
strval = STR_CONFIG_SETTING_ORDER_REVIEW_OFF
|
strval = STR_CONFIG_SETTING_ORDER_REVIEW_OFF
|
||||||
cat = SC_BASIC
|
cat = SC_BASIC
|
||||||
|
|
||||||
|
[SDTC_BOOL]
|
||||||
|
var = gui.no_depot_order_warn
|
||||||
|
flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
|
||||||
|
def = false
|
||||||
|
str = STR_CONFIG_SETTING_WARN_NO_DEPOT_ORDER
|
||||||
|
strhelp = STR_CONFIG_SETTING_WARN_NO_DEPOT_ORDER_HELPTEXT
|
||||||
|
|
||||||
[SDTC_BOOL]
|
[SDTC_BOOL]
|
||||||
var = gui.lost_vehicle_warn
|
var = gui.lost_vehicle_warn
|
||||||
flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
|
flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
|
||||||
|
Reference in New Issue
Block a user