//
// UploadListPopup::init from 0x14030b1d0 to 0x14030b709 (1337 bytes)
//
// 2 xrefs:
// > ShareListLayer::onShare @ 0x14030b158
// > ??> @ 0x1406d467c
//
// 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=4
bool UploadListPopup::init(UploadListPopup *a1, GJLevelList *a2)
{
bool result; // al
__int64 v5; // rcx
__int64 v6; // rax
cocos2d::CCTouchDispatcher *v7; // rax
_BOOL8 v8; // rdx
_BOOL8 v9; // rdx
__int64 v10; // rcx
cocos2d::CCDirector *v11; // rax
cocos2d::CCLayer *v12; // rax
struct cocos2d::CCRect *v13; // rax
struct cocos2d::extension::CCScale9Sprite *v14; // rdi
__int64 v15; // rdx
cocos2d::extension::CCScale9Sprite_vtbl *v16; // rbx
const cocos2d::CCSize *v17; // rax
float v18; // xmm0_4
cocos2d::extension::CCScale9Sprite_vtbl *v19; // rbx
const cocos2d::CCPoint *v20; // rax
const char *v21; // rcx
struct cocos2d::CCLabelBMFont *v22; // rdi
float v23; // xmm0_4
cocos2d::CCLabelBMFont_vtbl *v24; // rbx
const cocos2d::CCPoint *v25; // rax
__int64 v26; // rcx
cocos2d::CCMenu *v27; // rax
const struct cocos2d::CCPoint *v28; // rax
char *v29; // rax
float v30; // xmm0_4
TextArea_vtbl *v31; // rbx
double v32; // xmm0_8
const cocos2d::CCPoint *v33; // rax
LoadingCircle *v34; // rax
cocos2d::CCSprite *m_sprite; // rbx
cocos2d::CCSprite_vtbl *v36; // rdi
const cocos2d::CCPoint *v37; // rax
GameLevelManager *v38; // rcx
struct cocos2d::CCSprite *v39; // rax
CCMenuItemSpriteExtra *v40; // rax
CCMenuItemSpriteExtra_vtbl *v41; // rbx
__int64 v42; // rcx
cocos2d::CCDirector *v43; // rax
__int64 v44; // rcx
cocos2d::CCDirector *v45; // rax
float v46; // xmm0_4
struct cocos2d::CCPoint v47; // rax
__int128 *v48; // [rsp+48h] [rbp-19h] BYREF
float v49; // [rsp+50h] [rbp-11h]
cocos2d::CCRect v50; // [rsp+58h] [rbp-9h] BYREF
__int128 v51; // [rsp+68h] [rbp+7h] BYREF
__int64 v52; // [rsp+78h] [rbp+17h]
unsigned __int64 v53; // [rsp+80h] [rbp+1Fh]
LODWORD(v48) = -1778384896;
result = cocos2d::CCLayerColor::initWithColor(a1, (const struct cocos2d::_ccColor4B *)&v48);
if ( result )
{
if ( !a1->m_forcePrioRegistered )
{
a1->m_forcePrioRegistered = 1;
v6 = cocos2d::CCDirector::sharedDirector(v5);
v7 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v6 + 144LL))(v6);
cocos2d::CCTouchDispatcher::registerForcePrio(v7, a1, 2);
}
a1->m_levelList = a2;
cocos2d::CCObject::retain(a2);
LOBYTE(v8) = 1;
a1->setTouchEnabled(a1, v8);
LOBYTE(v9) = 1;
a1->setKeypadEnabled(a1, v9);
v11 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v10);
cocos2d::CCDirector::getWinSize(v11);
v12 = (cocos2d::CCLayer *)cocos2d::CCLayer::create();
a1->m_mainLayer = v12;
a1->addChild_1(a1, v12);
cocos2d::CCRect::CCRect(&v50, 0.0, 0.0, 80.0, 80.0);
v14 = cocos2d::extension::CCScale9Sprite::create("square04_001.png", v13);
LOBYTE(v15) = -1;
v14->setOpacity(&v14->cocos2d::CCRGBAProtocol, v15);
v14->setColor(&v14->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&word_140529B4C);
v16 = v14->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v48, 420.0, 300.0);
v16->setContentSize(v14, v17);
v18 = ((float (__fastcall *)(cocos2d::CCLayer *, struct cocos2d::extension::CCScale9Sprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v14,
0xFFFFFFFFLL);
v19 = v14->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v18, v49 * 0.5);
v19->setPosition_0(v14, v20);
sub_14003BDB0((__int64)&v51, (__int64)&a1->m_levelList->m_listName);
v21 = (const char *)&v51;
if ( v53 > 0xF )
v21 = (const char *)v51;
v22 = cocos2d::CCLabelBMFont::create(v21, "goldFont.fnt");
sub_14003A830((__int64)&v51);
v23 = ((float (__fastcall *)(cocos2d::CCLayer *, struct cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild_1)(
a1->m_mainLayer,
v22);
v24 = v22->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v23, v49 * 0.5);
v24->setPosition_0(v22, v25);
v27 = (cocos2d::CCMenu *)cocos2d::CCMenu::create(v26);
a1->m_buttonMenu = v27;
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v27, 10);
v48 = &v51;
v51 = 0;
v52 = 0;
v53 = 15;
*(_QWORD *)&v51 = sub_14003AA10(0x20u);
v52 = 30;
v53 = 31;
strcpy((char *)v51, "Please wait, uploading list...");
cocos2d::CCPoint::CCPoint(1.725595e25, 0.5);
v29 = TextArea::create((__int64)&v51, "chatFont.fnt", 1.0, 400.0, v28, 1101004800, 0);
a1->m_textArea = (TextArea *)v29;
v30 = ((float (__fastcall *)(cocos2d::CCLayer *, char *))a1->m_mainLayer->addChild_1)(a1->m_mainLayer, v29);
v31 = a1->m_textArea->__vftable;
v32 = cocos2d::CCPoint::CCPoint(v30, v49 * 0.5);
v31->setPosition_0(a1->m_textArea, v33);
a1->m_joystickConnected = -1;
v34 = LoadingCircle::create();
a1->m_loadingCircle = v34;
v34->m_parentLayer = a1->m_mainLayer;
a1->m_loadingCircle->m_fade = 0;
LoadingCircle::show(a1->m_loadingCircle);
m_sprite = a1->m_loadingCircle->m_sprite;
v36 = m_sprite->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(*(float *)&v32, v49 * 0.5);
v36->setPosition_0(m_sprite, v37);
v38 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v48 = (__int128 *)operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v48);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v38 = (GameLevelManager *)qword_1406C2EC0;
}
v38->m_listUploadDelegate = &a1->ListUploadDelegate;
GameLevelManager::uploadLevelList(v38, a1->m_levelList);
v39 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v40 = CCMenuItemSpriteExtra::create(v39, nullptr, a1, (cocos2d::SEL_MenuHandler *)UploadListPopup::onBack);
a1->m_backButton = v40;
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v40);
v41 = a1->m_backButton->__vftable;
v43 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v42);
cocos2d::CCDirector::getScreenTop(v43);
v45 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v44);
v46 = cocos2d::CCDirector::getScreenLeft(v45) + 40.0;
cocos2d::CCPoint::CCPoint(v46, v46);
v47 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, (const struct cocos2d::CCPoint *)&v48);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v41->setPosition_0)(a1->m_backButton, v47);
return 1;
}
return result;
}