//
// GridSettingsLayer::onBuildWindowContent from 0xcdc220 to 0xcdc9f4 (2004 bytes)
//
// 2 xrefs:
// > ??> @ 0x6f520
// > ??> @ 0x1502518
//
// 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 13:06:33 +0000
//
__int64 __fastcall GridSettingsLayer::onBuildWindowContent(GridSettingsLayer *this)
{
__int64 v2; // x22
cocos2d::CCNode *v3; // x26
void (__fastcall *v4)(__int64, __int64 *); // x25
float v5; // s10
float v6; // s8
__int64 v7; // x22
void (__fastcall *v8)(__int64, __int64 *); // x25
void (__fastcall *v9)(__int64, __int64 *); // x25
void *v10; // x25
char *v11; // x22
cocos2d::CCDictionary *v12; // x0
Slider *v13; // x0
cocos2d::CCDictionary *v14; // x0
__int64 v15; // x0
cocos2d::CCNode *v16; // x21
const cocos2d::CCPoint *v17; // x0
const char *v18; // x1
__int64 v19; // x22
__int64 v20; // x22
void (__fastcall *v21)(__int64, __int64 *); // x25
const char *v22; // x1
__int64 v23; // x22
__int64 v24; // x22
void (__fastcall *v25)(__int64, __int64 *); // x25
const char *v26; // x1
__int64 v27; // x22
__int64 v28; // x22
void (__fastcall *v29)(__int64, __int64 *); // x19
char *v31; // x1
float v32; // [xsp+70h] [xbp+70h] BYREF
float v33; // [xsp+74h] [xbp+74h]
__int64 v34; // [xsp+78h] [xbp+78h] BYREF
_BYTE v35[8]; // [xsp+80h] [xbp+80h] BYREF
__int64 v36[2]; // [xsp+88h] [xbp+88h] BYREF
__int64 v37[2]; // [xsp+98h] [xbp+98h] BYREF
void *v38; // [xsp+A8h] [xbp+A8h]
__int64 v39; // [xsp+B0h] [xbp+B0h] BYREF
__int64 v40; // [xsp+B8h] [xbp+B8h] BYREF
void *v41; // [xsp+C0h] [xbp+C0h]
void *v42; // [xsp+C8h] [xbp+C8h]
__int64 v43; // [xsp+D0h] [xbp+D0h] BYREF
float v44; // [xsp+D8h] [xbp+D8h]
char v45; // [xsp+DCh] [xbp+DCh]
int v46; // [xsp+E0h] [xbp+E0h]
int v47; // [xsp+E4h] [xbp+E4h]
char v48; // [xsp+E8h] [xbp+E8h]
float v49; // [xsp+ECh] [xbp+ECh]
int v50; // [xsp+F0h] [xbp+F0h]
int v51; // [xsp+F4h] [xbp+F4h]
int v52; // [xsp+F8h] [xbp+F8h]
int v53; // [xsp+FCh] [xbp+FCh]
int v54; // [xsp+100h] [xbp+100h]
char v55; // [xsp+104h] [xbp+104h]
char v56; // [xsp+105h] [xbp+105h]
int v57; // [xsp+108h] [xbp+108h]
__int64 v58[2]; // [xsp+110h] [xbp+110h] BYREF
void *v59; // [xsp+120h] [xbp+120h]
int v60; // [xsp+128h] [xbp+128h]
__int64 v61[2]; // [xsp+130h] [xbp+130h] BYREF
void *v62; // [xsp+140h] [xbp+140h]
EditorWindowPopup::contentCenter((cocos2d::CCPoint *)&v32);
v39 = 0;
v40 = 0;
v41 = nullptr;
std::string::__init(&v39, "Grid Size", 9u);
SetupTriggerPopup::addTitle((__int64)this, (__int64)&v39);
if ( (v39 & 1) != 0 )
operator delete(v41);
v37[0] = 0;
v37[1] = 0;
v38 = nullptr;
std::string::__init(v37, "Grid Size", 9u);
v39 = 0;
v40 = 0;
v41 = nullptr;
std::string::__init(
&v39,
"Enable to override the editor grid with a custom size.\n"
"Shift+G toggles it. Ctrl+G cycles the preset sizes\n"
"(7.5, 15, 30, 60, 120).",
0xA1u);
v2 = InfoAlertButton::create((char *)v37, (char *)&v39, 0.6);
if ( (v39 & 1) != 0 )
operator delete(v41);
if ( (v37[0] & 1) != 0 )
operator delete(v38);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v2);
v3 = *((cocos2d::CCNode **)this + 69);
v4 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v2 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v35,
(float)(v32 + (float)(*((float *)this + 264) * 0.5)) - 13.0,
(float)(v33 + (float)(*((float *)this + 265) * 0.5)) - 13.0);
cocos2d::CCNode::convertToNodeSpace(v36, v3, (const cocos2d::CCPoint *)v35);
v4(v2, v36);
v5 = v32;
v6 = v33 - 15.0;
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v36, 0.0, 0.0, 40.0, 40.0);
v7 = cocos2d::extension::CCScale9Sprite::create("square02_small.png", v36);
v8 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v7 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v36, *((float *)this + 183) - 30.0, 64.0);
v8(v7, v36);
v9 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v7 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v36, v5, v6 + 5.0);
v9(v7, v36);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v7 + 960LL))(v7, &unk_11A4B10);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v7 + 912LL))(v7, 50);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v7,
0xFFFFFFFFLL);
v39 = 0;
v40 = 0;
v41 = nullptr;
std::string::__init(&v39, "Enabled", 7u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v36, v5 - 100.0, v6);
SetupTriggerPopup::createToggleValueControl(
(__int64)this,
0xFFFFFFFF,
&v39,
(const cocos2d::CCPoint *)v36,
1,
0,
0,
1.0);
if ( (v39 & 1) != 0 )
operator delete(v41);
LODWORD(v39) = 0;
v40 = 0;
v41 = nullptr;
v42 = nullptr;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v43, (const cocos2d::CCPoint *)&unk_155F3E8);
v46 = 2;
v54 = 2;
v47 = 6;
v45 = 0;
v44 = 1.0;
v48 = 1;
v49 = 0.0;
v51 = 0;
v50 = 0;
v52 = 0;
v53 = 0;
v55 = 0;
v56 = 0;
v57 = 1116471296;
v58[0] = 0;
v58[1] = 0;
v59 = nullptr;
std::string::__init(v58, "goldFont.fnt", 0xCu);
v61[0] = 0;
v61[1] = 0;
v60 = 0;
v62 = nullptr;
std::string::__init(v61, "Num", 3u);
LODWORD(v39) = -2;
if ( (v40 & 1) != 0 )
{
if ( (v40 & 0xFFFFFFFFFFFFFFFELL) - 1 <= 4 )
{
v10 = v42;
v11 = (char *)operator new(0x17u);
strcpy(v11, "Size:");
operator delete(v10);
v42 = v11;
v40 = 23;
v41 = &byte_5;
goto LABEL_12;
}
v31 = (char *)v42;
}
else
{
v31 = (char *)&v40 + 1;
}
strcpy(v31, "Size:");
if ( (v40 & 1) != 0 )
v41 = &byte_5;
else
LOBYTE(v40) = 10;
LABEL_12:
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v36, v5 + 15.0, v6 + 5.0);
cocos2d::CCPoint::operator=(&v43, v36);
v48 = 1;
v56 = 1;
v46 = 1;
v54 = 1;
v44 = 0.6;
v45 = 0;
v60 = 1057803469;
v47 = 5;
v49 = 5.0;
v50 = 1123024896;
SetupTriggerPopup::createValueControlAdvanced((cocos2d::CCArray **)this, (ValueControlSettings *)&v39);
SetupTriggerPopup::toggleLimitArrowValue((__int64 **)this, -2, 1);
v12 = *((cocos2d::CCDictionary **)this + 96);
if ( v12 )
{
v13 = (Slider *)cocos2d::CCDictionary::objectForKey(v12, -2);
if ( v13 )
Slider::setSnapStepCalc(v13, 0.5, 5.0, 120.0);
}
v14 = *((cocos2d::CCDictionary **)this + 95);
if ( v14 )
{
v15 = cocos2d::CCDictionary::objectForKey(v14, -2);
if ( v15 )
{
v16 = *((cocos2d::CCNode **)this + 69);
v17 = (const cocos2d::CCPoint *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v15 + 192LL))(v15);
cocos2d::CCNode::convertToNodeSpace(&v34, v16, v17);
v19 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"edit_leftBtn2_001.png", v18);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v19 + 160LL))(v19, 0.72);
v20 = CCMenuItemSpriteExtra::create(v19, 0, (__int64)this, (__int64)GridSettingsLayer::onCycleDown, 0);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v20);
v21 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v20 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v35, -64.8, 0.0);
cocos2d::CCPoint::operator+(v36, &v34);
v21(v20, v36);
CCMenuItemSpriteExtra::setSizeMult(v20, 2.0);
v23 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"edit_rightBtn2_001.png", v22);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v23 + 160LL))(v23, 0.72);
v24 = CCMenuItemSpriteExtra::create(v23, 0, (__int64)this, (__int64)GridSettingsLayer::onCycleUp, 0);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v24);
v25 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v24 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v35, 64.8, 0.0);
cocos2d::CCPoint::operator+(v36, &v34);
v25(v24, v36);
CCMenuItemSpriteExtra::setSizeMult(v24, 2.0);
v27 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_trashBtn_001.png", v26);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v27 + 160LL))(v27, 0.5);
v28 = CCMenuItemSpriteExtra::create(v27, 0, (__int64)this, (__int64)GridSettingsLayer::onReset, 0);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v28);
v29 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v28 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v35, 96.8, 0.0);
cocos2d::CCPoint::operator+(v36, &v34);
v29(v28, v36);
}
}
if ( (v61[0] & 1) != 0 )
operator delete(v62);
if ( (v58[0] & 1) != 0 )
operator delete(v59);
if ( (v40 & 1) != 0 )
operator delete(v42);
return _stack_chk_guard;
}