Documentation Index
Fetch the complete documentation index at: https://mintlify.com/geode-sdk/docs/llms.txt
Use this file to discover all available pages before exploring further.
Migrating from Geode v3.x to v4.0
Changes to Result
Link to the full docs
Result type has been rewritten from scratch, and it is now shared with many parts of the Geode codebase (Geode itself, TulipHook and matjson).
Method changes
value()→unwrap()expect(str, fmt args...)→ UsemapErralong withfmt::format- Snake case methods renamed to camel case
Universal unwrap macros
GEODE_UNWRAP(res) and GEODE_UNWRAP_INTO(value, res) macros can help a lot when dealing with results:
Changes to the Geode Settings API
Settings v2 has been removed, V3 suffix from classes are now aliased. Most SettingV3 code should work fine, with the exception of some Result usages:Changes to utils::MiniFunction
Removed, use std::function now.
Changes to geode::Layout
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)
Changes to matjson
Link to the full docs
Result integration
Entire library rewritten to usegeode::Result. See result section for tips on how to use Geode’s Result class.
Method naming
Methods are now camel case to fit with rest of Geode’s codebase:is_string→isStringas_string→asString- etc.
Iteration
matjson::Object has been removed, now you can just iterate directly off a Value (same for arrays!):
Object creation
Usematjson::makeObject for making objects inline now:
Missing properties
Accessing missing properties withValue::operator[] will now return a null value instead of throwing an exception.
Serialization
Serialization methods have been changed:T from_json(matjson::Value const&)→Result<T> fromJson(matjson::Value const&)- Make sure to return a Result! Much of the code relies on
fromJsonreturning a Result.
- Make sure to return a Result! Much of the code relies on
matjson::Value to_json(T const& value)→matjson::Value toJson(T const& value)is_jsonis no longer used, instead just return an error infromJson
Other changes
bool Value::is<T>()removed#include <matjson/stl_serialize.hpp>→#include <matjson/std.hpp>- Added new experimental
<matjson/reflect.hpp>header, uses qlibs/reflect to (de)serialize aggregate structs- Behavior might change in the future, so use with caution
Changes to JsonChecker / JsonExpectedValue
The JsonChecker class was previously marked deprecated, and is now removed. Now you should move to using JsonExpectedValue instead:
JsonChecker::has has different behavior to JsonExpectedValue::has, use JsonExpectedValue::hasNullable to keep old behavior with null values.