//
// LevelSettingsLayer::createToggleButton from 0x6a9274 to 0x6a93f4 (384 bytes)
//
// 1 xrefs:
// > LevelSettingsLayer::init @ 0x6ac410
//
// 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:56:33 +0000
//
int __fastcall LevelSettingsLayer::createToggleButton(
int a1,
unsigned __int8 *a2,
int a3,
int a4,
bool a5,
const cocos2d::CCPoint *a6,
int a7)
{
int v9; // r7
const char *v10; // r1
int v11; // r6
cocos2d::CCNodeRGBA *v12; // r10
int result; // r0
unsigned int v14; // r3
cocos2d::CCLabelBMFont *v15; // r0
int v16; // r4
void (__fastcall *v17)(int, _BYTE *); // r9
void (__fastcall *v18)(int, _BYTE *); // r9
float *v19; // r0
void (__fastcall *v20)(int, _DWORD); // r6
float *v21; // r0
void (__fastcall *v22)(cocos2d::CCNodeRGBA *, _BYTE *); // [sp+Ch] [bp-28h]
char v23[4]; // [sp+10h] [bp-24h] BYREF
int v24; // [sp+14h] [bp-20h]
_BYTE v25[8]; // [sp+1Ch] [bp-18h] BYREF
_BYTE v26[8]; // [sp+24h] [bp-10h] BYREF
*(_DWORD *)v23 = a3;
v24 = a4;
v9 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_checkOn_001.png", v23);
v11 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_checkOff_001.png", v10);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v9 + 80))(v9, 1061997773);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v11 + 80))(v11, 1061997773);
v12 = CCMenuItemToggler::create(v9, v11, a1, *(int *)v23, v24);
CCMenuItemToggler::toggle(v12, a5);
(*(void (__fastcall **)(const cocos2d::CCPoint *, cocos2d::CCNodeRGBA *))(*(_DWORD *)a6 + 228))(a6, v12);
v22 = *(void (__fastcall **)(cocos2d::CCNodeRGBA *, _BYTE *))(*(_DWORD *)v12 + 92);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v26, a6);
v22(v12, v26);
result = CCMenuItemToggler::setSizeMult(v12, 1.5);
v14 = *a2;
if ( (v14 & 1) != 0 )
{
if ( !*((_DWORD *)a2 + 1) )
return result;
v15 = *((cocos2d::CCLabelBMFont **)a2 + 2);
}
else
{
if ( !(v14 >> 1) )
return result;
v15 = (cocos2d::CCLabelBMFont *)(a2 + 1);
}
v16 = cocos2d::CCLabelBMFont::create(v15, "bigFont.fnt", (const char *)(v14 << 31));
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 460) + 228))(*(_DWORD *)(a1 + 460), v16);
v17 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v16 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v26, 0.0, 0.5);
v17(v16, v26);
v18 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v16 + 92);
v19 = (float *)(*(int (__fastcall **)(int))(*(_DWORD *)v9 + 164))(v9);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, (float)((float)(*v19 * 0.5) * 0.8) + 6.0, 0.0);
cocos2d::CCPoint::operator+(v26, a7, v25);
v18(v16, v26);
if ( *(float *)(*(int (__fastcall **)(int))(*(_DWORD *)v16 + 164))(v16) > 110.0 )
{
v20 = *(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v16 + 80);
v21 = (float *)(*(int (__fastcall **)(int))(*(_DWORD *)v16 + 164))(v16);
v20(v16, 110.0 / *v21);
}
return (*(int (__fastcall **)(int, int))(*(_DWORD *)v16 + 80))(v16, 1051931443);
}