//
// SetTextPopup::create from 0x8d3c1c to 0x8d4018 (1020 bytes)
//
// 4 xrefs:
// > LevelBrowserLayer::onSearch @ 0x6e709c
// > SetFolderPopup::onSetFolderName @ 0x8d40d8
// > MusicBrowser::onSearch @ 0xa5a500
// > ??> @ 0x81810
//
// 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
//
SetTextPopup *__fastcall SetTextPopup::create(
float a1,
__int64 a2,
__int64 a3,
int a4,
__int64 a5,
__int64 a6,
unsigned __int8 a7)
{
SetTextPopup *v10; // x19
int v11; // w22
cocos2d::CCPoint *p_m_textOffset; // x0
void *v13; // x0
char *v14; // x0
void *v15; // x0
SetTextPopup_vtbl *v16; // x1
SetTextPopup *v17; // x0
unsigned int *v19; // x2
int v20; // w1
unsigned int *v21; // x1
int v22; // w2
unsigned int *p_m_caption; // x1
int m_data; // w2
unsigned int *v25; // x1
int v26; // w2
__int64 v27; // [xsp+78h] [xbp+78h] BYREF
const char *v28; // [xsp+80h] [xbp+80h] BYREF
__int64 v29; // [xsp+88h] [xbp+88h] BYREF
ButtonSprite *v30; // [xsp+90h] [xbp+90h] BYREF
v10 = (SetTextPopup *)operator new(0x2A0u);
cocos2d::CCLayerColor::CCLayerColor(v10);
v10->m_controlConnected = -1;
v10->m_joystickConnected = -1;
v10->m_buttonMenu = nullptr;
v10->m_alertProtocol = nullptr;
v10->m_scene = nullptr;
v10->m_reverseKeyBack = 0;
v10->m_mainLayer = nullptr;
v10->m_ZOrder = 0;
v10->m_noElasticity = 0;
v10->m_button1 = nullptr;
v10->m_button2 = nullptr;
v10->m_scrollingLayer = nullptr;
v10->m_containsBorder = 0;
v10->m_noAction = 0;
v10->m_forcePrioRegistered = 0;
v10->m_input = nullptr;
v10->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (SetTextPopup_vtbl *)&off_119C180;
v10->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCTouchDelegate::__vftable = (cocos2d::CCTouchDelegate_vtbl *)off_119C6B0;
v10->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCAccelerometerDelegate::__vftable = (cocos2d::CCAccelerometerDelegate_vtbl *)&off_119C720;
v10->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCKeypadDelegate::__vftable = (cocos2d::CCKeypadDelegate_vtbl *)&off_119C738;
v10->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCKeyboardDelegate::__vftable = (cocos2d::CCKeyboardDelegate_vtbl *)&off_119C758;
v10->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCMouseDelegate::__vftable = (cocos2d::CCMouseDelegate_vtbl *)off_119C778;
v10->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCRGBAProtocol::__vftable = (cocos2d::CCRGBAProtocol_vtbl *)&off_119C7A0;
v10->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCBlendProtocol::__vftable = (cocos2d::CCBlendProtocol_vtbl *)&off_119C820;
v10->TextInputDelegate::__vftable = (TextInputDelegate_vtbl *)&off_119C840;
v10->m_disableDelegate = 0;
v10->m_cancelled = 0;
v10->m_delegate = nullptr;
v10->m_value.m_data.m_data = (stl::StringData::Internal *)&byte_124B6C8;
sub_D18D28(&v27);
sub_D18D28(&v28);
sub_D18D28(&v29);
sub_D18D28(&v30);
v11 = (unsigned __int8)SetTextPopup::init(v10, (__int64)&v27, &v28, a4, a1, (__int64)&v29, &v30, a7);
p_m_textOffset = &v30[-1].m_textOffset;
if ( &v30[-1].m_textOffset != (cocos2d::CCPoint *)&qword_124B6B0 )
{
if ( &pthread_create )
{
p_m_caption = (unsigned int *)&v30[-1].m_caption;
do
m_data = __ldaxr(p_m_caption);
while ( __stlxr(m_data - 1, p_m_caption) );
}
else
{
m_data = (int)v30[-1].m_caption.m_data.m_data;
LODWORD(v30[-1].m_caption.m_data.m_data) = m_data - 1;
}
if ( m_data <= 0 )
operator delete(p_m_textOffset);
}
v13 = (void *)(v29 - 24);
if ( (__int64 *)(v29 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v25 = (unsigned int *)(v29 - 8);
do
v26 = __ldaxr(v25);
while ( __stlxr(v26 - 1, v25) );
}
else
{
v26 = *(_DWORD *)(v29 - 8);
*(_DWORD *)(v29 - 8) = v26 - 1;
}
if ( v26 <= 0 )
operator delete(v13);
}
v14 = (char *)(v28 - 24);
if ( v28 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v21 = (unsigned int *)(v28 - 8);
do
v22 = __ldaxr(v21);
while ( __stlxr(v22 - 1, v21) );
}
else
{
v22 = *((_DWORD *)v28 - 2);
*((_DWORD *)v28 - 2) = v22 - 1;
}
if ( v22 <= 0 )
operator delete(v14);
}
v15 = (void *)(v27 - 24);
if ( (__int64 *)(v27 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v19 = (unsigned int *)(v27 - 8);
do
v20 = __ldaxr(v19);
while ( __stlxr(v20 - 1, v19) );
}
else
{
v20 = *(_DWORD *)(v27 - 8);
*(_DWORD *)(v27 - 8) = v20 - 1;
}
if ( v20 <= 0 )
operator delete(v15);
}
if ( v11 )
{
cocos2d::CCObject::autorelease(v10);
}
else
{
v16 = v10->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v17 = v10;
v10 = nullptr;
v16->~SetTextPopup_0(v17);
}
return v10;
}