//
// SetupAudioLineGuidePopup::init from 0x100583cd0 to 0x10058432b (1627 bytes)
//
// 1 xrefs:
// > SetupAudioLineGuidePopup::create @ 0x100583c89
//
// 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
//
bool __fastcall SetupAudioLineGuidePopup::init(
SetupAudioLineGuidePopup *a1,
AudioLineGuideGameObject *a2,
cocos2d::CCArray *a3)
{
bool result; // al
cocos2d::CCLabelBMFont *v5; // r14
float v6; // xmm0_4
const char *v7; // rdi
cocos2d::CCSprite *m_speedSprite; // rax
CCMenuItemSpriteExtra *v9; // r15
unsigned __int64 *v10; // r14
double v11; // [rsp+38h] [rbp-138h] BYREF
unsigned __int64 v12; // [rsp+40h] [rbp-130h] BYREF
cocos2d::CCMenu *m_buttonMenu; // [rsp+48h] [rbp-128h]
char v14; // [rsp+50h] [rbp-120h] BYREF
int v15; // [rsp+51h] [rbp-11Fh]
void *v16; // [rsp+60h] [rbp-110h]
char v17; // [rsp+68h] [rbp-108h] BYREF
int v18; // [rsp+69h] [rbp-107h]
void *v19; // [rsp+78h] [rbp-F8h]
char v20; // [rsp+80h] [rbp-F0h] BYREF
_BYTE v21[23]; // [rsp+81h] [rbp-EFh] BYREF
char v22; // [rsp+98h] [rbp-D8h] BYREF
char v23[15]; // [rsp+99h] [rbp-D7h] BYREF
void *v24; // [rsp+A8h] [rbp-C8h]
char v25; // [rsp+B0h] [rbp-C0h] BYREF
char v26[15]; // [rsp+B1h] [rbp-BFh] BYREF
void *v27; // [rsp+C0h] [rbp-B0h]
__int128 v28; // [rsp+C8h] [rbp-A8h] BYREF
void *v29; // [rsp+D8h] [rbp-98h]
char v30; // [rsp+E0h] [rbp-90h] BYREF
_BYTE v31[23]; // [rsp+E1h] [rbp-8Fh] BYREF
__int128 v32; // [rsp+F8h] [rbp-78h] BYREF
void *v33; // [rsp+108h] [rbp-68h]
unsigned __int64 v34; // [rsp+110h] [rbp-60h] BYREF
double v35[2]; // [rsp+118h] [rbp-58h] BYREF
void *v36; // [rsp+128h] [rbp-48h]
float v37; // [rsp+134h] [rbp-3Ch] BYREF
float v38; // [rsp+138h] [rbp-38h]
unsigned __int64 v39; // [rsp+13Ch] [rbp-34h] BYREF
bool v40; // [rsp+147h] [rbp-29h]
double v41; // 0:xmm0_8.8
result = SetupTriggerPopup::init(a1, a2, a3, 340.0, 250.0, 1);
if ( result )
{
v40 = result;
SetupTriggerPopup::preSetup(a1);
a1->m_disableSliderDelegate = 1;
v20 = 18;
strcpy(v21, "BPM Guide");
SetupTriggerPopup::addTitle((__int64)a1, (__int64)&v20);
if ( (v20 & 1) != 0 )
operator delete(*(void **)&v21[15]);
v22 = 4;
strcpy(v23, "OK");
SetupTriggerPopup::addCloseButton((__int64)a1, (__int64)&v22);
if ( (v22 & 1) != 0 )
operator delete(v24);
v25 = 8;
strcpy(v26, "Help");
v29 = operator new(0xC8u);
*(_QWORD *)&v28 = 201;
*((_QWORD *)&v28 + 1) = 195;
strcpy(
(char *)v29,
"Creates lines in the editor to help synchronize to music.\n"
"BPM is beats per minute. The position is based on speed.\n"
"BPB is beats per bar. This adds more lines to each beat.");
SetupTriggerPopup::addHelpButton((__int64)a1, (__int64)&v25, &v28, (__m128)0x3F800000u);
if ( (v28 & 1) != 0 )
operator delete(v29);
if ( (v25 & 1) != 0 )
operator delete(v27);
cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v37);
sub_10028CBE0((float *)&v34, v37 * 0.5, v38 * 0.5);
v14 = 6;
v15 = 5066818;
sub_10028CBE0((float *)&v39, -80.0, 60.0);
sub_10028CCE0(v35, &v34, &v39);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
498,
(__int64)&v14,
(float *)v35,
0,
Uint,
0.80000001,
1.0,
200.0,
10,
0,
0,
0,
0,
0,
0);
if ( (v14 & 1) != 0 )
operator delete(v16);
v17 = 6;
v18 = 4345922;
sub_10028CBE0((float *)&v39, 80.0, 60.0);
sub_10028CCE0(v35, &v34, &v39);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
501,
(__int64)&v17,
(float *)v35,
0,
Uint,
0.80000001,
1.0,
10.0,
10,
0,
0,
0,
0,
0,
0);
if ( (v17 & 1) != 0 )
operator delete(v19);
v30 = 16;
strcpy(v31, "Duration");
sub_10028CBE0((float *)&v39, 0.0, -10.0);
sub_10028CCE0(v35, &v34, &v39);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
10,
(__int64)&v30,
(float *)v35,
0,
Uint,
0.80000001,
1.0,
120.0,
10,
0,
0,
0,
0,
0,
0);
if ( (v30 & 1) != 0 )
operator delete(*(void **)&v31[15]);
LOBYTE(v32) = 14;
strcpy((char *)&v32 + 1, "Disable");
sub_10028CBE0(
(float *)v35,
(float)((float)(a1->m_width * 0.5) + (float)(v37 * 0.5)) + -35.0,
(float)((float)(v38 * 0.5) - (float)(a1->m_height * 0.5)) + 25.0);
SetupTriggerPopup::createToggleValueControl((int)a1, 500, &v32, 1.0, (__int64)v35, 1, 0, 0);
if ( (v32 & 1) != 0 )
operator delete(v33);
sub_10028CBE0(
(float *)&v39,
(float)((float)(v37 * 0.5) - (float)(a1->m_width * 0.5)) + 40.0,
(float)((float)(v38 * 0.5) - (float)(a1->m_height * 0.5)) + 70.0);
v5 = cocos2d::CCLabelBMFont::create_3("Speed:", "goldFont.fnt");
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v5->setScale)(v5, 0.5);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, unsigned __int64 *))v5->setPosition)(v5, &v39);
v6 = ((float (__fastcall *)(SetupAudioLineGuidePopup *, __int64))a1->getValue)(a1, 499);
SelectSettingLayer::frameForValue((__int64)v35, 2, (int)v6);
if ( (LOBYTE(v35[0]) & 1) != 0 )
v7 = (const char *)v36;
else
v7 = (char *)v35 + 1;
m_speedSprite = cocos2d::CCSprite::createWithSpriteFrameName(v7);
a1->m_speedSprite = m_speedSprite;
if ( (LOBYTE(v35[0]) & 1) != 0 )
{
operator delete(v36);
m_speedSprite = a1->m_speedSprite;
}
((void (__fastcall *)(cocos2d::CCSprite *, float))m_speedSprite->setScale)(m_speedSprite, 0.60000002);
v9 = CCMenuItemSpriteExtra::create(
a1->m_speedSprite,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)SetupAudioLineGuidePopup::onSpeed);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v9);
m_buttonMenu = a1->m_buttonMenu;
v10 = (unsigned __int64 *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v5->getPosition)(v5);
sub_10028CBE0((float *)&v12, 0.0, -34.0);
sub_10028CCE0(&v11, v10, &v12);
*(cocos2d::CCPoint *)&v41 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)v35,
(const cocos2d::CCPoint *)m_buttonMenu);
((void (__fastcall *)(CCMenuItemSpriteExtra *, double *, double))v9->setPosition)(v9, v35, v41);
SetupTriggerPopup::postSetup(a1);
return v40;
}
return result;
}