GH-1895 update LWJGL list during legacy instance update
This commit is contained in:
parent
d70c783de8
commit
572a6026b5
@ -164,6 +164,20 @@ void LegacyUpdate::lwjglStart()
|
|||||||
{
|
{
|
||||||
LegacyInstance *inst = (LegacyInstance *)m_inst;
|
LegacyInstance *inst = (LegacyInstance *)m_inst;
|
||||||
|
|
||||||
|
auto list = std::dynamic_pointer_cast<LWJGLVersionList>(ENV.getVersionList("org.lwjgl.legacy"));
|
||||||
|
if (!list->isLoaded())
|
||||||
|
{
|
||||||
|
setStatus(tr("Checking the LWJGL version list..."));
|
||||||
|
list->loadList();
|
||||||
|
auto task = list->getLoadTask();
|
||||||
|
connect(task.get(), &Task::succeeded, this, &LegacyUpdate::lwjglStart);
|
||||||
|
connect(task.get(), &Task::failed, this, [&](const QString & error)
|
||||||
|
{
|
||||||
|
emitFailed(tr("Failed to refresh LWJGL list: %1.").arg(error));
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
lwjglVersion = inst->lwjglVersion();
|
lwjglVersion = inst->lwjglVersion();
|
||||||
lwjglTargetPath = FS::PathCombine(inst->lwjglFolder(), lwjglVersion);
|
lwjglTargetPath = FS::PathCombine(inst->lwjglFolder(), lwjglVersion);
|
||||||
lwjglNativesPath = FS::PathCombine(lwjglTargetPath, "natives");
|
lwjglNativesPath = FS::PathCombine(lwjglTargetPath, "natives");
|
||||||
@ -176,18 +190,11 @@ void LegacyUpdate::lwjglStart()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto list = std::dynamic_pointer_cast<LWJGLVersionList>(ENV.getVersionList("org.lwjgl.legacy"));
|
|
||||||
if (!list->isLoaded())
|
|
||||||
{
|
|
||||||
emitFailed("Too soon! Let the LWJGL list load :)");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
setStatus(tr("Downloading new LWJGL..."));
|
setStatus(tr("Downloading new LWJGL..."));
|
||||||
auto version = std::dynamic_pointer_cast<LWJGLVersion>(list->findVersion(lwjglVersion));
|
auto version = std::dynamic_pointer_cast<LWJGLVersion>(list->findVersion(lwjglVersion));
|
||||||
if (!version)
|
if (!version)
|
||||||
{
|
{
|
||||||
emitFailed("Game update failed: the selected LWJGL version is invalid.");
|
emitFailed(QString("Game update failed: the selected LWJGL version is invalid: %1").arg(lwjglVersion));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -350,10 +350,10 @@ MultiMC::MultiMC(int &argc, char **argv) : QApplication(argc, argv)
|
|||||||
|
|
||||||
initIcons();
|
initIcons();
|
||||||
initThemes();
|
initThemes();
|
||||||
// make sure we have at least some minecraft versions before we init instances
|
|
||||||
initInstances();
|
initInstances();
|
||||||
initAccounts();
|
initAccounts();
|
||||||
initNetwork();
|
initNetwork();
|
||||||
|
initLegacyLwjgl();
|
||||||
|
|
||||||
// now we have network, download translation updates
|
// now we have network, download translation updates
|
||||||
m_translations->downloadIndex();
|
m_translations->downloadIndex();
|
||||||
@ -859,6 +859,11 @@ void MultiMC::initMCEdit()
|
|||||||
m_mcedit.reset(new MCEditTool(m_settings));
|
m_mcedit.reset(new MCEditTool(m_settings));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MultiMC::initLegacyLwjgl()
|
||||||
|
{
|
||||||
|
auto list = lwjgllist();
|
||||||
|
}
|
||||||
|
|
||||||
std::shared_ptr<TranslationsModel> MultiMC::translations()
|
std::shared_ptr<TranslationsModel> MultiMC::translations()
|
||||||
{
|
{
|
||||||
return m_translations;
|
return m_translations;
|
||||||
|
@ -185,6 +185,7 @@ private:
|
|||||||
void initAccounts();
|
void initAccounts();
|
||||||
void initMCEdit();
|
void initMCEdit();
|
||||||
void initAnalytics();
|
void initAnalytics();
|
||||||
|
void initLegacyLwjgl();
|
||||||
void shutdownAnalytics();
|
void shutdownAnalytics();
|
||||||
bool createSetupWizard();
|
bool createSetupWizard();
|
||||||
void performMainStartupAction();
|
void performMainStartupAction();
|
||||||
|
Loading…
Reference in New Issue
Block a user