//
// LevelBrowserLayer::cellPerformedAction from 0x4a90dc to 0x4a9282 (422 bytes)
//
// 2 xrefs:
// > `non-virtual thunk to'LevelBrowserLayer::cellPerformedAction @ 0x4a92b8
// > LevelListLayer::cellPerformedAction @ 0x6d5d1c
//
// 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:49:57 +0000
//
int (__fastcall ***__fastcall LevelBrowserLayer::cellPerformedAction(
_DWORD *a1,
LevelCell *this,
int a3,
int a4))(_DWORD)
{
GJSmartTemplate *v6; // r1
int v7; // r0
int (__fastcall ***result)(_DWORD); // r0
cocos2d::CCObject *v9; // r6
GameStatsManager *v10; // r7
int v11; // r1
GameStatsManager *v12; // r8
GameStatsManager *v13; // r0
int Stat; // r0
const char *v15; // r2
cocos2d::CCString *v16; // r0
char *CString; // r0
const char *v18; // r8
size_t v19; // r0
int *v20; // r0
GJGameLevel *v21; // r2
cocos2d::CCObject *v22; // r0
int v23; // r5
char v24[4]; // [sp+Ch] [bp-1Ch] BYREF
int v25; // [sp+10h] [bp-18h]
const char *v26; // [sp+14h] [bp-14h]
int v27[3]; // [sp+18h] [bp-10h] BYREF
if ( a3 == 20 )
{
if ( a4 == 1 )
{
LevelBrowserLayer::reloadAllObjects((CCMenuItemToggler *)a1);
return nullptr;
}
if ( a4 != 6 )
return nullptr;
(*(void (__fastcall **)(_DWORD *, _DWORD))(*a1 + 664))(a1, 0);
*(_DWORD *)(*((_DWORD *)this + 105) + 124) = 0;
v7 = SetupSmartTemplateLayer::create(*((SetupSmartTemplateLayer **)this + 105), v6);
(*(void (__fastcall **)(int))(*(_DWORD *)v7 + 656))(v7);
return (int (__fastcall ***)(_DWORD))(&dword_0 + 1);
}
if ( (unsigned int)(a4 - 9) <= 1 )
{
if ( a4 == 10 )
{
LevelBrowserLayer::claimRecallChest((LevelBrowserLayer *)a1, (GJGameLevel **)this);
}
else
{
v9 = (cocos2d::CCObject *)LevelCell::recallLevel((GJGameLevel **)this);
v10 = (GameStatsManager *)(*((_DWORD *)v9 + 186) - *((_DWORD *)v9 + 187));
v12 = (GameStatsManager *)GameStatsManager::dailyRecallPrice(v10, v11);
v13 = (GameStatsManager *)GameStatsManager::sharedState(v12);
Stat = GameStatsManager::getStat(v13, "21");
if ( Stat >= (int)v12 )
{
cocos2d::CCObject::retain(v9);
v22 = (cocos2d::CCObject *)a1[150];
if ( v22 )
cocos2d::CCObject::release(v22);
a1[150] = v9;
v23 = DailyRecallUnlockPopup::create((DailyRecallUnlockPopup *)(a1 + 111), v9, v21);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v23 + 36))(v23, 7);
(*(void (__fastcall **)(int))(*(_DWORD *)v23 + 656))(v23);
}
else
{
if ( (int)v10 > 200000 )
{
v15 = "Event Level";
}
else if ( (int)v10 > 100000 )
{
v15 = "Weekly Demon";
}
else
{
v15 = "Daily Level";
}
*(_DWORD *)v24 = 0;
v25 = 0;
v26 = nullptr;
if ( v12 == (GameStatsManager *)((char *)&dword_0 + 1) )
v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"You need a key to\nunlock this %s",
v15);
else
v16 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"You need %i more keys to\nunlock this %s",
(const char *)v12 - Stat,
v15);
CString = (char *)cocos2d::CCString::getCString(v16);
std::string::assign((int *)v24, CString);
if ( (v24[0] & 1) != 0 )
v18 = v26;
else
v18 = &v24[1];
memset(v27, 0, sizeof(v27));
v19 = strlen(v18);
std::string::__init(v27, v18, v19);
v20 = FLAlertLayer::create(
0,
(cocos2d::CCLabelBMFont *)"Locked",
(int)v27,
(ButtonSprite *)"OK",
nullptr,
300.0);
(*(void (__fastcall **)(int *))(*v20 + 656))(v20);
std::string::~string((int)v27);
std::string::~string((int)v24);
}
}
return (int (__fastcall ***)(_DWORD))(&dword_0 + 1);
}
result = (int (__fastcall ***)(_DWORD))a1[144];
if ( result )
return (int (__fastcall ***)(_DWORD))(**result)(result);
return result;
}