summaryrefslogtreecommitdiff
path: root/src/error_gui.cpp
diff options
context:
space:
mode:
authordP <dp@dpointer.org>2020-07-05 21:18:35 +0300
committerMichael Lutz <michi@icosahedron.de>2020-09-24 19:23:12 +0200
commit0110fa12daabecfaa5e6454ba6f93b8024db552e (patch)
tree6cd3e3cee85f9584060bc9a23951f8ab9d6151bd /src/error_gui.cpp
parent8f3d1ec970520d5a7d775e173ca1df2dc6867686 (diff)
downloadopenttd-0110fa12daabecfaa5e6454ba6f93b8024db552e.tar.xz
Feature: Make news and errors close hotkeys configurable
Diffstat (limited to 'src/error_gui.cpp')
-rw-r--r--src/error_gui.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/error_gui.cpp b/src/error_gui.cpp
index 7cbe1d95e..381d67a96 100644
--- a/src/error_gui.cpp
+++ b/src/error_gui.cpp
@@ -315,13 +315,6 @@ public:
if (_window_system_initialized) ShowFirstError();
}
- EventState OnKeyPress(WChar key, uint16 keycode) override
- {
- if (keycode != WKC_SPACE) return ES_NOT_HANDLED;
- delete this;
- return ES_HANDLED;
- }
-
/**
* Check whether the currently shown error message was critical or not.
* @return True iff the message was critical.
@@ -424,6 +417,18 @@ void ShowErrorMessage(StringID summary_msg, StringID detailed_msg, WarningLevel
}
}
+
+/**
+ * Close active error message window
+ * @return true if a window was closed.
+ */
+bool HideActiveErrorMessage() {
+ ErrmsgWindow *w = (ErrmsgWindow*)FindWindowById(WC_ERRMSG, 0);
+ if (w == nullptr) return false;
+ delete w;
+ return true;
+}
+
/**
* Schedule a list of errors.
* Note: This does not try to display the error now. This is useful if the window system is not yet running.