//
// EditorUI::onLockLayer from 0x1401bec50 to 0x1401bed52 (258 bytes)
//
// 3 xrefs:
// > EditorUI::handleEditorAction @ 0x1401c3832
// > EditorUI::init @ 0x1401abfad
// > ??> @ 0x14091a504
//
// 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:28:02 +0000
//
__int64 __fastcall EditorUI::onLockLayer(__int64 a1)
{
__int64 v2; // rcx
__int64 result; // rax
__int64 v4; // rdx
__int64 v5; // r8
unsigned __int64 v6; // rax
int *v7; // r10
char v8; // r9
int v9; // edx
int v10; // edx
int v11; // ecx
int v12; // eax
void *v13; // [rsp+40h] [rbp+18h]
v2 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v13 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v13);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v2 = qword_14090BFD0;
}
result = GameManager::getGameVariable(v2, "0103");
if ( (_BYTE)result )
{
v5 = *(_QWORD *)(a1 + 1512);
v6 = *(__int16 *)(v5 + 14866);
if ( (__int16)v6 <= 9999 && (__int16)v6 > 0 && *(_BYTE *)(v5 + 14666) )
{
v7 = (int *)(*(_QWORD *)(v5 + 15208) + 4 * (v6 >> 5));
v8 = v6 & 0x1F;
v9 = *v7;
if ( ((1 << (v6 & 0x1F)) & *v7) != 0 )
v10 = v9 & ~(1 << v8);
else
v10 = v9 | (1 << v8);
*v7 = v10;
v4 = *(_WORD *)(v5 + 14866) & 0x1F;
v11 = *(_DWORD *)(*(_QWORD *)(v5 + 15208) + 4 * ((unsigned __int64)*(__int16 *)(v5 + 14866) >> 5));
v12 = -1;
if ( _bittest(&v11, v4) )
v12 = 1;
*(_DWORD *)(v5 + 15240) += v12;
}
return EditorUI::updateGroupIDLabel(a1, v4, v5);
}
return result;
}