Dehardcode account providers (#38)

* Dehardcode account providers

* Fix crash on creation

* Add dynamic 'add account dialog' provider selector

* Fix typo and add newlines

* Rename loginType to provider

* Rename MojangAccount to Account and MojangAccountList to AccountList

* Fix json save error
This commit is contained in:
Max
2021-06-14 12:51:25 +03:00
committed by GitHub
parent 396400b60d
commit 167b6bd405
39 changed files with 398 additions and 261 deletions

View File

@@ -1,6 +1,6 @@
#include "LaunchController.h"
#include "MainWindow.h"
#include <minecraft/auth/MojangAccountList.h>
#include <minecraft/auth/AccountList.h>
#include "MultiMC.h"
#include "dialogs/CustomMessageBox.h"
#include "dialogs/ProfileSelectDialog.h"
@@ -37,8 +37,8 @@ void LaunchController::login()
JavaCommon::checkJVMArgs(m_instance->settings()->get("JvmArgs").toString(), m_parentWidget);
// Find an account to use.
std::shared_ptr<MojangAccountList> accounts = MMC->accounts();
MojangAccountPtr account = accounts->activeAccount();
std::shared_ptr<AccountList> accounts = MMC->accounts();
AccountPtr account = accounts->activeAccount();
if (accounts->count() <= 0)
{
// Tell the user they need to log in at least one account in order to play.