//
// InfoLayer::onComment from 0x1402bd5f0 to 0x1402bdb9f (1455 bytes)
//
// 3 xrefs:
// > InfoLayer::FLAlert_Clicked @ 0x1402bd3eb
// > InfoLayer::init @ 0x1402bba75
// > ??> @ 0x1406d2840
//
// 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=5
void InfoLayer::onComment(InfoLayer *a1, cocos2d::CCObject *a2)
{
GJAccountManager *v3; // rax
__int64 v4; // rax
FLAlertLayer *v5; // rbx
FLAlertLayer_vtbl *v6; // rdx
__int64 v7; // rcx
GameManager *v8; // rcx
GameManager *v9; // rcx
int v10; // esi
_QWORD *v11; // rax
_QWORD *v12; // rcx
const char *v13; // rdx
__int64 v14; // r8
__int64 v15; // rax
FLAlertLayer *v16; // rbx
GJUserScore *m_score; // r14
int v18; // ebx
int m_userID; // r14d
GJLevelList *m_levelList; // r14
GJGameLevel *m_level; // rax
cocos2d::CCString *v22; // rax
const char *CString; // r14
GameLevelManager *v24; // rcx
int TimeLeft; // eax
cocos2d::CCString *v26; // rax
const char *v27; // rax
size_t v28; // r8
__int64 v29; // rax
FLAlertLayer *v30; // rbx
GJUserScore *v31; // rax
GJLevelList *v32; // rax
GJGameLevel *v33; // rax
__int64 v34; // rax
GJGameLevel *v35; // rdx
__int128 v36; // [rsp+50h] [rbp-9h] BYREF
__int64 v37; // [rsp+60h] [rbp+7h]
__int64 v38; // [rsp+68h] [rbp+Fh]
__int128 v39; // [rsp+70h] [rbp+17h] BYREF
__int64 v40; // [rsp+80h] [rbp+27h]
__int64 v41; // [rsp+88h] [rbp+2Fh]
void *v42; // [rsp+D0h] [rbp+77h]
void *v43; // [rsp+D0h] [rbp+77h]
void *v44; // [rsp+D0h] [rbp+77h]
void *v45; // [rsp+D0h] [rbp+77h]
v3 = GJAccountManager::sharedState();
if ( v3->m_accountID - v3->m_unkInt1 > 0 )
{
v8 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v42 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v42);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v8 = (GameManager *)qword_1406C2ED8;
}
if ( GameManager::getGameVariable(v8, "0012") )
{
m_score = a1->m_score;
v18 = 0;
if ( m_score )
{
m_userID = m_score->m_userID;
}
else
{
m_levelList = a1->m_levelList;
if ( m_levelList )
{
m_userID = -m_levelList->m_listID;
}
else
{
m_level = a1->m_level;
if ( m_level )
m_userID = m_level->m_levelID.random - m_level->m_levelID.seed;
else
m_userID = 0;
}
}
if ( !qword_1406C2EC0 )
{
v44 = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v44);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
}
v22 = cocos2d::CCString::createWithFormat("c_%i", m_userID);
CString = cocos2d::CCString::getCString(v22);
v24 = (GameLevelManager *)qword_1406C2EC0;
if ( !qword_1406C2EC0 )
{
v45 = operator new(0x3D0u);
qword_1406C2EC0 = sub_140141280((__int64)v45);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EC0 + 72LL))(qword_1406C2EC0);
v24 = (GameLevelManager *)qword_1406C2EC0;
}
TimeLeft = GameLevelManager::getTimeLeft(v24, CString, 15.0);
if ( (unsigned int)(TimeLeft - 1) > 0xE )
{
v39 = 0;
v40 = 0;
v41 = 15;
LOBYTE(v39) = 0;
v37 = 11;
v38 = 15;
*(_QWORD *)&v36 = 0x6D6D6F4320646441LL;
*((_QWORD *)&v36 + 1) = 7630437;
v31 = a1->m_score;
if ( v31 )
{
v18 = v31->m_userID;
}
else
{
v32 = a1->m_levelList;
if ( v32 )
{
v18 = -v32->m_listID;
}
else
{
v33 = a1->m_level;
if ( v33 )
v18 = v33->m_levelID.random - v33->m_levelID.seed;
}
}
v34 = ShareCommentLayer::create((unsigned int)&v36, 100, 0, v18, (__int64)&v39);
v35 = a1->m_level;
if ( v35 )
*(_DWORD *)(v34 + 772) = v35->m_orbCompletion.random - v35->m_orbCompletion.seed;
v6 = *(FLAlertLayer_vtbl **)v34;
v7 = v34;
}
else
{
v26 = cocos2d::CCString::createWithFormat("Please wait %i seconds before posting a new comment!", TimeLeft);
v27 = cocos2d::CCString::getCString(v26);
v36 = 0;
v37 = 0;
v38 = 0;
v28 = -1;
do
++v28;
while ( v27[v28] );
sub_14003A930(&v36, v27, v28);
v29 = sub_14003BDB0((__int64)&v39, (__int64)&v36);
v30 = FLAlertLayer::create(0, (int)"Too fast", v29, (__int64)"OK", 0, 1133903872, 0, 0, 1065353216);
sub_14003A830((__int64)&v36);
v6 = v30->cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v7 = (__int64)v30;
}
}
else
{
v9 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v43 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v43);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v9 = (GameManager *)qword_1406C2ED8;
}
GameManager::setGameVariable(v9, "0012", 1);
v10 = (_DWORD)a1 + 648;
if ( !a1 )
v10 = 0;
v36 = 0;
v11 = sub_14003AA10(0x110u);
*(_QWORD *)&v36 = v11;
v37 = 259;
v38 = 271;
v12 = v11;
v13 = "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 Elder Moderators' discretion.";
v14 = 2;
do
{
*(_OWORD *)v12 = *(_OWORD *)v13;
*((_OWORD *)v12 + 1) = *((_OWORD *)v13 + 1);
*((_OWORD *)v12 + 2) = *((_OWORD *)v13 + 2);
*((_OWORD *)v12 + 3) = *((_OWORD *)v13 + 3);
*((_OWORD *)v12 + 4) = *((_OWORD *)v13 + 4);
*((_OWORD *)v12 + 5) = *((_OWORD *)v13 + 5);
*((_OWORD *)v12 + 6) = *((_OWORD *)v13 + 6);
v12 += 16;
*((_OWORD *)v12 - 1) = *((_OWORD *)v13 + 7);
v13 += 128;
--v14;
}
while ( v14 );
*(_WORD *)v12 = *(_WORD *)v13;
*((_BYTE *)v12 + 2) = v13[2];
*((_BYTE *)v11 + 259) = 0;
v15 = sub_14003BDB0((__int64)&v39, (__int64)&v36);
v16 = FLAlertLayer::create(v10, (int)"Comment Rules", v15, (__int64)"Next", 0, 1136525312, 0, 0, 1065353216);
sub_14003A830((__int64)&v36);
v16->setTag(v16, 3);
v6 = v16->cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v7 = (__int64)v16;
}
}
else
{
v36 = 0;
v37 = 0;
v38 = 15;
*(_QWORD *)&v36 = sub_14003AA10(0x80u);
v37 = 113;
v38 = 127;
strcpy(
(char *)v36,
"You need an account to post comments. You can create one for free from settings in the main menu.");
v4 = sub_14003BDB0((__int64)&v39, (__int64)&v36);
v5 = FLAlertLayer::create(0, (int)"Account Needed", v4, (__int64)"Close", 0, 1136525312, 0, 0, 1065353216);
sub_14003A830((__int64)&v36);
v6 = v5->cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v7 = (__int64)v5;
}
v6->show((FLAlertLayer *)v7);
}