//
// RateStarsLayer::onClose from 0x10028c600 to 0x10028c717 (279 bytes)
//
// 1 xrefs:
// > RateStarsLayer::init @ 0x10028c24d
//
// 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::onClose(RateStarsLayer *a1, cocos2d::CCObject *a2)
{
GameLevelManager *v3; // rax
char v4; // al
UploadActionPopup *m_popup; // rax
UploadActionPopup *v6; // rax
RateLevelDelegate *m_delegate; // rdi
GameLevelManager *v8; // rax
void *v9[4]; // [rsp+0h] [rbp-20h] BYREF
if ( a1->m_starsRate != -1 )
{
if ( a1->m_moderator )
{
v3 = GameLevelManager::sharedState();
GameLevelManager::suggestLevelStars(v3, a1->m_levelID, a1->m_starsRate, a1->m_featureState);
if ( v4 )
{
GameLevelManager::sharedState()->m_uploadActionDelegate = &a1->UploadActionDelegate;
m_popup = a1->m_popup;
if ( m_popup )
m_popup->m_delegate = nullptr;
strcpy((char *)v9, "\"Sending rating...");
v6 = (UploadActionPopup *)UploadActionPopup::create(&a1->UploadPopupDelegate, v9);
a1->m_popup = v6;
if ( ((__int64)v9[0] & 1) != 0 )
{
operator delete(v9[2]);
v6 = a1->m_popup;
}
((void (__fastcall *)(UploadActionPopup *))v6->show)(v6);
}
}
else
{
((void (__fastcall *)(RateStarsLayer *, _QWORD))a1->setKeypadEnabled)(a1, 0);
((void (__fastcall *)(RateStarsLayer *, __int64))a1->removeFromParentAndCleanup)(a1, 1);
m_delegate = a1->m_delegate;
if ( m_delegate )
((void (__fastcall *)(RateLevelDelegate *))m_delegate->rateLevelClosed)(m_delegate);
v8 = GameLevelManager::sharedState();
GameLevelManager::rateStars(v8, a1->m_levelID, a1->m_starsRate);
}
}
}