//
// SetupRotateGameplayPopup::init from 0x1405d65a0 to 0x1405d6f62 (2498 bytes)
//
// 2 xrefs:
// > EditorUI::editObject @ 0x1401bba11
// > ??> @ 0x14092ea78
//
// 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:57 +0000
//
// Hidden C++ exception states: #wind=3
char __fastcall SetupRotateGameplayPopup::init(float *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
__int64 v18; // rax
int v19; // eax
__int64 v20; // rax
int v21; // r9d
__int64 v22; // r8
__int64 v23; // r8
int v24; // eax
__int128 v25; // xmm0
int v26; // eax
__int128 v27; // [rsp+88h] [rbp-80h] BYREF
__int64 v28; // [rsp+98h] [rbp-70h]
__int64 v29; // [rsp+A0h] [rbp-68h]
int v30[2]; // [rsp+A8h] [rbp-60h] BYREF
__int128 *v31; // [rsp+B0h] [rbp-58h] BYREF
__int128 *v32; // [rsp+B8h] [rbp-50h] BYREF
__int128 v33; // [rsp+C0h] [rbp-48h] BYREF
__int64 v34; // [rsp+D0h] [rbp-38h]
__int64 v35; // [rsp+D8h] [rbp-30h]
_BYTE v36[4]; // [rsp+E0h] [rbp-28h] BYREF
float v37; // [rsp+E4h] [rbp-24h]
_BYTE v38[8]; // [rsp+E8h] [rbp-20h] BYREF
_BYTE v39[88]; // [rsp+F0h] [rbp-18h] BYREF
float v40; // [rsp+170h] [rbp+68h] BYREF
float v41; // [rsp+174h] [rbp+6Ch]
result = SetupTriggerPopup::init((_DWORD)a1, a2, a3, a4, 1133248512, 1, 0);
if ( result )
{
*((_BYTE *)a1 + 744) = 1;
(*(void (__fastcall **)(float *))(*(_QWORD *)a1 + 1096LL))(a1);
v28 = 15;
v29 = 15;
strcpy((char *)&v27, "Rotate Gameplay");
SetupTriggerPopup::addTitle(a1, &v27);
v27 = 0;
v28 = 2;
v29 = 15;
strcpy((char *)&v27, "OK");
SetupTriggerPopup::addCloseButton(a1, &v27);
*(_QWORD *)v30 = &v27;
v27 = 0;
v28 = 0;
v29 = 0;
v6 = sub_14003D460(0x2B0u);
*(_QWORD *)&v27 = v6;
v28 = 685;
v29 = 687;
v7 = v6;
v8 = "VelMod modifies the velocity after switching rotation.\n"
"Override Velocity sets the velocity instead of multiplying.\n"
"Change Channel allows you to specify which channel to switch to after rotating. Triggers in a given cha"
"nnel will only be activated when the player is in that channel. You can use Channel Only to exclude gam"
"eplay rotation.\n"
"The Rotate Gameplay trigger direction determines how the channel's triggers are sorted. Upwards means s"
"maller Y values are triggered first, right means smaller X values are triggered first, and so on.\n"
"Instant Offset makes the camera update instantly when switching gameplay to the opposite direction.";
v9 = 5;
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);
v7[4] = *((_QWORD *)v8 + 4);
*((_DWORD *)v7 + 10) = *((_DWORD *)v8 + 10);
*((_BYTE *)v7 + 44) = v8[44];
*((_BYTE *)v6 + 685) = 0;
v33 = 0;
v34 = 4;
v35 = 15;
strcpy((char *)&v33, "Help");
SetupTriggerPopup::addHelpButton(a1, &v33, &v27);
v11 = cocos2d::CCDirector::sharedDirector(v10);
cocos2d::CCDirector::getWinSize(v11, &v40);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v36, (float)(v40 * 0.5) - 25.0, (float)(v41 * 0.5) + 85.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v38, v40 * 0.5, v37);
v32 = &v27;
v28 = 13;
v29 = 15;
strcpy((char *)&v27, "Edit\nVelocity");
HIWORD(v27) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v31, -60.0, 0.0);
cocos2d::CCPoint::operator+(v36, v30, v12);
SetupTriggerPopup::createToggleValueControl(
(_DWORD)a1,
169,
(unsigned int)&v27,
(unsigned int)v30,
0,
0,
0,
1065353216);
v31 = &v27;
v27 = 0;
v28 = 0;
v29 = 0;
*(_QWORD *)&v27 = sub_14003D460(0x20u);
v28 = 17;
v29 = 31;
strcpy((char *)v27, "Override\nVelocity");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v32, 60.0, 0.0);
cocos2d::CCPoint::operator+(v36, v30, v13);
SetupTriggerPopup::createToggleValueControl(
(_DWORD)a1,
584,
(unsigned int)&v27,
(unsigned int)v30,
0,
0,
169,
1065353216);
v31 = &v33;
v34 = 8;
v35 = 15;
v33 = 0x3A58646F4D6C6556uLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v32, -80.0, -42.0);
cocos2d::CCPoint::operator+(v38, v30, v14);
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
582,
(unsigned int)&v33,
(unsigned int)v30,
1060320051,
0,
1,
6,
0,
-1082130432,
1065353216,
0,
169,
1,
2,
0);
v31 = &v33;
v33 = 0;
v34 = 2;
v35 = 15;
strcpy((char *)&v33, "Y:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v32, 80.0, -42.0);
cocos2d::CCPoint::operator+(v38, v30, v15);
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
583,
(unsigned int)&v33,
(unsigned int)v30,
1060320051,
0,
1,
6,
0,
-1082130432,
1065353216,
0,
169,
1,
2,
0);
v31 = &v27;
v28 = 14;
v29 = 15;
strcpy((char *)&v27, "Change\nChannel");
HIBYTE(v27) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v32, -60.0, -84.0);
cocos2d::CCPoint::operator+(v36, v30, v16);
SetupTriggerPopup::createToggleValueControl(
(_DWORD)a1,
171,
(unsigned int)&v27,
(unsigned int)v30,
0,
0,
0,
1065353216);
v31 = &v27;
v28 = 12;
v29 = 15;
strcpy((char *)&v27, "Channel\nOnly");
BYTE13(v27) = 0;
HIWORD(v27) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v32, 60.0, -84.0);
cocos2d::CCPoint::operator+(v36, v30, v17);
SetupTriggerPopup::createToggleValueControl(
(_DWORD)a1,
172,
(unsigned int)&v27,
(unsigned int)v30,
0,
0,
171,
1065353216);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v31, 0.0, -146.0);
cocos2d::CCPoint::operator+(v38, v39, v18);
v31 = &v27;
v28 = 15;
v29 = 15;
strcpy((char *)&v27, "Target Channel:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v32, (const struct cocos2d::CCPoint *)v39);
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
173,
(unsigned int)&v27,
v19,
1061997773,
1,
3,
6,
1,
0,
1176255488,
0,
171,
0,
2,
0);
v31 = &v33;
v33 = 0;
v34 = 0;
v35 = 15;
LOBYTE(v33) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v32, 75.0, 0.0);
cocos2d::CCPoint::operator+(v39, v30, v20);
SetupTriggerPopup::createPlusButton((int)a1, 173, (int)v30, v21, &v33, 0, 171);
if ( (*(float (__fastcall **)(float *, __int64))(*(_QWORD *)a1 + 1168LL))(a1, 171) == 0.0 )
v22 = 0;
else
LOBYTE(v22) = 1;
(*(void (__fastcall **)(float *, __int64, __int64))(*(_QWORD *)a1 + 1088LL))(a1, 171, v22);
if ( (*(float (__fastcall **)(float *, __int64))(*(_QWORD *)a1 + 1168LL))(a1, 169) == 0.0 )
v23 = 0;
else
LOBYTE(v23) = 1;
(*(void (__fastcall **)(float *, __int64, __int64))(*(_QWORD *)a1 + 1088LL))(a1, 169, v23);
v31 = &v27;
v28 = 14;
v29 = 15;
strcpy((char *)&v27, "Instant\nOffset");
HIBYTE(v27) = 0;
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v32,
(float)((float)(a1[183] * 0.5) + (float)(v40 * 0.5)) - 72.0,
(float)((float)(v41 * 0.5) - (float)(a1[184] * 0.5)) + 50.0);
SetupTriggerPopup::createToggleValueControl((_DWORD)a1, 368, (unsigned int)&v27, v24, 0, 0, 0, 1065353216);
v31 = &v27;
v25 = 0;
v28 = 10;
v29 = 15;
*(_QWORD *)&v25 = 0x696C530A746E6F44LL;
v27 = v25;
WORD4(v27) = 25956;
BYTE10(v27) = 0;
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v32,
(float)((float)(a1[183] * 0.5) + (float)(v40 * 0.5)) - 72.0,
(float)((float)((float)(v41 * 0.5) - (float)(a1[184] * 0.5)) + 50.0) + 30.0);
SetupTriggerPopup::createToggleValueControl((_DWORD)a1, 585, (unsigned int)&v27, v26, 0, 0, 0, 1065353216);
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
(*(void (__fastcall **)(float *))(*(_QWORD *)a1 + 1136LL))(a1);
*((_BYTE *)a1 + 744) = 0;
return 1;
}
return result;
}