//
// CCTextInputNode::updateLabel from 0x10016cc18 to 0x10016ce0c (500 bytes)
//
// 32 xrefs:
// > CustomizeObjectLayer::textInputOpened @ 0x100050a9c
// > LevelSearchLayer::updateSearchLabel @ 0x1000533e0
// > LevelSearchLayer::textInputOpened @ 0x100054ab8
// > SetupSmartTemplateLayer::textInputOpened @ 0x1000712ec
// > SecretLayer5::updateSearchLabel @ 0x100074d94
// > SecretLayer5::onSubmit @ 0x100074f78
// > SecretLayer5::textInputOpened @ 0x100076e1c
// > EditLevelLayer::textInputClosed @ 0x1000eb96c
// > EditLevelLayer::textInputOpened @ 0x1000ebb30
// > CCTextInputNode::addTextArea @ 0x10016cb70
// > CCTextInputNode::setString @ 0x10016cf0c
// > CCTextInputNode::textChanged @ 0x10016d740
// > CCTextInputNode::onTextFieldDetachWithIME @ 0x10016e1d4
// > LevelListLayer::textInputClosed @ 0x1002472b0
// > LevelListLayer::textInputOpened @ 0x1002473ec
// > SetColorIDPopup::init @ 0x1002dea78
// > SetColorIDPopup::colorSelectClosed @ 0x1002debd8
// > GJGarageLayer::textInputOpened @ 0x100304798
// > SecretLayer2::updateSearchLabel @ 0x10030a624
// > SecretLayer2::textInputOpened @ 0x10030d148
// > SecretLayer4::updateSearchLabel @ 0x100354d64
// > SecretLayer4::textInputOpened @ 0x100355e98
// > SetupPulsePopup::updateTextInputLabel @ 0x1003b68d8
// > SetupPulsePopup::updateCopyColorTextInputLabel @ 0x1003b69cc
// > SetupPulsePopup::colorSelectClosed @ 0x1003b7064
// > SetupPulsePopup::colorSelectClosed @ 0x1003b70fc
// > SecretLayer::updateSearchLabel @ 0x1003bdcc4
// > SecretLayer::textInputOpened @ 0x1003bf348
// > ColorSelectPopup::updateTextInputLabel @ 0x10041f15c
// > ColorSelectPopup::updateCopyColorTextInputLabel @ 0x10041f3dc
// > ColorSelectPopup::colorSelectClosed @ 0x1004209b0
// > ColorSelectPopup::colorSelectClosed @ 0x100420a50
//
// 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 __fastcall CCTextInputNode::updateLabel(CCTextInputNode *a1, std::string *a2)
{
cocos2d::CCLabelBMFont *m_textLabel; // x8
_BOOL4 v5; // w0
_BOOL4 v6; // w21
const std::string::value_type *p_m_caption; // x1
unsigned __int64 i; // x22
unsigned __int64 size; // x8
cocos2d::CCLabelBMFont *v10; // x0
char *v11; // x0
bool v12; // w20
cocos2d::CCTextFieldTTF *m_textField; // x8
int m_uCursorPos; // w1
__int64 m_textArea; // x21
void *v16[2]; // [xsp+8h] [xbp-68h] BYREF
char v17; // [xsp+1Fh] [xbp-51h]
void *v18[2]; // [xsp+20h] [xbp-50h] BYREF
char v19; // [xsp+37h] [xbp-39h]
std::string __p; // [xsp+38h] [xbp-38h] BYREF
m_textLabel = a1->m_textLabel;
if ( m_textLabel )
{
m_textLabel->m_nExtraKerning = a1->m_kerningAmount;
}
else if ( !a1->m_textArea )
{
return;
}
sub_100009900(&__p, "");
v5 = sub_1000045BC(a2, &__p);
v6 = v5;
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
{
operator delete(__p.__r_.__value_.__l.__data_);
if ( v6 )
goto LABEL_6;
LABEL_10:
if ( a1->m_usePasswordChar )
{
sub_100009900(&__p, "");
for ( i = 0; ; ++i )
{
size = SHIBYTE(a2->__r_.__value_.__r.__words[2]);
if ( (size & 0x8000000000000000LL) != 0 )
size = a2->__r_.__value_.__l.__size_;
if ( size <= i )
break;
std::string::append(&__p, "•");
}
std::string::operator=(a2, &__p);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
}
goto LABEL_18;
}
if ( !v5 )
goto LABEL_10;
LABEL_6:
p_m_caption = (const std::string::value_type *)&a1->m_caption;
if ( a1->m_caption.m_data.m_short.shortStorage.__elems_[22] < 0 )
p_m_caption = *(const std::string::value_type **)p_m_caption;
std::string::assign(a2, p_m_caption);
LABEL_18:
v10 = a1->m_textLabel;
if ( v10 )
{
if ( SHIBYTE(a2->__r_.__value_.__r.__words[2]) < 0 )
a2 = (std::string *)a2->__r_.__value_.__r.__words[0];
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v10->setString)(v10, a2);
}
else
{
m_textArea = (__int64)a1->m_textArea;
if ( m_textArea )
{
if ( SHIBYTE(a2->__r_.__value_.__r.__words[2]) < 0 )
a2 = (std::string *)a2->__r_.__value_.__r.__words[0];
sub_100009900(v18, (char *)a2);
TextArea::setString(m_textArea, (const void **)v18);
if ( v19 < 0 )
operator delete(v18[0]);
}
}
CCTextInputNode::refreshLabel(a1);
v11 = (char *)((__int64 (__fastcall *)(cocos2d::CCTextFieldTTF *))a1->m_textField->getString)(a1->m_textField);
sub_100009900(&__p, v11);
sub_100009900(v16, "");
v12 = sub_1000045BC(&__p, v16);
if ( v17 < 0 )
operator delete(v16[0]);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
m_textField = a1->m_textField;
if ( v12 )
{
m_uCursorPos = -1;
m_textField->m_uCursorPos = -1;
}
else
{
m_uCursorPos = m_textField->m_uCursorPos;
}
CCTextInputNode::updateBlinkLabelToChar(a1, m_uCursorPos);
}