//
// LevelListLayer::onClaimReward from 0x58ec34 to 0x58edcc (408 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void LevelListLayer::onClaimReward(LevelListLayer *a1, cocos2d::CCObject *a2)
{
GJLevelList *m_levelList; // r0
int m_levelsToClaim; // r7
const char *v6; // r7
GameStatsManager *v7; // r0
FMODAudioEngine *v8; // r7
int v9; // r2
int v10; // r3
int m_diamonds; // r7
CurrencyRewardLayer *v12; // r0
char *v13; // r1
cocos2d::CCString *v14; // r0
char *CString; // r0
DialogObject *v16; // r0
DialogLayer *v17; // r9
int v18; // [sp+4h] [bp-40h]
float v19; // [sp+20h] [bp-24h]
int v20; // [sp+28h] [bp-1Ch] BYREF
_BYTE v21[4]; // [sp+2Ch] [bp-18h] BYREF
char v22; // [sp+30h] [bp-14h] BYREF
cocos2d::CCPoint v23; // [sp+34h] [bp-10h] BYREF
m_levelList = a1->m_levelList;
m_levelsToClaim = m_levelList->m_levelsToClaim;
v6 = (const char *)(m_levelsToClaim - GJLevelList::completedLevels(m_levelList));
if ( (int)v6 > 0 )
{
if ( v6 == (_BYTE *)&dword_0 + 1 )
v13 = "level";
else
v13 = "levels";
sub_776584((int)&v20, v13);
v14 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Complete %i more %s from this list to clai"
"m the reward!",
v6,
v20);
CString = (char *)cocos2d::CCString::getCString(v14);
sub_776584((int)v21, CString);
sub_776584((int)&v22, "The Mechanic");
sub_775C20(&v23);
LOWORD(v18) = -1;
BYTE2(v18) = -1;
v16 = (DialogObject *)DialogObject::create(
(DialogObject *)&v22,
(std::string)&v23,
(std::string)37,
1065353216,
0.0,
v18);
v17 = DialogLayer::create(v16, (int)byte_4);
sub_774008(&v23);
sub_774008(&v22);
DialogLayer::addToMainScene(v17);
DialogLayer::updateChatPlacement(v17, Center);
DialogLayer::animateIn(v17, FromCenter);
sub_774008(v21);
sub_774008(&v20);
}
else
{
v7 = GameStatsManager::sharedState();
if ( GameStatsManager::claimListReward(v7, a1->m_levelList) )
{
v8 = FMODAudioEngine::sharedEngine();
sub_776584((int)&v23, "gold02.ogg");
FMODAudioEngine::playEffect(v8, (int)&v23, v9, v10);
sub_774008(&v23);
m_diamonds = a1->m_levelList->m_diamonds;
cocos2d::CCPoint::CCPoint(&v23, &a1->m_rewardPosition);
v12 = CurrencyRewardLayer::create(
0,
0,
0,
m_diamonds,
Icon,
0,
Icon,
0,
(cocos2d::CCPoint)(unsigned int)&v23,
(CurrencyRewardType)0,
1.0,
v19);
a1->addChild_0(a1, v12, 14);
}
a2->__vftable[13].copyWithZone(a2, nullptr);
((void (__fastcall *)(cocos2d::CCObject *, _DWORD))a2->__vftable[4].~CCObject)(a2, 0);
}
}