//
// EditLevelLayer::textInputClosed from 0x1000eb800 to 0x1000eb9dc (476 bytes)
//
// 2 xrefs:
// > sub_1000EBA88 @ 0x1000eba8c
// > ??> @ 0x1007824a0
//
// 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::textInputClosed(EditLevelLayer *a1, CCTextInputNode *a2)
{
int v4; // w0
GJGameLevel *v5; // x20
GJGameLevel *m_level; // x19
GameManager *v7; // x19
void *v8; // x0
char *v9; // x1
std::string v10; // [xsp+0h] [xbp-D0h] BYREF
std::string __dst; // [xsp+20h] [xbp-B0h] BYREF
std::string __str; // [xsp+38h] [xbp-98h] BYREF
_QWORD v13[2]; // [xsp+50h] [xbp-80h] BYREF
char v14; // [xsp+67h] [xbp-69h]
void *__p[2]; // [xsp+68h] [xbp-68h] BYREF
char v16; // [xsp+7Fh] [xbp-51h]
std::string v17; // [xsp+80h] [xbp-50h] BYREF
std::string v18; // [xsp+98h] [xbp-38h] BYREF
v4 = ((__int64 (__fastcall *)(CCTextInputNode *))a2->getTag)(a2);
if ( v4 == 3 )
{
CCTextInputNode::getString(&v18, a2);
v7 = GameManager::sharedState();
if ( SHIBYTE(v18.__r_.__value_.__r.__words[2]) < 0 )
sub_1000097D0(&v10, v18.__r_.__value_.__l.__data_, v18.__r_.__value_.__l.__size_);
else
v10 = v18;
std::string::operator=((std::string *)&v7->m_playerName, &v10);
if ( (SHIBYTE(v10.__r_.__value_.__r.__words[2]) & 0x80000000) == 0 )
goto LABEL_29;
v8 = (void *)v10.__r_.__value_.__r.__words[0];
goto LABEL_28;
}
if ( v4 == 2 )
{
CCTextInputNode::getString(&v18, a2);
m_level = a1->m_level;
if ( SHIBYTE(v18.__r_.__value_.__r.__words[2]) < 0 )
sub_1000097D0(&__dst, v18.__r_.__value_.__l.__data_, v18.__r_.__value_.__l.__size_);
else
__dst = v18;
LevelTools::base64EncodeString(&__str, &__dst);
std::string::operator=((std::string *)&m_level->m_levelDesc, &__str);
if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__str.__r_.__value_.__l.__data_);
if ( (SHIBYTE(__dst.__r_.__value_.__r.__words[2]) & 0x80000000) == 0 )
goto LABEL_29;
v8 = (void *)__dst.__r_.__value_.__r.__words[0];
goto LABEL_28;
}
if ( v4 != 1 )
return;
CCTextInputNode::getString(&v18, a2);
v5 = a1->m_level;
if ( SHIBYTE(v18.__r_.__value_.__r.__words[2]) < 0 )
sub_1000097D0(&v17, v18.__r_.__value_.__l.__data_, v18.__r_.__value_.__l.__size_);
else
v17 = v18;
std::string::operator=((std::string *)&v5->m_levelName, &v17);
if ( SHIBYTE(v17.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v17.__r_.__value_.__l.__data_);
CCTextInputNode::getString(v13, a2);
if ( v14 >= 0 )
v9 = (char *)v13;
else
v9 = (char *)v13[0];
sub_100009900(__p, v9);
CCTextInputNode::updateLabel(a2, __p);
if ( v16 < 0 )
operator delete(__p[0]);
if ( v14 < 0 )
{
v8 = (void *)v13[0];
LABEL_28:
operator delete(v8);
}
LABEL_29:
if ( SHIBYTE(v18.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v18.__r_.__value_.__l.__data_);
}