//
// SetupAreaFadeTriggerPopup::init from 0x1405a6710 to 0x1405a6e71 (1889 bytes)
//
// 2 xrefs:
// > EditorUI::editObject @ 0x1401bc034
// > ??> @ 0x14092d5c0
//
// 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:39 +0000
//
// Hidden C++ exception states: #wind=3
char __fastcall SetupAreaFadeTriggerPopup::init(_BYTE *a1, int a2, int a3, int a4)
{
char result; // al
_QWORD *v6; // r9
_QWORD *v7; // rcx
const char *v8; // rdx
__int64 v9; // r8
__int64 v10; // rcx
__int64 v11; // rax
__int64 v12; // rax
__int64 v13; // rax
__int64 v14; // rax
__int64 v15; // rax
__int64 v16; // rax
__int64 v17; // rax
float v18[2]; // [rsp+88h] [rbp-80h] BYREF
__int128 *v19; // [rsp+90h] [rbp-78h] BYREF
__int128 *v20; // [rsp+98h] [rbp-70h] BYREF
__int128 *v21; // [rsp+A0h] [rbp-68h] BYREF
__int128 v22; // [rsp+A8h] [rbp-60h] BYREF
__int64 v23; // [rsp+B8h] [rbp-50h]
__int64 v24; // [rsp+C0h] [rbp-48h]
__int128 v25; // [rsp+C8h] [rbp-40h] BYREF
__int64 v26; // [rsp+D8h] [rbp-30h]
__int64 v27; // [rsp+E0h] [rbp-28h]
char v28; // [rsp+170h] [rbp+68h] BYREF
result = SetupTriggerPopup::init((_DWORD)a1, a2, a3, a4, 1133248512, 1, 0);
if ( result )
{
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)a1 + 1096LL))(a1);
v22 = 0;
*(_QWORD *)&v22 = sub_14003D460(0x20u);
v23 = 17;
v24 = 31;
strcpy((char *)v22, "Area Fade Trigger");
SetupTriggerPopup::addTitle(a1, &v22);
v22 = 0;
v23 = 2;
v24 = 15;
strcpy((char *)&v22, "OK");
SetupTriggerPopup::addCloseButton(a1, &v22);
v19 = &v22;
v22 = 0;
v23 = 0;
v24 = 0;
v6 = sub_14003D460(0x140u);
*(_QWORD *)&v22 = v6;
v23 = 310;
v24 = 319;
v7 = v6;
v8 = "Fades objects using Target Group ID within an area around Center Group ID. The area can be spec"
"ified by the arrow buttons and Length (for size).\n"
"You can specify how much the objects in the area fade depending on how close they are to the center.\n"
"Check the other pages for more settings.";
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 += 16;
*((_OWORD *)v7 - 1) = *((_OWORD *)v8 + 7);
v8 += 128;
--v9;
}
while ( v9 );
*(_OWORD *)v7 = *(_OWORD *)v8;
*((_OWORD *)v7 + 1) = *((_OWORD *)v8 + 1);
*((_OWORD *)v7 + 2) = *((_OWORD *)v8 + 2);
*((_DWORD *)v7 + 12) = *((_DWORD *)v8 + 12);
*((_WORD *)v7 + 26) = *((_WORD *)v8 + 26);
*((_BYTE *)v6 + 310) = 0;
v25 = 0;
v26 = 4;
v27 = 15;
strcpy((char *)&v25, "Help");
SetupTriggerPopup::addHelpButton(a1, &v25, &v22);
SetupTriggerPopup::createMultiTriggerItemsDefaultHorizontal(a1);
v11 = cocos2d::CCDirector::sharedDirector(v10);
cocos2d::CCDirector::getWinSize(v11, v18);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v28, v18[0] * 0.5, (float)(v18[1] * 0.5) + 95.0);
v20 = &v22;
v22 = 0;
v23 = 6;
v24 = 15;
strcpy((char *)&v22, "Length");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v21, -75.0, 0.0);
cocos2d::CCPoint::operator+(&v28, &v19, v12);
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
222,
(unsigned int)&v22,
(unsigned int)&v19,
1059481190,
0,
2,
6,
0,
0,
1120403456,
0,
0,
1,
2,
0);
v21 = &v25;
v25 = 0;
v26 = 2;
v27 = 15;
strcpy((char *)&v25, "+-");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v20, 75.0, 0.0);
cocos2d::CCPoint::operator+(&v28, &v19, v13);
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
223,
(unsigned int)&v25,
(unsigned int)&v19,
1059481190,
0,
2,
6,
0,
0,
1120403456,
0,
0,
1,
2,
0);
v21 = &v22;
v22 = 0;
v23 = 6;
v24 = 15;
strcpy((char *)&v22, "Offset");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v20, -75.0, -25.0);
cocos2d::CCPoint::operator+(&v28, &v19, v14);
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
220,
(unsigned int)&v22,
(unsigned int)&v19,
1059481190,
0,
2,
6,
0,
-1027080192,
1120403456,
0,
0,
1,
2,
0);
v21 = &v25;
v25 = 0;
v26 = 2;
v27 = 15;
strcpy((char *)&v25, "+-");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v20, 75.0, -25.0);
cocos2d::CCPoint::operator+(&v28, &v19, v15);
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
221,
(unsigned int)&v25,
(unsigned int)&v19,
1059481190,
0,
2,
6,
0,
-1027080192,
1120403456,
0,
0,
1,
2,
0);
v21 = &v22;
v23 = 12;
v24 = 15;
strcpy((char *)&v22, "From Opacity");
BYTE13(v22) = 0;
HIWORD(v22) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v20, -75.0, -50.0);
cocos2d::CCPoint::operator+(&v28, &v19, v16);
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
286,
(unsigned int)&v22,
(unsigned int)&v19,
1059481190,
0,
1,
6,
0,
0,
1065353216,
0,
0,
1,
2,
0);
v21 = &v22;
*((_QWORD *)&v22 + 1) = 31092;
v23 = 10;
v24 = 15;
*(_QWORD *)&v22 = 0x696361704F206F54LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v20, -75.0, -75.0);
cocos2d::CCPoint::operator+(&v28, &v19, v17);
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
275,
(unsigned int)&v22,
(unsigned int)&v19,
1059481190,
0,
1,
6,
0,
0,
1065353216,
0,
0,
1,
2,
0);
SetupAreaMoveTriggerPopup::addAreaDefaultControls((__int64)a1, 3009);
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)a1 + 1136LL))(a1);
SetupTriggerPopup::createPageButtons(a1);
SetupTriggerPopup::goToPage(a1, 0, 0);
a1[744] = 0;
return 1;
}
return result;
}