//
// PlatformerControlsPopup::refreshModeUI from 0x79ca50 to 0x79cc26 (470 bytes)
//
// 3 xrefs:
// > PlatformerControlsPopup::syncSourceUI @ 0x79cc5a
// > PlatformerControlsPopup::onToggleSource @ 0x79cc7e
// > PlatformerControlsPopup::init @ 0x79d7fe
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:59:50 +0000
//
int __fastcall PlatformerControlsPopup::refreshModeUI(cocos2d::CCPoint **this)
{
cocos2d::CCDirector *IsCustom; // r0
cocos2d::CCDirector *v3; // r7
cocos2d::CCDirector *v4; // r5
float v5; // s16
float v6; // s17
int v7; // r6
int v8; // r9
int v9; // r0
int v10; // r0
int v11; // r0
int v12; // r3
_BOOL4 v13; // r5
_BOOL4 v14; // r1
int v15; // r6
char v16; // r3
int v17; // r0
int v18; // r0
cocos2d::CCPoint **v19; // r5
cocos2d::CCPoint *v20; // r0
cocos2d::CCPoint *v21; // t1
void (__fastcall *v23)(int, __int16 *); // [sp+4h] [bp-38h]
cocos2d::CCPoint *v24; // [sp+Ch] [bp-30h]
float v25[2]; // [sp+10h] [bp-2Ch] BYREF
char v26[8]; // [sp+18h] [bp-24h] BYREF
__int16 v27; // [sp+20h] [bp-1Ch] BYREF
char v28; // [sp+22h] [bp-1Ah]
_DWORD v29[3]; // [sp+28h] [bp-14h] BYREF
IsCustom = (cocos2d::CCDirector *)PlatformerControlsPopup::sourceIsCustom((PlatformerControlsPopup *)this);
if ( *((_BYTE *)this + 804) )
v3 = IsCustom;
else
v3 = nullptr;
v4 = IsCustom;
cocos2d::CCDirector::sharedDirector(IsCustom);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v25);
v5 = (float)(*((float *)this + 140) * 0.5) + (float)(v25[1] * 0.5);
if ( v3 )
v6 = (float)(v25[0] * 0.5) - 45.0;
else
v6 = v25[0] * 0.5;
v7 = 0;
v29[0] = *(this + 191);
v29[1] = *(this + 192);
v29[2] = *(this + 193);
do
{
v8 = v29[v7];
if ( v8 )
{
v23 = *(void (__fastcall **)(int, __int16 *))(*(_DWORD *)v8 + 92);
v24 = *(this + 111);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v26, v6, v5 - *(float *)((char *)&unk_BF1214 + v7 * 4));
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v27, v24);
v23(v8, &v27);
}
++v7;
}
while ( v7 != 3 );
v9 = (int)*(this + 193);
if ( v9 )
{
(*(void (__fastcall **)(int, cocos2d::CCDirector *))(*(_DWORD *)v9 + 172))(v9, v4);
(*(void (__fastcall **)(_DWORD, cocos2d::CCDirector *))(*(_DWORD *)*(this + 193) + 528))(*(this + 193), v4);
}
v10 = (int)*(this + 191);
if ( v10 )
{
(*(void (__fastcall **)(int, cocos2d::CCDirector *))(*(_DWORD *)v10 + 172))(v10, v4);
(*(void (__fastcall **)(_DWORD, cocos2d::CCDirector *))(*(_DWORD *)*(this + 191) + 528))(*(this + 191), v4);
}
v11 = (int)*(this + 202);
if ( v11 )
{
v12 = (int)*(this + 182);
if ( v12 )
v13 = *(_DWORD *)(v12 + 268) - *(_DWORD *)(v12 + 272) > 0;
else
v13 = 0;
(*(void (__fastcall **)(int, cocos2d::CCDirector *))(*(_DWORD *)v11 + 172))(v11, v3);
if ( v3 )
v14 = v13;
else
v14 = 0;
(*(void (__fastcall **)(_DWORD, _BOOL4))(*(_DWORD *)*(this + 202) + 528))(*(this + 202), v14);
v15 = (int)*(this + 203);
if ( v13 )
{
v16 = -1;
v27 = -1;
}
else
{
v16 = -106;
v27 = -26986;
}
v28 = v16;
v17 = *(_DWORD *)(v15 + 536);
if ( v17 )
(*(void (__fastcall **)(int, __int16 *))(*(_DWORD *)v17 + 536))(v17, &v27);
v18 = *(_DWORD *)(v15 + 548);
if ( v18 )
(*(void (__fastcall **)(int, __int16 *))(*(_DWORD *)v18 + 480))(v18, &v27);
}
v19 = this + 203;
do
{
v21 = v19[1];
++v19;
v20 = v21;
if ( v21 )
(*(void (__fastcall **)(cocos2d::CCPoint *, cocos2d::CCDirector *))(*(_DWORD *)v20 + 172))(v20, v3);
}
while ( v19 != this + 206 );
return PlatformerControlsPopup::refreshClassUI((PlatformerControlsPopup *)this);
}