//
// EditorUI::toggleSnap from 0x1401b3590 to 0x1401b3698 (264 bytes)
//
// 4 xrefs:
// > EditorUI::init @ 0x1401ac320
// > EditorUI::handleEditorAction @ 0x1401c2952
// > EditorUI::init @ 0x1401aa652
// > ??> @ 0x14091a030
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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:27:56 +0000
//
// Hidden C++ exception states: #wind=2
void __fastcall EditorUI::toggleSnap(__int64 a1)
{
__int64 v2; // rcx
unsigned __int8 v3; // bl
__int64 v4; // rcx
__int64 v5; // rax
const char *v6; // rdx
_QWORD *v7; // rbx
bool hasSoundsForAction; // al
void *v9; // [rsp+30h] [rbp+8h]
void *v10; // [rsp+30h] [rbp+8h]
v2 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v9 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v9);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v2 = qword_14090BFD0;
}
v3 = GameManager::getGameVariable(v2, "0008") ^ 1;
v4 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v10 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v10);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v4 = qword_14090BFD0;
}
GameManager::setGameVariable(v4, "0008", v3);
v5 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1024) + 952LL))(*(_QWORD *)(a1 + 1024));
v6 = "GJ_button_01.png";
if ( v3 )
v6 = "GJ_button_02.png";
ButtonSprite::updateBGImage(v5, v6);
v7 = (_QWORD *)EditorSFXManager::sharedState();
hasSoundsForAction = EditorSFXManager::hasSoundsForAction(v7, 190);
EditorSFXManager::playAction((__int64)v7, hasSoundsForAction + 189);
}