//
// ShareLevelSettingsLayer::init from 0x140632b30 to 0x14063358f (2655 bytes)
//
// 2 xrefs:
// > ShareLevelLayer::onSettings @ 0x140631c7c
// > ??> @ 0x140930b78
//
// This function is hookable on this platform (idp: pc, 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 11:35:29 +0000
//
// Hidden C++ exception states: #wind=2
bool __fastcall ShareLevelSettingsLayer::init(__int64 a1, __int64 a2, __int64 a3)
{
bool result; // al
__int64 v7; // rcx
__int64 v8; // rax
__int64 v9; // rax
__int64 *v10; // rdi
__int64 v11; // rbx
__int64 v12; // rax
__int64 v13; // rbx
__int64 v14; // rax
struct cocos2d::CCLabelBMFont *v15; // rdi
__int64 v16; // rbx
__int64 v17; // rax
__int64 v18; // rcx
__int64 v19; // rax
_QWORD *v20; // r9
_QWORD *v21; // rcx
const char *v22; // rdx
__int64 v23; // r8
char *v24; // rsi
__int64 v25; // rdi
__int64 v26; // rbx
__int64 v27; // rax
__int64 v28; // rax
int v29; // eax
cocos2d::CCObject *v30; // rsi
__int64 v31; // rdi
__int64 v32; // rbx
__int64 v33; // rax
__int64 v34; // rax
struct cocos2d::CCLabelBMFont *v35; // rax
__int64 *v36; // rdi
__int64 v37; // rbx
__int64 v38; // rax
struct cocos2d::CCSprite *v39; // r15
struct cocos2d::CCSprite *v40; // r12
cocos2d::CCMenuItem *v41; // rsi
__int64 v42; // rdx
__int64 v43; // rbx
__int64 v44; // rax
struct cocos2d::CCLabelBMFont *v45; // rdi
__int64 v46; // rbx
__int64 v47; // rax
float *v48; // rax
__int64 v49; // rax
__int64 v50; // rax
struct cocos2d::CCSprite *v51; // rsi
struct cocos2d::CCSprite *v52; // rbx
cocos2d::CCMenuItem *v53; // rax
__int64 *v54; // rdi
__int64 v55; // rbx
__int64 v56; // rax
__int64 v57; // rcx
struct cocos2d::CCLabelBMFont *v58; // rax
__int64 *v59; // rdi
__int64 v60; // rbx
__int64 v61; // rax
float *v62; // rax
__int64 v63; // rax
const struct cocos2d::CCPoint *v64; // rax
char *v65; // rdi
__int64 v66; // rbx
__int64 v67; // rax
__int128 *v68; // [rsp+48h] [rbp-79h] BYREF
_QWORD v69[2]; // [rsp+50h] [rbp-71h] BYREF
_BYTE v70[4]; // [rsp+60h] [rbp-61h] BYREF
float v71; // [rsp+64h] [rbp-5Dh]
__int128 v72; // [rsp+68h] [rbp-59h] BYREF
__int64 v73; // [rsp+78h] [rbp-49h]
__int64 v74; // [rsp+80h] [rbp-41h]
_BYTE v75[8]; // [rsp+88h] [rbp-39h] BYREF
__int128 v76; // [rsp+90h] [rbp-31h] BYREF
__int64 v77; // [rsp+A0h] [rbp-21h]
__int64 v78; // [rsp+A8h] [rbp-19h]
float v79; // [rsp+140h] [rbp+7Fh] BYREF
float v80; // [rsp+144h] [rbp+83h]
result = FLAlertLayer::init_1(a1, 75);
if ( result )
{
*(_QWORD *)(a1 + 680) = a2;
*(_QWORD *)(a1 + 704) = a3;
v8 = cocos2d::CCDirector::sharedDirector(v7);
cocos2d::CCDirector::getWinSize(v8, &v79);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v69, 0.0, 0.0, 80.0, 80.0);
v10 = (__int64 *)cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v9);
v11 = *v10;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v68, 360.0, 220.0);
(*(void (__fastcall **)(__int64 *, __int64))(v11 + 312))(v10, v12);
(*(void (__fastcall **)(_QWORD, __int64 *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v10,
0xFFFFFFFFLL);
v13 = *v10;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, v79 * 0.5, v80 * 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v13 + 184))(v10, v14);
v15 = cocos2d::CCLabelBMFont::create("Settings", &qword_140704F78);
v16 = *(_QWORD *)v15;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, v79 * 0.5, (float)((float)(v80 * 0.5) + 110.0) - 20.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v16 + 184))(v15, v17);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v15);
*(_DWORD *)(a1 + 640) = -1;
v19 = cocos2d::CCMenu::create(v18);
*(_QWORD *)(a1 + 552) = v19;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v19, 10);
v68 = &v72;
v72 = 0;
v73 = 0;
v74 = 0;
v20 = sub_14003D460(0x160u);
*(_QWORD *)&v72 = v20;
v73 = 351;
v74 = 351;
v21 = v20;
v22 = "Unlisted makes it so that your level can only be found by searching for the exact ID. It will "
"not be visible on your profile, from search, or anywhere else. Unlisted levels do not have to "
"be verified to be uploaded.\n"
"Friends Only makes it so that only friends who search the exact ID can find it.";
v23 = 2;
do
{
*(_OWORD *)v21 = *(_OWORD *)v22;
*((_OWORD *)v21 + 1) = *((_OWORD *)v22 + 1);
*((_OWORD *)v21 + 2) = *((_OWORD *)v22 + 2);
*((_OWORD *)v21 + 3) = *((_OWORD *)v22 + 3);
*((_OWORD *)v21 + 4) = *((_OWORD *)v22 + 4);
*((_OWORD *)v21 + 5) = *((_OWORD *)v22 + 5);
*((_OWORD *)v21 + 6) = *((_OWORD *)v22 + 6);
v21 += 16;
*((_OWORD *)v21 - 1) = *((_OWORD *)v22 + 7);
v22 += 128;
--v23;
}
while ( v23 );
*(_OWORD *)v21 = *(_OWORD *)v22;
*((_OWORD *)v21 + 1) = *((_OWORD *)v22 + 1);
*((_OWORD *)v21 + 2) = *((_OWORD *)v22 + 2);
*((_OWORD *)v21 + 3) = *((_OWORD *)v22 + 3);
*((_OWORD *)v21 + 4) = *((_OWORD *)v22 + 4);
v21[10] = *((_QWORD *)v22 + 10);
*((_DWORD *)v21 + 22) = *((_DWORD *)v22 + 22);
*((_WORD *)v21 + 46) = *((_WORD *)v22 + 46);
*((_BYTE *)v21 + 94) = v22[94];
*((_BYTE *)v20 + 351) = 0;
v76 = 0;
v77 = 4;
v78 = 15;
strcpy((char *)&v76, "Help");
v24 = InfoAlertButton::create((__int64)&v76, (__int64)&v72);
(*(void (__fastcall **)(_QWORD, char *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v24);
v25 = *(_QWORD *)v24;
v26 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v68,
(float)((float)(v79 * 0.5) + 180.0) - 20.0,
(float)((float)(v80 * 0.5) + 110.0) - 20.0);
cocos2d::CCNode::convertToNodeSpace(v26, v69, v27);
(*(void (__fastcall **)(char *, __int64))(v25 + 184))(v24, v28);
v29 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
v30 = CCMenuItemSpriteExtra::create(v29, 0, a1, (__int64)ShareLevelSettingsLayer::onClose);
*((_DWORD *)v30 + 93) = 1069547520;
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v30);
v31 = *(_QWORD *)v30;
v32 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v69,
(float)((float)(v79 * 0.5) - 180.0) + 5.0,
(float)((float)(v80 * 0.5) + 110.0) - 5.0);
cocos2d::CCNode::convertToNodeSpace(v32, &v68, v33);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v31 + 184))(v30, v34);
v35 = cocos2d::CCLabelBMFont::create(&byte_1406ED6E0, "goldFont.fnt");
*(_QWORD *)(a1 + 672) = v35;
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v35);
v36 = *(__int64 **)(a1 + 672);
v37 = *v36;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v69, v79 * 0.5, (float)((float)(v80 * 0.5) - 110.0) + 80.0);
(*(void (__fastcall **)(__int64 *, __int64))(v37 + 184))(v36, v38);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 672) + 160LL))(*(_QWORD *)(a1 + 672));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v70, (float)(v79 * 0.5) - 140.0, (float)(v80 * 0.5) + 45.0);
v39 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOn_001.png");
v40 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOff_001.png");
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v39 + 160LL))(v39);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v40 + 160LL))(v40);
v41 = CCMenuItemToggler::create((int)v39, (int)v40, a1, (__int64)ShareLevelSettingsLayer::onUnlisted);
LOBYTE(v42) = *(_BYTE *)(*(_QWORD *)(a1 + 680) + 688LL) == 0;
CCMenuItemToggler::toggle((__int64)v41, v42);
(*(void (__fastcall **)(_QWORD, cocos2d::CCMenuItem *))(**(_QWORD **)(a1 + 552) + 464LL))(
*(_QWORD *)(a1 + 552),
v41);
v43 = *(_QWORD *)v41;
cocos2d::CCNode::convertToNodeSpace(*(_QWORD *)(a1 + 552), v69, v70);
(*(void (__fastcall **)(cocos2d::CCMenuItem *, __int64))(v43 + 184))(v41, v44);
*(_DWORD *)(*((_QWORD *)v41 + 47) + 372LL) = 1069547520;
*(_DWORD *)(*((_QWORD *)v41 + 48) + 372LL) = 1069547520;
CCMenuItemToggler::toggle((__int64)v41, *((unsigned __int8 *)v41 + 392));
v45 = cocos2d::CCLabelBMFont::create("Unlisted", &qword_140704F78);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v45);
v46 = *(_QWORD *)v45;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v69, 0.0, 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v46 + 288))(v45, v47);
v48 = (float *)(*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v39 + 320LL))(v39);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v69, (float)((float)(*v48 * 0.5) * 0.80000001) + 8.0, 0.0);
cocos2d::CCPoint::operator+(v70, &v68, v49);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int128 **))(*(_QWORD *)v45 + 184LL))(v45, &v68);
if ( *(float *)(*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v45 + 320LL))(v45) > 110.0 )
{
(*(__int64 (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v45 + 320LL))(v45);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v45 + 160LL))(v45);
}
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v45 + 168LL))(v45);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v45 + 160LL))(v45);
v50 = *(_QWORD *)(a1 + 680);
if ( *(_BYTE *)(v50 + 857) || *(int *)(v50 + 860) > 1 )
{
(*(void (__fastcall **)(cocos2d::CCMenuItem *, _QWORD))(*(_QWORD *)v41 + 936LL))(v41, 0);
(**((void (__fastcall ***)(__int64, void *))v39 + 40))((__int64)v39 + 320, &unk_1407046C8);
(**((void (__fastcall ***)(__int64, void *))v40 + 40))((__int64)v40 + 320, &unk_1407046C8);
(**((void (__fastcall ***)(__int64, void *))v45 + 46))((__int64)v45 + 368, &unk_1407046C8);
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v75, (float)(v79 * 0.5) + 40.0, v71);
v51 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOn_001.png");
v52 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_checkOff_001.png");
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v51 + 160LL))(v51);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v52 + 160LL))(v52);
v53 = CCMenuItemToggler::create((int)v52, (int)v51, a1, (__int64)ShareLevelSettingsLayer::onUnlistedFriendsOnly);
*(_QWORD *)(a1 + 688) = v53;
CCMenuItemToggler::toggle((__int64)v53, *(unsigned __int8 *)(*(_QWORD *)(a1 + 680) + 689LL));
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 552) + 464LL))(
*(_QWORD *)(a1 + 552),
*(_QWORD *)(a1 + 688));
v54 = *(__int64 **)(a1 + 688);
v55 = *v54;
cocos2d::CCNode::convertToNodeSpace(*(_QWORD *)(a1 + 552), v69, v75);
(*(void (__fastcall **)(__int64 *, __int64))(v55 + 184))(v54, v56);
v57 = *(_QWORD *)(a1 + 688);
*(_DWORD *)(*(_QWORD *)(v57 + 376) + 372LL) = 1069547520;
*(_DWORD *)(*(_QWORD *)(v57 + 384) + 372LL) = 1069547520;
CCMenuItemToggler::toggle(v57, *(unsigned __int8 *)(v57 + 392));
v58 = cocos2d::CCLabelBMFont::create("Friends Only", &qword_140704F78);
*(_QWORD *)(a1 + 696) = v58;
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v58);
v59 = *(__int64 **)(a1 + 696);
v60 = *v59;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v69, 0.0, 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v60 + 288))(v59, v61);
v62 = (float *)(*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v51 + 320LL))(v51);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v69, (float)((float)(*v62 * 0.5) * 0.80000001) + 8.0, 0.0);
cocos2d::CCPoint::operator+(v75, &v68, v63);
(*(void (__fastcall **)(_QWORD, __int128 **))(**(_QWORD **)(a1 + 696) + 184LL))(*(_QWORD *)(a1 + 696), &v68);
cocos2d::CCLabelBMFont::limitLabelWidth(*(cocos2d::CCLabelBMFont **)(a1 + 696), 110.0, 0.34999999, 0.0);
ShareLevelSettingsLayer::updateSettingsState(a1);
v69[0] = &v72;
v72 = 0;
v73 = 0;
v74 = 0;
*(_QWORD *)&v72 = sub_14003D460(0x60u);
v73 = 90;
v74 = 95;
strcpy((char *)v72, "Starting in 2.2, all new levels are free to copy.\n(Older levels retain any copy settings.)");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v68, 0.5, 1.0);
v65 = TextArea::create((__int64)&v72, "chatFont.fnt", 1.0, 320.0, v64, 1101004800, 0, 0);
(*(void (__fastcall **)(_QWORD, char *))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v65);
v66 = *(_QWORD *)v65;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v69, v79 * 0.5, (float)((float)(v80 * 0.5) - 110.0) + 35.0);
(*(void (__fastcall **)(char *, __int64))(v66 + 184))(v65, v67);
(*(void (__fastcall **)(char *))(*(_QWORD *)v65 + 160LL))(v65);
return 1;
}
return result;
}