//
// NewThreadPopup::applyMode from 0x755e94 to 0x75612e (666 bytes)
//
// 2 xrefs:
// > NewThreadPopup::init @ 0x756fde
// > NewThreadPopup::onToggleMode @ 0x7572be
//
// 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:55 +0000
//
cocos2d::CCArray *__fastcall NewThreadPopup::applyMode(NewThreadPopup *this)
{
int v2; // r0
const char *v3; // r1
int v4; // r0
int v5; // r0
int v6; // r0
int v7; // r7
int v8; // r0
int v9; // r0
float v10; // s15
float v11; // s16
int v12; // r0
int v13; // r0
int v14; // r0
int *v15; // r0
char *v16; // r1
int v17; // r6
int v18; // r7
CCTextInputNode *v19; // r6
int v20; // r0
unsigned int v21; // r1
char *v22; // r3
char *v23; // r3
int v24; // r0
int v25; // r2
int v26; // r3
int v27; // r8
int v28; // r1
unsigned int v29; // r1
char *v30; // r2
int v32; // r9
char *v33; // r8
size_t v34; // r0
unsigned __int8 v36; // [sp+4h] [bp-20h] BYREF
_BYTE v37[3]; // [sp+5h] [bp-1Fh] BYREF
unsigned int v38; // [sp+8h] [bp-1Ch]
char *v39; // [sp+Ch] [bp-18h]
int v40[3]; // [sp+10h] [bp-14h] BYREF
v2 = *((_DWORD *)this + 142);
if ( v2 )
{
if ( *((_BYTE *)this + 557) )
v3 = "New Direct Message";
else
v3 = "New Group Chat";
(*(void (__fastcall **)(int, const char *))(*(_DWORD *)v2 + 464))(v2, v3);
cocos2d::CCLabelBMFont::limitLabelWidth(*((cocos2d::CCLabelBMFont **)this + 142), 230.0, 0.7, 0.4);
}
GameToolbox::setOnOffSprite(*((_DWORD *)this + 143), *((unsigned __int8 *)this + 557));
GameToolbox::setOnOffSprite(*((_DWORD *)this + 144), *((unsigned __int8 *)this + 557) ^ 1);
v4 = *((_DWORD *)this + 149);
if ( v4 )
(*(void (__fastcall **)(int, int))(*(_DWORD *)v4 + 172))(v4, *((unsigned __int8 *)this + 557) ^ 1);
v5 = *((_DWORD *)this + 150);
if ( v5 )
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v5 + 172))(v5, *((unsigned __int8 *)this + 557));
v6 = *((_DWORD *)this + 151);
v7 = *((unsigned __int8 *)this + 557);
if ( v6 )
(*(void (__fastcall **)(int, int))(*(_DWORD *)v6 + 172))(v6, v7 ^ 1);
v8 = *((_DWORD *)this + 156);
if ( v8 )
(*(void (__fastcall **)(int, int))(*(_DWORD *)v8 + 172))(v8, v7 ^ 1);
v9 = *((_DWORD *)this + 158);
if ( v9 )
{
(*(void (__fastcall **)(int, int))(*(_DWORD *)v9 + 172))(v9, v7 ^ 1);
v10 = *((float *)this + 153);
if ( v7 == 1 )
v10 = v10 + 3000.0;
(*(void (__fastcall **)(_DWORD, float))(**((_DWORD **)this + 158) + 116))(
*((_DWORD *)this + 158),
COERCE_FLOAT(LODWORD(v10)));
if ( v7 )
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 158) + 580))(*((_DWORD *)this + 158), 0);
}
v11 = *((float *)this + 154);
if ( *((_BYTE *)this + 557) )
v11 = v11 + 23.0;
v12 = *((_DWORD *)this + 152);
if ( v12 )
(*(void (__fastcall **)(int, float))(*(_DWORD *)v12 + 116))(v12, COERCE_FLOAT(LODWORD(v11)));
v13 = *((_DWORD *)this + 159);
if ( v13 )
(*(void (__fastcall **)(int, float))(*(_DWORD *)v13 + 116))(v13, COERCE_FLOAT(LODWORD(v11)));
v14 = *((_DWORD *)this + 159);
if ( v14 )
{
v15 = (int *)(v14 + 328);
if ( *((_BYTE *)this + 557) )
v16 = "Message";
else
v16 = "Description";
std::string::assign(v15, v16);
v17 = *((_DWORD *)this + 159);
v18 = NewThreadPopup::bodyCharLimit(this);
*(_DWORD *)(v17 + 424) = 17 * NewThreadPopup::bodyEmoteCap(this) + v18;
v19 = *((CCTextInputNode **)this + 159);
v20 = NewThreadPopup::bodyEmoteCap(this);
CCTextInputNode::setParseEmotes(v19, v20);
CCTextInputNode::setAllowNewlines(*((_DWORD *)this + 159), *((_BYTE *)this + 557));
CCTextInputNode::getString((CCTextInputNode *)&v36, *((_DWORD *)this + 159));
v21 = *((unsigned __int8 *)this + 557);
if ( !*((_BYTE *)this + 557) )
{
while ( 1 )
{
if ( (v36 & 1) != 0 )
{
if ( v21 >= v38 )
break;
v22 = v39;
}
else
{
if ( v21 >= v36 >> 1 )
break;
v22 = v37;
}
if ( v22[v21] == 10 )
{
if ( (v36 & 1) != 0 )
v23 = v39;
else
v23 = v37;
v23[v21] = 32;
}
++v21;
}
}
while ( (v36 & 1) != 0 ? v38 : (int)v36 >> 1 )
{
v24 = NewThreadPopup::bodyEmoteCap(this);
v27 = EmoteSprite::effectiveLength(&v36, v24, v25, v26);
if ( v27 <= NewThreadPopup::bodyCharLimit(this) )
break;
if ( (v36 & 1) != 0 )
v28 = v38;
else
v28 = (int)v36 >> 1;
v29 = v28 - 1;
if ( (v36 & 1) != 0 )
v30 = v39;
else
v30 = v37;
while ( v29 && (v30[v29] & 0xC0) == 0x80 )
--v29;
std::string::erase(&v36, v29, 0xFFFFFFFF);
}
v32 = *((_DWORD *)this + 159);
if ( (v36 & 1) != 0 )
v33 = v39;
else
v33 = v37;
memset(v40, 0, sizeof(v40));
v34 = strlen(v33);
std::string::__init(v40, v33, v34);
CCTextInputNode::setString(v32, (int)v40);
std::string::~string((int)v40);
std::string::~string((int)&v36);
}
return NewThreadPopup::updateRecipientLabel(this);
}