mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-14 19:15:05 -05:00
hacky temporary fix for mods with old gd key syntax
This commit is contained in:
parent
84a2c6bc42
commit
c1fbc08381
3 changed files with 18 additions and 0 deletions
|
@ -440,6 +440,18 @@ void Loader::Impl::loadModGraph(Mod* node, bool early) {
|
|||
};
|
||||
|
||||
{ // version checking
|
||||
if (auto reason = node->getMetadata().m_impl->m_softInvalidReason) {
|
||||
this->addProblem({
|
||||
LoadProblem::Type::InvalidFile,
|
||||
node,
|
||||
reason.value()
|
||||
});
|
||||
log::error("{}", reason.value());
|
||||
m_refreshingModCount -= 1;
|
||||
log::popNest();
|
||||
return;
|
||||
}
|
||||
|
||||
auto res = node->getMetadata().checkGameVersion();
|
||||
if (!res) {
|
||||
this->addProblem({
|
||||
|
|
|
@ -138,6 +138,9 @@ Result<ModMetadata> ModMetadata::Impl::createFromSchemaV010(ModJson const& rawJs
|
|||
auto key = PlatformID::toShortString(GEODE_PLATFORM_TARGET, true);
|
||||
if (rawJson["gd"].contains(key) && rawJson["gd"][key].is_string())
|
||||
ver = rawJson["gd"][key].as_string();
|
||||
} else if (rawJson["gd"].is_string()) {
|
||||
impl->m_softInvalidReason = "mod.json uses old syntax";
|
||||
goto dontCheckVersion;
|
||||
} else {
|
||||
return Err("[mod.json] has invalid target GD version");
|
||||
}
|
||||
|
@ -158,6 +161,7 @@ Result<ModMetadata> ModMetadata::Impl::createFromSchemaV010(ModJson const& rawJs
|
|||
} else {
|
||||
return Err("[mod.json] is missing target GD version");
|
||||
}
|
||||
dontCheckVersion:
|
||||
|
||||
root.needs("id")
|
||||
// todo: make this use validateID in full 2.0.0 release
|
||||
|
|
|
@ -23,6 +23,8 @@ namespace geode {
|
|||
std::string m_id;
|
||||
std::string m_name;
|
||||
std::vector<std::string> m_developers;
|
||||
// TODO: remove once #895 is fixed
|
||||
std::optional<std::string> m_softInvalidReason;
|
||||
std::string m_gdVersion;
|
||||
VersionInfo m_geodeVersion;
|
||||
std::optional<std::string> m_description;
|
||||
|
|
Loading…
Reference in a new issue