mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-10 06:29:00 +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_event_handler(instance.m_client, RAIntegrationEventHandler);
|
||||||
rc_client_raintegration_set_write_memory_function(instance.m_client, MemoryPoker);
|
rc_client_raintegration_set_write_memory_function(instance.m_client, MemoryPoker);
|
||||||
rc_client_raintegration_set_get_game_name_function(instance.m_client, GameTitleEstimateHandler);
|
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();
|
instance.m_dev_menu_callback();
|
||||||
// TODO: hook up menu and dll event handlers
|
// TODO: hook up menu and dll event handlers
|
||||||
break;
|
break;
|
||||||
|
@ -173,6 +173,7 @@ public:
|
|||||||
m_dev_menu_callback = callback;
|
m_dev_menu_callback = callback;
|
||||||
};
|
};
|
||||||
void SetHardcoreCallback(std::function<void(void)> callback) { m_hardcore_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
|
#endif // RC_CLIENT_SUPPORTS_RAINTEGRATION
|
||||||
|
|
||||||
void DoState(PointerWrap& p);
|
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
|
// 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
|
// message box returning, which could break cursor locking depending on the order
|
||||||
m_render_widget->SetWaitingForMessageBox(true);
|
m_render_widget->SetWaitingForMessageBox(true);
|
||||||
auto confirm = ModalMessageBox::question(
|
QString message;
|
||||||
confirm_parent, tr("Confirm"),
|
if (m_stop_requested)
|
||||||
m_stop_requested ? tr("A shutdown is already in progress. Unsaved data "
|
{
|
||||||
"may be lost if you stop the current emulation "
|
message = tr("A shutdown is already in progress. Unsaved data "
|
||||||
"before it completes. Force stop?") :
|
"may be lost if you stop the current emulation "
|
||||||
tr("Do you want to stop the current emulation?"),
|
"before it completes. Force stop?");
|
||||||
QMessageBox::Yes | QMessageBox::No, QMessageBox::NoButton, Qt::ApplicationModal);
|
}
|
||||||
|
#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,
|
// 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.
|
// even if the render widget will stay alive for a while.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user