//
// SetupSongTriggerPopup::init from 0x6586f8 to 0x658de2 (1770 bytes)
//
// 1 xrefs:
// > SetupSongTriggerPopup::create @ 0x659024
//
// 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:55:31 +0000
//
int __fastcall SetupSongTriggerPopup::init(SetupSongTriggerPopup *this, EffectGameObject *a2, cocos2d::CCArray *a3)
{
cocos2d::CCDirector *MultiTriggerItemsDefaultHorizontal; // r0
float v5; // s17
int v6; // r0
const char *v7; // r1
int v8; // r6
cocos2d::CCObject *v9; // r8
const char *v10; // r1
int v11; // r8
cocos2d::CCObject *v12; // r7
const cocos2d::CCPoint *v13; // r11
MusicDownloadManager *v14; // r0
cocos2d::CCArray **v15; // r0
float v16; // r0
int v18; // [sp+34h] [bp-78h]
void (__fastcall *v19)(cocos2d::CCObject *, _DWORD *); // [sp+38h] [bp-74h]
void (__fastcall *v20)(cocos2d::CCObject *, _BYTE *); // [sp+38h] [bp-74h]
cocos2d::CCPoint *v21; // [sp+44h] [bp-68h]
float v22; // [sp+4Ch] [bp-60h] BYREF
float v23; // [sp+50h] [bp-5Ch]
_BYTE v24[8]; // [sp+54h] [bp-58h] BYREF
_BYTE v25[8]; // [sp+5Ch] [bp-50h] BYREF
_BYTE v26[8]; // [sp+64h] [bp-48h] BYREF
_BYTE v27[8]; // [sp+6Ch] [bp-40h] BYREF
_BYTE v28[8]; // [sp+74h] [bp-38h] BYREF
_DWORD v29[2]; // [sp+7Ch] [bp-30h] BYREF
_DWORD v30[2]; // [sp+84h] [bp-28h] BYREF
int v31[3]; // [sp+8Ch] [bp-20h] BYREF
int v32; // [sp+98h] [bp-14h] BYREF
int v33; // [sp+9Ch] [bp-10h]
int v34; // [sp+A0h] [bp-Ch]
v18 = SetupTriggerPopup::init(this, a2, a3, 440.0, 300.0, 1, 0.0);
if ( v18 )
{
SetupTriggerPopup::preSetup(this);
v32 = 0;
v33 = 0;
v34 = 0;
std::string::__init(&v32, "Song Trigger", 0xCu);
SetupTriggerPopup::addTitle(this, &v32);
std::string::~string((int)&v32);
memset(v31, 0, sizeof(v31));
std::string::__init(v31, "Help", 4u);
v32 = 0;
v33 = 0;
v34 = 0;
std::string::__init(
&v32,
"Lets you start a specified song.\n"
"A single track can be active in each Channel at a time.\n"
"Start, End, FadeIn, and FadeOut are in milliseconds.\n"
"Prep is used to ensure exact sync to a specified time as there may be some delay loading it normally. Use "
"this option on a trigger to prepare the song before you want it to start, and then use Load Prep when you "
"want it to start. Note that only one Prep can be active at a time per channel.",
0x1D8u);
SetupTriggerPopup::addHelpButton(this, v31, &v32, 1065353216);
std::string::~string((int)&v32);
std::string::~string((int)v31);
v32 = 0;
v33 = 0;
v34 = 0;
std::string::__init(&v32, "OK", 2u);
SetupTriggerPopup::addCloseButton(this, &v32);
std::string::~string((int)&v32);
MultiTriggerItemsDefaultHorizontal = (cocos2d::CCDirector *)SetupTriggerPopup::createMultiTriggerItemsDefaultHorizontal(this);
cocos2d::CCDirector::sharedDirector(MultiTriggerItemsDefaultHorizontal);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v22);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v24, v22 * 0.5, v23 * 0.5);
v32 = 0;
v33 = 0;
v34 = 0;
std::string::__init(&v32, "Prep", 4u);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v29,
(float)(*((float *)this + 139) * 0.5) - 130.0,
(float)(*((float *)this + 140) * 0.5) - 20.0);
cocos2d::CCPoint::operator+(v30, v24, v29);
SetupTriggerPopup::createToggleValueControl((int)this, 399, (int)&v32, (int)v30, 0, 0, 0, 1.0);
std::string::~string((int)&v32);
v32 = 0;
v33 = 0;
v34 = 0;
std::string::__init(&v32, "Load\nPrep", 9u);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v29,
(float)(*((float *)this + 139) * 0.5) - 60.0,
(float)(*((float *)this + 140) * 0.5) - 20.0);
cocos2d::CCPoint::operator+(v30, v24, v29);
SetupTriggerPopup::createToggleValueControl((int)this, 400, (int)&v32, (int)v30, 0, 0, 2, 1.0);
std::string::~string((int)&v32);
v5 = COERCE_FLOAT((*(int (__fastcall **)(SetupSongTriggerPopup *, int))(*(_DWORD *)this + 732))(this, 392));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v30, v22 * 0.5, (float)(v23 * 0.5) + 55.0);
v6 = SongSelectNode::create(
(int)v5,
1,
0,
1,
(const cocos2d::CCPoint *)v30,
*((_DWORD *)this + 115),
*((const cocos2d::CCPoint **)this + 111),
1);
*((_DWORD *)this + 181) = v6;
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v6, 5);
*(_DWORD *)(*(_DWORD *)(*((_DWORD *)this + 181) + 316) + 372) = (char *)this + 720;
SetupSongTriggerPopup::updateLength(this);
SetupTriggerPopup::addObjectsToGroup(this, *(cocos2d::CCArray **)(*((_DWORD *)this + 181) + 288), 1);
SetupTriggerPopup::addObjectsToGroup(this, *(cocos2d::CCArray **)(*((_DWORD *)this + 181) + 296), 1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, v22 * 0.5, (float)(v23 * 0.5) + 10.0);
v32 = 0;
v33 = 0;
v34 = 0;
std::string::__init(&v32, "Volume:", 7u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v29, -91.0, -39.0);
cocos2d::CCPoint::operator+(v30, v25, v29);
SetupTriggerPopup::createValueControlAdvanced(
this,
406,
&v32,
v30,
1059481190,
0,
1,
6,
0,
0,
0x40000000,
0,
0,
1,
2,
0);
std::string::~string((int)&v32);
v32 = 0;
v33 = 0;
v34 = 0;
std::string::__init(&v32, "Speed:", 6u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v29, 91.0, -39.0);
cocos2d::CCPoint::operator+(v30, v25, v29);
SetupTriggerPopup::createValueControlAdvanced(
this,
404,
&v32,
v30,
1059481190,
0,
2,
6,
0,
-1052770304,
1094713344,
0,
0,
1,
2,
0);
std::string::~string((int)&v32);
SetupTriggerPopup::toggleLimitValue(this, 404, 1);
SetupTriggerPopup::toggleLimitValue(this, 406, 1);
v32 = 0;
v33 = 0;
v34 = 0;
std::string::__init(&v32, "Loop", 4u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v29, 38.0, -93.0);
cocos2d::CCPoint::operator+(v30, v25, v29);
SetupTriggerPopup::createToggleValueControl((int)this, 413, (int)&v32, (int)v30, 0, 0, 0, 1.0);
std::string::~string((int)&v32);
v32 = 0;
v33 = 0;
v34 = 0;
std::string::__init(&v32, "Dont\nReset", 0xAu);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v29, 118.0, -93.0);
cocos2d::CCPoint::operator+(v30, v25, v29);
SetupTriggerPopup::createToggleValueControl((int)this, 595, (int)&v32, (int)v30, 0, 0, 0, 1.0);
std::string::~string((int)&v32);
v32 = 0;
v33 = 0;
v34 = 0;
std::string::__init(&v32, "Channel:", 8u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v29, -108.0, -93.0);
cocos2d::CCPoint::operator+(v30, v25, v29);
SetupTriggerPopup::createValueControlAdvanced(
this,
432,
&v32,
v30,
1059481190,
1,
3,
10,
1,
0,
1082130432,
0,
2,
0,
2,
0);
std::string::~string((int)&v32);
SetupTriggerPopup::toggleLimitValue(this, 432, 1);
SetupAudioTriggerPopup::addTimeControls(this, 1, -25.0);
v8 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_pauseEditorBtn_001.png", v7);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v8 + 80))(v8, 1058642330);
v29[0] = SetupSongTriggerPopup::onSavePlaybackPos;
v29[1] = 0;
v9 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::create(
v8,
0,
(int)this,
(int)SetupSongTriggerPopup::onSavePlaybackPos,
0);
(*(void (__fastcall **)(cocos2d::CCObject *, _DWORD))(*(_DWORD *)v9 + 36))(v9, 0);
(*(void (__fastcall **)(_DWORD, cocos2d::CCObject *))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v9);
v19 = *(void (__fastcall **)(cocos2d::CCObject *, _DWORD *))(*(_DWORD *)v9 + 92);
v21 = *((cocos2d::CCPoint **)this + 111);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v27, -185.0, -25.0);
cocos2d::CCPoint::operator+(v28, v24, v27);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v30, v21);
v19(v9, v30);
SetupTriggerPopup::addObjectToPage(this, v9, 1);
v11 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_pauseEditorBtn_001.png", v10);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v11 + 80))(v11, 1058642330);
v30[0] = SetupSongTriggerPopup::onSavePlaybackPos;
v30[1] = 0;
v12 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::create(
v11,
0,
(int)this,
(int)SetupSongTriggerPopup::onSavePlaybackPos,
0);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v12 + 36))(v12, 1);
(*(void (__fastcall **)(_DWORD, cocos2d::CCObject *))(**((_DWORD **)this + 111) + 228))(
*((_DWORD *)this + 111),
v12);
v13 = *((const cocos2d::CCPoint **)this + 111);
v20 = *(void (__fastcall **)(cocos2d::CCObject *, _BYTE *))(*(_DWORD *)v12 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v26, -185.0, -64.0);
cocos2d::CCPoint::operator+(v27, v24, v26);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v28, v13);
v20(v12, v28);
v14 = (MusicDownloadManager *)SetupTriggerPopup::addObjectToPage(this, v12, 1);
v15 = (cocos2d::CCArray **)MusicDownloadManager::sharedState(v14);
MusicDownloadManager::addMusicDownloadDelegate(v15, (SetupSongTriggerPopup *)((char *)this + 716));
SetupSongTriggerPopup::updateSongTimeSlider(this);
SetupTriggerPopup::createPageButtons(this, (float)(*((float *)this + 139) * 0.5) + 15.0, 1);
if ( (*(float (__fastcall **)(SetupSongTriggerPopup *, int))(*(_DWORD *)this + 732))(this, 400) == 0.0 )
{
v16 = (*(float (__fastcall **)(SetupSongTriggerPopup *, int))(*(_DWORD *)this + 732))(this, 427);
SetupTriggerPopup::goToPage(this, (int)v16, 0);
}
else
{
SetupSongTriggerPopup::updateApplyPrepare(this, 1);
}
SetupTriggerPopup::postSetup(this);
}
return v18;
}