//
// EditLevelLayer::onEmotes from 0x14017b6c0 to 0x14017b7e1 (289 bytes)
//
// 2 xrefs:
// > EditLevelLayer::init @ 0x140178fbe
// > ??> @ 0x140918764
//
// 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:35 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall EditLevelLayer::onEmotes(__int64 *a1, __int64 a2, __int64 a3, double a4)
{
__int64 v5; // rbp
__int64 v6; // rdx
__int64 v7; // rcx
__int64 v8; // r8
int v9; // r12d
__int64 v10; // rsi
__int64 v11; // rcx
const struct cocos2d::CCPoint *v12; // r15
void *v13; // rbx
cocos2d::CCObject *v14; // rbx
float *v15; // rax
char v16; // [rsp+60h] [rbp+8h] BYREF
void *v17; // [rsp+70h] [rbp+18h] BYREF
v5 = (*(__int64 (__fastcall **)(__int64 *, __int64))(*a1 + 472))(a1, 2);
ensureEmotesAreLoaded(v7, v6, v8, a4);
v9 = dword_1408FE3A4;
v10 = a1[69];
v11 = a1[70];
if ( v11 )
{
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v11 + 1104LL))(v11, 0);
LABEL_3:
a1[70] = 0;
return;
}
if ( !v10 || !v5 )
goto LABEL_3;
v12 = (const struct cocos2d::CCPoint *)EmotePickerPopup::buttonAnchor((__int64)&v16, a1[69]);
v13 = operator new(0x4C8u);
v17 = v13;
memset(v13, 0, 0x4C8u);
v14 = (cocos2d::CCObject *)EmotePickerPopup::EmotePickerPopup((__int64)v13);
if ( !v14 )
goto LABEL_10;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v17, v12);
if ( !EmotePickerPopup::init((__int64)v14, v5, v15, v9, 180) )
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v14 + 8LL))(v14, 1);
LABEL_10:
v14 = nullptr;
goto LABEL_11;
}
cocos2d::CCObject::autorelease(v14);
LABEL_11:
a1[70] = (__int64)EmotePickerPopup::openAt(v14, (__int64)(a1 + 57), v10);
}