//
// SetupEventLinkPopup::init from 0x1005775b0 to 0x100577a90 (1248 bytes)
//
// 1 xrefs:
// > SetupEventLinkPopup::create @ 0x10057756b
//
// 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 SetupEventLinkPopup::init(SetupEventLinkPopup *a1, EventLinkTrigger *a2, cocos2d::CCArray *a3)
{
bool result; // al
cocos2d::CCSprite *v4; // r14
CCMenuItemSpriteExtra *v5; // r14
cocos2d::CCMenu *m_buttonMenu; // r15
unsigned __int64 v7; // [rsp+40h] [rbp-100h] BYREF
char v8; // [rsp+48h] [rbp-F8h] BYREF
char v9[15]; // [rsp+49h] [rbp-F7h] BYREF
void *v10; // [rsp+58h] [rbp-E8h]
char v11; // [rsp+60h] [rbp-E0h] BYREF
char v12[15]; // [rsp+61h] [rbp-DFh] BYREF
void *v13; // [rsp+70h] [rbp-D0h]
__int128 v14; // [rsp+78h] [rbp-C8h] BYREF
void *v15; // [rsp+88h] [rbp-B8h]
char v16; // [rsp+90h] [rbp-B0h] BYREF
_BYTE v17[23]; // [rsp+91h] [rbp-AFh] BYREF
char v18; // [rsp+A8h] [rbp-98h] BYREF
_BYTE v19[23]; // [rsp+A9h] [rbp-97h] BYREF
float v20[2]; // [rsp+C0h] [rbp-80h] BYREF
char v21; // [rsp+C8h] [rbp-78h] BYREF
_BYTE v22[23]; // [rsp+C9h] [rbp-77h] BYREF
char v23; // [rsp+E0h] [rbp-60h] BYREF
void *v24[3]; // [rsp+E1h] [rbp-5Fh] BYREF
unsigned __int64 v25; // [rsp+FCh] [rbp-44h] BYREF
double v26; // [rsp+104h] [rbp-3Ch] BYREF
unsigned __int64 v27; // [rsp+10Ch] [rbp-34h] BYREF
bool v28; // [rsp+117h] [rbp-29h]
double v29; // 0:xmm0_8.8
result = SetupTriggerPopup::init(a1, a2, a3, 380.0, 280.0, 1);
if ( result )
{
v28 = result;
SetupTriggerPopup::preSetup(a1);
v21 = 20;
strcpy(v22, "Event Link");
SetupTriggerPopup::addTitle((__int64)a1, (__int64)&v21);
if ( (v21 & 1) != 0 )
operator delete(*(void **)&v22[15]);
v8 = 4;
strcpy(v9, "OK");
SetupTriggerPopup::addCloseButton((__int64)a1, (__int64)&v8);
if ( (v8 & 1) != 0 )
operator delete(v10);
v11 = 8;
strcpy(v12, "Help");
v15 = operator new(0x120u);
*(_QWORD *)&v14 = 289;
*((_QWORD *)&v14 + 1) = 283;
strcpy(
(char *)v15,
"Activates Group ID upon a specified player action. Select one or multiple from the top right menu.\n"
"Extra ID makes the action only apply if the player interacts with a corresponding object, for example if M"
"aterial ID matches.\n"
"Extra ID2: 0 = All, 1 = P1, 2 = P2");
SetupTriggerPopup::addHelpButton((__int64)a1, (__int64)&v11, &v14, (__m128)0x3F800000u);
if ( (v14 & 1) != 0 )
operator delete(v15);
if ( (v11 & 1) != 0 )
operator delete(v13);
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v20);
sub_10028CBE0((float *)&v25, v20[0] * 0.5, v20[1] * 0.5);
v16 = 18;
strcpy(v17, "Group ID:");
sub_10028CBE0((float *)&v27, -80.0, 40.0);
sub_10028CCE0(&v26, &v25, &v27);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
51,
(__int64)&v16,
(float *)&v26,
1,
Int,
0.80000001,
0.0,
9999.0,
10,
1,
0,
0,
0,
0,
0);
if ( (v16 & 1) != 0 )
operator delete(*(void **)&v17[15]);
v18 = 18;
strcpy(v19, "Extra ID:");
sub_10028CBE0((float *)&v27, 80.0, 40.0);
sub_10028CCE0(&v26, &v25, &v27);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
447,
(__int64)&v18,
(float *)&v26,
1,
Int,
0.80000001,
0.0,
9999.0,
10,
1,
0,
0,
0,
0,
0);
if ( (v18 & 1) != 0 )
operator delete(*(void **)&v19[15]);
v23 = 20;
strcpy((char *)v24, "Extra ID2:");
sub_10028CBE0((float *)&v27, 80.0, -40.0);
sub_10028CCE0(&v26, &v25, &v27);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
525,
(__int64)&v23,
(float *)&v26,
1,
Int,
0.80000001,
0.0,
9999.0,
10,
1,
0,
0,
0,
0,
0);
if ( (v23 & 1) != 0 )
operator delete(*(void **)((char *)&v24[1] + 7));
v4 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_menuBtn_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, float))v4->setScale)(v4, 0.55000001);
v5 = CCMenuItemSpriteExtra::create(
v4,
nullptr,
a1,
(cocos2d::SEL_MenuHandler)(unsigned __int64)SetupEventLinkPopup::onSelectEvent);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v5);
m_buttonMenu = a1->m_buttonMenu;
sub_10028CBE0((float *)&v7, (float)(a1->m_width * 0.5) + -22.0, (float)(0.5 * a1->m_height) + -22.0);
sub_10028CCE0((double *)&v27, &v25, &v7);
*(cocos2d::CCPoint *)&v29 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)&v26,
(const cocos2d::CCPoint *)m_buttonMenu);
((void (__fastcall *)(CCMenuItemSpriteExtra *, double *, double))v5->setPosition)(v5, &v26, v29);
SetupTriggerPopup::postSetup(a1);
return v28;
}
return result;
}