//
// LevelInfoLayer::onRateStars from 0x1002c1a90 to 0x1002c1bcc (316 bytes)
//
// 2 xrefs:
// > LevelInfoLayer::FLAlert_Clicked @ 0x1002c4cc4
// > LevelInfoLayer::init @ 0x1002be421
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall LevelInfoLayer::onRateStars(LevelInfoLayer *a1, cocos2d::CCObject *a2)
{
GameManager *v3; // rax
GameLevelManager *v4; // rax
GJGameLevel *m_level; // rdi
int v6; // r14d
bool isPlatformer; // al
RateStarsLayer *v8; // rax
__int64 v9; // rbx
_QWORD v10[2]; // [rsp+8h] [rbp-28h] BYREF
void *__p; // [rsp+18h] [rbp-18h]
if ( !a1->m_isBusy )
{
v3 = GameManager::sharedState();
if ( v3->m_playerUserID.random == v3->m_playerUserID.seed )
{
v4 = GameLevelManager::sharedState();
GameLevelManager::updateUserScore(v4);
}
if ( GameManager::sharedState()->m_showedRateStarDialog )
{
m_level = a1->m_level;
v6 = m_level->m_levelID.random - m_level->m_levelID.seed;
isPlatformer = GJGameLevel::isPlatformer(m_level);
v8 = RateStarsLayer::create(v6, isPlatformer, 0);
v8->m_delegate = &a1->RateLevelDelegate;
((void (__fastcall *)(RateStarsLayer *))v8->show)(v8);
}
else
{
GameManager::sharedState()->m_showedRateStarDialog = 1;
__p = operator new(0x140u);
v10[0] = 321;
v10[1] = 314;
strcpy(
(char *)__p,
"Auto: 1 Star or Moon\n"
"Easy: 2 Stars or Moons\n"
"Normal: 3 Stars or Moons\n"
"Hard: 4 to 5 Stars or Moons\n"
"Harder: 6 to 7 Stars or Moons\n"
"Insane: 8 to 9 Stars or Moons\n"
"Demon: 10 Stars or Moons\n"
"(These values are not assigned before a rating is manually given by RobTop.)");
v9 = FLAlertLayer::create_1(&a1->FLAlertLayerProtocol, "Rating guide", v10, "OK", 0, 300.0);
if ( (v10[0] & 1) != 0 )
operator delete(__p);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v9 + 72LL))(v9, 8);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v9 + 1288LL))(v9);
}
}
}