fix: write it a bit better
Some checks are pending
Build Binaries / Build Windows (push) Waiting to run
Build Binaries / Build macOS (push) Waiting to run
Build Binaries / Build Android (64-bit) (push) Waiting to run
Build Binaries / Build Android (32-bit) (push) Waiting to run
Build Binaries / Publish (push) Blocked by required conditions

This commit is contained in:
Fleeym 2024-11-13 00:24:01 +02:00
parent 0b2fc66a89
commit f96ea5e727

View file

@ -426,33 +426,32 @@ void ModItem::updateState() {
// If there were problems, tint the BG red // If there were problems, tint the BG red
m_outdatedLabel->setVisible(false); m_outdatedLabel->setVisible(false);
if (m_source.asMod()) { if (m_source.asMod()) {
std::optional<LoadProblem> targetsOutdated = m_source.asMod()->targetsOutdatedVersion();
if (m_source.asMod()->hasLoadProblems()) { if (m_source.asMod()->hasLoadProblems()) {
m_bg->setColor("mod-list-errors-found"_cc3b); m_bg->setColor("mod-list-errors-found"_cc3b);
m_bg->setOpacity(isGeodeTheme() ? 25 : 90); m_bg->setOpacity(isGeodeTheme() ? 25 : 90);
} }
if (std::optional<LoadProblem> opt = m_source.asMod()->targetsOutdatedVersion()) { if (!wantsRestart && targetsOutdated) {
LoadProblem problem = opt.value(); LoadProblem problem = targetsOutdated.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(
content = fmt::format( "Outdated (Geode {})",
"Outdated (Geode {})", m_source.getMetadata().getGeodeVersion().toNonVString()
m_source.getMetadata().getGeodeVersion().toNonVString() );
); } else {
} else { content = fmt::format(
content = fmt::format( "Outdated (GD {})",
"Outdated (GD {})", m_source.getMetadata().getGameVersion().value_or("*")
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);
} }
} }