//
// SecretLayer5::onSubmit from 0x100074edc to 0x10007522c (848 bytes)
//
// 1 xrefs:
// > SecretLayer5::init @ 0x1000747b0
//
// 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 SecretLayer5::onSubmit(SecretLayer5 *a1, cocos2d::CCObject *a2)
{
CCTextInputNode *m_textInput; // x20
CCTextInputNode *v4; // x20
MusicDownloadManager *v5; // x20
__int64 v6; // x1
FMODAudioEngine *v7; // x20
unsigned int v8; // w0
cocos2d::CCParticleSystemQuad *v9; // x20
float32x2_t *v10; // x21
__n128 v11; // q0
__n128 v12; // q1
double v13; // d0
cocos2d::CCDelayTime *v14; // x20
cocos2d::CCAction *v15; // x0
cocos2d::CCDelayTime *v16; // x20
cocos2d::CCAction *v17; // x0
GameLevelManager *v18; // x20
cocos2d::CCDelayTime *v19; // x20
cocos2d::CCAction *v20; // x0
void *__dst[2]; // [xsp+10h] [xbp-E0h] BYREF
__int64 v22; // [xsp+20h] [xbp-D0h]
float32x2_t v23; // [xsp+30h] [xbp-C0h] BYREF
void *v24[2]; // [xsp+38h] [xbp-B8h] BYREF
char v25; // [xsp+4Fh] [xbp-A1h]
void *__p[2]; // [xsp+50h] [xbp-A0h] BYREF
__int64 v27; // [xsp+60h] [xbp-90h]
void *v28[2]; // [xsp+70h] [xbp-80h] BYREF
__int64 v29; // [xsp+80h] [xbp-70h]
void *v30[2]; // [xsp+88h] [xbp-68h] BYREF
char v31; // [xsp+9Fh] [xbp-51h]
void *v32[2]; // [xsp+A0h] [xbp-50h] BYREF
char v33; // [xsp+B7h] [xbp-39h]
__int128 v34; // [xsp+B8h] [xbp-38h] BYREF
__int64 v35; // [xsp+C8h] [xbp-28h]
cocos2d::SEL_CallFunc v36; // 0:x1.16
cocos2d::SEL_CallFunc v37; // 0:x1.16
cocos2d::SEL_CallFunc v38; // 0:x1.16
if ( !a1->m_loading && !a1->m_uiLocked )
{
a1->m_rewardStatus = 0;
std::string::assign((std::string *)&a1->m_chestID, "");
a1->m_loading = 1;
CCTextInputNode::getString(&v34, a1->m_textInput);
m_textInput = a1->m_textInput;
sub_100009900(v32, "");
CCTextInputNode::setString(m_textInput, v32);
if ( v33 < 0 )
operator delete(v32[0]);
v4 = a1->m_textInput;
sub_100009900(v30, " ");
CCTextInputNode::updateLabel(v4, v30);
if ( v31 < 0 )
operator delete(v30[0]);
v5 = MusicDownloadManager::sharedState();
if ( vcvts_n_f32_s32(rand(), 0x1Fu) <= 0.5 )
v6 = 9983;
else
v6 = 9982;
MusicDownloadManager::pathForSFX(v28, v5, v6);
v7 = FMODAudioEngine::sharedEngine();
if ( SHIBYTE(v29) < 0 )
{
sub_1000097D0(__p, v28[0], (unsigned __int64)v28[1]);
}
else
{
*(_OWORD *)__p = *(_OWORD *)v28;
v27 = v29;
}
v8 = rand();
FMODAudioEngine::playEffect(v7, __p, (float)(vcvts_n_f32_s32(v8, 0x1Fu) * 0.1) + 0.9, 0.0, 0.5);
if ( SHIBYTE(v27) < 0 )
operator delete(__p[0]);
sub_100009900(
v24,
"40a0.21a0.81a0.2a180a90a10a12a6a90a12a0a0a0a0a0a0a25a10a0a10a0a0a0.815686a0a1a0a1a0a4a1a0a0a0.733333a0a0a0a1a0a1a0"
"a0a0a0.2a0a0a0a0a0a0a0a0a2a1a1a0a0a26a0a0a0a0a0a0a0a0a0a0a0a0a0a0");
v9 = GameToolbox::particleFromString((__int64)v24, nullptr, 0);
if ( v25 < 0 )
operator delete(v24[0]);
((void (__fastcall *)(SecretLayer5 *, cocos2d::CCParticleSystemQuad *, __int64))a1->addChild_0)(a1, v9, 30);
v10 = (float32x2_t *)((__int64 (__fastcall *)(CCTextInputNode *))a1->m_textInput->getPosition)(a1->m_textInput);
v11.n128_u32[0] = 0;
v12.n128_u32[0] = 0;
sub_100022980(v11, v12, &v23);
*(float32x2_t *)&v13 = sub_1000229DC(v10, &v23, (float32x2_t *)v24);
((void (__fastcall *)(cocos2d::CCParticleSystemQuad *, void **, double))v9->setPosition)(v9, v24, v13);
SecretLayer5::incrementChatIdx(a1);
v14 = cocos2d::CCDelayTime::create(0.3);
v36.ptr = (void (*)(void))SecretLayer5::fadeInSubmitMessage;
v36.adj = 0;
cocos2d::CCCallFunc::create(a1, v36);
v15 = (cocos2d::CCAction *)sub_10018A494(v14);
cocos2d::CCNode::runAction(a1, v15);
v16 = cocos2d::CCDelayTime::create(0.0);
v37.ptr = (void (*)(void))SecretLayer5::animateHead;
v37.adj = 0;
cocos2d::CCCallFunc::create(a1, v37);
v17 = (cocos2d::CCAction *)sub_10018A494(v16);
cocos2d::CCNode::runAction(a1, v17);
SecretLayer5::hideTextInput(a1);
LoadingCircleSprite::fadeInCircle(a1->m_circleSprite, 0, 0.8, 150.0);
((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))a1->m_wraithButton->setEnabled)(a1->m_wraithButton, 0);
v18 = GameLevelManager::sharedState();
if ( SHIBYTE(v35) < 0 )
{
sub_1000097D0(__dst, (void *)v34, *((unsigned __int64 *)&v34 + 1));
}
else
{
*(_OWORD *)__dst = v34;
v22 = v35;
}
GameLevelManager::getGJSecretReward(v18, __dst);
if ( SHIBYTE(v22) < 0 )
operator delete(__dst[0]);
v19 = cocos2d::CCDelayTime::create(4.0);
v38.ptr = (void (*)(void))SecretLayer5::finishLoadingState;
v38.adj = 0;
cocos2d::CCCallFunc::create(a1, v38);
v20 = (cocos2d::CCAction *)sub_10018A494(v19);
cocos2d::CCNode::runAction(a1, v20);
if ( SHIBYTE(v29) < 0 )
operator delete(v28[0]);
if ( SHIBYTE(v35) < 0 )
operator delete((void *)v34);
}
}