mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-20 05:15:42 -04:00
Achievements: Don't turn HC off on login fail if we reauth
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
#include <QtWidgets/QMessageBox>
|
||||
|
||||
AchievementLoginDialog::AchievementLoginDialog(QWidget* parent, Achievements::LoginRequestReason reason)
|
||||
: QDialog(parent)
|
||||
: QDialog(parent), m_reason(reason)
|
||||
{
|
||||
m_ui.setupUi(this);
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
@ -51,6 +51,15 @@ void AchievementLoginDialog::loginClicked()
|
||||
|
||||
void AchievementLoginDialog::cancelClicked()
|
||||
{
|
||||
// Disable hardcore mode if we cancelled reauthentication.
|
||||
if (m_reason == Achievements::LoginRequestReason::TokenInvalid && QtHost::IsSystemValid())
|
||||
{
|
||||
Host::RunOnCPUThread([]() {
|
||||
if (System::IsValid() && !Achievements::HasActiveGame())
|
||||
Achievements::DisableHardcoreMode();
|
||||
});
|
||||
}
|
||||
|
||||
done(1);
|
||||
}
|
||||
|
||||
|
@ -30,4 +30,5 @@ private:
|
||||
|
||||
Ui::AchievementLoginDialog m_ui;
|
||||
QPushButton* m_login;
|
||||
Achievements::LoginRequestReason m_reason;
|
||||
};
|
||||
|
Reference in New Issue
Block a user