//
// UploadPopup::init from 0x4a3824 to 0x4a3bde (954 bytes)
//
// 1 xrefs:
// > UploadPopup::create @ 0x4a3c98
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:49:52 +0000
//
int __fastcall UploadPopup::init(UploadPopup *this, GJGameLevel *a2)
{
int v4; // r8
cocos2d::CCDirector *v5; // r0
cocos2d::CCLayer *WinSize; // r0
int v7; // r0
int v8; // r3
int v9; // r6
void (__fastcall *v10)(int, _DWORD *); // r10
void (__fastcall *v11)(int, _DWORD *); // r10
int v12; // r3
int *v13; // r3
int v14; // r1
cocos2d::CCLabelBMFont *v15; // r2
cocos2d::CCLabelBMFont *v16; // r0
int v17; // r9
int (__fastcall *v18)(int, _DWORD *); // r10
cocos2d::CCMenu *v19; // r0
int v20; // r0
int v21; // r9
int (__fastcall *v22)(int, _DWORD *); // r10
LoadingCircle *v23; // r0
cocos2d::CCLayerColor *v24; // r0
int v25; // r3
int v26; // r10
int (__fastcall *v27)(int, _DWORD *); // r11
GameLevelManager *v28; // r0
int v29; // r5
const char *v30; // r1
GameLevelManager *v31; // r0
GameLevelManager *v32; // r0
int v33; // r0
int v34; // r0
cocos2d::CCDirector *v35; // r0
int v36; // r6
const cocos2d::CCPoint *v37; // r10
void (__fastcall *v38)(int, _BYTE *); // r9
cocos2d::CCDirector *v39; // r0
float v40; // s16
cocos2d::CCDirector *v41; // r0
float v42; // r0
float v44; // [sp+10h] [bp-3Ch] BYREF
float v45; // [sp+14h] [bp-38h]
char v46[8]; // [sp+18h] [bp-34h] BYREF
_BYTE v47[8]; // [sp+20h] [bp-2Ch] BYREF
int v48; // [sp+28h] [bp-24h] BYREF
int v49; // [sp+2Ch] [bp-20h]
cocos2d::CCLabelBMFont *v50; // [sp+30h] [bp-1Ch]
_DWORD v51[4]; // [sp+34h] [bp-18h] BYREF
v51[0] = -1778384896;
v4 = cocos2d::CCLayerColor::initWithColor(this, v51);
if ( v4 )
{
FLAlertLayer::incrementForcePrio(this);
*((_DWORD *)this + 131) = a2;
cocos2d::CCObject::retain(a2);
(*(void (__fastcall **)(UploadPopup *, int))(*(_DWORD *)this + 500))(this, 1);
v5 = (cocos2d::CCDirector *)(*(int (__fastcall **)(UploadPopup *, int))(*(_DWORD *)this + 536))(this, 1);
cocos2d::CCDirector::sharedDirector(v5);
WinSize = (cocos2d::CCLayer *)cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v44);
v7 = cocos2d::CCLayer::create(WinSize);
v8 = *(_DWORD *)this;
*((_DWORD *)this + 115) = v7;
(*(void (__fastcall **)(UploadPopup *, int))(v8 + 228))(this, v7);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v51, 0.0, 0.0, 80.0, 80.0);
v9 = cocos2d::extension::CCScale9Sprite::create("square04_001.png", v51);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v9 + 456))(v9, 255);
(*(void (__fastcall **)(int, void *))(*(_DWORD *)v9 + 480))(v9, &unk_BEC166);
v10 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v9 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v51, 420.0, 300.0);
v10(v9, v51);
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v9, -1);
v11 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v9 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v51, v44 * 0.5, v45 * 0.5);
v11(v9, v51);
v12 = *((_DWORD *)this + 131);
v48 = 0;
v49 = 0;
v50 = nullptr;
if ( (*(_BYTE *)(v12 + 280) & 1) != 0 )
{
std::string::__init(&v48, *(const void **)(v12 + 288), *(_DWORD *)(v12 + 284));
}
else
{
v13 = (int *)(v12 + 280);
v14 = v13[1];
v15 = (cocos2d::CCLabelBMFont *)v13[2];
v48 = *v13;
v49 = v14;
v50 = v15;
}
if ( (v48 & 1) != 0 )
v16 = v50;
else
v16 = (cocos2d::CCLabelBMFont *)((char *)&v48 + 1);
v17 = cocos2d::CCLabelBMFont::create(v16, "goldFont.fnt", (const char *)v15);
std::string::~string((int)&v48);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 115) + 228))(*((_DWORD *)this + 115), v17);
v18 = *(int (__fastcall **)(int, _DWORD *))(*(_DWORD *)v17 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v51, v44 * 0.5, (float)((float)(v45 * 0.5) + 150.0) - 25.0);
v19 = (cocos2d::CCMenu *)v18(v17, v51);
v20 = cocos2d::CCMenu::create(v19);
*((_DWORD *)this + 111) = v20;
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v20, 10);
v48 = 0;
v49 = 0;
v50 = nullptr;
std::string::__init(&v48, "Please wait, uploading level...", 0x1Fu);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v51, 0.5, 1.0);
*((_DWORD *)this + 132) = TextArea::create(
(int)&v48,
"chatFont.fnt",
1065353216,
1137180672,
(const cocos2d::CCPoint *)v51,
COERCE_INT(20.0),
0,
0);
std::string::~string((int)&v48);
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 115) + 228))(
*((_DWORD *)this + 115),
*((_DWORD *)this + 132));
v21 = *((_DWORD *)this + 132);
v22 = *(int (__fastcall **)(int, _DWORD *))(*(_DWORD *)v21 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v51, v44 * 0.5, (float)(v45 * 0.5) - 30.0);
v23 = (LoadingCircle *)v22(v21, v51);
*((_DWORD *)this + 125) = -1;
v24 = LoadingCircle::create(v23);
v25 = *((_DWORD *)this + 115);
*((_DWORD *)this + 133) = v24;
*((_DWORD *)v24 + 111) = v25;
*(_BYTE *)(*((_DWORD *)this + 133) + 448) = 0;
LoadingCircle::show(*((cocos2d::CCNode ***)this + 133));
v26 = *(_DWORD *)(*((_DWORD *)this + 133) + 440);
v27 = *(int (__fastcall **)(int, _DWORD *))(*(_DWORD *)v26 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v51, v44 * 0.5, (float)(v45 * 0.5) + 20.0);
v28 = (GameLevelManager *)v27(v26, v51);
if ( *(_BYTE *)(*((_DWORD *)this + 131) + 609) )
{
(*(void (__fastcall **)(UploadPopup *))(*(_DWORD *)this + 672))(this);
v29 = *((_DWORD *)this + 132);
v48 = 0;
v49 = 0;
v50 = nullptr;
std::string::__init(&v48, "Level already uploaded", 0x16u);
TextArea::setString(v29, &v48);
std::string::~string((int)&v48);
}
else
{
v31 = (GameLevelManager *)GameLevelManager::sharedState(v28);
*((_DWORD *)v31 + 211) = (char *)this + 520;
v32 = (GameLevelManager *)GameLevelManager::sharedState(v31);
GameLevelManager::uploadLevel(v32, *((GJGameLevel **)this + 131));
}
v33 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_arrow_01_001.png", v30);
v51[0] = UploadPopup::onBack;
v51[1] = 0;
v34 = CCMenuItemSpriteExtra::create(v33, 0, (int)this, (int)UploadPopup::onBack, 0);
*((_DWORD *)this + 134) = v34;
v35 = (cocos2d::CCDirector *)(*(int (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(
*((_DWORD *)this + 111),
v34);
v36 = *((_DWORD *)this + 134);
v37 = *((const cocos2d::CCPoint **)this + 111);
v38 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v36 + 92);
v39 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v35);
v40 = COERCE_FLOAT(cocos2d::CCDirector::getScreenLeft(v39));
v41 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)LODWORD(v40));
v42 = COERCE_FLOAT(cocos2d::CCDirector::getScreenTop(v41));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v46, v40 + 40.0, v42 - 40.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v47, v37);
v38(v36, v47);
}
return v4;
}