//
// DialogLayer::init from 0xa70fcc to 0xa7144c (1152 bytes)
//
// 2 xrefs:
// > DialogLayer::createDialogLayer @ 0xa71538
// > ??> @ 0xc5920
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:00:23 +0000
//
__int64 __fastcall DialogLayer::init(DialogLayer *this, DialogObject *a2, cocos2d::CCArray *a3, unsigned int a4)
{
unsigned __int64 v7; // x0
unsigned int v8; // w23
cocos2d::CCDirector *v9; // x0
char *v10; // x27
cocos2d::CCDirector *WinSize; // x0
__int64 v12; // x0
cocos2d::CCTouchDispatcher *v13; // x0
cocos2d::CCLayer *v14; // x0
__int64 v15; // x0
__int64 v16; // x2
__int64 v17; // x26
void (__fastcall *v18)(__int64, char *); // x28
cocos2d::CCString *v19; // x0
const char *CString; // x0
size_t v21; // x0
__int64 v22; // x21
void (__fastcall *v23)(__int64, char *); // x25
const char *v24; // x2
__int64 v25; // x0
__int64 v26; // x3
__int64 v27; // x21
void (__fastcall *v28)(__int64, char *); // x25
__int64 v29; // x21
void (__fastcall *v30)(__int64, char *); // x25
__int64 v31; // x21
void (__fastcall *v32)(__int64, char *); // x25
void (__fastcall *v33)(__int64, char *); // x2
const char *v34; // x1
__int64 v35; // x0
__int64 v36; // x3
__int64 v37; // x21
void (__fastcall *v38)(__int64, char *); // x25
cocos2d::CCObject *v41; // [xsp+78h] [xbp+78h]
__int64 v42; // [xsp+80h] [xbp+80h] BYREF
_BYTE v43[8]; // [xsp+88h] [xbp+88h] BYREF
_BYTE v44[16]; // [xsp+90h] [xbp+90h] BYREF
char v45; // [xsp+A0h] [xbp+A0h] BYREF
char v46; // [xsp+A1h] [xbp+A1h]
char v47; // [xsp+A2h] [xbp+A2h]
char v48; // [xsp+A3h] [xbp+A3h]
__int64 v49[2]; // [xsp+B0h] [xbp+B0h] BYREF
void *v50; // [xsp+C0h] [xbp+C0h]
v45 = 0;
v46 = 0;
v47 = 0;
v48 = -106;
v7 = (unsigned __int8)cocos2d::CCLayerColor::initWithColor(this, &v45);
v8 = (unsigned __int8)v7;
if ( (_BYTE)v7 )
{
if ( a3 )
{
*((_QWORD *)this + 74) = a3;
v7 = cocos2d::CCObject::retain(a3);
}
v9 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v7);
v10 = (char *)v49 + 1;
WinSize = (cocos2d::CCDirector *)cocos2d::CCDirector::getWinSize(&v42, v9);
v12 = cocos2d::CCDirector::sharedDirector(WinSize);
v13 = (cocos2d::CCTouchDispatcher *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v12 + 160LL))(v12);
cocos2d::CCTouchDispatcher::registerForcePrio(v13, this, 2, 0);
(*(void (__fastcall **)(DialogLayer *, __int64))(*(_QWORD *)this + 1000LL))(this, 1);
(*(void (__fastcall **)(DialogLayer *, __int64))(*(_QWORD *)this + 1072LL))(this, 1);
v14 = (cocos2d::CCLayer *)(*(__int64 (__fastcall **)(DialogLayer *, __int64))(*(_QWORD *)this + 1088LL))(this, 1);
v15 = cocos2d::CCLayer::create(v14);
v16 = *(_QWORD *)this;
*((_QWORD *)this + 70) = v15;
(*(void (__fastcall **)(DialogLayer *))(v16 + 456))(this);
(*(void (__fastcall **)(_QWORD, void *))(**((_QWORD **)this + 70) + 320LL))(*((_QWORD *)this + 70), &unk_155D768);
v17 = *((_QWORD *)this + 70);
v18 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)v17 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v45, *(float *)&v42 * 0.5, *((float *)&v42 + 1) * 0.5);
v18(v17, &v45);
v19 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"GJ_square%02d.png",
(const char *)a4);
CString = (const char *)cocos2d::CCString::getCString(v19);
v49[0] = 0;
v41 = (cocos2d::CCObject *)CString;
v49[1] = 0;
v50 = nullptr;
v21 = strlen(CString);
std::string::__init(v49, v41, v21);
if ( (v49[0] & 1) != 0 )
v10 = (char *)v50;
cocos2d::CCRect::CCRect((cocos2d::CCRect *)&v45, 0.0, 0.0, 80.0, 80.0);
v22 = cocos2d::extension::CCScale9Sprite::create(v10, &v45);
v23 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)v22 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v45, 380.0, 100.0);
v23(v22, &v45);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 70) + 464LL))(
*((_QWORD *)this + 70),
v22,
4294967294LL);
v25 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)&byte_11E1A70, "bigFont.fnt", v24);
v26 = *((_QWORD *)this + 70);
*((_QWORD *)this + 71) = v25;
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v26 + 464LL))(v26, v25, 2);
v27 = *((_QWORD *)this + 71);
v28 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)v27 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v45, 0.0, 1.0);
v28(v27, &v45);
v29 = *((_QWORD *)this + 71);
v30 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)v29 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v45, -93.0, 36.0);
v30(v29, &v45);
cocos2d::CCLabelBMFont::limitLabelWidth(*((cocos2d::CCLabelBMFont **)this + 71), 200.0, 0.5, 0.0);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v44, 0.0, 0.0, 80.0, 80.0);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)&v45, (const cocos2d::CCRect *)v44);
v31 = cocos2d::extension::CCScale9Sprite::create("square02b_001.png", &v45);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v43, 280.0, 80.0);
(*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v31 + 320LL))(v31, v43);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 70) + 464LL))(
*((_QWORD *)this + 70),
v31,
0xFFFFFFFFLL);
v32 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)v31 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v45, 40.0, 0.0);
v32(v31, &v45);
v33 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)v31 + 960LL);
v45 = 0;
v46 = 0;
v47 = 0;
v33(v31, &v45);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v31 + 912LL))(v31, 50);
v35 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_chatBtn_01_001.png", v34);
v36 = *((_QWORD *)this + 70);
*((_QWORD *)this + 76) = v35;
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v36 + 464LL))(v36, v35, 3);
v37 = *((_QWORD *)this + 76);
v38 = *(void (__fastcall **)(__int64, char *))(*(_QWORD *)v37 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v45, 0.0, -50.0);
v38(v37, &v45);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)this + 76) + 912LL))(*((_QWORD *)this + 76), 0);
if ( *((_QWORD *)this + 74) )
DialogLayer::displayNextObject((cocos2d::CCArray **)this);
else
DialogLayer::displayDialogObject(this, a2);
DialogLayer::updateNavButtonFrame(this);
if ( (v49[0] & 1) != 0 )
operator delete(v50);
}
return v8;
}