Gray out "Manage Skins" button for authlib-injector accounts
Support for this is blocked by https://github.com/unmojang/FjordLauncher/issues/37, which we can get to after the 9.0 release.
This commit is contained in:
parent
fab399c094
commit
5c8bdf99cd
@ -398,6 +398,11 @@ bool AccountData::usesCustomApiServers() const
|
|||||||
return type == AccountType::AuthlibInjector;
|
return type == AccountType::AuthlibInjector;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AccountData::supportsSkinManagement() const
|
||||||
|
{
|
||||||
|
return type == AccountType::MSA;
|
||||||
|
}
|
||||||
|
|
||||||
QString AccountData::authServerUrl() const
|
QString AccountData::authServerUrl() const
|
||||||
{
|
{
|
||||||
if (usesCustomApiServers()) {
|
if (usesCustomApiServers()) {
|
||||||
|
@ -96,6 +96,7 @@ struct AccountData {
|
|||||||
QJsonObject saveState() const;
|
QJsonObject saveState() const;
|
||||||
bool resumeStateFromV3(QJsonObject data);
|
bool resumeStateFromV3(QJsonObject data);
|
||||||
|
|
||||||
|
bool supportsSkinManagement() const;
|
||||||
bool usesCustomApiServers() const;
|
bool usesCustomApiServers() const;
|
||||||
QString authServerUrl() const;
|
QString authServerUrl() const;
|
||||||
QString accountServerUrl() const;
|
QString accountServerUrl() const;
|
||||||
|
@ -119,6 +119,8 @@ class MinecraftAccount : public QObject, public Usable {
|
|||||||
|
|
||||||
bool usesCustomApiServers() const { return data.usesCustomApiServers(); }
|
bool usesCustomApiServers() const { return data.usesCustomApiServers(); }
|
||||||
|
|
||||||
|
bool supportsSkinManagement() const { return data.supportsSkinManagement(); }
|
||||||
|
|
||||||
QString accountDisplayString() const { return data.accountDisplayString(); }
|
QString accountDisplayString() const { return data.accountDisplayString(); }
|
||||||
|
|
||||||
QString accessToken() const { return data.accessToken(); }
|
QString accessToken() const { return data.accessToken(); }
|
||||||
|
@ -379,6 +379,7 @@ bool parseMinecraftProfileMojang(QByteArray& data, MinecraftProfile& output)
|
|||||||
// we don't know the cape ID as it is not returned from the session server
|
// we don't know the cape ID as it is not returned from the session server
|
||||||
// so just fake it - changing capes is probably locked anyway :(
|
// so just fake it - changing capes is probably locked anyway :(
|
||||||
capeOut.alias = "cape";
|
capeOut.alias = "cape";
|
||||||
|
capeOut.id = "00000000-0000-0000-0000-000000000000";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -238,15 +238,17 @@ void AccountListPage::updateButtonStates()
|
|||||||
bool hasSelection = !selection.empty();
|
bool hasSelection = !selection.empty();
|
||||||
bool accountIsReady = false;
|
bool accountIsReady = false;
|
||||||
bool accountIsOnline = false;
|
bool accountIsOnline = false;
|
||||||
|
bool accountSupportsSkinManagement = false;
|
||||||
if (hasSelection) {
|
if (hasSelection) {
|
||||||
QModelIndex selected = selection.first();
|
QModelIndex selected = selection.first();
|
||||||
MinecraftAccountPtr account = selected.data(AccountList::PointerRole).value<MinecraftAccountPtr>();
|
MinecraftAccountPtr account = selected.data(AccountList::PointerRole).value<MinecraftAccountPtr>();
|
||||||
accountIsReady = !account->isActive();
|
accountIsReady = !account->isActive();
|
||||||
accountIsOnline = account->accountType() != AccountType::Offline;
|
accountIsOnline = account->accountType() != AccountType::Offline;
|
||||||
|
accountSupportsSkinManagement = account->supportsSkinManagement();
|
||||||
}
|
}
|
||||||
ui->actionRemove->setEnabled(accountIsReady);
|
ui->actionRemove->setEnabled(accountIsReady);
|
||||||
ui->actionSetDefault->setEnabled(accountIsReady);
|
ui->actionSetDefault->setEnabled(accountIsReady);
|
||||||
ui->actionManageSkins->setEnabled(accountIsReady && accountIsOnline);
|
ui->actionManageSkins->setEnabled(accountIsReady && accountIsOnline && accountSupportsSkinManagement);
|
||||||
ui->actionRefresh->setEnabled(accountIsReady && accountIsOnline);
|
ui->actionRefresh->setEnabled(accountIsReady && accountIsOnline);
|
||||||
|
|
||||||
if (m_accounts->defaultAccount().get() == nullptr) {
|
if (m_accounts->defaultAccount().get() == nullptr) {
|
||||||
|
Loading…
Reference in New Issue
Block a user