//
// MoreVideoOptionsLayer::onToggle from 0x1000f2098 to 0x1000f2454 (956 bytes)
//
// 1 xrefs:
// > MoreVideoOptionsLayer::addToggle @ 0x1000f1940
//
// 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 MoreVideoOptionsLayer::onToggle(MoreVideoOptionsLayer *a1, cocos2d::CCObject *a2)
{
int v3; // w0
cocos2d::CCObject *v4; // x0
cocos2d::CCString *v5; // x20
GameManager *v6; // x21
const char *CString; // x0
char *v8; // x0
_BOOL4 v9; // w21
GameManager *v10; // x0
bool GameVariable; // w0
char *v12; // x0
_BOOL4 v13; // w21
GameManager *v14; // x0
bool v15; // w0
char *v16; // x0
_BOOL4 v17; // w21
GameManager *v18; // x0
bool v19; // w0
char *v20; // x0
_BOOL4 v21; // w21
GameManager *v22; // x0
bool v23; // w0
char *v24; // x0
_BOOL4 v25; // w21
cocos2d::CCDirector *v26; // x19
GameManager *v27; // x0
_BOOL8 v28; // x20
int v29; // w21
AppDelegate *v30; // x0
__n128 v31; // q0
__n128 v32; // q1
char *v33; // x0
_BOOL4 v34; // w20
GameManager *v35; // x0
GameManager *v36; // x0
cocos2d::CCDirector *v37; // x0
void *v38[2]; // [xsp+8h] [xbp-68h] BYREF
char v39; // [xsp+1Fh] [xbp-51h]
void *__p[2]; // [xsp+20h] [xbp-50h] BYREF
char v41; // [xsp+37h] [xbp-39h]
void *v42[2]; // [xsp+38h] [xbp-38h] BYREF
char v43; // [xsp+4Fh] [xbp-21h]
v3 = ((__int64 (__fastcall *)(cocos2d::CCObject *))a2->getTag)(a2);
v4 = cocos2d::CCDictionary::objectForKey(a1->m_variables, v3);
if ( v4 )
{
v5 = (cocos2d::CCString *)v4;
v6 = GameManager::sharedState();
CString = cocos2d::CCString::getCString(v5);
GameManager::toggleGameVariable(v6, CString);
v8 = (char *)cocos2d::CCString::getCString(v5);
sub_100009900(v42, v8);
sub_100009900(__p, "0028");
v9 = sub_1000045BC(v42, __p);
if ( v41 < 0 )
operator delete(__p[0]);
if ( v43 < 0 )
{
operator delete(v42[0]);
if ( v9 )
goto LABEL_6;
}
else if ( v9 )
{
LABEL_6:
v10 = GameManager::sharedState();
GameVariable = GameManager::getGameVariable(v10, "0028");
PlatformToolbox::toggleMouseControl(!GameVariable);
return;
}
v12 = (char *)cocos2d::CCString::getCString(v5);
sub_100009900(v42, v12);
sub_100009900(__p, "0030");
v13 = sub_1000045BC(v42, __p);
if ( v41 < 0 )
operator delete(__p[0]);
if ( v43 < 0 )
{
operator delete(v42[0]);
if ( v13 )
goto LABEL_12;
}
else if ( v13 )
{
LABEL_12:
v14 = GameManager::sharedState();
v15 = GameManager::getGameVariable(v14, "0030");
PlatformToolbox::toggleVerticalSync(v15);
return;
}
v16 = (char *)cocos2d::CCString::getCString(v5);
sub_100009900(v42, v16);
sub_100009900(__p, "0032");
v17 = sub_1000045BC(v42, __p);
if ( v41 < 0 )
operator delete(__p[0]);
if ( v43 < 0 )
{
operator delete(v42[0]);
if ( v17 )
goto LABEL_18;
}
else if ( v17 )
{
LABEL_18:
v18 = GameManager::sharedState();
v19 = GameManager::getGameVariable(v18, "0032");
PlatformToolbox::toggleForceTimer(v19);
return;
}
v20 = (char *)cocos2d::CCString::getCString(v5);
sub_100009900(v42, v20);
sub_100009900(__p, "0023");
v21 = sub_1000045BC(v42, __p);
if ( v41 < 0 )
operator delete(__p[0]);
if ( v43 < 0 )
operator delete(v42[0]);
if ( v21 )
{
v22 = GameManager::sharedState();
v23 = GameManager::getGameVariable(v22, "0023");
PlatformToolbox::toggleSmoothFix(v23);
}
else
{
v24 = (char *)cocos2d::CCString::getCString(v5);
sub_100009900(v42, v24);
sub_100009900(__p, "0115");
v25 = sub_1000045BC(v42, __p);
if ( v41 < 0 )
operator delete(__p[0]);
if ( v43 < 0 )
operator delete(v42[0]);
if ( v25 )
{
v26 = cocos2d::CCDirector::sharedDirector();
v27 = GameManager::sharedState();
v28 = GameManager::getGameVariable(v27, "0115");
sub_100009900(v38, "chatFont.fnt");
v29 = (unsigned __int8)AppDelegate::get()->m_startupScriptFilename.m_data.m_short.shortStorage.__elems_[4];
v30 = AppDelegate::get();
v31.n128_u32[0] = 1112014848;
v32.n128_u32[0] = 0;
if ( !v29 )
v31.n128_f32[0] = 0.0;
if ( v30->m_startupScriptFilename.m_data.m_short.shortStorage.__elems_[4] )
v32.n128_f32[0] = -10.0;
sub_100022980(v31, v32, v42);
cocos2d::CCDirector::toggleShowFPS(v26, v28, v38, v42);
if ( v39 < 0 )
operator delete(v38[0]);
}
else
{
v33 = (char *)cocos2d::CCString::getCString(v5);
sub_100009900(v42, v33);
sub_100009900(__p, "0116");
v34 = sub_1000045BC(v42, __p);
if ( v41 < 0 )
operator delete(__p[0]);
if ( v43 < 0 )
operator delete(v42[0]);
if ( v34 )
{
v35 = GameManager::sharedState();
if ( GameManager::getGameVariable(v35, "0116") )
{
v36 = GameManager::sharedState();
GameManager::updateCustomFPS(v36);
}
else
{
v37 = cocos2d::CCDirector::sharedDirector();
((void (__fastcall *)(cocos2d::CCDirector *, double))v37->setAnimationInterval)(v37, 0.0166666675);
}
MoreVideoOptionsLayer::updateFPSButtons(a1);
}
}
}
}
}