//
// EditLevelLayer::FLAlert_Clicked from 0x1000ec098 to 0x1000ec2ec (596 bytes)
//
// 2 xrefs:
// > sub_1000EC3F8 @ 0x1000ec3fc
// > ??> @ 0x100782490
//
// 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::FLAlert_Clicked(EditLevelLayer *a1, FLAlertLayer *a2, bool a3)
{
_BOOL4 v3; // w20
cocos2d::CCObject *v9; // x1
LocalLevelManager *v10; // x0
cocos2d::CCObject *v11; // x1
GameManager *v13; // x0
GameLevelManager *v14; // x20
GJGameLevel *m_level; // x8
int v16; // w21
_BOOL4 updated; // w20
UploadActionPopup *m_descriptionPopup; // x8
UploadActionPopup *v19; // x0
void *v20[2]; // [xsp+8h] [xbp-58h] BYREF
char v21; // [xsp+1Fh] [xbp-41h]
void *__p[2]; // [xsp+20h] [xbp-40h] BYREF
char *longStorage; // [xsp+30h] [xbp-30h]
v3 = a3;
if ( ((unsigned int (__fastcall *)(FLAlertLayer *))a2->getTag)(a2) == 4 && v3 )
{
EditLevelLayer::onDelete(a1);
return;
}
if ( ((unsigned int (__fastcall *)(FLAlertLayer *))a2->getTag)(a2) == 7 && v3 )
{
EditLevelLayer::onClone(a1);
return;
}
if ( ((unsigned int (__fastcall *)(FLAlertLayer *))a2->getTag)(a2) == 8 && v3 )
{
v10 = LocalLevelManager::sharedState();
LocalLevelManager::moveLevelToTop(v10, a1->m_level);
return;
}
if ( ((unsigned int (__fastcall *)(FLAlertLayer *))a2->getTag)(a2) == 10 )
{
EditLevelLayer::onShare(a1, v9);
return;
}
if ( ((unsigned int (__fastcall *)(FLAlertLayer *))a2->getTag)(a2) == 5 )
{
if ( !v3 )
{
EditLevelLayer::onEdit(a1, v11);
return;
}
goto LABEL_28;
}
if ( ((unsigned int (__fastcall *)(FLAlertLayer *))a2->getTag)(a2) != 9 || !v3 )
{
if ( ((unsigned int (__fastcall *)(FLAlertLayer *))a2->getTag)(a2) == 6 && v3 )
{
LABEL_28:
v13 = GameManager::sharedState();
GameManager::openEditorGuide(v13);
}
}
else
{
EditLevelLayer::closeTextInputs(a1);
GameLevelManager::sharedState()->m_uploadActionDelegate = &a1->UploadActionDelegate;
v14 = GameLevelManager::sharedState();
m_level = a1->m_level;
v16 = m_level->m_levelID.random - m_level->m_levelID.seed;
if ( m_level->m_levelDesc.m_data.m_short.shortStorage.__elems_[22] < 0 )
{
sub_1000097D0(__p, (void *)m_level->m_levelDesc.m_data.m_long.capacitym1, m_level->m_levelDesc.m_data.m_long.size);
}
else
{
*(_OWORD *)__p = *(_OWORD *)&m_level->m_levelDesc.m_data.m_short.sizex2;
longStorage = m_level->m_levelDesc.m_data.m_long.longStorage;
}
updated = GameLevelManager::updateDescription((__int64)v14, v16, (char *)__p);
if ( SHIBYTE(longStorage) < 0 )
operator delete(__p[0]);
if ( updated )
{
m_descriptionPopup = a1->m_descriptionPopup;
if ( m_descriptionPopup )
{
m_descriptionPopup->m_delegate = nullptr;
a1->m_descriptionPopup = nullptr;
}
sub_100009900(v20, "Updating description...");
v19 = (UploadActionPopup *)UploadActionPopup::create(&a1->UploadPopupDelegate, v20);
a1->m_descriptionPopup = v19;
if ( v21 < 0 )
{
operator delete(v20[0]);
v19 = a1->m_descriptionPopup;
}
((void (__fastcall *)(UploadActionPopup *))v19->show)(v19);
}
}
}