From b7eefeac8bb358bc2d9342e39df7c22055b0fb6d Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sat, 3 Apr 2021 19:15:40 +0200 Subject: [PATCH] hotfix: skip progr dialogs if msg dialogs are open --- .../RSX/Overlays/overlay_message_dialog.cpp | 2 +- .../Emu/RSX/Overlays/overlay_message_dialog.h | 2 +- rpcs3/Emu/System.cpp | 21 +++++++++++++++++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp b/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp index ee5c36e4f1..8494a61f52 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp +++ b/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.cpp @@ -311,7 +311,7 @@ namespace rsx text_display.translate(0, -(text_h - 16)); } - u32 message_dialog::progress_bar_count() + u32 message_dialog::progress_bar_count() const { return num_progress_bars; } diff --git a/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.h b/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.h index 5b5b1d1c50..a9663450fc 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.h +++ b/rpcs3/Emu/RSX/Overlays/overlay_message_dialog.h @@ -37,7 +37,7 @@ namespace rsx void set_text(const std::string& text); - u32 progress_bar_count(); + u32 progress_bar_count() const; void progress_bar_set_taskbar_index(s32 index); error_code progress_bar_set_message(u32 index, const std::string& msg); error_code progress_bar_increment(u32 index, f32 value); diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 1fab89517f..b04d0158f0 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -361,13 +361,17 @@ namespace } // Initialize message dialog + bool skip_this_one = false; // Workaround: do not open a progress dialog if there is already a cell message dialog open. std::shared_ptr dlg; std::shared_ptr native_dlg; if (const auto renderer = rsx::get_current_renderer(); renderer && renderer->is_inited) { - if (auto manager = g_fxo->try_get()) + auto manager = g_fxo->try_get(); + skip_this_one = manager && manager->get(); + + if (manager && !skip_this_one) { MsgDialogType type{}; type.se_normal = true; @@ -381,7 +385,7 @@ namespace } } - if (!native_dlg) + if (!skip_this_one && !native_dlg) { dlg = Emu.GetCallbacks().get_msg_dialog(); dlg->type.se_normal = true; @@ -411,6 +415,13 @@ namespace // Update progress while (thread_ctrl::state() != thread_state::aborting) { + if (skip_this_one) + { + // Do nothing + std::this_thread::sleep_for(10ms); + continue; + } + const u32 ftotal_new = g_progr_ftotal; const u32 fdone_new = g_progr_fdone; const u32 ptotal_new = g_progr_ptotal; @@ -476,6 +487,12 @@ namespace g_progr_ptotal -= ptotal; g_progr_pdone -= pdone; + if (skip_this_one) + { + // Do nothing + continue; + } + Emu.CallAfter([=]() { if (native_dlg)