//
// SetupAudioLineGuidePopup::init from 0x14046ffb0 to 0x1404706bf (1807 bytes)
//
// 2 xrefs:
// > EditorUI::editObject @ 0x14011c6f1
// > ??> @ 0x1406db2a0
//
// 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=4
bool SetupAudioLineGuidePopup::init(SetupAudioLineGuidePopup *a1, AudioLineGuideGameObject *a2, cocos2d::CCArray *a3)
{
int v4; // ebx
bool result; // al
double v6; // xmm0_8
__int64 v7; // rcx
cocos2d::CCDirector *v8; // rax
int v9; // eax
struct cocos2d::CCLabelBMFont *v10; // r14
int v11; // ecx
int v12; // ecx
int v13; // ecx
int v14; // ecx
const char *v15; // rcx
CCMenuItemSpriteExtra *v16; // rdi
float v17; // xmm0_4
__int64 v18; // rax
CCMenuItemSpriteExtra_vtbl *v19; // rbx
struct cocos2d::CCPoint v20; // rax
__int64 v21; // [rsp+80h] [rbp-88h]
__int64 v22; // [rsp+80h] [rbp-88h]
__int128 *v23; // [rsp+88h] [rbp-80h] BYREF
__int128 v24; // [rsp+90h] [rbp-78h] BYREF
__int64 v25; // [rsp+A0h] [rbp-68h]
__int64 v26; // [rsp+A8h] [rbp-60h]
float v27; // [rsp+B0h] [rbp-58h]
__int128 *v28; // [rsp+B8h] [rbp-50h] BYREF
__int128 *v29; // [rsp+C0h] [rbp-48h]
char v30[8]; // [rsp+C8h] [rbp-40h] BYREF
cocos2d::CCPoint v31; // [rsp+D0h] [rbp-38h] BYREF
__int128 v32; // [rsp+D8h] [rbp-30h] BYREF
__int64 v33; // [rsp+E8h] [rbp-20h]
unsigned __int64 v34; // [rsp+F0h] [rbp-18h]
v4 = 1;
result = SetupTriggerPopup::init(a1, a2, a3, 340.0, 250.0, 1);
if ( result )
{
a1->m_disableTextDelegate = 1;
a1->determineStartValues(a1);
a1->m_disableSliderDelegate = 1;
*((_QWORD *)&v24 + 1) = 101;
v25 = 9;
v26 = 15;
*(_QWORD *)&v24 = 0x64697547204D5042LL;
SetupTriggerPopup::addTitle(a1, &v24);
v24 = 0;
v25 = 2;
v26 = 15;
strcpy((char *)&v24, "OK");
SetupTriggerPopup::addCloseButton(a1, &v24);
v23 = &v24;
v24 = 0;
v25 = 0;
v26 = 15;
*(_QWORD *)&v24 = sub_14003AA10(0xD0u);
v25 = 195;
v26 = 207;
strcpy(
(char *)v24,
"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.");
v32 = 0;
v33 = 4;
v34 = 15;
strcpy((char *)&v32, "Help");
v6 = SetupTriggerPopup::addHelpButton(a1, &v32, &v24);
v8 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v7);
cocos2d::CCDirector::getWinSize(v8);
cocos2d::CCPoint::CCPoint(*(float *)&v6, v27 * 0.5);
v28 = &v24;
v24 = 0;
v25 = 3;
v26 = 15;
LOWORD(v24) = *(_WORD *)"BPM";
WORD1(v24) = (unsigned __int8)aBpm[2];
cocos2d::CCPoint::CCPoint(0.0, -80.0);
cocos2d::CCPoint::operator+(v30, &v23);
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
498,
(unsigned int)&v24,
(unsigned int)&v23,
1061997773,
0,
3,
10,
0,
1065353216,
1128792064,
0,
0,
0,
0,
0,
v23);
v29 = &v24;
v24 = 0;
v25 = 3;
v26 = 15;
LODWORD(v24) = 4345922;
cocos2d::CCPoint::CCPoint(0.0, 80.0);
cocos2d::CCPoint::operator+(v30, &v23);
LOBYTE(v21) = 0;
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
501,
(unsigned int)&v24,
(unsigned int)&v23,
1061997773,
0,
3,
10,
0,
1065353216,
1092616192,
0,
0,
0,
0,
v21);
v29 = &v32;
v33 = 8;
v34 = 15;
v32 = 0x6E6F697461727544uLL;
cocos2d::CCPoint::CCPoint(0.0, 0.0);
cocos2d::CCPoint::operator+(v30, &v23);
LOBYTE(v22) = 0;
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
10,
(unsigned int)&v32,
(unsigned int)&v23,
1061997773,
0,
3,
10,
0,
1065353216,
1123024896,
0,
0,
0,
0,
v22);
v29 = &v24;
HIWORD(v24) = 0;
v25 = 7;
v26 = 15;
qmemcpy(&v24, "Disabl", 6);
*(_QWORD *)((char *)&v24 + 6) = (unsigned __int8)aDisable[6];
cocos2d::CCPoint::CCPoint(v27 * 0.5, (float)((float)(a1->m_width * 0.5) + (float)(v27 * 0.5)) - 35.0);
SetupTriggerPopup::createToggleValueControl((_DWORD)a1, 500, (unsigned int)&v24, v9, 1, 0, 0, 1065353216);
cocos2d::CCPoint::CCPoint(a1->m_width * 0.5, (float)((float)(v27 * 0.5) - (float)(a1->m_width * 0.5)) + 40.0);
v10 = cocos2d::CCLabelBMFont::create("Speed:", "goldFont.fnt");
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v10->setScale_0)(v10);
a1->m_mainLayer->addChild_1(a1->m_mainLayer, v10);
v10->setPosition_0(v10, &v31);
v11 = (int)a1->getValue(a1, 499);
if ( v11 )
{
v12 = v11 - 1;
if ( v12 )
{
v13 = v12 - 1;
if ( v13 )
{
v14 = v13 - 1;
if ( v14 )
{
if ( v14 == 1 )
v4 = 4;
}
else
{
v4 = 3;
}
}
else
{
v4 = 2;
}
}
else
{
v4 = 0;
}
}
SelectSettingLayer::frameForItem((__int64)&v32, 2u, v4);
v15 = (const char *)&v32;
if ( v34 > 0xF )
v15 = (const char *)v32;
a1->m_speedSprite = cocos2d::CCSprite::createWithSpriteFrameName(v15);
sub_14003A830((__int64)&v32);
((void (__fastcall *)(cocos2d::CCSprite *))a1->m_speedSprite->setScale_0)(a1->m_speedSprite);
v16 = CCMenuItemSpriteExtra::create(
a1->m_speedSprite,
nullptr,
a1,
(cocos2d::SEL_MenuHandler *)SetupAudioLineGuidePopup::onSpeed);
v17 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
v16);
cocos2d::CCPoint::CCPoint(v17, 0.0);
v18 = (__int64)v10->getPosition_0(v10);
cocos2d::CCPoint::operator+(v18, &v23);
v19 = v16->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v20 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, (const struct cocos2d::CCPoint *)&v28);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v19->setPosition_0)(v16, v20);
a1->updateDefaultTriggerValues(a1);
a1->m_disableTextDelegate = 0;
return 1;
}
return result;
}