//
// EditTriggersPopup::init from 0x1002d253c to 0x1002d2768 (556 bytes)
//
// 1 xrefs:
// > EditTriggersPopup::create @ 0x1002d24ec
//
// 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 EditTriggersPopup::init(EditTriggersPopup *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
char *v11; // x21
__n128 v12; // q0
cocos2d::CCMenu *m_buttonMenu; // x22
__n128 v14; // q1
cocos2d::CCPoint v16; // [xsp+8h] [xbp-68h] BYREF
void *__p[2]; // [xsp+10h] [xbp-60h] BYREF
char v18; // [xsp+27h] [xbp-49h]
void *v19[2]; // [xsp+28h] [xbp-48h] BYREF
char v20; // [xsp+3Fh] [xbp-31h]
int v21; // [xsp+40h] [xbp-30h] BYREF
float v22; // [xsp+48h] [xbp-28h]
float v23; // [xsp+4Ch] [xbp-24h]
cocos2d::CCPoint v24; // 0:kr08_8.8
cocos2d::SEL_MenuHandler v25; // 0:x3.16
v4 = SetupTriggerPopup::init(a1, a2, a3, 330.0, 120.0, 1);
if ( v4 )
{
((void (__fastcall *)(EditTriggersPopup *))a1->determineStartValues)(a1);
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v5);
v6 = cocos2d::CCLabelBMFont::create_1("Edit Triggers", "goldFont.fnt");
((void (__fastcall *)(EditTriggersPopup *, cocos2d::CCLabelBMFont *))a1->addChild)(a1, v6);
v7 = ((__n128 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v6->setScale)(v6, 0.7);
v7.n128_f32[0] = v22 * 0.5;
v8.n128_f32[0] = (float)((float)(v23 * 0.5) + (float)(a1->m_height * 0.5)) + -18.0;
sub_100022980(v7, v8, &v21);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int *))v6->setPosition)(v6, &v21);
v9 = ButtonSprite::create_1("OK", 40, 0, 0.8, 1, "goldFont.fnt", "GJ_button_01.png", 30.0);
v25.ptr = (void (__cdecl *)(cocos2d::CCObject *))1320;
v25.adj = 1;
v10 = CCMenuItemSpriteExtra::create(v9, nullptr, a1, v25);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v10);
sub_100009900(v19, "Help");
sub_100009900(
__p,
"Edit attributes of the selected triggers.\n"
"Touch Triggers makes the object activate on player touch.\n"
"Spawn Triggered makes the triggers activate from a spawn trigger.");
v11 = InfoAlertButton::create((__int64)v19, (__int64)__p, 1.0);
if ( v18 < 0 )
operator delete(__p[0]);
if ( v20 < 0 )
operator delete(v19[0]);
v12 = ((__n128 (__fastcall *)(cocos2d::CCMenu *, char *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v11);
m_buttonMenu = a1->m_buttonMenu;
v12.n128_f32[0] = (float)((float)(v22 * 0.5) - (float)(a1->m_width * 0.5)) + 18.0;
v14.n128_f32[0] = (float)((float)(v23 * 0.5) + (float)(a1->m_height * 0.5)) + -18.0;
sub_100022980(v12, v14, &v16);
v24 = cocos2d::CCNode::convertToNodeSpace(m_buttonMenu, &v16);
(*(void (__fastcall **)(char *, int *, float, float))(*(_QWORD *)v11 + 184LL))(v11, &v21, v24.x, v24.y);
a1->m_joystickConnected = -1;
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
}
return v4;
}