//
// GJPathPage::onUnlock from 0x100300d80 to 0x100300e49 (201 bytes)
//
// 1 xrefs:
// > GJPathPage::init @ 0x1003006ef
//
// 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 GJPathPage::onUnlock(GJPathPage *a1, cocos2d::CCObject *a2)
{
int v2; // r14d
GameStatsManager *v3; // rax
GJStoreItem *StoreItem; // r14
int random; // r12d
int seed; // r13d
GameStatsManager *v7; // r15
const char *v8; // rsi
int Stat; // r15d
int v10; // r12d
PurchaseItemPopup *v11; // rax
char v12; // [rsp+0h] [rbp-40h] BYREF
char v13; // [rsp+1h] [rbp-3Fh] BYREF
void *__p; // [rsp+10h] [rbp-30h]
v2 = a1->m_pathNumber + 5;
v3 = GameStatsManager::sharedState();
StoreItem = GameStatsManager::getStoreItem(v3, v2, 12);
random = StoreItem->m_price.random;
seed = StoreItem->m_price.seed;
v7 = GameStatsManager::sharedState();
GJStoreItem::getCurrencyKey((__int64)&v12, (__int64)StoreItem);
if ( (v12 & 1) != 0 )
v8 = (const char *)__p;
else
v8 = &v13;
Stat = GameStatsManager::getStat(v7, v8);
v10 = random - seed;
if ( (v12 & 1) != 0 )
operator delete(__p);
if ( v10 <= Stat )
{
v11 = PurchaseItemPopup::create(StoreItem);
v11->m_delegate = &a1->GJPurchaseDelegate;
((void (__fastcall *)(PurchaseItemPopup *))v11->show)(v11);
}
else
{
GJPathPage::showCantAffordMessage(a1, StoreItem);
}
}