//
// ShareLevelSettingsLayer::onUnlisted from 0x140491b00 to 0x140491d1a (538 bytes)
//
// 2 xrefs:
// > ShareLevelSettingsLayer::init @ 0x1404915bd
// > ??> @ 0x1406dc0d4
//
// 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=3
void ShareLevelSettingsLayer::onUnlisted(ShareLevelSettingsLayer *a1, cocos2d::CCObject *a2)
{
GameManager *v3; // rcx
GameManager *v4; // rcx
__int64 v5; // rax
FLAlertLayer *v6; // rbx
GJGameLevel *m_level; // rax
__int128 v8; // [rsp+50h] [rbp-48h] BYREF
__int64 v9; // [rsp+60h] [rbp-38h]
__int64 v10; // [rsp+68h] [rbp-30h]
_BYTE v11[40]; // [rsp+70h] [rbp-28h] BYREF
void *v12; // [rsp+A0h] [rbp+8h]
void *v13; // [rsp+A0h] [rbp+8h]
a1->m_level->m_unlisted = !a1->m_level->m_unlisted;
v3 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v12 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v12);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v3 = (GameManager *)qword_1406C2ED8;
}
if ( !GameManager::getGameVariable(v3, "0070") )
{
v4 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v13 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00((__int64)v13);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v4 = (GameManager *)qword_1406C2ED8;
}
GameManager::setGameVariable(v4, "0070", 1);
v8 = 0;
*(_QWORD *)&v8 = sub_14003AA10(0x80u);
v9 = 119;
v10 = 127;
strcpy(
(char *)v8,
"An unlisted level can only be found by entering its levelID. Once a level is unlisted, it cannot change back to listed.");
v5 = sub_14003BDB0((__int64)v11, (__int64)&v8);
v6 = FLAlertLayer::create(0, (int)"Unlisted", v5, (__int64)"OK", 0, 1134559232, 0, 0, 1065353216);
sub_14003A830((__int64)&v8);
v6->show(v6);
}
m_level = a1->m_level;
if ( !m_level->m_unlisted )
m_level->m_friendsOnly = 0;
ShareLevelSettingsLayer::updateSettingsState(a1);
}