Skip to content

Commit e346f6d

Browse files
committed
Fix node
1 parent 8224aa9 commit e346f6d

File tree

5 files changed

+23
-5
lines changed

5 files changed

+23
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Miscellaneous Geode utils to make development easier:
77
Familiar modify syntax as Geode, supporting fields. `class $objectModify(SomeObject)` or `class $nodeModify(SomeNode)`
88
You can name the modified node/object the same way as well `class $objectModify(MySomeObject, SomeObject)` or `class $nodeModify(MySomeNode, SomeNode)`
99

10-
$nodeModify and $objectModify do the same thing, but both names are available for organization purposes.
10+
$nodeModify and $objectModify do the same thing, except $nodeModify is a base of CCNode while $objectModify is a base of CCObject
1111

1212
To use this, you will create a `void modify()` method within that class and inside of there you can change the node to your hearts content. You can use the fields struct just like in Geode to add fields if needed.
1313

about.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Miscellaneous Geode utils to make development easier:
77
Familiar modify syntax as Geode, supporting fields. `class $objectModify(SomeObject)` or `class $nodeModify(SomeNode)`
88
You can name the modified node/object the same way as well `class $objectModify(MySomeObject, SomeObject)` or `class $nodeModify(MySomeNode, SomeNode)`
99

10-
$nodeModify and $objectModify do the same thing, but both names are available for organization purposes.
10+
$nodeModify and $objectModify do the same thing, except $nodeModify is a base of CCNode while $objectModify is a base of CCObject
1111

1212
To use this, you will create a `void modify()` method within that class and inside of there you can change the node to your hearts content. You can use the fields struct just like in Geode to add fields if needed.
1313

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 1.1.1
2+
- Separate Node and Object modify macros
3+
- $nodeModify now has a base class of CCNode
4+
- $objectModify has a base class of CCObject
5+
16
# 1.1.0
27
- Fields and User Objects can now be used with CCObjects in the same way as CCNodes
38

include/NodeModding.h

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,23 @@ class GEODE_CONCAT(GEODE_CONCAT(derived, Hook), __LINE__) : AlphaUtils::ObjectWr
9696
};\
9797
struct derived : AlphaUtils::ObjectWrapper<derived>
9898

99+
#define ALPHA_NODE_MODIFY_DECLARE(base, derived) \
100+
GEODE_CONCAT(GEODE_CONCAT(derived, __LINE__), Dummy);\
101+
struct derived;\
102+
class GEODE_CONCAT(GEODE_CONCAT(derived, Hook), __LINE__) : AlphaUtils::NodeWrapper<derived> {\
103+
private:\
104+
static inline AlphaUtils::ModifyObjectLoad<derived> s_apply{#base};\
105+
};\
106+
struct derived : AlphaUtils::NodeWrapper<derived>
107+
99108
#define MODIFY1(base) ALPHA_MODIFY_DECLARE(base, GEODE_CONCAT(hook, __LINE__))
100109
#define MODIFY2(derived, base) ALPHA_MODIFY_DECLARE(base, derived)
101110

111+
#define MODIFYNODE1(base) ALPHA_NODE_MODIFY_DECLARE(base, GEODE_CONCAT(hook, __LINE__))
112+
#define MODIFYNODE2(derived, base) ALPHA_NODE_MODIFY_DECLARE(base, derived)
113+
102114
#define $nodeModify(...) \
103-
GEODE_INVOKE(GEODE_CONCAT(MODIFY, GEODE_NUMBER_OF_ARGS(__VA_ARGS__)), __VA_ARGS__)
115+
GEODE_INVOKE(GEODE_CONCAT(MODIFYNODE, GEODE_NUMBER_OF_ARGS(__VA_ARGS__)), __VA_ARGS__)
104116

105-
#define $objectModify(...) $nodeModify(__VA_ARGS__)
117+
#define $objectModify(...) \
118+
GEODE_INVOKE(GEODE_CONCAT(MODIFY, GEODE_NUMBER_OF_ARGS(__VA_ARGS__)), __VA_ARGS__)

mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"id": "alphalaneous.alphas_geode_utils",
1010
"name": "Alpha's Geode Utils",
11-
"version": "v1.1.0",
11+
"version": "v1.1.1",
1212
"developer": "Alphalaneous",
1313
"description": "Miscellaneous utilities for Geode Modding",
1414
"api": {

0 commit comments

Comments
 (0)