//
// RewardUnlockLayer::showCollectReward from 0x10021b710 to 0x10021b7b7 (167 bytes)
//
// 15 xrefs:
// > DailyLevelPage::claimLevelReward @ 0x1002323e9
// > GJPathRewardPopup::onClaim @ 0x1003034d9
// > GJShopLayer::dialogClosed @ 0x100327216
// > GameManager::rewardedVideoHidden @ 0x1003805db
// > GameManager::rewardedVideoHidden @ 0x100380679
// > SupportLayer::onGetReward @ 0x10039a72f
// > SecretLayer4::onChest01 @ 0x1003b2f3e
// > FollowRewardPage::onSpecialItem @ 0x100420eae
// > SecretLayer5::claimOnlineReward @ 0x10047d7fb
// > SecretLayer3::onChest01 @ 0x1004a5dbb
// > SecretLayer3::onChest02 @ 0x1004a5e8b
// > GauntletSelectLayer::onPlay @ 0x100572e7d
// > SecretRewardsLayer::onGoldChest @ 0x1006325ae
// > SecretRewardsLayer::onSpecialItem @ 0x100632ede
// > SecretRewardsLayer::onSelectItem @ 0x10063499c
//
// 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
//
bool __fastcall RewardUnlockLayer::showCollectReward(RewardUnlockLayer *a1, GJRewardItem *a2)
{
GJRewardItem *m_rewardItem; // rdi
bool v4; // r14
if ( !a2 )
return 0;
m_rewardItem = a1->m_rewardItem;
if ( m_rewardItem )
cocos2d::CCObject::release(m_rewardItem);
a1->m_rewardItem = a2;
cocos2d::CCObject::retain(a2);
if ( a2->m_unk && a2->m_rewardType != a1->m_chestType )
return 0;
((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))a1->m_closeBtn->setVisible)(a1->m_closeBtn, 0);
((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))a1->m_closeBtn->setEnabled)(a1->m_closeBtn, 0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _QWORD))a1->m_wrongLabel->setVisible)(a1->m_wrongLabel, 0);
a1->m_rewardCollected = 1;
v4 = 1;
if ( a1->m_animationPlayed )
RewardUnlockLayer::playRewardEffect(a1);
return v4;
}