//
// EditorSoundsSettingsPopup::init from 0x1403d4970 to 0x1403d4db3 (1091 bytes)
//
// 2 xrefs:
// > EditorSoundsLayer::onSettings @ 0x14019ee57
// > ??> @ 0x140924920
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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:31:36 +0000
//
// Hidden C++ exception states: #wind=2
bool __fastcall EditorSoundsSettingsPopup::init(__int64 a1, __int64 a2)
{
bool result; // al
__int64 v5; // rcx
__int64 v6; // rax
__int64 v7; // rax
__int64 *v8; // rdi
__int64 v9; // rbx
__int64 v10; // rax
__int64 v11; // rbx
__int64 v12; // rax
struct cocos2d::CCLabelBMFont *v13; // rdi
__int64 v14; // rbx
__int64 v15; // rax
__int64 v16; // rcx
__int64 v17; // rax
__int64 v18; // rdi
__int64 v19; // rbx
__int64 v20; // rax
cocos2d::CCObject *v21; // rbx
cocos2d::CCObject *v22; // rdi
__int64 v23; // rbx
__int64 v24; // rax
cocos2d::CCObject *v25; // rbx
cocos2d::CCObject *v26; // rdi
__int64 v27; // rbx
__int64 v28; // rax
int v29; // eax
cocos2d::CCObject *v30; // rdi
__int64 v31; // rbx
__int64 v32; // rax
_BYTE v33[16]; // [rsp+50h] [rbp-48h] BYREF
float v34; // [rsp+B0h] [rbp+18h] BYREF
float v35; // [rsp+B4h] [rbp+1Ch]
void *v36; // [rsp+B8h] [rbp+20h] BYREF
result = FLAlertLayer::init_1(a1, 150);
if ( result )
{
*(_QWORD *)(a1 + 672) = a2;
*(_BYTE *)(a1 + 596) = 1;
v6 = cocos2d::CCDirector::sharedDirector(v5);
cocos2d::CCDirector::getWinSize(v6, &v34);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v33, 0.0, 0.0, 80.0, 80.0);
v8 = (__int64 *)cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v7);
v9 = *v8;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v36, 280.0, 160.0);
(*(void (__fastcall **)(__int64 *, __int64))(v9 + 312))(v8, v10);
v11 = *v8;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v36, v34 * 0.5, v35 * 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v11 + 184))(v8, v12);
(*(void (__fastcall **)(_QWORD, __int64 *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v8,
4294967294LL);
v13 = cocos2d::CCLabelBMFont::create("Editor SFX", "goldFont.fnt");
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v13 + 160LL))(v13);
v14 = *(_QWORD *)v13;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v36, v34 * 0.5, (float)((float)(v35 * 0.5) + 80.0) - 20.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v14 + 184))(v13, v15);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v13);
v17 = cocos2d::CCMenu::create(v16);
*(_QWORD *)(a1 + 552) = v17;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v17, 10);
v18 = **(_QWORD **)(a1 + 552);
v19 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v36, v34 * 0.5, v35 * 0.5);
(*(void (__fastcall **)(__int64, __int64))(v18 + 184))(v19, v20);
v36 = operator new(0x2C8u);
v21 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite((__int64)v36);
if ( v21 )
{
if ( ButtonSprite::init_1(
(__int64)v21,
(__int64)"Download used SFX",
170,
0,
1057803469,
1,
&qword_140704F78,
(__int64)"GJ_button_04.png",
1105199104) )
{
cocos2d::CCObject::autorelease(v21);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v21 + 8LL))(v21, 1);
LODWORD(v21) = 0;
}
}
v22 = CCMenuItemSpriteExtra::create((int)v21, 0, a1, (__int64)EditorSoundsSettingsPopup::onDownloadAll);
v23 = *(_QWORD *)v22;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v36, 0.0, 12.0);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v23 + 184))(v22, v24);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v22);
v36 = operator new(0x2C8u);
v25 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite((__int64)v36);
if ( v25 )
{
if ( ButtonSprite::init_1(
(__int64)v25,
(__int64)"Clear All bindings",
170,
0,
1057803469,
1,
&qword_140704F78,
(__int64)"GJ_button_06.png",
1105199104) )
{
cocos2d::CCObject::autorelease(v25);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v25 + 8LL))(v25, 1);
LODWORD(v25) = 0;
}
}
v26 = CCMenuItemSpriteExtra::create((int)v25, 0, a1, (__int64)EditorSoundsSettingsPopup::onClearAll);
v27 = *(_QWORD *)v26;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v36, 0.0, -28.0);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v27 + 184))(v26, v28);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v26);
v29 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
v30 = CCMenuItemSpriteExtra::create(v29, 0, a1, (__int64)PagedListPopup::onClose);
*((_DWORD *)v30 + 93) = 1069547520;
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v30);
v31 = *(_QWORD *)v30;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v36, -130.0, 70.0);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v31 + 184))(v30, v32);
return 1;
}
return result;
}