//
// EditLevelLayer::onShare from 0x7ee51c to 0x7ee8a4 (904 bytes)
//
// 4 xrefs:
// > EditLevelLayer::FLAlert_Clicked @ 0x7f1d24
// > ??> @ 0x94888
// > EditLevelLayer::init @ 0x7f0b18
// > ??> @ 0x1544048
//
// 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:54:34 +0000
//
__int64 __fastcall EditLevelLayer::onShare(EditLevelLayer *this, cocos2d::CCObject *a2)
{
GameManager *v3; // x0
GameManager *v4; // x0
__int64 v5; // x0
GJAccountManager *v6; // x0
__int64 v7; // x0
__int64 v8; // x1
_BOOL4 v9; // w24
__int64 v10; // x0
__int64 v11; // x1
_BOOL4 v12; // w21
GameManager *v13; // x0
GameManager *v14; // x0
GameManager *GameVariable; // x0
GameManager *v16; // x0
__int64 v17; // x20
GameManager *v18; // x0
__int64 v20; // x0
GJGameLevel *v21; // x1
__int64 v22; // x0
GJAccountManager *v23; // x0
GameManager *v24; // [xsp+48h] [xbp+48h] BYREF
__int64 v25; // [xsp+50h] [xbp+50h]
void *v26; // [xsp+58h] [xbp+58h]
__int64 v27; // [xsp+60h] [xbp+60h] BYREF
__int64 v28; // [xsp+68h] [xbp+68h]
void *v29; // [xsp+70h] [xbp+70h]
v3 = (GameManager *)GameManager::sharedState(_stack_chk_guard);
v4 = (GameManager *)(unsigned __int8)GameManager::safeModeEnabled(v3);
if ( (_BYTE)v4 )
{
v18 = (GameManager *)GameManager::sharedState(v4);
GameManager::showParentalRestrictedAlert(v18);
return _stack_chk_guard;
}
v5 = GJAccountManager::sharedState(v4);
v6 = (GJAccountManager *)(unsigned int)(*(_DWORD *)(v5 + 352) - *(_DWORD *)(v5 + 356));
if ( (int)v6 <= 0 )
{
v23 = (GJAccountManager *)GJAccountManager::sharedState(v6);
GJAccountManager::showAccountNeededAlert(v23, "share levels");
return _stack_chk_guard;
}
v7 = *((_QWORD *)this + 59);
v24 = nullptr;
v25 = 0;
v26 = nullptr;
if ( (*(_BYTE *)(v7 + 392) & 1) != 0 )
{
std::string::__init((__int64 *)&v24, *(void **)(v7 + 408), *(_QWORD *)(v7 + 400));
}
else
{
v8 = *(_QWORD *)(v7 + 400);
v24 = *(GameManager **)(v7 + 392);
v25 = v8;
v26 = *(void **)(v7 + 408);
}
v27 = 0;
v28 = 0;
v29 = nullptr;
std::string::__init(&v27, &byte_11B8890, 0);
v9 = sub_7ED2C0((__int64)&v24, (__int64)&v27);
if ( (v27 & 1) != 0 )
operator delete(v29);
if ( ((unsigned __int8)v24 & 1) != 0 )
{
operator delete(v26);
if ( !v9 )
goto LABEL_9;
LABEL_26:
v27 = 0;
v28 = 0;
v29 = nullptr;
std::string::__init(&v27, "You cannot share an empty level.", 0x20u);
v20 = FLAlertLayer::create(0, (cocos2d::CCLabelBMFont *)"Empty", (char *)&v27, (ButtonSprite *)"OK", nullptr, 380.0);
goto LABEL_23;
}
if ( v9 )
goto LABEL_26;
LABEL_9:
v10 = *((_QWORD *)this + 59);
v24 = nullptr;
v25 = 0;
v26 = nullptr;
if ( (*(_BYTE *)(v10 + 344) & 1) != 0 )
{
std::string::__init((__int64 *)&v24, *(void **)(v10 + 360), *(_QWORD *)(v10 + 352));
}
else
{
v11 = *(_QWORD *)(v10 + 352);
v24 = *(GameManager **)(v10 + 344);
v25 = v11;
v26 = *(void **)(v10 + 360);
}
v27 = 0;
v28 = 0;
v29 = nullptr;
std::string::__init(&v27, &byte_11B8890, 0);
v12 = sub_7ED2C0((__int64)&v24, (__int64)&v27);
if ( (v27 & 1) != 0 )
operator delete(v29);
v13 = (GameManager *)(unsigned __int8)v24;
if ( ((unsigned __int8)v24 & 1) != 0 )
{
operator delete(v26);
if ( !v12 )
goto LABEL_15;
}
else if ( !v12 )
{
LABEL_15:
v14 = (GameManager *)GameManager::sharedState(v13);
GameVariable = (GameManager *)(unsigned __int8)GameManager::getGameVariable(v14, "0157");
if ( (_BYTE)GameVariable )
{
EditLevelLayer::closeTextInputs((cocos2d::CCArray **)this);
v22 = ShareLevelLayer::create(*((ShareLevelLayer **)this + 59), v21);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v22 + 1312LL))(v22);
return _stack_chk_guard;
}
v16 = (GameManager *)GameManager::sharedState(GameVariable);
GameManager::setGameVariable(v16, "0157", 1u);
v27 = 0;
v28 = 0;
v29 = nullptr;
std::string::__init(
&v27,
"Hateful, abusive, or otherwise inappropriate content, whether it is in the level, name, or description may lead to"
" deletion. The same applies to levels abusing cheats or exploits. Stealing assets from other levels is discouraged and may stop a level from being rated depending on the context, severity, credit, and more. Level"
"s verified with hacks cannot be rated.\n"
"These guidelines and their enforcement are entirely at RobTop's discretion.",
0x1D0u);
v17 = FLAlertLayer::create(
(__int64)this + 416,
(cocos2d::CCLabelBMFont *)"Upload Guidelines",
(char *)&v27,
(ButtonSprite *)"OK",
nullptr,
380.0);
if ( (v27 & 1) != 0 )
operator delete(v29);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v17 + 72LL))(v17, 10);
goto LABEL_19;
}
v27 = 0;
v28 = 0;
v29 = nullptr;
std::string::__init(&v27, "You must name your level before sharing it.", 0x2Bu);
v20 = FLAlertLayer::create(0, (cocos2d::CCLabelBMFont *)"No Name", (char *)&v27, (ButtonSprite *)"OK", nullptr, 380.0);
LABEL_23:
v17 = v20;
if ( (v27 & 1) != 0 )
operator delete(v29);
LABEL_19:
(*(void (__fastcall **)(__int64))(*(_QWORD *)v17 + 1312LL))(v17);
return _stack_chk_guard;
}