//
// cocos2d::CCTextFieldTTF::setString from 0x5f3434 to 0x5f352c (248 bytes)
//
// 1 xrefs:
// > `non-virtual thunk to'cocos2d::CCTextFieldTTF::setString @ 0x5f3540
//
// 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 cocos2d::CCTextFieldTTF::setString(cocos2d::CCTextFieldTTF *a1, const char *a2)
{
std::string *m_pInputText; // r7
std::string *v5; // r5
int i; // r5
std::string *v7; // r0
cocos2d::CCTextFieldTTF *v8; // r0
const char *m_data; // r1
int v10; // r1
char *v11; // r2
char v12; // r3
int v13; // t1
cocos2d::CCTextFieldDelegate *m_pDelegate; // r0
char *v15; // [sp+8h] [bp-8h] BYREF
m_pInputText = a1->m_pInputText;
v15 = (char *)&unk_ACDDA8;
if ( m_pInputText )
{
sub_774008(m_pInputText);
operator delete(m_pInputText);
a1->m_pInputText = nullptr;
}
if ( a2 )
{
v5 = (std::string *)operator new(4u);
sub_776584((int)v5, (char *)a2);
a1->m_pInputText = v5;
sub_775D40(&v15, v5);
if ( a1->m_bSecureTextEntry )
{
sub_7753D4((int)&v15, (char *)&unk_939830);
for ( i = *((_DWORD *)a1->m_pInputText->m_data.m_data - 3); i; --i )
sub_774544((int)&v15, (char *)&off_ABAD80);
}
}
else
{
v7 = (std::string *)operator new(4u);
v7->m_data.m_data = (stl::StringData::Internal *)&unk_ACDDA8;
a1->m_pInputText = v7;
}
if ( *((_DWORD *)a1->m_pInputText->m_data.m_data - 3) )
{
m_data = v15;
v8 = a1;
}
else
{
v8 = a1;
m_data = (const char *)a1->m_pPlaceHolder->m_data.m_data;
}
cocos2d::CCLabelTTF::setString(v8, m_data);
v10 = 0;
v11 = (char *)a1->m_pInputText->m_data.m_data - 1;
while ( 1 )
{
v13 = (unsigned __int8)*++v11;
v12 = v13;
if ( !v13 )
break;
if ( (v12 & 0xC0) != 0x80 )
++v10;
}
m_pDelegate = a1->m_pDelegate;
a1->m_nCharCount = v10;
if ( m_pDelegate )
m_pDelegate->textChanged(m_pDelegate);
sub_774008(&v15);
}