mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
add info & retry dialog
Signed-off-by: Tayou <git@tayou.org>
(cherry picked from commit 768d12259b)
This commit is contained in:
parent
7478c97ccd
commit
f490d4f77f
1 changed files with 27 additions and 0 deletions
|
|
@ -182,6 +182,33 @@ LaunchDecision LaunchController::decideLaunchMode()
|
|||
|
||||
QString reauthReason;
|
||||
switch (state) {
|
||||
case AccountState::Offline: {
|
||||
if (m_wantedLaunchMode == LaunchMode::Normal) {
|
||||
QMessageBox msg(m_parentWidget);
|
||||
msg.setWindowTitle(tr("Auth servers offline"));
|
||||
msg.setText(tr("The Minecraft authentication servers are currently unavailable."));
|
||||
msg.setIcon(QMessageBox::Warning);
|
||||
|
||||
auto* launchOfflineButton = msg.addButton(tr("Launch Offline"), QMessageBox::AcceptRole);
|
||||
auto* retryButton = msg.addButton(tr("Retry"), QMessageBox::ActionRole);
|
||||
msg.addButton(tr("Cancel"), QMessageBox::RejectRole);
|
||||
msg.setDefaultButton(launchOfflineButton);
|
||||
|
||||
msg.exec();
|
||||
|
||||
if (msg.clickedButton() == launchOfflineButton) {
|
||||
m_actualLaunchMode = LaunchMode::Offline;
|
||||
return LaunchDecision::Continue;
|
||||
}
|
||||
if (msg.clickedButton() == retryButton) {
|
||||
return LaunchDecision::Undecided;
|
||||
}
|
||||
return LaunchDecision::Abort;
|
||||
}
|
||||
|
||||
m_actualLaunchMode = LaunchMode::Offline;
|
||||
return LaunchDecision::Continue;
|
||||
}
|
||||
case AccountState::Errored:
|
||||
reauthReason = tr("An error occurred while refreshing '%1'").arg(accountToCheck->profileName());
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue