//
// TouchControlEditLayer::buildHud from 0x140452cc0 to 0x140453725 (2661 bytes)
//
// 2 xrefs:
// > TouchControlEditLayer::create @ 0x1404523db
// > ??> @ 0x1409278b4
//
// 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:32:28 +0000
//
// Hidden C++ exception states: #wind=7
__int64 __fastcall TouchControlEditLayer::buildHud(__int64 a1)
{
__int64 v2; // rax
__int64 v3; // rcx
__int64 v4; // rax
cocos2d::CCObject *v5; // rbx
cocos2d::CCObject *v6; // rsi
__int64 v7; // rdi
__int64 v8; // rbx
__int64 v9; // rax
__int64 v10; // rax
cocos2d::CCObject *v11; // rbx
cocos2d::CCObject *v12; // rdi
__int64 v13; // rax
__int64 v14; // rbx
__int64 v15; // rax
int v16; // eax
int v17; // eax
int v18; // eax
int v19; // eax
int v20; // eax
int v21; // eax
int v22; // eax
cocos2d::CCObject *v23; // rbx
__int64 (__fastcall *v24)(); // r9
__int64 v25; // rax
cocos2d::CCObject *v26; // rsi
__int64 v27; // rdi
__int64 v28; // rbx
__int64 v29; // rax
__int64 v30; // rax
__int64 v31; // rax
cocos2d::CCObject *v32; // rbx
cocos2d::CCObject *v33; // rsi
__int64 v34; // rdi
__int64 v35; // rbx
__int64 v36; // rax
__int64 v37; // rax
__int64 v38; // rax
cocos2d::CCObject *v39; // rbx
cocos2d::CCObject *v40; // rsi
__int64 v41; // rdi
__int64 v42; // rbx
__int64 v43; // rax
__int64 v44; // rax
__int128 v46; // [rsp+88h] [rbp-80h] BYREF
__int64 v47; // [rsp+98h] [rbp-70h]
__int64 v48; // [rsp+A0h] [rbp-68h]
float v49; // [rsp+158h] [rbp+50h] BYREF
float v50; // [rsp+15Ch] [rbp+54h]
__int128 *v51; // [rsp+160h] [rbp+58h] BYREF
char v52; // [rsp+168h] [rbp+60h] BYREF
v2 = cocos2d::CCDirector::sharedDirector(a1);
cocos2d::CCDirector::getWinSize(v2, &v49);
v4 = cocos2d::CCMenu::create(v3);
*(_QWORD *)(a1 + 552) = v4;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v4, 10);
v51 = (__int128 *)operator new(0x2C8u);
v5 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite((__int64)v51);
if ( v5 )
{
if ( ButtonSprite::init_1(
(__int64)v5,
(__int64)"OK",
40,
0,
1061997773,
1,
"goldFont.fnt",
(__int64)"GJ_button_01.png",
1106247680) )
{
cocos2d::CCObject::autorelease(v5);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v5 + 8LL))(v5, 1);
LODWORD(v5) = 0;
}
}
v6 = CCMenuItemSpriteExtra::create((int)v5, 0, a1, (__int64)TouchControlEditLayer::onOK);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v6);
v7 = *(_QWORD *)v6;
v8 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v51, (float)(v49 * 0.5) - 40.0, v50 - 30.0);
cocos2d::CCNode::convertToNodeSpace(v8, &v52, v9);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v7 + 184))(v6, v10);
v51 = (__int128 *)operator new(0x2C8u);
v11 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite((__int64)v51);
if ( v11 )
{
if ( ButtonSprite::init_1(
(__int64)v11,
(__int64)"Reset",
40,
0,
1061997773,
1,
"goldFont.fnt",
(__int64)"GJ_button_05.png",
1106247680) )
{
cocos2d::CCObject::autorelease(v11);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v11 + 8LL))(v11, 1);
LODWORD(v11) = 0;
}
}
v12 = CCMenuItemSpriteExtra::create((int)v11, 0, a1, (__int64)TouchControlEditLayer::onReset);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v12);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, 80.0, 0.0);
v14 = v13;
v15 = (*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v6 + 200LL))(v6);
cocos2d::CCPoint::operator+(v15, &v51, v14);
(*(void (__fastcall **)(cocos2d::CCObject *, __int128 **))(*(_QWORD *)v12 + 184LL))(v12, &v51);
v51 = &v46;
v46 = 0;
v47 = 5;
v48 = 15;
strcpy((char *)&v46, "ModeB");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, 88.0, v50 - 30.0);
SetupTriggerPopup::createToggleValueControl(a1, 3, (unsigned int)&v46, v16, 1, 0, 0, 1065353216);
v51 = &v46;
v46 = 0;
v47 = 4;
v48 = 15;
strcpy((char *)&v46, "Snap");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, 132.0, v50 - 30.0);
SetupTriggerPopup::createToggleValueControl(a1, 4, (unsigned int)&v46, v17, 1, 0, 0, 1065353216);
v51 = &v46;
v46 = 0;
v47 = 5;
v48 = 15;
LODWORD(v46) = *(_DWORD *)"Split";
WORD2(v46) = (unsigned __int8)aSplit[4];
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, v49 - 132.0, v50 - 30.0);
SetupTriggerPopup::createToggleValueControl(a1, 5, (unsigned int)&v46, v18, 1, 0, 0, 1065353216);
v51 = &v46;
v46 = 0;
v47 = 5;
v48 = 15;
strcpy((char *)&v46, "JumpL");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, v49 - 88.0, v50 - 30.0);
SetupTriggerPopup::createToggleValueControl(a1, 6, (unsigned int)&v46, v19, 1, 0, 2, 1065353216);
if ( !*(_QWORD *)(a1 + 1008) )
{
v51 = &v46;
v46 = 0;
v47 = 4;
v48 = 15;
strcpy((char *)&v46, "Dual");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, v49 - 40.0, v50 - 30.0);
SetupTriggerPopup::createToggleValueControl(a1, 7, (unsigned int)&v46, v20, 1, 0, 0, 1065353216);
}
v51 = &v46;
v47 = 8;
v48 = 15;
v46 = 0x3A7974696361704FuLL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, v49 * 0.5, v50 - 70.0);
SetupTriggerPopup::createValueControlAdvanced(
a1,
1,
(unsigned int)&v46,
v21,
1058642330,
0,
1,
4,
0,
0,
1065353216,
0,
1,
1,
2,
0);
v51 = &v46;
v46 = 0;
v47 = 6;
v48 = 15;
strcpy((char *)&v46, "Scale:");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v52, v49 * 0.5, v50 - 95.0);
SetupTriggerPopup::createValueControlAdvanced(
a1,
2,
(unsigned int)&v46,
v22,
1058642330,
0,
1,
4,
0,
1045220557,
0x40000000,
0,
1,
1,
2,
0);
if ( *(_QWORD *)(a1 + 1008) )
{
v51 = (__int128 *)operator new(0x2C8u);
v25 = ButtonSprite::ButtonSprite((__int64)v51);
v23 = (cocos2d::CCObject *)v25;
if ( v25 )
{
if ( ButtonSprite::init_1(
v25,
(__int64)&dword_140787070,
50,
0,
1060320051,
1,
&qword_140704F78,
(__int64)"GJ_button_04.png",
1104150528) )
{
cocos2d::CCObject::autorelease(v23);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v23 + 8LL))(v23, 1);
v23 = nullptr;
}
}
(*(void (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v23 + 160LL))(v23);
v24 = TouchControlEditLayer::onApplyGlobal;
}
else
{
v51 = (__int128 *)operator new(0x2C8u);
v23 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite((__int64)v51);
if ( v23 )
{
if ( ButtonSprite::init_1(
(__int64)v23,
(__int64)"Slots",
50,
0,
1060320051,
1,
&qword_140704F78,
(__int64)"GJ_button_01.png",
1104150528) )
{
cocos2d::CCObject::autorelease(v23);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v23 + 8LL))(v23, 1);
v23 = nullptr;
}
}
(*(void (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v23 + 160LL))(v23);
v24 = TouchControlEditLayer::onSlots;
}
v26 = CCMenuItemSpriteExtra::create((int)v23, 0, a1, (__int64)v24);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v26);
v27 = *(_QWORD *)v26;
v28 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v51, 40.0, v50 - 30.0);
cocos2d::CCNode::convertToNodeSpace(v28, &v52, v29);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v27 + 184))(v26, v30);
v51 = (__int128 *)operator new(0x2C8u);
v31 = ButtonSprite::ButtonSprite((__int64)v51);
v32 = (cocos2d::CCObject *)v31;
if ( v31 )
{
if ( ButtonSprite::init_1(
v31,
(__int64)"Copy",
50,
0,
1056964608,
1,
&qword_140704F78,
(__int64)"GJ_button_04.png",
1104150528) )
{
cocos2d::CCObject::autorelease(v32);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v32 + 8LL))(v32, 1);
v32 = nullptr;
}
}
(*(void (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v32 + 160LL))(v32);
v33 = CCMenuItemSpriteExtra::create((int)v32, 0, a1, (__int64)TouchControlEditLayer::onCopy);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v33);
v34 = *(_QWORD *)v33;
v35 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v51, 40.0, v50 - 54.0);
cocos2d::CCNode::convertToNodeSpace(v35, &v52, v36);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v34 + 184))(v33, v37);
v51 = (__int128 *)operator new(0x2C8u);
v38 = ButtonSprite::ButtonSprite((__int64)v51);
v39 = (cocos2d::CCObject *)v38;
if ( v38 )
{
if ( ButtonSprite::init_1(
v38,
(__int64)"Paste",
50,
0,
1056964608,
1,
&qword_140704F78,
(__int64)"GJ_button_04.png",
1104150528) )
{
cocos2d::CCObject::autorelease(v39);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v39 + 8LL))(v39, 1);
v39 = nullptr;
}
}
(*(void (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v39 + 160LL))(v39);
v40 = CCMenuItemSpriteExtra::create((int)v39, 0, a1, (__int64)TouchControlEditLayer::onPaste);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v40);
v41 = *(_QWORD *)v40;
v42 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v51, 40.0, v50 - 78.0);
cocos2d::CCNode::convertToNodeSpace(v42, &v52, v43);
return (*(__int64 (__fastcall **)(cocos2d::CCObject *, __int64))(v41 + 184))(v40, v44);
}