//
// sub_10060DCB0 from 0x10060dcb0 to 0x10060e10f (1119 bytes)
//
// 2 xrefs:
// > EditorUI::handleEditorAction @ 0x10060bc96
// > EditorUI::handleEditorAction @ 0x10060bcb9
//
// 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 12:34:33 +0000
//
void __fastcall sub_10060DCB0(__int64 a1, unsigned int a2, int a3)
{
__int64 v6; // rsi
_QWORD *v7; // rax
__int64 v8; // rdi
__int64 v9; // rax
__int64 v10; // rax
const char *v11; // r15
size_t v12; // rax
size_t v13; // r14
char *v14; // r12
char v15; // r14
__int64 v16; // rax
const char *CString; // r15
size_t v18; // rax
size_t v19; // r14
char *v20; // r12
__int64 v21; // r14
__int64 v22; // rax
size_t v23; // r13
char *v24; // rax
void *v25; // rdi
size_t v26; // r13
char *v27; // rax
char v28; // [rsp+0h] [rbp-E0h]
float v29; // [rsp+8h] [rbp-D8h] BYREF
__int128 v30; // [rsp+10h] [rbp-D0h] BYREF
void *__p; // [rsp+20h] [rbp-C0h]
__int128 v32; // [rsp+28h] [rbp-B8h] BYREF
void *v33; // [rsp+38h] [rbp-A8h]
__int128 v34; // [rsp+40h] [rbp-A0h] BYREF
void *v35; // [rsp+50h] [rbp-90h]
__int128 v36; // [rsp+60h] [rbp-80h] BYREF
void *v37; // [rsp+70h] [rbp-70h]
__int64 v38; // [rsp+84h] [rbp-5Ch] BYREF
__int64 v39; // [rsp+8Ch] [rbp-54h] BYREF
float v40; // [rsp+94h] [rbp-4Ch]
float v41; // [rsp+98h] [rbp-48h]
float v42; // [rsp+9Ch] [rbp-44h]
__int128 __dst; // [rsp+A0h] [rbp-40h] BYREF
void *v44; // [rsp+B0h] [rbp-30h]
v41 = (*(float (__fastcall **)(_QWORD))(**(_QWORD **)(*(_QWORD *)(a1 + 1440) + 3920LL) + 168LL))(*(_QWORD *)(*(_QWORD *)(a1 + 1440) + 3920LL));
v6 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v38, v6);
v40 = (float)(0.5 * *(float *)(a1 + 856)) + (float)(*((float *)&v38 + 1) * 0.5);
v42 = *(float *)&v38 * 0.5;
if ( !a3 )
{
LevelEditorLayer::getSavedEditorPosition((__int64)&v39, *(_QWORD *)(a1 + 1440), a2);
if ( *(float *)&v39 != 0.0 || *((float *)&v39 + 1) != 0.0 )
{
v21 = *(_QWORD *)(*(_QWORD *)(a1 + 1440) + 3920LL);
sub_100278250((float *)&__dst, v42 - (float)(*(float *)&v39 * v41), v40 - (float)(*((float *)&v39 + 1) * v41));
(*(void (__fastcall **)(__int64, __int128 *))(*(_QWORD *)v21 + 184LL))(v21, &__dst);
EditorUI::constrainGameLayerPosition_1(a1);
EditorUI::updateSlider(a1);
v22 = EditorSFXManager::sharedState(a1);
EditorSFXManager::playAction_1(v22, 163);
return;
}
v16 = sub_10088E820("Position %i empty.", v28);
CString = (const char *)cocos2d::CCString::getCString(v16);
v18 = strlen(CString);
if ( v18 >= 0xFFFFFFFFFFFFFFF8LL )
LABEL_37:
sub_100003630();
v19 = v18;
if ( v18 >= 0x17 )
{
v26 = 26;
if ( (v18 | 7) != 0x17 )
v26 = (v18 | 7) + 1;
v20 = (char *)operator new(v26);
v44 = v20;
*(_QWORD *)&__dst = v26 + 1;
*((_QWORD *)&__dst + 1) = v19;
}
else
{
LOBYTE(__dst) = 2 * v18;
v20 = (char *)&__dst + 1;
if ( !v18 )
{
BYTE1(__dst) = 0;
v15 = __dst;
if ( (__dst & 1) == 0 )
{
LABEL_13:
v37 = v44;
v36 = __dst;
LABEL_29:
LOWORD(v32) = 0;
v27 = TextAlertPopup::create(&v36, 0x96u, &v32, 0.5, 0.60000002);
(*(void (__fastcall **)(__int64, char *, __int64))(*(_QWORD *)a1 + 464LL))(a1, v27, 100);
if ( (v32 & 1) != 0 )
operator delete(v33);
if ( (v36 & 1) == 0 )
goto LABEL_34;
v25 = v37;
goto LABEL_33;
}
LABEL_28:
sub_10001AD30(&v36, v44, *((unsigned __int64 *)&__dst + 1));
goto LABEL_29;
}
}
memmove(v20, CString, v19);
v20[v19] = 0;
v15 = __dst;
if ( (__dst & 1) == 0 )
goto LABEL_13;
goto LABEL_28;
}
v7 = (_QWORD *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(*(_QWORD *)(a1 + 1440) + 3920LL) + 192LL))(*(_QWORD *)(*(_QWORD *)(a1 + 1440) + 3920LL));
sub_1002782D0(&v39, v7);
sub_100278250(&v29, (float)(v42 - *(float *)&v39) / v41, (float)(v40 - *((float *)&v39 + 1)) / v41);
v8 = *(_QWORD *)(a1 + 1440);
LevelEditorLayer::saveEditorPosition(v8, (__int64)&v29, a2);
v9 = EditorSFXManager::sharedState(v8);
EditorSFXManager::playAction_1(v9, 162);
v10 = sub_10088E820("Position %i saved.", v28);
v11 = (const char *)cocos2d::CCString::getCString(v10);
v12 = strlen(v11);
if ( v12 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_37;
v13 = v12;
if ( v12 >= 0x17 )
{
v23 = 26;
if ( (v12 | 7) != 0x17 )
v23 = (v12 | 7) + 1;
v14 = (char *)operator new(v23);
v44 = v14;
*(_QWORD *)&__dst = v23 + 1;
*((_QWORD *)&__dst + 1) = v13;
LABEL_18:
memmove(v14, v11, v13);
v14[v13] = 0;
v15 = __dst;
if ( (__dst & 1) == 0 )
goto LABEL_6;
LABEL_19:
sub_10001AD30(&v34, v44, *((unsigned __int64 *)&__dst + 1));
goto LABEL_20;
}
LOBYTE(__dst) = 2 * v12;
v14 = (char *)&__dst + 1;
if ( v12 )
goto LABEL_18;
BYTE1(__dst) = 0;
v15 = __dst;
if ( (__dst & 1) != 0 )
goto LABEL_19;
LABEL_6:
v35 = v44;
v34 = __dst;
LABEL_20:
LOWORD(v30) = 0;
v24 = TextAlertPopup::create(&v34, 0x96u, &v30, 0.5, 0.60000002);
(*(void (__fastcall **)(__int64, char *, __int64))(*(_QWORD *)a1 + 464LL))(a1, v24, 100);
if ( (v30 & 1) != 0 )
operator delete(__p);
if ( (v34 & 1) == 0 )
goto LABEL_34;
v25 = v35;
LABEL_33:
operator delete(v25);
LABEL_34:
if ( (v15 & 1) != 0 )
operator delete(v44);
}