1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-25 20:22:30 +01:00

hotfix: skip progr dialogs if msg dialogs are open

This commit is contained in:
Megamouse 2021-04-03 19:15:40 +02:00
parent e57f36fc5b
commit b7eefeac8b
3 changed files with 21 additions and 4 deletions

View File

@ -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;
}

View File

@ -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);

View File

@ -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<MsgDialogBase> dlg;
std::shared_ptr<rsx::overlays::message_dialog> native_dlg;
if (const auto renderer = rsx::get_current_renderer();
renderer && renderer->is_inited)
{
if (auto manager = g_fxo->try_get<rsx::overlays::display_manager>())
auto manager = g_fxo->try_get<rsx::overlays::display_manager>();
skip_this_one = manager && manager->get<rsx::overlays::message_dialog>();
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)