mirror of
https://github.com/UltimMC/Launcher.git
synced 2025-12-14 04:32:14 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b3cf19190f | ||
|
|
842328df8e | ||
|
|
7f4073840a | ||
|
|
f0d850e1ee | ||
|
|
c31dbf13cb | ||
|
|
c081cd8021 |
@@ -104,7 +104,7 @@ set(MultiMC_NEWS_RSS_URL "http://multimc.org/rss.xml" CACHE STRING "URL to fetch
|
|||||||
######## Set version numbers ########
|
######## Set version numbers ########
|
||||||
set(MultiMC_VERSION_MAJOR 0)
|
set(MultiMC_VERSION_MAJOR 0)
|
||||||
set(MultiMC_VERSION_MINOR 3)
|
set(MultiMC_VERSION_MINOR 3)
|
||||||
set(MultiMC_VERSION_HOTFIX 6)
|
set(MultiMC_VERSION_HOTFIX 9)
|
||||||
|
|
||||||
# Build number
|
# Build number
|
||||||
set(MultiMC_VERSION_BUILD -1 CACHE STRING "Build number. -1 for no build number.")
|
set(MultiMC_VERSION_BUILD -1 CACHE STRING "Build number. -1 for no build number.")
|
||||||
|
|||||||
@@ -484,6 +484,7 @@ void MultiMC::initGlobalSettings()
|
|||||||
// Java Settings
|
// Java Settings
|
||||||
m_settings->registerSetting("JavaPath", "");
|
m_settings->registerSetting("JavaPath", "");
|
||||||
m_settings->registerSetting("LastHostname", "");
|
m_settings->registerSetting("LastHostname", "");
|
||||||
|
m_settings->registerSetting("JavaDetectionHack", "");
|
||||||
m_settings->registerSetting("JvmArgs", "");
|
m_settings->registerSetting("JvmArgs", "");
|
||||||
|
|
||||||
// Custom Commands
|
// Custom Commands
|
||||||
|
|||||||
@@ -82,3 +82,9 @@
|
|||||||
- Fix for translations on OSX not working
|
- Fix for translations on OSX not working
|
||||||
- Screenshot dialog should be harder to lose track of when used from the console window
|
- Screenshot dialog should be harder to lose track of when used from the console window
|
||||||
- A crash handler implementation has been added.
|
- A crash handler implementation has been added.
|
||||||
|
0.3.7
|
||||||
|
- Fixed forge for 1.7.10-pre4 (and any future prereleases)
|
||||||
|
0.3.8
|
||||||
|
- Workaround for performance issues with Intel integrated graphics chips
|
||||||
|
0.3.9
|
||||||
|
- Workaround for 1.7.10 Forge
|
||||||
|
|||||||
@@ -110,7 +110,8 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
|
|||||||
MultiMCPlatform::fixWM_CLASS(this);
|
MultiMCPlatform::fixWM_CLASS(this);
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
QString winTitle = QString("MultiMC 5 - Version %1").arg(BuildConfig.printableVersionString());
|
QString winTitle =
|
||||||
|
QString("MultiMC 5 - Version %1").arg(BuildConfig.printableVersionString());
|
||||||
if (!BuildConfig.BUILD_PLATFORM.isEmpty())
|
if (!BuildConfig.BUILD_PLATFORM.isEmpty())
|
||||||
winTitle += " on " + BuildConfig.BUILD_PLATFORM;
|
winTitle += " on " + BuildConfig.BUILD_PLATFORM;
|
||||||
setWindowTitle(winTitle);
|
setWindowTitle(winTitle);
|
||||||
@@ -339,7 +340,6 @@ void MainWindow::skinJobFinished()
|
|||||||
skin_download_job.reset();
|
skin_download_job.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::showInstanceContextMenu(const QPoint &pos)
|
void MainWindow::showInstanceContextMenu(const QPoint &pos)
|
||||||
{
|
{
|
||||||
QList<QAction *> actions;
|
QList<QAction *> actions;
|
||||||
@@ -361,9 +361,10 @@ void MainWindow::showInstanceContextMenu(const QPoint &pos)
|
|||||||
QAction *actionCopyInstance = new QAction(tr("Copy instance"), this);
|
QAction *actionCopyInstance = new QAction(tr("Copy instance"), this);
|
||||||
actionCopyInstance->setToolTip(ui->actionCopyInstance->toolTip());
|
actionCopyInstance->setToolTip(ui->actionCopyInstance->toolTip());
|
||||||
|
|
||||||
|
connect(actionRename, SIGNAL(triggered(bool)),
|
||||||
connect(actionRename, SIGNAL(triggered(bool)), SLOT(on_actionRenameInstance_triggered()));
|
SLOT(on_actionRenameInstance_triggered()));
|
||||||
connect(actionCopyInstance, SIGNAL(triggered(bool)), SLOT(on_actionCopyInstance_triggered()));
|
connect(actionCopyInstance, SIGNAL(triggered(bool)),
|
||||||
|
SLOT(on_actionCopyInstance_triggered()));
|
||||||
|
|
||||||
actions.replace(1, actionRename);
|
actions.replace(1, actionRename);
|
||||||
actions.prepend(actionSep);
|
actions.prepend(actionSep);
|
||||||
@@ -378,7 +379,8 @@ void MainWindow::showInstanceContextMenu(const QPoint &pos)
|
|||||||
QAction *actionCreateInstance = new QAction(tr("Create instance"), this);
|
QAction *actionCreateInstance = new QAction(tr("Create instance"), this);
|
||||||
actionCreateInstance->setToolTip(ui->actionAddInstance->toolTip());
|
actionCreateInstance->setToolTip(ui->actionAddInstance->toolTip());
|
||||||
|
|
||||||
connect(actionCreateInstance, SIGNAL(triggered(bool)), SLOT(on_actionAddInstance_triggered()));
|
connect(actionCreateInstance, SIGNAL(triggered(bool)),
|
||||||
|
SLOT(on_actionAddInstance_triggered()));
|
||||||
|
|
||||||
actions.prepend(actionSep);
|
actions.prepend(actionSep);
|
||||||
actions.prepend(actionVoid);
|
actions.prepend(actionVoid);
|
||||||
@@ -399,7 +401,8 @@ void MainWindow::updateToolsMenu()
|
|||||||
}
|
}
|
||||||
QMenu *launchMenu = new QMenu(this);
|
QMenu *launchMenu = new QMenu(this);
|
||||||
QAction *normalLaunch = launchMenu->addAction(tr("Launch"));
|
QAction *normalLaunch = launchMenu->addAction(tr("Launch"));
|
||||||
connect(normalLaunch, &QAction::triggered, [this](){doLaunch();});
|
connect(normalLaunch, &QAction::triggered, [this]()
|
||||||
|
{ doLaunch(); });
|
||||||
launchMenu->addSeparator()->setText(tr("Profilers"));
|
launchMenu->addSeparator()->setText(tr("Profilers"));
|
||||||
for (auto profiler : MMC->profilers().values())
|
for (auto profiler : MMC->profilers().values())
|
||||||
{
|
{
|
||||||
@@ -408,11 +411,13 @@ void MainWindow::updateToolsMenu()
|
|||||||
if (!profiler->check(&error))
|
if (!profiler->check(&error))
|
||||||
{
|
{
|
||||||
profilerAction->setDisabled(true);
|
profilerAction->setDisabled(true);
|
||||||
profilerAction->setToolTip(tr("Profiler not setup correctly. Go into settings, \"External Tools\"."));
|
profilerAction->setToolTip(
|
||||||
|
tr("Profiler not setup correctly. Go into settings, \"External Tools\"."));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
connect(profilerAction, &QAction::triggered, [this, profiler](){doLaunch(true, profiler.get());});
|
connect(profilerAction, &QAction::triggered, [this, profiler]()
|
||||||
|
{ doLaunch(true, profiler.get()); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
launchMenu->addSeparator()->setText(tr("Tools"));
|
launchMenu->addSeparator()->setText(tr("Tools"));
|
||||||
@@ -423,14 +428,13 @@ void MainWindow::updateToolsMenu()
|
|||||||
if (!tool->check(&error))
|
if (!tool->check(&error))
|
||||||
{
|
{
|
||||||
toolAction->setDisabled(true);
|
toolAction->setDisabled(true);
|
||||||
toolAction->setToolTip(tr("Tool not setup correctly. Go into settings, \"External Tools\"."));
|
toolAction->setToolTip(
|
||||||
|
tr("Tool not setup correctly. Go into settings, \"External Tools\"."));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
connect(toolAction, &QAction::triggered, [this, tool]()
|
connect(toolAction, &QAction::triggered, [this, tool]()
|
||||||
{
|
{ tool->createDetachedTool(m_selectedInstance, this)->run(); });
|
||||||
tool->createDetachedTool(m_selectedInstance, this)->run();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ui->actionLaunchInstance->setMenu(launchMenu);
|
ui->actionLaunchInstance->setMenu(launchMenu);
|
||||||
@@ -1224,7 +1228,8 @@ void MainWindow::doLaunch(bool online, BaseProfilerFactory *profiler)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::updateInstance(InstancePtr instance, AuthSessionPtr session, BaseProfilerFactory *profiler)
|
void MainWindow::updateInstance(InstancePtr instance, AuthSessionPtr session,
|
||||||
|
BaseProfilerFactory *profiler)
|
||||||
{
|
{
|
||||||
auto updateTask = instance->doUpdate();
|
auto updateTask = instance->doUpdate();
|
||||||
if (!updateTask)
|
if (!updateTask)
|
||||||
@@ -1239,7 +1244,8 @@ void MainWindow::updateInstance(InstancePtr instance, AuthSessionPtr session, Ba
|
|||||||
tDialog.exec(updateTask.get());
|
tDialog.exec(updateTask.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::launchInstance(InstancePtr instance, AuthSessionPtr session, BaseProfilerFactory *profiler)
|
void MainWindow::launchInstance(InstancePtr instance, AuthSessionPtr session,
|
||||||
|
BaseProfilerFactory *profiler)
|
||||||
{
|
{
|
||||||
Q_ASSERT_X(instance != NULL, "launchInstance", "instance is NULL");
|
Q_ASSERT_X(instance != NULL, "launchInstance", "instance is NULL");
|
||||||
Q_ASSERT_X(session.get() != nullptr, "launchInstance", "session is NULL");
|
Q_ASSERT_X(session.get() != nullptr, "launchInstance", "session is NULL");
|
||||||
@@ -1266,7 +1272,8 @@ void MainWindow::launchInstance(InstancePtr instance, AuthSessionPtr session, Ba
|
|||||||
QString error;
|
QString error;
|
||||||
if (!profiler->check(&error))
|
if (!profiler->check(&error))
|
||||||
{
|
{
|
||||||
QMessageBox::critical(this, tr("Error"), tr("Couldn't start profiler: %1").arg(error));
|
QMessageBox::critical(this, tr("Error"),
|
||||||
|
tr("Couldn't start profiler: %1").arg(error));
|
||||||
proc->abort();
|
proc->abort();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1276,9 +1283,11 @@ void MainWindow::launchInstance(InstancePtr instance, AuthSessionPtr session, Ba
|
|||||||
dialog.setMaximum(0);
|
dialog.setMaximum(0);
|
||||||
dialog.setValue(0);
|
dialog.setValue(0);
|
||||||
dialog.setLabelText(tr("Waiting for profiler..."));
|
dialog.setLabelText(tr("Waiting for profiler..."));
|
||||||
connect(&dialog, &QProgressDialog::canceled, profilerInstance, &BaseProfiler::abortProfiling);
|
connect(&dialog, &QProgressDialog::canceled, profilerInstance,
|
||||||
|
&BaseProfiler::abortProfiling);
|
||||||
dialog.show();
|
dialog.show();
|
||||||
connect(profilerInstance, &BaseProfiler::readyToLaunch, [&dialog, this, proc](const QString &message)
|
connect(profilerInstance, &BaseProfiler::readyToLaunch,
|
||||||
|
[&dialog, this, proc](const QString & message)
|
||||||
{
|
{
|
||||||
dialog.accept();
|
dialog.accept();
|
||||||
QMessageBox msg;
|
QMessageBox msg;
|
||||||
@@ -1291,7 +1300,8 @@ void MainWindow::launchInstance(InstancePtr instance, AuthSessionPtr session, Ba
|
|||||||
msg.exec();
|
msg.exec();
|
||||||
proc->launch();
|
proc->launch();
|
||||||
});
|
});
|
||||||
connect(profilerInstance, &BaseProfiler::abortLaunch, [&dialog, this, proc](const QString &message)
|
connect(profilerInstance, &BaseProfiler::abortLaunch,
|
||||||
|
[&dialog, this, proc](const QString & message)
|
||||||
{
|
{
|
||||||
dialog.accept();
|
dialog.accept();
|
||||||
QMessageBox msg;
|
QMessageBox msg;
|
||||||
@@ -1528,7 +1538,9 @@ void MainWindow::checkMigrateLegacyAssets()
|
|||||||
|
|
||||||
void MainWindow::checkSetDefaultJava()
|
void MainWindow::checkSetDefaultJava()
|
||||||
{
|
{
|
||||||
|
const QString javaHack = "IntelHack";
|
||||||
bool askForJava = false;
|
bool askForJava = false;
|
||||||
|
do
|
||||||
{
|
{
|
||||||
QString currentHostName = QHostInfo::localHostName();
|
QString currentHostName = QHostInfo::localHostName();
|
||||||
QString oldHostName = MMC->settings()->get("LastHostname").toString();
|
QString oldHostName = MMC->settings()->get("LastHostname").toString();
|
||||||
@@ -1536,16 +1548,30 @@ void MainWindow::checkSetDefaultJava()
|
|||||||
{
|
{
|
||||||
MMC->settings()->set("LastHostname", currentHostName);
|
MMC->settings()->set("LastHostname", currentHostName);
|
||||||
askForJava = true;
|
askForJava = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
QString currentJavaPath = MMC->settings()->get("JavaPath").toString();
|
QString currentJavaPath = MMC->settings()->get("JavaPath").toString();
|
||||||
if (currentJavaPath.isEmpty())
|
if (currentJavaPath.isEmpty())
|
||||||
{
|
{
|
||||||
askForJava = true;
|
askForJava = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
#if defined Q_OS_WIN32
|
||||||
|
QString currentHack = MMC->settings()->get("JavaDetectionHack").toString();
|
||||||
|
if (currentHack != javaHack)
|
||||||
|
{
|
||||||
|
CustomMessageBox::selectable(
|
||||||
|
this, tr("Java detection forced"),
|
||||||
|
tr("Because of graphics performance issues caused by Intel drivers on Windows, "
|
||||||
|
"MultiMC java detection was forced. Please select a Java "
|
||||||
|
"version.<br/><br/>If you have custom java versions set for your instances, "
|
||||||
|
"make sure you use the 'javaw.exe' executable."),
|
||||||
|
QMessageBox::Warning)->exec();
|
||||||
|
askForJava = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
} while (0);
|
||||||
|
|
||||||
if (askForJava)
|
if (askForJava)
|
||||||
{
|
{
|
||||||
@@ -1573,7 +1599,10 @@ void MainWindow::checkSetDefaultJava()
|
|||||||
java = ju.GetDefaultJava();
|
java = ju.GetDefaultJava();
|
||||||
}
|
}
|
||||||
if (java)
|
if (java)
|
||||||
|
{
|
||||||
MMC->settings()->set("JavaPath", java->path);
|
MMC->settings()->set("JavaPath", java->path);
|
||||||
|
MMC->settings()->set("JavaDetectionHack", javaHack);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
MMC->settings()->set("JavaPath", QString("java"));
|
MMC->settings()->set("JavaPath", QString("java"));
|
||||||
}
|
}
|
||||||
@@ -1600,3 +1629,5 @@ void MainWindow::on_actionScreenshots_triggered()
|
|||||||
QMessageBox::Information)->exec();
|
QMessageBox::Information)->exec();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -133,24 +133,37 @@ bool ForgeInstaller::add(OneSixInstance *to)
|
|||||||
int sliding_insert_window = 0;
|
int sliding_insert_window = 0;
|
||||||
{
|
{
|
||||||
QJsonArray librariesPlus;
|
QJsonArray librariesPlus;
|
||||||
|
// A blacklist - we ignore these entirely
|
||||||
// for each library in the version we are adding (except for the blacklisted)
|
|
||||||
QSet<QString> blacklist{"lwjgl", "lwjgl_util", "lwjgl-platform"};
|
QSet<QString> blacklist{"lwjgl", "lwjgl_util", "lwjgl-platform"};
|
||||||
|
QList<QString> xzlist{"org.scala-lang", "com.typesafe"};
|
||||||
|
// for each library in the version we are adding (except for the blacklisted)
|
||||||
for (auto lib : m_forge_version->libraries)
|
for (auto lib : m_forge_version->libraries)
|
||||||
{
|
{
|
||||||
QString libName = lib->name();
|
QString libName = lib->name();
|
||||||
|
QString rawName = lib->rawName();
|
||||||
|
|
||||||
|
// ignore blacklisted stuff
|
||||||
|
if (blacklist.contains(libName))
|
||||||
|
continue;
|
||||||
|
|
||||||
// WARNING: This could actually break.
|
// WARNING: This could actually break.
|
||||||
// if this is the actual forge lib, set an absolute url for the download
|
// if this is the actual forge lib, set an absolute url for the download
|
||||||
if (libName.contains("minecraftforge"))
|
if (libName.contains("minecraftforge"))
|
||||||
{
|
{
|
||||||
lib->setAbsoluteUrl(m_universal_url);
|
lib->setAbsoluteUrl(m_universal_url);
|
||||||
}
|
}
|
||||||
else if (libName.contains("scala"))
|
|
||||||
|
// WARNING: This could actually break.
|
||||||
|
// mark bad libraries based on the xzlist above
|
||||||
|
for(auto entry : xzlist)
|
||||||
|
{
|
||||||
|
QLOG_DEBUG() << "Testing " << rawName << " : " << entry;
|
||||||
|
if(rawName.startsWith(entry))
|
||||||
{
|
{
|
||||||
lib->setHint("forge-pack-xz");
|
lib->setHint("forge-pack-xz");
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (blacklist.contains(libName))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
QJsonObject libObj = lib->toJson();
|
QJsonObject libObj = lib->toJson();
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ QList<JavaVersionPtr> JavaUtils::FindJavaFromRegistryKey(DWORD keyType, QString
|
|||||||
javaVersion->id = subKeyName;
|
javaVersion->id = subKeyName;
|
||||||
javaVersion->arch = archType;
|
javaVersion->arch = archType;
|
||||||
javaVersion->path =
|
javaVersion->path =
|
||||||
QDir(PathCombine(value, "bin")).absoluteFilePath("java.exe");
|
QDir(PathCombine(value, "bin")).absoluteFilePath("javaw.exe");
|
||||||
javas.append(javaVersion);
|
javas.append(javaVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -154,12 +154,12 @@ QList<QString> JavaUtils::FindJavaPaths()
|
|||||||
KEY_WOW64_32KEY, "SOFTWARE\\JavaSoft\\Java Development Kit");
|
KEY_WOW64_32KEY, "SOFTWARE\\JavaSoft\\Java Development Kit");
|
||||||
|
|
||||||
java_candidates.append(JRE64s);
|
java_candidates.append(JRE64s);
|
||||||
java_candidates.append(MakeJavaPtr("C:/Program Files/Java/jre7/bin/java.exe"));
|
java_candidates.append(MakeJavaPtr("C:/Program Files/Java/jre7/bin/javaw.exe"));
|
||||||
java_candidates.append(MakeJavaPtr("C:/Program Files/Java/jre6/bin/java.exe"));
|
java_candidates.append(MakeJavaPtr("C:/Program Files/Java/jre6/bin/javaw.exe"));
|
||||||
java_candidates.append(JDK64s);
|
java_candidates.append(JDK64s);
|
||||||
java_candidates.append(JRE32s);
|
java_candidates.append(JRE32s);
|
||||||
java_candidates.append(MakeJavaPtr("C:/Program Files (x86)/Java/jre7/bin/java.exe"));
|
java_candidates.append(MakeJavaPtr("C:/Program Files (x86)/Java/jre7/bin/javaw.exe"));
|
||||||
java_candidates.append(MakeJavaPtr("C:/Program Files (x86)/Java/jre6/bin/java.exe"));
|
java_candidates.append(MakeJavaPtr("C:/Program Files (x86)/Java/jre6/bin/javaw.exe"));
|
||||||
java_candidates.append(JDK32s);
|
java_candidates.append(JDK32s);
|
||||||
java_candidates.append(MakeJavaPtr(this->GetDefaultJava()->path));
|
java_candidates.append(MakeJavaPtr(this->GetDefaultJava()->path));
|
||||||
|
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ QVariant ForgeVersionList::data(const QModelIndex &index, int role) const
|
|||||||
return version->name();
|
return version->name();
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
return version->mcver;
|
return version->mcver_sane;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
return version->typeString();
|
return version->typeString();
|
||||||
@@ -281,7 +281,7 @@ bool ForgeListLoadTask::parseForgeList(QList<BaseVersionPtr> &out)
|
|||||||
fVersion->changelog_url = changelog_url;
|
fVersion->changelog_url = changelog_url;
|
||||||
fVersion->installer_url = installer_url;
|
fVersion->installer_url = installer_url;
|
||||||
fVersion->jobbuildver = jobbuildver;
|
fVersion->jobbuildver = jobbuildver;
|
||||||
fVersion->mcver = mcver;
|
fVersion->mcver = fVersion->mcver_sane = mcver;
|
||||||
if (installer_filename.isEmpty())
|
if (installer_filename.isEmpty())
|
||||||
{
|
{
|
||||||
fVersion->filename = filename;
|
fVersion->filename = filename;
|
||||||
@@ -341,9 +341,16 @@ bool ForgeListLoadTask::parseForgeGradleList(QList<BaseVersionPtr> &out)
|
|||||||
std::shared_ptr<ForgeVersion> fVersion(new ForgeVersion());
|
std::shared_ptr<ForgeVersion> fVersion(new ForgeVersion());
|
||||||
fVersion->m_buildnr = number.value("build").toDouble();
|
fVersion->m_buildnr = number.value("build").toDouble();
|
||||||
fVersion->jobbuildver = number.value("version").toString();
|
fVersion->jobbuildver = number.value("version").toString();
|
||||||
|
fVersion->branch = number.value("branch").toString("");
|
||||||
fVersion->mcver = number.value("mcversion").toString();
|
fVersion->mcver = number.value("mcversion").toString();
|
||||||
|
// HACK: here, we fix the minecraft version used by forge.
|
||||||
|
// HACK: this will inevitably break (later)
|
||||||
|
// FIXME: replace with a dictionary
|
||||||
|
fVersion->mcver_sane = fVersion->mcver;
|
||||||
|
fVersion->mcver_sane.replace("_pre", "-pre");
|
||||||
fVersion->filename = "";
|
fVersion->filename = "";
|
||||||
QString filename, installer_filename;
|
|
||||||
|
QString universal_filename, installer_filename;
|
||||||
QJsonArray files = number.value("files").toArray();
|
QJsonArray files = number.value("files").toArray();
|
||||||
for (auto fIt = files.begin(); fIt != files.end(); ++fIt)
|
for (auto fIt = files.begin(); fIt != files.end(); ++fIt)
|
||||||
{
|
{
|
||||||
@@ -353,37 +360,46 @@ bool ForgeListLoadTask::parseForgeGradleList(QList<BaseVersionPtr> &out)
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (file.at(1).toString() == "installer")
|
|
||||||
|
QString extension = file.at(0).toString();
|
||||||
|
QString part = file.at(1).toString();
|
||||||
|
QString checksum = file.at(2).toString();
|
||||||
|
|
||||||
|
// insane form of mcver is used here
|
||||||
|
QString longVersion = fVersion->mcver + "-" + fVersion->jobbuildver;
|
||||||
|
if (!fVersion->branch.isEmpty())
|
||||||
{
|
{
|
||||||
fVersion->installer_url = QString("%1/%2-%3/%4-%2-%3-installer.%5").arg(
|
longVersion = longVersion + "-" + fVersion->branch;
|
||||||
webpath, fVersion->mcver, fVersion->jobbuildver, artifact,
|
|
||||||
file.at(0).toString());
|
|
||||||
installer_filename = QString("%1-%2-%3-installer.%4").arg(
|
|
||||||
artifact, fVersion->mcver, fVersion->jobbuildver, file.at(0).toString());
|
|
||||||
}
|
}
|
||||||
else if (file.at(1).toString() == "universal")
|
QString filename = artifact + "-" + longVersion + "-" + part + "." + extension;
|
||||||
|
|
||||||
|
QString url = QString("%1/%2/%3")
|
||||||
|
.arg(webpath)
|
||||||
|
.arg(longVersion)
|
||||||
|
.arg(filename);
|
||||||
|
|
||||||
|
if (part == "installer")
|
||||||
{
|
{
|
||||||
fVersion->universal_url = QString("%1/%2-%3/%4-%2-%3-universal.%5").arg(
|
fVersion->installer_url = url;
|
||||||
webpath, fVersion->mcver, fVersion->jobbuildver, artifact,
|
installer_filename = filename;
|
||||||
file.at(0).toString());
|
|
||||||
filename = QString("%1-%2-%3-universal.%4").arg(
|
|
||||||
artifact, fVersion->mcver, fVersion->jobbuildver, file.at(0).toString());
|
|
||||||
}
|
}
|
||||||
else if (file.at(1).toString() == "changelog")
|
else if (part == "universal")
|
||||||
{
|
{
|
||||||
fVersion->changelog_url = QString("%1/%2-%3/%4-%2-%3-changelog.%5").arg(
|
fVersion->universal_url = url;
|
||||||
webpath, fVersion->mcver, fVersion->jobbuildver, artifact,
|
universal_filename = filename;
|
||||||
file.at(0).toString());
|
}
|
||||||
|
else if (part == "changelog")
|
||||||
|
{
|
||||||
|
fVersion->changelog_url = url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fVersion->installer_url.isEmpty() && fVersion->universal_url.isEmpty())
|
if (fVersion->installer_url.isEmpty() && fVersion->universal_url.isEmpty())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
fVersion->filename = fVersion->installer_url.isEmpty() ? filename : installer_filename;
|
fVersion->filename = fVersion->installer_url.isEmpty() ? universal_filename : installer_filename;
|
||||||
out.append(fVersion);
|
out.append(fVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,6 +68,8 @@ struct ForgeVersion : public BaseVersion
|
|||||||
QString jobbuildver;
|
QString jobbuildver;
|
||||||
QString mcver;
|
QString mcver;
|
||||||
QString filename;
|
QString filename;
|
||||||
|
QString branch;
|
||||||
|
QString mcver_sane;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ForgeVersionList : public BaseVersionList
|
class ForgeVersionList : public BaseVersionList
|
||||||
|
|||||||
Reference in New Issue
Block a user