diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index 955c0ae102..95c32d03df 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -64,6 +64,7 @@ void AddRemoveEngineFromAutoreplaceAndBuildWindows(VehicleType type) { InvalidateWindowData(WC_REPLACE_VEHICLE, type, 0); // Update the autoreplace window InvalidateWindowClassesData(WC_BUILD_VEHICLE); // The build windows needs updating as well + InvalidateWindowClassesData(WC_BUILD_VIRTUAL_TRAIN); } static const StringID _start_replace_dropdown[] = { diff --git a/src/economy.cpp b/src/economy.cpp index 9439b62bf5..00ef1c4491 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -878,6 +878,7 @@ void RecomputePrices() } SetWindowClassesDirty(WC_BUILD_VEHICLE); + SetWindowClassesDirty(WC_BUILD_VIRTUAL_TRAIN); SetWindowClassesDirty(WC_REPLACE_VEHICLE); SetWindowClassesDirty(WC_VEHICLE_DETAILS); SetWindowClassesDirty(WC_COMPANY_INFRASTRUCTURE); diff --git a/src/engine.cpp b/src/engine.cpp index ff4b3a6038..9b1b9a0846 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -627,7 +627,10 @@ static void CalcEngineReliability(Engine *e) /* Kick this engine out of the lists */ RetireEngineIfPossible(e, e->duration_phase_1 + e->duration_phase_2 + e->duration_phase_3); } + SetWindowClassesDirty(WC_BUILD_VEHICLE); // Update to show the new reliability + SetWindowClassesDirty(WC_BUILD_VIRTUAL_TRAIN); + SetWindowClassesDirty(WC_REPLACE_VEHICLE); } @@ -739,6 +742,7 @@ void StartupEngines() /* Invalidate any open purchase lists */ InvalidateWindowClassesData(WC_BUILD_VEHICLE); + InvalidateWindowClassesData(WC_BUILD_VIRTUAL_TRAIN); } /** @@ -1105,6 +1109,7 @@ void EnginesMonthlyLoop() } InvalidateWindowClassesData(WC_BUILD_VEHICLE); // rebuild the purchase list (esp. when sorted by reliability) + InvalidateWindowClassesData(WC_BUILD_VIRTUAL_TRAIN); } } diff --git a/src/settings.cpp b/src/settings.cpp index 5acc7c6a1c..725a748ee0 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -960,6 +960,7 @@ static void UpdateConsists(int32 new_value) AfterLoadTemplateVehiclesUpdateProperties(); InvalidateWindowClassesData(WC_BUILD_VEHICLE, 0); + InvalidateWindowClassesData(WC_BUILD_VIRTUAL_TRAIN, 0); SetWindowClassesDirty(WC_TEMPLATEGUI_MAIN); SetWindowClassesDirty(WC_CREATE_TEMPLATE); } @@ -1045,6 +1046,7 @@ static void TrainAccelerationModelChanged(int32 new_value) /* These windows show acceleration values only when realistic acceleration is on. They must be redrawn after a setting change. */ SetWindowClassesDirty(WC_ENGINE_PREVIEW); InvalidateWindowClassesData(WC_BUILD_VEHICLE, 0); + InvalidateWindowClassesData(WC_BUILD_VIRTUAL_TRAIN, 0); SetWindowClassesDirty(WC_VEHICLE_DETAILS); SetWindowClassesDirty(WC_TEMPLATEGUI_MAIN); SetWindowClassesDirty(WC_CREATE_TEMPLATE); @@ -1183,6 +1185,7 @@ static void RoadVehAccelerationModelChanged(int32 new_value) /* These windows show acceleration values only when realistic acceleration is on. They must be redrawn after a setting change. */ SetWindowClassesDirty(WC_ENGINE_PREVIEW); InvalidateWindowClassesData(WC_BUILD_VEHICLE, 0); + InvalidateWindowClassesData(WC_BUILD_VIRTUAL_TRAIN, 0); SetWindowClassesDirty(WC_VEHICLE_DETAILS); } diff --git a/src/strings.cpp b/src/strings.cpp index 4cfb30a07d..75ccfde8d5 100644 --- a/src/strings.cpp +++ b/src/strings.cpp @@ -2239,6 +2239,7 @@ bool ReadLanguagePack(const LanguageMetadata *lang) BuildIndustriesLegend(); BuildContentTypeStringList(); InvalidateWindowClassesData(WC_BUILD_VEHICLE); // Build vehicle window. + InvalidateWindowClassesData(WC_BUILD_VIRTUAL_TRAIN);// Build template trains window. InvalidateWindowClassesData(WC_TRAINS_LIST); // Train group window. InvalidateWindowClassesData(WC_TRACE_RESTRICT_SLOTS);// Trace restrict slots window. InvalidateWindowClassesData(WC_ROADVEH_LIST); // Road vehicle group window.