//
// ShareCommentLayer::init from 0x541358 to 0x54201a (3266 bytes)
//
// 1 xrefs:
// > ShareCommentLayer::create @ 0x5421e6
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:52:20 +0000
//
GameManager *__fastcall ShareCommentLayer::init(int a1, int a2, int a3, unsigned int a4, int a5, unsigned __int8 *a6)
{
GameManager *v10; // r0
bool v11; // r3
int v12; // r9
int v13; // r3
float v14; // s17
float v15; // s19
float v16; // s16
float v17; // s20
void (__fastcall *v18)(int, _DWORD *); // r5
const char *v19; // r2
cocos2d::CCLabelBMFont *v20; // r0
float v21; // s16
int v22; // r8
void (__fastcall *v23)(int, _DWORD *); // r5
GameLevelManager *v24; // r0
cocos2d::CCDictionary **v25; // r0
char *v26; // r3
_BOOL4 v27; // r9
char *v28; // r1
char *v29; // r9
const char *v30; // r2
int v31; // r5
unsigned int v32; // r3
cocos2d::CCLabelBMFont *v33; // r10
char *v34; // r5
cocos2d::CCLabelBMFont *v35; // r0
int v36; // r5
void (__fastcall *v37)(int, _DWORD *); // r10
int v38; // r11
int v39; // r0
cocos2d::CCArray *updated; // r0
const char *v41; // r1
int v42; // r7
const cocos2d::CCPoint *v43; // r9
const cocos2d::CCPoint *v44; // r10
int (__fastcall *v45)(int, _DWORD *); // r8
float v46; // s15
float v47; // r1
int v48; // r9
const cocos2d::CCPoint *v49; // r5
const cocos2d::CCPoint *v50; // r11
int (__fastcall *v51)(int, _DWORD *); // r10
const char *v52; // r1
int v53; // r9
const char *v54; // r1
int v55; // r10
cocos2d::CCNodeRGBA *v56; // r10
const cocos2d::CCPoint *v57; // r11
const char *v58; // r2
int v59; // r0
int v60; // r11
void (__fastcall *v61)(int, _DWORD *); // r10
int v62; // r11
void (__fastcall *v63)(int, _DWORD *); // r10
float *v64; // r0
int v65; // r0
cocos2d::CCArray *v66; // r0
cocos2d::CCArray *v67; // r7
const char *v68; // r1
char *v69; // r1
ButtonSprite *v70; // r0
ButtonSprite *v71; // r0
cocos2d::CCObject *v72; // r6
ButtonSprite *v73; // r0
ButtonSprite *v74; // r0
cocos2d::CCObject *v75; // r6
const cocos2d::CCPoint *v76; // r9
float v77; // r8
float v78; // s18
int v79; // r0
int v80; // r7
void (__fastcall *v81)(int, _DWORD *); // r3
int v82; // r3
int *v83; // r0
char *v84; // r1
float v85; // s17
char *v86; // r2
int *v87; // r0
int v88; // r9
int *v89; // r0
unsigned int v90; // r3
int v91; // r7
int v92; // r6
TextArea *v93; // r7
EmoteSprite *v94; // r0
cocos2d::CCString *v95; // r0
cocos2d::CCLabelBMFont *CString; // r0
CCTextInputNode *v97; // r6
int v98; // r0
const char *v99; // r2
int v100; // r0
int v101; // r7
void (__fastcall *v102)(int, _DWORD *); // r8
int v103; // r1
int v104; // r2
int v105; // r3
cocos2d::CCSprite *v106; // r7
int v107; // r0
int v108; // r6
const cocos2d::CCPoint *v109; // r11
void (__fastcall *v110)(int, _BYTE *); // r9
int v111; // r3
int v112; // r3
int v113; // r6
char *v115; // [sp+8h] [bp-104h]
cocos2d::CCPoint *v116; // [sp+14h] [bp-F8h]
GameManager *v117; // [sp+18h] [bp-F4h]
void (__fastcall *v118)(cocos2d::CCNodeRGBA *, _DWORD *); // [sp+24h] [bp-E8h]
int v119; // [sp+28h] [bp-E4h]
float v120[2]; // [sp+2Ch] [bp-E0h] BYREF
float v121; // [sp+34h] [bp-D8h] BYREF
float v122; // [sp+38h] [bp-D4h]
_BYTE v123[8]; // [sp+3Ch] [bp-D0h] BYREF
_BYTE v124[8]; // [sp+44h] [bp-C8h] BYREF
char v125[8]; // [sp+4Ch] [bp-C0h] BYREF
char v126[8]; // [sp+54h] [bp-B8h] BYREF
_BYTE v127[8]; // [sp+5Ch] [bp-B0h] BYREF
int (__fastcall *v128)(ShareCommentLayer *, cocos2d::CCObject *); // [sp+64h] [bp-A8h]
int v129; // [sp+68h] [bp-A4h]
_DWORD (*v130)(ShareCommentLayer *__hidden, cocos2d::CCObject *); // [sp+6Ch] [bp-A0h]
int v131; // [sp+70h] [bp-9Ch]
int (__fastcall *v132)(ShareCommentLayer *, cocos2d::CCObject *); // [sp+74h] [bp-98h]
int v133; // [sp+78h] [bp-94h]
_DWORD v134[2]; // [sp+7Ch] [bp-90h] BYREF
int v135[2]; // [sp+84h] [bp-88h] BYREF
ButtonSprite *v136; // [sp+8Ch] [bp-80h]
int v137[2]; // [sp+90h] [bp-7Ch] BYREF
ButtonSprite *v138; // [sp+98h] [bp-74h]
int v139[3]; // [sp+9Ch] [bp-70h] BYREF
int v140[3]; // [sp+A8h] [bp-64h] BYREF
int v141[3]; // [sp+B4h] [bp-58h] BYREF
int v142[3]; // [sp+C0h] [bp-4Ch] BYREF
int v143; // [sp+CCh] [bp-40h] BYREF
char *v144; // [sp+D0h] [bp-3Ch]
char *v145; // [sp+D4h] [bp-38h]
int v146; // [sp+D8h] [bp-34h] BYREF
int v147; // [sp+DCh] [bp-30h]
cocos2d::CCLabelBMFont *v148; // [sp+E0h] [bp-2Ch]
_BYTE v149[16]; // [sp+E4h] [bp-28h] BYREF
_DWORD v150[4]; // [sp+F4h] [bp-18h] BYREF
v10 = FLAlertLayer::init((FLAlertLayer *)a1, 150);
v117 = v10;
if ( !v10 )
return v117;
*(_DWORD *)(a1 + 532) = a3;
*(_DWORD *)(a1 + 540) = a4;
*(_DWORD *)(a1 + 536) = a5;
if ( a4 <= 1 || a4 - 3 <= 1 || a4 - 6 <= 1 || a4 == 9 )
{
v11 = (char)v10;
}
else
{
v10 = (GameManager *)(a4 - 2);
v11 = a4 == 2;
}
*(_BYTE *)(a1 + 544) = v11;
cocos2d::CCDirector::sharedDirector(v10);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v120);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v150, 0.0, 0.0, 80.0, 80.0);
v12 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v150);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v12 + 456))(v12, 255);
v13 = *(_DWORD *)(a1 + 540);
if ( v13 == 2 )
{
v14 = 60.0;
v17 = -5.0;
v15 = 40.0;
v16 = 160.0;
}
else if ( v13 == 4 )
{
v17 = 7.0;
v14 = 180.0;
v15 = 0.0;
v16 = 270.0;
}
else
{
v14 = 180.0;
v15 = 0.0;
if ( v13 != 9 )
v14 = 60.0;
v16 = 270.0;
v17 = 7.0;
if ( v13 != 9 )
{
v15 = 80.0;
v16 = 135.0;
}
}
v18 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v12 + 160);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v150, 400.0, v16);
v18(v12, v150);
(*(void (__fastcall **)(_DWORD, int, int))(**(_DWORD **)(a1 + 460) + 232))(*(_DWORD *)(a1 + 460), v12, -1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v121, v120[0] * 0.5, v15 + (float)(v120[1] * 0.5));
(*(void (__fastcall **)(int, float *))(*(_DWORD *)v12 + 92))(v12, &v121);
if ( (*(_BYTE *)a2 & 1) != 0 )
v20 = *(cocos2d::CCLabelBMFont **)(a2 + 8);
else
v20 = (cocos2d::CCLabelBMFont *)(a2 + 1);
v21 = v16 * 0.5;
v22 = cocos2d::CCLabelBMFont::create(v20, "bigFont.fnt", v19);
v23 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v22 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v150, v121, (float)(v21 + v122) - 16.0);
v23(v22, v150);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 460) + 228))(*(_DWORD *)(a1 + 460), v22);
v24 = (GameLevelManager *)(*(int (__fastcall **)(int, int))(*(_DWORD *)v22 + 80))(v22, 1058642330);
if ( *(_DWORD *)(a1 + 540) == 2 )
{
v25 = (cocos2d::CCDictionary **)GameLevelManager::sharedState(v24);
GameLevelManager::tryGetUsername((GameLevelManager *)&v143, v25, *(_DWORD *)(a1 + 536));
if ( (v143 & 1) != 0 )
v26 = v144;
else
v26 = (char *)((int)(unsigned __int8)v143 >> 1);
if ( v26 )
{
v146 = 0;
v147 = 0;
v148 = nullptr;
std::string::__init(&v146, "-", 1u);
v27 = sub_540BB4((unsigned __int8 *)&v146, (unsigned __int8 *)&v143);
std::string::~string((int)&v146);
if ( !v27 )
{
v146 = 0;
v147 = 0;
v148 = nullptr;
std::string::__init(&v146, "Send friend request to ", 0x17u);
if ( (v143 & 1) != 0 )
{
v28 = v145;
v29 = v144;
}
else
{
v29 = (char *)((int)(unsigned __int8)v143 >> 1);
v28 = (char *)&v143 + 1;
}
v30 = (const char *)(v146 & 1);
if ( v30 )
{
v31 = v147;
v32 = (v146 & 0xFFFFFFFE) - 1;
}
else
{
v31 = (int)(unsigned __int8)v146 >> 1;
v32 = 10;
}
if ( v32 - v31 < (unsigned int)v29 )
{
std::string::__grow_by_and_replace(
(int)&v146,
v32,
(unsigned int)&v29[v31 - v32],
v31,
v31,
0,
(size_t)v29,
v28);
}
else if ( v29 )
{
if ( v30 )
v33 = v148;
else
v33 = (cocos2d::CCLabelBMFont *)((char *)&v146 + 1);
std::char_traits::copy((char *)v33 + v31, v28, (size_t)v29);
v34 = &v29[v31];
if ( (v146 & 1) != 0 )
v147 = (int)v34;
else
LOBYTE(v146) = 2 * (_BYTE)v34;
v34[(_DWORD)v33] = 0;
}
if ( (v146 & 1) != 0 )
v35 = v148;
else
v35 = (cocos2d::CCLabelBMFont *)((char *)&v146 + 1);
v36 = cocos2d::CCLabelBMFont::create(v35, "goldFont.fnt", v30);
v37 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v36 + 92);
v38 = (*(int (__fastcall **)(int))(*(_DWORD *)v22 + 96))(v22);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v149, 0.0, -20.0);
cocos2d::CCPoint::operator+(v150, v38, v149);
v37(v36, v150);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 460) + 228))(*(_DWORD *)(a1 + 460), v36);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v36 + 80))(v36, 1058642330);
std::string::~string((int)&v146);
}
}
v24 = (GameLevelManager *)std::string::~string((int)&v143);
}
*(_DWORD *)(a1 + 500) = -1;
v39 = cocos2d::CCMenu::create(v24);
*(_DWORD *)(a1 + 444) = v39;
updated = (cocos2d::CCArray *)(*(int (__fastcall **)(_DWORD, int, int))(**(_DWORD **)(a1 + 460) + 232))(
*(_DWORD *)(a1 + 460),
v39,
10);
if ( a4 == 2 )
{
v143 = 0;
v144 = nullptr;
v145 = nullptr;
std::string::__init(&v143, "Friend Requests", 0xFu);
v146 = 0;
v147 = 0;
v148 = nullptr;
std::string::__init(
&v146,
"A request can carry a short message only if the other player allows it in their Account Settings.\n"
"A request that is not answered expires after 120 days.",
0xB0u);
v42 = InfoAlertButton::create(&v143, &v146, 1065353216);
std::string::~string((int)&v146);
std::string::~string((int)&v143);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 444) + 228))(*(_DWORD *)(a1 + 444), v42);
v43 = *(const cocos2d::CCPoint **)(a1 + 444);
v44 = *(const cocos2d::CCPoint **)(a1 + 460);
v45 = *(int (__fastcall **)(int, _DWORD *))(*(_DWORD *)v42 + 92);
v46 = (float)(v21 + v122) - 4.0;
v47 = (float)(v121 - 200.0) + 4.0;
LABEL_54:
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v134, v47, v46);
cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)v149, v44);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v150, v43);
updated = (cocos2d::CCArray *)v45(v42, v150);
goto LABEL_55;
}
if ( a4 && a4 != 7 )
{
if ( a4 == 4 || a4 == 9 )
{
v65 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_resetBtn_001.png", v41);
v131 = 0;
v130 = ShareCommentLayer::onClear;
v42 = CCMenuItemSpriteExtra::create(v65, 0, a1, (int)ShareCommentLayer::onClear, 0);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 444) + 228))(*(_DWORD *)(a1 + 444), v42);
v43 = *(const cocos2d::CCPoint **)(a1 + 444);
v44 = *(const cocos2d::CCPoint **)(a1 + 460);
v45 = *(int (__fastcall **)(int, _DWORD *))(*(_DWORD *)v42 + 92);
v47 = (float)(v121 - 200.0) + 18.0;
v46 = (float)(v21 + v122) - 18.0;
goto LABEL_54;
}
}
else
{
v143 = 0;
v144 = nullptr;
v145 = nullptr;
std::string::__init(&v143, "Comment Rules", 0xDu);
v146 = 0;
v147 = 0;
v148 = nullptr;
std::string::__init(
&v146,
"1. Do not spam.\n"
"2. Do not harass other players.\n"
"3. Do not post inappropriate or controversial content.\n"
"4. Do not try to bypass these rules.\n"
"These rules and their enforcement are entirely at Moderators' discretion.",
0xFDu);
v48 = InfoAlertButton::create(&v143, &v146, 1065353216);
std::string::~string((int)&v146);
std::string::~string((int)&v143);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 444) + 228))(*(_DWORD *)(a1 + 444), v48);
v49 = *(const cocos2d::CCPoint **)(a1 + 460);
v50 = *(const cocos2d::CCPoint **)(a1 + 444);
v51 = *(int (__fastcall **)(int, _DWORD *))(*(_DWORD *)v48 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v134, (float)(v121 - 200.0) + 4.0, (float)(v21 + v122) - 4.0);
cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)v149, v49);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v150, v50);
updated = (cocos2d::CCArray *)v51(v48, v150);
if ( *(int *)(a1 + 536) > 0 )
{
v53 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_checkOn_001.png", v52);
v55 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_checkOff_001.png", v54);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v53 + 80))(v53, 1058642330);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v55 + 80))(v55, 1058642330);
v129 = 0;
v128 = ShareCommentLayer::onPercent;
v56 = CCMenuItemToggler::create(v55, v53, a1, (int)ShareCommentLayer::onPercent, 0);
(*(void (__fastcall **)(_DWORD, cocos2d::CCNodeRGBA *))(**(_DWORD **)(a1 + 444) + 228))(
*(_DWORD *)(a1 + 444),
v56);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v134, (float)(v121 - 200.0) + 20.0, (float)(v122 - v21) + 20.0);
v57 = *(const cocos2d::CCPoint **)(a1 + 444);
v118 = *(void (__fastcall **)(cocos2d::CCNodeRGBA *, _DWORD *))(*(_DWORD *)v56 + 92);
cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)v149, *(const cocos2d::CCPoint **)(a1 + 460));
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v150, v57);
v118(v56, v150);
CCMenuItemToggler::setSizeMult(v56, 1.5);
v59 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"%", "chatFont.fnt", v58);
*(_DWORD *)(a1 + 588) = v59;
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 460) + 228))(*(_DWORD *)(a1 + 460), v59);
v60 = *(_DWORD *)(a1 + 588);
v61 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v60 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v150, 0.0, 0.5);
v61(v60, v150);
v62 = *(_DWORD *)(a1 + 588);
v63 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v62 + 92);
v64 = (float *)(*(int (__fastcall **)(int))(*(_DWORD *)v53 + 164))(v53);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v149, (float)((float)(*v64 * 0.5) * 0.6) + 4.0, 0.0);
cocos2d::CCPoint::operator+(v150, v134, v149);
v63(v62, v150);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 588) + 80))(*(_DWORD *)(a1 + 588), 1061997773);
updated = (cocos2d::CCArray *)ShareCommentLayer::updatePercentLabel((ShareCommentLayer *)a1);
}
}
LABEL_55:
v66 = (cocos2d::CCArray *)cocos2d::CCArray::create(updated);
v135[0] = 0;
v135[1] = 0;
v136 = nullptr;
v67 = v66;
std::string::__init(v135, "Submit", 6u);
v137[0] = 0;
v137[1] = 0;
v138 = nullptr;
std::string::__init(v137, "Cancel", 6u);
if ( a4 == 4 || a4 == 9 )
{
v69 = "Save";
}
else
{
if ( a4 != 5 )
goto LABEL_59;
v69 = "Create";
}
std::string::assign(v135, v69);
LABEL_59:
if ( (v137[0] & 1) != 0 )
v70 = v138;
else
v70 = (ButtonSprite *)((char *)v137 + 1);
v71 = ButtonSprite::create(v70, v68);
v133 = 0;
v132 = ShareCommentLayer::onClose;
v72 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::create((int)v71, 0, a1, (int)ShareCommentLayer::onClose, 0);
(*(void (__fastcall **)(_DWORD, cocos2d::CCObject *))(**(_DWORD **)(a1 + 444) + 228))(*(_DWORD *)(a1 + 444), v72);
cocos2d::CCArray::addObject(v67, v72);
if ( (v135[0] & 1) != 0 )
v73 = v136;
else
v73 = (ButtonSprite *)((char *)v135 + 1);
v74 = ButtonSprite::create(v73, (const char *)(LOBYTE(v135[0]) << 31));
v134[1] = 0;
v134[0] = ShareCommentLayer::onShare;
v75 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::create((int)v74, 0, a1, (int)ShareCommentLayer::onShare, 0);
(*(void (__fastcall **)(_DWORD, cocos2d::CCObject *))(**(_DWORD **)(a1 + 444) + 228))(*(_DWORD *)(a1 + 444), v75);
cocos2d::CCArray::addObject(v67, v75);
v76 = *(const cocos2d::CCPoint **)(a1 + 444);
v77 = v121;
v78 = (float)(v122 - v21) + 24.0;
v79 = (*(int (__fastcall **)(_DWORD))(**(_DWORD **)(a1 + 460) + 96))(*(_DWORD *)(a1 + 460));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v149, v77, v78 + *(float *)(v79 + 4));
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v150, v76);
GameToolbox::alignItemsHorisontally(*(float *)&v67, 15.0, (int)v150, 0);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v149, 0.0, 0.0, 80.0, 80.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v123, v121, v17 + v122);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v150, (const cocos2d::CCRect *)v149);
v80 = cocos2d::extension::CCScale9Sprite::create("square02b_001.png", v150);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v80 + 456))(v80, 100);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v124, 360.0, v14);
(*(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v80 + 160))(v80, v124);
(*(void (__fastcall **)(_DWORD, int, int))(**(_DWORD **)(a1 + 460) + 232))(*(_DWORD *)(a1 + 460), v80, 1);
(*(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v80 + 92))(v80, v123);
v81 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v80 + 480);
LOWORD(v150[0]) = 0;
BYTE2(v150[0]) = 0;
v81(v80, v150);
memset(v139, 0, sizeof(v139));
std::string::__init(
v139,
" abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,-!?:;)(/\\\"'`*=+-_%[]<>|@&^#{}%$~",
0x61u);
v82 = *(_DWORD *)(a1 + 540);
v83 = (int *)(a1 + 572);
if ( v82 == 5 )
{
std::string::assign(v83, "Insert List Name");
v83 = v139;
v84 = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
}
else if ( v82 == 2 )
{
v84 = "[Optional Message]";
}
else
{
v84 = "Insert comment";
}
std::string::assign(v83, v84);
v85 = v14 - 10.0;
if ( (*(_BYTE *)(a1 + 572) & 1) != 0 )
v86 = *(char **)(a1 + 580);
else
v86 = (char *)(a1 + 573);
v87 = CCTextInputNode::create(
(CCTextInputNode *)0x43B40000,
v85,
v86,
"Thonburi",
(const char *)&dword_18,
nullptr,
v115);
*(_DWORD *)(a1 + 548) = v87;
*((_BYTE *)v87 + 432) = 0;
(*(void (__fastcall **)(_DWORD, _DWORD, int))(**(_DWORD **)(a1 + 460) + 232))(
*(_DWORD *)(a1 + 460),
*(_DWORD *)(a1 + 548),
20);
*(_DWORD *)(*(_DWORD *)(a1 + 548) + 420) = a1 + 440;
(*(void (__fastcall **)(_DWORD, _BYTE *))(**(_DWORD **)(a1 + 548) + 92))(*(_DWORD *)(a1 + 548), v123);
v88 = *(_DWORD *)(a1 + 548);
std::string::basic_string(v140, (int)v139);
CCTextInputNode::setAllowedChars(v88, (unsigned __int8 *)v140);
v89 = (int *)std::string::~string((int)v140);
v90 = *(_DWORD *)(a1 + 540);
if ( v90 <= 2 || (v90 & 0xFFFFFFFD) == 4 || v90 == 9 )
v89 = CCTextInputNode::setUnicodeText(*(int **)(a1 + 548), 1);
v91 = *(_DWORD *)(a1 + 548);
v92 = *(_DWORD *)(a1 + 532);
if ( *(_BYTE *)(a1 + 544) )
v92 += 17 * EmoteSprite::maxEmotesComment((EmoteSprite *)v89);
*(_DWORD *)(v91 + 424) = v92;
memset(v141, 0, sizeof(v141));
std::string::__init(v141, &unk_B6B226, 0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v150, 0.5, 0.5);
v93 = (TextArea *)TextArea::create(
(int)v141,
"chatFont.fnt",
1065353216,
1134706688,
(const cocos2d::CCPoint *)v150,
1101004800,
1,
0);
std::string::~string((int)v141);
CCTextInputNode::addTextArea(*(int **)(a1 + 548), v93);
LOWORD(v119) = -14136;
BYTE2(v119) = -56;
v94 = (EmoteSprite *)CCTextInputNode::setLabelPlaceholderColor(*(_DWORD *)(a1 + 548), v119);
if ( *(_BYTE *)(a1 + 544) )
{
v97 = *(CCTextInputNode **)(a1 + 548);
v98 = EmoteSprite::maxEmotesComment(v94);
CCTextInputNode::setParseEmotes(v97, v98);
}
v95 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", *(const char **)(a1 + 532));
CString = (cocos2d::CCLabelBMFont *)cocos2d::CCString::getCString(v95);
v100 = cocos2d::CCLabelBMFont::create(CString, "chatFont.fnt", v99);
*(_DWORD *)(a1 + 584) = v100;
(*(void (__fastcall **)(_DWORD, int, int))(**(_DWORD **)(a1 + 460) + 232))(*(_DWORD *)(a1 + 460), v100, 2);
v101 = *(_DWORD *)(a1 + 584);
v102 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v101 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v150, 1.0, 0.5);
v102(v101, v150);
(*(void (__fastcall **)(_DWORD, _DWORD, _DWORD))(**(_DWORD **)(a1 + 584) + 100))(
*(_DWORD *)(a1 + 584),
(float)(v121 + 200.0) - 10.0,
(float)(v21 + v122) - 14.0);
if ( *(_BYTE *)(a1 + 544) )
{
memset(v142, 0, sizeof(v142));
std::string::__init(v142, "easy", 4u);
v106 = EmoteSprite::createWithName((int)v142, v103, v104, v105);
std::string::~string((int)v142);
EmoteSprite::fitToHeight(v106, 18.0, 0.0);
v150[1] = 0;
v150[0] = ShareCommentLayer::onEmotes;
v107 = CCMenuItemSpriteExtra::create((int)v106, 0, a1, (int)ShareCommentLayer::onEmotes, 0);
*(_DWORD *)(a1 + 552) = v107;
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 444) + 228))(*(_DWORD *)(a1 + 444), v107);
CCMenuItemSpriteExtra::setSizeMult(*(_DWORD *)(a1 + 552), 1.5);
v108 = *(_DWORD *)(a1 + 552);
v109 = *(const cocos2d::CCPoint **)(a1 + 460);
v110 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v108 + 92);
v116 = *(cocos2d::CCPoint **)(a1 + 444);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v125, (float)(v121 + 200.0) - 50.0, (float)(v21 + v122) - 16.0);
cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)v126, v109);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v127, v116);
v110(v108, v127);
}
std::string::basic_string(&v143, (int)a6);
ShareCommentLayer::updateDescText((unsigned __int8 *)a1, (unsigned __int8 *)&v143);
std::string::~string((int)&v143);
v111 = *a6;
if ( (v111 & 1) != 0 )
v112 = *((_DWORD *)a6 + 1);
else
v112 = v111 >> 1;
if ( v112 )
{
v113 = *(_DWORD *)(a1 + 548);
std::string::basic_string(&v146, (int)a6);
CCTextInputNode::setString(v113, (int)&v146);
std::string::~string((int)&v146);
}
std::string::~string((int)v139);
std::string::~string((int)v137);
std::string::~string((int)v135);
return v117;
}