//
// SetLevelOrderPopup::init from 0x140308ed0 to 0x1403091a0 (720 bytes)
//
// 2 xrefs:
// > LevelListLayer::cellPerformedAction @ 0x140306dc6
// > ??> @ 0x1406d45e0
//
// 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
//
// Hidden C++ exception states: #wind=1
bool SetLevelOrderPopup::init(SetLevelOrderPopup *a1, int a2, int a3, int a4)
{
bool result; // al
__int64 v7; // rcx
cocos2d::CCDirector *v8; // rax
struct cocos2d::CCSprite *v9; // rbx
cocos2d::CCNode *v10; // rbx
float v11; // xmm0_4
struct cocos2d::CCSprite *v12; // rbx
cocos2d::CCNode *v13; // rbx
float v14; // xmm0_4
__int128 *v15; // [rsp+68h] [rbp-29h] BYREF
float v16; // [rsp+70h] [rbp-21h]
struct cocos2d::CCPoint v17; // [rsp+78h] [rbp-19h] BYREF
_QWORD v18[4]; // [rsp+80h] [rbp-11h] BYREF
__int128 v19; // [rsp+B0h] [rbp+1Fh] BYREF
__int64 v20; // [rsp+C0h] [rbp+2Fh]
__int64 v21; // [rsp+C8h] [rbp+37h]
v15 = &v19;
v19 = 0;
v20 = 2;
v21 = 15;
strcpy((char *)&v19, "OK");
HIDWORD(v18[1]) = 0;
v18[2] = 11;
v18[3] = 15;
strcpy((char *)v18, "Level Order");
result = SetIDPopup::init(a1, a3, 1, a4, v18, &v19, 0, 0, 0, 1, 1);
if ( result )
{
a1->m_levelID = a2;
v8 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v7);
cocos2d::CCDirector::getWinSize(v8);
cocos2d::CCPoint::CCPoint(7.2723172e22, v16 * 0.5);
cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v17);
v9 = cocos2d::CCSprite::createWithSpriteFrameName("edit_leftBtn2_001.png");
v9->setColor(&v9->cocos2d::CCRGBAProtocol, &stru_140529B50);
((void (__fastcall *)(struct cocos2d::CCSprite *))v9->setScale_0)(v9);
((void (__fastcall *)(struct cocos2d::CCSprite *))v9->setRotation)(v9);
v10 = CCMenuItemSpriteExtra::create(v9, nullptr, a1, (cocos2d::SEL_MenuHandler *)SetLevelOrderPopup::onOrderButton);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v10);
v11 = ((float (__fastcall *)(cocos2d::CCNode *, _QWORD))v10->setTag)(v10, 0);
cocos2d::CCPoint::CCPoint(v11, -85.0);
cocos2d::CCPoint::operator+(&v17, &v15);
v10->setPosition_0(v10, (const cocos2d::CCPoint *)&v15);
v10[1].m_unknown5 = 1068708659;
v12 = cocos2d::CCSprite::createWithSpriteFrameName("edit_rightBtn2_001.png");
v12->setColor(&v12->cocos2d::CCRGBAProtocol, &stru_140529B48);
((void (__fastcall *)(struct cocos2d::CCSprite *))v12->setScale_0)(v12);
((void (__fastcall *)(struct cocos2d::CCSprite *))v12->setRotation)(v12);
v13 = CCMenuItemSpriteExtra::create(v12, nullptr, a1, (cocos2d::SEL_MenuHandler *)SetLevelOrderPopup::onOrderButton);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v13);
v14 = ((float (__fastcall *)(cocos2d::CCNode *, __int64))v13->setTag)(v13, 1);
cocos2d::CCPoint::CCPoint(v14, 85.0);
cocos2d::CCPoint::operator+(&v17, &v15);
v13->setPosition_0(v13, (const cocos2d::CCPoint *)&v15);
v13[1].m_unknown5 = 1068708659;
return 1;
}
return result;
}