summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/window.cpp b/src/window.cpp
index 3f4adf5e9..e8c4fe74d 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -39,6 +39,7 @@
#include "framerate_type.h"
#include "network/network_func.h"
#include "guitimer_func.h"
+#include "news_func.h"
#include "safeguards.h"
@@ -3371,6 +3372,17 @@ restart_search:
}
/**
+ * Delete all messages and their corresponding window (if any).
+ */
+void DeleteAllMessages()
+{
+ InitNewsItemStructs();
+ InvalidateWindowData(WC_STATUS_BAR, 0, SBI_NEWS_DELETED); // invalidate the statusbar
+ InvalidateWindowData(WC_MESSAGE_HISTORY, 0); // invalidate the message history
+ DeleteWindowById(WC_NEWS_WINDOW, 0); // close newspaper or general message window if shown
+}
+
+/**
* Delete all windows that are used for construction of vehicle etc.
* Once done with that invalidate the others to ensure they get refreshed too.
*/