Skip to content

Commit

Permalink
change doc links, add section abt getChildOfType
Browse files Browse the repository at this point in the history
  • Loading branch information
matcool authored Nov 23, 2024
1 parent f550db3 commit ef2cf74
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tutorials/migrate-v4.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Migrating from Geode v3.x to v4.0

## Changes to `Result`
[Link to the full docs](https://github.com/geode-sdk/result?tab=readme-ov-file#result)
* Result type has been rewritten from scratch, and it is now shared with many parts of the Geode codebase (Geode itself, TulipHook and matjson).
* Many methods removed or renamed:
* `value()` -> `unwrap()`
Expand Down Expand Up @@ -56,8 +57,14 @@ static Result<std::shared_ptr<SettingV3>> parse(std::string const&, std::string
* No longer in cocos2d namespace
* Can now be found in `Geode/ui/Layout.hpp`
## Changes to `getChildOfType`
* Deprecated in 3.9.0, and now removed, use `CCNode::getChildByType<T>(int index)` instead:
* `getChildOfType<CCLayer>(node, 1)` -> `node->getChildByType<CCLayer*>(1)`
* You can use this regex pattern to quickly find and replace:
* `getChildOfType<(.+?)>\((.+?),\s*(.+?)\)` and replace with `$2->getChildByType<$1>($3)`
## Changes to `matjson`
[Link to the full docs](https://github.com/geode-sdk/json)
[Link to the full docs](https://github.com/geode-sdk/json?tab=readme-ov-file#matjson)
* Entire library rewritten to use `geode::Result`
* See result section for tips on how to use Geode's Result class
* Methods are now camel case to fit with rest of Geode's codebase
Expand Down

0 comments on commit ef2cf74

Please sign in to comment.