summaryrefslogtreecommitdiffstats
path: root/gui/dialogs/AccountListDialog.cpp
diff options
context:
space:
mode:
authorSky <git@bunnies.cc>2013-11-27 18:45:29 +0000
committerSky <git@bunnies.cc>2013-11-27 18:45:29 +0000
commit38732636d3c1f1563c2dceeae723fd51f7b5fda6 (patch)
treeee59e304a5aa93ff9a47c98ab69db21b4e671434 /gui/dialogs/AccountListDialog.cpp
parent7d7579d7f04f88013d7e4d064b2becec28cced61 (diff)
downloadMultiMC-38732636d3c1f1563c2dceeae723fd51f7b5fda6.tar
MultiMC-38732636d3c1f1563c2dceeae723fd51f7b5fda6.tar.gz
MultiMC-38732636d3c1f1563c2dceeae723fd51f7b5fda6.tar.lz
MultiMC-38732636d3c1f1563c2dceeae723fd51f7b5fda6.tar.xz
MultiMC-38732636d3c1f1563c2dceeae723fd51f7b5fda6.zip
Nuke skins.json, use nice yggdrasil implementation instead. Grabs all Mojang account skins on addition, active on startup
Diffstat (limited to 'gui/dialogs/AccountListDialog.cpp')
-rw-r--r--gui/dialogs/AccountListDialog.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/gui/dialogs/AccountListDialog.cpp b/gui/dialogs/AccountListDialog.cpp
index 81b39e4c..ea6861c6 100644
--- a/gui/dialogs/AccountListDialog.cpp
+++ b/gui/dialogs/AccountListDialog.cpp
@@ -21,6 +21,7 @@
#include <logger/QsLog.h>
#include <logic/auth/AuthenticateTask.h>
+#include <logic/net/NetJob.h>
#include <gui/dialogs/LoginDialog.h>
#include <gui/dialogs/ProgressDialog.h>
@@ -112,5 +113,21 @@ void AccountListDialog::onLoginComplete()
MojangAccountPtr account = m_authTask->getMojangAccount();
m_accounts->addAccount(account);
//ui->listView->update();
+
+ // Grab associated player skins
+ auto job = new NetJob("Player skins: " + account->username());
+
+ for(AccountProfile profile : account->profiles())
+ {
+ auto meta = MMC->metacache()->resolveEntry("skins", profile.name() + ".png");
+ auto action = CacheDownload::make(
+ QUrl("http://skins.minecraft.net/MinecraftSkins/" + profile.name() + ".png"),
+ meta);
+ job->addNetAction(action);
+ meta->stale = true;
+ }
+
+ connect(job, SIGNAL(succeeded()), SIGNAL(activeAccountChanged()));
+ job->start();
}