//
// SetupStaticCameraPopup::init from 0x1405f5b10 to 0x1405f654c (2620 bytes)
//
// 3 xrefs:
// > SetupStaticCameraPopup::create @ 0x1405f5ace
// > ??> @ 0x14092f4b0
// > ??> @ 0x14092f4bc
//
// 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:07 +0000
//
// Hidden C++ exception states: #wind=4
char __fastcall SetupStaticCameraPopup::init(__int64 a1, int a2, int a3, int a4)
{
char result; // al
__int64 v6; // rcx
__int64 v7; // rax
_QWORD *v8; // r9
_QWORD *v9; // rcx
const char *v10; // rdx
__int64 v11; // r8
__int64 v12; // rax
__int64 v13; // rax
__int64 v14; // rax
__int64 v15; // rdx
void *v16; // rcx
int v17; // ebx
__int64 v18; // rax
int v19; // r8d
int v20; // r9d
__int64 v21; // rax
int v22; // r8d
int v23; // r9d
__int64 v24; // rax
__int64 v25; // rax
__int64 v26; // rax
__int64 v27; // rax
__int64 v28; // rax
__int64 v29; // rax
int v30; // r8d
int v31; // r9d
__int64 v32; // [rsp+80h] [rbp-88h]
__int64 v33; // [rsp+80h] [rbp-88h]
__int128 *v34; // [rsp+88h] [rbp-80h] BYREF
__int128 v35; // [rsp+90h] [rbp-78h] BYREF
__int64 v36; // [rsp+A0h] [rbp-68h]
__int64 v37; // [rsp+A8h] [rbp-60h]
_BYTE v38[8]; // [rsp+B0h] [rbp-58h] BYREF
__int128 *v39; // [rsp+B8h] [rbp-50h] BYREF
__int128 *v40; // [rsp+C0h] [rbp-48h] BYREF
float v41[2]; // [rsp+C8h] [rbp-40h] BYREF
void *Block[2]; // [rsp+D0h] [rbp-38h] BYREF
__m128i si128; // [rsp+E0h] [rbp-28h]
result = SetupTriggerPopup::init(a1, a2, a3, a4, 1134231552, 1, 0);
if ( result )
{
*(_BYTE *)(a1 + 744) = 1;
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1096LL))(a1);
v7 = cocos2d::CCDirector::sharedDirector(v6);
cocos2d::CCDirector::getWinSize(v7, v41);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v38, v41[0] * 0.5, v41[1] * 0.5);
v35 = 0;
*(_QWORD *)&v35 = sub_14003D460(0x20u);
v36 = 19;
v37 = 31;
strcpy((char *)v35, "Setup Static Camera");
SetupTriggerPopup::addTitle(a1, &v35);
v34 = &v35;
v35 = 0;
v36 = 0;
v37 = 0;
v8 = sub_14003D460(0x180u);
*(_QWORD *)&v35 = v8;
v36 = 378;
v37 = 383;
v9 = v8;
v10 = "Makes the camera static around a target object.\n"
"Follow makes the camera change according to the object's movement.\n"
"Smooth Velocity makes the transition to the target adapt to current camera velocity. Recommended no ea"
"sing.\n"
"Duration is how long the camera takes to change to the target object.\n"
"Use another trigger with Exit Static to stop.";
v11 = 2;
do
{
*(_OWORD *)v9 = *(_OWORD *)v10;
*((_OWORD *)v9 + 1) = *((_OWORD *)v10 + 1);
*((_OWORD *)v9 + 2) = *((_OWORD *)v10 + 2);
*((_OWORD *)v9 + 3) = *((_OWORD *)v10 + 3);
*((_OWORD *)v9 + 4) = *((_OWORD *)v10 + 4);
*((_OWORD *)v9 + 5) = *((_OWORD *)v10 + 5);
*((_OWORD *)v9 + 6) = *((_OWORD *)v10 + 6);
v9 += 16;
*((_OWORD *)v9 - 1) = *((_OWORD *)v10 + 7);
v10 += 128;
--v11;
}
while ( v11 );
*(_OWORD *)v9 = *(_OWORD *)v10;
*((_OWORD *)v9 + 1) = *((_OWORD *)v10 + 1);
*((_OWORD *)v9 + 2) = *((_OWORD *)v10 + 2);
*((_OWORD *)v9 + 3) = *((_OWORD *)v10 + 3);
*((_OWORD *)v9 + 4) = *((_OWORD *)v10 + 4);
*((_OWORD *)v9 + 5) = *((_OWORD *)v10 + 5);
*((_OWORD *)v9 + 6) = *((_OWORD *)v10 + 6);
v9[14] = *((_QWORD *)v10 + 14);
*((_WORD *)v9 + 60) = *((_WORD *)v10 + 60);
*((_BYTE *)v8 + 378) = 0;
*(_OWORD *)Block = 0;
si128.m128i_i64[0] = 4;
si128.m128i_i64[1] = 15;
strcpy((char *)Block, "Help");
SetupTriggerPopup::addHelpButton(a1, Block, &v35);
*(_OWORD *)Block = 0;
si128.m128i_i64[0] = 2;
si128.m128i_i64[1] = 15;
strcpy((char *)Block, "OK");
SetupTriggerPopup::addCloseButton(a1, Block);
SetupTriggerPopup::createMultiTriggerItemsDefaultHorizontal(a1);
v40 = &v35;
v36 = 11;
v37 = 15;
*(_QWORD *)&v35 = 0x6174530A74697845LL;
*((_QWORD *)&v35 + 1) = 6515060;
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v39,
(float)(*(float *)(a1 + 732) * 0.5) - 80.0,
(float)(*(float *)(a1 + 736) * 0.5) - 20.0);
cocos2d::CCPoint::operator+(v38, &v34, v12);
SetupTriggerPopup::createToggleValueControl(a1, 110, (unsigned int)&v35, (unsigned int)&v34, 0, 0, 0, 1065353216);
v39 = &v35;
v36 = 12;
v37 = 15;
strcpy((char *)&v35, "Exit\nInstant");
BYTE13(v35) = 0;
HIWORD(v35) = 0;
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v40,
(float)(*(float *)(a1 + 732) * 0.5) - 80.0,
(float)(*(float *)(a1 + 736) * 0.5) - 50.0);
cocos2d::CCPoint::operator+(v38, &v34, v13);
SetupTriggerPopup::createToggleValueControl(a1, 465, (unsigned int)&v35, (unsigned int)&v34, 0, 0, 0, 1065353216);
*(_OWORD *)Block = 0;
si128 = 0;
Block[0] = sub_14003D460(0x20u);
si128 = _mm_load_si128((const __m128i *)&xmmword_140836610);
strcpy((char *)Block[0], "Target Group ID:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v39, -100.0, 80.0);
cocos2d::CCPoint::operator+(v38, &v34, v14);
v15 = a1 + 544;
if ( !a1 )
v15 = 0;
IDNameInput::create(a1, v15, 1, 71, (__int64)Block, (const struct cocos2d::CCPoint *)&v34, 1061158912, 6, 0, 0, 0);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v16 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v16 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v16 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v16);
}
v17 = (int)(*(float (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1168LL))(a1, 101);
v39 = &v35;
v35 = 0;
v36 = 6;
v37 = 15;
strcpy((char *)&v35, "X\nOnly");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v40, 40.0, 80.0);
cocos2d::CCPoint::operator+(v38, &v34, v18);
LOBYTE(v19) = v17 == 1;
SetupTriggerPopup::createCustomToggleValueControl(a1, 1, v19, v20, (__int64)&v35, (__int64)&v34, 0, 0, 0);
v39 = &v35;
v35 = 0;
v36 = 6;
v37 = 15;
strcpy((char *)&v35, "Y\nOnly");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v40, 130.0, 80.0);
cocos2d::CCPoint::operator+(v38, &v34, v21);
LOBYTE(v22) = v17 == 2;
SetupTriggerPopup::createCustomToggleValueControl(a1, 2, v22, v23, (__int64)&v35, (__int64)&v34, 0, 0, 0);
v39 = &v35;
v35 = 0;
v36 = 6;
v37 = 15;
strcpy((char *)&v35, "Follow");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v40, -130.0, 30.0);
cocos2d::CCPoint::operator+(v38, &v34, v24);
SetupTriggerPopup::createToggleValueControl(a1, 212, (unsigned int)&v35, (unsigned int)&v34, 0, 0, 0, 1065353216);
v39 = &v35;
v36 = 7;
v37 = 15;
v35 = 0x3A676E69736145uLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v40, 95.0, 30.0);
cocos2d::CCPoint::operator+(v38, &v34, v25);
SetupTriggerPopup::createValueControlAdvanced(
a1,
213,
(unsigned int)&v35,
(unsigned int)&v34,
1061158912,
0,
1,
10,
0,
0,
1112014848,
0,
212,
1,
1,
0,
v34);
v39 = &v35;
v36 = 15;
v37 = 15;
strcpy((char *)&v35, "Smooth\nVelocity");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v40, -130.0, -10.0);
cocos2d::CCPoint::operator+(v38, &v34, v26);
SetupTriggerPopup::createToggleValueControl(a1, 453, (unsigned int)&v35, (unsigned int)&v34, 0, 0, 0, 1065353216);
v39 = &v35;
*((_QWORD *)&v35 + 1) = 58;
v36 = 9;
v37 = 15;
*(_QWORD *)&v35 = 0x7265696669646F4DLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v40, 95.0, -10.0);
cocos2d::CCPoint::operator+(v38, &v34, v27);
LOBYTE(v32) = 0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
454,
(unsigned int)&v35,
(unsigned int)&v34,
1061158912,
0,
1,
10,
0,
0,
1065353216,
0,
453,
1,
2,
v32);
v39 = &v35;
v36 = 9;
v37 = 15;
*(_QWORD *)&v35 = *(_QWORD *)"Duration:";
*((_QWORD *)&v35 + 1) = (unsigned __int8)aDuration[8];
BYTE9(v35) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v40, -100.0, -60.0);
cocos2d::CCPoint::operator+(v38, &v34, v28);
LOBYTE(v33) = 0;
SetupTriggerPopup::createValueControlAdvanced(
a1,
10,
(unsigned int)&v35,
(unsigned int)&v34,
1061158912,
0,
1,
10,
0,
0,
1092616192,
0,
0,
0,
2,
v33);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v39, 105.0, -60.0);
cocos2d::CCPoint::operator+(v38, &v34, v29);
SetupTriggerPopup::createEasingControls(a1, (unsigned int)&v34, v30, v31, 0);
SetupStaticCameraPopup::updateState(a1);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1136LL))(a1);
*(_BYTE *)(a1 + 744) = 0;
return 1;
}
return result;
}