//
// ShareLevelLayer::selectRating from 0x1002814e0 to 0x10028163a (346 bytes)
//
// 2 xrefs:
// > ShareLevelLayer::setupStars @ 0x1002811a5
// > ShareLevelLayer::setupStars @ 0x100280f66
//
// 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)
{
char v2; // al
unsigned int v3; // r14d
__int64 v4; // r15
ButtonSprite *v5; // r12
int m_starsRequested; // r13d
const char *v7; // rsi
int v8; // eax
const std::string::value_type *CString; // r14
cocos2d::CCString *v10; // rax
cocos2d::CCSprite *m_difficultySprite; // rbx
cocos2d::CCSpriteFrameCache *v12; // rax
cocos2d::CCSpriteFrame *v13; // rax
char v14; // [rsp-8h] [rbp-30h]
v14 = v2;
if ( a2 )
a1->m_starsRequested = ((__int64 (__fastcall *)(cocos2d::CCObject *))a2->getTag)(a2);
if ( (unsigned int)sub_100720070(a1->m_starButtons) )
{
v3 = 0;
do
{
v4 = sub_1007200C0(a1->m_starButtons, v3);
v5 = (ButtonSprite *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 1056LL))(v4);
m_starsRequested = a1->m_starsRequested;
v7 = "GJ_button_04.png";
if ( m_starsRequested == (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)v4 + 64LL))(v4) )
v7 = "GJ_button_01.png";
ButtonSprite::updateBGImage(v5, v7);
++v3;
}
while ( v3 < (unsigned int)sub_100720070(a1->m_starButtons) );
}
v8 = a1->m_starsRequested;
a1->m_level->m_starsRequested = v8;
if ( v8 == 1 )
{
CString = "difficulty_auto_btn_001.png";
}
else
{
v10 = (cocos2d::CCString *)sub_1007AB580("difficulty_%02d_btn_001.png", v14);
CString = cocos2d::CCString::getCString(v10);
}
m_difficultySprite = a1->m_difficultySprite;
v12 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v13 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v12, CString);
((void (__fastcall *)(cocos2d::CCSprite *, cocos2d::CCSpriteFrame *))m_difficultySprite->setDisplayFrame)(
m_difficultySprite,
v13);
}