diff options
author | swirl <swurl@swurl.xyz> | 2022-01-14 18:03:35 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-14 18:03:35 -0500 |
commit | b4f750e7db40352111417ea89a9f375ae8c746ab (patch) | |
tree | d69c63d525c824f0c39803460896aa6ca719d66e /launcher/ui/pages/global/AccountListPage.cpp | |
parent | b19e3156154ba0dd232a3d165b1759c57e2858f2 (diff) | |
parent | cdaa397dcffb92ae6a9c659047a87d49286dee4f (diff) | |
download | PrismLauncher-b4f750e7db40352111417ea89a9f375ae8c746ab.tar.gz PrismLauncher-b4f750e7db40352111417ea89a9f375ae8c746ab.tar.bz2 PrismLauncher-b4f750e7db40352111417ea89a9f375ae8c746ab.zip |
Merge pull request #50 from bexnoss/offline-mode
Offline Mode Support
Diffstat (limited to 'launcher/ui/pages/global/AccountListPage.cpp')
-rw-r--r-- | launcher/ui/pages/global/AccountListPage.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/launcher/ui/pages/global/AccountListPage.cpp b/launcher/ui/pages/global/AccountListPage.cpp index b8da6c75..ad88812a 100644 --- a/launcher/ui/pages/global/AccountListPage.cpp +++ b/launcher/ui/pages/global/AccountListPage.cpp @@ -24,6 +24,7 @@ #include "net/NetJob.h" #include "ui/dialogs/ProgressDialog.h" +#include "ui/dialogs/OfflineLoginDialog.h" #include "ui/dialogs/LoginDialog.h" #include "ui/dialogs/MSALoginDialog.h" #include "ui/dialogs/CustomMessageBox.h" @@ -153,6 +154,28 @@ void AccountListPage::on_actionAddMicrosoft_triggered() } } +void AccountListPage::on_actionAddOffline_triggered() +{ + MinecraftAccountPtr account = OfflineLoginDialog::newAccount( + this, + tr("Please enter your desired username to add your offline account. <br>" + "<br>" + "It is required by Mojang that you own Minecraft BEFORE you may use offline mode. <br>" + "The PolyMC developers denounce piracy and take NO LIABILITY WHATSOEVER for <br>" + "any illegal activity that may occur in usage of the offline mode feature. <br>" + "<br>" + "By continuing you promise that you own a Minecraft account.") + ); + + if (account) + { + m_accounts->addAccount(account); + if (m_accounts->count() == 1) { + m_accounts->setDefaultAccount(account); + } + } +} + void AccountListPage::on_actionRemove_triggered() { QModelIndexList selection = ui->listView->selectionModel()->selectedIndexes(); |