Add: News menu entry and shortcut for deleting all messages. (#7240)

This commit is contained in:
Joan Josep
2019-02-17 00:15:58 +01:00
committed by PeterN
parent ebe84b9d4c
commit 548ec05a48
5 changed files with 19 additions and 1 deletions

View File

@@ -39,6 +39,7 @@
#include "framerate_type.h"
#include "network/network_func.h"
#include "guitimer_func.h"
#include "news_func.h"
#include "safeguards.h"
@@ -3370,6 +3371,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.