//
// BoomScrollLayer::moveToPage from 0x56df9c to 0x56e11c (384 bytes)
//
// 11 xrefs:
// > BoomScrollLayer::ccTouchEnded @ 0x56e27c
// > BoomScrollLayer::addPage @ 0x56e494
// > BoomScrollLayer::removePage @ 0x56e53c
// > BoomScrollLayer::removePage @ 0x56e55c
// > ListButtonBar::goToPage @ 0x5a8964
// > LevelSelectLayer::onNext @ 0x79b1a4
// > LevelSelectLayer::onPrev @ 0x79b1d8
// > GauntletSelectLayer::goToPage @ 0x9187d0
// > WorldSelectLayer::goToPage @ 0x95f3e8
// > SecretRewardsLayer::goToPage @ 0xa60a30
// > ??> @ 0x8c5b0
//
// 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 BoomScrollLayer::moveToPage(BoomScrollLayer *a1, int a2)
{
float m_touchQuotient; // s0
float v5; // s0
float m_unkFloat2; // s1
cocos2d::CCEaseElasticOut *v7; // x0
cocos2d::CCActionInterval *v8; // x1
cocos2d::CCSequence *v9; // x22
cocos2d::CCFiniteTimeAction *v10; // x0
cocos2d::CCAction *v11; // x22
BoomScrollLayerDelegate *m_delegate; // x0
cocos2d::CCPoint v13; // 0:kr00_8.8
if ( a1->m_looped || (a2 & 0x80000000) == 0 && a2 < BoomScrollLayer::getTotalPages(a1) )
{
a1->m_pageMoving = 1;
v13 = BoomScrollLayer::positionForPageWithNumber(a1, a2);
cocos2d::CCPoint::operator=(&a1->m_position, v13.x, v13.y);
cocos2d::CCNode::stopActionByTag(a1->m_extendedLayer, 2);
m_touchQuotient = a1->m_touchQuotient;
if ( m_touchQuotient <= a1->m_maxSpeed )
{
if ( m_touchQuotient <= a1->m_minSpeed )
v5 = 0.96;
else
v5 = 0.72;
}
else
{
v5 = 0.48;
}
m_unkFloat2 = a1->m_unkFloat2;
if ( m_unkFloat2 > 0.0 )
v5 = v5 * m_unkFloat2;
a1->m_touchQuotient = 0.0;
v7 = (cocos2d::CCEaseElasticOut *)cocos2d::CCMoveTo::create(v5, &a1->m_position);
v9 = (cocos2d::CCSequence *)cocos2d::CCEaseElasticOut::create(v7, v8, 0.5);
v10 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCCallFunc::create(a1, BoomScrollLayer::moveToPageEnded, 0);
v11 = (cocos2d::CCAction *)cocos2d::CCSequence::create(v9, v10, 0);
cocos2d::CCNode::runAction(a1->m_extendedLayer, v11);
v11->setTag(v11, 2);
a1->m_page = a2;
m_delegate = a1->m_delegate;
if ( m_delegate )
m_delegate->scrollLayerWillScrollToPage(m_delegate, a1, a2);
if ( a1->m_looped )
BoomScrollLayer::repositionPagesLooped(a1);
}
}