//
// SetupReverbPopup::init from 0x140446820 to 0x140446dd5 (1461 bytes)
//
// 2 xrefs:
// > SetupSFXPopup::onPlusButton @ 0x140448f06
// > ??> @ 0x1406da5f8
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=2
bool SetupReverbPopup::init(SetupReverbPopup *a1, SFXTriggerGameObject *a2, cocos2d::CCArray *a3)
{
bool result; // al
double v5; // xmm0_8
__int64 v6; // rcx
cocos2d::CCDirector *v7; // rax
cocos2d::CCLabelBMFont *v8; // rax
float v9; // xmm0_4
cocos2d::CCSprite *v10; // rbx
CCMenuItemSpriteExtra *v11; // rdi
float v12; // xmm0_4
const cocos2d::CCPoint *v13; // rax
CCMenuItemSpriteExtra_vtbl *v14; // rbx
struct cocos2d::CCPoint v15; // rax
struct cocos2d::CCSprite *v16; // rbx
CCMenuItemSpriteExtra *v17; // rdi
float v18; // xmm0_4
const cocos2d::CCPoint *v19; // rax
CCMenuItemSpriteExtra_vtbl *v20; // rbx
struct cocos2d::CCPoint v21; // rax
struct cocos2d::CCSprite *v22; // rbx
CCMenuItemSpriteExtra *v23; // rdi
float v24; // xmm0_4
CCMenuItemSpriteExtra_vtbl *v25; // rbx
struct cocos2d::CCPoint v26; // rax
float v27; // [rsp+48h] [rbp-29h]
__int128 *v28; // [rsp+50h] [rbp-21h] BYREF
__int128 *v29; // [rsp+58h] [rbp-19h] BYREF
__int128 v30; // [rsp+68h] [rbp-9h] BYREF
__int64 v31; // [rsp+78h] [rbp+7h]
__int64 v32; // [rsp+80h] [rbp+Fh]
__int128 v33; // [rsp+88h] [rbp+17h] BYREF
__int64 v34; // [rsp+98h] [rbp+27h]
__int64 v35; // [rsp+A0h] [rbp+2Fh]
char v36; // [rsp+F0h] [rbp+7Fh] BYREF
result = SetupTriggerPopup::init(a1, a2, a3, 320.0, 140.0, 2);
if ( result )
{
a1->m_disableTextDelegate = 1;
a1->determineStartValues(a1);
v30 = 0;
v31 = 0;
v32 = 15;
*(_QWORD *)&v30 = sub_14003AA10(0x20u);
v31 = 18;
v32 = 31;
strcpy((char *)v30, "Edit Global Reverb");
SetupTriggerPopup::addTitle(a1, &v30);
v30 = 0;
v31 = 2;
v32 = 15;
strcpy((char *)&v30, "OK");
SetupTriggerPopup::addCloseButton(a1, &v30);
v28 = &v30;
v30 = 0;
v31 = 0;
v32 = 15;
*(_QWORD *)&v30 = sub_14003AA10(0xC0u);
v31 = 183;
v32 = 191;
strcpy(
(char *)v30,
"Lets you change the Reverb settings.\n"
"The sound engine has one global reverb channel. This means that two sounds with different reverb settings cannot b"
"e played simultaneously.");
v33 = 0;
v34 = 4;
v35 = 15;
strcpy((char *)&v33, "Help");
v5 = SetupTriggerPopup::addHelpButton(a1, &v33, &v30);
v7 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v6);
cocos2d::CCDirector::getWinSize(v7);
cocos2d::CCPoint::CCPoint(*(float *)&v5, v27 * 0.5);
v29 = &v30;
v30 = 0;
v31 = 6;
v32 = 15;
strcpy((char *)&v30, "Enable");
cocos2d::CCPoint::CCPoint(a1->m_height * 0.5, (float)(a1->m_width * 0.5) - 78.0);
cocos2d::CCPoint::operator+(&v36, &v28);
SetupTriggerPopup::createToggleValueControl(
(_DWORD)a1,
503,
(unsigned int)&v30,
(unsigned int)&v28,
0,
0,
0,
1065353216);
v8 = cocos2d::CCLabelBMFont::create("Reverb", "goldFont.fnt");
a1->m_reverbLabel = v8;
v9 = ((float (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v8,
1);
cocos2d::CCPoint::CCPoint(v9, 0.0);
cocos2d::CCPoint::operator+(&v36, &v28);
a1->m_reverbLabel->setPosition_0(a1->m_reverbLabel, (const cocos2d::CCPoint *)&v28);
v10 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
cocos2d::CCSprite::setFlipX(v10, 1);
((void (__fastcall *)(cocos2d::CCSprite *))v10->setScale_0)(v10);
v11 = CCMenuItemSpriteExtra::create(v10, nullptr, a1, (cocos2d::SEL_MenuHandler *)SetupReverbPopup::onReverb);
v12 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
v11);
cocos2d::CCPoint::CCPoint(v12, 100.0);
v13 = a1->m_reverbLabel->getPosition_0(a1->m_reverbLabel);
cocos2d::CCPoint::operator+(v13, &v28);
v14 = v11->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v15 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, (const struct cocos2d::CCPoint *)&v29);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v14->setPosition_0)(v11, v15);
HIDWORD(v11->m_pfnSelector.adj) = 1068708659;
v11->setTag(v11, 1);
v16 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v16->setScale_0)(v16);
v17 = CCMenuItemSpriteExtra::create(v16, nullptr, a1, (cocos2d::SEL_MenuHandler *)SetupReverbPopup::onReverb);
v18 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
v17);
cocos2d::CCPoint::CCPoint(v18, -100.0);
v19 = a1->m_reverbLabel->getPosition_0(a1->m_reverbLabel);
cocos2d::CCPoint::operator+(v19, &v28);
v20 = v17->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v21 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, (const struct cocos2d::CCPoint *)&v29);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v20->setPosition_0)(v17, v21);
HIDWORD(v17->m_pfnSelector.adj) = 1068708659;
v17->setTag(v17, 0);
SetupReverbPopup::updateReverbLabel(a1);
v22 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_playMusicBtn_001.png");
((void (__fastcall *)(struct cocos2d::CCSprite *))v22->setScale_0)(v22);
v23 = CCMenuItemSpriteExtra::create(v22, nullptr, a1, (cocos2d::SEL_MenuHandler *)SetupReverbPopup::onPlay);
v24 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
v23);
cocos2d::CCPoint::CCPoint(v24, (float)(a1->m_width * 0.5) - 24.0);
cocos2d::CCPoint::operator+(&v36, &v28);
v25 = v23->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v26 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, (const struct cocos2d::CCPoint *)&v29);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v25->setPosition_0)(v23, v26);
a1->updateDefaultTriggerValues(a1);
a1->m_disableTextDelegate = 0;
return 1;
}
return result;
}