//
// ThreadMessageOptionsPopup::init from 0x7537c8 to 0x753c40 (1144 bytes)
//
// 1 xrefs:
// > ThreadMessageOptionsPopup::create @ 0x753cfc
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:58:53 +0000
//
GameManager *__fastcall ThreadMessageOptionsPopup::init(int a1, cocos2d::CCObject *a2, unsigned __int8 *a3, int a4)
{
GameManager *v8; // r8
unsigned __int8 *v9; // r0
int v10; // r6
cocos2d::CCDirector *v11; // r0
float v12; // s21
float v13; // s16
float v14; // s21
float v15; // s16
float v16; // s18
int v17; // r5
__int64 v18; // r2
const char *v19; // r1
const char *v20; // r2
cocos2d::CCLabelBMFont *v21; // r0
int v22; // r5
void (__fastcall *v23)(int, _DWORD *); // r9
int v24; // r6
int v25; // r10
const cocos2d::CCPoint *v26; // r11
void (__fastcall *v27)(int, _DWORD *); // r6
const char *v28; // r1
int v29; // r0
int v30; // r11
void (__fastcall *v31)(int, _DWORD *); // r10
EmoteSprite *v32; // r0
int v33; // r0
_BYTE *v34; // r6
void (__fastcall *v35)(_BYTE *, _DWORD *); // r10
void (__fastcall *v36)(_BYTE *, _DWORD *); // r5
int v37; // r5
char *v38; // r0
ButtonSprite *v39; // r0
int v40; // r6
const cocos2d::CCPoint *v41; // r10
void (__fastcall *v42)(int, _BYTE *); // r9
float v44; // [sp+10h] [bp-4Ch]
cocos2d::CCPoint *v45; // [sp+14h] [bp-48h]
float v46[2]; // [sp+18h] [bp-44h] BYREF
_BYTE v47[8]; // [sp+20h] [bp-3Ch] BYREF
_BYTE v48[8]; // [sp+28h] [bp-34h] BYREF
int v49; // [sp+30h] [bp-2Ch]
int v50; // [sp+34h] [bp-28h]
_DWORD v51[2]; // [sp+38h] [bp-24h] BYREF
_DWORD v52[2]; // [sp+40h] [bp-1Ch] BYREF
int v53[2]; // [sp+48h] [bp-14h] BYREF
cocos2d::CCLabelBMFont *v54; // [sp+50h] [bp-Ch]
if ( !a2 )
return nullptr;
if ( !a4 )
return nullptr;
v8 = SetupTriggerPopup::init((SetupTriggerPopup *)a1, nullptr, nullptr, 300.0, 170.0, (_BYTE *)&dword_0 + 1, 0.0);
if ( !v8 )
return nullptr;
*(_DWORD *)(a1 + 716) = a2;
cocos2d::CCObject::retain(a2);
*(_DWORD *)(a1 + 720) = a4;
v9 = std::string::operator=((unsigned __int8 *)(a1 + 724), a3);
v10 = *((_DWORD *)a2 + 16);
v11 = (cocos2d::CCDirector *)GJAccountManager::sharedState((GJAccountManager *)v9);
*(_BYTE *)(a1 + 736) = v10 == *((_DWORD *)v11 + 70) - *((_DWORD *)v11 + 71);
cocos2d::CCDirector::sharedDirector(v11);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v46);
v12 = v46[1];
v13 = v46[0];
std::string::basic_string(v53, (int)a3);
v14 = v12 * 0.5;
v15 = v13 * 0.5;
v16 = v14 + 85.0;
v17 = SetupTriggerPopup::addTitle(a1, (unsigned __int8 *)v53);
std::string::~string((int)v53);
(*(void (__fastcall **)(int, _DWORD, int))(*(_DWORD *)v17 + 124))(v17, 0, -1065353216);
v18 = *(_QWORD *)(*(_DWORD *)(a1 + 716) + 80);
v19 = (const char *)((unsigned __int64)(v18 - 1) >> 32);
if ( v18 >= 1 )
{
GameToolbox::timestampToDateString((GameToolbox *)v53, *(_DWORD *)(*(_DWORD *)(a1 + 716) + 80));
if ( (v53[0] & 1) != 0 )
v21 = v54;
else
v21 = (cocos2d::CCLabelBMFont *)((char *)v53 + 1);
v22 = cocos2d::CCLabelBMFont::create(v21, "chatFont.fnt", v20);
std::string::~string((int)v53);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v22 + 80))(v22, 1058642330);
(*(void (__fastcall **)(int, void *))(*(_DWORD *)v22 + 536))(v22, &unk_BF077C);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v22 + 512))(v22, 150);
v23 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v22 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v52, v15, v16 - 36.0);
v23(v22, v52);
(*(void (__fastcall **)(_DWORD, int, int))(**(_DWORD **)(a1 + 460) + 232))(*(_DWORD *)(a1 + 460), v22, 1);
}
v24 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v19);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v24 + 80))(v24, 1061997773);
v49 = 684;
v50 = 1;
v25 = CCMenuItemSpriteExtra::create(v24, 0, a1, 684, 1);
CCMenuItemSpriteExtra::setSizeMult(v25, 1.5);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 444) + 228))(*(_DWORD *)(a1 + 444), v25);
v26 = *(const cocos2d::CCPoint **)(a1 + 444);
v27 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v25 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v51, (float)(v15 - 150.0) + 8.0, v16 - 12.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v52, v26);
v27(v25, v52);
v29 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"threadBtn_copy_001.png", v28);
v51[0] = ThreadMessageOptionsPopup::onCopy;
v51[1] = 0;
v30 = CCMenuItemSpriteExtra::create(v29, 0, a1, (int)ThreadMessageOptionsPopup::onCopy, 0);
CCMenuItemSpriteExtra::setSizeMult(v30, 1.4);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 444) + 228))(*(_DWORD *)(a1 + 444), v30);
v31 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v30 + 92);
v45 = *(cocos2d::CCPoint **)(a1 + 444);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v48, (float)(v15 + 150.0) - 18.0, v16 - 19.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v52, v45);
v31(v30, v52);
v53[0] = 0;
v53[1] = 0;
v54 = nullptr;
std::string::__init(v53, &unk_B6B226, 0);
v32 = (EmoteSprite *)cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v52, 0.0, 0.5);
v33 = EmoteSprite::maxEmotesMessage(v32);
v34 = (_BYTE *)TextArea::create(
(int)v53,
"chatFont.fnt",
1065353216,
1132068864,
(const cocos2d::CCPoint *)v52,
1101004800,
1,
v33);
std::string::~string((int)v53);
v34[509] = 1;
v35 = *(void (__fastcall **)(_BYTE *, _DWORD *))(*(_DWORD *)v34 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v52, 0.0, 0.5);
v35(v34, v52);
std::string::basic_string(v53, *(_DWORD *)(a1 + 716) + 68);
TextArea::fitString((int)v34, (int)v53, 250.0, 80.0, 0.35, 0.0);
std::string::~string((int)v53);
v36 = *(void (__fastcall **)(_BYTE *, _DWORD *))(*(_DWORD *)v34 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v52, (float)(v15 - 125.0) - 10.0, v14 + 2.0);
v36(v34, v52);
(*(void (__fastcall **)(_DWORD, _BYTE *, int))(**(_DWORD **)(a1 + 460) + 232))(*(_DWORD *)(a1 + 460), v34, 1);
if ( *(_BYTE *)(a1 + 736) )
v37 = 1;
else
v37 = *(unsigned __int8 *)(*(_DWORD *)(a1 + 720) + 599);
if ( !*(_BYTE *)(*(_DWORD *)(a1 + 716) + 88)
&& (!*(_BYTE *)(a1 + 736) || !ThreadViewPopup::removedView(*(ThreadViewPopup **)(a1 + 720))) )
{
if ( v37 )
v38 = "Delete";
else
v38 = "Report";
v39 = ButtonSprite::create(
(ButtonSprite *)v38,
(const char *)&dword_64,
0,
0.7,
1,
"bigFont.fnt",
"GJ_button_06.png",
(const char *)0x41F00000,
v44);
v52[0] = ThreadMessageOptionsPopup::onAction;
v52[1] = 0;
v40 = CCMenuItemSpriteExtra::create((int)v39, 0, a1, (int)ThreadMessageOptionsPopup::onAction, 0);
CCMenuItemSpriteExtra::setSizeMult(v40, 1.1);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 444) + 228))(*(_DWORD *)(a1 + 444), v40);
v41 = *(const cocos2d::CCPoint **)(a1 + 444);
v42 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v40 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, v15, (float)(v14 - 85.0) + 24.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v48, v41);
v42(v40, v48);
}
return v8;
}