//
// RateStarsModLayer::init from 0x79e94c to 0x79efa8 (1628 bytes)
//
// 1 xrefs:
// > RateStarsModLayer::create @ 0x79f156
//
// 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:59:52 +0000
//
GameManager *__fastcall RateStarsModLayer::init(RateStarsModLayer *this, int a2, int a3)
{
GameManager *v6; // r0
int v7; // r5
void (__fastcall *v8)(int, _DWORD *); // r10
void (__fastcall *v9)(int, _DWORD *); // r8
char *v10; // r1
const char *v11; // r2
cocos2d::CCLabelBMFont *v12; // r0
int v13; // r5
void (__fastcall *v14)(int, _DWORD *); // r8
cocos2d::CCArray *v15; // r0
cocos2d::CCObject *v16; // r0
cocos2d::CCArray *v17; // r0
cocos2d::CCObject *v18; // r0
cocos2d::CCArray *v19; // r0
cocos2d::CCArray *v20; // r5
int v21; // r0
const char *v22; // r1
int v23; // r0
int v24; // r0
int v25; // r9
const cocos2d::CCPoint *v26; // r11
void (__fastcall *v27)(int, _DWORD *); // r10
int v28; // r0
const char *v29; // r9
cocos2d::CCObject *StarsButton; // r10
cocos2d::CCArray *v31; // r0
const cocos2d::CCPoint *v32; // r9
const cocos2d::CCPoint *v33; // r9
cocos2d::CCSprite *v34; // r0
int v35; // r0
int v36; // r8
void (__fastcall *v37)(int, _DWORD *); // r10
int v38; // r8
void (__fastcall *v39)(int, _DWORD *); // r9
void (__fastcall *v40)(int, _DWORD *); // r9
int v41; // r7
cocos2d::CCString *v42; // r0
cocos2d::CCSprite *CString; // r0
const char *v44; // r1
int v45; // r8
cocos2d::CCObject *v46; // r8
const cocos2d::CCPoint *v47; // r9
const char *v48; // r1
ButtonSprite *v49; // r0
cocos2d::CCObject *v50; // r7
const char *v51; // r1
ButtonSprite *v52; // r0
int v53; // r0
const cocos2d::CCPoint *v54; // r8
GameManager *v56; // [sp+10h] [bp-A4h]
cocos2d::CCMenu *v57; // [sp+14h] [bp-A0h]
int v58; // [sp+14h] [bp-A0h]
float v59; // [sp+20h] [bp-94h] BYREF
float v60; // [sp+24h] [bp-90h]
char v61[8]; // [sp+28h] [bp-8Ch] BYREF
char v62[8]; // [sp+30h] [bp-84h] BYREF
_BYTE v63[8]; // [sp+38h] [bp-7Ch] BYREF
int (__fastcall *v64)(RateStarsModLayer *, cocos2d::CCObject *, int); // [sp+40h] [bp-74h]
int v65; // [sp+44h] [bp-70h]
unsigned int (__fastcall *v66)(RateStarsModLayer *, cocos2d::CCObject *); // [sp+48h] [bp-6Ch]
int v67; // [sp+4Ch] [bp-68h]
_DWORD *(__fastcall *v68)(RateStarsModLayer *, cocos2d::CCObject *); // [sp+50h] [bp-64h]
int v69; // [sp+54h] [bp-60h]
unsigned int (__fastcall *v70)(unsigned int, cocos2d::CCObject *); // [sp+58h] [bp-5Ch]
int v71; // [sp+5Ch] [bp-58h]
_DWORD v72[2]; // [sp+60h] [bp-54h] BYREF
int v73[2]; // [sp+68h] [bp-4Ch] BYREF
cocos2d::CCLabelBMFont *v74; // [sp+70h] [bp-44h]
_DWORD v75[4]; // [sp+74h] [bp-40h] BYREF
_DWORD v76[10]; // [sp+84h] [bp-30h] BYREF
v6 = FLAlertLayer::init(this, 75);
v56 = v6;
if ( v6 )
{
*((_DWORD *)this + 136) = a2;
*((_DWORD *)this + 137) = -1;
cocos2d::CCDirector::sharedDirector(v6);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v59);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v75, 0.0, 0.0, 80.0, 80.0);
v7 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v75);
v8 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v7 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v75, 380.0, 250.0);
v8(v7, v75);
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v7, -1);
v9 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v7 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v75, v59 * 0.5, v60 * 0.5);
v9(v7, v75);
v73[0] = 0;
v73[1] = 0;
v74 = nullptr;
std::string::__init(v73, "Advisor: Suggest ", 0x11u);
if ( a3 )
v10 = "Moons";
else
v10 = "Stars";
std::string::append(v73, v10);
if ( (v73[0] & 1) != 0 )
v12 = v74;
else
v12 = (cocos2d::CCLabelBMFont *)((char *)v73 + 1);
v13 = cocos2d::CCLabelBMFont::create(v12, "bigFont.fnt", v11);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v13 + 80))(v13, 1059481190);
v14 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v13 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v75, v59 * 0.5, (float)((float)(v60 * 0.5) + 125.0) - 22.0);
v14(v13, v75);
v15 = (cocos2d::CCArray *)(*(int (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 115) + 228))(
*((_DWORD *)this + 115),
v13);
v16 = (cocos2d::CCObject *)cocos2d::CCArray::create(v15);
*((_DWORD *)this + 134) = v16;
v17 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v16);
v18 = (cocos2d::CCObject *)cocos2d::CCArray::create(v17);
*((_DWORD *)this + 135) = v18;
v19 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v18);
v20 = (cocos2d::CCArray *)cocos2d::CCArray::create(v19);
v57 = (cocos2d::CCMenu *)cocos2d::CCArray::create(v20);
v21 = cocos2d::CCMenu::create(v57);
*((_DWORD *)this + 111) = v21;
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v21, 10);
v23 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_coinsIcon2_001.png", v22);
*((_DWORD *)this + 139) = v23;
(*(void (__fastcall **)(int, int))(*(_DWORD *)v23 + 80))(v23, 1067030938);
v24 = *((_DWORD *)this + 139);
v65 = 0;
v64 = RateStarsModLayer::onToggleCoins;
v25 = CCMenuItemSpriteExtra::create(v24, 0, (int)this, (int)RateStarsModLayer::onToggleCoins, 0);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v25);
v26 = *((const cocos2d::CCPoint **)this + 111);
v27 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v25 + 92);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v72,
(float)((float)(v59 * 0.5) - 190.0) + 23.0,
(float)((float)(v60 * 0.5) + 125.0) - 23.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v75, v26);
v27(v25, v75);
v28 = *((_DWORD *)this + 139);
*((_BYTE *)this + 552) = 1;
(*(void (__fastcall **)(int, __int16 *))(*(_DWORD *)v28 + 480))(v28, &word_BF1248);
v29 = (_BYTE *)(&dword_0 + 1);
do
{
v67 = 0;
v66 = RateStarsModLayer::selectRating;
StarsButton = (cocos2d::CCObject *)RateStarsModLayer::getStarsButton(
(int)this,
v29,
COERCE_FLOAT(RateStarsModLayer::selectRating),
0,
*((_DWORD *)this + 111),
COERCE_INT(1.0));
cocos2d::CCArray::addObject(*((cocos2d::CCArray **)this + 134), StarsButton);
(*(void (__fastcall **)(cocos2d::CCObject *, const char *))(*(_DWORD *)StarsButton + 36))(StarsButton, v29);
if ( (int)v29 > 5 )
v31 = v57;
else
v31 = v20;
cocos2d::CCArray::addObject(v31, StarsButton);
++v29;
}
while ( v29 != &byte_9[2] );
v32 = *((const cocos2d::CCPoint **)this + 111);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v72,
(float)(v59 * 0.5) - 30.0,
(float)((float)(v60 * 0.5) + 23.0) + 34.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v75, v32);
GameToolbox::alignItemsHorisontally(*(float *)&v20, 18.0, (int)v75, 0);
v33 = *((const cocos2d::CCPoint **)this + 111);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v72,
(float)(v59 * 0.5) - 30.0,
(float)((float)(v60 * 0.5) - 23.0) + 34.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v75, v33);
GameToolbox::alignItemsHorisontally(*(float *)&v57, 18.0, (int)v75, 0);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v61,
(float)((float)(v59 * 0.5) - 30.0) + 172.0,
(float)((float)(v60 * 0.5) + 34.0) + 2.0);
v34 = GJDifficultySprite::create(nullptr, (_BYTE *)&dword_0 + 1);
*((_DWORD *)this + 141) = v34;
(*(void (__fastcall **)(cocos2d::CCSprite *, int))(*(_DWORD *)v34 + 80))(v34, 1067030938);
v35 = *((_DWORD *)this + 141);
v69 = 0;
v68 = RateStarsModLayer::onFeature;
v36 = CCMenuItemSpriteExtra::create(v35, 0, (int)this, (int)RateStarsModLayer::onFeature, 0);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v36);
v37 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v36 + 92);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v75, *((const cocos2d::CCPoint **)this + 111));
v37(v36, v75);
cocos2d::CCArray::removeAllObjects(v20);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v75, 0.0, 0.0, 40.0, 40.0);
v38 = cocos2d::extension::CCScale9Sprite::create("square02_small.png", v75);
v39 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v38 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v75, 280.0, 56.0);
v39(v38, v75);
v40 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v38 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v75, v59 * 0.5, (float)(v60 * 0.5) - 45.0);
v40(v38, v75);
(*(void (__fastcall **)(int, void *))(*(_DWORD *)v38 + 480))(v38, &unk_BF1254);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v38 + 456))(v38, 35);
(*(void (__fastcall **)(_DWORD, int, _DWORD))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v38, 0);
v76[0] = 1;
v76[1] = 7;
v76[2] = 2;
v76[3] = 8;
v76[4] = 3;
v76[5] = 6;
v76[6] = 4;
v76[7] = 9;
v41 = 0;
v76[8] = 5;
v76[9] = 10;
do
{
v58 = v76[v41];
v42 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"difficulty_%02d_btn2_001.png",
(const char *)v76[v41 + 1]);
CString = (cocos2d::CCSprite *)cocos2d::CCString::getCString(v42);
v45 = cocos2d::CCSprite::createWithSpriteFrameName(CString, v44);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v45 + 80))(v45, 1062836634);
v71 = 0;
v70 = RateStarsModLayer::selectDemon;
v46 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::create(
v45,
0,
(int)this,
(int)RateStarsModLayer::selectDemon,
0);
(*(void (__fastcall **)(_DWORD, cocos2d::CCObject *))(**((_DWORD **)this + 111) + 228))(
*((_DWORD *)this + 111),
v46);
cocos2d::CCArray::addObject(*((cocos2d::CCArray **)this + 135), v46);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v46 + 36))(v46, v58);
cocos2d::CCArray::addObject(v20, v46);
v41 += 2;
}
while ( v41 != 10 );
v47 = *((const cocos2d::CCPoint **)this + 111);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v72, v59 * 0.5, (float)(v60 * 0.5) - 42.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v75, v47);
GameToolbox::alignItemsHorisontally(*(float *)&v20, 18.0, (int)v75, 0);
cocos2d::CCArray::removeAllObjects(v20);
v49 = ButtonSprite::create((ButtonSprite *)"Cancel", v48);
v72[1] = 0;
v72[0] = RateStarsModLayer::onClose;
v50 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::create((int)v49, 0, (int)this, (int)RateStarsModLayer::onClose, 0);
(*(void (__fastcall **)(_DWORD, cocos2d::CCObject *))(**((_DWORD **)this + 111) + 228))(
*((_DWORD *)this + 111),
v50);
cocos2d::CCArray::addObject(v20, v50);
v52 = ButtonSprite::create((ButtonSprite *)"Submit", v51);
v75[1] = 0;
v75[0] = RateStarsModLayer::onRate;
v53 = CCMenuItemSpriteExtra::create((int)v52, 0, (int)this, (int)RateStarsModLayer::onRate, 0);
*((_DWORD *)this + 133) = v53;
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v53);
cocos2d::CCArray::addObject(v20, *((cocos2d::CCObject **)this + 133));
v54 = *((const cocos2d::CCPoint **)this + 111);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v62, v59 * 0.5, (float)((float)(v60 * 0.5) - 125.0) + 25.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v63, v54);
GameToolbox::alignItemsHorisontally(*(float *)&v20, 15.0, (int)v63, 0);
RateStarsModLayer::selectRating(this, nullptr);
std::string::~string((int)v73);
}
return v56;
}