//
// LevelBrowserLayer::cellPerformedAction from 0x7fcb18 to 0x7fce00 (744 bytes)
//
// 4 xrefs:
// > `non-virtual thunk to'LevelBrowserLayer::cellPerformedAction @ 0x7fce08
// > LevelListLayer::cellPerformedAction @ 0xbaaaf8
// > ??> @ 0x85288
// > ??> @ 0x143e8f0
//
// 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:42 +0000
//
__int64 __fastcall LevelBrowserLayer::cellPerformedAction(LevelBrowserLayer *a1, LevelCell *this, int a3, int a4)
{
unsigned __int8 (__fastcall ***v5)(_QWORD); // x0
unsigned int v6; // w1
GJSmartTemplate *v8; // x1
__int64 v9; // x0
cocos2d::CCObject *v10; // x0
cocos2d::CCObject *v11; // x21
int v12; // w20
int v13; // w1
GameStatsManager *v14; // x0
int v15; // w22
GameStatsManager *v16; // x0
int Stat; // w0
const char *v18; // x2
cocos2d::CCString *v19; // x0
char *CString; // x0
const char *v21; // x1
size_t v22; // x0
__int64 v23; // x0
GJGameLevel *v24; // x2
LevelBrowserLayer *v25; // x4
cocos2d::CCObject *v26; // x0
__int64 v27; // x20
char *v29; // [xsp+38h] [xbp+38h]
__int64 v30[2]; // [xsp+48h] [xbp+48h] BYREF
void *v31; // [xsp+58h] [xbp+58h]
__int64 v32[2]; // [xsp+60h] [xbp+60h] BYREF
void *v33; // [xsp+70h] [xbp+70h]
if ( a3 == 20 )
{
if ( a4 == 1 )
{
LevelBrowserLayer::reloadAllObjects(a1);
return 0;
}
else
{
v6 = 0;
if ( a4 == 6 )
{
(*(void (__fastcall **)(LevelBrowserLayer *, _QWORD))(*(_QWORD *)a1 + 1328LL))(a1, 0);
*(_DWORD *)(*((_QWORD *)this + 69) + 196LL) = 0;
v9 = SetupSmartTemplateLayer::create(*((SetupSmartTemplateLayer **)this + 69), v8);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v9 + 1312LL))(v9);
return 1;
}
}
}
else if ( (unsigned int)(a4 - 9) <= 1 )
{
if ( a4 == 10 )
{
LevelBrowserLayer::claimRecallChest(a1, (GJGameLevel **)this);
return 1;
}
else
{
LevelCell::recallLevel((GJGameLevel **)this);
v11 = v10;
v12 = *((_DWORD *)v10 + 230) - *((_DWORD *)v10 + 231);
v14 = (GameStatsManager *)GameStatsManager::dailyRecallPrice((GameStatsManager *)(unsigned int)v12, v13);
v15 = (int)v14;
v16 = (GameStatsManager *)GameStatsManager::sharedState(v14);
Stat = GameStatsManager::getStat(v16, "21");
if ( v15 <= Stat )
{
cocos2d::CCObject::retain(v11);
v25 = a1;
v26 = *((cocos2d::CCObject **)a1 + 104);
if ( v26 )
{
cocos2d::CCObject::release(v26);
v25 = a1;
}
*((_QWORD *)v25 + 104) = v11;
v27 = DailyRecallUnlockPopup::create((LevelBrowserLayer *)((char *)v25 + 552), v11, v24);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v27 + 72LL))(v27, 7);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v27 + 1312LL))(v27);
return 1;
}
else
{
if ( v12 <= 200000 )
{
if ( v12 > (int)&elf_hash_bucket[24874] )
v18 = "Weekly Demon";
else
v18 = "Daily Level";
}
else
{
v18 = "Event Level";
}
v30[0] = 0;
v30[1] = 0;
v31 = nullptr;
if ( v15 == 1 )
v19 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"You need a key to\nunlock this %s",
v18);
else
v19 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"You need %i more keys to\nunlock this %s",
(const char *)(unsigned int)(v15 - Stat),
v18);
CString = (char *)cocos2d::CCString::getCString(v19);
std::string::assign(v30, CString);
v21 = (char *)v30 + 1;
if ( (v30[0] & 1) != 0 )
v21 = (const char *)v31;
v29 = (char *)v21;
v32[0] = 0;
v32[1] = 0;
v33 = nullptr;
v22 = strlen(v21);
std::string::__init(v32, v29, v22);
v23 = FLAlertLayer::create(
0,
(cocos2d::CCLabelBMFont *)"Locked",
(char *)v32,
(ButtonSprite *)"OK",
nullptr,
300.0);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v23 + 1312LL))(v23);
if ( (v32[0] & 1) != 0 )
operator delete(v33);
if ( (v30[0] & 1) != 0 )
operator delete(v31);
return 1;
}
}
}
else
{
v5 = *((unsigned __int8 (__fastcall ****)(_QWORD))a1 + 98);
if ( v5 )
return (**v5)(v5);
else
return 0;
}
return v6;
}