//
// SetupTeleportPopup::onTeleportGravity from 0x10035a1f0 to 0x10035a2f8 (264 bytes)
//
// 3 xrefs:
// > SetupTeleportPopup::init @ 0x100359691
// > SetupTeleportPopup::init @ 0x1003597db
// > SetupTeleportPopup::init @ 0x100359925
//
// 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
//
void __fastcall SetupTeleportPopup::onTeleportGravity(SetupTeleportPopup *a1, cocos2d::CCObject *a2)
{
int v2; // r15d
int v3; // eax
int v4; // r12d
cocos2d::CCDictionary *m_triggerValues; // r15
float *v6; // r14
cocos2d::CCArray *m_teleportGravityToggles; // rax
cocos2d::ccArray *data; // rax
CCMenuItemToggler **arr; // r14
unsigned __int64 v10; // r15
CCMenuItemToggler *v11; // rbx
int v12; // eax
v2 = (int)((float (__fastcall *)(SetupTeleportPopup *, __int64))a1->getValue)(a1, 354);
v3 = ((__int64 (__fastcall *)(cocos2d::CCObject *))a2->getTag)(a2);
v4 = 0;
if ( v3 != v2 )
v4 = v3;
m_triggerValues = a1->m_triggerValues;
v6 = (float *)operator new(0x40u);
cocos2d::CCObject::CCObject(v6);
*(_QWORD *)v6 = off_1008E2E78;
v6[14] = (float)v4;
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v6);
cocos2d::CCDictionary::setObject(m_triggerValues, (cocos2d::CCObject *)v6, 354);
SetupTriggerPopup::valueChanged(a1, 354, (float)v4);
m_teleportGravityToggles = a1->m_teleportGravityToggles;
if ( m_teleportGravityToggles )
{
data = m_teleportGravityToggles->data;
if ( data->num )
{
arr = (CCMenuItemToggler **)data->arr;
v10 = (unsigned __int64)&arr[data->num - 1];
do
{
v11 = *arr;
if ( !*arr )
break;
v12 = ((__int64 (__fastcall *)(CCMenuItemToggler *))v11->getTag)(*arr);
CCMenuItemToggler::toggle(v11, v12 == v4);
++arr;
}
while ( (unsigned __int64)arr <= v10 );
}
}
}