UI improvement: Ely.by skins in launcher

This commit is contained in:
Zakhar Afonin
2021-06-12 08:46:53 +03:00
committed by GitHub
parent dca3b28325
commit 396400b60d
3 changed files with 19 additions and 3 deletions

View File

@@ -771,8 +771,15 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new MainWindow
}
for (auto profile : account->profiles())
{
auto skinsBase = BuildConfig.SKINS_BASE_MOJANG;
auto skinsArg = profile.id;
if (account->loginType() == "elyby")
{
skinsBase = BuildConfig.SKINS_BASE_ELYBY;
skinsArg = profile.name;
}
auto meta = Env::getInstance().metacache()->resolveEntry("skins", profile.id + ".png");
auto action = Net::Download::makeCached(QUrl(BuildConfig.SKINS_BASE + profile.id + ".png"), meta);
auto action = Net::Download::makeCached(QUrl(skinsBase + skinsArg + ".png"), meta);
skin_dls.append(action);
meta->setStale(true);
}

View File

@@ -175,8 +175,15 @@ void AccountListPage::addAccount(const QString &errMsg)
for (AccountProfile profile : account->profiles())
{
auto skinsBase = BuildConfig.SKINS_BASE_MOJANG;
auto skinsArg = profile.id;
if (account->loginType() == "elyby")
{
skinsBase = BuildConfig.SKINS_BASE_ELYBY;
skinsArg = profile.name;
}
auto meta = Env::getInstance().metacache()->resolveEntry("skins", profile.id + ".png");
auto action = Net::Download::makeCached(QUrl(BuildConfig.SKINS_BASE + profile.id + ".png"), meta);
auto action = Net::Download::makeCached(QUrl(skinsBase + skinsArg + ".png"), meta);
job->addNetAction(action);
meta->setStale(true);
}

View File

@@ -67,7 +67,6 @@ public:
QString RESOURCE_BASE = "https://resources.download.minecraft.net/";
QString LIBRARY_BASE = "https://libraries.minecraft.net/";
QString SKINS_BASE = "https://crafatar.com/skins/";
QString MOJANG_STATUS_URL = "https://status.mojang.com/check";
QString IMGUR_BASE_URL = "https://api.imgur.com/3/";
QString FMLLIBS_BASE_URL = "https://files.multimc.org/fmllibs/";
@@ -77,6 +76,9 @@ public:
QString AUTH_BASE_MOJANG = "https://authserver.mojang.com/";
QString AUTH_BASE_ELYBY = "https://authserver.ely.by/auth/";
QString SKINS_BASE_MOJANG = "https://crafatar.com/skins/";
QString SKINS_BASE_ELYBY = "http://skinsystem.ely.by/skins/";
QString MODPACKSCH_API_BASE_URL = "https://api.modpacks.ch/";
QString LEGACY_FTB_CDN_BASE_URL = "https://dist.creeper.host/FTB2/";