//
// EditTriggersPopup::init from 0x10029aa30 to 0x10029ac9d (621 bytes)
//
// 1 xrefs:
// > EditTriggersPopup::create @ 0x10029a9eb
//
// 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)
{
bool result; // al
cocos2d::CCLabelBMFont *v4; // r15
ButtonSprite *v5; // rax
CCMenuItemSpriteExtra *v6; // rax
__int64 v7; // r14
cocos2d::CCMenu *m_buttonMenu; // r15
float v9; // [rsp+8h] [rbp-78h] BYREF
float v10; // [rsp+10h] [rbp-70h] BYREF
char v11; // [rsp+18h] [rbp-68h] BYREF
char v12[15]; // [rsp+19h] [rbp-67h] BYREF
void *v13; // [rsp+28h] [rbp-58h]
_QWORD v14[2]; // [rsp+30h] [rbp-50h] BYREF
void *__p; // [rsp+40h] [rbp-40h]
float v16; // [rsp+4Ch] [rbp-34h] BYREF
float v17; // [rsp+50h] [rbp-30h]
bool v18; // [rsp+57h] [rbp-29h]
double v19; // 0:xmm0_8.8
double v20; // 0:xmm0_8.8
result = SetupTriggerPopup::init(a1, a2, a3, 330.0, 120.0, 1);
if ( result )
{
v18 = result;
((void (__fastcall *)(EditTriggersPopup *))a1->determineStartValues)(a1);
cocos2d::CCDirector::sharedDirector();
*(cocos2d::CCSize *)&v19 = cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v16);
v4 = cocos2d::CCLabelBMFont::create_3("Edit Triggers", "goldFont.fnt");
((void (__fastcall *)(EditTriggersPopup *, cocos2d::CCLabelBMFont *, double))a1->addChild)(a1, v4, v19);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v4->setScale)(v4, 0.69999999);
sub_10028CBE0(&v10, v16 * 0.5, (float)((float)(a1->m_height * 0.5) + (float)(v17 * 0.5)) + -18.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float *))v4->setPosition)(v4, &v10);
v5 = ButtonSprite::create_1("OK", 40, 0, 0.80000001, 1, "goldFont.fnt", "GJ_button_01.png", 30.0);
v6 = CCMenuItemSpriteExtra::create(v5, nullptr, a1, (cocos2d::SEL_MenuHandler)0x529uLL);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v6);
v11 = 8;
strcpy(v12, "Help");
__p = operator new(0xC0u);
v14[0] = 193;
v14[1] = 189;
strcpy(
(char *)__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.");
v7 = InfoAlertButton::create(&v11, v14, 1.0);
if ( (v14[0] & 1) != 0 )
operator delete(__p);
if ( (v11 & 1) != 0 )
operator delete(v13);
((void (__fastcall *)(cocos2d::CCMenu *, __int64))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v7);
m_buttonMenu = a1->m_buttonMenu;
sub_10028CBE0(
&v9,
(float)((float)(v16 * 0.5) - (float)(a1->m_width * 0.5)) + 18.0,
(float)((float)(0.5 * a1->m_height) + (float)(v17 * 0.5)) + -18.0);
*(cocos2d::CCPoint *)&v20 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)&v10,
(const cocos2d::CCPoint *)m_buttonMenu);
(*(void (__fastcall **)(__int64, float *, double))(*(_QWORD *)v7 + 184LL))(v7, &v10, v20);
a1->m_joystickConnected = -1;
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
return v18;
}
return result;
}