diff --git a/changelog.md b/changelog.md index 55db7d8..8a2dace 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,6 @@ +## 1.8.3 +- Fix loading individual sprites from init + ## 1.8.2 - Fix some layouting issues - Fix duplicated node modifications for certain layers diff --git a/mod.json b/mod.json index ae58b0c..a4b90bc 100644 --- a/mod.json +++ b/mod.json @@ -5,7 +5,7 @@ "android": "2.2074", "mac": "2.2074" }, - "version": "v1.8.2", + "version": "v1.8.3", "id": "alphalaneous.happy_textures", "name": "Happy Textures :3", "developer": "Alphalaneous", diff --git a/src/nodes/CCSprite.h b/src/nodes/CCSprite.h index 380dcd6..b560699 100644 --- a/src/nodes/CCSprite.h +++ b/src/nodes/CCSprite.h @@ -7,10 +7,10 @@ class $modify(MyCCSprite, CCSprite) { static void onModify(auto& self) { - (void) self.setHookPriority("cocos2d::CCSprite::createWithSpriteFrameName", Priority::VeryEarly); + (void) self.setHookPriority("cocos2d::CCSprite::initWithSpriteFrameName", Priority::VeryEarly); } - static CCSprite* createWithSpriteFrameName(const char *pszSpriteFrameName) { + bool initWithSpriteFrameName(const char *pszSpriteFrameName) { if (Utils::spriteExistsInPacks(pszSpriteFrameName)) { CCSprite* spr = CCSprite::create(pszSpriteFrameName); @@ -18,6 +18,6 @@ class $modify(MyCCSprite, CCSprite) { CCSpriteFrameCache::get()->addSpriteFrame(spriteFrame, pszSpriteFrameName); } - return CCSprite::createWithSpriteFrameName(pszSpriteFrameName); + return CCSprite::initWithSpriteFrameName(pszSpriteFrameName); } };