//
// CustomizeObjectLayer::textChanged from 0x1001f9430 to 0x1001f9621 (497 bytes)
//
// 2 xrefs:
// > sub_1001F9670 @ 0x1001f967c
// > ??> @ 0x1008d98a8
//
// 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 CustomizeObjectLayer::textChanged(CustomizeObjectLayer *a1, CCTextInputNode *a2)
{
double v2; // xmm0_8
int v3; // eax
GameObject *m_targetObject; // rbx
char *v5; // r14
char *v6; // r14
cocos2d::CCString *v7; // rax
const char *CString; // rax
int m_customColorChannel; // esi
const char *v10; // rax
cocos2d::CCString *v11; // rax
const std::string::value_type *v12; // rsi
size_t v13; // rax
size_t v14; // r15
char *v15; // r12
size_t v16; // r13
char v17; // [rsp+0h] [rbp-60h]
char v18; // [rsp+0h] [rbp-60h]
_QWORD __dst[2]; // [rsp+8h] [rbp-58h] BYREF
void *__p; // [rsp+18h] [rbp-48h]
char *v21[2]; // [rsp+20h] [rbp-40h] BYREF
char *__s; // [rsp+30h] [rbp-30h]
if ( a1->m_disableTextDelegate )
return;
v3 = ((__int64 (__fastcall *)(CCTextInputNode *))a2->getTag)(a2);
if ( v3 == 1 )
{
m_targetObject = a1->m_targetObject;
CCTextInputNode::getString(v21, (__int64)a2, v2);
if ( ((__int64)v21[0] & 1) != 0 )
v5 = __s;
else
v5 = (char *)v21 + 1;
v13 = strlen(v5);
if ( v13 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v2);
v14 = v13;
if ( v13 >= 0x17 )
{
v16 = 26;
if ( (v13 | 7) != 0x17 )
v16 = (v13 | 7) + 1;
v15 = (char *)operator new(v16);
__p = v15;
__dst[0] = v16 | 1;
__dst[1] = v14;
}
else
{
LOBYTE(__dst[0]) = 2 * v13;
v15 = (char *)__dst + 1;
if ( !v13 )
goto LABEL_24;
}
memmove(v15, v5, v14);
LABEL_24:
v15[v14] = 0;
TextGameObject::updateTextObject(m_targetObject, __dst, 0);
if ( (__dst[0] & 1) != 0 )
operator delete(__p);
if ( ((__int64)v21[0] & 1) != 0 )
operator delete(__s);
return;
}
if ( !v3 )
{
CCTextInputNode::getString(v21, (__int64)a2, v2);
if ( ((__int64)v21[0] & 1) != 0 )
{
v6 = __s;
a1->m_customColorChannel = atoi(__s);
operator delete(v6);
}
else
{
a1->m_customColorChannel = atoi((const char *)v21 + 1);
}
v7 = (cocos2d::CCString *)sub_1007AB580("%i", v17);
CString = cocos2d::CCString::getCString(v7);
ButtonSprite::setString(a1->m_customColorButtonSprite, CString);
CustomizeObjectLayer::updateSelected(a1, a1->m_customColorChannel);
CustomizeObjectLayer::updateColorSprite(a1);
m_customColorChannel = a1->m_customColorChannel;
if ( m_customColorChannel < 1000 )
{
if ( m_customColorChannel <= 0 )
{
v12 = " ";
goto LABEL_14;
}
v11 = (cocos2d::CCString *)sub_1007AB580("%i", v18);
v10 = cocos2d::CCString::getCString(v11);
}
else
{
v10 = GJSpecialColorSelect::textForColorIdx(m_customColorChannel);
}
v12 = v10;
LABEL_14:
((void (__fastcall *)(cocos2d::CCLabelBMFont *, const std::string::value_type *))a1->m_selectedColorLabel->setString)(
a1->m_selectedColorLabel,
v12);
}
}