//
// CommentCell::loadFromComment from 0x335ce4 to 0x337018 (4916 bytes)
//
// 4 xrefs:
// > CommentCell::onUnhide @ 0x33704e
// > CommentCell::onDelete @ 0x3371e8
// > CommentCell::onUndelete @ 0x33722c
// > CustomListView::loadCell @ 0x33bca2
//
// 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 CommentCell::loadFromComment(CommentCell *a1, GJComment *a2)
{
GJComment *m_comment; // r0
int m_levelID; // r3
bool v6; // r3
cocos2d::CCLayer *m_mainLayer; // r0
cocos2d::CCMenu *v8; // r5
GameLevelManager *v9; // r0
GameLevelManager *v10; // r0
GJComment *v11; // r9
int m_accountID; // r9
GameLevelManager *v13; // r0
cocos2d::CCLabelBMFont *v14; // r7
cocos2d::CCLabelBMFont *v15; // r0
float v16; // r1
float v17; // r2
SimplePlayer *v18; // r6
int v19; // r1
float v20; // s15
GameManager *v21; // r0
int v22; // r0
GameManager *v23; // r0
int v24; // r0
GJUserScore *m_userScore; // r2
int m_iconID; // r1
char v27; // r3
float v28; // r0
float v29; // r0
float v30; // s15
float v31; // s16
float width; // s17
float v33; // s14
float v34; // s13
float v35; // s15
const char *v36; // r0
cocos2d::CCSprite *v37; // r0
float v38; // r1
float v39; // s17
cocos2d::CCNode *v40; // r6
const char *m_percentage; // r1
cocos2d::CCString *v42; // r0
cocos2d::CCLabelBMFont *v43; // r6
int v44; // r1
float v45; // s18
float v46; // s17
float v47; // s15
float v48; // s18
_BOOL4 v49; // r1
CCMenuItemSpriteExtra *v50; // r9
cocos2d::CCLayer *v51; // r10
float v52; // s19
float v53; // r0
float v54; // s16
float m_width; // s15
float m_height; // s19
float v57; // s18
float v58; // s18
int i; // r2
int v60; // r0
int v61; // r7
float v62; // s16
cocos2d::CCArray *m_pTargetArray; // r2
int v64; // r3
float v65; // s14
char *v66; // r1
cocos2d::CCLabelBMFont *v67; // r7
void (__fastcall *v68)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r8
void (__fastcall *v69)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
void (__fastcall *v70)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // r2
char v71; // r3
GameLevelManager *v72; // r0
GJGameLevel *SavedDailyLevelFromLevelID; // r0
GameLevelManager *v74; // r0
float v75; // s18
cocos2d::CCNode *v76; // r7
void (__fastcall *v77)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
float v78; // s15
void (__fastcall *v79)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
TextArea *v80; // r0
int v81; // r1
GameLevelManager *v82; // r0
GJGameLevel *SavedLevel; // r0
GameLevelManager *v84; // r0
void (__fastcall *v85)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r10
void (__fastcall *v86)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
void (__fastcall *setColor)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // r2
cocos2d::CCNode *v88; // r8
int (__fastcall *getTag)(const cocos2d::CCObject *__hidden); // r3
GJComment *v90; // r3
GLubyte g; // r0
GLubyte b; // r1
GLubyte r; // r3
int v94; // r8
ButtonSprite *v95; // r8
int v96; // r1
CCMenuItemSpriteExtra *v97; // r8
float v98; // s14
float v99; // s15
GJComment *v100; // r3
ButtonSprite *v101; // r0
cocos2d::CCNode *v102; // r7
CCMenuItemSpriteExtra *v103; // r8
float v104; // s16
void (__fastcall *v105)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
float *v106; // r0
float v107; // s15
float v108; // s16
float v109; // s18
float v110; // r7
float v111; // s17
cocos2d::CCSprite *v112; // r0
cocos2d::CCSprite_vtbl *v113; // r3
cocos2d::CCSprite *v114; // r8
void (__fastcall *v115)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
float v116; // s14
float v117; // s14
float v118; // s15
cocos2d::CCSprite *m_iconSprite; // r6
const char *m_likeCount; // r8
void (__fastcall *setDisplayFrame)(cocos2d::CCSprite *__hidden, cocos2d::CCSpriteFrame *); // r9
cocos2d::CCSpriteFrameCache *v122; // r0
const char *v123; // r1
cocos2d::CCSpriteFrame *v124; // r0
cocos2d::CCString *v125; // r0
cocos2d::CCLabelBMFont *v126; // r0
cocos2d::CCLabelBMFont *m_likeLabel; // r8
void (__fastcall *v128)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r9
cocos2d::CCLabelBMFont *v129; // r8
void (__fastcall *v130)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
const cocos2d::CCPoint *v131; // r11
float v132; // s14
float v133; // s15
float v134; // r1
cocos2d::CCSprite *v135; // r7
void (__fastcall *v136)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // r9
int v137; // r10
const cocos2d::CCPoint *v138; // r0
cocos2d::CCSprite *v139; // r0
CCMenuItemSpriteExtra *v140; // r7
void (__fastcall *v141)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10
GJComment *v142; // r3
GameLevelManager *v143; // r0
int v144; // r0
int v145; // r6
GameManager *v146; // r0
GameManager *v147; // r0
_BOOL4 m_canDelete; // r6
GameManager *v149; // r0
int v150; // r9
GJAccountManager *v151; // r0
GameManager *v152; // r0
GameManager *v153; // r0
cocos2d::CCSprite *v154; // r6
CCMenuItemSpriteExtra *v155; // r6
void (__fastcall *v156)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
int v157; // r7
float v158; // r1
int v159; // r6
cocos2d::CCString *v160; // r0
cocos2d::CCLabelBMFont *v161; // r5
void (__fastcall *v162)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r7
float v163; // r1
void (__fastcall *v164)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r7
float v165; // s15
float v166; // r2
GJComment *v167; // r3
float v168; // r2
float v169; // r3
cocos2d::CCPoint v170; // [sp+4h] [bp-A8h]
float v171; // [sp+10h] [bp-9Ch]
void (__fastcall *v172)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // [sp+14h] [bp-98h]
void (__fastcall *v173)(SimplePlayer *__hidden, const cocos2d::ccColor3B *); // [sp+14h] [bp-98h]
IconType m_iconType; // [sp+14h] [bp-98h]
void (__fastcall *setScale)(cocos2d::CCSprite *__hidden, float); // [sp+14h] [bp-98h]
void (__fastcall *v176)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // [sp+14h] [bp-98h]
void (__fastcall *v177)(cocos2d::CCSprite *__hidden, float); // [sp+14h] [bp-98h]
void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // [sp+14h] [bp-98h]
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+14h] [bp-98h]
void (__fastcall *v180)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+14h] [bp-98h]
cocos2d::CCLayer *v181; // [sp+18h] [bp-94h]
_BOOL4 v182; // [sp+1Ch] [bp-90h]
int v183; // [sp+24h] [bp-88h]
void (__fastcall *v184)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+24h] [bp-88h]
cocos2d::CCLayer *v185; // [sp+28h] [bp-84h]
int v186; // [sp+34h] [bp-78h]
int v187; // [sp+38h] [bp-74h]
int v188; // [sp+3Ch] [bp-70h]
cocos2d::CCLabelBMFont *v189; // [sp+40h] [bp-6Ch] BYREF
int v190; // [sp+44h] [bp-68h] BYREF
int v191; // [sp+48h] [bp-64h] BYREF
char v192; // [sp+4Ch] [bp-60h] BYREF
ButtonSprite *v193; // [sp+50h] [bp-5Ch] BYREF
cocos2d::CCPoint v194; // [sp+54h] [bp-58h] BYREF
cocos2d::CCPoint v195; // [sp+5Ch] [bp-50h] BYREF
cocos2d::CCPoint v196; // [sp+64h] [bp-48h] BYREF
void (*v197)(CommentCell *, cocos2d::CCObject *); // [sp+6Ch] [bp-40h]
_BOOL4 m_hasLevelID; // [sp+70h] [bp-3Ch]
void (*v199)(CommentCell *, cocos2d::CCObject *); // [sp+74h] [bp-38h]
int v200; // [sp+78h] [bp-34h]
cocos2d::CCPoint v201; // [sp+7Ch] [bp-30h] BYREF
cocos2d::CCRect v202; // [sp+84h] [bp-28h] BYREF
cocos2d::CCRect v203; // [sp+94h] [bp-18h] BYREF
cocos2d::CCSize v204; // 0:^0.8
cocos2d::CCRect v205; // 0:kr00_16.16
a1->m_backgroundLayer->setOpacity(a1->m_backgroundLayer, 255);
cocos2d::CCObject::retain(a2);
m_comment = a1->m_comment;
if ( m_comment )
cocos2d::CCObject::release(m_comment);
m_levelID = a2->m_levelID;
a1->m_comment = a2;
if ( m_levelID )
v6 = 0;
else
v6 = a2->m_accountID > 0;
m_mainLayer = a1->m_mainLayer;
a1->m_accountComment = v6;
m_mainLayer->removeAllChildrenWithCleanup(m_mainLayer, 1);
if ( !a1->m_comment->m_commentDeleted )
{
v8 = cocos2d::CCMenu::create();
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v8, 2);
if ( !a1->m_comment->m_unkMultiplayerBool )
{
v9 = GameLevelManager::sharedState();
GameLevelManager::userNameForUserID((GameLevelManager *)&v201, (int)v9);
if ( a1->m_accountComment )
{
v10 = GameLevelManager::sharedState();
GameLevelManager::tryGetUsername((GameLevelManager *)&v202, v10);
sub_774794(&v201, &v202);
sub_774008(&v202);
}
v11 = a1->m_comment;
sub_775C20(&v203, &v201);
sub_775D40(&v11->m_userName, &v203);
sub_774008(&v203);
sub_774008(&v201);
}
m_accountID = a1->m_comment->m_accountID;
if ( !a1->m_accountComment && !m_accountID )
{
v13 = GameLevelManager::sharedState();
m_accountID = GameLevelManager::accountIDForUserID(v13, a1->m_comment->m_userID);
a1->m_comment->m_accountID = m_accountID;
}
v182 = a1->m_comment->m_accountID == 71;
sub_775C20(&v203, &a1->m_comment->m_userName);
v14 = cocos2d::CCLabelBMFont::create();
sub_774008(&v203);
if ( a1->m_compactMode )
{
v15 = v14;
v16 = 150.0;
v17 = 0.5;
}
else
{
v15 = v14;
v17 = 0.7;
if ( a1->m_comment->m_hasLevelID )
v16 = 100.0;
else
v16 = 150.0;
}
cocos2d::CCLabelBMFont::limitLabelWidth(v15, v16, v17, 0.0);
if ( a1->m_accountComment )
{
v31 = 0.0;
goto LABEL_62;
}
if ( !a1->m_comment->m_userScore )
{
v31 = 0.0;
LABEL_39:
if ( a1->m_comment->m_modBadge <= 0 )
{
v39 = 0.0;
}
else
{
width = v14->getContentSize(v14)->width;
v33 = 12.0;
v34 = (float)(v31 + 10.0)
+ (float)(width * COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCLabelBMFont *))v14->getScale)(v14)));
if ( a1->m_compactMode )
v33 = 8.0;
v35 = 11.5;
if ( !a1->m_compactMode )
v35 = 19.5;
cocos2d::CCPoint::CCPoint(&v203.origin, v34 + v33, a1->m_height - v35);
if ( a1->m_comment->m_modBadge == 2 )
v36 = "modBadge_02_001.png";
else
v36 = "modBadge_01_001.png";
v37 = cocos2d::CCSprite::createWithSpriteFrameName(v36);
if ( a1->m_compactMode )
v38 = 0.55;
else
v38 = 0.75;
v39 = 22.0;
v40 = v37;
v37->setScale(v37, COERCE_FLOAT(LODWORD(v38)));
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v40, 10);
v40->setPosition(v40, &v203.origin);
if ( a1->m_compactMode )
v39 = 15.0;
}
m_percentage = (const char *)a1->m_comment->m_percentage;
if ( (int)m_percentage > 0 )
{
v42 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i%%", m_percentage);
cocos2d::CCString::getCString(v42);
v43 = cocos2d::CCLabelBMFont::create();
a1->m_mainLayer->addChild(a1->m_mainLayer, v43);
setAnchorPoint = v43->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v203.origin, 0.0, 0.5);
setAnchorPoint(v43, &v203.origin);
if ( a1->m_compactMode )
v44 = 1056293520;
else
v44 = 1058642330;
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v43->setScale)(v43, v44);
v43->setColor(v43, &stru_9AA43F);
v43->setOpacity(v43, 150);
setPosition = v43->setPosition;
v45 = v14->getContentSize(v14)->width;
v46 = (float)((float)(v31 + 10.0) + v39)
+ (float)(v45 * COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCLabelBMFont *))v14->getScale)(v14)));
v47 = 11.5;
if ( !a1->m_compactMode )
v47 = 19.5;
cocos2d::CCPoint::CCPoint(&v203.origin, v46 + 4.0, a1->m_height - v47);
setPosition(v43, &v203.origin);
}
LABEL_62:
v48 = 18.0;
if ( a1->m_compactMode )
v48 = 10.0;
if ( !m_accountID || a1->m_accountComment || (v49 = a2->m_hasLevelID) )
{
a1->m_mainLayer->addChild(a1->m_mainLayer, v14);
v85 = v14->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v203.origin, 0.0, 0.5);
v85(v14, &v203.origin);
v86 = v14->setPosition;
cocos2d::CCPoint::CCPoint(&v203.origin, v31 + 10.0, a1->m_height - v48);
v86(v14, &v203.origin);
if ( !v182 && !a1->m_accountComment && m_accountID <= 0 )
{
setColor = v14->setColor;
LOWORD(v203.origin.x) = -166;
BYTE2(v203.origin.x) = -1;
setColor(v14, (const cocos2d::ccColor3B *)&v203);
}
}
else
{
m_hasLevelID = a2->m_hasLevelID;
v197 = CommentCell::onViewProfile;
v50 = CCMenuItemSpriteExtra::create(
v14,
(cocos2d::CCObject *)v49,
(cocos2d::SEL_MenuHandler)__PAIR64__(CommentCell::onViewProfile, (unsigned int)a1));
v8->addChild(v8, v50);
v51 = a1->m_mainLayer;
v180 = v50->setPosition;
v52 = v14->getContentSize(v14)->width;
v53 = v14->getScale(v14);
cocos2d::CCPoint::CCPoint(&v201, (float)(v31 + 10.0) + (float)((float)(v52 * 0.5) * v53), a1->m_height - v48);
cocos2d::CCNode::convertToWorldSpace(&v202.origin, v51, &v201);
cocos2d::CCNode::convertToNodeSpace(&v203.origin, v8, &v202.origin);
v180(v50, &v203.origin);
}
v54 = 8.0;
m_width = a1->m_width;
m_height = a1->m_height;
v57 = 10.0;
if ( a1->m_compactMode )
v57 = 8.0;
v58 = m_width - v57;
if ( !a1->m_compactMode )
v54 = 12.0;
cocos2d::CCPoint::CCPoint(&v194, m_width * 0.5, m_height * 0.5);
if ( !a1->m_compactMode )
{
cocos2d::CCRect::CCRect(&v202, 0.0, 0.0, 80.0, 80.0);
cocos2d::CCRect::CCRect(&v203, &v202);
v205.origin.x = v168;
v205.origin.y = v169;
v205.size = v204;
v88 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create(
(cocos2d::extension::CCScale9Sprite *)"square02b_001.png",
(const char *)&v203,
v205);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v203, v58, m_height - v54);
v88->setContentSize(v88, (const cocos2d::CCSize *)&v203);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v88, -1);
v88->setPosition(v88, &v194);
getTag = v88->__vftable[1].getTag;
LOWORD(v201.x) = 16514;
BYTE2(v201.x) = 33;
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCPoint *))getTag)(v88, &v201);
((void (__fastcall *)(cocos2d::CCNode *, int))v88->__vftable[1].~CCNode_0)(v88, 100);
}
sub_775C20(&v203, &a1->m_comment->m_commentString);
sub_776584((int)&v189, (char *)LODWORD(v203.origin.x));
sub_774008(&v203);
sub_776584((int)&v190, byte_965AA5);
sub_776584((int)&v191, (char *)&unk_939830);
for ( i = 0; ; i = *(_DWORD *)(v191 - 12) + v61 )
{
v60 = sub_774834(&v189, &v190, i);
v61 = v60;
if ( v60 == -1 )
break;
sub_776454(&v189, v60, *(_DWORD *)(v190 - 12), &v191);
}
v62 = 1.0;
m_pTargetArray = v189[-1].m_pTargetArray;
if ( a1->m_accountComment )
v64 = 180;
else
v64 = 100;
v65 = 0.6;
if ( (unsigned int)m_pTargetArray >= v64 )
m_pTargetArray = (cocos2d::CCArray *)v64;
if ( !a1->m_compactMode )
v65 = 0.7;
if ( (float)(int)m_pTargetArray > (float)((float)v64 * 0.5) )
v62 = v65 + (float)((float)((float)(v64 - (int)m_pTargetArray) / (float)v64) * (float)(1.0 - v65));
if ( a1->m_comment->m_isSpam )
{
if ( a1->m_compactMode )
v66 = "Comment flagged as spam";
else
v66 = "Comment flagged as spam";
sub_7753D4((int)&v189, v66);
}
if ( !a1->m_compactMode )
{
sub_776584((int)&v192, (char *)v189);
if ( a1->m_compactMode )
v75 = 9999.0;
else
v75 = (float)(v58 - 45.0) / v62;
cocos2d::CCPoint::CCPoint(&v203.origin, 0.0, 1.0);
v170.x = 20.0;
LODWORD(v170.y) = !a1->m_comment->m_isSpam;
v76 = (cocos2d::CCNode *)TextArea::create(
(TextArea *)&v192,
(std::string)"chatFont.fnt",
(const char *)0x3F800000,
SLODWORD(v75),
&v203.origin,
v170);
sub_774008(&v192);
a1->m_mainLayer->addChild(a1->m_mainLayer, v76);
v77 = v76->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v203.origin, 0.0, 0.5);
v77(v76, &v203.origin);
v78 = 3.0;
v79 = v76->setPosition;
if ( !a1->m_compactMode )
v78 = 0.0;
cocos2d::CCPoint::CCPoint(&v203.origin, 10.0, (float)(a1->m_height * 0.5) - v78);
v79(v76, &v203.origin);
v76->setScale(v76, COERCE_FLOAT(LODWORD(v62)));
if ( v182 )
{
LOWORD(v186) = -206;
BYTE2(v186) = -1;
v80 = (TextArea *)v76;
v81 = v186;
LABEL_190:
TextArea::colorAllCharactersTo(v80, (cocos2d::ccColor3B)v81);
goto LABEL_119;
}
v82 = GameLevelManager::sharedState();
SavedLevel = (GJGameLevel *)GameLevelManager::getSavedLevel(v82, a1->m_comment->m_levelID);
if ( SavedLevel
|| (v84 = GameLevelManager::sharedState(),
(SavedLevel = GameLevelManager::getSavedDailyLevelFromLevelID(v84, a1->m_comment->m_levelID)) != nullptr) )
{
if ( SavedLevel->m_userID.random - SavedLevel->m_userID.seed == a1->m_comment->m_userID )
{
LOWORD(v187) = -1;
BYTE2(v187) = 75;
v80 = (TextArea *)v76;
v81 = v187;
goto LABEL_190;
}
}
v167 = a1->m_comment;
if ( v167->m_modBadge > 0 && !a1->m_accountComment )
{
v80 = (TextArea *)v76;
BYTE1(v188) = v167->m_color.g;
BYTE2(v188) = v167->m_color.b;
LOBYTE(v188) = v167->m_color.r;
v81 = v188;
goto LABEL_190;
}
LABEL_119:
if ( a1->m_comment->m_hasLevelID )
{
sub_776584((int)&v196, "GJ_button_01.png");
v94 = a1->m_comment->m_levelID;
if ( v94 < 0 )
{
v94 = -v94;
sub_7753D4((int)&v196, "GJ_button_03.png");
}
GameToolbox::intToString((GameToolbox *)&v193, v94);
v95 = ButtonSprite::create(
v193,
(const char *)&dword_78,
0,
1.0,
1,
"bigFont.fnt",
(char *)LODWORD(v196.x),
(const char *)0x41F00000,
v171);
sub_774008(&v193);
if ( a1->m_compactMode )
v96 = 1053609165;
else
v96 = 1058642330;
((void (__fastcall *)(ButtonSprite *, int))v95->setScale)(v95, v96);
v200 = 0;
v199 = CommentCell::onGoToLevel;
v97 = CCMenuItemSpriteExtra::create(
v95,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(CommentCell::onGoToLevel, (unsigned int)a1));
CCMenuItemSpriteExtra::setSizeMult(v97, 1.2);
v8->addChild(v8, v97);
v98 = 130.0;
v184 = v97->setPosition;
v185 = a1->m_mainLayer;
if ( a1->m_compactMode )
v98 = 95.0;
v99 = 11.5;
if ( !a1->m_compactMode )
v99 = 19.5;
cocos2d::CCPoint::CCPoint(&v201, a1->m_width - v98, a1->m_height - v99);
cocos2d::CCNode::convertToWorldSpace(&v202.origin, v185, &v201);
cocos2d::CCNode::convertToNodeSpace(&v203.origin, v8, &v202.origin);
v184(v97, &v203.origin);
sub_774008(&v196);
}
v100 = a1->m_comment;
if ( v100->m_isSpam )
{
v101 = ButtonSprite::create(
(ButtonSprite *)"Show",
(const char *)&word_28,
0,
0.6,
1,
"goldFont.fnt",
"GJ_button_04.png",
(const char *)0x41F00000,
v171);
v102 = v101;
if ( a1->m_compactMode )
((void (__fastcall *)(ButtonSprite *, int))v101->setScale)(v101, 1061997773);
v201.y = 0.0;
LODWORD(v201.x) = CommentCell::onUnhide;
v103 = CCMenuItemSpriteExtra::create(
v102,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(CommentCell::onUnhide, (unsigned int)a1));
CCMenuItemSpriteExtra::setSizeMult(v103, 1.2);
v8->addChild(v8, v103);
v104 = a1->m_width;
v105 = v103->setPosition;
v181 = a1->m_mainLayer;
v106 = (float *)v102->getContentSize(v102);
cocos2d::CCPoint::CCPoint(&v196, (float)(v104 - (float)(*v106 * 0.5)) - 9.0, a1->m_height * 0.5);
cocos2d::CCNode::convertToWorldSpace(&v202.origin, v181, &v196);
cocos2d::CCNode::convertToNodeSpace(&v203.origin, v8, &v202.origin);
v105(v103, &v203.origin);
sub_774008(&v191);
LABEL_186:
sub_774008(&v190);
sub_774008(&v189);
return;
}
if ( v100->m_unkMultiplayerBool )
{
LABEL_177:
sub_775C20(&v195, &a1->m_comment->m_uploadDate);
v159 = *(_DWORD *)(LODWORD(v195.x) - 12);
sub_774008(&v195);
if ( v159 )
{
sub_775C20(&v196, &a1->m_comment->m_uploadDate);
v160 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%s ago",
(const char *)LODWORD(v196.x));
cocos2d::CCString::getCString(v160);
v161 = cocos2d::CCLabelBMFont::create();
sub_774008(&v196);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v161, 1);
v162 = v161->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v201, 1.0, 0.5);
v162(v161, &v201);
if ( a1->m_compactMode )
v163 = 0.35;
else
v163 = 0.5;
v161->setScale(v161, COERCE_FLOAT(LODWORD(v163)));
v161->setColor(v161, &stru_9AA43F);
v161->setOpacity(v161, 125);
v164 = v161->setPosition;
v165 = 8.0;
if ( a1->m_compactMode )
{
v166 = 7.0;
}
else
{
v165 = 11.0;
v166 = 14.0;
}
cocos2d::CCPoint::CCPoint(&v201, a1->m_width - v165, v166);
v164(v161, &v201);
}
sub_774008(&v191);
goto LABEL_186;
}
v107 = 20.0;
if ( a1->m_compactMode )
v107 = 14.0;
v108 = 0.6;
v109 = a1->m_height - v107;
if ( a1->m_compactMode )
v110 = 0.3;
else
v110 = 0.4;
v111 = 12.0;
if ( !a1->m_compactMode )
{
v108 = 0.8;
v111 = 13.0;
}
v112 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_likesIcon_001.png");
v113 = v112->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v114 = v112;
a1->m_iconSprite = v112;
v115 = v113->setPosition;
v116 = 32.0;
if ( !a1->m_compactMode )
v116 = 35.0;
v117 = a1->m_width - v116;
v118 = 14.0;
if ( a1->m_compactMode )
v118 = 0.0;
cocos2d::CCPoint::CCPoint(&v203.origin, v117 - v118, v109);
v115(v114, &v203.origin);
((void (__fastcall *)(cocos2d::CCSprite *, _DWORD))a1->m_iconSprite->setScale)(a1->m_iconSprite, LODWORD(v108));
m_iconSprite = a1->m_iconSprite;
m_likeCount = (const char *)a1->m_comment->m_likeCount;
setDisplayFrame = m_iconSprite->setDisplayFrame;
v122 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
if ( (int)m_likeCount < 0 )
v123 = "GJ_dislikesIcon_001.png";
else
v123 = "GJ_likesIcon_001.png";
v124 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v122, v123);
setDisplayFrame(m_iconSprite, v124);
v125 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", m_likeCount);
cocos2d::CCString::getCString(v125);
v126 = cocos2d::CCLabelBMFont::create();
a1->m_likeLabel = v126;
a1->m_mainLayer->addChild(a1->m_mainLayer, v126);
m_likeLabel = a1->m_likeLabel;
v128 = m_likeLabel->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v203.origin, 0.5, 0.5);
v128(m_likeLabel, &v203.origin);
v129 = a1->m_likeLabel;
v130 = v129->setPosition;
v131 = a1->m_iconSprite->getPosition(a1->m_iconSprite);
v132 = 14.0;
if ( a1->m_compactMode )
v132 = 8.0;
v133 = 1.0;
if ( !a1->m_compactMode )
v133 = 0.5;
cocos2d::CCPoint::CCPoint(&v202.origin, v111 + v132, v133 + 0.0);
cocos2d::CCPoint::operator+(&v203, v131, &v202);
v130(v129, &v203.origin);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, _DWORD))a1->m_likeLabel->setScale)(
a1->m_likeLabel,
LODWORD(v110));
if ( a1->m_compactMode )
v134 = 15.0;
else
v134 = 28.0;
cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_likeLabel, v134, v110, 0.0);
v135 = a1->m_iconSprite;
v136 = v135->setPosition;
v137 = (int)v135->getPosition(v135);
cocos2d::CCPoint::CCPoint(&v202.origin, 0.0, 2.0);
cocos2d::CCPoint::operator+(&v203, v137, &v202);
v136(v135, &v203.origin);
v138 = a1->m_iconSprite->getPosition(a1->m_iconSprite);
cocos2d::CCPoint::CCPoint(&v195, v138);
a1->m_iconSprite->setPosition(a1->m_iconSprite, &stru_AC5C3C);
v139 = a1->m_iconSprite;
v202.origin.y = 0.0;
LODWORD(v202.origin.x) = CommentCell::onLike;
v140 = CCMenuItemSpriteExtra::create(
v139,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(CommentCell::onLike, (unsigned int)a1));
CCMenuItemSpriteExtra::setSizeMult(v140, 2.0);
v8->addChild(v8, v140);
v141 = v140->setPosition;
cocos2d::CCNode::convertToWorldSpace(&v201, a1->m_mainLayer, &v195);
cocos2d::CCNode::convertToNodeSpace(&v203.origin, v8, &v201);
v141(v140, &v203.origin);
v142 = a1->m_comment;
if ( v142->m_levelID <= 0 )
{
if ( !v182 )
{
m_canDelete = v142->m_canDelete;
goto LABEL_165;
}
}
else
{
v143 = GameLevelManager::sharedState();
v144 = GameLevelManager::getSavedLevel(v143, a1->m_comment->m_levelID);
v145 = v144;
if ( !v182 )
{
if ( v144 )
{
v146 = GameManager::sharedState();
if ( v146->m_playerUserID.random - v146->m_playerUserID.seed == *(_DWORD *)(v145 + 324)
- *(_DWORD *)(v145 + 328) )
{
v147 = GameManager::sharedState();
m_canDelete = v147->m_playerUserID.random - v147->m_playerUserID.seed > 0;
goto LABEL_165;
}
}
}
}
m_canDelete = 0;
LABEL_165:
if ( a1->m_accountComment
&& (v150 = a1->m_comment->m_accountID,
v151 = GJAccountManager::sharedState(),
v150 == v151->m_accountID - v151->m_unkInt1)
|| (v149 = GameManager::sharedState(), v149->m_playerUserID.random - v149->m_playerUserID.seed > 0)
&& (v152 = GameManager::sharedState(),
v152->m_playerUserID.random - v152->m_playerUserID.seed == a1->m_comment->m_userID)
|| m_canDelete
|| (v153 = GameManager::sharedState(), v153->m_hasRP.random - v153->m_hasRP.seed == 2) )
{
v154 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_deleteIcon_001.png");
((void (__fastcall *)(cocos2d::CCSprite *, _DWORD))v154->setScale)(v154, v108 * 0.95);
v203.origin.y = 0.0;
LODWORD(v203.origin.x) = CommentCell::onConfirmDelete;
v155 = CCMenuItemSpriteExtra::create(
v154,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(CommentCell::onConfirmDelete, (unsigned int)a1));
CCMenuItemSpriteExtra::setSizeMult(v155, 2.0);
v8->addChild(v8, v155);
v156 = v155->setPosition;
v157 = (int)v140->getPosition(v140);
if ( a1->m_compactMode )
v158 = -20.0;
else
v158 = -24.0;
cocos2d::CCPoint::CCPoint(&v196, v158, -1.0);
cocos2d::CCPoint::operator+(&v201, v157, &v196);
v156(v155, &v201);
}
goto LABEL_177;
}
v67 = cocos2d::CCLabelBMFont::create();
a1->m_mainLayer->addChild(a1->m_mainLayer, v67);
v68 = v67->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v203.origin, 0.0, 0.5);
v68(v67, &v203.origin);
v69 = v67->setPosition;
cocos2d::CCPoint::CCPoint(&v203.origin, 10.0, (float)(a1->m_height * 0.5) - 9.0);
v69(v67, &v203.origin);
cocos2d::CCLabelBMFont::limitLabelWidth(v67, 270.0, 0.7, 0.0);
if ( v182 )
{
v70 = v67->setColor;
LOWORD(v203.origin.x) = -206;
v71 = -1;
}
else
{
v72 = GameLevelManager::sharedState();
SavedDailyLevelFromLevelID = (GJGameLevel *)GameLevelManager::getSavedLevel(v72, a1->m_comment->m_levelID);
if ( !SavedDailyLevelFromLevelID
&& (v74 = GameLevelManager::sharedState(),
(SavedDailyLevelFromLevelID = GameLevelManager::getSavedDailyLevelFromLevelID(
v74,
a1->m_comment->m_levelID)) == nullptr)
|| SavedDailyLevelFromLevelID->m_userID.random - SavedDailyLevelFromLevelID->m_userID.seed != a1->m_comment->m_userID )
{
v90 = a1->m_comment;
if ( v90->m_modBadge <= 0 || a1->m_accountComment )
goto LABEL_119;
g = v90->m_color.g;
b = v90->m_color.b;
r = v90->m_color.r;
v70 = v67->setColor;
BYTE1(v203.origin.x) = g;
LOBYTE(v203.origin.x) = r;
BYTE2(v203.origin.x) = b;
LABEL_118:
v70(v67, (const cocos2d::ccColor3B *)&v203);
goto LABEL_119;
}
v70 = v67->setColor;
LOWORD(v203.origin.x) = -1;
v71 = 75;
}
BYTE2(v203.origin.x) = v71;
goto LABEL_118;
}
v18 = SimplePlayer::create((int)&dword_0 + 1);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v18, 1);
if ( a1->m_compactMode )
v19 = 1055286887;
else
v19 = 1058642330;
((void (__fastcall *)(SimplePlayer *, int))v18->setScale)(v18, v19);
v20 = 11.0;
v172 = v18->setPosition;
if ( !a1->m_compactMode )
v20 = 19.5;
cocos2d::CCPoint::CCPoint(&v203.origin, 20.0, a1->m_height - v20);
v172(v18, &v203.origin);
v173 = v18->setColor;
v21 = GameManager::sharedState();
*(cocos2d::ccColor3B *)&v22 = GameManager::colorForIdx(v21, a1->m_comment->m_userScore->m_color1);
LOWORD(v203.origin.x) = v22;
BYTE2(v203.origin.x) = BYTE2(v22);
v173(v18, (const cocos2d::ccColor3B *)&v203);
v23 = GameManager::sharedState();
*(cocos2d::ccColor3B *)&v24 = GameManager::colorForIdx(v23, a1->m_comment->m_userScore->m_color2);
LOWORD(v203.origin.x) = v24;
BYTE2(v203.origin.x) = BYTE2(v24);
SimplePlayer::setSecondColor(v18, (const cocos2d::ccColor3B *)&v203);
SimplePlayer::tryEnableCustomGlowColor(v18, a1->m_comment->m_userScore->m_color3);
m_userScore = a1->m_comment->m_userScore;
m_iconID = m_userScore->m_iconID;
v27 = m_userScore->m_special == 2 || m_userScore->m_glowEnabled;
v18->m_hasGlowOutline = v27;
m_iconType = m_userScore->m_iconType;
SimplePlayer::updatePlayerFrame(v18, m_iconID, m_iconType);
SimplePlayer::updateColors(v18);
switch ( m_iconType )
{
case Wave:
setScale = v18->setScale;
v28 = COERCE_FLOAT(((int (__fastcall *)(SimplePlayer *))v18->getScale)(v18));
((void (__fastcall *)(SimplePlayer *, _DWORD))setScale)(v18, v28 * 1.15);
v176 = v18->setPosition;
v183 = (int)v18->getPosition(v18);
cocos2d::CCPoint::CCPoint(&v202.origin, 1.0, 0.0);
cocos2d::CCPoint::operator+(&v203, v183, &v202);
v176(v18, &v203.origin);
LABEL_38:
v31 = 26.0;
goto LABEL_39;
case Spider:
case Ship:
v177 = v18->setScale;
v29 = COERCE_FLOAT(((int (__fastcall *)(SimplePlayer *))v18->getScale)(v18));
v30 = 0.9;
break;
case Ufo:
v177 = v18->setScale;
v29 = COERCE_FLOAT(((int (__fastcall *)(SimplePlayer *))v18->getScale)(v18));
v30 = 0.95;
break;
default:
goto LABEL_38;
}
((void (__fastcall *)(SimplePlayer *, _DWORD))v177)(v18, v29 * v30);
goto LABEL_38;
}
}