//
// ThreadOptionsPopup::init from 0xc7f08c to 0xc7fac4 (2616 bytes)
//
// 2 xrefs:
// > ThreadOptionsPopup::create @ 0xc7fd3c
// > ??> @ 0xe6e00
//
// 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:05:38 +0000
//
__int64 __fastcall ThreadOptionsPopup::init(
ThreadOptionsPopup *this,
GJMessageThread *a2,
ThreadViewPopup *a3,
char a4)
{
GJAccountManager *v6; // x0
int v7; // w26
float v8; // s8
_BOOL4 v9; // w27
int v10; // w25
cocos2d::CCDirector *v11; // x0
cocos2d::CCDirector *v12; // x0
__int64 v13; // x2
float v14; // s9
float v15; // s8
const char *v16; // x1
size_t v17; // x0
cocos2d::CCLabelBMFont *v18; // x0
cocos2d::CCLabelBMFont *v19; // x22
float v20; // s11
const char *v21; // x1
GameToolbox *v22; // x0
const char **v23; // x0
const char *v24; // x2
const char *v25; // x3
cocos2d::CCLabelBMFont *v26; // x0
__int64 v27; // x22
void (__fastcall *v28)(__int64, __int64 *); // x28
__int64 v29; // x28
__int64 v30; // x28
void (__fastcall *v31)(__int64, __int64 *); // x24
int v32; // w8
_BYTE *v33; // x10
int v34; // w9
int v35; // w7
int v36; // w5
char *v37; // x11
__int64 *v38; // x13
const char *v39; // x9
__int64 *v40; // x14
__int64 *v41; // x13
const char *v42; // x6
__int64 *v43; // x3
__int64 v44; // x24
__int64 v45; // x0
__int64 v46; // x26
cocos2d::CCNode *v47; // x25
float v48; // s2
void (__fastcall *v49)(__int64, __int64 *); // x27
int v51; // w20
__int64 v52; // x0
const char *v53; // x2
__int64 *v54; // x3
const char *v55; // x1
__int64 *v56; // x3
__int64 RoleBadge; // x23
void (__fastcall *v58)(__int64, __int64 *); // x28
float v59; // s12
float v60; // s10
float v61; // s13
float v62; // s0
GameLevelManager *v63; // x0
signed int v64; // w28
cocos2d::CCArray *ThreadMembers; // x20
__int64 v66; // x0
__int64 v67; // x0
unsigned __int64 v68; // x0
cocos2d::CCDirector *v69; // x0
__int64 v70; // x2
cocos2d::CCNode *v71; // [xsp+90h] [xbp+90h]
cocos2d::CCNode *v72; // [xsp+90h] [xbp+90h]
int v73; // [xsp+9Ch] [xbp+9Ch]
__int64 v74; // [xsp+A0h] [xbp+A0h] BYREF
_BYTE v75[8]; // [xsp+A8h] [xbp+A8h] BYREF
__int64 v76; // [xsp+B0h] [xbp+B0h] BYREF
char *v77; // [xsp+B8h] [xbp+B8h]
const char *v78; // [xsp+C0h] [xbp+C0h]
const char *v79; // [xsp+F8h] [xbp+F8h] BYREF
const char *v80; // [xsp+100h] [xbp+100h]
cocos2d::CCLabelBMFont *v81; // [xsp+108h] [xbp+108h]
__int64 (__fastcall *v82)(ThreadOptionsPopup *, cocos2d::CCObject *); // [xsp+138h] [xbp+138h] BYREF
__int64 v83; // [xsp+140h] [xbp+140h]
void *v84; // [xsp+148h] [xbp+148h]
__int64 v85; // [xsp+150h] [xbp+150h]
v6 = (GJAccountManager *)_stack_chk_guard;
if ( !a2 )
return 0;
*((_QWORD *)this + 130) = a3;
*((_BYTE *)this + 1056) = a4;
v7 = *((unsigned __int8 *)a2 + 264);
if ( *((_BYTE *)a2 + 264) )
{
if ( a4 )
{
v8 = 88.0;
v9 = 0;
v73 = 1;
}
else
{
v9 = 0;
v73 = 5;
v8 = 204.0;
}
}
else
{
v51 = *((_DWORD *)a2 + 50);
v52 = GJAccountManager::sharedState(v6);
v9 = v51 == *(_DWORD *)(v52 + 352) - *(_DWORD *)(v52 + 356);
if ( *((_BYTE *)this + 1056) )
{
v73 = 1;
v8 = 88.0;
}
else
{
if ( *((_DWORD *)a2 + 67) == 8 )
{
v8 = 117.0;
if ( (unsigned __int8)SetupTriggerPopup::init(this, nullptr, nullptr, 240.0, 117.0, 1u, 0.0) )
{
*((_QWORD *)this + 129) = a2;
v10 = 1;
v73 = 2;
v11 = (cocos2d::CCDirector *)cocos2d::CCObject::retain(a2);
LABEL_7:
v12 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v11);
cocos2d::CCDirector::getWinSize(&v74, v12);
v13 = *((_QWORD *)this + 129);
v14 = *(float *)&v74 * 0.5;
v15 = (float)(v8 * 0.5) + (float)(*((float *)&v74 + 1) * 0.5);
if ( (*(_BYTE *)(v13 + 88) & 1) != 0 )
v16 = *(const char **)(v13 + 104);
else
v16 = (const char *)(v13 + 89);
goto LABEL_9;
}
return 0;
}
v73 = 6;
v8 = 233.0;
if ( v51 != *(_DWORD *)(v52 + 352) - *(_DWORD *)(v52 + 356) )
{
v73 = 5;
v8 = 204.0;
}
}
}
if ( !(unsigned __int8)SetupTriggerPopup::init(this, nullptr, nullptr, 240.0, v8, 1u, 0.0) )
return 0;
*((_QWORD *)this + 129) = a2;
v10 = 0;
v11 = (cocos2d::CCDirector *)cocos2d::CCObject::retain(a2);
if ( !v7 )
goto LABEL_7;
v63 = (GameLevelManager *)GameLevelManager::sharedState(v11);
v64 = 0;
ThreadMembers = (cocos2d::CCArray *)GameLevelManager::getThreadMembers(
v63,
(const char *)*(unsigned int *)(*((_QWORD *)this + 129) + 56LL));
if ( ThreadMembers )
{
while ( v64 < (int)cocos2d::CCArray::count(ThreadMembers) )
{
v66 = cocos2d::CCArray::objectAtIndex(ThreadMembers, v64++);
if ( *(_DWORD *)(v66 + 376) == *(_DWORD *)(*((_QWORD *)this + 129) + 60LL) )
*((_DWORD *)this + 263) = *(_DWORD *)(v66 + 456) > 0;
}
}
v67 = *((_QWORD *)this + 129);
if ( *(int *)(v67 + 288) <= 0 )
{
v68 = *(unsigned int *)(v67 + 268);
if ( (_DWORD)v68 )
{
v68 = (_DWORD)v68 == 6;
*((_DWORD *)this + 263) = v68;
}
}
else
{
v68 = (unsigned __int64)&dword_0 + 1;
*((_DWORD *)this + 263) = (unsigned int)&dword_0 + 1;
}
v69 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v68);
cocos2d::CCDirector::getWinSize(&v74, v69);
v70 = *((_QWORD *)this + 129);
v14 = *(float *)&v74 * 0.5;
v15 = (float)(v8 * 0.5) + (float)(*((float *)&v74 + 1) * 0.5);
if ( (*(_BYTE *)(v70 + 64) & 1) != 0 )
v16 = *(const char **)(v70 + 80);
else
v16 = (const char *)(v70 + 65);
v10 = 0;
LABEL_9:
v71 = (cocos2d::CCNode *)v16;
v82 = nullptr;
v83 = 0;
v84 = nullptr;
v17 = strlen(v16);
std::string::__init((__int64 *)&v82, v71, v17);
v18 = (cocos2d::CCLabelBMFont *)SetupTriggerPopup::addTitle((__int64)this, (__int64)&v82);
v19 = v18;
if ( ((unsigned __int8)v82 & 1) != 0 )
{
operator delete(v84);
v20 = 0.5;
cocos2d::CCLabelBMFont::limitLabelWidth(v19, 180.0, 0.5, 0.2);
if ( !v7 )
goto LABEL_11;
LABEL_47:
RoleBadge = GJMessageThread::createRoleBadge(*((GJMessageThread **)this + 129), 16.0);
if ( RoleBadge )
{
v58 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)RoleBadge + 184LL);
v59 = (*(float (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)v19 + 224LL))(v19);
v60 = *(float *)(*(__int64 (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)v19 + 328LL))(v19);
v61 = (*(float (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)v19 + 168LL))(v19);
v62 = (*(float (__fastcall **)(cocos2d::CCLabelBMFont *))(*(_QWORD *)v19 + 240LL))(v19);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v76, (float)(v59 + (float)((float)(v60 * v61) * v20)) + 6.0, v62);
v58(RoleBadge, &v76);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
RoleBadge,
1);
}
goto LABEL_11;
}
v20 = 0.5;
cocos2d::CCLabelBMFont::limitLabelWidth(v18, 180.0, 0.5, 0.2);
if ( v7 )
goto LABEL_47;
LABEL_11:
v22 = *(GameToolbox **)(*((_QWORD *)this + 129) + 280LL);
if ( (__int64)v22 > 0 )
{
GameToolbox::timestampToDateString(v22, (__int64 *)&v82);
v23 = (const char **)std::string::insert(&v82, 0, "Created: ");
v24 = *v23;
v25 = v23[1];
v79 = *v23;
v80 = v25;
v81 = (cocos2d::CCLabelBMFont *)v23[2];
*v23 = nullptr;
v23[1] = nullptr;
v23[2] = nullptr;
if ( ((unsigned __int8)v82 & 1) != 0 )
operator delete(v84);
v26 = (cocos2d::CCLabelBMFont *)((char *)&v79 + 1);
if ( ((unsigned __int8)v79 & 1) != 0 )
v26 = v81;
v27 = cocos2d::CCLabelBMFont::create(v26, "chatFont.fnt", v24);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v27 + 160LL))(v27, 0.6);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v27 + 1072LL))(v27, &unk_119E6A0);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v27 + 1024LL))(v27, 4294967190LL);
v28 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v27 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v76, v14, v15 - 33.0);
v28(v27, &v76);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v27,
1);
if ( ((unsigned __int8)v79 & 1) != 0 )
operator delete(v81);
}
v29 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v21);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v29 + 160LL))(v29, 0.8);
v30 = CCMenuItemSpriteExtra::create(v29, 0, (__int64)this, 1368, 1);
CCMenuItemSpriteExtra::setSizeMult(v30, 1.5);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v30);
v72 = *((cocos2d::CCNode **)this + 69);
v31 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v30 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v75, (float)(v14 - 120.0) + 8.0, v15 - 12.0);
cocos2d::CCNode::convertToNodeSpace(&v76, v72, (const cocos2d::CCPoint *)v75);
v31(v30, &v76);
if ( v10 )
{
v82 = ThreadOptionsPopup::onReport;
v80 = "GJ_button_06.png";
v32 = 3;
v33 = *((_BYTE **)this + 129);
v34 = 2;
v77 = "Report";
v35 = 4;
v79 = "GJ_button_05.png";
v36 = 5;
v78 = "Remove";
v83 = 0;
v84 = ThreadOptionsPopup::onDismissRemoved;
v85 = 0;
}
else if ( *((_BYTE *)this + 1056) )
{
v33 = *((_BYTE **)this + 129);
if ( v33[272] )
v53 = "Unlock Conversation";
else
v53 = "Lock Conversation";
v83 = 0;
v36 = 4;
v35 = 3;
v77 = (char *)v53;
v32 = 2;
v79 = "GJ_button_06.png";
v34 = 1;
v82 = ThreadOptionsPopup::onModLock;
}
else if ( v7 )
{
v36 = 4;
v35 = 3;
v32 = 2;
v34 = 1;
v77 = "View Profile";
v82 = (__int64 (__fastcall *)(ThreadOptionsPopup *, cocos2d::CCObject *))ThreadOptionsPopup::onViewProfile;
v79 = "GJ_button_01.png";
v83 = 0;
v33 = *((_BYTE **)this + 129);
}
else
{
v83 = 0;
v77 = "Members";
v82 = (__int64 (__fastcall *)(ThreadOptionsPopup *, cocos2d::CCObject *))ThreadOptionsPopup::onMembers;
v79 = "GJ_button_01.png";
if ( v9 )
{
v80 = "GJ_button_04.png";
v36 = 5;
v78 = "Rename";
v35 = 4;
v84 = ThreadOptionsPopup::onRename;
v32 = 3;
v33 = *((_BYTE **)this + 129);
v34 = 2;
v85 = 0;
}
else
{
v33 = *((_BYTE **)this + 129);
v36 = 4;
v35 = 3;
v32 = 2;
v34 = 1;
}
}
if ( v33[204] )
v37 = "Unmute";
else
v37 = "Mute";
(&v79)[v34] = "GJ_button_04.png";
v38 = (__int64 *)(&v82 + 2 * v34);
*v38 = (__int64)ThreadOptionsPopup::onMuteRow;
v38[1] = 0;
(&v77)[v34] = v37;
if ( v33[274] )
v39 = "Unpin";
else
v39 = "Pin";
v40 = (__int64 *)(&v82 + 2 * v32);
v41 = (__int64 *)(&v82 + 2 * v35);
v42 = (const char *)ThreadOptionsPopup::onPinRow;
*v40 = (__int64)ThreadOptionsPopup::onPinRow;
v40[1] = 0;
(&v77)[v32] = (char *)v39;
(&v79)[v32] = "GJ_button_04.png";
*v41 = (__int64)ThreadOptionsPopup::onReport;
(&v77)[v35] = "Report";
(&v79)[v35] = "GJ_button_05.png";
v41[1] = 0;
if ( v7 )
{
if ( v33[265] )
{
v43 = (__int64 *)(&v82 + 2 * v36);
*v43 = (__int64)ThreadOptionsPopup::onCancelRequest;
(&v77)[v36] = "Cancel Request";
(&v79)[v36] = "GJ_button_06.png";
v43[1] = 0;
}
else
{
if ( *((_DWORD *)this + 263) )
v55 = "Clear";
else
v55 = "Leave";
(&v77)[v36] = (char *)v55;
v56 = (__int64 *)(&v82 + 2 * v36);
*v56 = (__int64)ThreadOptionsPopup::onHide;
(&v79)[v36] = "GJ_button_06.png";
v56[1] = 0;
}
}
else
{
v54 = (__int64 *)(&v82 + 2 * v36);
*v54 = (__int64)ThreadOptionsPopup::onLeave;
(&v79)[v36] = "GJ_button_06.png";
(&v77)[v36] = "Leave";
v54[1] = 0;
}
v44 = 0;
do
{
v45 = ButtonSprite::create(
(ButtonSprite *)(&v77)[v44],
(const char *)&qword_80 + 2,
0,
1,
0.5,
"bigFont.fnt",
(&v79)[v44],
v42,
22.0);
v46 = CCMenuItemSpriteExtra::create(
v45,
0,
(__int64)this,
(__int64)*(&v82 + 2 * (int)v44),
(__int64)*(&v82 + 2 * (int)v44 + 1));
CCMenuItemSpriteExtra::setSizeMult(v46, 1.1);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v46);
v47 = *((cocos2d::CCNode **)this + 69);
v48 = (float)(int)v44++;
v49 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v46 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v75, v14, (float)(v15 - 61.0) - (float)(v48 * 29.0));
cocos2d::CCNode::convertToNodeSpace(&v76, v47, (const cocos2d::CCPoint *)v75);
v49(v46, &v76);
}
while ( v73 > (int)v44 );
return 1;
}