//
// InfoLayer::onComment from 0x100351720 to 0x1003519c0 (672 bytes)
//
// 2 xrefs:
// > InfoLayer::FLAlert_Clicked @ 0x100352a98
// > InfoLayer::init @ 0x100350634
//
// 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 __fastcall InfoLayer::onComment(InfoLayer *a1, cocos2d::CCObject *a2)
{
GJAccountManager *v3; // x0
GameManager *v4; // x0
GameLevelManager *v5; // x20
GameLevelManager *v6; // x0
GJUserScore *m_score; // x8
int m_userID; // w1
FLAlertLayer *v9; // x20
void *v10; // x0
GameManager *v11; // x0
GJLevelList *m_levelList; // x8
GJGameLevel *m_level; // x8
const char *PostCommentKey; // x0
int TimeLeft; // w0
cocos2d::CCString *v16; // x0
char *CString; // x0
GJUserScore *v18; // x8
__int64 v19; // x20
GJLevelList *v20; // x8
GJGameLevel *v21; // x8
GJGameLevel *v22; // x8
void *__p[2]; // [xsp+8h] [xbp-88h] BYREF
char v24; // [xsp+1Fh] [xbp-71h]
void *v25[2]; // [xsp+20h] [xbp-70h] BYREF
char v26; // [xsp+37h] [xbp-59h]
_QWORD v27[2]; // [xsp+38h] [xbp-58h] BYREF
char v28; // [xsp+4Fh] [xbp-41h]
void *v29[2]; // [xsp+50h] [xbp-40h] BYREF
char v30; // [xsp+67h] [xbp-29h]
_QWORD v31[2]; // [xsp+68h] [xbp-28h] BYREF
char v32; // [xsp+7Fh] [xbp-11h]
v3 = GJAccountManager::sharedState();
if ( v3->m_accountID <= v3->m_unkInt1 )
{
sub_100009900(
v31,
"You need an account to post comments. You can create one for free from settings in the main menu.");
v9 = FLAlertLayer::create_1(0, (__int64)"Account Needed", (__int64)v31, (__int64)"Close", 0, 380.0);
if ( v32 < 0 )
{
v10 = (void *)v31[0];
LABEL_7:
operator delete(v10);
}
}
else
{
v4 = GameManager::sharedState();
if ( GameManager::getGameVariable(v4, "0012") )
{
v5 = GameLevelManager::sharedState();
v6 = GameLevelManager::sharedState();
m_score = a1->m_score;
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;
}
}
PostCommentKey = GameLevelManager::getPostCommentKey(v6, m_userID);
TimeLeft = GameLevelManager::getTimeLeft(v5, PostCommentKey, 15.0);
if ( (unsigned int)(TimeLeft - 1) <= 0xE )
{
v16 = (cocos2d::CCString *)sub_100268F4C("Please wait %i seconds before posting a new comment!", TimeLeft);
CString = (char *)cocos2d::CCString::getCString(v16);
sub_100009900(v27, CString);
v9 = FLAlertLayer::create_1(0, (__int64)"Too fast", (__int64)v27, (__int64)"OK", 0, 300.0);
if ( (v28 & 0x80000000) == 0 )
goto LABEL_32;
v10 = (void *)v27[0];
goto LABEL_7;
}
sub_100009900(v25, "Add Comment");
v18 = a1->m_score;
if ( v18 )
{
v19 = (unsigned int)v18->m_userID;
}
else
{
v20 = a1->m_levelList;
if ( v20 )
{
v19 = (unsigned int)-v20->m_listID;
}
else
{
v21 = a1->m_level;
if ( v21 )
v19 = (unsigned int)(v21->m_levelID.random - v21->m_levelID.seed);
else
v19 = 0;
}
}
sub_100009900(__p, "");
v9 = (FLAlertLayer *)ShareCommentLayer::create((__int64)v25, 100, 0, v19, (__int64)__p);
if ( v24 < 0 )
operator delete(__p[0]);
if ( v26 < 0 )
operator delete(v25[0]);
v22 = a1->m_level;
if ( v22 )
LODWORD(v9[1].m_sAdditionalTransform.c) = v22->m_orbCompletion.random - v22->m_orbCompletion.seed;
}
else
{
v11 = GameManager::sharedState();
GameManager::setGameVariable(v11, "0012", 1);
sub_100009900(
v29,
"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.");
v9 = FLAlertLayer::create_1(
(__int64)&a1->FLAlertLayerProtocol,
(__int64)"Comment Rules",
(__int64)v29,
(__int64)"Next",
0,
380.0);
if ( v30 < 0 )
operator delete(v29[0]);
((void (__fastcall *)(FLAlertLayer *, __int64))v9->setTag)(v9, 3);
}
}
LABEL_32:
((void (__fastcall *)(FLAlertLayer *))v9->show)(v9);
}