//
// EditorPauseLayer::customSetup from 0x10027d2e0 to 0x10027e246 (3942 bytes)
//
// 1 xrefs:
// > ??> @ 0x100afdf00
//
// 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 12:27:42 +0000
//
__int64 __fastcall EditorPauseLayer::customSetup(_QWORD *a1)
{
__int64 v1; // rax
__int64 v2; // rbx
char *v3; // rax
void *v4; // rax
char *v5; // rsi
__int64 v6; // rax
void *v7; // r15
char *v8; // r12
void *v9; // r13
char *v10; // rax
void *v11; // rax
char *v12; // r14
char *v13; // r14
_QWORD *v14; // r15
__int64 v15; // r14
__int64 v16; // rdi
__int64 v17; // rax
double v18; // xmm0_8
__int64 v19; // rax
double *v20; // rsi
__int64 v21; // rdi
__int64 v22; // rdi
double v23; // xmm0_8
__int64 v24; // rax
char *v25; // r13
float *v26; // rdi
char *v27; // r15
_QWORD *v28; // rax
__int64 v29; // r12
char *v30; // r14
float v31; // xmm0_4
float v32; // xmm0_4
float v33; // xmm0_4
__int64 v34; // rax
__int64 v35; // rcx
__int64 v36; // r8
float *v37; // r15
__int64 v38; // r13
__int64 v39; // rsi
__int64 v40; // rax
double v41; // xmm0_8
__int64 v42; // rax
__int64 v43; // rdi
double v44; // xmm0_8
__int64 v45; // r12
_QWORD *v46; // r14
__int64 v47; // r13
__int64 v48; // r13
__int64 v49; // r13
__int64 v50; // r15
__int64 v51; // rbx
__int64 v52; // rdx
double v53; // xmm0_8
__int64 v54; // rax
__int64 v55; // rsi
__int64 v56; // rax
float v58; // [rsp+0h] [rbp-230h] BYREF
unsigned int v59; // [rsp+8h] [rbp-228h] BYREF
float v60[2]; // [rsp+10h] [rbp-220h] BYREF
double v61; // [rsp+18h] [rbp-218h] BYREF
float v62; // [rsp+20h] [rbp-210h]
float v63; // [rsp+24h] [rbp-20Ch]
__int64 v64; // [rsp+28h] [rbp-208h]
_QWORD *v65; // [rsp+30h] [rbp-200h]
_QWORD *v66; // [rsp+38h] [rbp-1F8h]
float v67[4]; // [rsp+44h] [rbp-1ECh] BYREF
__int64 v68; // [rsp+54h] [rbp-1DCh] BYREF
int v69; // [rsp+5Ch] [rbp-1D4h]
char *v70; // [rsp+60h] [rbp-1D0h]
char *v71; // [rsp+68h] [rbp-1C8h]
float v72; // [rsp+74h] [rbp-1BCh]
char *v73; // [rsp+78h] [rbp-1B8h]
_QWORD v74[2]; // [rsp+80h] [rbp-1B0h] BYREF
float v75[4]; // [rsp+90h] [rbp-1A0h] BYREF
__int64 (__fastcall *v76)(); // [rsp+A0h] [rbp-190h]
_QWORD v77[3]; // [rsp+A8h] [rbp-188h] BYREF
float v78[4]; // [rsp+C0h] [rbp-170h] BYREF
__int64 (__fastcall *v79)(); // [rsp+D0h] [rbp-160h]
__int64 v80; // [rsp+D8h] [rbp-158h]
const char *v81; // [rsp+E0h] [rbp-150h]
const char *v82; // [rsp+E8h] [rbp-148h]
float v83[4]; // [rsp+F0h] [rbp-140h] BYREF
__int64 (__fastcall *v84)(); // [rsp+100h] [rbp-130h]
__int64 v85; // [rsp+108h] [rbp-128h]
const char *v86; // [rsp+110h] [rbp-120h]
const char *v87; // [rsp+118h] [rbp-118h]
float v88[4]; // [rsp+120h] [rbp-110h] BYREF
__int64 (__fastcall *v89)(); // [rsp+130h] [rbp-100h]
__int64 v90; // [rsp+138h] [rbp-F8h]
const char *v91; // [rsp+140h] [rbp-F0h]
const char *v92; // [rsp+148h] [rbp-E8h]
float v93[4]; // [rsp+150h] [rbp-E0h] BYREF
__int64 (__fastcall *v94)(); // [rsp+160h] [rbp-D0h]
__int64 v95; // [rsp+168h] [rbp-C8h]
const char *v96; // [rsp+170h] [rbp-C0h]
const char *v97; // [rsp+178h] [rbp-B8h]
float v98[4]; // [rsp+180h] [rbp-B0h] BYREF
__int64 (__fastcall *v99)(); // [rsp+190h] [rbp-A0h]
__int64 v100; // [rsp+198h] [rbp-98h]
const char *v101; // [rsp+1A0h] [rbp-90h]
const char *v102; // [rsp+1A8h] [rbp-88h]
float v103[4]; // [rsp+1B0h] [rbp-80h] BYREF
__int64 (__fastcall *v104)(); // [rsp+1C0h] [rbp-70h]
__int64 v105; // [rsp+1C8h] [rbp-68h]
const char *v106; // [rsp+1D0h] [rbp-60h]
const char *v107; // [rsp+1D8h] [rbp-58h]
float v108[4]; // [rsp+1E0h] [rbp-50h] BYREF
__int64 (__fastcall *v109)(); // [rsp+1F0h] [rbp-40h]
__int64 v110; // [rsp+1F8h] [rbp-38h]
(*(void (__fastcall **)(_QWORD *, __int64))(*a1 + 1168LL))(a1, 175);
v1 = cocos2d::CCDirector::sharedDirector(a1, 175);
cocos2d::CCDirector::getWinSize(v60, v1);
v2 = cocos2d::CCMenu::create();
(*(void (__fastcall **)(_QWORD *, __int64))(*a1 + 456LL))(a1, v2);
v3 = ButtonSprite::create_1(
(__int64)"Resume",
0xB4u,
0,
1u,
(__int64)"goldFont.fnt",
(__int64)"GJ_button_01.png",
0.80000001,
28.0);
v4 = CCMenuItemSpriteExtra::create((__int64)v3, 0, (__int64)a1, (__int64)EditorPauseLayer::onResume, 0);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v2 + 456LL))(v2, v4);
v73 = ButtonSprite::create_1(
(__int64)"Save and Play",
0xB4u,
0,
1u,
(__int64)"goldFont.fnt",
(__int64)"GJ_button_01.png",
0.80000001,
28.0);
v5 = (char *)CCMenuItemSpriteExtra::create((__int64)v73, 0, (__int64)a1, (__int64)EditorPauseLayer::onSaveAndPlay, 0);
v6 = *(_QWORD *)v2;
v70 = v5;
(*(void (__fastcall **)(__int64))(v6 + 456))(v2);
v71 = ButtonSprite::create_1(
(__int64)"Save and Exit",
0xB4u,
0,
1u,
(__int64)"goldFont.fnt",
(__int64)"GJ_button_01.png",
0.80000001,
28.0);
v7 = CCMenuItemSpriteExtra::create((__int64)v71, 0, (__int64)a1, (__int64)EditorPauseLayer::onSaveAndExit, 0);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v2 + 456LL))(v2, v7);
v8 = ButtonSprite::create_1(
(__int64)"Save",
0xB4u,
0,
1u,
(__int64)"goldFont.fnt",
(__int64)"GJ_button_01.png",
0.80000001,
28.0);
v9 = CCMenuItemSpriteExtra::create((__int64)v8, 0, (__int64)a1, (__int64)EditorPauseLayer::onSave, 0);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v2 + 456LL))(v2, v9);
v10 = ButtonSprite::create_1(
(__int64)"Exit",
0xB4u,
0,
1u,
(__int64)"goldFont.fnt",
(__int64)"GJ_button_01.png",
0.80000001,
28.0);
v11 = CCMenuItemSpriteExtra::create((__int64)v10, 0, (__int64)a1, (__int64)EditorPauseLayer::onExitNoSave, 0);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v2 + 456LL))(v2, v11);
cocos2d::CCMenu::alignItemsVerticallyWithPadding(v2, 14.0);
v65 = a1;
v69 = *(_DWORD *)(*(_QWORD *)(a1[72] + 1936LL) + 1140LL);
if ( v69 != 2 )
{
memset(v74, 75, 3);
v12 = v73;
(*(void (__fastcall **)(_QWORD, _QWORD *))(**((_QWORD **)v73 + 81) + 960LL))(*((_QWORD *)v73 + 81), v74);
(*(void (__fastcall **)(_QWORD, _QWORD *))(**((_QWORD **)v12 + 78) + 1072LL))(*((_QWORD *)v12 + 78), v74);
(*(void (__fastcall **)(char *, _QWORD))(*(_QWORD *)v70 + 1056LL))(v70, 0);
v13 = v71;
(*(void (__fastcall **)(_QWORD, _QWORD *))(**((_QWORD **)v71 + 81) + 960LL))(*((_QWORD *)v71 + 81), v74);
(*(void (__fastcall **)(_QWORD, _QWORD *))(**((_QWORD **)v13 + 78) + 1072LL))(*((_QWORD *)v13 + 78), v74);
(*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)v7 + 1056LL))(v7, 0);
(*(void (__fastcall **)(_QWORD, _QWORD *))(**((_QWORD **)v8 + 81) + 960LL))(*((_QWORD *)v8 + 81), v74);
(*(void (__fastcall **)(_QWORD, _QWORD *))(**((_QWORD **)v8 + 78) + 1072LL))(*((_QWORD *)v8 + 78), v74);
(*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)v9 + 1056LL))(v9, 0);
}
v14 = (_QWORD *)cocos2d::CCMenu::create();
v15 = (__int64)v65;
v16 = (__int64)v65;
(*(void (__fastcall **)(_QWORD *, _QWORD *))(*v65 + 456LL))(v65, v14);
*(float *)&v73 = v60[0] * 0.5;
v17 = cocos2d::CCDirector::sharedDirector(v16, v14);
v18 = sub_100479750(v17);
sub_100278250((float *)v74, *(float *)&v73, *(float *)&v18 + 28.0);
v19 = *v14;
v66 = v14;
v20 = (double *)v74;
(*(void (__fastcall **)(_QWORD *, _QWORD *))(v19 + 184))(v14, v74);
v21 = cocos2d::CCDirector::sharedDirector(v14, v74);
v62 = sub_100479770(v21) + -50.0;
v22 = cocos2d::CCDirector::sharedDirector(v21, v74);
v23 = sub_100479740(v22);
v63 = *(float *)&v23 + -20.0;
v24 = cocos2d::CCDirector::sharedDirector(v22, v74);
sub_100479760(v24);
sub_100278250(&v58, 8.0, 0.0);
v74[0] = "Settings";
v74[1] = "GJ_sSettingsIcon_001.png";
sub_100278250(v75, -0.75, 1.0);
v75[2] = 1.0;
v76 = EditorPauseLayer::onOptions;
v25 = (char *)v77;
v77[0] = 0;
v77[1] = "Export";
v77[2] = "GJ_sExportIcon_001.png";
sub_100278250(v78, -1.0, 1.0);
v78[2] = 1.0;
v79 = EditorPauseLayer::onExport;
v80 = 0;
v81 = "Editor SFX";
v82 = "GJ_sSFXIcon_001.png";
sub_100278250(v83, -0.5, 0.5);
v83[2] = 0.94999999;
v84 = EditorPauseLayer::onEditorSounds;
v85 = 0;
v86 = "Auto-Save";
v87 = "GJ_sSaveIcon_001.png";
sub_100278250(v88, -1.0, 0.5);
v88[2] = 0.94999999;
v89 = EditorPauseLayer::onAutoSaveSettings;
v90 = 0;
v91 = "Death Stats";
v92 = "GJ_sMarkerIcon_001.png";
sub_100278250(v93, -0.5, 0.5);
v93[2] = 0.94999999;
v94 = EditorPauseLayer::onDeathStats;
v95 = 0;
v96 = "Get Audio";
v97 = "GJ_sAudioDLIcon_001.png";
sub_100278250(v98, -0.5, 0.5);
v98[2] = 0.94999999;
v99 = EditorPauseLayer::onDownloadAudio;
v100 = 0;
v101 = "Help";
v102 = "GJ_sHelpIcon_001.png";
sub_100278250(v103, -0.5, 0.5);
v103[2] = 1.0;
v104 = EditorPauseLayer::onHelp;
v105 = 0;
v106 = "Controls";
v107 = "controllerBtn_DPad_None_001.png";
v26 = v108;
sub_100278250(v108, -0.5, 0.5);
v108[2] = 0.55000001;
v109 = EditorPauseLayer::onControls;
v110 = 0;
LOBYTE(v72) = *(_BYTE *)(*(_QWORD *)(*(_QWORD *)(v15 + 576) + 3272LL) + 341LL);
v70 = nullptr;
do
{
if ( LOBYTE(v72) || *((__int64 (__fastcall **)())v25 - 1) != EditorPauseLayer::onControls || *(_QWORD *)v25 )
{
sub_100278270((__int64)v67, 0.0, 0.0, (__m128)0x42200000u, (__m128)0x42200000u);
v27 = (char *)cocos2d::extension::CCScale9Sprite::create_2("GJ_button_05.png", v67);
sub_100278260(v67, 82.0, 26.0);
(*(void (__fastcall **)(char *, float *))(*(_QWORD *)v27 + 320LL))(v27, v67);
sub_100278250(v67, -1.0, 1.0);
v28 = (_QWORD *)(*(__int64 (__fastcall **)(char *))(*(_QWORD *)v27 + 328LL))(v27);
sub_100278630(&v68, v28);
v29 = cocos2d::CCLabelBMFont::create_3(*((_QWORD *)v25 - 5), "bigFont.fnt");
(*(void (__fastcall **)(char *, __int64, __int64))(*(_QWORD *)v27 + 464LL))(v27, v29, 1);
cocos2d::CCLabelBMFont::limitLabelWidth(v29, 50.0, 0.44999999, 0.0);
v30 = cocos2d::CCSprite::createWithSpriteFrameName(*((_QWORD *)v25 - 4), COERCE_DOUBLE(1112014848));
(*(void (__fastcall **)(char *, char *, __int64))(*(_QWORD *)v27 + 464LL))(v27, v30, 1);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v30 + 160LL))(v30, *((float *)v25 - 4));
LODWORD(v73) = *((_DWORD *)v30 + 108);
v31 = (*(float (__fastcall **)(char *))(*(_QWORD *)v30 + 168LL))(v30);
*(float *)&v73 = v31 * *(float *)&v73;
LODWORD(v71) = *(_DWORD *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v29 + 328LL))(v29);
v32 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v29 + 168LL))(v29);
v33 = (float)(v32 * *(float *)&v71) + 5.0;
*(float *)&v73 = *(float *)&v73 * 0.5;
*(float *)&v71 = (float)((float)(*(float *)&v73 + v33) + 8.0) * 0.5;
sub_100278250(
(float *)&v61,
(float)((float)(v33 * 0.5) + (float)((float)(*(float *)&v68 * 0.5) - *(float *)&v71)) + v67[0],
(float)(*((float *)&v68 + 1) * 0.5) + v67[1]);
v34 = *(_QWORD *)v29;
v64 = v29;
(*(void (__fastcall **)(__int64, double *))(v34 + 184))(v29, &v61);
sub_100278250(
(float *)&v61,
(float)((float)((float)(*(float *)&v68 * 0.5) + *(float *)&v71) - *(float *)&v73) + *((float *)v25 - 6),
(float)(*((float *)&v68 + 1) * 0.5) + *((float *)v25 - 5));
(*(void (__fastcall **)(char *, double *))(*(_QWORD *)v30 + 184LL))(v30, &v61);
v35 = *((_QWORD *)v25 - 1);
v36 = *(_QWORD *)v25;
v71 = v27;
v37 = (float *)CCMenuItemSpriteExtra::create((__int64)v27, 0, (__int64)v65, v35, v36);
v73 = v25;
v38 = (__int64)v66;
(*(void (__fastcall **)(_QWORD *, float *))(*v66 + 456LL))(v66, v37);
sub_100278250((float *)&v59, v62, (float)((float)(int)v70 * -32.0) + v63);
v39 = v38;
v25 = v73;
cocos2d::CCNode::convertToNodeSpace(&v61, v39, &v59);
v26 = v37;
v20 = &v61;
(*(void (__fastcall **)(float *, double *))(*(_QWORD *)v37 + 184LL))(v37, &v61);
if ( v69 != 2 && *((__int64 (__fastcall **)())v25 - 1) == EditorPauseLayer::onExport && !*(_QWORD *)v25 )
{
memset(&v61, 75, 3);
(*(void (__fastcall **)(char *, double *))(*(_QWORD *)v71 + 960LL))(v71, &v61);
(*(void (__fastcall **)(__int64, double *))(*(_QWORD *)v64 + 1072LL))(v64, &v61);
(*(void (__fastcall **)(char *, double *))(*(_QWORD *)v30 + 960LL))(v30, &v61);
v26 = v37;
v20 = nullptr;
(*(void (__fastcall **)(float *, _QWORD))(*(_QWORD *)v37 + 1056LL))(v37, 0);
}
}
v25 += 48;
++v70;
}
while ( v70 != (char *)8 );
*(float *)&v73 = v60[0] * 0.5;
v40 = cocos2d::CCDirector::sharedDirector(v26, v20);
v41 = sub_100479750(v40);
*(float *)&v41 = *(float *)&v41 + 22.0;
LODWORD(v70) = LODWORD(v41);
*(float *)&v71 = *(float *)&v41 + 20.0;
v42 = FMODAudioEngine::sharedEngine(v41);
*(float *)&v41 = FMODAudioEngine::getBackgroundMusicVolume(v42);
LODWORD(v66) = LODWORD(v41);
v43 = FMODAudioEngine::sharedEngine(v41);
v44 = sub_1003D3F10(v43);
v69 = LODWORD(v44);
LODWORD(v64) = *(_DWORD *)(EditorSFXManager::sharedState(v43) + 192);
v72 = *(float *)&v73 + -160.0;
v45 = cocos2d::CCLabelBMFont::create_3("Music", "bigFont.fnt");
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v45 + 160LL))(v45, 0.40000001);
sub_100278250(v67, 0.5, 0.5);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v45 + 296LL))(v45, v67);
sub_100278250(v67, v72, *(float *)&v71);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v45 + 184LL))(v45, v67);
v46 = v65;
(*(void (__fastcall **)(_QWORD *, __int64, __int64))(*v65 + 464LL))(v65, v45, 1);
v47 = Slider::create_1(v46, EditorPauseLayer::musicSliderChanged, 0, 0.55000001);
Slider::setBarVisibility(v47, 1, 0.55000001);
sub_100278250(v67, v72, *(float *)&v70);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v47 + 184LL))(v47, v67);
Slider::setValue(v47, COERCE_DOUBLE((unsigned __int64)(unsigned int)v66));
(*(void (__fastcall **)(_QWORD *, __int64, __int64))(*v46 + 464LL))(v46, v47, 1);
v46[77] = v47;
v72 = *(float *)&v73 + 0.0;
v48 = cocos2d::CCLabelBMFont::create_3("SFX", "bigFont.fnt");
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v48 + 160LL))(v48, 0.40000001);
sub_100278250(v67, 0.5, 0.5);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v48 + 296LL))(v48, v67);
sub_100278250(v67, v72, *(float *)&v71);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v48 + 184LL))(v48, v67);
(*(void (__fastcall **)(_QWORD *, __int64, __int64))(*v46 + 464LL))(v46, v48, 1);
v49 = Slider::create_1(v46, EditorPauseLayer::sfxSliderChanged, 0, 0.55000001);
Slider::setBarVisibility(v49, 1, 0.55000001);
sub_100278250(v67, v72, *(float *)&v70);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v49 + 184LL))(v49, v67);
Slider::setValue(v49, COERCE_DOUBLE((unsigned __int64)v69));
(*(void (__fastcall **)(_QWORD *, __int64, __int64))(*v46 + 464LL))(v46, v49, 1);
v46[78] = v49;
*(float *)&v73 = *(float *)&v73 + 160.0;
v50 = cocos2d::CCLabelBMFont::create_3("Editor SFX", "bigFont.fnt");
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v50 + 160LL))(v50, 0.40000001);
sub_100278250(v67, 0.5, 0.5);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v50 + 296LL))(v50, v67);
sub_100278250(v67, *(float *)&v73, *(float *)&v71);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v50 + 184LL))(v50, v67);
(*(void (__fastcall **)(_QWORD *, __int64, __int64))(*v46 + 464LL))(v46, v50, 1);
v51 = Slider::create_1(v46, EditorPauseLayer::editorSFXSliderChanged, 0, 0.55000001);
Slider::setBarVisibility(v51, 1, 0.55000001);
sub_100278250(v67, *(float *)&v73, *(float *)&v70);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v51 + 184LL))(v51, v67);
Slider::setValue(v51, COERCE_DOUBLE((unsigned __int64)(unsigned int)v64));
(*(void (__fastcall **)(_QWORD *, __int64, __int64))(*v46 + 464LL))(v46, v51, 1);
v46[79] = v51;
*(_QWORD *)&v53 = GameManager::sharedState(v46, v51, v52).u64[0];
*(_QWORD *)(v54 + 952) = v46 + 70;
v55 = TimeSpeedControl::create(v46[72], v53);
(*(void (__fastcall **)(_QWORD *, __int64, __int64))(*v46 + 464LL))(v46, v55, 1);
v56 = cocos2d::CCDirector::sharedDirector(v46, v55);
*(float *)&v53 = sub_100479760(v56);
sub_100278250(v67, *(float *)&v53 + 40.0, (float)(0.5 * v60[1]) + 14.0);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v55 + 184LL))(v55, v67);
return __stack_chk_guard;
}