cellSaveData: get rid of g_last_user_response

This commit is contained in:
Megamouse 2023-02-14 01:01:30 +01:00
parent 3d411431c6
commit 2885c8a4ab
6 changed files with 42 additions and 25 deletions

View file

@ -85,14 +85,12 @@ void msg_dialog_frame::Create(const std::string& msg, const std::string& title)
connect(m_button_yes, &QAbstractButton::clicked, [this]()
{
g_last_user_response = CELL_MSGDIALOG_BUTTON_YES;
if (on_close) on_close(CELL_MSGDIALOG_BUTTON_YES);
m_dialog->accept();
});
connect(m_button_no, &QAbstractButton::clicked, [this]()
{
g_last_user_response = CELL_MSGDIALOG_BUTTON_NO;
if (on_close) on_close(CELL_MSGDIALOG_BUTTON_NO);
m_dialog->accept();
});
@ -117,7 +115,6 @@ void msg_dialog_frame::Create(const std::string& msg, const std::string& title)
connect(m_button_ok, &QAbstractButton::clicked, [this]()
{
g_last_user_response = CELL_MSGDIALOG_BUTTON_OK;
if (on_close) on_close(CELL_MSGDIALOG_BUTTON_OK);
m_dialog->accept();
});
@ -129,7 +126,6 @@ void msg_dialog_frame::Create(const std::string& msg, const std::string& title)
{
if (!type.disable_cancel)
{
g_last_user_response = CELL_MSGDIALOG_BUTTON_ESCAPE;
if (on_close) on_close(CELL_MSGDIALOG_BUTTON_ESCAPE);
}
});