fix ErrorScreen pane never coming back after closing the first error

This commit is contained in:
Kae 2023-06-27 01:22:09 +10:00
parent 4e6e342169
commit 14e23a17cc

View File

@ -24,15 +24,17 @@ ErrorScreen::ErrorScreen() {
m_accepted = true; m_accepted = true;
}); });
reader.construct(assets->json("/interface/windowconfig/error.config:paneLayout"), m_errorPane.get()); reader.construct(assets->json("/interface/windowconfig/error.config:paneLayout"), m_errorPane.get());
m_paneManager->displayPane(PaneLayer::Window, m_errorPane, [this](PanePtr) {
m_accepted = true;
});
} }
void ErrorScreen::setMessage(String const& errorMessage) { void ErrorScreen::setMessage(String const& errorMessage) {
m_errorPane->fetchChild<LabelWidget>("labelError")->setText(errorMessage); m_errorPane->fetchChild<LabelWidget>("labelError")->setText(errorMessage);
m_accepted = false; m_accepted = false;
if (!m_paneManager->isDisplayed(m_errorPane)) {
m_paneManager->displayPane(PaneLayer::Window, m_errorPane, [this](PanePtr) {
m_accepted = true;
});
}
} }
bool ErrorScreen::accepted() { bool ErrorScreen::accepted() {