//
// SetupAudioLineGuidePopup::init from 0x57d03c to 0x57d462 (1062 bytes)
//
// 1 xrefs:
// > SetupAudioLineGuidePopup::create @ 0x57d4e8
//
// 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 SetupAudioLineGuidePopup::init(SetupAudioLineGuidePopup *a1, AudioLineGuideGameObject *a2, cocos2d::CCArray *a3)
{
_BOOL4 v4; // r10
cocos2d::CCDirector *v5; // r0
cocos2d::CCLabelBMFont *v6; // r7
float v7; // r0
cocos2d::CCSprite *m_speedSprite; // r0
CCMenuItemSpriteExtra *v9; // r4
int v10; // r11
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+30h] [bp-4Ch]
cocos2d::CCMenu *m_buttonMenu; // [sp+34h] [bp-48h]
cocos2d::CCSize v14; // [sp+3Ch] [bp-40h] BYREF
cocos2d::CCPoint v15; // [sp+44h] [bp-38h] BYREF
cocos2d::CCPoint v16; // [sp+4Ch] [bp-30h] BYREF
cocos2d::CCPoint v17; // [sp+54h] [bp-28h] BYREF
cocos2d::CCPoint v18; // [sp+5Ch] [bp-20h] BYREF
cocos2d::CCPoint v19; // [sp+64h] [bp-18h] BYREF
cocos2d::CCPoint v20; // [sp+6Ch] [bp-10h] BYREF
v4 = SetupTriggerPopup::init(a1, a2, a3, 340.0, 250.0, 1);
if ( v4 )
{
SetupTriggerPopup::preSetup(a1);
a1->m_disableSliderDelegate = 1;
sub_776584((int)&v20, "BPM Guide");
SetupTriggerPopup::addTitle((int)a1);
sub_774008(&v20);
sub_776584((int)&v20, "OK");
SetupTriggerPopup::addCloseButton((unsigned int)a1, (ButtonSprite **)&v20);
sub_774008(&v20);
sub_776584((int)&v19, "Help");
sub_776584(
(int)&v20,
"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((int)a1, (int)&v19, (int)&v20, 1065353216);
sub_774008(&v20);
sub_774008(&v19);
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v14, v5);
cocos2d::CCPoint::CCPoint(&v15, v14.width * 0.5, v14.height * 0.5);
sub_776584((int)&v18, "BPM");
cocos2d::CCPoint::CCPoint(&v19, -80.0, 60.0);
cocos2d::CCPoint::operator+(&v20, &v15, &v19);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
498,
(int)&v18,
&v20,
(cocos2d::CCZone *)0x3F4CCCCD,
0,
Uint,
10,
0,
(cocos2d::CCFloat *)0x3F800000,
200.0,
0,
0,
0,
0,
0);
sub_774008(&v18);
sub_776584((int)&v18, "BPB");
cocos2d::CCPoint::CCPoint(&v19, 80.0, 60.0);
cocos2d::CCPoint::operator+(&v20, &v15, &v19);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
501,
(int)&v18,
&v20,
(cocos2d::CCZone *)0x3F4CCCCD,
0,
Uint,
10,
0,
COERCE_COCOS2D_CCFLOAT_(1.0),
10.0,
0,
0,
0,
0,
0);
sub_774008(&v18);
sub_776584((int)&v18, "Duration");
cocos2d::CCPoint::CCPoint(&v19, 0.0, -10.0);
cocos2d::CCPoint::operator+(&v20, &v15, &v19);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
10,
(int)&v18,
&v20,
(cocos2d::CCZone *)0x3F4CCCCD,
0,
Uint,
10,
0,
COERCE_COCOS2D_CCFLOAT_(1.0),
120.0,
0,
0,
0,
0,
0);
sub_774008(&v18);
sub_776584((int)&v19, "Disable");
cocos2d::CCPoint::CCPoint(
&v20,
(float)((float)(a1->m_width * 0.5) + (float)(v14.width * 0.5)) - 35.0,
(float)((float)(v14.height * 0.5) - (float)(a1->m_height * 0.5)) + 25.0);
SetupTriggerPopup::createToggleValueControl(a1, 500, (int)&v19, &v20, 1, 0, 0, 1.0);
sub_774008(&v19);
cocos2d::CCPoint::CCPoint(
&v16,
(float)((float)(v14.width * 0.5) - (float)(a1->m_width * 0.5)) + 40.0,
(float)((float)(v14.height * 0.5) - (float)(a1->m_height * 0.5)) + 70.0);
v6 = cocos2d::CCLabelBMFont::create();
v6->setScale(v6, 0.5);
a1->m_mainLayer->addChild(a1->m_mainLayer, v6);
v6->setPosition(v6, &v16);
v7 = a1->getValue(a1, 499);
SelectSettingLayer::frameForValue((int)&v20, StartingSpeed, (int)v7);
a1->m_speedSprite = cocos2d::CCSprite::createWithSpriteFrameName((const char *)LODWORD(v20.x));
sub_774008(&v20);
((void (__fastcall *)(cocos2d::CCSprite *, int))a1->m_speedSprite->setScale)(a1->m_speedSprite, 1058642330);
m_speedSprite = a1->m_speedSprite;
LODWORD(v20.x) = SetupAudioLineGuidePopup::onSpeed;
v20.y = 0.0;
v9 = CCMenuItemSpriteExtra::create(
m_speedSprite,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(SetupAudioLineGuidePopup::onSpeed, (unsigned int)a1));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v9);
setPosition = v9->setPosition;
m_buttonMenu = a1->m_buttonMenu;
v10 = (int)v6->getPosition(v6);
cocos2d::CCPoint::CCPoint(&v17, 0.0, -34.0);
cocos2d::CCPoint::operator+(&v18, v10, &v17);
cocos2d::CCNode::convertToNodeSpace(&v19, m_buttonMenu, &v18);
setPosition(v9, &v19);
SetupTriggerPopup::postSetup(a1);
}
return v4;
}