//
// SecretLayer3::dialogClosed from 0x100311618 to 0x10031186c (596 bytes)
//
// 2 xrefs:
// > sub_10031186C @ 0x100311870
// > ??> @ 0x1007ee0f8
//
// 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 SecretLayer3::dialogClosed(SecretLayer3 *a1, DialogLayer *a2)
{
char v4; // w8
int v5; // w23
cocos2d::ccColor4B v6; // w8
cocos2d::CCLayerColor *v7; // x20
cocos2d::CCFadeTo *v8; // x21
char v9; // w0
__int64 v10; // x1
__int64 v11; // x2
__int64 v12; // x3
__int64 v13; // x4
__int64 v14; // x5
__int64 v15; // x6
__int64 v16; // x7
cocos2d::CCSequence *v17; // x0
CCMenuItemSpriteExtra *m_secretChest; // x0
cocos2d::CCDelayTime *v19; // x20
char v20; // w0
__int64 v21; // x1
__int64 v22; // x2
__int64 v23; // x3
__int64 v24; // x4
__int64 v25; // x5
__int64 v26; // x6
__int64 v27; // x7
cocos2d::CCSequence *v28; // x0
GameManager *v29; // x0
const char *v30; // x1
cocos2d::ccColor4B v31; // [xsp+1Ch] [xbp-34h] BYREF
cocos2d::SEL_CallFunc v32; // 0:x1.16
cocos2d::SEL_CallFunc v33; // 0:x1.16
if ( ((unsigned int (__fastcall *)(DialogLayer *))a2->getTag)(a2) != 4 )
{
if ( ((unsigned int (__fastcall *)(DialogLayer *))a2->getTag)(a2) == 5 )
{
v29 = GameManager::sharedState();
v30 = "13";
}
else
{
if ( ((unsigned int (__fastcall *)(DialogLayer *))a2->getTag)(a2) == 3 )
{
SecretLayer3::revealStep3(a1);
return;
}
if ( ((unsigned int (__fastcall *)(DialogLayer *))a2->getTag)(a2) == 1 )
{
SecretLayer3::firstInteractionStep3(a1);
return;
}
if ( ((unsigned int (__fastcall *)(DialogLayer *))a2->getTag)(a2) != 2 )
{
if ( ((unsigned int (__fastcall *)(DialogLayer *))a2->getTag)(a2) != 6 )
return;
LABEL_13:
a1->m_lockInput = 0;
return;
}
v29 = GameManager::sharedState();
v30 = "12";
}
GameManager::setUGV(v29, v30, 1);
goto LABEL_13;
}
v4 = 1;
do
{
v5 = v4 & 1;
if ( (v4 & 1) != 0 )
v6 = (cocos2d::ccColor4B)-1;
else
v6 = (cocos2d::ccColor4B)1358954495;
v31 = v6;
v7 = cocos2d::CCLayerColor::create_1(&v31);
((void (__fastcall *)(SecretLayer3 *, cocos2d::CCLayerColor *, __int64))a1->addChild_0)(a1, v7, 100);
((void (__fastcall *)(cocos2d::CCLayerColor *, __int64))v7->setBlendFunc)(v7, 0x100000302LL);
v8 = cocos2d::CCFadeTo::create(2.0, 0);
v32.ptr = (void (*)(void))520;
v32.adj = 1;
v9 = (unsigned __int8)cocos2d::CCCallFunc::create(v7, v32);
v17 = sub_10018A494(v8, v10, v11, v12, v13, v14, v15, v16, v9);
cocos2d::CCNode::runAction(v7, v17);
v4 = 0;
}
while ( v5 );
cocos2d::CCNode::stopAllActions(a1->m_demonEyes);
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))a1->m_demonEyes->setVisible)(a1->m_demonEyes, 0);
((void (__fastcall *)(cocos2d::CCSprite *, _QWORD))a1->m_demonBody->setVisible)(a1->m_demonBody, 0);
m_secretChest = a1->m_secretChest;
if ( m_secretChest )
{
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))m_secretChest->setVisible)(m_secretChest, 1);
((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))a1->m_secretChest->setEnabled)(a1->m_secretChest, 1);
}
v19 = cocos2d::CCDelayTime::create(3.0);
v33.ptr = (void (*)(void))SecretLayer3::revealStep5;
v33.adj = 0;
v20 = (unsigned __int8)cocos2d::CCCallFunc::create(a1, v33);
v28 = sub_10018A494(v19, v21, v22, v23, v24, v25, v26, v27, v20);
cocos2d::CCNode::runAction(a1, v28);
}