mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-09 06:03:32 +01:00
Added Modified Achievements Confirmation
Added a line to the close game confirmation dialog to tell the dev if there are unsaved modifications to the achievement assets.
This commit is contained in:
parent
ee051da66d
commit
3aa69094d4
@ -1487,6 +1487,7 @@ void AchievementManager::LoadIntegrationCallback(int result, const char* error_m
|
||||
rc_client_raintegration_set_event_handler(instance.m_client, RAIntegrationEventHandler);
|
||||
rc_client_raintegration_set_write_memory_function(instance.m_client, MemoryPoker);
|
||||
rc_client_raintegration_set_get_game_name_function(instance.m_client, GameTitleEstimateHandler);
|
||||
Config::SetBaseOrCurrent(Config::MAIN_CONFIRM_ON_STOP, true);
|
||||
instance.m_dev_menu_callback();
|
||||
// TODO: hook up menu and dll event handlers
|
||||
break;
|
||||
|
@ -173,6 +173,7 @@ public:
|
||||
m_dev_menu_callback = callback;
|
||||
};
|
||||
void SetHardcoreCallback(std::function<void(void)> callback) { m_hardcore_callback = callback; };
|
||||
bool CheckForModifications() { return rc_client_raintegration_has_modifications(m_client); };
|
||||
#endif // RC_CLIENT_SUPPORTS_RAINTEGRATION
|
||||
|
||||
void DoState(PointerWrap& p);
|
||||
|
@ -967,13 +967,27 @@ bool MainWindow::RequestStop()
|
||||
// This is to avoid any "race conditions" between the "Window Activate" message and the
|
||||
// message box returning, which could break cursor locking depending on the order
|
||||
m_render_widget->SetWaitingForMessageBox(true);
|
||||
auto confirm = ModalMessageBox::question(
|
||||
confirm_parent, tr("Confirm"),
|
||||
m_stop_requested ? tr("A shutdown is already in progress. Unsaved data "
|
||||
"may be lost if you stop the current emulation "
|
||||
"before it completes. Force stop?") :
|
||||
tr("Do you want to stop the current emulation?"),
|
||||
QMessageBox::Yes | QMessageBox::No, QMessageBox::NoButton, Qt::ApplicationModal);
|
||||
QString message;
|
||||
if (m_stop_requested)
|
||||
{
|
||||
message = tr("A shutdown is already in progress. Unsaved data "
|
||||
"may be lost if you stop the current emulation "
|
||||
"before it completes. Force stop?");
|
||||
}
|
||||
#ifdef RC_CLIENT_SUPPORTS_RAINTEGRATION
|
||||
else if (AchievementManager::GetInstance().CheckForModifications())
|
||||
{
|
||||
message = tr(
|
||||
"Do you want to stop the current emulation? Unsaved achievement modifications detected.");
|
||||
}
|
||||
#endif // RC_CLIENT_SUPPORTS_RAINTEGRATION
|
||||
else
|
||||
{
|
||||
message = tr("Do you want to stop the current emulation?");
|
||||
}
|
||||
auto confirm = ModalMessageBox::question(confirm_parent, tr("Confirm"), message,
|
||||
QMessageBox::Yes | QMessageBox::No,
|
||||
QMessageBox::NoButton, Qt::ApplicationModal);
|
||||
|
||||
// If a user confirmed stopping the emulation, we do not capture the cursor again,
|
||||
// even if the render widget will stay alive for a while.
|
||||
|
Loading…
x
Reference in New Issue
Block a user