Skip to content

Commit 08b22b1

Browse files
authored
GameStatsManager::countUnlockedSecretChests and GameStatsManager::countSecretChests (geode-sdk#1060)
1 parent 4b3ea1f commit 08b22b1

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

bindings/2.2074/GeometryDash.bro

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8469,8 +8469,42 @@ class GameStatsManager : cocos2d::CCNode {
84698469
TodoReturn completedLevel(GJGameLevel*) = ios 0x330d54, imac 0x6d6b0;
84708470
void completedMapPack(GJMapPack*) = win 0x1dbe30;
84718471
void completedStarLevel(GJGameLevel*) = m1 0x61598, ios 0x330f2c;
8472-
int countSecretChests(GJRewardType);
8473-
int countUnlockedSecretChests(GJRewardType);
8472+
int countSecretChests(GJRewardType rewardType) = win inline, imac 0x8bdd0, m1 0x7fa48, ios 0x33e264 {
8473+
using namespace cocos2d;
8474+
if (!m_allTreasureRoomChests) {
8475+
return 0;
8476+
}
8477+
8478+
if (rewardType == GJRewardType::Unknown) {
8479+
return m_allTreasureRoomChests->count();
8480+
}
8481+
8482+
int count = 0;
8483+
CCDictElement* obj;
8484+
CCDICT_FOREACH(m_allTreasureRoomChests, obj) {
8485+
auto chest = static_cast<GJRewardItem*>(obj->getObject());
8486+
if (chest->m_rewardType == rewardType) count++;
8487+
}
8488+
return count;
8489+
}
8490+
int countUnlockedSecretChests(GJRewardType rewardType) = win inline, imac 0x8be30, m1 0x7fa8c, ios 0x33e2a8 {
8491+
using namespace cocos2d;
8492+
if (!m_treasureRoomChests) {
8493+
return 0;
8494+
}
8495+
8496+
if (rewardType == GJRewardType::Unknown) {
8497+
return m_treasureRoomChests->count();
8498+
}
8499+
8500+
int count = 0;
8501+
CCDictElement* obj;
8502+
CCDICT_FOREACH(m_treasureRoomChests, obj) {
8503+
auto chest = static_cast<GJRewardItem*>(obj->getObject());
8504+
if (chest->m_rewardType == rewardType) count++;
8505+
}
8506+
return count;
8507+
}
84748508
TodoReturn createReward(GJRewardType, int, gd::string) = ios 0x332fb4;
84758509
void createSecretChestItems() = imac 0x5d080, m1 0x5243c;
84768510
void createSecretChestRewards() = win 0x1e7760;

0 commit comments

Comments
 (0)