//
// EmotePickerPopup::onPickEmote from 0xcba48c to 0xcba678 (492 bytes)
//
// 3 xrefs:
// > ??> @ 0x65ba8
// > EmotePickerPopup::addCell @ 0xcb9148
// > ??> @ 0x1542758
//
// This function is hookable on this platform (idp: arm, 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 13:06:14 +0000
//
__int64 __fastcall EmotePickerPopup::onPickEmote(EmotePickerPopup *this, cocos2d::CCObject *a2)
{
unsigned __int64 v4; // x0
GameManager *v5; // x0
char **v6; // x21
GameManager *v7; // x0
size_t v8; // x0
__int64 v9; // x23
__int64 v10; // x0
char *v12; // [xsp+48h] [xbp+48h]
__int64 v13; // [xsp+58h] [xbp+58h] BYREF
size_t v14; // [xsp+60h] [xbp+60h]
void *v15; // [xsp+68h] [xbp+68h]
__int64 v16; // [xsp+70h] [xbp+70h] BYREF
size_t v17; // [xsp+78h] [xbp+78h]
void *v18; // [xsp+80h] [xbp+80h]
if ( EmotePickerPopup::canAddEmote(this) )
{
v4 = (*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)a2 + 64LL))(a2);
if ( (int)v4 > 99999 )
v4 = (unsigned int)(v4 - 100000);
v5 = (GameManager *)EmoteSprite::defAtIndex((EmoteSprite *)v4);
v6 = (char **)v5;
if ( v5 )
{
v7 = (GameManager *)GameManager::sharedState(v5);
GameManager::addRecentEmote(v7, *v6);
if ( *((_QWORD *)this + 146) )
{
v13 = 0;
v14 = 0;
v15 = nullptr;
std::string::__init(&v13, ":", 1u);
v12 = *v6;
v8 = strlen(*v6);
std::string::append((__int64)&v13, v12, v8);
std::string::append((__int64)&v13, ":", 1u);
v16 = 0;
v17 = 0;
v18 = nullptr;
v9 = *((_QWORD *)this + 146);
if ( (v13 & 1) != 0 )
{
std::string::__init(&v16, v15, v14);
}
else
{
v18 = v15;
v16 = v13;
v17 = v14;
}
CCTextInputNode::insertAtCursor(v9, (__int64)&v16);
if ( (v16 & 1) != 0 )
operator delete(v18);
EmotePickerPopup::refreshEnabled((__int64)this);
if ( (v13 & 1) != 0 )
operator delete(v15);
}
else
{
v10 = *((_QWORD *)this + 148);
if ( v10 )
(*(void (__fastcall **)(__int64, EmotePickerPopup *, char **))(*(_QWORD *)v10 + 8LL))(v10, this, v6);
(*(void (__fastcall **)(EmotePickerPopup *, _QWORD))(*(_QWORD *)this + 1368LL))(this, 0);
}
}
}
return _stack_chk_guard;
}