//
// RateStarsLayer::selectRating from 0x10028c430 to 0x10028c579 (329 bytes)
//
// 7 xrefs:
// > RateStarsLayer::init @ 0x10028c2f0
// > RateStarsLayer::init @ 0x10028bb89
// > RateStarsLayer::init @ 0x10028bc53
// > RateStarsLayer::init @ 0x10028bd1d
// > RateStarsLayer::init @ 0x10028bde7
// > RateStarsLayer::init @ 0x10028beb1
// > RateStarsLayer::init @ 0x10028bf30
//
// 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 RateStarsLayer::selectRating(RateStarsLayer *a1, cocos2d::CCObject *a2)
{
int v2; // eax
unsigned int v3; // r14d
__int64 v4; // r15
ButtonSprite *v5; // r12
int m_starsRate; // r13d
const char *v7; // rsi
_BOOL8 v8; // r14
ButtonSprite *v9; // rax
unsigned int v10; // eax
int v11; // ecx
int v12; // esi
if ( a2 )
v2 = ((__int64 (__fastcall *)(cocos2d::CCObject *))a2->getTag)(a2);
else
v2 = -1;
a1->m_starsRate = v2;
if ( (unsigned int)sub_100720070(a1->m_buttons) )
{
v3 = 0;
do
{
v4 = sub_1007200C0(a1->m_buttons, v3);
v5 = (ButtonSprite *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 1056LL))(v4);
m_starsRate = a1->m_starsRate;
v7 = "GJ_button_04.png";
if ( m_starsRate == (*(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_buttons) );
}
v8 = a1->m_starsRate != -1;
v9 = (ButtonSprite *)((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))a1->m_submitButton->getNormalImage)(a1->m_submitButton);
ButtonSprite::setColor(v9, (cocos2d::ccColor3B)(v8 ? -1 : 0xFFA6A6A6));
v10 = a1->m_starsRate;
v11 = 0;
if ( (int)v10 >= 2 )
{
if ( v10 == 2 )
{
v11 = 1;
}
else if ( v10 == 3 )
{
v11 = 2;
}
else
{
v11 = 3;
if ( v10 >= 6 )
{
v11 = 4;
if ( v10 >= 8 )
{
v11 = 5;
if ( v10 >= 0xA )
{
v11 = 6;
if ( v10 != 10 )
v11 = 0;
}
}
}
}
}
v12 = -1;
if ( v10 != 1 )
v12 = v11;
GJDifficultySprite::updateDifficultyFrame(a1->m_difficultySprite, v12, Short);
}