//
// EditLevelLayer::FLAlert_Clicked from 0x7f1aa0 to 0x7f1d7c (732 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'EditLevelLayer::FLAlert_Clicked @ 0x7f1d80
// > ??> @ 0xa93c0
// > ??> @ 0x143c948
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 12:54:36 +0000
//
__int64 __fastcall EditLevelLayer::FLAlert_Clicked(GJGameLevel **this, FLAlertLayer *a2, unsigned __int8 a3)
{
int v5; // w21
GameManager *v7; // x0
GameManager *v8; // x0
GameLevelManager *v9; // x0
GameLevelManager *v10; // x0
__int64 v11; // x23
__int64 v12; // x0
int v13; // w1
int v14; // w19
unsigned int v15; // w19
__int64 v16; // x1
int updated; // w19
__int64 v18; // x0
__int64 v19; // x0
char v20; // w1
__int64 v21; // [xsp+40h] [xbp+40h] BYREF
__int64 v22; // [xsp+48h] [xbp+48h]
void *v23; // [xsp+50h] [xbp+50h]
v5 = a3;
if ( (*(unsigned int (__fastcall **)(FLAlertLayer *))(*(_QWORD *)a2 + 64LL))(a2) == 4 && v5 )
{
EditLevelLayer::onDelete((EditLevelLayer *)this);
}
else if ( (*(unsigned int (__fastcall **)(FLAlertLayer *))(*(_QWORD *)a2 + 64LL))(a2) == 7 && v5 )
{
EditLevelLayer::onClone(this);
}
else if ( (*(unsigned int (__fastcall **)(FLAlertLayer *))(*(_QWORD *)a2 + 64LL))(a2) == 8 && v5 )
{
EditLevelLayer::onMoveToTop(this);
}
else if ( (*(unsigned int (__fastcall **)(FLAlertLayer *))(*(_QWORD *)a2 + 64LL))(a2) == 12 && v5 )
{
EditLevelLayer::onMoveToBottom(this);
}
else if ( (*(unsigned int (__fastcall **)(FLAlertLayer *))(*(_QWORD *)a2 + 64LL))(a2) == 10 )
{
EditLevelLayer::onShare((EditLevelLayer *)this, nullptr);
}
else
{
v7 = (GameManager *)(*(__int64 (__fastcall **)(FLAlertLayer *))(*(_QWORD *)a2 + 64LL))(a2);
if ( (_DWORD)v7 == 5 )
{
if ( v5 )
{
v8 = (GameManager *)GameManager::sharedState(v7);
GameManager::openEditorGuide(v8);
}
else
{
EditLevelLayer::onEdit(this, nullptr);
}
}
else if ( (*(unsigned int (__fastcall **)(FLAlertLayer *))(*(_QWORD *)a2 + 64LL))(a2) == 9 && v5 )
{
v9 = (GameLevelManager *)EditLevelLayer::closeTextInputs(this);
v10 = (GameLevelManager *)GameLevelManager::sharedState(v9);
*((_QWORD *)v10 + 170) = this + 53;
v11 = GameLevelManager::sharedState(v10);
v12 = (__int64)*(this + 59);
v13 = *(_DWORD *)(v12 + 328);
v14 = *(_DWORD *)(v12 + 332);
v21 = 0;
v22 = 0;
v15 = v13 - v14;
v23 = nullptr;
if ( (*(_BYTE *)(v12 + 368) & 1) != 0 )
{
std::string::__init(&v21, *(void **)(v12 + 384), *(_QWORD *)(v12 + 376));
}
else
{
v16 = *(_QWORD *)(v12 + 376);
v21 = *(_QWORD *)(v12 + 368);
v22 = v16;
v23 = *(void **)(v12 + 384);
}
updated = (unsigned __int8)GameLevelManager::updateDescription(v11, v15, &v21);
if ( (v21 & 1) != 0 )
operator delete(v23);
if ( updated )
{
v18 = (__int64)*(this + 66);
if ( v18 )
{
*(_QWORD *)(v18 + 664) = 0;
*(this + 66) = nullptr;
}
v21 = 0;
v22 = 0;
v23 = nullptr;
std::string::__init(&v21, "Updating description...", 0x17u);
v19 = UploadActionPopup::create(this + 54, &v21);
v20 = v21;
*(this + 66) = (GJGameLevel *)v19;
if ( (v20 & 1) != 0 )
{
operator delete(v23);
v19 = (__int64)*(this + 66);
}
(*(void (__fastcall **)(__int64))(*(_QWORD *)v19 + 1312LL))(v19);
}
}
else if ( (*(unsigned int (__fastcall **)(FLAlertLayer *))(*(_QWORD *)a2 + 64LL))(a2) == 11 )
{
if ( v5 )
*((_BYTE *)this + 536) = 1;
else
GJGameLevel::clearPlatformerSave(*(this + 59));
EditLevelLayer::onPlay((EditLevelLayer *)this, nullptr);
}
}
return _stack_chk_guard;
}