Merge pull request #3833 from jamierocks/disable-forge-btn-when-game-running
NOISSUE Disable 'Install Forge' button when game is running
This commit is contained in:
commit
9fafe3ffe6
@ -238,6 +238,7 @@ void InstanceImportTask::processFlame()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QString forgeVersion;
|
QString forgeVersion;
|
||||||
|
QString fabricVersion;
|
||||||
for(auto &loader: pack.minecraft.modLoaders)
|
for(auto &loader: pack.minecraft.modLoaders)
|
||||||
{
|
{
|
||||||
auto id = loader.id;
|
auto id = loader.id;
|
||||||
@ -247,6 +248,12 @@ void InstanceImportTask::processFlame()
|
|||||||
forgeVersion = id;
|
forgeVersion = id;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if(id.startsWith("fabric-"))
|
||||||
|
{
|
||||||
|
id.remove("fabric-");
|
||||||
|
fabricVersion = id;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
logWarning(tr("Unknown mod loader in manifest: %1").arg(id));
|
logWarning(tr("Unknown mod loader in manifest: %1").arg(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -281,6 +288,10 @@ void InstanceImportTask::processFlame()
|
|||||||
}
|
}
|
||||||
components->setComponentVersion("net.minecraftforge", forgeVersion);
|
components->setComponentVersion("net.minecraftforge", forgeVersion);
|
||||||
}
|
}
|
||||||
|
if(!fabricVersion.isEmpty())
|
||||||
|
{
|
||||||
|
components->setComponentVersion("net.fabricmc.fabric-loader", fabricVersion);
|
||||||
|
}
|
||||||
if (m_instIcon != "default")
|
if (m_instIcon != "default")
|
||||||
{
|
{
|
||||||
instance.setIconKey(m_instIcon);
|
instance.setIconKey(m_instIcon);
|
||||||
|
@ -109,12 +109,7 @@ void PackInstallTask::downloadPack()
|
|||||||
connect(jobPtr.get(), &NetJob::failed, [&](QString reason)
|
connect(jobPtr.get(), &NetJob::failed, [&](QString reason)
|
||||||
{
|
{
|
||||||
jobPtr.reset();
|
jobPtr.reset();
|
||||||
|
emitFailed(reason);
|
||||||
// FIXME: Temporarily ignore file download failures (matching FTB's installer),
|
|
||||||
// while FTB's data is fucked.
|
|
||||||
qWarning() << "Failed to download files for modpack: " + reason;
|
|
||||||
|
|
||||||
install();
|
|
||||||
});
|
});
|
||||||
connect(jobPtr.get(), &NetJob::progress, [&](qint64 current, qint64 total)
|
connect(jobPtr.get(), &NetJob::progress, [&](qint64 current, qint64 total)
|
||||||
{
|
{
|
||||||
|
@ -203,11 +203,11 @@ void VersionPage::updateVersionControls()
|
|||||||
{
|
{
|
||||||
// FIXME: this is a dirty hack
|
// FIXME: this is a dirty hack
|
||||||
auto minecraftVersion = Version(m_profile->getComponentVersion("net.minecraft"));
|
auto minecraftVersion = Version(m_profile->getComponentVersion("net.minecraft"));
|
||||||
bool newCraft = controlsEnabled && (minecraftVersion >= Version("1.14"));
|
bool newCraft = minecraftVersion >= Version("1.14");
|
||||||
bool oldCraft = controlsEnabled && (minecraftVersion <= Version("1.12.2"));
|
bool oldCraft = minecraftVersion <= Version("1.12.2");
|
||||||
ui->actionInstall_Fabric->setEnabled(newCraft);
|
ui->actionInstall_Fabric->setEnabled(controlsEnabled && newCraft);
|
||||||
ui->actionInstall_Forge->setEnabled(true);
|
ui->actionInstall_Forge->setEnabled(controlsEnabled);
|
||||||
ui->actionInstall_LiteLoader->setEnabled(oldCraft);
|
ui->actionInstall_LiteLoader->setEnabled(controlsEnabled && oldCraft);
|
||||||
ui->actionReload->setEnabled(true);
|
ui->actionReload->setEnabled(true);
|
||||||
updateButtons();
|
updateButtons();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user