//
// LevelAreaLayer::showDialog from 0x1402c5280 to 0x1402c55a8 (808 bytes)
//
// 2 xrefs:
// > LevelAreaLayer::init @ 0x1402c51e7
// > ??> @ 0x1406d2aec
//
// 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
//
// Hidden C++ exception states: #wind=2
void LevelAreaLayer::showDialog(LevelAreaLayer *a1)
{
GameManager *v2; // rcx
__int64 v3; // rcx
cocos2d::CCArray *v4; // rbx
char *v5; // rax
char *v6; // rax
DialogLayer *DialogLayer; // rax
DialogLayer *v8; // rdi
DialogDelegate *v9; // rcx
__int64 v10; // rax
__int64 v11; // rcx
DialogDelegate *v12; // rax
cocos2d::CCDirector *v13; // rax
cocos2d::CCLayer_vtbl *v14; // rbx
const cocos2d::CCPoint *v15; // rax
char v16[8]; // [rsp+30h] [rbp-40h] BYREF
__int64 v17; // [rsp+38h] [rbp-38h]
__int64 v18; // [rsp+40h] [rbp-30h]
__int64 v19; // [rsp+48h] [rbp-28h]
__int128 v20; // [rsp+50h] [rbp-20h] BYREF
__int64 v21; // [rsp+60h] [rbp-10h]
__int64 v22; // [rsp+68h] [rbp-8h]
void *v23; // [rsp+98h] [rbp+28h]
__int16 v24; // [rsp+A0h] [rbp+30h] BYREF
char v25; // [rsp+A2h] [rbp+32h]
v2 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v23 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v23);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v2 = (GameManager *)qword_1406C2ED8;
}
GameManager::setUGV(v2, (const char *)&word_14055A524, 1);
v4 = (cocos2d::CCArray *)cocos2d::CCArray::create(v3);
v24 = -1;
v25 = -1;
v20 = 0;
v21 = 0;
v22 = 15;
*(_QWORD *)&v20 = sub_14003AA10(0x20u);
v21 = 31;
v22 = 31;
strcpy((char *)v20, "Who left the lights on?");
v17 = 0;
v18 = 7;
v19 = 15;
strcpy(v16, "Scratch");
v5 = DialogObject::create((__int64)v16, (__int64)&v20, 13, 1.0, 0, (__int64)&v24);
cocos2d::CCArray::addObject(v4, (struct cocos2d::CCObject *)v5);
v24 = -1;
v25 = -1;
v20 = 0;
v21 = 0;
v22 = 15;
*(_QWORD *)&v20 = sub_14003AA10(0x40u);
v21 = 59;
v22 = 63;
strcpy((char *)v20, "I got a bad feeling about this...");
v17 = 0;
v18 = 7;
v19 = 15;
strcpy(v16, "Scratch");
v6 = DialogObject::create((__int64)v16, (__int64)&v20, 11, 1.0, 0, (__int64)&v24);
cocos2d::CCArray::addObject(v4, (struct cocos2d::CCObject *)v6);
DialogLayer = DialogLayer::createDialogLayer(nullptr, v4, 2);
v8 = DialogLayer;
v9 = &a1->DialogDelegate;
if ( !a1 )
v9 = nullptr;
DialogLayer->m_delegate = v9;
v10 = cocos2d::CCDirector::sharedDirector(v9);
(*(void (__fastcall **)(_QWORD, DialogLayer *, __int64))(**(_QWORD **)(v10 + 264) + 440LL))(
*(_QWORD *)(v10 + 264),
v8,
1000);
v12 = &a1->DialogDelegate;
if ( !a1 )
v12 = nullptr;
v8->m_delegate = v12;
v13 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v11);
cocos2d::CCDirector::getWinSize(v13);
v14 = v8->m_mainLayer->__vftable;
cocos2d::CCPoint::CCPoint(0.0000000025668347, COERCE_FLOAT(&v20) * 0.5);
v14->setPosition_0(v8->m_mainLayer, v15);
DialogLayer::animateInRandomSide(v8);
}