//
// GJPathRewardPopup::init from 0xa71160 to 0xa7164c (1260 bytes)
//
// 2 xrefs:
// > GJPathRewardPopup::create @ 0xa71714
// > ??> @ 0xaebe8
//
// 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)
{
char v3; // w24
GJPathRewardPopup_vtbl *v4; // x2
cocos2d::CCDirector *v5; // x0
cocos2d::CCLayer *v6; // x0
cocos2d::CCNode *v7; // x23
void (__fastcall *setContentSize)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // x22
CCMenuItemSpriteExtra *v9; // x0
cocos2d::CCMenu *v10; // x22
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x25
cocos2d::CCNode *v12; // x20
void (__fastcall *v13)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x22
cocos2d::CCLabelBMFont *v14; // x22
cocos2d::CCLabelBMFont *v15; // x23
void (__fastcall *setScale)(cocos2d::CCLabelBMFont *__hidden, float); // x25
cocos2d::CCLabelBMFont *v17; // x0
const cocos2d::CCPoint *(__fastcall *getPosition)(cocos2d::CCNode *__hidden); // x1
void (__fastcall *v19)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x22
__int64 v20; // x0
GJChestSprite *v21; // x23
void (__fastcall *v22)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x22
GJChestSprite *v23; // x22
void (__fastcall *v24)(cocos2d::CCSprite *__hidden, float); // x26
GJChestSprite *v25; // x0
const cocos2d::CCPoint *(__fastcall *v26)(cocos2d::CCNode *__hidden); // x1
void (__fastcall *v27)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x23
__int64 v28; // x0
cocos2d::CCArray *v29; // x0
__int64 v30; // x0
cocos2d::CCArray *v31; // x0
__int64 v32; // x0
cocos2d::CCMoveBy *v33; // x0
cocos2d::CCEaseInOut *v34; // x22
cocos2d::CCMoveBy *v35; // x0
cocos2d::CCEaseInOut *v36; // x0
cocos2d::CCActionInterval *v37; // x0
cocos2d::CCRepeatForever *v38; // x0
void (__fastcall *v40)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [xsp+68h] [xbp+68h]
float v41; // [xsp+70h] [xbp+70h]
float v42; // [xsp+74h] [xbp+74h]
cocos2d::CCPoint v43; // [xsp+78h] [xbp+78h] BYREF
cocos2d::CCPoint v44; // [xsp+80h] [xbp+80h] BYREF
__int64 v45; // [xsp+88h] [xbp+88h] BYREF
cocos2d::CCPoint v46; // [xsp+90h] [xbp+90h] BYREF
cocos2d::SEL_MenuHandler v47; // 0:x2.16
a1->m_pathNumber = a2;
FLAlertLayer::incrementForcePrio(a1);
v46.x = 1.0634e37;
v3 = cocos2d::CCLayerColor::initWithColor(a1, (const cocos2d::_ccColor4B *)&v46);
if ( v3 )
{
v4 = a1->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
a1->m_noElasticity = 1;
v4->setTouchEnabled(a1, 1);
a1->setKeypadEnabled(a1, 1);
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v5);
v6 = cocos2d::CCLayer::create();
a1->m_mainLayer = v6;
a1->addChild(a1, v6);
v7 = cocos2d::CCNode::create();
setContentSize = v7->setContentSize;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v46, 100.0, 100.0);
setContentSize(v7, (const cocos2d::CCSize *)&v46);
v47.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v47.adj = (size_t)GJPathRewardPopup::onClaim;
v9 = CCMenuItemSpriteExtra::create(v7, nullptr, v47);
v10 = (cocos2d::CCMenu *)cocos2d::CCMenu::create((cocos2d::CCMenu *)v9, nullptr);
a1->m_buttonMenu = v10;
setPosition = v10->setPosition;
cocos2d::CCPoint::CCPoint(&v46, v41 * 0.5, v42 * 0.5);
setPosition(v10, &v46);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, a1->m_buttonMenu, 10);
cocos2d::CCPoint::CCPoint(&v43, 0.0, 10.0);
v12 = cocos2d::CCNode::create();
v12->setContentSize(v12, &stru_1244550);
v7->addChild(v7, v12);
v13 = v12->setPosition;
cocos2d::CCPoint::CCPoint(&v46, 50.0, 50.0);
v13(v12, &v46);
v14 = cocos2d::CCLabelBMFont::create();
v14->setScale(v14, 0.65);
v12->addChild_0(v12, v14, 22);
v40 = v14->setPosition;
cocos2d::CCPoint::CCPoint(&v46, 0.0, 40.0);
cocos2d::CCPoint::operator+(&v45, &v43, &v46);
v40(v14, (const cocos2d::CCPoint *)&v45);
cocos2d::CCPoint::CCPoint(&v44, 0.0, -5.0);
v15 = cocos2d::CCLabelBMFont::create();
setScale = v15->setScale;
v14->getScale(v14);
((void (__fastcall *)(cocos2d::CCLabelBMFont *))setScale)(v15);
v12->addChild_0(v12, v15, 21);
v17 = v14;
getPosition = v14->getPosition;
v19 = v15->setPosition;
v20 = (__int64)getPosition(v17);
cocos2d::CCPoint::operator+(&v46, v20, &v44);
v19(v15, &v46);
v15->setColor(v15, (const cocos2d::ccColor3B *)&unk_F14700);
v15->setOpacity(v15, 50);
v21 = GJChestSprite::create((int)&byte_6);
v12->addChild_0(v12, v21, 22);
v21->setScale(v21, 0.6);
v22 = v21->setPosition;
cocos2d::CCPoint::CCPoint(&v46, 0.0, -6.0);
cocos2d::CCPoint::operator+(&v45, &v43, &v46);
v22(v21, (const cocos2d::CCPoint *)&v45);
v23 = GJChestSprite::create((int)&byte_6);
v12->addChild_0(v12, v23, 21);
v24 = v23->setScale;
v21->getScale(v21);
((void (__fastcall *)(GJChestSprite *))v24)(v23);
v25 = v21;
v26 = v21->getPosition;
v27 = v23->setPosition;
v28 = (__int64)v26(v25);
cocos2d::CCPoint::operator+(&v46, v28, &v44);
v27(v23, &v46);
v29 = v23->getChildren(v23);
v30 = cocos2d::CCArray::objectAtIndex(v29, 0);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v30 + 944LL))(v30, &unk_F14700);
v31 = v23->getChildren(v23);
v32 = cocos2d::CCArray::objectAtIndex(v31, 0);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v32 + 896LL))(v32, 50);
cocos2d::CCPoint::CCPoint(&v46, 0.0, 5.0);
v33 = cocos2d::CCMoveBy::create(1.0, &v46);
v34 = cocos2d::CCEaseInOut::create(v33, 2.0);
cocos2d::CCPoint::CCPoint(&v46, 0.0, -5.0);
v35 = cocos2d::CCMoveBy::create(1.0, &v46);
v36 = cocos2d::CCEaseInOut::create(v35, 2.0);
v37 = (cocos2d::CCActionInterval *)cocos2d::CCSequence::create((cocos2d::CCSequence *)v34, v36, 0);
v38 = cocos2d::CCRepeatForever::create(v37);
cocos2d::CCNode::runAction(v12, v38);
}
return v3;
}