//
// EditorSoundsLayer::init from 0x78aba8 to 0x78b188 (1504 bytes)
//
// 1 xrefs:
// > EditorSoundsLayer::create @ 0x78b40c
//
// 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:36 +0000
//
GameManager *__fastcall EditorSoundsLayer::init(EditorSoundsLayer *this, EditorUI *a2)
{
GameManager *v4; // r10
cocos2d::CCDirector *v5; // r0
float v6; // s17
float v7; // s18
int v8; // r1
int v9; // r2
int v10; // r3
int *v11; // r0
float v12; // s14
int *v13; // r6
void (__fastcall *v14)(int *, _DWORD *); // r11
ScrollableContentLayer *v15; // r6
cocos2d::CCMenu *v16; // r0
int v17; // r0
float v18; // s17
float v19; // s17
int v20; // r6
void (__fastcall *v21)(int, _DWORD *); // r7
void (__fastcall *v22)(int, _DWORD *); // r3
void (__fastcall *v23)(int, _DWORD *); // r11
int *v24; // r0
int v25; // r1
int v26; // r11
int v27; // r6
void (__fastcall *v28)(int, _DWORD *); // r7
const char *v29; // r1
int v30; // r7
int v31; // r0
void (__fastcall *v32)(cocos2d::CCPoint *, _DWORD *); // r11
ButtonSprite *v33; // r7
int v34; // r11
const char *v35; // r1
int v36; // r5
int v37; // r6
void (__fastcall *v38)(int, _BYTE *); // r11
int v39; // r7
unsigned int v40; // r3
const char *v41; // r6
size_t v42; // r0
char *v44; // [sp+8h] [bp-64h]
cocos2d::CCPoint *v45; // [sp+10h] [bp-5Ch]
cocos2d::CCPoint *v46; // [sp+10h] [bp-5Ch]
cocos2d::CCPoint *v47; // [sp+10h] [bp-5Ch]
cocos2d::CCPoint *v48; // [sp+14h] [bp-58h]
cocos2d::CCPoint *v49; // [sp+14h] [bp-58h]
_BYTE v50[4]; // [sp+18h] [bp-54h] BYREF
int v51; // [sp+1Ch] [bp-50h]
float v52; // [sp+20h] [bp-4Ch] BYREF
float v53; // [sp+24h] [bp-48h]
_BYTE v54[8]; // [sp+28h] [bp-44h] BYREF
_BYTE v55[8]; // [sp+30h] [bp-3Ch] BYREF
int (__fastcall *v56)(int, cocos2d::CCObject *, int, int); // [sp+38h] [bp-34h]
int v57; // [sp+3Ch] [bp-30h]
_DWORD v58[2]; // [sp+40h] [bp-2Ch] BYREF
int v59; // [sp+48h] [bp-24h] BYREF
int v60; // [sp+4Ch] [bp-20h]
int v61; // [sp+50h] [bp-1Ch]
_DWORD v62[4]; // [sp+54h] [bp-18h] BYREF
v4 = SetupTriggerPopup::init(this, nullptr, nullptr, 400.0, 280.0, &byte_7, 0.0);
if ( v4 )
{
*((_DWORD *)this + 188) = a2;
SetupTriggerPopup::preSetup(this);
qmemcpy(v50, "PWi", 3);
SetupTriggerPopup::setCustomBGColor((int)this, (int)v50);
*((_BYTE *)this + 468) = 1;
TabbedPopupLayer::addCloseButton((const cocos2d::CCPoint **)this);
v5 = (cocos2d::CCDirector *)EditorSoundsLayer::setupTabs(this);
cocos2d::CCDirector::sharedDirector(v5);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v52);
v6 = (float)(v53 * 0.5) - 100.0;
v7 = *((float *)this + 139) - 30.0;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v62, v7, (float)((float)(v53 * 0.5) + 96.0) - v6);
v11 = ScrollableContentLayer::create((const cocos2d::CCSize *)v62, v8, v9, v10);
v12 = (float)(v52 * 0.5) - (float)(v7 * 0.5);
*((_DWORD *)this + 196) = v11;
v13 = v11;
v14 = *(void (__fastcall **)(int *, _DWORD *))(*v11 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v62, v12, v6);
v14(v13, v62);
v15 = *((ScrollableContentLayer **)this + 196);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v62, 2.0, 0.0);
ScrollableContentLayer::setThumbOffset(v15, (int)v62);
v16 = (cocos2d::CCMenu *)(*(int (__fastcall **)(_DWORD, _DWORD, int))(**((_DWORD **)this + 115) + 232))(
*((_DWORD *)this + 115),
*((_DWORD *)this + 196),
5);
v17 = cocos2d::CCMenu::create(v16);
*((_DWORD *)this + 197) = v17;
(*(void (__fastcall **)(int, void *))(*(_DWORD *)v17 + 148))(v17, &unk_D2E3D8);
(*(void (__fastcall **)(_DWORD, void *))(**((_DWORD **)this + 197) + 160))(*((_DWORD *)this + 197), &unk_D2E3E0);
(*(void (__fastcall **)(_DWORD, void *))(**((_DWORD **)this + 197) + 92))(*((_DWORD *)this + 197), &unk_D2E3D8);
(*(void (__fastcall **)(_DWORD, _DWORD, int))(**(_DWORD **)(*((_DWORD *)this + 196) + 320) + 232))(
*(_DWORD *)(*((_DWORD *)this + 196) + 320),
*((_DWORD *)this + 197),
2);
v18 = (float)(*((float *)this + 140) * 0.5) + (float)(v53 * 0.5);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v62, 0.0, 0.0, 40.0, 40.0);
v19 = v18 - 60.0;
v20 = cocos2d::extension::CCScale9Sprite::create("square02_small.png", v62);
v21 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v20 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v62, v7, 30.0);
v21(v20, v62);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v20 + 456))(v20, 100);
v22 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v20 + 480);
LOWORD(v62[0]) = 0;
BYTE2(v62[0]) = 0;
v22(v20, v62);
v23 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v20 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v62, v52 * 0.5, v19);
v23(v20, v62);
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v20 + 172))(v20, 0);
(*(void (__fastcall **)(_DWORD, int, _DWORD))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v20, 0);
*((_DWORD *)this + 190) = v20;
v24 = CCTextInputNode::create(
COERCE_CCTEXTINPUTNODE_(v7 - 20.0),
30.0,
"Search...",
"Thonburi",
(const char *)&dword_14,
"bigFont.fnt",
v44);
LOWORD(v51) = -26986;
BYTE2(v51) = -106;
v25 = v51;
*((_DWORD *)this + 189) = v24;
CCTextInputNode::setLabelPlaceholderColor((unsigned int)v24, v25);
CCTextInputNode::setLabelPlaceholderScale(*((_DWORD *)this + 189), 0.4);
CCTextInputNode::setMaxLabelScale(*((_DWORD *)this + 189), 0.4);
CCTextInputNode::setMaxLabelWidth(*((_DWORD *)this + 189), v7 - 60.0);
*(_DWORD *)(*((_DWORD *)this + 189) + 420) = (char *)this + 440;
v26 = *((_DWORD *)this + 189);
v59 = 0;
v60 = 0;
v61 = 0;
std::string::__init(&v59, " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", 0x3Fu);
CCTextInputNode::setAllowedChars(v26, (unsigned __int8 *)&v59);
std::string::~string((int)&v59);
v27 = *((_DWORD *)this + 189);
v28 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v27 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v62, v52 * 0.5, v19);
v28(v27, v62);
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 189) + 500))(*((_DWORD *)this + 189), 0);
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 189) + 172))(*((_DWORD *)this + 189), 0);
(*(void (__fastcall **)(_DWORD, _DWORD, int))(**((_DWORD **)this + 115) + 232))(
*((_DWORD *)this + 115),
*((_DWORD *)this + 189),
1);
v30 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_longBtn07_001.png", v29);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v30 + 80))(v30, 1058642330);
v57 = 0;
v56 = EditorSoundsLayer::onClearSearch;
v31 = CCMenuItemSpriteExtra::create(v30, 0, (int)this, (int)EditorSoundsLayer::onClearSearch, 0);
*((_DWORD *)this + 191) = v31;
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v31);
v48 = *((cocos2d::CCPoint **)this + 191);
v32 = *(void (__fastcall **)(cocos2d::CCPoint *, _DWORD *))(*(_DWORD *)v48 + 92);
v45 = *((cocos2d::CCPoint **)this + 111);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v58, (float)((float)(v7 * 0.5) + (float)(v52 * 0.5)) - 18.0, v19);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v62, v45);
v32(v48, v62);
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 191) + 172))(*((_DWORD *)this + 191), 0);
v33 = ButtonSprite::create(
(ButtonSprite *)"Browse",
(const char *)&word_32,
0,
0.4,
1,
"goldFont.fnt",
"GJ_button_05.png",
(const char *)0x41D00000,
*(float *)&v45);
(*(void (__fastcall **)(_DWORD, float))(**((_DWORD **)v33 + 134) + 80))(*((_DWORD *)v33 + 134), 0.5);
v58[1] = 0;
v58[0] = EditorSoundsLayer::onBrowse;
v34 = CCMenuItemSpriteExtra::create((int)v33, 0, (int)this, (int)EditorSoundsLayer::onBrowse, 0);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v34);
v46 = *(cocos2d::CCPoint **)(*(_DWORD *)v34 + 92);
v49 = *((cocos2d::CCPoint **)this + 111);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v55,
(float)((float)(*((float *)this + 139) * 0.5) + (float)(v52 * 0.5)) - 42.0,
(float)((float)(v53 * 0.5) - (float)(*((float *)this + 140) * 0.5)) + 20.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v62, v49);
((void (__fastcall *)(int, _DWORD *))v46)(v34, v62);
v36 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_optionsBtn02_001.png", v35);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v36 + 80))(v36, 1060320051);
v62[1] = 0;
v62[0] = EditorSoundsLayer::onSettings;
v37 = CCMenuItemSpriteExtra::create(v36, 0, (int)this, (int)EditorSoundsLayer::onSettings, 0);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v37);
v38 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v37 + 92);
v47 = *((cocos2d::CCPoint **)this + 111);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v54,
(float)((float)(*((float *)this + 139) * 0.5) + (float)(v52 * 0.5)) - 20.0,
(float)((float)(*((float *)this + 140) * 0.5) + (float)(v53 * 0.5)) - 20.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v55, v47);
v38(v37, v55);
SetupTriggerPopup::postSetup(this);
std::string::operator=((unsigned __int8 *)this + 768, (unsigned __int8 *)&EditorSoundsLayer::s_lastSearchText);
v39 = *((_DWORD *)this + 189);
if ( v39 )
{
v40 = *((unsigned __int8 *)this + 768);
if ( (v40 & 1) != 0 )
{
if ( !*((_DWORD *)this + 193) )
goto LABEL_10;
v41 = *((const char **)this + 194);
}
else
{
if ( !(v40 >> 1) )
goto LABEL_10;
v41 = (char *)this + 769;
}
v59 = 0;
v60 = 0;
v61 = 0;
v42 = strlen(v41);
std::string::__init(&v59, v41, v42);
CCTextInputNode::setString(v39, (int)&v59);
std::string::~string((int)&v59);
}
LABEL_10:
*((_DWORD *)this + 184) = -1;
(*(void (__fastcall **)(EditorSoundsLayer *))(*(_DWORD *)this + 752))(this);
}
return v4;
}