//
// EditTriggersPopup::init from 0x4aa850 to 0x4aaa1a (458 bytes)
//
// 1 xrefs:
// > EditTriggersPopup::create @ 0x4aaac6
//
// 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 EditTriggersPopup::init(EditTriggersPopup *a1, EffectGameObject *a2, cocos2d::CCArray *a3)
{
_BOOL4 v4; // r8
cocos2d::CCDirector *v5; // r0
cocos2d::CCLabelBMFont *v6; // r6
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r11
ButtonSprite *v8; // r0
CCMenuItemSpriteExtra *v9; // r0
float v10; // r3
cocos2d::CCNode *v11; // r9
cocos2d::CCMenu *m_buttonMenu; // r11
void (__fastcall *v13)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
float v15; // [sp+10h] [bp-34h]
cocos2d::CCSize v16; // [sp+1Ch] [bp-28h] BYREF
cocos2d::CCPoint v17; // [sp+24h] [bp-20h] BYREF
cocos2d::CCPoint v18; // [sp+2Ch] [bp-18h] BYREF
cocos2d::CCPoint v19; // [sp+34h] [bp-10h] BYREF
v4 = SetupTriggerPopup::init(a1, a2, a3, 330.0, 120.0, 1);
if ( v4 )
{
a1->determineStartValues(a1);
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v16, v5);
v6 = cocos2d::CCLabelBMFont::create();
a1->addChild(a1, v6);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v6->setScale)(v6, 1060320051);
setPosition = v6->setPosition;
cocos2d::CCPoint::CCPoint(
&v19,
v16.width * 0.5,
(float)((float)(a1->m_height * 0.5) + (float)(v16.height * 0.5)) - 18.0);
setPosition(v6, &v19);
v8 = ButtonSprite::create(
(ButtonSprite *)"OK",
(const char *)&word_28,
0,
0.8,
1,
"goldFont.fnt",
"GJ_button_01.png",
(const char *)0x41F00000,
v15);
LODWORD(v19.x) = 660;
LODWORD(v19.y) = 1;
v9 = CCMenuItemSpriteExtra::create(v8, nullptr, (cocos2d::SEL_MenuHandler)((unsigned int)a1 | 0x29400000000LL));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v9);
sub_776584((int)&v17, "Help");
sub_776584(
(int)&v18,
"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 = (cocos2d::CCNode *)InfoAlertButton::create(
(InfoAlertButton *)&v17,
(std::string)&v18,
(std::string)1065353216,
v10);
sub_774008(&v18);
sub_774008(&v17);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v11);
m_buttonMenu = a1->m_buttonMenu;
v13 = v11->setPosition;
cocos2d::CCPoint::CCPoint(
&v17,
(float)((float)(v16.width * 0.5) - (float)(a1->m_width * 0.5)) + 18.0,
(float)((float)(a1->m_height * 0.5) + (float)(v16.height * 0.5)) - 18.0);
cocos2d::CCNode::convertToNodeSpace(&v18, m_buttonMenu, &v17);
v13(v11, &v18);
a1->m_joystickConnected = -1;
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
}
return v4;
}