//
// LevelListLayer::onBack from 0x100246770 to 0x100246900 (400 bytes)
//
// 1 xrefs:
// > ??> @ 0x1007cb2f0
//
// 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 LevelListLayer::onBack(LevelListLayer *a1, cocos2d::CCObject *a2)
{
CCTextInputNode *m_titleInput; // x0
GameLevelManager *v5; // x21
GameLevelManager *v6; // x19
GameLevelManager *v7; // x0
void **v8; // x1
cocos2d::CCScene *SearchScene; // x19
GJSearchObject *v10; // x0
cocos2d::CCDirector *v11; // x20
cocos2d::CCTransitionFade *v12; // x0
void *__p[2]; // [xsp+0h] [xbp-60h] BYREF
char *longStorage; // [xsp+10h] [xbp-50h]
std::string __str; // [xsp+20h] [xbp-40h] BYREF
if ( !a1->m_exiting )
{
((void (__fastcall *)(LevelListLayer *, _QWORD))a1->setKeypadEnabled)(a1, 0);
m_titleInput = a1->m_titleInput;
if ( m_titleInput )
((void (__fastcall *)(CCTextInputNode *, _QWORD))m_titleInput->onClickTrackNode)(m_titleInput, 0);
LevelListLayer::verifyListName(a1);
v5 = GameLevelManager::sharedState();
if ( a1->m_searchKey1.m_data.m_short.shortStorage.__elems_[22] < 0 )
sub_1000097D0(&__str, (void *)a1->m_searchKey1.m_data.m_long.capacitym1, a1->m_searchKey1.m_data.m_long.size);
else
__str = (std::string)a1->m_searchKey1;
std::string::operator=((std::string *)&v5->m_searchKey, &__str);
if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__str.__r_.__value_.__l.__data_);
if ( a1->m_levelList->m_listType == Editor )
{
v6 = GameLevelManager::sharedState();
v7 = GameLevelManager::sharedState();
if ( v7->m_searchKey.m_data.m_short.shortStorage.__elems_[22] < 0 )
{
sub_1000097D0(__p, (void *)v7->m_searchKey.m_data.m_long.capacitym1, v7->m_searchKey.m_data.m_long.size);
}
else
{
*(_OWORD *)__p = *(_OWORD *)&v7->m_searchKey.m_data.m_short.sizex2;
longStorage = v7->m_searchKey.m_data.m_long.longStorage;
}
if ( SHIBYTE(longStorage) >= 0 )
v8 = __p;
else
v8 = (void **)__p[0];
SearchScene = GameLevelManager::getSearchScene(v6, (const char *)v8);
if ( SHIBYTE(longStorage) < 0 )
operator delete(__p[0]);
if ( GameLevelManager::sharedState()->m_returnToLocalLevels || !SearchScene )
{
GameLevelManager::sharedState()->m_returnToLocalLevels = 0;
v10 = GJSearchObject::create_2(MyLists);
SearchScene = LevelBrowserLayer::scene(v10);
}
v11 = cocos2d::CCDirector::sharedDirector();
v12 = cocos2d::CCTransitionFade::create_1(0.5, SearchScene);
cocos2d::CCDirector::replaceScene(v11, v12);
}
else
{
LevelBrowserLayer::onBack(a1, a2);
}
}
}