//
// SetupTimerTriggerPopup::init from 0x1405f7e40 to 0x1405f8723 (2275 bytes)
//
// 3 xrefs:
// > SetupTimerTriggerPopup::create @ 0x1405f7dfe
// > ??> @ 0x14092f570
// > ??> @ 0x14092f57c
//
// 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:08 +0000
//
// Hidden C++ exception states: #wind=5
char __fastcall SetupTimerTriggerPopup::init(_BYTE *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; // rax
__int64 v14; // rax
__int64 v15; // rdi
__int64 v16; // rax
void *v17; // rcx
__int64 v18; // rax
__int64 v19; // rax
void *v20; // rcx
__int64 v21; // rax
__int64 v22; // rax
__int64 v23; // rax
__int64 v24; // [rsp+80h] [rbp-88h]
__int64 v25; // [rsp+80h] [rbp-88h]
void **v26; // [rsp+88h] [rbp-80h] BYREF
_BYTE v27[8]; // [rsp+90h] [rbp-78h] BYREF
void **v28; // [rsp+98h] [rbp-70h] BYREF
void **v29; // [rsp+A0h] [rbp-68h] BYREF
float v30[2]; // [rsp+A8h] [rbp-60h] BYREF
void *Block[2]; // [rsp+B0h] [rbp-58h] BYREF
__m128i si128; // [rsp+C0h] [rbp-48h]
void *v33[2]; // [rsp+D0h] [rbp-38h] BYREF
__m128i v34; // [rsp+E0h] [rbp-28h]
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] = 12;
si128.m128i_i64[1] = 15;
strcpy((char *)Block, "Time Trigger");
BYTE5(Block[1]) = 0;
HIWORD(Block[1]) = 0;
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);
v26 = Block;
*(_OWORD *)Block = 0;
si128 = 0u;
v6 = sub_14003D460(0x120u);
Block[0] = v6;
si128.m128i_i64[0] = 281;
si128.m128i_i64[1] = 287;
v7 = v6;
v8 = "These function as an in-game timer using ItemID.\n"
"TargetID is spawned when StopTime is hit.\n"
"TimeMod modifies the timer with multiplication (Can be negative).\n"
"StartPaused pauses at starting time until activated by another Time trigger.";
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);
v7[24] = v8[24];
v6[281] = 0;
*(_OWORD *)v33 = 0;
v34.m128i_i64[0] = 4;
v34.m128i_i64[1] = 15;
strcpy((char *)v33, "Help");
SetupTriggerPopup::addHelpButton(a1, v33, Block);
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
v11 = cocos2d::CCDirector::sharedDirector(v10);
cocos2d::CCDirector::getWinSize(v11, v30);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v27, v30[0] * 0.5, (float)(v30[1] * 0.5) + 85.0);
v29 = Block;
Block[1] = (void *)101;
si128.m128i_i64[0] = 9;
si128.m128i_i64[1] = 15;
Block[0] = (void *)0x6D69547472617453LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v28, -85.0, 0.0);
cocos2d::CCPoint::operator+(v27, &v26, v12);
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
467,
(unsigned int)Block,
(unsigned int)&v26,
1061997773,
0,
1,
10,
0,
0,
1120403456,
0,
0,
0,
2,
0,
v26);
v28 = v33;
v33[1] = nullptr;
v34.m128i_i64[0] = 8;
v34.m128i_i64[1] = 15;
v33[0] = (void *)0x656D6954706F7453LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v29, 85.0, 0.0);
cocos2d::CCPoint::operator+(v27, &v26, v13);
LOBYTE(v24) = 0;
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
473,
(unsigned int)v33,
(unsigned int)&v26,
1061997773,
0,
1,
10,
0,
0,
1120403456,
0,
0,
0,
2,
v24);
v28 = v33;
*(_OWORD *)v33 = 0;
v34.m128i_i64[0] = 0;
v34.m128i_i64[1] = 15;
LOBYTE(v33[0]) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v29, 175.0, 0.0);
cocos2d::CCPoint::operator+(v27, &v26, v14);
SetupTriggerPopup::createToggleValueControl(
(_DWORD)a1,
474,
(unsigned int)v33,
(unsigned int)&v26,
0,
0,
0,
1065353216);
Block[1] = nullptr;
si128 = _mm_load_si128((const __m128i *)&xmmword_140836580);
Block[0] = (void *)0x444972656D6954LL;
v15 = (__int64)(a1 + 544);
if ( !a1 )
v15 = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v28, -85.0, -75.0);
cocos2d::CCPoint::operator+(v27, &v26, v16);
IDNameInput::create(
(__int64)a1,
v15,
4,
80,
(__int64)Block,
(const struct cocos2d::CCPoint *)&v26,
1061997773,
6,
0,
0,
0);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v17 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v17 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v17 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v17);
}
v28 = Block;
Block[1] = nullptr;
si128.m128i_i64[0] = 7;
si128.m128i_i64[1] = 15;
Block[0] = (void *)0x646F4D656D6954LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v29, 85.0, -60.0);
cocos2d::CCPoint::operator+(v27, &v26, v18);
LOBYTE(v25) = 0;
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
470,
(unsigned int)Block,
(unsigned int)&v26,
1061997773,
0,
1,
10,
0,
1008981770,
0x40000000,
0,
0,
0,
2,
v25);
v33[1] = nullptr;
v34 = _mm_load_si128((const __m128i *)&xmmword_140836590);
v33[0] = (void *)0x4449746567726154LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v28, -85.0, -135.0);
cocos2d::CCPoint::operator+(v27, &v26, v19);
IDNameInput::create(
(__int64)a1,
v15,
1,
51,
(__int64)v33,
(const struct cocos2d::CCPoint *)&v26,
1061997773,
6,
0,
0,
0);
if ( v34.m128i_i64[1] > 0xFuLL )
{
v20 = v33[0];
if ( (unsigned __int64)(v34.m128i_i64[1] + 1) >= 0x1000 )
{
v20 = *((void **)v33[0] - 1);
if ( (unsigned __int64)((char *)v33[0] - (char *)v20 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v20);
}
v28 = Block;
si128.m128i_i64[0] = 15;
si128.m128i_i64[1] = 15;
strcpy((char *)Block, "Ignore\nTimeWarp");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v29, 10.0, -128.0);
cocos2d::CCPoint::operator+(v27, &v26, v21);
SetupTriggerPopup::createToggleValueControl(
(_DWORD)a1,
469,
(unsigned int)Block,
(unsigned int)&v26,
0,
0,
0,
1065353216);
v28 = Block;
si128.m128i_i64[0] = 12;
si128.m128i_i64[1] = 15;
strcpy((char *)Block, "Start\nPaused");
BYTE5(Block[1]) = 0;
HIWORD(Block[1]) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v29, 120.0, -128.0);
cocos2d::CCPoint::operator+(v27, &v26, v22);
SetupTriggerPopup::createToggleValueControl(
(_DWORD)a1,
471,
(unsigned int)Block,
(unsigned int)&v26,
0,
0,
0,
1065353216);
v28 = Block;
si128.m128i_i64[0] = 13;
si128.m128i_i64[1] = 15;
strcpy((char *)Block, "Dont\nOverride");
HIWORD(Block[1]) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v29, 120.0, -163.0);
cocos2d::CCPoint::operator+(v27, &v26, v23);
SetupTriggerPopup::createToggleValueControl(
(_DWORD)a1,
468,
(unsigned int)Block,
(unsigned int)&v26,
0,
0,
0,
1065353216);
(*(void (__fastcall **)(_BYTE *))(*(_QWORD *)a1 + 1136LL))(a1);
a1[744] = 0;
return 1;
}
return result;
}