//
// GameManager::toggleGameVariable from 0x100383e80 to 0x100383f2a (170 bytes)
//
// 47 xrefs:
// > EditorUI::init @ 0x10000b4dd
// > EditorUI::init @ 0x10000b4f1
// > EditorUI::onStickyToggle @ 0x10000c98c
// > EditorUI::keyDown @ 0x10005091a
// > EditorUI::keyDown @ 0x100050bce
// > EditorUI::keyDown @ 0x100050c1c
// > EditorUI::keyDown @ 0x100050c65
// > EditorUI::keyDown @ 0x100050ca2
// > EditorPauseLayer::toggleIgnoreDamage @ 0x100294024
// > EditorPauseLayer::toggleSelectFilter @ 0x100294044
// > EditorPauseLayer::toggleEditorGrid @ 0x100294064
// > EditorPauseLayer::toggleShowObjectInfo @ 0x100294088
// > EditorPauseLayer::toggleEditorGround @ 0x1002940cc
// > EditorPauseLayer::togglePreviewShaders @ 0x100294114
// > EditorPauseLayer::togglePreviewParticles @ 0x100294138
// > EditorPauseLayer::togglePreviewAnim @ 0x100294168
// > EditorPauseLayer::toggleEditorColorMode @ 0x100294198
// > EditorPauseLayer::toggleHideInvisible @ 0x1002941c4
// > EditorPauseLayer::toggleDebugDraw @ 0x1002941e4
// > EditorPauseLayer::toggleFollowPlayer @ 0x1002946f4
// > EditorPauseLayer::togglePlaytestMusic @ 0x100294714
// > EditorPauseLayer::toggleEffectDuration @ 0x100294734
// > EditorPauseLayer::toggleEffectLines @ 0x100294754
// > EditorPauseLayer::toggleEditorBackground @ 0x10029477c
// > EditorPauseLayer::toggleGridOnTop @ 0x1002947cc
// > EditorPauseLayer::toggleRecordOrder @ 0x100294844
// > GJOptionsLayer::onToggle @ 0x10029cf00
// > GameOptionsLayer::didToggle @ 0x1002b1ee8
// > GameOptionsLayer::didToggle @ 0x1002b1f22
// > GameOptionsLayer::didToggle @ 0x1002b1f93
// > GameOptionsLayer::didToggle @ 0x1002b1fbf
// > GameOptionsLayer::didToggle @ 0x1002b1fd3
// > GameOptionsLayer::didToggle @ 0x1002b1ffb
// > GameOptionsLayer::didToggle @ 0x1002b2031
// > UIOptionsLayer::valueDidChange @ 0x1002b48f9
// > GJGarageLayer::onSpecial @ 0x10036ddf4
// > SFXBrowser::onToggleCompactMode @ 0x10043f7a2
// > SearchSFXPopup::onSearchFolders @ 0x1004411a4
// > CreateParticlePopup::onTogglePerfLog @ 0x10047390c
// > UILayer::handleKeypress @ 0x1004c92c6
// > KeybindingsLayer::onToggle @ 0x10060b624
// > OptionsLayer::onMenuMusic @ 0x10079b1e3
// > MoreOptionsLayer::onToggle @ 0x10079df1e
// > MoreVideoOptionsLayer::onToggle @ 0x1007a2242
// > ParentalOptionsLayer::onToggle @ 0x1007a4714
// > InfoLayer::toggleExtendedMode @ 0x1007b1128
// > InfoLayer::toggleSmallCommentMode @ 0x1007b1158
//
// 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 GameManager::toggleGameVariable(GameManager *a1, const char *a2)
{
GameManager *v2; // rdi
void *v3; // r14
bool GameVariable; // al
GameManager *v5; // rdi
bool v6; // r15
void *v7; // r14
bool v8; // r14
v2 = (GameManager *)qword_1009A0E18;
if ( !qword_1009A0E18 )
{
v3 = operator new(0x638u);
sub_10038CE40(v3);
qword_1009A0E18 = (__int64)v3;
(*(void (__fastcall **)(void *))(*(_QWORD *)v3 + 80LL))(v3);
v2 = (GameManager *)qword_1009A0E18;
}
GameVariable = GameManager::getGameVariable(v2, a2);
v5 = (GameManager *)qword_1009A0E18;
if ( !qword_1009A0E18 )
{
v6 = GameVariable;
v7 = operator new(0x638u);
sub_10038CE40(v7);
qword_1009A0E18 = (__int64)v7;
(*(void (__fastcall **)(void *))(*(_QWORD *)v7 + 80LL))(v7);
v5 = (GameManager *)qword_1009A0E18;
GameVariable = v6;
}
v8 = !GameVariable;
GameManager::setGameVariable(v5, a2, !GameVariable);
return v8;
}