Merge pull request #860 from kthchew/fix/status-version

Show MC version of instance in status bar
This commit is contained in:
Ezekiel Smith 2022-07-03 01:47:27 +10:00 committed by GitHub
commit e32030f364
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -826,8 +826,16 @@ QString MinecraftInstance::getStatusbarDescription()
traits.append(tr("broken")); traits.append(tr("broken"));
} }
QString mcVersion = m_components->getComponentVersion("net.minecraft");
if (mcVersion.isEmpty())
{
// Load component info if needed
m_components->reload(Net::Mode::Offline);
mcVersion = m_components->getComponentVersion("net.minecraft");
}
QString description; QString description;
description.append(tr("Minecraft %1 (%2)").arg(m_components->getComponentVersion("net.minecraft")).arg(typeName())); description.append(tr("Minecraft %1").arg(mcVersion));
if(m_settings->get("ShowGameTime").toBool()) if(m_settings->get("ShowGameTime").toBool())
{ {
if (lastTimePlayed() > 0) { if (lastTimePlayed() > 0) {