Skip to content

Commit 6a06e8c

Browse files
committed
CurrencyRewardLayer, CurrencySprite, and EndLevelLayer
1 parent 0e4057b commit 6a06e8c

2 files changed

Lines changed: 71 additions & 24 deletions

File tree

bindings/2.2074/GeometryDash.bro

Lines changed: 67 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3926,14 +3926,14 @@ class CurrencyRewardLayer : cocos2d::CCLayer {
39263926
// virtual ~CurrencyRewardLayer();
39273927
// CurrencyRewardLayer();
39283928

3929-
static CurrencyRewardLayer* create(int orbs, int stars, int moons, int diamonds, CurrencySpriteType demonKey, int keyCount, CurrencySpriteType shardType, int shardsCount, cocos2d::CCPoint position, CurrencyRewardType rewardType, float, float time) = win 0x9f500, imac 0x78ff00, m1 0x6a36f8, ios 0x31e9b4;
3929+
static CurrencyRewardLayer* create(int orbs, int stars, int moons, int diamonds, CurrencySpriteType demonKey, int keyCount, CurrencySpriteType shardType, int shardsCount, cocos2d::CCPoint position, CurrencyRewardType rewardType, float yOffset, float time) = win 0x9f500, imac 0x78ff00, m1 0x6a36f8, ios 0x31e9b4;
39303930

39313931
virtual void update(float) = win 0xa2230, imac 0x792fd0, m1 0x6a64a8, ios 0x3212a4;
39323932

39333933
void createObjects(CurrencySpriteType type, int count, cocos2d::CCPoint position, float time) = win inline, imac 0x792130, m1 0x6a57c0, ios 0x3206cc {
39343934
this->createObjectsFull(type, count, nullptr, position, time);
39353935
}
3936-
void createObjectsFull(CurrencySpriteType, int, cocos2d::CCSprite*, cocos2d::CCPoint, float) = win 0xa1520, imac 0x7921d0, m1 0x6a5884, ios 0x320790;
3936+
void createObjectsFull(CurrencySpriteType type, int count, cocos2d::CCSprite* sprite, cocos2d::CCPoint position, float time) = win 0xa1520, imac 0x7921d0, m1 0x6a5884, ios 0x320790;
39373937
void createUnlockObject(cocos2d::CCSprite* sprite, cocos2d::CCPoint position, float time) = win inline, imac 0x792180, m1 0x6a5828, ios 0x320734 {
39383938
this->createObjectsFull(CurrencySpriteType::Icon, 1, sprite, position, time);
39393939
}
@@ -3943,7 +3943,7 @@ class CurrencyRewardLayer : cocos2d::CCLayer {
39433943
this->pulseSprite(m_orbsSprite);
39443944
m_orbsLabel->setString(cocos2d::CCString::createWithFormat("%i", count)->getCString());
39453945
}
3946-
void incrementDiamondsCount(int count) = win inline, m1 0x6a6f08, imac 0x793b50 {
3946+
void incrementDiamondsCount(int count) = win inline, m1 0x6a6f08, imac 0x793b50, ios 0x321b84 {
39473947
if (m_diamondsLabel == nullptr) return;
39483948
m_diamonds += count;
39493949
this->pulseSprite(m_diamondsSprite);
@@ -3973,8 +3973,8 @@ class CurrencyRewardLayer : cocos2d::CCLayer {
39733973
this->pulseSprite(m_starsSprite);
39743974
m_starsLabel->setString(cocos2d::CCString::createWithFormat("%i", count)->getCString());
39753975
}
3976-
bool init(int orbs, int stars, int moons, int diamonds, CurrencySpriteType demonKey, int keyCount, CurrencySpriteType shardType, int shardsCount, cocos2d::CCPoint position, CurrencyRewardType rewardType, float, float time) = win 0x9f750, imac 0x78ffe0, m1 0x6a3800, ios 0x31eabc;
3977-
void pulseSprite(cocos2d::CCSprite*) = win 0xa2c00, imac 0x793fa0, m1 0x6a72f8, ios 0x321ea8;
3976+
bool init(int orbs, int stars, int moons, int diamonds, CurrencySpriteType demonKey, int keyCount, CurrencySpriteType shardType, int shardsCount, cocos2d::CCPoint position, CurrencyRewardType rewardType, float yOffset, float time) = win 0x9f750, imac 0x78ffe0, m1 0x6a3800, ios 0x31eabc;
3977+
void pulseSprite(cocos2d::CCSprite* sprite) = win 0xa2c00, imac 0x793fa0, m1 0x6a72f8, ios 0x321ea8;
39783978

39793979
CurrencyRewardDelegate* m_delegate;
39803980
cocos2d::CCArray* m_objects;
@@ -4040,11 +4040,28 @@ class CurrencySprite : CCSpritePlus {
40404040
return nullptr;
40414041
}
40424042

4043-
static CurrencySprite* createWithSprite(cocos2d::CCSprite*) = win 0xa44b0, m1 0x6a63c0, imac 0x792ed0, ios 0x321230;
4044-
static CurrencySpriteType rewardToSpriteType(int);
4045-
static gd::string spriteTypeToStat(CurrencySpriteType) = win 0xa4780, m1 0x6a5574, imac 0x791f20;
4046-
bool init(CurrencySpriteType, bool) = win 0xa2cd0, m1 0x6a74c0, imac 0x794180, ios 0x321fe4;
4047-
bool initWithSprite(cocos2d::CCSprite*) = m1 0x6a7dc8, imac 0x794ad0, ios 0x3228ac; // inlined on windows
4043+
static CurrencySprite* createWithSprite(cocos2d::CCSprite* sprite) = win 0xa44b0, m1 0x6a63c0, imac 0x792ed0, ios 0x321230;
4044+
static CurrencySpriteType rewardToSpriteType(int rewardType) = win 0xa46d0, m1 0x6a7f80, imac 0x794c80, ios 0x322a60;
4045+
static gd::string spriteTypeToStat(CurrencySpriteType type) = win 0xa4780, m1 0x6a5574, imac 0x791f20, ios 0x320618;
4046+
bool init(CurrencySpriteType type, bool burst) = win 0xa2cd0, m1 0x6a74c0, imac 0x794180, ios 0x321fe4;
4047+
bool initWithSprite(cocos2d::CCSprite* sprite) = win inline, m1 0x6a7dc8, imac 0x794ad0, ios 0x3228ac {
4048+
if (!cocos2d::CCSprite::init()) return false;
4049+
this->addChild(sprite);
4050+
sprite->setPosition({ 0.f, 0.f });
4051+
m_burstSprite = cocos2d::CCSprite::createWithSpriteFrameName("shineBurst_001.png");
4052+
m_burstSprite->retain();
4053+
auto factor = (float)rand() / (float)RAND_MAX > .5f ? 1.f : -1.f;
4054+
m_burstSprite->runAction(cocos2d::CCRepeatForever::create(cocos2d::CCRotateBy::create(1.f, 90.f * factor)));
4055+
m_burstSprite->setScale(2.f);
4056+
m_burstSprite->setColor({ 255, 255, 255 });
4057+
auto shineBurst = cocos2d::CCSprite::createWithSpriteFrameName("shineBurst_001.png");
4058+
m_burstSprite->addChild(shineBurst);
4059+
shineBurst->setPosition(m_burstSprite->convertToNodeSpace({ 0.f, 0.f }));
4060+
shineBurst->setScale(.8f);
4061+
shineBurst->setColor({ 255, 255, 255 });
4062+
shineBurst->runAction(cocos2d::CCRepeatForever::create(cocos2d::CCRotateBy::create(1.f, -180.f * factor)));
4063+
return true;
4064+
}
40484065

40494066
float m_unkFloat1;
40504067
float m_unkFloat2;
@@ -6055,10 +6072,35 @@ class EffectManagerState {
60556072

60566073
[[link(android)]]
60576074
class EndLevelLayer : GJDropDownLayer {
6058-
// virtual ~EndLevelLayer();
6059-
// EndLevelLayer();
6075+
EndLevelLayer() = m1 0x419328, imac 0x4b06d0, ios 0x2f8988 {
6076+
m_playLayer = nullptr;
6077+
m_notLocal = false;
6078+
m_coinsVerified = false;
6079+
m_unknown3 = false;
6080+
m_exiting = false;
6081+
m_animateCoins = false;
6082+
m_endEffectPlayed = false;
6083+
m_sideMenu = nullptr;
6084+
m_coinsToAnimate = nullptr;
6085+
m_orbs = 0;
6086+
m_stars = 0;
6087+
m_moons = 0;
6088+
m_diamonds = 0;
6089+
m_hidden = false;
6090+
}
6091+
~EndLevelLayer() = win inline, m1 0x415a0c, imac 0x4ac950, ios 0x2f55b0 {
6092+
CC_SAFE_RELEASE(m_coinsToAnimate);
6093+
}
60606094

6061-
static EndLevelLayer* create(PlayLayer* playLayer);
6095+
static EndLevelLayer* create(PlayLayer* playLayer) = win inline, m1 0x41595c, imac 0x4ac8a0, ios 0x2f5528 {
6096+
auto ret = new EndLevelLayer();
6097+
if (ret->init(playLayer)) {
6098+
ret->autorelease();
6099+
return ret;
6100+
}
6101+
delete ret;
6102+
return nullptr;
6103+
}
60626104

60636105
virtual void keyBackClicked() = win 0x133aa0, imac 0x4afe70, m1 0x418b0c, ios 0x2f81f4;
60646106
virtual void keyDown(cocos2d::enumKeyCodes) = win 0x135140, imac 0x4b0620, m1 0x4192a4, ios 0x2f893c;
@@ -6067,28 +6109,31 @@ class EndLevelLayer : GJDropDownLayer {
60676109
virtual void enterAnimFinished() = m1 0x418a60, imac 0x4afd90, ios 0x2f8174 {}
60686110
virtual void keyUp(cocos2d::enumKeyCodes) = m1 0x419320, imac 0x4b06b0, ios 0x2f8980 {}
60696111

6070-
void coinEnterFinished(cocos2d::CCPoint) = win 0x134230, m1 0x418e98, imac 0x4b0230, ios 0x2f8550;
6071-
void coinEnterFinishedO(cocos2d::CCObject*) = win 0x1341f0, m1 0x418e4c, imac 0x4b01f0;
6112+
void coinEnterFinished(cocos2d::CCPoint position) = win 0x134230, m1 0x418e98, imac 0x4b0230, ios 0x2f8550;
6113+
void coinEnterFinishedO(cocos2d::CCObject* sender) = win 0x1341f0, m1 0x418e4c, imac 0x4b01f0, ios 0x2f8504;
60726114
void currencyEnterFinished() = win 0x1348e0, m1 0x4190b0, imac 0x4b0420, ios 0x2f8750;
60736115
void diamondEnterFinished() = win 0x134d70, m1 0x4191a8, imac 0x4b0520, ios 0x2f8844;
60746116
gd::string getCoinString() = win 0x132d30, m1 0x4174b8, imac 0x4ae840, ios 0x2f6d38;
60756117
const char* getEndText() = win 0x135190, m1 0x41770c, imac 0x4aea80, ios 0x2f6f00;
60766118
void goEdit() = win 0x1336e0, m1 0x418a68, imac 0x4afdb0, ios 0x2f8178;
6077-
bool init(PlayLayer* playLayer);
6119+
bool init(PlayLayer* playLayer) = win inline, m1 0x4159f0, imac 0x4ac920, ios inline {
6120+
m_playLayer = playLayer;
6121+
return GJDropDownLayer::init(" ", 230.f, true);
6122+
}
60786123
void onEdit(cocos2d::CCObject* sender) = win 0x1335e0, m1 0x417a1c, imac 0x4aed20, ios 0x2f71c0;
6079-
void onEveryplay(cocos2d::CCObject* sender);
6124+
void onEveryplay(cocos2d::CCObject* sender) = win inline, m1 0x418a64, imac 0x4afda0, ios inline {}
60806125
void onHideLayer(cocos2d::CCObject* sender) = win 0x1337b0, imac 0x4aef70, m1 0x417c94, ios 0x2f7420;
60816126
void onLevelLeaderboard(cocos2d::CCObject* sender) = win 0x132c30, m1 0x417c20, imac 0x4aef00, ios 0x2f73ac;
60826127
void onMenu(cocos2d::CCObject* sender) = win 0x133460, m1 0x417918, imac 0x4aec30, ios 0x2f70d4;
60836128
void onReplay(cocos2d::CCObject* sender) = win 0x133250, m1 0x4177f4, imac 0x4aeb30, ios 0x2f6fc8;
60846129
void onRestartCheckpoint(cocos2d::CCObject* sender) = win 0x133890, m1 0x417ab8, imac 0x4aedb0, ios 0x2f725c;
6085-
void playCoinEffect(float) = win 0x133fb0, m1 0x41825c, imac 0x4af550, ios 0x2f7998;
6086-
void playCurrencyEffect(float) = win 0x134560, m1 0x4183f0, imac 0x4af6f0, ios 0x2f7b1c;
6087-
void playDiamondEffect(float) = win 0x1349f0, m1 0x418728, imac 0x4afa40, ios 0x2f7e48;
6130+
void playCoinEffect(float duration) = win 0x133fb0, m1 0x41825c, imac 0x4af550, ios 0x2f7998;
6131+
void playCurrencyEffect(float duration) = win 0x134560, m1 0x4183f0, imac 0x4af6f0, ios 0x2f7b1c;
6132+
void playDiamondEffect(float duration) = win 0x1349f0, m1 0x418728, imac 0x4afa40, ios 0x2f7e48;
60886133
void playEndEffect() = win 0x134e80, m1 0x418c38, imac 0x4affd0, ios 0x2f831c;
6089-
void playStarEffect(float) = win 0x133ab0, m1 0x417f0c, imac 0x4af1f0, ios 0x2f7658;
6134+
void playStarEffect(float duration) = win 0x133ab0, m1 0x417f0c, imac 0x4af1f0, ios 0x2f7658;
60906135
void starEnterFinished() = win 0x133e50, m1 0x418b18, imac 0x4afea0, ios 0x2f8200;
6091-
void tryShowBanner(float);
6136+
void tryShowBanner(float) = m1 0x417d4c, imac 0x4af030;
60926137

60936138
PlayLayer* m_playLayer;
60946139
bool m_notLocal;

bindings/include/Geode/Enums.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,11 +658,13 @@ enum class CurrencySpriteType {
658658
MetalShard = 12,
659659
LightShard = 13,
660660
SoulShard = 14,
661-
Moon = 15
661+
Moon = 15,
662+
GoldKey = 16
662663
};
663664

664665
enum class CurrencyRewardType {
665-
// todo
666+
Default = 0,
667+
Treasure = 1
666668
};
667669

668670
enum class MenuAnimationType {

0 commit comments

Comments
 (0)