//
// UploadActionPopup::init from 0x1402952c0 to 0x14029571f (1119 bytes)
//
// 2 xrefs:
// > UploadActionPopup::create @ 0x140295267
// > ??> @ 0x1406d1b8c
//
// 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=2
char __fastcall UploadActionPopup::init(__int64 a1, __int64 a2, _QWORD *a3)
{
__int64 v6; // rdx
__int64 v7; // rcx
__int64 v9; // rax
cocos2d::CCTouchDispatcher *v10; // rax
__int64 v11; // rdx
__int64 v12; // rcx
cocos2d::CCDirector *v13; // rax
__int64 v14; // rax
struct cocos2d::CCRect *v15; // rax
struct cocos2d::extension::CCScale9Sprite *v16; // rdi
cocos2d::extension::CCScale9Sprite_vtbl *v17; // rbx
const cocos2d::CCSize *v18; // rax
float v19; // xmm0_4
cocos2d::extension::CCScale9Sprite_vtbl *v20; // rbx
const cocos2d::CCPoint *v21; // rax
__int64 v22; // rcx
__int64 v23; // rax
_BYTE *v24; // rdx
size_t v25; // r8
const struct cocos2d::CCPoint *v26; // rax
char *v27; // rax
float v28; // xmm0_4
__int64 v29; // rbx
__int64 v30; // rax
double v31; // xmm0_8
LoadingCircle *v32; // rax
__int64 *v33; // rbx
__int64 v34; // rdi
__int64 v35; // rax
struct cocos2d::CCSprite *v36; // rbx
CCMenuItemSpriteExtra *v37; // rax
float v38; // xmm0_4
__int64 v39; // rbx
struct cocos2d::CCPoint v40; // rax
__int128 *v41; // [rsp+48h] [rbp-29h] BYREF
float v42; // [rsp+50h] [rbp-21h]
cocos2d::CCRect v43; // [rsp+58h] [rbp-19h] BYREF
__int128 v44; // [rsp+68h] [rbp-9h] BYREF
__int64 v45; // [rsp+78h] [rbp+7h]
__int64 v46; // [rsp+80h] [rbp+Fh]
_QWORD *v47; // [rsp+88h] [rbp+17h]
v47 = a3;
LODWORD(v41) = -1778384896;
if ( cocos2d::CCLayerColor::initWithColor((cocos2d::CCLayerColor *)a1, (const struct cocos2d::_ccColor4B *)&v41) )
{
if ( !*(_BYTE *)(a1 + 628) )
{
*(_BYTE *)(a1 + 628) = 1;
v9 = cocos2d::CCDirector::sharedDirector(v7);
v10 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v9 + 144LL))(v9);
cocos2d::CCTouchDispatcher::registerForcePrio(v10, (struct cocos2d::CCObject *)a1, 2);
}
*(_QWORD *)(a1 + 632) = a2;
LOBYTE(v6) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 904LL))(a1, v6);
LOBYTE(v11) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 976LL))(a1, v11);
v13 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v12);
cocos2d::CCDirector::getWinSize(v13);
v14 = cocos2d::CCLayer::create();
*(_QWORD *)(a1 + 576) = v14;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 448LL))(a1, v14);
cocos2d::CCRect::CCRect(&v43, 0.0, 0.0, 80.0, 80.0);
v16 = cocos2d::extension::CCScale9Sprite::create("GJ_square02.png", v15);
v17 = v16->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v41, 200.0, 100.0);
v17->setContentSize(v16, v18);
v19 = (*(float (__fastcall **)(_QWORD, struct cocos2d::extension::CCScale9Sprite *, __int64))(**(_QWORD **)(a1 + 576)
+ 440LL))(
*(_QWORD *)(a1 + 576),
v16,
0xFFFFFFFFLL);
v20 = v16->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v19, v42 * 0.5);
v20->setPosition_0(v16, v21);
v23 = cocos2d::CCMenu::create(v22);
*(_QWORD *)(a1 + 544) = v23;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 576) + 440LL))(*(_QWORD *)(a1 + 576), v23, 10);
v41 = &v44;
v24 = a3;
if ( a3[3] > 0xFu )
v24 = (_BYTE *)*a3;
v44 = 0;
v45 = 0;
v46 = 0;
v25 = -1;
do
++v25;
while ( v24[v25] );
sub_14003A930(&v44, v24, v25);
cocos2d::CCPoint::CCPoint(0.0, 0.5);
v27 = TextArea::create((__int64)&v44, "chatFont.fnt", 1.0, 400.0, v26, 1101004800, 0);
*(_QWORD *)(a1 + 640) = v27;
v28 = (*(float (__fastcall **)(_QWORD, char *))(**(_QWORD **)(a1 + 576) + 448LL))(*(_QWORD *)(a1 + 576), v27);
v29 = **(_QWORD **)(a1 + 640);
cocos2d::CCPoint::CCPoint(v28, v42 * 0.5);
v31 = (*(double (__fastcall **)(_QWORD, __int64))(v29 + 184))(*(_QWORD *)(a1 + 640), v30);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 640) + 160LL))(*(_QWORD *)(a1 + 640));
*(_DWORD *)(a1 + 624) = -1;
v32 = LoadingCircle::create();
*(_QWORD *)(a1 + 648) = v32;
v32->m_parentLayer = *(cocos2d::CCLayer **)(a1 + 576);
*(_BYTE *)(*(_QWORD *)(a1 + 648) + 560LL) = 0;
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 648) + 160LL))(*(_QWORD *)(a1 + 648));
LoadingCircle::show(*(LoadingCircle **)(a1 + 648));
v33 = *(__int64 **)(*(_QWORD *)(a1 + 648) + 544LL);
v34 = *v33;
cocos2d::CCPoint::CCPoint(*(float *)&v31, v42 * 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v34 + 184))(v33, v35);
v36 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v36->setScale_0)(v36);
v37 = CCMenuItemSpriteExtra::create(
v36,
nullptr,
(cocos2d::CCObject *)a1,
(cocos2d::SEL_MenuHandler *)UploadActionPopup::onClose);
*(_QWORD *)(a1 + 656) = v37;
HIDWORD(v37->m_pfnSelector.adj) = 1070386381;
v38 = (*(float (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 544) + 448LL))(
*(_QWORD *)(a1 + 544),
*(_QWORD *)(a1 + 656));
v39 = **(_QWORD **)(a1 + 656);
cocos2d::CCPoint::CCPoint(v38, (float)((float)(v42 * 0.5) - 100.0) + 5.0);
v40 = cocos2d::CCNode::convertToNodeSpace(*(cocos2d::CCNode **)(a1 + 544), (const struct cocos2d::CCPoint *)&v41);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCPoint))(v39 + 184))(*(_QWORD *)(a1 + 656), v40);
sub_14003A830((__int64)a3);
return 1;
}
else
{
sub_14003A830((__int64)a3);
return 0;
}
}