//
// LevelSettingsLayer::onClose from 0x56f22c to 0x56f2de (178 bytes)
//
// 2 xrefs:
// > LevelSettingsLayer::keyBackClicked @ 0x56f2f0
// > LevelSettingsLayer::onLiveEdit @ 0x56f8d0
//
// 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 LevelSettingsLayer::onClose(LevelSettingsLayer *a1, cocos2d::CCObject *a2)
{
CCTextInputNode *m_orderInput; // r3
CCTextInputNode *m_channelInput; // r3
LevelSettingsObject *m_settingsObject; // r3
SongSelectNode *m_songSelectNode; // r2
GJGameLevel *m_level; // r1
LevelSettingsDelegate *m_delegate; // r0
m_orderInput = a1->m_orderInput;
if ( m_orderInput )
{
m_orderInput->m_delegate = nullptr;
((void (__fastcall *)(CCTextInputNode *))a1->m_orderInput->onClickTrackNode)(a1->m_orderInput);
}
m_channelInput = a1->m_channelInput;
if ( m_channelInput )
{
m_channelInput->m_delegate = nullptr;
((void (__fastcall *)(CCTextInputNode *))a1->m_channelInput->onClickTrackNode)(a1->m_channelInput);
}
m_settingsObject = a1->m_settingsObject;
if ( !m_settingsObject->m_startsWithStartPos )
{
m_songSelectNode = a1->m_songSelectNode;
if ( m_songSelectNode && m_songSelectNode->m_songChanged )
{
m_level = m_settingsObject->m_level;
if ( m_songSelectNode->m_isCustomSong )
{
m_level->m_songID = m_songSelectNode->m_selectedSongID;
}
else
{
m_level->m_songID = m_songSelectNode->m_isCustomSong;
m_level->m_audioTrack = m_songSelectNode->m_selectedSongID;
}
m_settingsObject->m_guidelinesUpdated = 1;
}
if ( m_settingsObject->m_startSpeed != a1->m_speed || m_settingsObject->m_guidelinesUpdated )
m_settingsObject->m_guidelinesUpdated = 0;
m_delegate = a1->m_delegate;
if ( m_delegate )
m_delegate->levelSettingsUpdated(m_delegate);
}
a1->setKeypadEnabled(a1, 0);
a1->removeFromParentAndCleanup(a1, 1);
}