//
// GJShopLayer::onSelectItem from 0x4e4874 to 0x4e491e (170 bytes)
//
// 0 xrefs:
//
// 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 GJShopLayer::onSelectItem(GJShopLayer *a1, cocos2d::CCObject *a2)
{
intptr_t v3; // r4
GameStatsManager *v4; // r0
GameStatsManager *v5; // r0
GJStoreItem *StoreItem; // r4
int v7; // r8
GameStatsManager *v8; // r9
int Stat; // r9
PurchaseItemPopup *v10; // r0
char *v11[3]; // [sp+0h] [bp-Ch] BYREF
v11[0] = (char *)a1;
v11[1] = (char *)a2;
if ( !a1->m_closing )
{
v3 = a2->getTag(a2);
v4 = GameStatsManager::sharedState();
if ( !GameStatsManager::isStoreItemUnlocked(v4, v3) )
{
v5 = GameStatsManager::sharedState();
StoreItem = (GJStoreItem *)GameStatsManager::getStoreItem(v5, v3);
v7 = StoreItem->m_price.random - StoreItem->m_price.seed;
v8 = GameStatsManager::sharedState();
GJStoreItem::getCurrencyKey((GJStoreItem *)v11, (int)StoreItem);
Stat = GameStatsManager::getStat(v8, v11[0]);
sub_774008(v11);
if ( v7 <= Stat )
{
v10 = PurchaseItemPopup::create(StoreItem);
v10->m_delegate = &a1->GJPurchaseDelegate;
v10->show(v10);
}
else
{
GJShopLayer::showCantAffordMessage(a1, StoreItem);
}
}
}
}