//
// ProfilePage::onFollow from 0x8f849c to 0x8f8724 (648 bytes)
//
// 3 xrefs:
// > ??> @ 0x952e0
// > ProfilePage::init @ 0x8fe418
// > ??> @ 0x122d190
//
// 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 ProfilePage::onFollow(ProfilePage *a1, cocos2d::CCObject *a2)
{
GameManager *v3; // x0
GameLevelManager *v4; // x0
GameLevelManager *v5; // x0
cocos2d::CCNode *v6; // x20
void (__fastcall *setSkewY)(cocos2d::CCNode *__hidden, float); // x21
cocos2d::CCSpriteFrameCache *v8; // x0
const char *v9; // x1
cocos2d::CCSpriteFrame *v10; // x0
GameLevelManager *v11; // x0
signed int v12; // w21
float v13; // s8
GameManager *v14; // x0
GameManager *v15; // x0
GameManager *v16; // x0
GameLevelManager *v17; // x0
cocos2d::CCString *v18; // x0
char *CString; // x0
FLAlertLayer *v20; // x20
void *v21; // x0
unsigned int *v22; // x2
int v23; // w1
__int64 v24; // [xsp+50h] [xbp+50h] BYREF
v3 = GameManager::sharedState();
GameManager::reportAchievementWithID(v3, "geometry.ach.followCreator", 100, 0);
v4 = GameLevelManager::sharedState();
if ( GameLevelManager::isFollowingUser(v4, a1->m_accountID) )
{
v5 = GameLevelManager::sharedState();
GameLevelManager::unfollowUser(v5, a1->m_accountID);
v6 = a1->m_followBtn->getNormalImage(a1->m_followBtn);
setSkewY = v6->__vftable[1].setSkewY;
v8 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v9 = "gj_heartOff_001.png";
LABEL_3:
v10 = cocos2d::CCSpriteFrameCache::spriteFrameByName(v8, v9);
((void (__fastcall *)(cocos2d::CCNode *, cocos2d::CCSpriteFrame *))setSkewY)(v6, v10);
return;
}
v11 = GameLevelManager::sharedState();
v12 = cocos2d::CCDictionary::count(v11->m_followedCreators);
v13 = (float)(v12 + 1);
v14 = GameManager::sharedState();
GameManager::reportAchievementWithID(v14, "geometry.ach.followCreator02", (int)floorf((float)(v13 / 10.0) * 100.0), 0);
v15 = GameManager::sharedState();
GameManager::reportAchievementWithID(
v15,
"geometry.ach.followCreator03",
vcvtms_s32_f32((float)(v13 / 25.0) * 100.0),
0);
v16 = GameManager::sharedState();
GameManager::reportAchievementWithID(
v16,
"geometry.ach.followCreator04",
vcvtms_s32_f32((float)(v13 / 50.0) * 100.0),
0);
if ( v12 <= 99 )
{
v17 = GameLevelManager::sharedState();
GameLevelManager::followUser(v17, a1->m_accountID);
v6 = a1->m_followBtn->getNormalImage(a1->m_followBtn);
setSkewY = v6->__vftable[1].setSkewY;
v8 = cocos2d::CCSpriteFrameCache::sharedSpriteFrameCache();
v9 = "gj_heartOn_001.png";
goto LABEL_3;
}
v18 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"You can only follow %i users at the same time.",
(const char *)&qword_60 + 4);
CString = (char *)cocos2d::CCString::getCString(v18);
sub_D153B8((int)&v24, CString);
v20 = FLAlertLayer::create(0, (__int64)"Max Followed", (__int64)&v24);
v21 = (void *)(v24 - 24);
if ( (__int64 *)(v24 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v22 = (unsigned int *)(v24 - 8);
do
v23 = __ldaxr(v22);
while ( __stlxr(v23 - 1, v22) );
}
else
{
v23 = *(_DWORD *)(v24 - 8);
*(_DWORD *)(v24 - 8) = v23 - 1;
}
if ( v23 <= 0 )
operator delete(v21);
}
v20->show(v20);
}