Merge pull request #4042 from leoetlino/where-did-the-panicalert-go
Don't pipe PanicAlerts to netplay window if it isn't opened
This commit is contained in:
commit
aa34e5e20e
|
@ -372,16 +372,13 @@ bool wxMsgAlert(const char* caption, const char* text, bool yes_no, int /*Style*
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
NetPlayDialog*& npd = NetPlayDialog::GetInstance();
|
NetPlayDialog*& npd = NetPlayDialog::GetInstance();
|
||||||
if (npd == nullptr)
|
if (npd != nullptr && npd->IsShown())
|
||||||
{
|
|
||||||
return wxYES == wxMessageBox(StrToWxStr(text), StrToWxStr(caption),
|
|
||||||
(yes_no) ? wxYES_NO : wxOK, wxWindow::FindFocus());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
npd->AppendChat("/!\\ " + std::string{text});
|
npd->AppendChat("/!\\ " + std::string{text});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
return wxYES == wxMessageBox(StrToWxStr(text), StrToWxStr(caption), (yes_no) ? wxYES_NO : wxOK,
|
||||||
|
wxWindow::FindFocus());
|
||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue