//
// GJWriteMessagePopup::closeMessagePopup from 0x4ae514 to 0x4ae5f0 (220 bytes)
//
// 2 xrefs:
// > GJWriteMessagePopup::onClose @ 0x4ae5f6
// > GJWriteMessagePopup::onClosePopup @ 0x4ae630
//
// 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 GJWriteMessagePopup::closeMessagePopup(GJWriteMessagePopup *a1, bool a2)
{
_BOOL4 v3; // r5
GJUserMessage *v4; // r0
GJUserMessage *v5; // r7
GameLevelManager *v6; // r0
GameLevelManager *v7; // r0
GJUserMessage *StoredUserMessage; // r0
GJMessagePopup *v9; // r0
GJMessagePopup_vtbl *v10; // r3
_DWORD v11[3]; // [sp+0h] [bp-Ch] BYREF
v11[0] = a1;
v11[1] = a2;
v3 = a2;
a1->m_messageInput->onClickTrackNode(a1->m_messageInput, 0);
v4 = (GJUserMessage *)((int (__fastcall *)(CCTextInputNode *, _DWORD))a1->m_subjectInput->onClickTrackNode)(
a1->m_subjectInput,
0);
if ( !v3 && a1->m_accountID )
{
if ( *((_DWORD *)a1->m_messageText.m_data.m_data - 3) )
{
v5 = GJUserMessage::create(v4);
sub_775C20(v11);
sub_775D40(&v5->m_content, v11);
sub_774008(v11);
sub_775C20(v11);
sub_775D40(&v5->m_title, v11);
sub_774008(v11);
v6 = GameLevelManager::sharedState();
GameLevelManager::storeUserMessageReply(v6, a1->m_accountID, v5);
}
v7 = GameLevelManager::sharedState();
StoredUserMessage = GameLevelManager::getStoredUserMessage(v7, a1->m_accountID);
if ( StoredUserMessage )
{
v9 = GJMessagePopup::create(StoredUserMessage);
v10 = v9->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v9->m_noElasticity = 1;
((void (*)(void))v10->show)();
}
}
a1->setKeypadEnabled(a1, 0);
a1->removeFromParentAndCleanup(a1, 1);
}