//
// ShareLevelLayer::selectRating from 0x1002760dc to 0x100276258 (380 bytes)
//
// 2 xrefs:
// > ShareLevelLayer::setupStars @ 0x100275dd0
// > ShareLevelLayer::setupStars @ 0x100275b94
//
// 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 ShareLevelLayer::selectRating(ShareLevelLayer *a1, cocos2d::CCObject *a2)
{
unsigned int v3; // w20
__int64 v4; // x21
ButtonSprite *v5; // x22
int m_starsRequested; // w25
const char *v7; // x1
unsigned int v8; // w8
const char *CString; // x20
int v10; // w8
int v11; // w12
int v12; // w11
int v13; // w10
cocos2d::CCString *v14; // x0
cocos2d::CCSprite *m_difficultySprite; // x19
cocos2d::CCSpriteFrameCache *v16; // x0
cocos2d::CCSpriteFrame *v17; // x1
if ( a2 )
a1->m_starsRequested = ((__int64 (__fastcall *)(cocos2d::CCObject *))a2->getTag)(a2);
if ( (unsigned int)sub_10024A36C((__int64)a1->m_starButtons) )
{
v3 = 0;
do
{
v4 = sub_10024A388((__int64)a1->m_starButtons, v3);
v5 = (ButtonSprite *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 1056LL))(v4);
m_starsRequested = a1->m_starsRequested;
if ( m_starsRequested == (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v4 + 64LL))(v4) )
v7 = "GJ_button_01.png";
else
v7 = "GJ_button_04.png";
ButtonSprite::updateBGImage(v5, v7);
++v3;
}
while ( v3 < (unsigned int)sub_10024A36C((__int64)a1->m_starButtons) );
}
v8 = a1->m_starsRequested;
a1->m_level->m_starsRequested = v8;
if ( (int)v8 >= 2 )
{
if ( v8 == 2 )
{
v10 = 1;
}
else if ( v8 == 3 )
{
v10 = 2;
}
else
{
if ( v8 == 10 )
v11 = 6;
else
v11 = 0;
if ( v8 >= 0xA )
v12 = v11;
else
v12 = 5;
if ( v8 >= 8 )
v13 = v12;
else
v13 = 4;
if ( v8 >= 6 )
v10 = v13;
else
v10 = 3;
}
goto LABEL_29;
}
if ( v8 != 1 )
{
v10 = 0;
LABEL_29:
v14 = (cocos2d::CCString *)sub_100268F4C("difficulty_%02d_btn_001.png", v10);
CString = cocos2d::CCString::getCString(v14);
goto LABEL_30;
}
CString = "difficulty_auto_btn_001.png";
LABEL_30:
m_difficultySprite = a1->m_difficultySprite;
v16 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v17 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v16, CString);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSpriteFrame *))m_difficultySprite->setDisplayFrame)(
m_difficultySprite,
v17);
}