//
// GJPathRewardPopup::init from 0x58e31c to 0x58e66c (848 bytes)
//
// 1 xrefs:
// > GJPathRewardPopup::create @ 0x58e708
//
// 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
//
bool GJPathRewardPopup::init(GJPathRewardPopup *a1, int a2)
{
GJPathRewardPopup_vtbl *v3; // r3
cocos2d::CCDirector *v4; // r0
cocos2d::CCLayer *v5; // r0
GJPathRewardPopup_vtbl *v6; // r3
cocos2d::CCNode *v7; // r7
void (__fastcall *setContentSize)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // r5
CCMenuItemSpriteExtra *v9; // r0
cocos2d::CCMenu *v10; // r0
float v11; // r1
float v12; // s15
cocos2d::CCMenu_vtbl *v13; // r3
cocos2d::CCMenu *v14; // r5
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
cocos2d::CCNode *v16; // r5
void (__fastcall *v17)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7
cocos2d::CCLabelBMFont *v18; // r7
void (__fastcall *v19)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11
cocos2d::CCLabelBMFont *v20; // r10
void (__fastcall *setScale)(cocos2d::CCLabelBMFont *__hidden, float); // r9
int v22; // r0
void (__fastcall *v23)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
int v24; // r0
GJChestSprite *v25; // r10
void (__fastcall *v26)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
GJChestSprite *v27; // r9
void (__fastcall *v28)(cocos2d::CCSprite *__hidden, float); // r8
int v29; // r0
void (__fastcall *v30)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r8
int v31; // r0
cocos2d::CCArray *v32; // r0
int v33; // r0
cocos2d::CCArray *v34; // r0
int v35; // r0
cocos2d::CCMoveBy *v36; // r0
cocos2d::CCEaseInOut *v37; // r7
cocos2d::CCMoveBy *v38; // r0
cocos2d::CCEaseInOut *v39; // r0
cocos2d::CCActionInterval *v40; // r0
cocos2d::CCRepeatForever *v41; // r0
int v43; // [sp+Ch] [bp-48h]
cocos2d::CCSize v44; // [sp+1Ch] [bp-38h] BYREF
cocos2d::CCPoint v45; // [sp+24h] [bp-30h] BYREF
cocos2d::CCPoint v46; // [sp+2Ch] [bp-28h] BYREF
void (*v47)(GJPathRewardPopup *, cocos2d::CCObject *); // [sp+34h] [bp-20h]
int v48; // [sp+38h] [bp-1Ch]
cocos2d::CCPoint v49; // [sp+3Ch] [bp-18h] BYREF
cocos2d::CCPoint v50; // [sp+44h] [bp-10h] BYREF
a1->m_pathNumber = a2;
FLAlertLayer::incrementForcePrio(a1);
v50.x = 1.0634e37;
v43 = cocos2d::CCLayerColor::initWithColor(a1, (const cocos2d::_ccColor4B *)&v50);
if ( v43 )
{
v3 = a1->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_noElasticity = 1;
v3->setTouchEnabled(a1, 1);
a1->setKeypadEnabled(a1, 1);
v4 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v44, v4);
v5 = cocos2d::CCLayer::create();
v6 = a1->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_mainLayer = v5;
v6->addChild(a1, v5);
v7 = cocos2d::CCNode::create();
setContentSize = v7->setContentSize;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v50, 100.0, 100.0);
setContentSize(v7, (const cocos2d::CCSize *)&v50);
v47 = GJPathRewardPopup::onClaim;
v48 = 0;
v9 = CCMenuItemSpriteExtra::create(
v7,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(GJPathRewardPopup::onClaim, (unsigned int)a1));
v10 = (cocos2d::CCMenu *)cocos2d::CCMenu::create((cocos2d::CCMenu *)v9, nullptr);
v11 = v44.width * 0.5;
v12 = v44.height * 0.5;
v13 = v10->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v14 = v10;
a1->m_buttonMenu = v10;
setPosition = v13->setPosition;
cocos2d::CCPoint::CCPoint(&v50, v11, v12);
setPosition(v14, &v50);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, a1->m_buttonMenu, 10);
cocos2d::CCPoint::CCPoint(&v45, 0.0, 10.0);
v16 = cocos2d::CCNode::create();
v16->setContentSize(v16, &stru_AC7ECC);
v7->addChild(v7, v16);
v17 = v16->setPosition;
cocos2d::CCPoint::CCPoint(&v50, 50.0, 50.0);
v17(v16, &v50);
v18 = cocos2d::CCLabelBMFont::create();
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v18->setScale)(v18, 1059481190);
v16->addChild_0(v16, v18, 22);
v19 = v18->setPosition;
cocos2d::CCPoint::CCPoint(&v50, 0.0, 40.0);
cocos2d::CCPoint::operator+(&v49, &v45, &v50);
v19(v18, &v49);
cocos2d::CCPoint::CCPoint(&v46, 0.0, -5.0);
v20 = cocos2d::CCLabelBMFont::create();
setScale = v20->setScale;
v22 = ((int (__fastcall *)(cocos2d::CCLabelBMFont *))v18->getScale)(v18);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))setScale)(v20, v22);
v16->addChild_0(v16, v20, 21);
v23 = v20->setPosition;
v24 = (int)v18->getPosition(v18);
cocos2d::CCPoint::operator+(&v50, v24, &v46);
v23(v20, &v50);
v20->setColor(v20, &stru_9ADC88);
v20->setOpacity(v20, 50);
v25 = GJChestSprite::create((int)&byte_6);
v16->addChild_0(v16, v25, 22);
((void (__fastcall *)(GJChestSprite *, int))v25->setScale)(v25, 1058642330);
v26 = v25->setPosition;
cocos2d::CCPoint::CCPoint(&v50, 0.0, -6.0);
cocos2d::CCPoint::operator+(&v49, &v45, &v50);
v26(v25, &v49);
v27 = GJChestSprite::create((int)&byte_6);
v16->addChild_0(v16, v27, 21);
v28 = v27->setScale;
v29 = ((int (__fastcall *)(GJChestSprite *))v25->getScale)(v25);
((void (__fastcall *)(GJChestSprite *, int))v28)(v27, v29);
v30 = v27->setPosition;
v31 = (int)v25->getPosition(v25);
cocos2d::CCPoint::operator+(&v50, v31, &v46);
v30(v27, &v50);
v32 = v27->getChildren(v27);
v33 = cocos2d::CCArray::objectAtIndex(v32, 0);
(*(void (__fastcall **)(int, cocos2d::ccColor3B *))(*(_DWORD *)v33 + 472))(v33, &stru_9ADC88);
v34 = v27->getChildren(v27);
v35 = cocos2d::CCArray::objectAtIndex(v34, 0);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v35 + 448))(v35, 50);
cocos2d::CCPoint::CCPoint(&v50, 0.0, 5.0);
v36 = cocos2d::CCMoveBy::create(1.0, &v50);
v37 = cocos2d::CCEaseInOut::create(v36, 2.0);
cocos2d::CCPoint::CCPoint(&v50, 0.0, -5.0);
v38 = cocos2d::CCMoveBy::create(1.0, &v50);
v39 = cocos2d::CCEaseInOut::create(v38, 2.0);
v40 = (cocos2d::CCActionInterval *)cocos2d::CCSequence::create((cocos2d::CCSequence *)v37, v39, 0);
v41 = cocos2d::CCRepeatForever::create(v40);
cocos2d::CCNode::runAction(v16, v41);
}
return v43;
}