summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/window.cpp b/src/window.cpp
index f5fed776d..5161bea4f 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -2191,6 +2191,28 @@ restart_search:
}
}
+/**
+ * Delete all windows that are used for construction of vehicle etc.
+ * Once done with that invalidate the others to ensure they get refreshed too.
+ */
+void DeleteConstructionWindows()
+{
+ Window *w;
+
+restart_search:
+ /* When we find the window to delete, we need to restart the search
+ * as deleting this window could cascade in deleting (many) others
+ * anywhere in the z-array */
+ FOR_ALL_WINDOWS_FROM_BACK(w) {
+ if (w->desc_flags & WDF_CONSTRUCTION) {
+ delete w;
+ goto restart_search;
+ }
+ }
+
+ FOR_ALL_WINDOWS_FROM_BACK(w) w->SetDirty();
+}
+
/** Delete all always on-top windows to get an empty screen */
void HideVitalWindows()
{