//
// ThreadDescPopup::buildUI from 0xc79c14 to 0xc7a61c (2568 bytes)
//
// 2 xrefs:
// > ThreadDescPopup::init @ 0xc7a6c8
// > ??> @ 0x6a288
//
// 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:35 +0000
//
__int64 __fastcall ThreadDescPopup::buildUI(__int64 a1, unsigned __int8 a2, unsigned __int8 *a3, __int64 a4)
{
int v5; // w28
cocos2d::CCDirector *v8; // x0
unsigned int v9; // w22
cocos2d::CCDirector *v11; // x0
float v12; // s8
float v13; // s10
const char *v14; // x1
__int64 v15; // x27
__int64 v16; // x27
__int64 v17; // x27
void (__fastcall *v18)(__int64, __int64 *); // x28
void (__fastcall *v19)(__int64, __int64 *); // x2
void (__fastcall *v20)(__int64, __int64 *); // x28
__int64 v21; // x0
__int64 v22; // x27
void (__fastcall *v23)(__int64, __int64 *); // x28
__int64 *v24; // x0
__int64 v25; // x27
EmoteSprite *v26; // x0
CCTextInputNode *v27; // x27
int v28; // w0
float v29; // s9
TextArea *v30; // x27
__int64 v31; // x1
void (__fastcall *v32)(TextArea *, __int64 *); // x28
void (__fastcall *v33)(TextArea *, __int64 *); // x28
const char *v34; // x6
int v35; // w1
_QWORD *v36; // x27
const char *v37; // x1
size_t v38; // x0
__int64 v39; // x0
__int64 v40; // x27
cocos2d::CCNode *v41; // x28
void (__fastcall *v42)(__int64, __int64 *); // x24
float v43; // s8
const char *v44; // x2
const void *v45; // x1
size_t v46; // x2
__int64 v47; // x27
void (__fastcall *v48)(__int64, __int64 *); // x24
void (__fastcall *v49)(__int64, __int64 *); // x24
__int64 v50; // x24
void (__fastcall *v51)(__int64, __int64 *); // x26
__int64 v52; // x0
__int64 v53; // x24
__int64 v54; // x1
__int64 v55; // x0
cocos2d::CCNode *v56; // x27
void (__fastcall *v57)(__int64, __int64 *); // x26
float *v58; // x0
cocos2d::CCSprite *v59; // x23
long double v60; // q1
__int64 v61; // x26
cocos2d::CCNode *v62; // x24
void (__fastcall *v63)(__int64, __int64 *); // x23
EmoteSprite *v64; // x0
int v65; // w0
__int64 v66; // x26
__int64 v67; // x1
void (__fastcall *v68)(__int64, __int64 *); // x25
int v69; // w1
size_t v70; // x2
void *v71; // x1
__int64 v72; // x1
void (__fastcall *v73)(__int64, __int64 *); // x23
__int64 v74; // x0
__int64 v75; // x1
cocos2d::CCNode *v76; // [xsp+A0h] [xbp+A0h]
void (__fastcall *v77)(__int64, __int64 *); // [xsp+A8h] [xbp+A8h]
char *v78; // [xsp+A8h] [xbp+A8h]
int v79; // [xsp+B8h] [xbp+B8h]
__int64 v80; // [xsp+C0h] [xbp+C0h] BYREF
__int64 v81; // [xsp+C8h] [xbp+C8h] BYREF
__int64 v82[2]; // [xsp+D0h] [xbp+D0h] BYREF
__int64 v83; // [xsp+E0h] [xbp+E0h] BYREF
__int64 v84; // [xsp+E8h] [xbp+E8h]
void *v85; // [xsp+F0h] [xbp+F0h]
v5 = a2;
v8 = (cocos2d::CCDirector *)(unsigned __int8)SetupTriggerPopup::init(
(SetupTriggerPopup *)a1,
nullptr,
nullptr,
340.0,
190.0,
1u,
0.0);
v9 = (unsigned __int8)v8;
if ( !(_BYTE)v8 )
return v9;
v11 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v8);
cocos2d::CCDirector::getWinSize(&v80, v11);
v83 = 0;
v12 = *((float *)&v80 + 1) * 0.5;
v84 = 0;
v13 = *(float *)&v80 * 0.5;
v85 = nullptr;
std::string::__init(&v83, "Description", 0xBu);
SetupTriggerPopup::addTitle(a1, (__int64)&v83);
if ( (v83 & 1) != 0 )
operator delete(v85);
v15 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v14);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v15 + 160LL))(v15, 0.8);
v16 = CCMenuItemSpriteExtra::create(v15, 0, a1, 1368, 1);
CCMenuItemSpriteExtra::setSizeMult(v16, 1.5);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v16);
v77 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v16 + 184LL);
v76 = *(cocos2d::CCNode **)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v81, (float)(v13 - 170.0) + 8.0, (float)(v12 + 95.0) - 12.0);
cocos2d::CCNode::convertToNodeSpace(v82, v76, (const cocos2d::CCPoint *)&v81);
v77(v16, v82);
if ( v5 )
{
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v82, 0.0, 0.0, 40.0, 40.0);
v17 = cocos2d::extension::CCScale9Sprite::create("square02b_small.png", v82);
v18 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v17 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v82, 300.0, 92.0);
v18(v17, v82);
v19 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v17 + 960LL);
LOWORD(v82[0]) = 13405;
BYTE2(v82[0]) = 31;
v19(v17, v82);
v20 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v17 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v82, v13, v12 + 8.0);
v20(v17, v82);
(*(void (__fastcall **)(_QWORD, __int64, _QWORD))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v17, 0);
*(_DWORD *)(a1 + 1056) = 1133248512;
v21 = CCTextInputNode::create(
(CCTextInputNode *)"Describe this group chat",
288.0,
82.0,
"Thonburi",
(const char *)&off_18,
nullptr,
(const char *)0x438C0000);
*(_QWORD *)(a1 + 1048) = v21;
*(_BYTE *)(v21 + 608) = 0;
v22 = *(_QWORD *)(a1 + 1048);
v23 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v22 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v82, v13, v12 + 8.0);
v23(v22, v82);
v24 = CCTextInputNode::setUnicodeText(*(__int64 **)(a1 + 1048), 1);
v25 = *(_QWORD *)(a1 + 1048);
v26 = (EmoteSprite *)(17 * (unsigned int)EmoteSprite::maxEmotesComment((EmoteSprite *)v24) + 300);
*(_DWORD *)(v25 + 592) = (_DWORD)v26;
v27 = *(CCTextInputNode **)(a1 + 1048);
v28 = EmoteSprite::maxEmotesComment(v26);
CCTextInputNode::setParseEmotes(v27, v28);
LOBYTE(v79) = -61;
*(_QWORD *)(*(_QWORD *)(a1 + 1048) + 584LL) = a1 + 544;
*(_WORD *)((char *)&v79 + 1) = 16748;
CCTextInputNode::setLabelPlaceholderColor(*(_QWORD *)(a1 + 1048), v79);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
*(_QWORD *)(a1 + 1048),
5);
v83 = 0;
v84 = 0;
v85 = nullptr;
std::string::__init(&v83, &byte_11B8890, 0);
v29 = *(float *)(a1 + 1056);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v82, 0.0, 0.5);
v30 = (TextArea *)TextArea::create(
(char *)&v83,
"chatFont.fnt",
(const cocos2d::CCPoint *)v82,
1,
0,
1.0,
v29,
20.0);
if ( (v83 & 1) != 0 )
operator delete(v85);
v31 = *(_QWORD *)v30;
*((_BYTE *)v30 + 597) = 1;
v32 = *(void (__fastcall **)(TextArea *, __int64 *))(v31 + 296);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v82, 0.0, 0.5);
v32(v30, v82);
CCTextInputNode::addTextArea(*(CCTextInputNode **)(a1 + 1048), v30);
v33 = *(void (__fastcall **)(TextArea *, __int64 *))(*(_QWORD *)v30 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v82, (float)-*(float *)(a1 + 1056) * 0.5, 0.0);
v33(v30, v82);
v35 = *a3;
if ( (v35 & 1) != 0 )
{
if ( *((_QWORD *)a3 + 1) )
{
v36 = *(_QWORD **)(a1 + 1048);
v37 = *((const char **)a3 + 2);
goto LABEL_11;
}
}
else if ( v35 >> 1 )
{
v36 = *(_QWORD **)(a1 + 1048);
v37 = (const char *)(a3 + 1);
LABEL_11:
v78 = (char *)v37;
v83 = 0;
v84 = 0;
v85 = nullptr;
v38 = strlen(v37);
std::string::__init(&v83, v78, v38);
CCTextInputNode::setString(v36, (char *)&v83);
if ( (v83 & 1) != 0 )
operator delete(v85);
}
v39 = ButtonSprite::create(
(ButtonSprite *)"Save",
(const char *)&dword_44 + 2,
0,
1,
0.6,
"bigFont.fnt",
"GJ_button_01.png",
v34,
28.0);
v40 = CCMenuItemSpriteExtra::create(v39, 0, a1, (__int64)ThreadDescPopup::onSave, 0);
CCMenuItemSpriteExtra::setSizeMult(v40, 1.1);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v40);
v41 = *(cocos2d::CCNode **)(a1 + 552);
v42 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v40 + 184LL);
v43 = (float)(v12 - 95.0) + 24.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v81, v13, v43);
cocos2d::CCNode::convertToNodeSpace(v82, v41, (const cocos2d::CCPoint *)&v81);
v42(v40, v82);
if ( a1 + 1088 != a4 )
{
if ( (*(_BYTE *)a4 & 1) != 0 )
{
v45 = *(const void **)(a4 + 16);
v46 = *(_QWORD *)(a4 + 8);
}
else
{
v45 = (const void *)(a4 + 1);
v46 = *(_BYTE *)a4 >> 1;
}
std::string::assign((__int64 *)(a1 + 1088), v45, v46);
}
v47 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Icon:", "goldFont.fnt", v44);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v47 + 160LL))(v47, 0.5);
v48 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v47 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v82, 0.0, 0.5);
v48(v47, v82);
v49 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v47 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v82, (float)(v13 - 170.0) + 22.0, v43);
v49(v47, v82);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v47, 1);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v82, 0.0, 0.0, 40.0, 40.0);
v50 = cocos2d::extension::CCScale9Sprite::create("GJ_button_04.png", v82);
v51 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v50 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v82, 32.0, 32.0);
v51(v50, v82);
*(_QWORD *)(a1 + 1120) = v50;
v52 = CCMenuItemSpriteExtra::create(v50, 0, a1, (__int64)ThreadDescPopup::onPickIcon, 0);
*(_QWORD *)(a1 + 1128) = v52;
CCMenuItemSpriteExtra::setSizeMult(v52, 1.2);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 552) + 456LL))(
*(_QWORD *)(a1 + 552),
*(_QWORD *)(a1 + 1128));
v53 = *(_QWORD *)(a1 + 1128);
v54 = *(_QWORD *)v47;
v55 = v47;
v56 = *(cocos2d::CCNode **)(a1 + 552);
v57 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v53 + 184LL);
v58 = (float *)(*(__int64 (__fastcall **)(__int64))(v54 + 328))(v55);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v81,
(float)((float)((float)(v13 - 170.0) + 22.0) + (float)(*v58 * 0.5)) + 24.0,
v43);
cocos2d::CCNode::convertToNodeSpace(v82, v56, (const cocos2d::CCPoint *)&v81);
v57(v53, v82);
ThreadDescPopup::refreshIconSlot((ThreadDescPopup *)a1);
v83 = 0;
v84 = 0;
v85 = nullptr;
std::string::__init(&v83, "easy", 4u);
v59 = EmoteSprite::createWithName((char *)&v83);
if ( (v83 & 1) != 0 )
operator delete(v85);
LODWORD(v60) = 0;
EmoteSprite::fitToHeight(v59, 18.0, v60);
v61 = CCMenuItemSpriteExtra::create((__int64)v59, 0, a1, (__int64)ThreadDescPopup::onEmotes, 0);
CCMenuItemSpriteExtra::setSizeMult(v61, 1.4);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v61);
v62 = *(cocos2d::CCNode **)(a1 + 552);
v63 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v61 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v81, (float)(v13 + 170.0) - 30.0, v43);
cocos2d::CCNode::convertToNodeSpace(v82, v62, (const cocos2d::CCPoint *)&v81);
v63(v61, v82);
return v9;
}
v83 = 0;
v84 = 0;
v85 = nullptr;
std::string::__init(&v83, &byte_11B8890, 0);
v64 = (EmoteSprite *)cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v82, 0.0, 0.5);
v65 = EmoteSprite::maxEmotesComment(v64);
v66 = TextArea::create((char *)&v83, "chatFont.fnt", (const cocos2d::CCPoint *)v82, 1, v65, 1.0, 280.0, 20.0);
if ( (v83 & 1) != 0 )
operator delete(v85);
v67 = *(_QWORD *)v66;
*(_BYTE *)(v66 + 597) = 1;
v68 = *(void (__fastcall **)(__int64, __int64 *))(v67 + 296);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v82, 0.0, 0.5);
v68(v66, v82);
v69 = *a3;
if ( (v69 & 1) == 0 )
{
if ( v69 >> 1 )
{
v74 = *(_QWORD *)a3;
v75 = *((_QWORD *)a3 + 1);
v85 = *((void **)a3 + 2);
v83 = v74;
v84 = v75;
goto LABEL_25;
}
LABEL_37:
v83 = 0;
v84 = 0;
v85 = nullptr;
std::string::__init(&v83, "No description", 0xEu);
goto LABEL_25;
}
v70 = *((_QWORD *)a3 + 1);
if ( !v70 )
goto LABEL_37;
v71 = *((void **)a3 + 2);
v83 = 0;
v84 = 0;
v85 = nullptr;
std::string::__init(&v83, v71, v70);
LABEL_25:
TextArea::fitString((float *)v66, (char *)&v83, 280.0, 110.0, 0.35, 0.0);
if ( (v83 & 1) != 0 )
operator delete(v85);
v72 = *a3 >> 1;
if ( (*a3 & 1) != 0 )
v72 = *((_QWORD *)a3 + 1);
if ( !v72 )
{
LOWORD(v81) = -26986;
BYTE2(v81) = -106;
TextArea::colorAllCharactersTo(v66, v81);
}
v73 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v66 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v82, (float)(v13 - 140.0) - 10.0, v12 - 4.0);
v73(v66, v82);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v66, 1);
return v9;
}