//
// SetupRotateGameplayPopup::init from 0x100797a30 to 0x10079831f (2287 bytes)
//
// 1 xrefs:
// > SetupRotateGameplayPopup::create @ 0x1007979eb
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
bool __fastcall SetupRotateGameplayPopup::init(
SetupRotateGameplayPopup *a1,
RotateGameplayGameObject *a2,
cocos2d::CCArray *a3)
{
bool result; // al
bool v4; // r12
__m128 v5; // xmm0
__m128 v6; // xmm0
__m128 v7; // rt1
unsigned __int64 v8; // [rsp+40h] [rbp-1A0h] BYREF
std::string v9; // [rsp+48h] [rbp-198h] BYREF
char v10; // [rsp+60h] [rbp-180h] BYREF
char v11[15]; // [rsp+61h] [rbp-17Fh] BYREF
void *v12; // [rsp+70h] [rbp-170h]
char v13; // [rsp+78h] [rbp-168h] BYREF
char v14[15]; // [rsp+79h] [rbp-167h] BYREF
void *v15; // [rsp+88h] [rbp-158h]
__int128 v16; // [rsp+90h] [rbp-150h] BYREF
void *v17; // [rsp+A0h] [rbp-140h]
_BYTE v18[24]; // [rsp+A8h] [rbp-138h] BYREF
char v19; // [rsp+C0h] [rbp-120h] BYREF
_BYTE v20[23]; // [rsp+C1h] [rbp-11Fh] BYREF
char v21; // [rsp+D8h] [rbp-108h] BYREF
char v22[15]; // [rsp+D9h] [rbp-107h] BYREF
void *v23; // [rsp+E8h] [rbp-F8h]
char v24; // [rsp+F0h] [rbp-F0h] BYREF
_BYTE v25[23]; // [rsp+F1h] [rbp-EFh] BYREF
__int128 v26; // [rsp+108h] [rbp-D8h] BYREF
void *v27; // [rsp+118h] [rbp-C8h]
__int128 v28; // [rsp+120h] [rbp-C0h] BYREF
void *v29; // [rsp+130h] [rbp-B0h]
__int128 v30; // [rsp+138h] [rbp-A8h] BYREF
void *v31; // [rsp+148h] [rbp-98h]
char v32; // [rsp+150h] [rbp-90h] BYREF
_BYTE v33[23]; // [rsp+151h] [rbp-8Fh] BYREF
__int128 v34; // [rsp+168h] [rbp-78h] BYREF
void *v35; // [rsp+178h] [rbp-68h]
__int128 v36; // [rsp+180h] [rbp-60h] BYREF
void *v37; // [rsp+190h] [rbp-50h]
unsigned __int64 v38; // [rsp+198h] [rbp-48h] BYREF
unsigned __int64 v39; // [rsp+1A0h] [rbp-40h] BYREF
float v40; // [rsp+1A8h] [rbp-38h] BYREF
float v41; // [rsp+1ACh] [rbp-34h]
unsigned __int64 v42; // [rsp+1B0h] [rbp-30h] BYREF
unsigned __int64 v43[5]; // [rsp+1B8h] [rbp-28h] BYREF
result = SetupTriggerPopup::init(a1, a2, a3, 380.0, 280.0, 1);
if ( result )
{
v4 = result;
SetupTriggerPopup::preSetup(a1);
v24 = 30;
strcpy(v25, "Rotate Gameplay");
SetupTriggerPopup::addTitle((__int64)a1, (__int64)&v24);
if ( (v24 & 1) != 0 )
operator delete(*(void **)&v25[15]);
v10 = 4;
strcpy(v11, "OK");
SetupTriggerPopup::addCloseButton((__int64)a1, (__int64)&v10);
if ( (v10 & 1) != 0 )
operator delete(v12);
v13 = 8;
strcpy(v14, "Help");
v17 = operator new(0x2B0u);
*(_QWORD *)&v16 = 689;
*((_QWORD *)&v16 + 1) = 685;
strcpy(
(char *)v17,
"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 channe"
"l will only be activated when the player is in that channel. You can use Channel Only to exclude gameplay "
"rotation.\n"
"The Rotate Gameplay trigger direction determines how the channel's triggers are sorted. Upwards means smal"
"ler 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.");
SetupTriggerPopup::addHelpButton((__int64)a1, (__int64)&v13, &v16, (__m128)0x3F666666u);
if ( (v16 & 1) != 0 )
operator delete(v17);
if ( (v13 & 1) != 0 )
operator delete(v15);
cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v40);
sub_10028CBE0((float *)&v39, (float)(v40 * 0.5) + -25.0, (float)(v41 * 0.5) + 85.0);
sub_10028CBE0((float *)&v38, v40 * 0.5, *((float *)&v39 + 1));
LOBYTE(v26) = 26;
strcpy((char *)&v26 + 1, "Edit\nVelocity");
sub_10028CBE0((float *)v43, -60.0, 0.0);
sub_10028CCE0((double *)&v42, &v39, v43);
SetupTriggerPopup::createToggleValueControl((int)a1, 169, &v26, 1.0, (__int64)&v42, 0, 0, 0);
if ( (v26 & 1) != 0 )
operator delete(v27);
strcpy(v18, "\"Override\nVelocity");
sub_10028CBE0((float *)v43, 60.0, 0.0);
sub_10028CCE0((double *)&v42, &v39, v43);
SetupTriggerPopup::createToggleValueControl((int)a1, 584, (__int128 *)v18, 1.0, (__int64)&v42, 0, 0, 169);
if ( (v18[0] & 1) != 0 )
operator delete(*(void **)&v18[16]);
v19 = 16;
strcpy(v20, "VelModX:");
sub_10028CBE0((float *)v43, -80.0, -42.0);
sub_10028CCE0((double *)&v42, &v38, v43);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
582,
(__int64)&v19,
(float *)&v42,
0,
Float,
0.69999999,
-1.0,
1.0,
6,
0,
0,
169,
1,
2,
0);
if ( (v19 & 1) != 0 )
operator delete(*(void **)&v20[15]);
v21 = 4;
strcpy(v22, "Y:");
sub_10028CBE0((float *)v43, 80.0, -42.0);
sub_10028CCE0((double *)&v42, &v38, v43);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
583,
(__int64)&v21,
(float *)&v42,
0,
Float,
0.69999999,
-1.0,
1.0,
6,
0,
0,
169,
1,
2,
0);
if ( (v21 & 1) != 0 )
operator delete(v23);
LOBYTE(v28) = 28;
strcpy((char *)&v28 + 1, "Change\nChannel");
sub_10028CBE0((float *)v43, -60.0, -84.0);
sub_10028CCE0((double *)&v42, &v39, v43);
SetupTriggerPopup::createToggleValueControl((int)a1, 171, &v28, 1.0, (__int64)&v42, 0, 0, 0);
if ( (v28 & 1) != 0 )
operator delete(v29);
LOBYTE(v30) = 24;
strcpy((char *)&v30 + 1, "Channel\nOnly");
sub_10028CBE0((float *)v43, 60.0, -84.0);
sub_10028CCE0((double *)&v42, &v39, v43);
SetupTriggerPopup::createToggleValueControl((int)a1, 172, &v30, 1.0, (__int64)&v42, 0, 0, 171);
if ( (v30 & 1) != 0 )
operator delete(v31);
sub_10028CBE0((float *)v43, 0.0, -146.0);
sub_10028CCE0((double *)&v42, &v38, v43);
v32 = 30;
strcpy(v33, "Target Channel:");
sub_10028CC60(v43, (double *)&v42);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
173,
(__int64)&v32,
(float *)v43,
1,
Uint,
0.80000001,
0.0,
9999.0,
6,
1,
0,
171,
0,
2,
0);
if ( (v32 & 1) != 0 )
operator delete(*(void **)&v33[15]);
sub_10028CBE0((float *)&v8, 75.0, 0.0);
sub_10028CCE0((double *)v43, &v42, &v8);
*(_WORD *)&v9.__r_.__value_.__l.0 = 0;
v5 = (__m128)0x3F4CCCCDu;
SetupTriggerPopup::createPlusButton((__int64)a1, 173, (__int64)v43, &v9, 0, 171, 0.80000001);
if ( (*(_BYTE *)&v9.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v9.__r_.__value_.__l.__data_);
*(double *)v5.i64 = ((double (__fastcall *)(SetupRotateGameplayPopup *, __int64))a1->getValue)(a1, 171);
v6 = _mm_cmpneq_ss(v5, (__m128)0LL);
((void (__fastcall *)(SetupRotateGameplayPopup *, __int64, _QWORD))a1->toggleGroup)(
a1,
171,
_mm_cvtsi128_si32((__m128i)v6) & 1);
*(double *)v6.i64 = ((double (__fastcall *)(SetupRotateGameplayPopup *, __int64))a1->getValue)(a1, 169);
v7.i32[0] = 0;
((void (__fastcall *)(SetupRotateGameplayPopup *, __int64, _QWORD))a1->toggleGroup)(
a1,
169,
_mm_cvtsi128_si32((__m128i)_mm_cmpneq_ss(v6, v7)) & 1);
LOBYTE(v34) = 28;
strcpy((char *)&v34 + 1, "Instant\nOffset");
sub_10028CBE0(
(float *)v43,
(float)((float)(a1->m_width * 0.5) + (float)(v40 * 0.5)) + -72.0,
(float)((float)(v41 * 0.5) - (float)(a1->m_height * 0.5)) + 50.0);
SetupTriggerPopup::createToggleValueControl((int)a1, 368, &v34, 1.0, (__int64)v43, 0, 0, 0);
if ( (v34 & 1) != 0 )
operator delete(v35);
LOBYTE(v36) = 20;
strcpy((char *)&v36 + 1, "Dont\nSlide");
sub_10028CBE0(
(float *)v43,
(float)((float)(a1->m_width * 0.5) + (float)(v40 * 0.5)) + -72.0,
(float)((float)((float)(v41 * 0.5) - (float)(0.5 * a1->m_height)) + 50.0) + 30.0);
SetupTriggerPopup::createToggleValueControl((int)a1, 585, &v36, 1.0, (__int64)v43, 0, 0, 0);
if ( (v36 & 1) != 0 )
operator delete(v37);
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
SetupTriggerPopup::postSetup(a1);
return v4;
}
return result;
}