//
// GJMessageCell::FLAlert_Clicked from 0x61d890 to 0x61da10 (384 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'GJMessageCell::FLAlert_Clicked @ 0x61da14
// > ??> @ 0xba2e8
// > ??> @ 0x11514a0
//
// 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
//
void GJMessageCell::FLAlert_Clicked(GJMessageCell *a1, FLAlertLayer *a2, bool a3)
{
GameLevelManager *v4; // x0
UploadActionPopup *m_popup; // x0
UploadActionPopup *v6; // x0
UploadPopupDelegate_vtbl *v7; // x3
unsigned int *v8; // x2
int onClosePopup; // w0
UploadPopupDelegate v10; // [xsp+40h] [xbp+40h] BYREF
std::string v11; // 0:x2.8
if ( a3 && a2->getTag(a2) == 1 )
{
if ( a1->m_message )
{
GJMessageCell::markAsRead(a1);
v4 = GameLevelManager::sharedState();
if ( GameLevelManager::deleteUserMessages(v4, a1->m_message, nullptr, a1->m_message->m_outgoing) )
{
GameLevelManager::sharedState()->m_uploadActionDelegate = &a1->UploadActionDelegate;
m_popup = a1->m_popup;
if ( m_popup )
m_popup->m_delegate = nullptr;
sub_D153B8((int)&v10, "Deleting message...");
v6 = (UploadActionPopup *)UploadActionPopup::create((UploadActionPopup *)&a1->UploadPopupDelegate, &v10, v11);
a1->m_popup = v6;
v7 = v10.__vftable - 3;
if ( (__int64 *)&v10.__vftable[-3] != &qword_124B6B0 )
{
if ( &pthread_create )
{
v8 = (unsigned int *)&v10.__vftable[-1];
do
onClosePopup = __ldaxr(v8);
while ( __stlxr(onClosePopup - 1, v8) );
}
else
{
onClosePopup = (int)v10.__vftable[-1].onClosePopup;
LODWORD(v10.__vftable[-1].onClosePopup) = onClosePopup - 1;
}
if ( onClosePopup <= 0 )
operator delete(v7);
v6 = a1->m_popup;
}
v6->show(v6);
}
}
}
}