//
// SoundPackDescPopup::init from 0x7865f8 to 0x786bec (1524 bytes)
//
// 1 xrefs:
// > SoundPackDescPopup::create @ 0x786cda
//
// 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:33 +0000
//
GameManager *__fastcall SoundPackDescPopup::init(int a1, unsigned __int8 *a2, unsigned __int8 *a3, int a4)
{
GameManager *v8; // r9
unsigned __int8 *v9; // r0
float v10; // s17
float v11; // s18
float v12; // s17
const char *v13; // r1
int v14; // r6
int v15; // r6
void (__fastcall *v16)(int, _DWORD *); // r7
int v17; // r6
void (__fastcall *v18)(int, _DWORD *); // r7
void (__fastcall *v19)(int, _DWORD *); // r3
void (__fastcall *v20)(int, _DWORD *); // r7
int *v21; // r0
void (__fastcall *v22)(cocos2d::CCPoint *, _DWORD *); // r6
int *v23; // r0
int v24; // r6
EmoteSprite *v25; // r0
CCTextInputNode *v26; // r6
int v27; // r0
int v28; // r6
TextArea *v29; // r6
void (__fastcall *v30)(TextArea *, _DWORD *); // r7
void (__fastcall *v31)(TextArea *, _DWORD *); // r7
unsigned int v32; // r3
int v33; // r7
const char *v34; // r6
size_t v35; // r0
ButtonSprite *v36; // r0
int v37; // r8
float v38; // s16
const char *v39; // r2
int v40; // r8
void (__fastcall *v41)(int, _DWORD *); // r11
void (__fastcall *v42)(int, _DWORD *); // r11
int v43; // r10
void (__fastcall *v44)(int, _DWORD *); // r11
int v45; // r0
const cocos2d::CCPoint *v46; // r11
void (__fastcall *v47)(cocos2d::CCPoint *, _DWORD *); // r10
float *v48; // r0
int v49; // r1
int v50; // r2
int v51; // r3
cocos2d::CCSprite *v52; // r6
int v53; // r5
const cocos2d::CCPoint *v54; // r7
void (__fastcall *v55)(int, _BYTE *); // r6
char *v57; // [sp+8h] [bp-74h]
float v58; // [sp+10h] [bp-6Ch]
cocos2d::CCPoint *v59; // [sp+14h] [bp-68h]
cocos2d::CCPoint *v60; // [sp+14h] [bp-68h]
cocos2d::CCPoint *v61; // [sp+14h] [bp-68h]
cocos2d::CCPoint *v62; // [sp+14h] [bp-68h]
cocos2d::CCPoint *v63; // [sp+1Ch] [bp-60h]
int v64; // [sp+24h] [bp-58h]
float v65[2]; // [sp+28h] [bp-54h] BYREF
_BYTE v66[8]; // [sp+30h] [bp-4Ch] BYREF
_BYTE v67[8]; // [sp+38h] [bp-44h] BYREF
int v68; // [sp+40h] [bp-3Ch]
int v69; // [sp+44h] [bp-38h]
int (__fastcall *v70)(SoundPackDescPopup *, cocos2d::CCObject *); // [sp+48h] [bp-34h]
int v71; // [sp+4Ch] [bp-30h]
_DWORD v72[2]; // [sp+50h] [bp-2Ch] BYREF
int v73; // [sp+58h] [bp-24h] BYREF
int v74; // [sp+5Ch] [bp-20h]
int v75; // [sp+60h] [bp-1Ch]
_DWORD v76[4]; // [sp+64h] [bp-18h] BYREF
v8 = SetupTriggerPopup::init((SetupTriggerPopup *)a1, nullptr, nullptr, 340.0, 190.0, (char *)&dword_0 + 1, 0.0);
if ( v8 )
{
*(_DWORD *)(a1 + 716) = a4;
v9 = std::string::operator=((unsigned __int8 *)(a1 + 728), a3);
cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v9);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v65);
v10 = v65[0];
v73 = 0;
v74 = 0;
v11 = v65[1] * 0.5;
v75 = 0;
std::string::__init(&v73, "Description", 0xBu);
v12 = v10 * 0.5;
SetupTriggerPopup::addTitle(a1, (unsigned __int8 *)&v73);
std::string::~string((int)&v73);
v14 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v13);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v14 + 80))(v14, 1061997773);
v68 = 684;
v69 = 1;
v15 = CCMenuItemSpriteExtra::create(v14, 0, a1, 684, 1);
CCMenuItemSpriteExtra::setSizeMult(v15, 1.5);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 444) + 228))(*(_DWORD *)(a1 + 444), v15);
v16 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v15 + 92);
v59 = *(cocos2d::CCPoint **)(a1 + 444);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v72, (float)(v12 - 170.0) + 8.0, (float)(v11 + 95.0) - 12.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v76, v59);
v16(v15, v76);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v76, 0.0, 0.0, 40.0, 40.0);
v17 = cocos2d::extension::CCScale9Sprite::create("square02b_small.png", v76);
v18 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v17 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v76, 300.0, 92.0);
v18(v17, v76);
v19 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v17 + 480);
LOWORD(v76[0]) = 13405;
BYTE2(v76[0]) = 31;
v19(v17, v76);
v20 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v17 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v76, v12, v11 + 8.0);
v20(v17, v76);
(*(void (__fastcall **)(_DWORD, int, _DWORD))(**(_DWORD **)(a1 + 460) + 232))(*(_DWORD *)(a1 + 460), v17, 0);
*(_DWORD *)(a1 + 724) = 1133248512;
v21 = CCTextInputNode::create(
(CCTextInputNode *)0x43900000,
82.0,
"Describe this sound pack",
"Thonburi",
(const char *)&dword_18,
nullptr,
v57);
*(_DWORD *)(a1 + 720) = v21;
*((_BYTE *)v21 + 432) = 0;
v60 = *(cocos2d::CCPoint **)(a1 + 720);
v22 = *(void (__fastcall **)(cocos2d::CCPoint *, _DWORD *))(*(_DWORD *)v60 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v76, v12, v11 + 8.0);
v22(v60, v76);
v23 = CCTextInputNode::setUnicodeText(*(int **)(a1 + 720), 1);
v24 = *(_DWORD *)(a1 + 720);
v25 = (EmoteSprite *)(17 * EmoteSprite::maxEmotesComment((EmoteSprite *)v23) + 140);
*(_DWORD *)(v24 + 424) = v25;
v26 = *(CCTextInputNode **)(a1 + 720);
v27 = EmoteSprite::maxEmotesComment(v25);
CCTextInputNode::setParseEmotes(v26, v27);
*(_DWORD *)(*(_DWORD *)(a1 + 720) + 420) = a1 + 440;
LOWORD(v64) = 27843;
BYTE2(v64) = 65;
CCTextInputNode::setLabelPlaceholderColor(*(_DWORD *)(a1 + 720), v64);
(*(void (__fastcall **)(_DWORD, _DWORD, int))(**(_DWORD **)(a1 + 460) + 232))(
*(_DWORD *)(a1 + 460),
*(_DWORD *)(a1 + 720),
5);
v73 = 0;
v74 = 0;
v75 = 0;
std::string::__init(&v73, &unk_B6B226, 0);
v28 = *(_DWORD *)(a1 + 724);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v76, 0.0, 0.5);
v29 = (TextArea *)TextArea::create(
(int)&v73,
"chatFont.fnt",
1065353216,
v28,
(const cocos2d::CCPoint *)v76,
1101004800,
1,
0);
std::string::~string((int)&v73);
*((_BYTE *)v29 + 509) = 1;
v30 = *(void (__fastcall **)(TextArea *, _DWORD *))(*(_DWORD *)v29 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v76, 0.0, 0.5);
v30(v29, v76);
CCTextInputNode::addTextArea(*(int **)(a1 + 720), v29);
v31 = *(void (__fastcall **)(TextArea *, _DWORD *))(*(_DWORD *)v29 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v76, -(float)(*(float *)(a1 + 724) * 0.5), 0.0);
v31(v29, v76);
v32 = *a2;
if ( (v32 & 1) != 0 )
{
if ( !*((_DWORD *)a2 + 1) )
goto LABEL_9;
v33 = *(_DWORD *)(a1 + 720);
v34 = *((const char **)a2 + 2);
}
else
{
if ( !(v32 >> 1) )
goto LABEL_9;
v33 = *(_DWORD *)(a1 + 720);
v34 = (const char *)(a2 + 1);
}
v73 = 0;
v74 = 0;
v75 = 0;
v35 = strlen(v34);
std::string::__init(&v73, v34, v35);
CCTextInputNode::setString(v33, (int)&v73);
std::string::~string((int)&v73);
LABEL_9:
v36 = ButtonSprite::create(
(ButtonSprite *)"Save",
(const char *)&dword_44 + 2,
0,
0.6,
1,
"bigFont.fnt",
"GJ_button_01.png",
(const char *)0x41E00000,
v58);
v70 = SoundPackDescPopup::onSave;
v71 = 0;
v37 = CCMenuItemSpriteExtra::create((int)v36, 0, a1, (int)SoundPackDescPopup::onSave, 0);
CCMenuItemSpriteExtra::setSizeMult(v37, 1.1);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 444) + 228))(*(_DWORD *)(a1 + 444), v37);
v61 = *(cocos2d::CCPoint **)(*(_DWORD *)v37 + 92);
v38 = (float)(v11 - 95.0) + 24.0;
v63 = *(cocos2d::CCPoint **)(a1 + 444);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v72, v12, v38);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v76, v63);
((void (__fastcall *)(int, _DWORD *))v61)(v37, v76);
v40 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Icon:", "goldFont.fnt", v39);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v40 + 80))(v40, 1056964608);
v41 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v40 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v76, 0.0, 0.5);
v41(v40, v76);
v42 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v40 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v76, (float)(v12 - 170.0) + 22.0, v38);
v42(v40, v76);
(*(void (__fastcall **)(_DWORD, int, int))(**(_DWORD **)(a1 + 460) + 232))(*(_DWORD *)(a1 + 460), v40, 1);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v76, 0.0, 0.0, 40.0, 40.0);
v43 = cocos2d::extension::CCScale9Sprite::create("GJ_button_04.png", v76);
v44 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v43 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v76, 32.0, 32.0);
v44(v43, v76);
*(_DWORD *)(a1 + 740) = v43;
v72[0] = SoundPackDescPopup::onPickIcon;
v72[1] = 0;
v45 = CCMenuItemSpriteExtra::create(v43, 0, a1, (int)SoundPackDescPopup::onPickIcon, 0);
*(_DWORD *)(a1 + 744) = v45;
CCMenuItemSpriteExtra::setSizeMult(v45, 1.2);
(*(void (__fastcall **)(_DWORD, _DWORD))(**(_DWORD **)(a1 + 444) + 228))(
*(_DWORD *)(a1 + 444),
*(_DWORD *)(a1 + 744));
v46 = *(const cocos2d::CCPoint **)(a1 + 444);
v62 = *(cocos2d::CCPoint **)(a1 + 744);
v47 = *(void (__fastcall **)(cocos2d::CCPoint *, _DWORD *))(*(_DWORD *)v62 + 92);
v48 = (float *)(*(int (__fastcall **)(int))(*(_DWORD *)v40 + 164))(v40);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v67,
(float)((float)((float)(v12 - 170.0) + 22.0) + (float)(*v48 * 0.5)) + 24.0,
v38);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v76, v46);
v47(v62, v76);
SoundPackDescPopup::refreshIconSlot((SoundPackDescPopup *)a1);
v73 = 0;
v74 = 0;
v75 = 0;
std::string::__init(&v73, "easy", 4u);
v52 = EmoteSprite::createWithName((int)&v73, v49, v50, v51);
std::string::~string((int)&v73);
EmoteSprite::fitToHeight(v52, 18.0, 0.0);
v76[0] = SoundPackDescPopup::onEmotes;
v76[1] = 0;
v53 = CCMenuItemSpriteExtra::create((int)v52, 0, a1, (int)SoundPackDescPopup::onEmotes, 0);
CCMenuItemSpriteExtra::setSizeMult(v53, 1.4);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 444) + 228))(*(_DWORD *)(a1 + 444), v53);
v54 = *(const cocos2d::CCPoint **)(a1 + 444);
v55 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v53 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v66, (float)(v12 + 170.0) - 30.0, v38);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v67, v54);
v55(v53, v67);
}
return v8;
}