mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
Don't pipe PanicAlerts to netplay window if it isn't opened
This is something that was quite confusing for me while trying to get netplay to work for me; once the Connect/Host buttons were pressed, the UI would hang, only to work again a few seconds later, but with no error message or explanation *at all*. Turns out this is because panic alerts are shown in the netplay window instead during netplay, even before it is even shown. This fixes it by "piping" the alerts to the netplay chat only if the netplay window is visible. (regression introduced in #3823)
This commit is contained in:
parent
c7ead90a09
commit
574468c95b
@ -372,16 +372,13 @@ bool wxMsgAlert(const char* caption, const char* text, bool yes_no, int /*Style*
|
||||
{
|
||||
#endif
|
||||
NetPlayDialog*& npd = NetPlayDialog::GetInstance();
|
||||
if (npd == nullptr)
|
||||
{
|
||||
return wxYES == wxMessageBox(StrToWxStr(text), StrToWxStr(caption),
|
||||
(yes_no) ? wxYES_NO : wxOK, wxWindow::FindFocus());
|
||||
}
|
||||
else
|
||||
if (npd != nullptr && npd->IsShown())
|
||||
{
|
||||
npd->AppendChat("/!\\ " + std::string{text});
|
||||
return true;
|
||||
}
|
||||
return wxYES == wxMessageBox(StrToWxStr(text), StrToWxStr(caption), (yes_no) ? wxYES_NO : wxOK,
|
||||
wxWindow::FindFocus());
|
||||
#ifdef __WXGTK__
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user