//
// LevelInfoLayer::onRateStars from 0x6d7158 to 0x6d7314 (444 bytes)
//
// 4 xrefs:
// > LevelInfoLayer::FLAlert_Clicked @ 0x6d9744
// > ??> @ 0x9d590
// > LevelInfoLayer::init @ 0x6dcfd0
// > ??> @ 0x122d620
//
// 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 LevelInfoLayer::onRateStars(LevelInfoLayer *a1, cocos2d::CCObject *a2)
{
GameManager *v3; // x0
FLAlertLayer *v4; // x20
void *v5; // x0
GJGameLevel *m_level; // x0
int v7; // w21
bool isPlatformer; // w0
RateStarsLayer *v9; // x0
RateStarsLayer_vtbl *v10; // x2
GameLevelManager *v11; // x0
unsigned int *v12; // x2
int v13; // w1
__int64 v14; // [xsp+40h] [xbp+40h] BYREF
if ( !a1->m_isBusy )
{
v3 = GameManager::sharedState();
if ( v3->m_playerUserID.random == v3->m_playerUserID.seed )
{
v11 = GameLevelManager::sharedState();
GameLevelManager::updateUserScore(v11);
}
if ( GameManager::sharedState()->m_showedRateStarDialog )
{
m_level = a1->m_level;
v7 = m_level->m_levelID.random - m_level->m_levelID.seed;
isPlatformer = GJGameLevel::isPlatformer(m_level);
v9 = RateStarsLayer::create(v7, isPlatformer, 0);
v10 = v9->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v9->m_delegate = &a1->RateLevelDelegate;
((void (*)(void))v10->show)();
}
else
{
GameManager::sharedState()->m_showedRateStarDialog = 1;
sub_D153B8(
(int)&v14,
"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.)");
v4 = FLAlertLayer::create((int)a1 + 440, (__int64)"Rating guide", (__int64)&v14);
v5 = (void *)(v14 - 24);
if ( (__int64 *)(v14 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v12 = (unsigned int *)(v14 - 8);
do
v13 = __ldaxr(v12);
while ( __stlxr(v13 - 1, v12) );
}
else
{
v13 = *(_DWORD *)(v14 - 8);
*(_DWORD *)(v14 - 8) = v13 - 1;
}
if ( v13 <= 0 )
operator delete(v5);
}
v4->setTag(v4, 8);
v4->show(v4);
}
}
}