//
// EditorSoundConfigUploadPopup::init from 0x789374 to 0x789d36 (2498 bytes)
//
// 1 xrefs:
// > EditorSoundConfigUploadPopup::create @ 0x789f78
//
// 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:59:35 +0000
//
GameManager *__fastcall EditorSoundConfigUploadPopup::init(
EditorSoundConfigUploadPopup *this,
GJEditorSoundConfig *a2,
EditorSoundConfigInfoLayer *a3)
{
cocos2d::CCDirector *v6; // r0
cocos2d::CCMenu *WinSize; // r0
float v8; // s16
float v9; // s15
float v10; // s19
float v11; // s18
int v12; // r0
const char *v13; // r2
cocos2d::CCLabelBMFont *v14; // r0
cocos2d::CCLabelBMFont *v15; // r5
void (__fastcall *v16)(cocos2d::CCLabelBMFont *, void **); // r7
const char *v17; // r2
cocos2d::CCLabelBMFont *v18; // r5
void (__fastcall *v19)(cocos2d::CCLabelBMFont *, void **); // r3
void (__fastcall *v20)(cocos2d::CCLabelBMFont *, void **); // r7
int v21; // r5
void (__fastcall *v22)(int, void **); // r7
void (__fastcall *v23)(int, void **); // r7
int *UnpackedSoundDesc; // r0
int v25; // r3
int v26; // r0
const char *v27; // r2
bool v28; // zf
int v29; // r3
int v30; // r0
unsigned int v31; // r3
unsigned int v32; // r0
cocos2d::CCLabelBMFont *v33; // r7
int v34; // r6
char *v35; // r0
int v36; // r2
size_t v37; // r2
cocos2d::CCLabelBMFont *v38; // r0
cocos2d::CCLabelBMFont *v39; // r6
void (__fastcall *v40)(cocos2d::CCLabelBMFont *, _DWORD *); // r7
cocos2d::CCArray *v41; // r0
int v42; // r3
cocos2d::CCArray *v43; // r7
const cocos2d::CCPoint *v44; // r10
int v45; // r9
cocos2d::CCArray *v46; // r0
cocos2d::CCArray *v47; // r7
const cocos2d::CCPoint *v48; // r10
int v49; // r9
GJAccountManager *updated; // r0
GJAccountManager *v51; // r0
int v52; // r0
_DWORD *v53; // r3
int v54; // r7
ButtonSprite *v55; // r0
int *v56; // r9
const cocos2d::CCPoint *v57; // r10
int v58; // r3
void (__fastcall *v59)(int *, _DWORD *); // r11
float v60; // s17
cocos2d::CCString *v61; // r0
const char *CString; // r7
size_t v63; // r0
ButtonSprite *v64; // r0
ButtonSprite *v65; // r0
int v66; // r7
void (__fastcall *v67)(int, _DWORD *); // r10
const cocos2d::CCPoint *v68; // r11
ButtonSprite *v69; // r0
int v70; // r7
const cocos2d::CCPoint *v71; // r11
void (__fastcall *v72)(int, _DWORD *); // r10
const char *v73; // r1
void (__fastcall *v74)(int *, _DWORD *); // r7
ButtonSprite *v75; // r0
int v76; // r6
const cocos2d::CCPoint *v77; // r9
void (__fastcall *v78)(int, _DWORD *); // r8
int v79; // r6
int v80; // r5
const cocos2d::CCPoint *v81; // r9
void (__fastcall *v82)(int, _BYTE *); // r8
float v84; // [sp+10h] [bp-C4h]
float v85; // [sp+10h] [bp-C4h]
float v86; // [sp+10h] [bp-C4h]
GameManager *v87; // [sp+24h] [bp-B0h]
float v88; // [sp+30h] [bp-A4h] BYREF
float v89; // [sp+34h] [bp-A0h]
_BYTE v90[8]; // [sp+38h] [bp-9Ch] BYREF
_BYTE v91[8]; // [sp+40h] [bp-94h] BYREF
int (__fastcall *v92)(EditorSoundConfigUploadPopup *, cocos2d::CCObject *); // [sp+48h] [bp-8Ch]
int v93; // [sp+4Ch] [bp-88h]
int (__fastcall *v94)(int, cocos2d::CCObject *); // [sp+50h] [bp-84h]
int v95; // [sp+54h] [bp-80h]
int (__fastcall *v96)(EditorSoundConfigUploadPopup *, cocos2d::CCObject *); // [sp+58h] [bp-7Ch]
int v97; // [sp+5Ch] [bp-78h]
GJAccountManager *(__fastcall *v98)(EditorSoundConfigUploadPopup *, cocos2d::CCObject *); // [sp+60h] [bp-74h]
int v99; // [sp+64h] [bp-70h]
_DWORD v100[2]; // [sp+68h] [bp-6Ch] BYREF
_DWORD v101[2]; // [sp+70h] [bp-64h] BYREF
_DWORD v102[2]; // [sp+78h] [bp-5Ch] BYREF
int v103[3]; // [sp+80h] [bp-54h] BYREF
int v104; // [sp+8Ch] [bp-48h] BYREF
unsigned int v105; // [sp+90h] [bp-44h]
cocos2d::CCLabelBMFont *v106; // [sp+94h] [bp-40h]
int v107; // [sp+98h] [bp-3Ch] BYREF
unsigned int v108; // [sp+9Ch] [bp-38h]
cocos2d::CCLabelBMFont *v109; // [sp+A0h] [bp-34h]
int v110[3]; // [sp+A4h] [bp-30h] BYREF
int v111; // [sp+B0h] [bp-24h] BYREF
int v112; // [sp+B4h] [bp-20h]
ButtonSprite *v113; // [sp+B8h] [bp-1Ch]
void *v114; // [sp+BCh] [bp-18h] BYREF
_BYTE *v115; // [sp+C0h] [bp-14h]
int v116; // [sp+C4h] [bp-10h]
if ( !a2 )
return nullptr;
v87 = SetupTriggerPopup::init(this, nullptr, nullptr, 340.0, 240.0, (_BYTE *)&dword_0 + 1, 0.0);
if ( !v87 )
return nullptr;
*((_DWORD *)this + 184) = a2;
*((_DWORD *)this + 193) = a3;
v6 = (cocos2d::CCDirector *)SetupTriggerPopup::preSetup(this);
*((_BYTE *)this + 468) = 1;
cocos2d::CCDirector::sharedDirector(v6);
WinSize = (cocos2d::CCMenu *)cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v88);
v8 = v88 * 0.5;
v9 = *((float *)this + 140) * 0.5;
v10 = (float)(v89 * 0.5) + v9;
v11 = (float)(v89 * 0.5) - v9;
v12 = cocos2d::CCMenu::create(WinSize);
*((_DWORD *)this + 111) = v12;
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v12, 10);
v111 = 0;
v112 = 0;
v113 = nullptr;
std::string::__init(&v111, "Upload Sound Pack", 0x11u);
SetupTriggerPopup::addTitle((int)this, (unsigned __int8 *)&v111);
std::string::~string((int)&v111);
std::string::basic_string(v103, *((_DWORD *)this + 184) + 324);
if ( (v103[0] & 1) != 0 )
{
if ( v103[1] )
{
LABEL_6:
v14 = (cocos2d::CCLabelBMFont *)v103[2];
goto LABEL_11;
}
}
else if ( LOBYTE(v103[0]) >> 1 )
{
goto LABEL_8;
}
std::string::assign(v103, "-");
if ( (v103[0] & 1) != 0 )
goto LABEL_6;
LABEL_8:
v14 = (cocos2d::CCLabelBMFont *)((char *)v103 + 1);
LABEL_11:
v15 = (cocos2d::CCLabelBMFont *)cocos2d::CCLabelBMFont::create(v14, "goldFont.fnt", v13);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, int))(*(_DWORD *)v15 + 80))(v15, 1061997773);
cocos2d::CCLabelBMFont::limitLabelWidth(v15, *((float *)this + 139) - 60.0, 0.8, 0.3);
v16 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, void **))(*(_DWORD *)v15 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v114, v8, v10 - 48.0);
v16(v15, &v114);
(*(void (__fastcall **)(_DWORD, cocos2d::CCLabelBMFont *))(**((_DWORD **)this + 115) + 228))(
*((_DWORD *)this + 115),
v15);
v18 = (cocos2d::CCLabelBMFont *)cocos2d::CCLabelBMFont::create(
(cocos2d::CCLabelBMFont *)"You cannot change the name once it is shared.",
"chatFont.fnt",
v17);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, int))(*(_DWORD *)v18 + 80))(v18, 1056964608);
v19 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, void **))(*(_DWORD *)v18 + 536);
LOWORD(v114) = -5121;
BYTE2(v114) = 120;
v19(v18, &v114);
cocos2d::CCLabelBMFont::limitLabelWidth(v18, *((float *)this + 139) - 50.0, 0.5, 0.25);
v20 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, void **))(*(_DWORD *)v18 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v114, v8, v10 - 70.0);
v20(v18, &v114);
(*(void (__fastcall **)(_DWORD, cocos2d::CCLabelBMFont *))(**((_DWORD **)this + 115) + 228))(
*((_DWORD *)this + 115),
v18);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)&v114, 0.0, 0.0, 40.0, 40.0);
v21 = cocos2d::extension::CCScale9Sprite::create("square02_small.png", &v114);
v22 = *(void (__fastcall **)(int, void **))(*(_DWORD *)v21 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v114, *((float *)this + 139) - 40.0, 52.0);
v22(v21, &v114);
(*(void (__fastcall **)(int, void *))(*(_DWORD *)v21 + 480))(v21, &unk_BF0D50);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v21 + 456))(v21, 90);
v23 = *(void (__fastcall **)(int, void **))(*(_DWORD *)v21 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v114, v8, v10 - 108.0);
v23(v21, &v114);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 115) + 228))(*((_DWORD *)this + 115), v21);
UnpackedSoundDesc = (int *)GJEditorSoundConfig::getUnpackedSoundDesc((GJEditorSoundConfig *)&v104);
if ( (v104 & 1) != 0 )
v25 = v105;
else
v25 = (int)(unsigned __int8)v104 >> 1;
if ( !v25 )
UnpackedSoundDesc = std::string::assign(&v104, "(No description provided)");
v114 = nullptr;
v115 = nullptr;
v116 = 0;
v26 = EmoteSprite::maxEmotesComment((EmoteSprite *)UnpackedSoundDesc);
EmoteSprite::parseTokens((unsigned __int8 *)&v104, (int)&v114, v26);
v27 = (const char *)v114;
if ( v114 == v115 )
goto LABEL_41;
EmoteSprite::replaceTokens(&v107, (unsigned __int8 *)&v104, &v114, 0.0);
v29 = v104 & 1;
v28 = v29 == 0;
if ( (v104 & 1) != 0 )
{
v29 = 0;
*(_BYTE *)v106 = 0;
}
else
{
LOBYTE(v104) = v29;
BYTE1(v104) = v29;
}
if ( !v28 )
v105 = v29;
if ( (v104 & 1) != 0 )
{
v30 = v105;
v31 = (v104 & 0xFFFFFFFE) - 1;
if ( v105 <= 0xA )
{
if ( (v104 & 0xFFFFFFFE) != 0xB )
goto LABEL_29;
goto LABEL_40;
}
}
else
{
v30 = (int)(unsigned __int8)v104 >> 1;
if ( v30 <= 10 )
goto LABEL_40;
v31 = 10;
}
v32 = (v30 + 16) & 0xFFFFFFF0;
if ( v32 - 1 != v31 )
{
if ( v32 != 11 )
{
v35 = (char *)operator new(v32);
v34 = v104 & 1;
if ( (v104 & 1) != 0 )
v33 = v106;
else
v33 = (cocos2d::CCLabelBMFont *)((char *)&v104 + 1);
LABEL_33:
if ( (v104 & 1) != 0 )
v36 = v105;
else
v36 = (int)(unsigned __int8)v104 >> 1;
v37 = v36 + 1;
if ( v37 )
memcpy(v35, v33, v37);
if ( v34 )
operator delete(v33);
goto LABEL_40;
}
LABEL_29:
v33 = v106;
v34 = 1;
v35 = (char *)&v104 + 1;
goto LABEL_33;
}
LABEL_40:
v104 = v107;
v105 = v108;
v106 = v109;
v107 = 0;
v108 = 0;
v109 = nullptr;
std::string::~string((int)&v107);
LABEL_41:
if ( (v104 & 1) != 0 )
v38 = v106;
else
v38 = (cocos2d::CCLabelBMFont *)((char *)&v104 + 1);
v39 = (cocos2d::CCLabelBMFont *)cocos2d::CCLabelBMFont::create(v38, "chatFont.fnt", v27);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, int))(*(_DWORD *)v39 + 80))(v39, 1057803469);
cocos2d::CCLabelBMFont::limitLabelWidth(v39, *((float *)this + 139) - 56.0, 0.55, 0.2);
v40 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, _DWORD *))(*(_DWORD *)v39 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v102, v8, v10 - 108.0);
v40(v39, v102);
(*(void (__fastcall **)(_DWORD, cocos2d::CCLabelBMFont *))(**((_DWORD **)this + 115) + 228))(
*((_DWORD *)this + 115),
v39);
v41 = (cocos2d::CCArray *)EmoteSprite::attachToLabel((int)v39, *((_DWORD *)this + 115), &v114, 0.0);
v42 = *(_DWORD *)(*((_DWORD *)this + 184) + 308);
*((_BYTE *)this + 756) = (unsigned int)(v42 - 3) <= 1;
*((_BYTE *)this + 757) = v42 == 3;
v43 = (cocos2d::CCArray *)cocos2d::CCArray::create(v41);
memset(v110, 0, sizeof(v110));
std::string::__init(v110, "Unlisted", 8u);
v44 = *((const cocos2d::CCPoint **)this + 111);
v93 = 0;
v45 = *((unsigned __int8 *)this + 756);
v92 = EditorSoundConfigUploadPopup::onToggleUnlisted;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v102, v8 - 120.0, v10 - 155.0);
*((_DWORD *)this + 185) = GameToolbox::createToggleButton(
(int)v110,
(int)v92,
v93,
v45,
v44,
(const cocos2d::CCPoint *)v102,
(int)this,
*((_DWORD *)this + 115),
v43);
std::string::~string((int)v110);
v46 = (cocos2d::CCArray *)cocos2d::CCArray::objectAtIndex(v43, 1u);
*((_DWORD *)this + 187) = v46;
v47 = (cocos2d::CCArray *)cocos2d::CCArray::create(v46);
v111 = 0;
v112 = 0;
v113 = nullptr;
std::string::__init(&v111, "Friends Only", 0xCu);
v48 = *((const cocos2d::CCPoint **)this + 111);
v95 = 0;
v49 = *((unsigned __int8 *)this + 757);
v94 = EditorSoundConfigUploadPopup::onToggleFriendsOnly;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v102, v8 + 20.0, v10 - 155.0);
*((_DWORD *)this + 186) = GameToolbox::createToggleButton(
(int)&v111,
(int)v94,
v95,
v49,
v48,
(const cocos2d::CCPoint *)v102,
(int)this,
*((_DWORD *)this + 115),
v47);
std::string::~string((int)&v111);
*((_DWORD *)this + 188) = cocos2d::CCArray::objectAtIndex(v47, 1u);
updated = (GJAccountManager *)EditorSoundConfigUploadPopup::updateVisibilityState(this);
v51 = (GJAccountManager *)GJAccountManager::sharedState(updated);
if ( v51 )
{
v52 = GJAccountManager::sharedState(v51);
v51 = (GJAccountManager *)(*(_DWORD *)(v52 + 280) - *(_DWORD *)(v52 + 284));
}
v53 = *((_DWORD **)this + 184);
v54 = v53[66];
if ( v54 )
{
v54 = 0;
}
else if ( (int)v53[71] > 0 && (int)v51 > 0 )
{
v54 = v51 == (GJAccountManager *)v53[72];
}
v55 = ButtonSprite::create(
(ButtonSprite *)"Cancel",
(const char *)off_3C,
0,
0.7,
1,
"bigFont.fnt",
"GJ_button_06.png",
(const char *)0x41F00000,
v84);
v97 = 0;
v96 = EditorSoundConfigUploadPopup::onCancel;
v56 = (int *)CCMenuItemSpriteExtra::create((int)v55, 0, (int)this, (int)EditorSoundConfigUploadPopup::onCancel, 0);
(*(void (__fastcall **)(_DWORD, int *))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v56);
*((_DWORD *)this + 182) = v56;
v57 = *((const cocos2d::CCPoint **)this + 111);
v58 = *v56;
if ( v54 )
{
v59 = *(void (__fastcall **)(int *, _DWORD *))(v58 + 92);
v60 = v11 + 25.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v101, v8 - 110.0, v11 + 25.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v102, v57);
v59(v56, v102);
v61 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Update #%d",
*(const char **)(*((_DWORD *)this + 184) + 284));
CString = (const char *)cocos2d::CCString::getCString(v61);
v111 = 0;
v112 = 0;
v113 = nullptr;
v63 = strlen(CString);
std::string::__init(&v111, CString, v63);
if ( (v111 & 1) != 0 )
v64 = v113;
else
v64 = (ButtonSprite *)((char *)&v111 + 1);
v65 = ButtonSprite::create(
v64,
(const char *)&dword_58 + 2,
0,
0.55,
1,
"goldFont.fnt",
"GJ_button_01.png",
(const char *)0x41F00000,
v85);
v99 = 0;
v98 = EditorSoundConfigUploadPopup::onUploadAsUpdate;
v66 = CCMenuItemSpriteExtra::create((int)v65, 0, (int)this, (int)EditorSoundConfigUploadPopup::onUploadAsUpdate, 0);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v66);
v67 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v66 + 92);
v68 = *((const cocos2d::CCPoint **)this + 111);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v101, v8, v60);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v102, v68);
v67(v66, v102);
*((_DWORD *)this + 181) = v66;
v69 = ButtonSprite::create(
(ButtonSprite *)"Upload as New",
(const char *)&dword_58 + 2,
0,
0.55,
1,
"bigFont.fnt",
"GJ_button_02.png",
(const char *)0x41F00000,
v86);
v100[1] = 0;
v100[0] = EditorSoundConfigUploadPopup::onUpload;
v70 = CCMenuItemSpriteExtra::create((int)v69, 0, (int)this, (int)EditorSoundConfigUploadPopup::onUpload, 0);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v70);
v71 = *((const cocos2d::CCPoint **)this + 111);
v72 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v70 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v101, v8 + 110.0, v60);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v102, v71);
v72(v70, v102);
*((_DWORD *)this + 180) = v70;
std::string::~string((int)&v111);
}
else
{
v74 = *(void (__fastcall **)(int *, _DWORD *))(v58 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v101, v8 - 60.0, v11 + 25.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v102, v57);
v74(v56, v102);
v75 = ButtonSprite::create(
(ButtonSprite *)"Upload",
(const char *)off_3C,
0,
0.7,
1,
"goldFont.fnt",
"GJ_button_01.png",
(const char *)0x41F00000,
v85);
v101[1] = 0;
v101[0] = EditorSoundConfigUploadPopup::onUpload;
v76 = CCMenuItemSpriteExtra::create((int)v75, 0, (int)this, (int)EditorSoundConfigUploadPopup::onUpload, 0);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v76);
v77 = *((const cocos2d::CCPoint **)this + 111);
v78 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v76 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v100, v8 + 60.0, v11 + 25.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v102, v77);
v78(v76, v102);
*((_DWORD *)this + 180) = v76;
}
v79 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v73);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v79 + 80))(v79, 1060320051);
v102[0] = 684;
v102[1] = 1;
v80 = CCMenuItemSpriteExtra::create(v79, 0, (int)this, 684, 1);
CCMenuItemSpriteExtra::setSizeMult(v80, 1.2);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v80);
v81 = *((const cocos2d::CCPoint **)this + 111);
v82 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v80 + 92);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v90,
(float)(v8 - (float)(*((float *)this + 139) * 0.5)) + 10.0,
v10 - 10.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v91, v81);
v82(v80, v91);
*((_DWORD *)this + 191) = v80;
SetupTriggerPopup::postSetup(this);
if ( v114 )
{
v115 -= 12 * ((715827883 * ((unsigned int)(v115 - (_BYTE *)v114) >> 2)) & 0x3FFFFFFF);
operator delete(v114);
}
std::string::~string((int)&v104);
std::string::~string((int)v103);
return v87;
}