//
// SetupTimeWarpPopup::init from 0x100147e5c to 0x1001481a4 (840 bytes)
//
// 1 xrefs:
// > SetupTimeWarpPopup::create @ 0x100147e0c
//
// 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 SetupTimeWarpPopup::init(SetupTimeWarpPopup *a1, EffectGameObject *a2, cocos2d::CCArray *a3)
{
_BOOL4 v4; // w20
cocos2d::CCDirector *v5; // x0
cocos2d::CCLabelBMFont *v6; // x22
__n128 v7; // q0
__n128 v8; // q1
ButtonSprite *v9; // x0
CCMenuItemSpriteExtra *v10; // x0
__int64 v11; // x21
__n128 v12; // q0
cocos2d::CCMenu *m_buttonMenu; // x22
__n128 v14; // q1
cocos2d::CCLabelBMFont *v15; // x0
__n128 v16; // q0
cocos2d::CCLabelBMFont *m_timeWarpLabel; // x21
__n128 v18; // q1
Slider *v19; // x0
Slider *m_timeWarpSlider; // x21
float32x2_t *v21; // x22
__n128 v22; // q0
__n128 v23; // q1
double v24; // d0
float32x2_t v26; // [xsp+8h] [xbp-78h] BYREF
void *__p[2]; // [xsp+10h] [xbp-70h] BYREF
char v28; // [xsp+27h] [xbp-59h]
void *v29[2]; // [xsp+28h] [xbp-58h] BYREF
char v30; // [xsp+3Fh] [xbp-41h]
float32x2_t v31; // [xsp+40h] [xbp-40h] BYREF
float v32; // [xsp+48h] [xbp-38h]
float v33; // [xsp+4Ch] [xbp-34h]
cocos2d::CCPoint v34; // 0:kr08_8.8
cocos2d::SEL_MenuHandler v35; // 0:x1.16
cocos2d::SEL_MenuHandler v36; // 0:x3.16
v4 = SetupTriggerPopup::init(a1, a2, a3, 340.0, 200.0, 1);
if ( v4 )
{
((void (__fastcall *)(SetupTimeWarpPopup *))a1->determineStartValues)(a1);
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v5);
v6 = cocos2d::CCLabelBMFont::create_1("Setup TimeWarp Effect", "goldFont.fnt");
((void (__fastcall *)(SetupTimeWarpPopup *, cocos2d::CCLabelBMFont *))a1->addChild)(a1, v6);
v7 = ((__n128 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v6->setScale)(v6, 0.7);
v7.n128_f32[0] = v32 * 0.5;
v8.n128_f32[0] = (float)((float)(v33 * 0.5) + (float)(a1->m_height * 0.5)) + -18.0;
sub_100022980(v7, v8, &v31);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *))v6->setPosition)(v6, &v31);
v9 = ButtonSprite::create_1("OK", 40, 0, 0.8, 1, "goldFont.fnt", "GJ_button_01.png", 30.0);
v36.ptr = (void (__cdecl *)(cocos2d::CCObject *))1320;
v36.adj = 1;
v10 = CCMenuItemSpriteExtra::create(v9, nullptr, a1, v36);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v10);
sub_100009900(v29, "Help");
sub_100009900(
__p,
"Lets you warp all time a given amount.\nI need to add more options\nbefore you can do Za Warudo...");
v11 = InfoAlertButton::create(v29, __p, 1.0);
if ( v28 < 0 )
operator delete(__p[0]);
if ( v30 < 0 )
operator delete(v29[0]);
v12 = ((__n128 (__fastcall *)(cocos2d::CCMenu *, __int64))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v11);
m_buttonMenu = a1->m_buttonMenu;
v12.n128_f32[0] = (float)((float)(v32 * 0.5) - (float)(a1->m_width * 0.5)) + 18.0;
v14.n128_f32[0] = (float)((float)(v33 * 0.5) + (float)(a1->m_height * 0.5)) + -18.0;
sub_100022980(v12, v14, &v26);
v34 = cocos2d::CCNode::convertToNodeSpace(m_buttonMenu, (const cocos2d::CCPoint *)&v26);
(*(void (__fastcall **)(__int64, float32x2_t *, float, float))(*(_QWORD *)v11 + 184LL))(v11, &v31, v34.x, v34.y);
v15 = cocos2d::CCLabelBMFont::create_1(" ", "goldFont.fnt");
a1->m_timeWarpLabel = v15;
v16 = ((__n128 (__fastcall *)(SetupTimeWarpPopup *, cocos2d::CCLabelBMFont *))a1->addChild)(a1, v15);
m_timeWarpLabel = a1->m_timeWarpLabel;
v16.n128_f32[0] = v32 * 0.5;
v18.n128_f32[0] = (float)(v33 * 0.5) + 20.0;
sub_100022980(v16, v18, &v31);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float32x2_t *))m_timeWarpLabel->setPosition)(m_timeWarpLabel, &v31);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))a1->m_timeWarpLabel->setScale)(a1->m_timeWarpLabel, 0.8);
v35.ptr = (void (__cdecl *)(cocos2d::CCObject *))SetupTimeWarpPopup::sliderChanged;
v35.adj = 0;
v19 = Slider::create_2(a1, v35);
a1->m_timeWarpSlider = v19;
((void (__fastcall *)(SetupTimeWarpPopup *, Slider *))a1->addChild)(a1, v19);
m_timeWarpSlider = a1->m_timeWarpSlider;
v21 = (float32x2_t *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))a1->m_timeWarpLabel->getPosition)(a1->m_timeWarpLabel);
v22.n128_u32[0] = 0;
v23.n128_u32[0] = -23.0;
sub_100022980(v22, v23, &v26);
*(float32x2_t *)&v24 = sub_1000229DC(v21, &v26, &v31);
((void (__fastcall *)(Slider *, float32x2_t *, double))m_timeWarpSlider->setPosition)(m_timeWarpSlider, &v31, v24);
SetupTimeWarpPopup::updateTimeWarpLabel(a1);
Slider::setValue(a1->m_timeWarpSlider, (float)(a1->m_timeWarpMod + -0.1) / 1.9);
SetupTriggerPopup::createMultiTriggerItemsDefaultVertical(a1);
}
return v4;
}