//
// PurchaseItemPopup::onPurchase from 0x1003285a0 to 0x10032860d (109 bytes)
//
// 1 xrefs:
// > PurchaseItemPopup::init @ 0x1003280d0
//
// 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 PurchaseItemPopup::onPurchase(PurchaseItemPopup *a1, cocos2d::CCObject *a2)
{
GameStatsManager *v3; // rax
GJPurchaseDelegate *m_delegate; // rdi
v3 = GameStatsManager::sharedState();
if ( GameStatsManager::purchaseItem(v3, a1->m_storeItem->m_index.random - a1->m_storeItem->m_index.seed) )
{
m_delegate = a1->m_delegate;
if ( m_delegate )
((void (__fastcall *)(GJPurchaseDelegate *, GJStoreItem *))m_delegate->didPurchaseItem)(
m_delegate,
a1->m_storeItem);
}
((void (__fastcall *)(PurchaseItemPopup *, _QWORD))a1->setKeypadEnabled)(a1, 0);
((void (__fastcall *)(PurchaseItemPopup *, __int64))a1->removeFromParentAndCleanup)(a1, 1);
}