MCPcopy Create free account
hub / github.com/PolyMC/PolyMC / updateVersionControls

Method updateVersionControls

launcher/ui/pages/instance/VersionPage.cpp:236–256  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236void VersionPage::updateVersionControls()
237{
238 // FIXME: this is a dirty hack
239 auto minecraftVersion = Version(m_profile->getComponentVersion("net.minecraft"));
240
241 ui->actionInstall_Forge->setEnabled(controlsEnabled);
242
243 bool supportsNeoForge = minecraftVersion >= Version("1.20.1");
244 ui->actionInstall_NeoForge->setEnabled(controlsEnabled && supportsNeoForge);
245
246 bool supportsFabric = minecraftVersion >= Version("1.14");
247 ui->actionInstall_Fabric->setEnabled(controlsEnabled && supportsFabric);
248
249 bool supportsQuilt = minecraftVersion >= Version("1.14");
250 ui->actionInstall_Quilt->setEnabled(controlsEnabled && supportsQuilt);
251
252 bool supportsLiteLoader = minecraftVersion <= Version("1.12.2");
253 ui->actionInstall_LiteLoader->setEnabled(controlsEnabled && supportsLiteLoader);
254
255 updateButtons();
256}
257
258void VersionPage::updateButtons(int row)
259{

Callers

nothing calls this directly

Calls 3

getComponentVersionMethod · 0.80
setEnabledMethod · 0.80
VersionClass · 0.50

Tested by

no test coverage detected