Skip to content

Commit ffd8e53

Browse files
authored
settings migration
1 parent 275fcfd commit ffd8e53

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

tutorials/migrate-v4.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,27 @@
2121

2222
## Changes to the Geode Settings API
2323
* Settings v2 has been removed, V3 suffix from classes are now aliased
24-
* Code that already used SettingsV3 should still work
24+
* Most SettingV3 code should work fine, with the exception of some Result usages:
25+
```cpp
26+
static Result<std::shared_ptr<MyCustomSettingV3>> parse(std::string const&, std::string const&, matjson::Value const& json) {
27+
auto res = std::make_shared<MyCustomSettingV3>();
28+
auto root = checkJson(json, "MyCustomSettingV3");
29+
// ... some code here ...
30+
return root.ok(res);
31+
}
32+
// should now be:
33+
// ↓ here
34+
static Result<std::shared_ptr<SettingV3>> parse(std::string const&, std::string const&, matjson::Value const& json) {
35+
auto res = std::make_shared<MyCustomSettingV3>();
36+
auto root = checkJson(json, "MyCustomSettingV3");
37+
// ... some code here ...
38+
// ↓ here
39+
return root.ok(std::static_pointer_cast<SettingV3>(res));
40+
}
41+
```
42+
43+
## Changes to `utils::MiniFunction`
44+
* Removed, use `std::function` now
2545
2646
## Changes to `geode::Layout`
2747
* No longer in cocos2d namespace

0 commit comments

Comments
 (0)