//
// NewThreadPopup::onEmotes from 0x1400f05a0 to 0x1400f06e4 (324 bytes)
//
// 2 xrefs:
// > NewThreadPopup::init @ 0x1400f042d
// > ??> @ 0x140915080
//
// 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:26:36 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall NewThreadPopup::onEmotes(__int64 a1, __int64 a2, __int64 a3, double a4)
{
__int64 v6; // rbp
int v7; // r15d
int v8; // r14d
__int64 v9; // r12
__int64 v10; // rcx
const struct cocos2d::CCPoint *v11; // r13
void *v12; // rbx
cocos2d::CCObject *v13; // rbx
int v14; // eax
char v15; // [rsp+70h] [rbp+8h] BYREF
void *v16; // [rsp+80h] [rbp+18h] BYREF
v6 = a1 + 688;
if ( !a1 )
v6 = 0;
v7 = 300;
if ( *(_BYTE *)(a1 + 745) )
{
v7 = 500;
ensureEmotesAreLoaded(500, a2, a3, a4);
v8 = dword_1408FE394;
}
else
{
ensureEmotesAreLoaded(500, a2, a3, a4);
v8 = dword_1408FE3A4;
}
v9 = *(_QWORD *)(a1 + 904);
v10 = *(_QWORD *)(a1 + 760);
if ( v10 )
{
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v10 + 1104LL))(v10, 0);
LABEL_8:
*(_QWORD *)(a1 + 760) = 0;
return;
}
if ( !a2 || !v9 )
goto LABEL_8;
v11 = (const struct cocos2d::CCPoint *)EmotePickerPopup::buttonAnchor(&v15, a2);
v12 = operator new(0x4C8u);
v16 = v12;
memset(v12, 0, 0x4C8u);
v13 = (cocos2d::CCObject *)EmotePickerPopup::EmotePickerPopup(v12);
if ( !v13 )
goto LABEL_15;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v16, v11);
if ( !(unsigned __int8)EmotePickerPopup::init((_DWORD)v13, v9, v14, v8, v7) )
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v13 + 8LL))(v13, 1);
LABEL_15:
v13 = nullptr;
goto LABEL_16;
}
cocos2d::CCObject::autorelease(v13);
LABEL_16:
*(_QWORD *)(a1 + 760) = EmotePickerPopup::openAt(v13, v6, a2);
}