//
// GJMessagePopup::FLAlert_Clicked from 0x140298e80 to 0x1402990a8 (552 bytes)
//
// 2 xrefs:
// > ??> @ 0x140576838
// > ??> @ 0x1406d1cd0
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=3
void GJMessagePopup::FLAlert_Clicked(GJMessagePopup *a1, FLAlertLayer *a2, bool a3)
{
int v4; // eax
GameLevelManager *v5; // rcx
CCMenuItemSpriteExtra **p_m_closeButton; // rsi
__int64 v7; // rax
__int64 v8; // rax
UploadActionPopup **p_m_uploadPopup; // rcx
GameLevelManager *v10; // rcx
FLAlertLayer *v11; // rax
__int128 v12; // [rsp+20h] [rbp-28h] BYREF
__int64 v13; // [rsp+30h] [rbp-18h]
__int64 v14; // [rsp+38h] [rbp-10h]
void *v15; // [rsp+68h] [rbp+20h]
void *v16; // [rsp+68h] [rbp+20h]
void *v17; // [rsp+68h] [rbp+20h]
if ( a3 )
{
v4 = ((__int64 (__fastcall *)(FLAlertLayer *))a2->getTag)(a2) - 1;
if ( v4 )
{
if ( v4 == 1 )
{
v5 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v15 = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v15);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v5 = (GameLevelManager *)qword_1406C2EC0;
}
if ( GameLevelManager::deleteUserMessages(
v5,
*(GJUserMessage **)&a1->m_uIndexInArray,
nullptr,
*(_BYTE *)(*(_QWORD *)&a1->m_uIndexInArray + 465LL)) )
{
p_m_closeButton = &a1[-1].m_closeButton;
if ( a1 == (GJMessagePopup *)648 )
p_m_closeButton = nullptr;
v7 = qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v16 = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v16);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v7 = qword_1406C2EC0;
}
*(_QWORD *)(v7 + 808) = p_m_closeButton;
v8 = *(_QWORD *)&a1->m_fRotationX;
if ( v8 )
*(_QWORD *)(v8 + 632) = 0;
v12 = 0;
*(_QWORD *)&v12 = sub_14003AA10(0x20u);
v13 = 19;
v14 = 31;
strcpy((char *)v12, "Deleting message...");
p_m_uploadPopup = &a1[-1].m_uploadPopup;
if ( a1 == (GJMessagePopup *)648 )
p_m_uploadPopup = nullptr;
goto LABEL_20;
}
}
}
else
{
v10 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v17 = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v17);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v10 = (GameLevelManager *)qword_1406C2EC0;
}
if ( GameLevelManager::blockUser(v10, *(_DWORD *)(*(_QWORD *)&a1->m_uIndexInArray + 324LL)) )
{
v12 = 0;
*(_QWORD *)&v12 = sub_14003AA10(0x20u);
v13 = 16;
v14 = 31;
strcpy((char *)v12, "Blocking user...");
p_m_uploadPopup = &a1[-1].m_uploadPopup;
LABEL_20:
v11 = UploadActionPopup::create((__int64)p_m_uploadPopup, (__int64)&v12);
*(_QWORD *)&a1->m_fRotationX = v11;
v11->show(v11);
}
}
}
}