//
// EditLevelLayer::textChanged from 0x1001fda40 to 0x1001fdb5b (283 bytes)
//
// 2 xrefs:
// > sub_1001FDBA0 @ 0x1001fdbac
// > ??> @ 0x1008da810
//
// 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 EditLevelLayer::textChanged(EditLevelLayer *a1, CCTextInputNode *a2)
{
double v2; // xmm0_8
int v3; // eax
GJGameLevel *m_level; // rbx
char *v5; // r14
size_t v6; // rax
std::string::size_type v7; // r15
char *data; // r12
size_t v9; // r13
std::string __dst; // [rsp+8h] [rbp-58h] BYREF
char *v11[2]; // [rsp+20h] [rbp-40h] BYREF
char *__s; // [rsp+30h] [rbp-30h]
v3 = ((__int64 (__fastcall *)(CCTextInputNode *))a2->getTag)(a2);
if ( v3 == 1 )
{
m_level = a1->m_level;
CCTextInputNode::getString(v11, (__int64)a2, v2);
if ( ((__int64)v11[0] & 1) != 0 )
v5 = __s;
else
v5 = (char *)v11 + 1;
v6 = strlen(v5);
if ( v6 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100006BF0(v2);
v7 = v6;
if ( v6 >= 0x17 )
{
v9 = 26;
if ( (v6 | 7) != 0x17 )
v9 = (v6 | 7) + 1;
data = (char *)operator new(v9);
__dst.__r_.__value_.__r.__words[2] = (std::string::size_type)data;
__dst.__r_.__value_.__r.__words[0] = v9 | 1;
__dst.__r_.__value_.__l.__size_ = v7;
}
else
{
__dst.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v6);
data = __dst.__r_.__value_.__s.__data_;
if ( !v6 )
{
LABEL_15:
data[v7] = 0;
std::string::operator=((std::string *)&m_level->m_levelName, &__dst);
if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst.__r_.__value_.__l.__data_);
goto LABEL_17;
}
}
memmove(data, v5, v7);
goto LABEL_15;
}
if ( v3 != 2 )
return;
CCTextInputNode::getString(v11, (__int64)a2, v2);
LABEL_17:
if ( ((__int64)v11[0] & 1) != 0 )
operator delete(__s);
}