//
// NewsPopup::init from 0x6c30a4 to 0x6c35a8 (1284 bytes)
//
// 1 xrefs:
// > NewsPopup::create @ 0x6c18fe
//
// 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:56:52 +0000
//
GameManager *__fastcall NewsPopup::init(cocos2d::CCSize **this)
{
GameManager *v2; // r11
MusicDownloadManager *v3; // r0
int v4; // r0
MusicDownloadManager *NewsFeed; // r0
cocos2d::CCArray **v6; // r0
MusicDownloadManager *v7; // r0
int v8; // r0
int v9; // r6
void (__fastcall *v10)(int, _BYTE *); // r8
int v11; // r7
const char *v12; // r1
cocos2d::CCSprite *v13; // r6
float v14; // s15
float v15; // s14
void (__fastcall *v16)(cocos2d::CCSprite *, _BYTE *); // r9
const char *v17; // r2
int v18; // r6
void (__fastcall *v19)(int, _BYTE *); // r9
cocos2d::CCMenu *v20; // r0
cocos2d::CCSize *v21; // r0
const char *v22; // r1
int v23; // r9
int v24; // r9
void (__fastcall *v25)(int, _BYTE *); // r10
const char *v26; // r1
float v27; // s17
float v28; // s16
int v29; // r0
int v30; // r0
void (__fastcall *v31)(cocos2d::CCSize *, _BYTE *); // r10
const char *v32; // r1
cocos2d::CCSprite *v33; // r9
int v34; // r0
int v35; // r9
void (__fastcall *v36)(int, _BYTE *); // r10
cocos2d::CCLayerColor *v37; // r9
int v38; // r1
int v39; // r2
int v40; // r3
int *v41; // r0
const char *v42; // r2
cocos2d::CCSize *v43; // r0
int v44; // r6
void (__fastcall *v45)(int, _BYTE *); // r7
int v46; // r6
void (__fastcall *v47)(int, _BYTE *); // r7
GameManager *v48; // r0
cocos2d::CCSize *v50; // [sp+Ch] [bp-60h]
float v51[2]; // [sp+1Ch] [bp-50h] BYREF
float v52; // [sp+24h] [bp-48h] BYREF
float v53; // [sp+28h] [bp-44h]
_BYTE v54[8]; // [sp+2Ch] [bp-40h] BYREF
float v55[8]; // [sp+34h] [bp-38h] BYREF
_BYTE v56[16]; // [sp+54h] [bp-18h] BYREF
v2 = FLAlertLayer::init((FLAlertLayer *)this, 150);
if ( !v2 )
return v2;
v3 = (MusicDownloadManager *)(*((int (__fastcall **)(cocos2d::CCSize **, int))*this + 134))(this, 1);
*((_BYTE *)this + 468) = 1;
v4 = MusicDownloadManager::sharedState(v3);
NewsFeed = (MusicDownloadManager *)MusicDownloadManager::tryLoadNewsFeed(v4);
v6 = (cocos2d::CCArray **)MusicDownloadManager::sharedState(NewsFeed);
v7 = (MusicDownloadManager *)MusicDownloadManager::addMusicDownloadDelegate(v6, (MusicDownloadDelegate *)(this + 131));
v8 = MusicDownloadManager::sharedState(v7);
if ( *(_DWORD *)(v8 + 540) == *(_DWORD *)(v8 + 544) )
{
v8 = MusicDownloadManager::sharedState((MusicDownloadManager *)v8);
*(_BYTE *)(v8 + 560) = 0;
}
cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v8);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v51);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, v51[0] * 0.5, v51[1] * 0.5);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v56, 0.0, 0.0, 80.0, 80.0);
v9 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v56);
v10 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v9 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v56, 420.0, 280.0);
v10(v9, v56);
v11 = 0;
(*(void (__fastcall **)(int, float *))(*(_DWORD *)v9 + 92))(v9, &v52);
(*(void (__fastcall **)(_DWORD, int, int))(*(_DWORD *)*(this + 115) + 232))(*(this + 115), v9, -1);
do
{
v13 = (cocos2d::CCSprite *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"dailyLevelCorner_001.png",
v12);
(*(void (__fastcall **)(_DWORD, cocos2d::CCSprite *, int))(*(_DWORD *)*(this + 115) + 232))(*(this + 115), v13, 8);
if ( v11 == 2 )
{
cocos2d::CCSprite::setFlipX(v13, 1);
cocos2d::CCSprite::setFlipY(v13, 1);
v14 = 185.0;
goto LABEL_20;
}
if ( v11 == 3 )
{
cocos2d::CCSprite::setFlipX(v13, 1);
v14 = 185.0;
LABEL_12:
v15 = -116.0;
goto LABEL_13;
}
if ( v11 != 1 )
{
v14 = -185.0;
goto LABEL_12;
}
cocos2d::CCSprite::setFlipY(v13, 1);
v14 = -185.0;
LABEL_20:
v15 = 115.0;
LABEL_13:
++v11;
v16 = *(void (__fastcall **)(cocos2d::CCSprite *, _BYTE *))(*(_DWORD *)v13 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v56, v14 + v52, v15 + v53);
v16(v13, v56);
}
while ( v11 != 4 );
v18 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"News", "goldFont.fnt", v17);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v18 + 80))(v18, 1063675494);
v19 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v18 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v56, v52, (float)(v53 + 140.0) - 17.0);
v19(v18, v56);
v20 = (cocos2d::CCMenu *)(*(int (__fastcall **)(_DWORD, int, int))(*(_DWORD *)*(this + 115) + 232))(
*(this + 115),
v18,
3);
*(this + 125) = (cocos2d::CCSize *)-1;
v21 = (cocos2d::CCSize *)cocos2d::CCMenu::create(v20);
*(this + 111) = v21;
(*(void (__fastcall **)(cocos2d::CCSize *, void *))(*(_DWORD *)v21 + 92))(v21, &unk_D2D7C8);
(*(void (__fastcall **)(_DWORD, _DWORD, int))(*(_DWORD *)*(this + 115) + 232))(*(this + 115), *(this + 111), 10);
v23 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_closeBtn_001.png", v22);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v23 + 80))(v23, 1061997773);
LODWORD(v55[2]) = NewsPopup::onClose;
v55[3] = 0.0;
v24 = CCMenuItemSpriteExtra::create(v23, 0, (int)this, (int)NewsPopup::onClose, 0);
CCMenuItemSpriteExtra::setSizeMult(v24, 1.2);
v25 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v24 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v56, (float)(v52 - 210.0) + 6.0, (float)(v53 + 140.0) - 6.0);
v25(v24, v56);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 111) + 228))(*(this + 111), v24);
v27 = (float)(v52 - 210.0) - 28.0;
v28 = (float)(v52 + 210.0) + 28.0;
if ( v27 <= 20.0 )
v27 = 20.0;
if ( (float)(v51[0] - 20.0) <= v28 )
v28 = v51[0] - 20.0;
v29 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_arrow_01_001.png", v26);
v55[5] = 0.0;
LODWORD(v55[4]) = NewsPopup::onPrevPage;
v30 = CCMenuItemSpriteExtra::create(v29, 0, (int)this, (int)NewsPopup::onPrevPage, 0);
*(this + 142) = (cocos2d::CCSize *)v30;
CCMenuItemSpriteExtra::setSizeMult(v30, 1.5);
v50 = *(this + 142);
v31 = *(void (__fastcall **)(cocos2d::CCSize *, _BYTE *))(*(_DWORD *)v50 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v56, v27, v53);
v31(v50, v56);
(*(void (__fastcall **)(_DWORD, _DWORD))(*(_DWORD *)*(this + 111) + 228))(*(this + 111), *(this + 142));
v33 = (cocos2d::CCSprite *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"GJ_arrow_01_001.png",
v32);
cocos2d::CCSprite::setFlipX(v33, 1);
LODWORD(v55[6]) = NewsPopup::onNextPage;
v55[7] = 0.0;
v34 = CCMenuItemSpriteExtra::create((int)v33, 0, (int)this, (int)NewsPopup::onNextPage, 0);
*(this + 143) = (cocos2d::CCSize *)v34;
CCMenuItemSpriteExtra::setSizeMult(v34, 1.5);
v35 = (int)*(this + 143);
v36 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v35 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v56, v28, v53);
v36(v35, v56);
(*(void (__fastcall **)(_DWORD, _DWORD))(*(_DWORD *)*(this + 111) + 228))(*(this + 111), *(this + 143));
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v54, 340.0, 232.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v55, v52 - 170.0, (float)(v53 - 140.0) + 12.0);
v37 = GJCommentListLayer::create(0, (int)&unk_B6B226, 838860800, 340.0, 232.0, 0);
(*(void (__fastcall **)(cocos2d::CCLayerColor *, float *))(*(_DWORD *)v37 + 92))(v37, v55);
(*(void (__fastcall **)(_DWORD, cocos2d::CCLayerColor *, int))(*(_DWORD *)*(this + 115) + 232))(*(this + 115), v37, 4);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v56, (const cocos2d::CCSize *)v54);
v41 = ScrollableContentLayer::create((const cocos2d::CCSize *)v56, v38, v39, v40);
*(this + 137) = (cocos2d::CCSize *)v41;
ScrollableContentLayer::setThumbOpacity((ScrollableContentLayer *)v41, 0x32u);
(*(void (__fastcall **)(cocos2d::CCLayerColor *, _DWORD, int))(*(_DWORD *)v37 + 232))(v37, *(this + 137), 6);
v43 = (cocos2d::CCSize *)cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)&unk_B6B226, "goldFont.fnt", v42);
*(this + 140) = v43;
(*(void (__fastcall **)(cocos2d::CCSize *, int))(*(_DWORD *)v43 + 80))(v43, 1056964608);
v44 = (int)*(this + 140);
v45 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v44 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v56, 1.0, 0.0);
v45(v44, v56);
v46 = (int)*(this + 140);
v47 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v46 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v56, v55[0] + 340.0, (float)(v55[1] + 232.0) + 5.0);
v47(v46, v56);
v48 = (GameManager *)(*(int (__fastcall **)(_DWORD, _DWORD, int))(*(_DWORD *)*(this + 115) + 232))(
*(this + 115),
*(this + 140),
9);
*(this + 136) = *(cocos2d::CCSize **)(GameManager::sharedState(v48) + 920);
NewsPopup::refreshFromManager((NewsPopup *)this);
return v2;
}