//
// EditorPauseLayer::init from 0x3ff674 to 0x3ffa54 (992 bytes)
//
// 1 xrefs:
// > EditorPauseLayer::create @ 0x3ffb18
//
// 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
//
bool EditorPauseLayer::init(EditorPauseLayer *a1, LevelEditorLayer *a2)
{
GJLevelType m_levelType; // r8
cocos2d::CCDirector *v4; // r0
LevelEditorLayer *m_editorLayer; // r3
int v6; // r4
cocos2d::CCString *v7; // r0
char *CString; // r0
bool *v9; // r1
int v10; // r2
_BOOL4 v11; // r4
cocos2d::CCString *v12; // r0
char *v13; // r0
int v14; // r4
int v15; // r0
unsigned __int8 *v16; // r3
int v17; // r4
int v18; // t1
const char *v19; // r4
int v20; // r2
unsigned __int8 *v21; // r6
int v22; // r0
int v23; // r2
int v24; // t1
cocos2d::CCString *v25; // r0
char *v26; // r0
cocos2d::CCLabelBMFont *v27; // r6
void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r8
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
cocos2d::CCDirector *v30; // r0
float v31; // s16
cocos2d::CCDirector *v32; // r0
float v33; // r0
float LastObjectX; // r0
DrawGridLayer *m_drawGridLayer; // r8
float v36; // r0
LevelEditorLayer *v37; // r11
float v38; // s16
int m_timestamp; // r3
int v40; // r8
int LengthKey; // r0
cocos2d::CCString *v42; // r0
cocos2d::CCLabelBMFont *v43; // r8
void (__fastcall *v44)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r5
int v45; // r6
cocos2d::CCPoint *v47; // [sp+10h] [bp-44h]
_BOOL4 v48; // [sp+14h] [bp-40h]
char *v49; // [sp+18h] [bp-3Ch]
bool v50; // [sp+23h] [bp-31h] BYREF
cocos2d::CCLabelBMFont *v51; // [sp+24h] [bp-30h] BYREF
int v52; // [sp+28h] [bp-2Ch] BYREF
int v53; // [sp+2Ch] [bp-28h] BYREF
int v54; // [sp+30h] [bp-24h] BYREF
cocos2d::CCSize v55; // [sp+34h] [bp-20h] BYREF
cocos2d::CCPoint v56; // [sp+3Ch] [bp-18h] BYREF
cocos2d::CCPoint v57; // [sp+44h] [bp-10h] BYREF
a1->m_editorLayer = a2;
v48 = CCBlockLayer::init(a1);
if ( v48 )
{
m_levelType = a1->m_editorLayer->m_level->m_levelType;
v4 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v55, v4);
m_editorLayer = a1->m_editorLayer;
v6 = m_editorLayer->m_level->m_highObjectsEnabled + m_editorLayer->m_level->m_unlimitedObjectsEnabled;
v51 = (cocos2d::CCLabelBMFont *)&unk_ACDDA8;
if ( v6 == 2 )
{
v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Objects: %i (Unlimited)",
(const char *)(m_editorLayer->m_objectCount.random - m_editorLayer->m_objectCount.seed));
CString = (char *)cocos2d::CCString::getCString(v7);
sub_7753D4((int)&v51, CString);
}
else
{
v10 = 80000;
v11 = v6 > 0;
if ( !v11 )
v10 = 40000;
v12 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Objects: %i/%i",
(const char *)(m_editorLayer->m_objectCount.random - m_editorLayer->m_objectCount.seed),
v10,
40000);
v13 = (char *)cocos2d::CCString::getCString(v12);
sub_7753D4((int)&v51, v13);
if ( v11 )
sub_774544((int)&v51, " (high)");
}
v9 = (bool *)a1->m_editorLayer;
v50 = 0;
LevelEditorLayer::getSongIDs((LevelEditorLayer *)&v52, v9, &v50);
LevelEditorLayer::getSFXIDs((LevelEditorLayer *)&v53, (int)a1->m_editorLayer);
if ( *(_DWORD *)(v52 - 12) )
{
v14 = sub_7756C4(&v52);
v15 = sub_7756FC(&v52);
v16 = (unsigned __int8 *)v14;
v17 = 0;
while ( v16 != (unsigned __int8 *)v15 )
{
v18 = *v16++;
if ( v18 == 44 )
++v17;
}
v19 = (const char *)(v17 + 1);
}
else
{
v19 = (_BYTE *)(&dword_0 + 1);
}
v20 = *(_DWORD *)(v53 - 12);
if ( v20 )
{
v21 = (unsigned __int8 *)sub_7756C4(&v53);
v22 = sub_7756FC(&v53);
v23 = 0;
while ( v21 != (unsigned __int8 *)v22 )
{
v24 = *v21++;
if ( v24 == 44 )
++v23;
}
v20 = v23 + 1;
}
if ( v50 || v20 )
{
v25 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)", Songs: %i, SFX: %i",
v19,
v20);
v26 = (char *)cocos2d::CCString::getCString(v25);
sub_774544((int)&v51, v26);
}
if ( m_levelType != Editor )
sub_774544((int)&v51, " (Read-Only)");
v27 = cocos2d::CCLabelBMFont::create();
setAnchorPoint = v27->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v57, 0.0, 1.0);
setAnchorPoint(v27, &v57);
a1->addChild(a1, v27);
setPosition = v27->setPosition;
v30 = cocos2d::CCDirector::sharedDirector();
v31 = (float)(COERCE_FLOAT(cocos2d::CCDirector::getScreenLeft(v30)) + 10.0) + 0.0;
v32 = cocos2d::CCDirector::sharedDirector();
v33 = COERCE_FLOAT(cocos2d::CCDirector::getScreenTop(v32));
cocos2d::CCPoint::CCPoint(&v57, v31, v33 - 5.0);
setPosition(v27, &v57);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v27->setScale)(v27, 1056964608);
LastObjectX = LevelEditorLayer::getLastObjectX(a1->m_editorLayer);
m_drawGridLayer = a1->m_editorLayer->m_drawGridLayer;
cocos2d::CCPoint::CCPoint(&v57, LastObjectX + 340.0, 0.0);
v36 = DrawGridLayer::timeForPos(m_drawGridLayer, (cocos2d::CCPoint)(unsigned int)&v57, 0, 0, 0, 0, 0, (int)v47);
v37 = a1->m_editorLayer;
v38 = v36;
m_timestamp = v37->m_level->m_timestamp;
if ( m_timestamp > 0 && (float)((float)m_timestamp / 240.0) > v36 )
v38 = (float)m_timestamp / 240.0;
v40 = (int)floorf(v38 / 60.0);
LengthKey = GJGameLevel::getLengthKey((int)v38, v37->m_levelSettings->m_platformerMode);
GJGameLevel::lengthKeyToString((GJGameLevel *)&v57, LengthKey);
sub_776584((int)&v54, (char *)LODWORD(v57.x));
sub_774008(&v57);
if ( !a1->m_editorLayer->m_levelSettings->m_platformerMode )
{
if ( v40 <= 0 )
v42 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Length: %i seconds (%s)",
(const char *)(int)(float)(v38 - (float)(60 * v40)),
v54,
60 * v40);
else
v42 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Length: %imin %is (%s)",
(const char *)v40,
(int)(float)(v38 - (float)(60 * v40)),
v54);
cocos2d::CCString::getCString(v42);
}
v43 = cocos2d::CCLabelBMFont::create();
v49 = (char *)v43->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v57, 0.0, 1.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, cocos2d::CCPoint *))v49)(v43, &v57);
a1->addChild(a1, v43);
v44 = v43->setPosition;
v45 = (int)v27->getPosition(v27);
cocos2d::CCPoint::CCPoint(&v56, 0.0, -20.0);
cocos2d::CCPoint::operator+(&v57, v45, &v56);
v44(v43, &v57);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v43->setScale)(v43, 1056964608);
sub_774008(&v54);
sub_774008(&v53);
sub_774008(&v52);
sub_774008(&v51);
}
return v48;
}