Add news setting for trains waiting due to routing restrictions
This commit is contained in:
@@ -1315,6 +1315,8 @@ STR_CONFIG_SETTING_NEVER_EXPIRE_AIRPORTS_HELPTEXT :Enabling this s
|
|||||||
|
|
||||||
STR_CONFIG_SETTING_WARN_LOST_VEHICLE :Warn if vehicle is lost: {STRING2}
|
STR_CONFIG_SETTING_WARN_LOST_VEHICLE :Warn if vehicle is lost: {STRING2}
|
||||||
STR_CONFIG_SETTING_WARN_LOST_VEHICLE_HELPTEXT :Trigger messages about vehicles unable to find a path to their ordered destination
|
STR_CONFIG_SETTING_WARN_LOST_VEHICLE_HELPTEXT :Trigger messages about vehicles unable to find a path to their ordered destination
|
||||||
|
STR_CONFIG_SETTING_WARN_RESTRICTION_WAIT_VEHICLE :Warn if train is stuck due to a routing restriction: {STRING2}
|
||||||
|
STR_CONFIG_SETTING_WARN_RESTRICTION_WAIT_VEHICLE_HELPTEXT :Trigger messages about trains which are stuck waiting at a PBS signal for a long time because of a routing restriction
|
||||||
STR_CONFIG_SETTING_ORDER_REVIEW :Review vehicles' orders: {STRING2}
|
STR_CONFIG_SETTING_ORDER_REVIEW :Review vehicles' orders: {STRING2}
|
||||||
STR_CONFIG_SETTING_ORDER_REVIEW_HELPTEXT :When enabled, the orders of the vehicles are periodically checked, and some obvious issues are reported with a news message when detected
|
STR_CONFIG_SETTING_ORDER_REVIEW_HELPTEXT :When enabled, the orders of the vehicles are periodically checked, and some obvious issues are reported with a news message when detected
|
||||||
STR_CONFIG_SETTING_ORDER_REVIEW_OFF :No
|
STR_CONFIG_SETTING_ORDER_REVIEW_OFF :No
|
||||||
|
@@ -1751,6 +1751,7 @@ static SettingsContainer &GetSettingsTree()
|
|||||||
advisors->Add(new SettingEntry("gui.no_depot_order_warn"));
|
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.restriction_wait_vehicle_warn"));
|
||||||
advisors->Add(new SettingEntry("gui.show_finances"));
|
advisors->Add(new SettingEntry("gui.show_finances"));
|
||||||
advisors->Add(new SettingEntry("news_display.economy"));
|
advisors->Add(new SettingEntry("news_display.economy"));
|
||||||
advisors->Add(new SettingEntry("news_display.subsidies"));
|
advisors->Add(new SettingEntry("news_display.subsidies"));
|
||||||
|
@@ -90,6 +90,7 @@ struct TimeSettings {
|
|||||||
struct GUISettings : public TimeSettings {
|
struct GUISettings : public TimeSettings {
|
||||||
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
|
||||||
|
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
|
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 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
|
||||||
|
@@ -4604,6 +4604,13 @@ def = true
|
|||||||
str = STR_CONFIG_SETTING_WARN_LOST_VEHICLE
|
str = STR_CONFIG_SETTING_WARN_LOST_VEHICLE
|
||||||
strhelp = STR_CONFIG_SETTING_WARN_LOST_VEHICLE_HELPTEXT
|
strhelp = STR_CONFIG_SETTING_WARN_LOST_VEHICLE_HELPTEXT
|
||||||
|
|
||||||
|
[SDTC_BOOL]
|
||||||
|
var = gui.restriction_wait_vehicle_warn
|
||||||
|
flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
|
||||||
|
def = false
|
||||||
|
str = STR_CONFIG_SETTING_WARN_RESTRICTION_WAIT_VEHICLE
|
||||||
|
strhelp = STR_CONFIG_SETTING_WARN_RESTRICTION_WAIT_VEHICLE_HELPTEXT
|
||||||
|
|
||||||
[SDTC_BOOL]
|
[SDTC_BOOL]
|
||||||
var = gui.disable_unsuitable_building
|
var = gui.disable_unsuitable_building
|
||||||
flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
|
flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
|
||||||
|
@@ -4987,7 +4987,7 @@ static bool TrainLocoHandler(Train *v, bool mode)
|
|||||||
|
|
||||||
if (HasBit(v->flags, VRF_TRAIN_STUCK) && v->wait_counter > 2 * _settings_game.pf.wait_for_pbs_path * DAY_TICKS) {
|
if (HasBit(v->flags, VRF_TRAIN_STUCK) && v->wait_counter > 2 * _settings_game.pf.wait_for_pbs_path * DAY_TICKS) {
|
||||||
/* Show message to player. */
|
/* Show message to player. */
|
||||||
if (_settings_client.gui.lost_vehicle_warn && v->owner == _local_company) {
|
if (v->owner == _local_company && (HasBit(v->flags, VRF_WAITING_RESTRICTION) ? _settings_client.gui.restriction_wait_vehicle_warn : _settings_client.gui.lost_vehicle_warn)) {
|
||||||
SetDParam(0, v->index);
|
SetDParam(0, v->index);
|
||||||
AddVehicleAdviceNewsItem(STR_NEWS_TRAIN_IS_STUCK, v->index);
|
AddVehicleAdviceNewsItem(STR_NEWS_TRAIN_IS_STUCK, v->index);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user