//
// ShardsPage::goToPage from 0x95c2c4 to 0x95c414 (336 bytes)
//
// 3 xrefs:
// > ShardsPage::onSwitchPage @ 0x95c454
// > ShardsPage::init @ 0x95d408
// > ??> @ 0x7aaa8
//
// 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 ShardsPage::goToPage(ShardsPage *a1, int a2)
{
cocos2d::CCDictionary *m_pages; // x0
intptr_t v5; // x20
signed int v6; // w23
cocos2d::CCObject *v7; // x0
cocos2d::CCObject_vtbl *v8; // x0
void (__fastcall *v9)(cocos2d::CCObject *__hidden); // x19
void (__fastcall *v10)(cocos2d::CCObject *__hidden); // x21
__int64 i; // x0
cocos2d::CCSprite *m_tierSprite; // x19
void (__fastcall *setDisplayFrame)(cocos2d::CCSprite *__hidden, cocos2d::CCSpriteFrame *); // x20
cocos2d::CCSpriteFrameCache *v14; // x0
const char *v15; // x1
cocos2d::CCSpriteFrame *v16; // x0
if ( (unsigned int)a2 <= 3 && a1->m_page != a2 )
{
m_pages = a1->m_pages;
v5 = 0;
a1->m_page = a2;
v6 = cocos2d::CCDictionary::count(m_pages);
if ( v6 > 0 )
{
do
{
v7 = cocos2d::CCDictionary::objectForKey(a1->m_pages, v5);
if ( v7 )
{
v8 = v7[1].__vftable;
if ( LODWORD(v8->copyWithZone) )
{
v9 = v8->~CCObject_0;
v10 = (void (__fastcall *)(cocos2d::CCObject *__hidden))((char *)v9 + 8 * LODWORD(v8->copyWithZone) - 8);
if ( (unsigned __int64)v9 <= (unsigned __int64)v10 )
{
for ( i = *(_QWORD *)v9; *(_QWORD *)v9; i = *(_QWORD *)v9 )
{
v9 = (void (__fastcall *)(cocos2d::CCObject *__hidden))((char *)v9 + 8);
(*(void (__fastcall **)(__int64, bool))(*(_QWORD *)i + 328LL))(i, a2 == (_DWORD)v5);
if ( (unsigned __int64)v10 < (unsigned __int64)v9 )
break;
}
}
}
}
++v5;
}
while ( v6 > (int)v5 );
}
a1->m_prevButton->setVisible(a1->m_prevButton, a2 > 0);
a1->m_nextButton->setVisible(a1->m_nextButton, a2 <= 2);
m_tierSprite = a1->m_tierSprite;
setDisplayFrame = m_tierSprite->setDisplayFrame;
v14 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
if ( a2 <= 1 )
v15 = "tier1Icon_001.png";
else
v15 = "tier2Icon_001.png";
v16 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v14, v15);
setDisplayFrame(m_tierSprite, v16);
}
}