Migrating from Geode v3.x to v4.0

Changes to Result

Link to the full docs

Changes to the Geode Settings API

static Result<std::shared_ptr<MyCustomSettingV3>> parse(std::string const&, std::string const&, matjson::Value const& json) {
   auto res = std::make_shared<MyCustomSettingV3>();
   auto root = checkJson(json, "MyCustomSettingV3");
   // ... some code here ...
   return root.ok(res);
}
// should now be:
//                            ↓ here
static Result<std::shared_ptr<SettingV3>> parse(std::string const&, std::string const&, matjson::Value const& json) {
   auto res = std::make_shared<MyCustomSettingV3>();
   auto root = checkJson(json, "MyCustomSettingV3");
   // ... some code here ...
   //             ↓ here
   return root.ok(std::static_pointer_cast<SettingV3>(res));
}

Changes to utils::MiniFunction

Changes to geode::Layout

Changes to getChildOfType

Changes to matjson

Link to the full docs

Changes to JsonChecker / JsonExpectedValue

auto checker = JsonChecker(json);
auto root = checker.root("[file.json]").obj();

// ... code

if (checker.isError()) {
    return Err(checker.getError());
}

is now

auto root = checkJson(json, "[file.json]")

// ... code

GEODE_UNWRAP(root.ok());