//
// MoreOptionsLayer::goToPage from 0x1000eef04 to 0x1000ef1d4 (720 bytes)
//
// 3 xrefs:
// > MoreOptionsLayer::init @ 0x1000ee7f0
// > MoreOptionsLayer::onPrevPage @ 0x1000eeef4
// > MoreOptionsLayer::onNextPage @ 0x1000eef00
//
// 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 MoreOptionsLayer::goToPage(MoreOptionsLayer *a1, int a2)
{
int m_pageCount; // w9
int v3; // w22
cocos2d::CCDictionary *m_variables; // x20
cocos2d::CCString *v6; // x0
char *CString; // x0
__int64 v8; // x20
__int64 v9; // x21
__int64 v10; // x0
cocos2d::CCDictionary *v11; // x20
cocos2d::CCString *v12; // x0
char *v13; // x0
__int64 v14; // x20
cocos2d::CCDictionary *v15; // x20
cocos2d::CCString *v16; // x0
char *v17; // x0
__int64 v18; // x20
__int64 v19; // x21
__int64 v20; // x0
cocos2d::CCDictionary *v21; // x20
cocos2d::CCString *v22; // x0
char *v23; // x0
__int64 v24; // x20
CCTextInputNode *m_offsetInput; // x20
__int64 v26; // x0
__int64 m_page; // x8
std::string *p_p; // x1
std::string __p; // [xsp+8h] [xbp-38h] BYREF
if ( a2 >= 0 )
m_pageCount = a2;
else
m_pageCount = a1->m_pageCount;
if ( a1->m_pageCount >= a2 )
v3 = m_pageCount;
else
v3 = 0;
if ( a1->m_page != v3 )
{
m_variables = a1->m_variables;
v6 = (cocos2d::CCString *)sub_100268F4C("object_%i", a1->m_page);
CString = (char *)cocos2d::CCString::getCString(v6);
sub_100009900(&__p, CString);
v8 = cocos2d::CCDictionary::objectForKey_1(m_variables, &__p);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
if ( v8 && (unsigned int)sub_10024A36C(v8) )
{
v9 = 0;
do
{
v10 = sub_10024A388(v8, v9);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v10 + 328LL))(v10, 0);
v9 = (unsigned int)(v9 + 1);
}
while ( (unsigned int)v9 < (unsigned int)sub_10024A36C(v8) );
}
v11 = a1->m_variables;
v12 = (cocos2d::CCString *)sub_100268F4C("layer_%i", a1->m_page);
v13 = (char *)cocos2d::CCString::getCString(v12);
sub_100009900(&__p, v13);
v14 = cocos2d::CCDictionary::objectForKey_1(v11, &__p);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
if ( v14 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v14 + 328LL))(v14, 0);
v15 = a1->m_variables;
v16 = (cocos2d::CCString *)sub_100268F4C("object_%i", v3);
v17 = (char *)cocos2d::CCString::getCString(v16);
sub_100009900(&__p, v17);
v18 = cocos2d::CCDictionary::objectForKey_1(v15, &__p);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
if ( v18 && (unsigned int)sub_10024A36C(v18) )
{
v19 = 0;
do
{
v20 = sub_10024A388(v18, v19);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v20 + 328LL))(v20, 1);
v19 = (unsigned int)(v19 + 1);
}
while ( (unsigned int)v19 < (unsigned int)sub_10024A36C(v18) );
}
v21 = a1->m_variables;
v22 = (cocos2d::CCString *)sub_100268F4C("layer_%i", v3);
v23 = (char *)cocos2d::CCString::getCString(v22);
sub_100009900(&__p, v23);
v24 = cocos2d::CCDictionary::objectForKey_1(v21, &__p);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
if ( v24 )
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v24 + 328LL))(v24, 1);
a1->m_page = v3;
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))a1->m_leftBtn->setVisible)(a1->m_leftBtn, 1);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))a1->m_rightBtn->setVisible)(a1->m_rightBtn, 1);
m_offsetInput = a1->m_offsetInput;
v26 = ((__int64 (__fastcall *)(CCTextInputNode *))m_offsetInput->isVisible)(m_offsetInput);
((void (__fastcall *)(CCTextInputNode *, __int64))m_offsetInput->setTouchEnabled)(m_offsetInput, v26);
sub_100009900(&__p, "Options");
m_page = (unsigned int)a1->m_page;
if ( (unsigned int)m_page < 7 )
std::string::assign(&__p, off_100784B08[m_page]);
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
p_p = &__p;
else
p_p = (std::string *)__p.__r_.__value_.__r.__words[0];
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))a1->m_categoryLabel->setString)(
a1->m_categoryLabel,
p_p);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
}
}