//
// IDNameBrowserPopup::updateConflictLabel from 0x78fbc0 to 0x78fd32 (370 bytes)
//
// 7 xrefs:
// > IDNameBrowserPopup::onFormArrowLeft @ 0x78fd6c
// > IDNameBrowserPopup::onFormArrowRight @ 0x78fd9a
// > IDNameBrowserPopup::onFormNextFree @ 0x78ff8e
// > IDNameBrowserPopup::onEditRow @ 0x790086
// > IDNameBrowserPopup::textChanged @ 0x79335c
// > IDNameBrowserPopup::onDeleteRow @ 0x7933fc
// > IDNameBrowserPopup::onFormAdd @ 0x7935c8
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:59:40 +0000
//
GameManager *__fastcall IDNameBrowserPopup::updateConflictLabel(GameManager *this)
{
GameManager *v1; // r4
GameManager *v2; // r0
GameManager *v3; // r0
int v4; // r3
LevelSettingsObject *v5; // r9
int v6; // r1
const char *v7; // r2
signed int FormID; // r8
char *v9; // r2
int v10; // r3
int v11; // r3
int IDByName; // r0
void (*v13)(void); // r3
void (*v14)(void); // r3
const char *v15; // r3
int v16[3]; // [sp+Ch] [bp-A0h] BYREF
int v17; // [sp+18h] [bp-94h] BYREF
int v18; // [sp+1Ch] [bp-90h]
const char *v19; // [sp+20h] [bp-8Ch]
_BYTE v20[128]; // [sp+24h] [bp-88h] BYREF
v1 = this;
if ( *((_DWORD *)this + 139) )
{
v2 = (GameManager *)GameManager::sharedState(this);
if ( !*((_DWORD *)v2 + 102) )
return (GameManager *)(*(int (__fastcall **)(_DWORD, void *))(**((_DWORD **)v1 + 139) + 464))(
*((_DWORD *)v1 + 139),
&unk_B6B226);
v3 = (GameManager *)GameManager::sharedState(v2);
if ( !*(_DWORD *)(*((_DWORD *)v3 + 102) + 2084) )
return (GameManager *)(*(int (__fastcall **)(_DWORD, void *))(**((_DWORD **)v1 + 139) + 464))(
*((_DWORD *)v1 + 139),
&unk_B6B226);
v4 = *(_DWORD *)(GameManager::sharedState(v3) + 408);
v5 = *(LevelSettingsObject **)(v4 + 2084);
FormID = IDNameBrowserPopup::getFormID(v1, v6, v7, v4);
if ( *((_DWORD *)v1 + 138) )
{
CCTextInputNode::getString((CCTextInputNode *)&v17, *((_DWORD *)v1 + 138));
}
else
{
v17 = 0;
v18 = 0;
v19 = nullptr;
std::string::__init(&v17, &unk_B6B226, 0);
}
LevelSettingsObject::sanitizeIDName(v16, (unsigned __int8 *)&v17, v9, v10);
std::string::~string((int)&v17);
if ( (v16[0] & 1) != 0 )
v11 = v16[1];
else
v11 = (int)LOBYTE(v16[0]) >> 1;
if ( v11 && (IDByName = LevelSettingsObject::findIDByName(v5, (int)v16, *((_DWORD *)v1 + 132)), IDByName > 0) )
{
if ( IDByName != FormID )
{
sub_993B88(v20, 64, "Name used by ID %d", IDByName);
v13 = *(void (**)(void))(**((_DWORD **)v1 + 139) + 464);
LABEL_17:
v13();
return (GameManager *)std::string::~string((int)v16);
}
}
else if ( FormID <= 0 )
{
v13 = *(void (**)(void))(**((_DWORD **)v1 + 139) + 464);
goto LABEL_17;
}
LevelSettingsObject::getIDName((LevelSettingsObject *)&v17, (int)v5, FormID, *((_DWORD *)v1 + 132));
if ( (v17 & 1) != 0 )
{
if ( !v18 )
goto LABEL_22;
v15 = v19;
}
else
{
if ( !((unsigned __int8)v17 >> 1) )
{
LABEL_22:
v14 = *(void (**)(void))(**((_DWORD **)v1 + 139) + 464);
LABEL_26:
v14();
std::string::~string((int)&v17);
return (GameManager *)std::string::~string((int)v16);
}
v15 = (char *)&v17 + 1;
}
sub_993B88(v20, 128, "ID %d already named \"%s\" - Add will rename it", FormID, v15);
v14 = *(void (**)(void))(**((_DWORD **)v1 + 139) + 464);
goto LABEL_26;
}
return this;
}