add setIDs overload for automatically incrementing current node ID index

This commit is contained in:
HJfod 2024-02-16 01:29:23 +02:00
parent 264f773e80
commit f140e67bef

View file

@ -30,6 +30,15 @@ namespace geode::node_ids {
}
}
template <typename ...Args>
void setIDs(CCNode* node, int* startIndex, Args... args) {
for (auto i : { args... }) {
if (setIDSafe(node, *startIndex, i)) {
*startIndex += 1;
}
}
}
static void switchToMenu(CCNode* node, CCNode* menu) {
if (!node || !menu) return;