Download assets for 1.6 on application start (background task).

This commit is contained in:
Petr Mrázek
2013-08-04 04:19:10 +02:00
parent 4f73091bb5
commit 0adf1828b0
6 changed files with 82 additions and 25 deletions

View File

@ -58,6 +58,7 @@
#include "BaseInstance.h"
#include "InstanceFactory.h"
#include "MinecraftProcess.h"
#include "OneSixAssets.h"
#include "instancemodel.h"
#include "instancedelegate.h"
@ -144,16 +145,20 @@ MainWindow::MainWindow ( QWidget *parent ) :
instList.at(0)->setName("TEST ITEM");
*/
//FIXME: WTF
if (!MinecraftVersionList::getMainList().isLoaded())
{
m_versionLoadTask = MinecraftVersionList::getMainList().getLoadTask();
startTask(m_versionLoadTask);
}
//FIXME: WTF X 2
if (!LWJGLVersionList::get().isLoaded())
{
LWJGLVersionList::get().loadList();
}
//FIXME: I guess you get the idea. This is a quick hack.
assets_downloader = new OneSixAssets();
assets_downloader->start();
}
MainWindow::~MainWindow()
@ -162,6 +167,7 @@ MainWindow::~MainWindow()
delete proxymodel;
delete model;
delete drawer;
delete assets_downloader;
}
void MainWindow::instanceActivated ( QModelIndex index )

View File

@ -28,6 +28,7 @@ class KCategorizedView;
class KCategoryDrawer;
class MinecraftProcess;
class ConsoleWindow;
class OneSixAssets;
namespace Ui
{
@ -128,6 +129,7 @@ private:
InstanceList instList;
MinecraftProcess *proc;
ConsoleWindow *console;
OneSixAssets *assets_downloader;
// A pointer to the instance we are actively doing stuff with.
// This is set when the user launches an instance and is used to refer to that