fix: don't show outdated if wantsRestart

This commit is contained in:
Fleeym 2024-11-13 00:20:49 +02:00
parent df2528c8a5
commit 0b2fc66a89

View file

@ -434,17 +434,25 @@ void ModItem::updateState() {
LoadProblem problem = opt.value(); LoadProblem problem = opt.value();
m_bg->setColor("mod-list-outdated-label"_cc3b); m_bg->setColor("mod-list-outdated-label"_cc3b);
m_bg->setOpacity(isGeodeTheme() ? 25 : 90); m_bg->setOpacity(isGeodeTheme() ? 25 : 90);
std::string content; if (!wantsRestart) {
if ( std::string content;
problem.type == LoadProblem::Type::UnsupportedGeodeVersion || if (
problem.type == LoadProblem::Type::NeedsNewerGeodeVersion problem.type == LoadProblem::Type::UnsupportedGeodeVersion ||
) { problem.type == LoadProblem::Type::NeedsNewerGeodeVersion
content = fmt::format("Outdated (Geode {})", m_source.getMetadata().getGeodeVersion().toNonVString()); ) {
} else { content = fmt::format(
content = fmt::format("Outdated (GD {})", m_source.getMetadata().getGameVersion().value_or("*")); "Outdated (Geode {})",
m_source.getMetadata().getGeodeVersion().toNonVString()
);
} else {
content = fmt::format(
"Outdated (GD {})",
m_source.getMetadata().getGameVersion().value_or("*")
);
}
m_outdatedLabel->setString(content.c_str());
m_outdatedLabel->setVisible(true);
} }
m_outdatedLabel->setString(content.c_str());
m_outdatedLabel->setVisible(true);
m_developers->setVisible(false); m_developers->setVisible(false);
} }
} }