//
// UISaveLoadLayer::init from 0xa27400 to 0xa27800 (1024 bytes)
//
// 2 xrefs:
// > UISaveLoadLayer::create @ 0xa27a28
// > ??> @ 0xc5c98
//
// 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 12:59:43 +0000
//
__int64 __fastcall UISaveLoadLayer::init(cocos2d::CCNode **this, UIOptionsLayer *a2)
{
unsigned __int8 v4; // w0
unsigned int v5; // w26
const char *v7; // x1
size_t v8; // x0
cocos2d::CCDirector *v9; // x0
cocos2d::CCDirector *v10; // x0
char *v11; // x20
cocos2d::CCString *v12; // x0
ButtonSprite *CString; // x0
const char *v14; // x6
__int64 v15; // x0
__int64 v16; // x21
void (__fastcall *v17)(__int64, __int64 *); // x28
cocos2d::CCNode *v18; // x27
cocos2d::CCString *v19; // x0
ButtonSprite *v20; // x0
const char *v21; // x6
__int64 v22; // x0
__int64 v23; // x21
cocos2d::CCNode *v24; // x28
void (__fastcall *v25)(__int64, __int64 *); // x27
char *v26; // [xsp+88h] [xbp+88h]
__int64 v27; // [xsp+98h] [xbp+98h] BYREF
_BYTE v28[8]; // [xsp+A0h] [xbp+A0h] BYREF
_BYTE v29[8]; // [xsp+A8h] [xbp+A8h] BYREF
__int64 v30; // [xsp+B0h] [xbp+B0h] BYREF
__int64 v31; // [xsp+B8h] [xbp+B8h] BYREF
__int64 v32; // [xsp+C0h] [xbp+C0h] BYREF
size_t v33; // [xsp+C8h] [xbp+C8h]
void *v34; // [xsp+D0h] [xbp+D0h]
__int64 v35; // [xsp+D8h] [xbp+D8h] BYREF
size_t v36; // [xsp+E0h] [xbp+E0h]
void *v37; // [xsp+E8h] [xbp+E8h]
cocos2d::CCDirector *v38[2]; // [xsp+F0h] [xbp+F0h] BYREF
void *v39; // [xsp+100h] [xbp+100h]
v4 = SetupTriggerPopup::init((SetupTriggerPopup *)this, nullptr, nullptr, 240.0, 220.0, 1, 0.0);
v5 = v4;
if ( v4 )
{
*(this + 127) = a2;
SetupTriggerPopup::preSetup((SetupTriggerPopup *)this);
if ( *((_BYTE *)a2 + 1012) )
v7 = "Save/Load Dual UI";
else
v7 = "Save/Load UI";
v26 = (char *)v7;
v32 = 0;
v33 = 0;
v34 = nullptr;
v8 = strlen(v7);
std::string::__init(&v32, v26, v8);
v35 = 0;
v36 = 0;
v37 = nullptr;
if ( (v32 & 1) != 0 )
{
std::string::__init(&v35, v34, v33);
}
else
{
v37 = v34;
v35 = v32;
v36 = v33;
}
SetupTriggerPopup::addTitle(this, &v35);
if ( (v35 & 1) != 0 )
operator delete(v37);
v38[0] = nullptr;
v38[1] = nullptr;
v39 = nullptr;
std::string::__init((__int64 *)v38, "OK", 2u);
SetupTriggerPopup::addCloseButton(this, v38);
v9 = (cocos2d::CCDirector *)LOBYTE(v38[0]);
if ( ((__int64)v38[0] & 1) != 0 )
operator delete(v39);
v10 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v9);
cocos2d::CCDirector::getWinSize(&v27, v10);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, *(float *)&v27 * 0.5, (float)(*((float *)&v27 + 1) * 0.5) + 50.0);
v11 = (char *)&dword_0 + 1;
do
{
v12 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Save %i",
(const char *)(unsigned int)v11);
CString = (ButtonSprite *)cocos2d::CCString::getCString(v12);
v15 = ButtonSprite::create(
CString,
(const char *)&dword_30 + 2,
0,
1,
0.8,
"goldFont.fnt",
"GJ_button_01.png",
v14,
30.0);
v16 = CCMenuItemSpriteExtra::create(v15, 0, (__int64)this, (__int64)UISaveLoadLayer::onSave, 0);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 69) + 456LL))(*(this + 69), v16);
v17 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v16 + 184LL);
v18 = *(this + 69);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v29, -40.0, (float)((int)v11 - 1) * -40.0);
cocos2d::CCPoint::operator+(&v30, v28);
cocos2d::CCNode::convertToNodeSpace(&v31, v18, (const cocos2d::CCPoint *)&v30);
v17(v16, &v31);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v16 + 72LL))(v16, (unsigned int)v11);
v19 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"Load %i",
(const char *)(unsigned int)v11);
v20 = (ButtonSprite *)cocos2d::CCString::getCString(v19);
v22 = ButtonSprite::create(
v20,
(const char *)&dword_30 + 2,
0,
1,
0.8,
"goldFont.fnt",
"GJ_button_02.png",
v21,
30.0);
v23 = CCMenuItemSpriteExtra::create(v22, 0, (__int64)this, (__int64)UISaveLoadLayer::onLoad, 0);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 69) + 456LL))(*(this + 69), v23);
v24 = *(this + 69);
v25 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v23 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v29, 40.0, (float)((int)v11 - 1) * -40.0);
cocos2d::CCPoint::operator+(&v30, v28);
cocos2d::CCNode::convertToNodeSpace(&v31, v24, (const cocos2d::CCPoint *)&v30);
v25(v23, &v31);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v23 + 72LL))(v23, (unsigned int)v11);
LODWORD(v11) = (_DWORD)v11 + 1;
}
while ( (_DWORD)v11 != 4 );
SetupTriggerPopup::postSetup((SetupTriggerPopup *)this);
if ( (v32 & 1) != 0 )
operator delete(v34);
}
return v5;
}