//
// SetupEventLinkPopup::init from 0x1405fbf80 to 0x1405fc53e (1470 bytes)
//
// 3 xrefs:
// > SetupEventLinkPopup::create @ 0x1405fbf3e
// > ??> @ 0x14092f774
// > ??> @ 0x14092f780
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:35:09 +0000
//
// Hidden C++ exception states: #wind=4
char __fastcall SetupEventLinkPopup::init(__int64 a1, int a2, int a3, int a4)
{
char result; // al
_BYTE *v6; // r9
_BYTE *v7; // rcx
const char *v8; // rdx
__int64 v9; // r8
__int64 v10; // rcx
__int64 v11; // rax
__int64 v12; // rax
__int64 v13; // rdx
void *v14; // rcx
__int64 v15; // rax
__int64 v16; // rax
struct cocos2d::CCSprite *v17; // rax
int v18; // ebx
cocos2d::CCObject *v19; // rdi
__int64 v20; // rax
__int64 v21; // rbx
__int64 v22; // rax
__int64 v23; // [rsp+80h] [rbp-88h]
void **v24; // [rsp+88h] [rbp-80h] BYREF
_BYTE v25[8]; // [rsp+90h] [rbp-78h] BYREF
void **v26; // [rsp+98h] [rbp-70h] BYREF
float v27[2]; // [rsp+A0h] [rbp-68h] BYREF
void **v28; // [rsp+A8h] [rbp-60h] BYREF
__int128 v29; // [rsp+B0h] [rbp-58h] BYREF
__int64 v30; // [rsp+C0h] [rbp-48h]
__int64 v31; // [rsp+C8h] [rbp-40h]
void *Block[2]; // [rsp+D0h] [rbp-38h] BYREF
__m128i si128; // [rsp+E0h] [rbp-28h]
result = SetupTriggerPopup::init(a1, a2, a3, a4, 1133248512, 1, 0);
if ( result )
{
*(_BYTE *)(a1 + 744) = 1;
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1096LL))(a1);
Block[1] = (void *)27502;
si128.m128i_i64[0] = 10;
si128.m128i_i64[1] = 15;
Block[0] = (void *)0x694C20746E657645LL;
SetupTriggerPopup::addTitle(a1, Block);
*(_OWORD *)Block = 0;
si128.m128i_i64[0] = 2;
si128.m128i_i64[1] = 15;
strcpy((char *)Block, "OK");
SetupTriggerPopup::addCloseButton(a1, Block);
v24 = Block;
*(_OWORD *)Block = 0;
si128 = 0u;
v6 = sub_14003D460(0x120u);
Block[0] = v6;
si128.m128i_i64[0] = 283;
si128.m128i_i64[1] = 287;
v7 = v6;
v8 = "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 i"
"f Material ID matches.\n"
"Extra ID2: 0 = All, 1 = P1, 2 = P2";
v9 = 2;
do
{
*(_OWORD *)v7 = *(_OWORD *)v8;
*((_OWORD *)v7 + 1) = *((_OWORD *)v8 + 1);
*((_OWORD *)v7 + 2) = *((_OWORD *)v8 + 2);
*((_OWORD *)v7 + 3) = *((_OWORD *)v8 + 3);
*((_OWORD *)v7 + 4) = *((_OWORD *)v8 + 4);
*((_OWORD *)v7 + 5) = *((_OWORD *)v8 + 5);
*((_OWORD *)v7 + 6) = *((_OWORD *)v8 + 6);
v7 += 128;
*((_OWORD *)v7 - 1) = *((_OWORD *)v8 + 7);
v8 += 128;
--v9;
}
while ( v9 );
*(_OWORD *)v7 = *(_OWORD *)v8;
*((_QWORD *)v7 + 2) = *((_QWORD *)v8 + 2);
*((_WORD *)v7 + 12) = *((_WORD *)v8 + 12);
v7[26] = v8[26];
v6[283] = 0;
v29 = 0;
v30 = 4;
v31 = 15;
strcpy((char *)&v29, "Help");
SetupTriggerPopup::addHelpButton(a1, &v29, Block);
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
v11 = cocos2d::CCDirector::sharedDirector(v10);
cocos2d::CCDirector::getWinSize(v11, v27);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, v27[0] * 0.5, v27[1] * 0.5);
Block[1] = (void *)58;
si128 = _mm_load_si128((const __m128i *)&xmmword_1408365A0);
Block[0] = (void *)0x44492070756F7247LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v26, -80.0, 40.0);
cocos2d::CCPoint::operator+(v25, &v24, v12);
v13 = a1 + 544;
if ( !a1 )
v13 = 0;
IDNameInput::create(a1, v13, 1, 51, (__int64)Block, (const struct cocos2d::CCPoint *)&v24, 1061997773, 6, 0, 0, 0);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v14 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v14 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v14 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v14);
}
v26 = Block;
Block[1] = (void *)58;
si128.m128i_i64[0] = 9;
si128.m128i_i64[1] = 15;
Block[0] = (void *)0x4449206172747845LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v28, 80.0, 40.0);
cocos2d::CCPoint::operator+(v25, &v24, v15);
SetupTriggerPopup::createValueControlAdvanced(
a1,
447,
(unsigned int)Block,
(unsigned int)&v24,
1061997773,
1,
2,
10,
1,
0,
1176255488,
0,
0,
0,
0,
0,
v24);
v28 = Block;
Block[1] = (void *)14898;
si128.m128i_i64[0] = 10;
si128.m128i_i64[1] = 15;
Block[0] = (void *)0x4449206172747845LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v26, 80.0, -40.0);
cocos2d::CCPoint::operator+(v25, &v24, v16);
LOBYTE(v23) = 0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
525,
(unsigned int)Block,
(unsigned int)&v24,
1061997773,
1,
2,
10,
1,
0,
1176255488,
0,
0,
0,
0,
v23);
v17 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_menuBtn_001.png");
v18 = (int)v17;
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v17 + 160LL))(v17);
v19 = CCMenuItemSpriteExtra::create(v18, 0, a1, (__int64)SetupEventLinkPopup::onSelectEvent);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v19);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v28,
(float)(*(float *)(a1 + 732) * 0.5) - 22.0,
(float)(*(float *)(a1 + 736) * 0.5) - 22.0);
cocos2d::CCPoint::operator+(v25, &v24, v20);
v21 = *(_QWORD *)v19;
cocos2d::CCNode::convertToNodeSpace(*(_QWORD *)(a1 + 552), &v26, &v24);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v21 + 184))(v19, v22);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1136LL))(a1);
*(_BYTE *)(a1 + 744) = 0;
return 1;
}
return result;
}