//
// LevelBadgePopup::init from 0x752390 to 0x7524f8 (360 bytes)
//
// 1 xrefs:
// > LevelBadgePopup::create @ 0x752594
//
// 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:58:52 +0000
//
int __fastcall LevelBadgePopup::init(LevelBadgePopup *this, int a2, bool a3)
{
int v6; // r5
int v7; // r9
int v8; // r3
cocos2d::CCLayer *v9; // r0
int v10; // r0
int v11; // r3
cocos2d::CCMenu *v12; // r0
int v13; // r0
LoadingCircle *v14; // r0
cocos2d::CCLayerColor *v15; // r0
int v16; // r3
cocos2d::CCString *v17; // r0
const char *CString; // r0
const char *v19; // r7
size_t v20; // r0
GJSearchObject *v21; // r7
char *Key; // r0
int *v23; // r0
GameLevelManager *v24; // r0
GameLevelManager *v25; // r0
GameLevelManager *v26; // r0
_BYTE v28[4]; // [sp+4h] [bp-18h] BYREF
int v29[3]; // [sp+8h] [bp-14h] BYREF
if ( a2 <= 0 )
return 0;
v28[0] = 0;
v28[1] = 0;
v28[2] = 0;
v28[3] = 0;
v7 = cocos2d::CCLayerColor::initWithColor(this, v28);
if ( !v7 )
return 0;
*((_DWORD *)this + 131) = a2;
*((_BYTE *)this + 528) = a3;
FLAlertLayer::incrementForcePrio(this);
v8 = *(_DWORD *)this;
*((_BYTE *)this + 468) = 1;
(*(void (__fastcall **)(LevelBadgePopup *, int))(v8 + 500))(this, 1);
v9 = (cocos2d::CCLayer *)(*(int (__fastcall **)(LevelBadgePopup *, int))(*(_DWORD *)this + 536))(this, 1);
v10 = cocos2d::CCLayer::create(v9);
v11 = *(_DWORD *)this;
*((_DWORD *)this + 115) = v10;
v12 = (cocos2d::CCMenu *)(*(int (__fastcall **)(LevelBadgePopup *, int))(v11 + 228))(this, v10);
v13 = cocos2d::CCMenu::create(v12);
*((_DWORD *)this + 111) = v13;
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v13, 10);
v14 = (LoadingCircle *)(*(int (__fastcall **)(_DWORD, void *))(**((_DWORD **)this + 111) + 92))(
*((_DWORD *)this + 111),
&unk_D2DF00);
*((_DWORD *)this + 125) = -1;
v15 = LoadingCircle::create(v14);
v16 = *((_DWORD *)this + 115);
*((_DWORD *)this + 140) = v15;
*((_DWORD *)v15 + 111) = v16;
*(_BYTE *)(*((_DWORD *)this + 140) + 448) = 0;
LoadingCircle::show(*((cocos2d::CCNode ***)this + 140));
v17 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i",
*((const char **)this + 131));
CString = (const char *)cocos2d::CCString::getCString(v17);
memset(v29, 0, sizeof(v29));
v19 = CString;
v20 = strlen(CString);
std::string::__init(v29, v19, v20);
v21 = (GJSearchObject *)GJSearchObject::create(0, (int)v29);
std::string::~string((int)v29);
if ( *((_BYTE *)this + 528) )
*((_DWORD *)v21 + 86) = 1;
Key = (char *)GJSearchObject::getKey(v21);
v23 = std::string::assign((int *)this + 137, Key);
v24 = (GameLevelManager *)GameLevelManager::sharedState((GameLevelManager *)v23);
*((_DWORD *)v24 + 205) = (char *)this + 520;
v6 = *((unsigned __int8 *)this + 528);
if ( *((_BYTE *)this + 528) )
{
v25 = (GameLevelManager *)GameLevelManager::sharedState(v24);
GameLevelManager::getLevelLists(v25, (const char **)v21);
}
else
{
v26 = (GameLevelManager *)GameLevelManager::sharedState(v24);
GameLevelManager::getOnlineLevels(v26, v21);
return v7;
}
return v6;
}