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);
if (!wantsRestart) {
std::string content; std::string content;
if ( if (
problem.type == LoadProblem::Type::UnsupportedGeodeVersion || problem.type == LoadProblem::Type::UnsupportedGeodeVersion ||
problem.type == LoadProblem::Type::NeedsNewerGeodeVersion problem.type == LoadProblem::Type::NeedsNewerGeodeVersion
) { ) {
content = fmt::format("Outdated (Geode {})", m_source.getMetadata().getGeodeVersion().toNonVString()); content = fmt::format(
"Outdated (Geode {})",
m_source.getMetadata().getGeodeVersion().toNonVString()
);
} else { } else {
content = fmt::format("Outdated (GD {})", m_source.getMetadata().getGameVersion().value_or("*")); content = fmt::format(
"Outdated (GD {})",
m_source.getMetadata().getGameVersion().value_or("*")
);
} }
m_outdatedLabel->setString(content.c_str()); m_outdatedLabel->setString(content.c_str());
m_outdatedLabel->setVisible(true); m_outdatedLabel->setVisible(true);
}
m_developers->setVisible(false); m_developers->setVisible(false);
} }
} }