//
// SetupInteractObjectPopup::init from 0x1405b8ff0 to 0x1405b9865 (2165 bytes)
//
// 3 xrefs:
// > SetupInteractObjectPopup::create @ 0x1405b8fae
// > ??> @ 0x14092de60
// > ??> @ 0x14092de6c
//
// 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:34:45 +0000
//
// Hidden C++ exception states: #wind=4
char __fastcall SetupInteractObjectPopup::init(_BYTE *a1, int a2, int a3, int a4)
{
char result; // al
_BYTE *v6; // rax
_OWORD *v7; // rcx
const char *v8; // rdx
__int64 v9; // r8
__int64 v10; // rcx
__int64 v11; // rax
float v12; // xmm8_4
float v13; // xmm7_4
float v14; // xmm11_4
float v15; // xmm12_4
int v16; // eax
__int64 v17; // rdi
const struct cocos2d::CCPoint *v18; // rax
void *v19; // rcx
int v20; // eax
int v21; // eax
const struct cocos2d::CCPoint *v22; // rax
void *v23; // rcx
int v24; // eax
float v25; // xmm6_4
int v26; // eax
int v27; // eax
int v28; // eax
void **v29; // [rsp+80h] [rbp-80h] BYREF
void **v30; // [rsp+88h] [rbp-78h] BYREF
float v31[2]; // [rsp+90h] [rbp-70h] BYREF
void *Block[2]; // [rsp+98h] [rbp-68h] BYREF
__m128i si128; // [rsp+A8h] [rbp-58h]
void *v34[2]; // [rsp+B8h] [rbp-48h] BYREF
__m128i v35; // [rsp+C8h] [rbp-38h]
result = SetupTriggerPopup::init((_DWORD)a1, a2, a3, a4, 1133248512, 1, 0);
if ( result )
{
a1[744] = 1;
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)a1 + 1096LL))(a1);
si128.m128i_i64[0] = 11;
si128.m128i_i64[1] = 15;
Block[0] = (void *)0x6369502074696445LL;
Block[1] = (void *)7370091;
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);
v29 = Block;
*(_OWORD *)Block = 0;
si128 = 0u;
v6 = sub_14003D460(0x170u);
Block[0] = v6;
si128.m128i_i64[0] = 352;
si128.m128i_i64[1] = 367;
v7 = v6;
v8 = "Sets the object to be a pickup collectable for ItemID.\n"
"Points is how much it increases the count of that ItemID.\n"
"Toggle Trigger lets you toggle or spawn a specific group when collected.\n"
"Particle lets you refer to a custom particles to spawn when collected.\n"
"No Anim disables the animation upon collection.";
v9 = 2;
do
{
*v7 = *(_OWORD *)v8;
v7[1] = *((_OWORD *)v8 + 1);
v7[2] = *((_OWORD *)v8 + 2);
v7[3] = *((_OWORD *)v8 + 3);
v7[4] = *((_OWORD *)v8 + 4);
v7[5] = *((_OWORD *)v8 + 5);
v7[6] = *((_OWORD *)v8 + 6);
v7 += 8;
*(v7 - 1) = *((_OWORD *)v8 + 7);
v8 += 128;
--v9;
}
while ( v9 );
*v7 = *(_OWORD *)v8;
v7[1] = *((_OWORD *)v8 + 1);
v7[2] = *((_OWORD *)v8 + 2);
v7[3] = *((_OWORD *)v8 + 3);
v7[4] = *((_OWORD *)v8 + 4);
v7[5] = *((_OWORD *)v8 + 5);
v6[352] = 0;
*(_OWORD *)v34 = 0;
v35.m128i_i64[0] = 4;
v35.m128i_i64[1] = 15;
strcpy((char *)v34, "Help");
SetupTriggerPopup::addHelpButton(a1, v34, Block);
v11 = cocos2d::CCDirector::sharedDirector(v10);
cocos2d::CCDirector::getWinSize(v11, v31);
v12 = (float)(v31[1] * 0.5) + 70.0;
v13 = v31[0] * 0.5;
v14 = (float)(v31[0] * 0.5) - 130.0;
v15 = (float)(v31[0] * 0.5) + 85.0;
v29 = Block;
si128.m128i_i64[0] = 11;
si128.m128i_i64[1] = 15;
Block[0] = (void *)0x490A70756B636950LL;
Block[1] = (void *)7169396;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v30, v14, v12);
SetupTriggerPopup::createToggleValueControl((_DWORD)a1, 381, (unsigned int)Block, v16, 0, 0, 0, 1065353216);
*(_OWORD *)Block = 0;
si128 = _mm_load_si128((const __m128i *)&xmmword_140836570);
strcpy((char *)Block, "ItemID");
v17 = (__int64)(a1 + 544);
if ( !a1 )
v17 = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v30, v13, v12);
IDNameInput::create((__int64)a1, v17, 2, 80, (__int64)Block, v18, 1060320051, 6, 1, 0, 0);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v19 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v19 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v19 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v19);
}
v30 = Block;
Block[1] = (void *)116;
si128.m128i_i64[0] = 9;
si128.m128i_i64[1] = 15;
Block[0] = (void *)0x6E756F430A627553LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v29, v15, v12);
SetupTriggerPopup::createToggleValueControl((_DWORD)a1, 78, (unsigned int)Block, v20, 0, 0, 1, 1065353216);
v30 = Block;
si128.m128i_i64[0] = 14;
si128.m128i_i64[1] = 15;
strcpy((char *)Block, "Toggle\nTrigger");
HIBYTE(Block[1]) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v29, v14, v12 - 60.0);
SetupTriggerPopup::createToggleValueControl((_DWORD)a1, 382, (unsigned int)Block, v21, 0, 0, 0, 1065353216);
v34[1] = nullptr;
v35 = _mm_load_si128((const __m128i *)&xmmword_140836590);
v34[0] = (void *)0x44492070756F7247LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v30, v13, v12 - 60.0);
IDNameInput::create((__int64)a1, v17, 1, 51, (__int64)v34, v22, 1060320051, 6, 2, 0, 0);
if ( v35.m128i_i64[1] > 0xFuLL )
{
v23 = v34[0];
if ( (unsigned __int64)(v35.m128i_i64[1] + 1) >= 0x1000 )
{
v23 = *((void **)v34[0] - 1);
if ( (unsigned __int64)((char *)v34[0] - (char *)v23 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v23);
}
v30 = Block;
si128.m128i_i64[0] = 12;
si128.m128i_i64[1] = 15;
strcpy((char *)Block, "Enable\nGroup");
BYTE5(Block[1]) = 0;
HIWORD(Block[1]) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v29, v15, v12 - 60.0);
SetupTriggerPopup::createToggleValueControl((_DWORD)a1, 56, (unsigned int)Block, v24, 0, 0, 2, 1065353216);
v30 = v34;
v34[1] = nullptr;
v35.m128i_i64[0] = 8;
v35.m128i_i64[1] = 15;
v34[0] = (void *)0x656C636974726150LL;
v25 = (float)(v12 - 120.0) - 5.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v29, (float)(v31[0] * 0.5) - 100.0, v25);
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
440,
(unsigned int)v34,
v26,
1060320051,
1,
3,
6,
1,
0,
1120403456,
0,
0,
0,
2,
0);
v30 = Block;
*(_OWORD *)Block = 0;
si128.m128i_i64[0] = 6;
si128.m128i_i64[1] = 15;
strcpy((char *)Block, "Points");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v29, (float)(v31[0] * 0.5) + 100.0, v25);
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
383,
(unsigned int)Block,
v27,
1060320051,
1,
2,
8,
1,
0,
1120403456,
0,
0,
0,
2,
0);
v30 = Block;
Block[1] = nullptr;
si128.m128i_i64[0] = 7;
si128.m128i_i64[1] = 15;
Block[0] = (void *)0x6D696E410A6F4ELL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v29, v14, v12 - 180.0);
SetupTriggerPopup::createToggleValueControl((_DWORD)a1, 463, (unsigned int)Block, v28, 0, 0, 0, 1065353216);
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)a1 + 1136LL))(a1);
a1[744] = 0;
SetupInteractObjectPopup::updateItems(a1);
return 1;
}
return result;
}