//
// InfoLayer::onComment from 0x908370 to 0x908728 (952 bytes)
//
// 5 xrefs:
// > InfoLayer::FLAlert_Clicked @ 0x908774
// > ??> @ 0x9ae10
// > InfoLayer::init @ 0x90b814
// > InfoLayer::init @ 0x90c49c
// > ??> @ 0x15443f0
//
// 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 12:57:10 +0000
//
__int64 __fastcall InfoLayer::onComment(InfoLayer *this, cocos2d::CCObject *a2)
{
__int64 v3; // x0
GJAccountManager *v4; // x0
GameManager *v5; // x0
GameLevelManager *GameVariable; // x0
GameManager *v7; // x0
__int64 v8; // x20
GameLevelManager *v10; // x20
GameLevelManager *v11; // x22
unsigned int active; // w0
const char *PostCommentKey; // x0
unsigned int TimeLeft; // w0
unsigned int v15; // w20
const char *v16; // x1
unsigned int v17; // w22
size_t v18; // x0
unsigned int v19; // w25
_DWORD *v20; // x20
__int64 v21; // x0
GJAccountManager *v22; // x0
cocos2d::CCString *v23; // x0
const char *CString; // x0
size_t v25; // x0
__int64 v26; // x0
char *v27; // [xsp+58h] [xbp+58h]
char *v28; // [xsp+58h] [xbp+58h]
__int64 v29[2]; // [xsp+68h] [xbp+68h] BYREF
void *v30; // [xsp+78h] [xbp+78h]
__int64 v31; // [xsp+80h] [xbp+80h] BYREF
__int64 v32; // [xsp+88h] [xbp+88h]
void *v33; // [xsp+90h] [xbp+90h]
v3 = GJAccountManager::sharedState(_stack_chk_guard);
v4 = (GJAccountManager *)(unsigned int)(*(_DWORD *)(v3 + 352) - *(_DWORD *)(v3 + 356));
if ( (int)v4 <= 0 )
{
v22 = (GJAccountManager *)GJAccountManager::sharedState(v4);
GJAccountManager::showAccountNeededAlert(v22, "post comments");
return _stack_chk_guard;
}
v5 = (GameManager *)GameManager::sharedState(v4);
GameVariable = (GameLevelManager *)(unsigned __int8)GameManager::getGameVariable(v5, "0012");
if ( (_BYTE)GameVariable )
{
v10 = (GameLevelManager *)GameLevelManager::sharedState(GameVariable);
v11 = (GameLevelManager *)GameLevelManager::sharedState(v10);
active = InfoLayer::activeCommentID(this);
PostCommentKey = (const char *)GameLevelManager::getPostCommentKey(v11, (const char *)active);
TimeLeft = GameLevelManager::getTimeLeft(v10, PostCommentKey, 15.0);
if ( TimeLeft - 1 <= 0xE )
{
v23 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Please wait %i seconds before posting a new comment!",
(const char *)TimeLeft);
CString = (const char *)cocos2d::CCString::getCString(v23);
v31 = 0;
v28 = (char *)CString;
v32 = 0;
v33 = nullptr;
v25 = strlen(CString);
std::string::__init(&v31, v28, v25);
v20 = (_DWORD *)FLAlertLayer::create(
0,
(cocos2d::CCLabelBMFont *)"Too fast",
(char *)&v31,
(ButtonSprite *)"OK",
nullptr,
300.0);
if ( (v31 & 1) != 0 )
operator delete(v33);
goto LABEL_17;
}
if ( *((_QWORD *)this + 90) )
{
if ( !*((_BYTE *)this + 880) )
{
v15 = 6;
v16 = "Add Comment";
v17 = 100;
LABEL_11:
v27 = (char *)v16;
v29[0] = 0;
v29[1] = 0;
v30 = nullptr;
v18 = strlen(v16);
std::string::__init(v29, v27, v18);
v19 = InfoLayer::activeCommentID(this);
v31 = 0;
v32 = 0;
v33 = nullptr;
std::string::__init(&v31, &byte_11B8890, 0);
v20 = (_DWORD *)ShareCommentLayer::create(v29, v17, v15, v19, &v31);
if ( (v31 & 1) != 0 )
operator delete(v33);
if ( (v29[0] & 1) != 0 )
operator delete(v30);
v21 = *((_QWORD *)this + 87);
if ( v21 )
v20[201] = *(_DWORD *)(v21 + 864) - *(_DWORD *)(v21 + 868);
LABEL_17:
(*(void (__fastcall **)(_DWORD *))(*(_QWORD *)v20 + 1312LL))(v20);
return _stack_chk_guard;
}
v15 = 6;
if ( !*((_QWORD *)this + 88) )
{
v17 = 100;
v16 = "Mod Comment";
goto LABEL_11;
}
v16 = "Add Note";
}
else
{
if ( *((_BYTE *)this + 880) )
{
if ( *((_QWORD *)this + 88) )
{
v15 = 8;
v16 = "Add Note";
}
else
{
v15 = 7;
v16 = "Mod Comment";
}
v17 = 100;
goto LABEL_11;
}
v26 = GameManager::sharedState((GameManager *)*((unsigned __int8 *)this + 880));
v15 = 0;
v16 = "Add Comment";
if ( *(_DWORD *)(v26 + 1032) - *(_DWORD *)(v26 + 1036) == 2 )
{
v17 = 140;
goto LABEL_11;
}
}
v17 = 100;
goto LABEL_11;
}
v7 = (GameManager *)GameManager::sharedState(GameVariable);
GameManager::setGameVariable(v7, "0012", 1u);
v31 = 0;
v32 = 0;
v33 = nullptr;
std::string::__init(
&v31,
"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);
v8 = FLAlertLayer::create(
(__int64)this + 680,
(cocos2d::CCLabelBMFont *)"Comment Rules",
(char *)&v31,
(ButtonSprite *)"Next",
nullptr,
380.0);
if ( (v31 & 1) != 0 )
operator delete(v33);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v8 + 72LL))(v8, 3);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v8 + 1312LL))(v8);
return _stack_chk_guard;
}