//
// SetupSmartTemplateLayer::onClose from 0x100070fd0 to 0x1000710a0 (208 bytes)
//
// 2 xrefs:
// > SetupSmartTemplateLayer::onBack @ 0x100070de8
// > SetupSmartTemplateLayer::onClick @ 0x100070e60
//
// 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 SetupSmartTemplateLayer::onClose(SetupSmartTemplateLayer *a1, cocos2d::CCObject *a2)
{
cocos2d::CCNode *m_unk298; // x0
GJSmartTemplate *m_smartTemplate; // x8
cocos2d::CCDirector *v5; // x0
cocos2d::CCTouchDispatcher *v6; // x0
cocos2d::CCString *v7; // x0
const char *CString; // x0
m_unk298 = a1->m_unk298;
if ( m_unk298 )
((void (__fastcall *)(cocos2d::CCNode *, __int64))m_unk298->setVisible)(m_unk298, 1);
((void (__fastcall *)(CCTextInputNode *, _QWORD))a1->m_nameInput->onClickTrackNode)(a1->m_nameInput, 0);
m_smartTemplate = a1->m_smartTemplate;
if ( (m_smartTemplate->m_templateName.m_data.m_short.shortStorage.__elems_[22] & 0x8000000000000000LL) != 0 )
{
if ( m_smartTemplate->m_templateName.m_data.m_long.size )
goto LABEL_5;
LABEL_7:
v7 = (cocos2d::CCString *)sub_100268F4C("SmartTemplate_%i", m_smartTemplate->m_nameIndex);
CString = cocos2d::CCString::getCString(v7);
std::string::assign((std::string *)&a1->m_smartTemplate->m_templateName, CString);
goto LABEL_5;
}
if ( !m_smartTemplate->m_templateName.m_data.m_short.shortStorage.__elems_[22] )
goto LABEL_7;
LABEL_5:
((void (__fastcall *)(SetupSmartTemplateLayer *, _QWORD))a1->setKeypadEnabled)(a1, 0);
((void (__fastcall *)(SetupSmartTemplateLayer *, __int64))a1->removeFromParentAndCleanup)(a1, 1);
v5 = cocos2d::CCDirector::sharedDirector();
v6 = (cocos2d::CCTouchDispatcher *)((__int64 (__fastcall *)(cocos2d::CCDirector *))v5->getTouchDispatcher)(v5);
cocos2d::CCTouchDispatcher::unregisterForcePrio(v6, a1);
}