mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-24 12:06:41 +00:00
Codechange: make WindowClass a scoped enum
This commit is contained in:
+5
-5
@@ -46,7 +46,7 @@ static constexpr std::initializer_list<NWidgetPart> _nested_errmsg_widgets = {
|
||||
/** Window definition for the error message window. */
|
||||
static WindowDesc _errmsg_desc(
|
||||
WindowPosition::Manual, {}, 0, 0,
|
||||
WC_ERRMSG, WC_NONE,
|
||||
WindowClass::ErrorMessage, WindowClass::None,
|
||||
{},
|
||||
_nested_errmsg_widgets
|
||||
);
|
||||
@@ -67,7 +67,7 @@ static constexpr std::initializer_list<NWidgetPart> _nested_errmsg_face_widgets
|
||||
/** Window definition for the error message with company president face window. */
|
||||
static WindowDesc _errmsg_face_desc(
|
||||
WindowPosition::Manual, {}, 0, 0,
|
||||
WC_ERRMSG, WC_NONE,
|
||||
WindowClass::ErrorMessage, WindowClass::None,
|
||||
{},
|
||||
_nested_errmsg_face_widgets
|
||||
);
|
||||
@@ -280,7 +280,7 @@ void ShowFirstError()
|
||||
*/
|
||||
void UnshowCriticalError()
|
||||
{
|
||||
ErrmsgWindow *w = dynamic_cast<ErrmsgWindow *>(FindWindowById(WC_ERRMSG, 0));
|
||||
ErrmsgWindow *w = dynamic_cast<ErrmsgWindow *>(FindWindowById(WindowClass::ErrorMessage, 0));
|
||||
if (_window_system_initialized && w != nullptr) {
|
||||
if (w->IsCritical()) _error_list.push_front(*w);
|
||||
_window_system_initialized = false;
|
||||
@@ -340,7 +340,7 @@ void ShowErrorMessage(EncodedString &&summary_msg, EncodedString &&detailed_msg,
|
||||
|
||||
ErrorMessageData data(std::move(summary_msg), std::move(detailed_msg), is_critical, x, y, std::move(extra_msg), company);
|
||||
|
||||
ErrmsgWindow *w = dynamic_cast<ErrmsgWindow *>(FindWindowById(WC_ERRMSG, 0));
|
||||
ErrmsgWindow *w = dynamic_cast<ErrmsgWindow *>(FindWindowById(WindowClass::ErrorMessage, 0));
|
||||
if (w != nullptr) {
|
||||
if (w->IsCritical()) {
|
||||
/* A critical error is currently shown. */
|
||||
@@ -364,7 +364,7 @@ void ShowErrorMessage(EncodedString &&summary_msg, EncodedString &&detailed_msg,
|
||||
*/
|
||||
bool HideActiveErrorMessage()
|
||||
{
|
||||
ErrmsgWindow *w = dynamic_cast<ErrmsgWindow *>(FindWindowById(WC_ERRMSG, 0));
|
||||
ErrmsgWindow *w = dynamic_cast<ErrmsgWindow *>(FindWindowById(WindowClass::ErrorMessage, 0));
|
||||
if (w == nullptr) return false;
|
||||
w->Close();
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user