GH-1795 add terminal launch option to use a specific Minecraft profile
Used like this: ``` ./MultiMC --launch 1.17.1 --profile MultiMCTest --server mc.hypixel.net ```
This commit is contained in:
@ -47,6 +47,16 @@ int AccountList::findAccountByProfileId(const QString& profileId) const {
|
||||
return -1;
|
||||
}
|
||||
|
||||
MinecraftAccountPtr AccountList::getAccountByProfileName(const QString& profileName) const {
|
||||
for (int i = 0; i < count(); i++) {
|
||||
MinecraftAccountPtr account = at(i);
|
||||
if (account->profileName() == profileName) {
|
||||
return account;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const MinecraftAccountPtr AccountList::at(int i) const
|
||||
{
|
||||
return MinecraftAccountPtr(m_accounts.at(i));
|
||||
|
@ -62,6 +62,7 @@ public:
|
||||
void addAccount(const MinecraftAccountPtr account);
|
||||
void removeAccount(QModelIndex index);
|
||||
int findAccountByProfileId(const QString &profileId) const;
|
||||
MinecraftAccountPtr getAccountByProfileName(const QString &profileName) const;
|
||||
|
||||
/*!
|
||||
* Sets the path to load/save the list file from/to.
|
||||
|
Reference in New Issue
Block a user