//
// SetupArtSwitchPopup::init from 0x6b7b08 to 0x6b7dba (690 bytes)
//
// 1 xrefs:
// > SetupArtSwitchPopup::create @ 0x6b7e90
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:56:43 +0000
//
GameManager *__fastcall SetupArtSwitchPopup::init(
SetupArtSwitchPopup *this,
ArtTriggerGameObject *a2,
cocos2d::CCArray *a3,
int a4)
{
GameManager *v6; // r11
const char *v7; // s16
char *v8; // r1
cocos2d::CCDirector *MultiTriggerItemsDefault; // r0
cocos2d::CCLabelBMFont *v10; // r0
int v11; // r8
const char *v12; // r1
cocos2d::CCSprite *v13; // r0
int v14; // r0
int v15; // r8
void (__fastcall *v16)(int, _BYTE *); // r10
void (__fastcall *v18)(int, _DWORD *); // [sp+10h] [bp-84h]
float v19[2]; // [sp+18h] [bp-7Ch] BYREF
_BYTE v20[8]; // [sp+20h] [bp-74h] BYREF
_BYTE v21[8]; // [sp+28h] [bp-6Ch] BYREF
_DWORD v22[2]; // [sp+30h] [bp-64h] BYREF
int v23[3]; // [sp+38h] [bp-5Ch] BYREF
int v24[2]; // [sp+44h] [bp-50h] BYREF
cocos2d::CCLabelBMFont *v25; // [sp+4Ch] [bp-48h]
int v26[3]; // [sp+50h] [bp-44h] BYREF
int v27[3]; // [sp+5Ch] [bp-38h] BYREF
int v28[3]; // [sp+68h] [bp-2Ch] BYREF
int v29[3]; // [sp+74h] [bp-20h] BYREF
int v30[3]; // [sp+80h] [bp-14h] BYREF
v6 = SetupTriggerPopup::init(this, a2, a3, 300.0, 200.0, (_BYTE *)&dword_0 + 1, 0.0);
if ( v6 )
{
memset(v23, 0, sizeof(v23));
v24[0] = 0;
v24[1] = 0;
v25 = nullptr;
v7 = (const char *)(int)(*(float (__fastcall **)(SetupArtSwitchPopup *, int))(*(_DWORD *)this + 732))(this, 533);
if ( a4 == 3030 )
{
*((_DWORD *)this + 179) = 1;
std::string::assign(v23, "Change Ground");
v8 = "G:";
}
else if ( a4 == 3031 )
{
*((_DWORD *)this + 179) = 2;
std::string::assign(v23, "Change Middleground");
v8 = "MG:";
}
else
{
*((_DWORD *)this + 179) = 0;
if ( a4 == 3029 )
{
std::string::assign(v23, "Change Background");
v8 = "BG:";
}
else
{
std::string::assign(v23, "NA");
v8 = "NA:";
}
}
std::string::assign(v24, v8);
SetupTriggerPopup::preSetup(this);
std::string::basic_string(v26, (int)v23);
SetupTriggerPopup::addTitle((int)this, (unsigned __int8 *)v26);
std::string::~string((int)v26);
memset(v27, 0, sizeof(v27));
std::string::__init(v27, "OK", 2u);
SetupTriggerPopup::addCloseButton((int)this, (int)v27);
std::string::~string((int)v27);
memset(v28, 0, sizeof(v28));
std::string::__init(v28, "Help", 4u);
memset(v29, 0, sizeof(v29));
std::string::__init(v29, "Seems pretty obvious what this does.\nWhy are you here?", 0x3Eu);
SetupTriggerPopup::addHelpButton((int)this, (int)v28, (int)v29, 1065353216);
std::string::~string((int)v29);
std::string::~string((int)v28);
MultiTriggerItemsDefault = (cocos2d::CCDirector *)SetupTriggerPopup::createMultiTriggerItemsDefault(this);
cocos2d::CCDirector::sharedDirector(MultiTriggerItemsDefault);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v19);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v20, v19[0] * 0.5, v19[1] * 0.5);
if ( (v24[0] & 1) != 0 )
v10 = v25;
else
v10 = (cocos2d::CCLabelBMFont *)((char *)v24 + 1);
v11 = cocos2d::CCLabelBMFont::create(v10, "goldFont.fnt", (const char *)(LOBYTE(v24[0]) << 31));
(*(void (__fastcall **)(int, int))(*(_DWORD *)v11 + 80))(v11, 1058642330);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 115) + 228))(*((_DWORD *)this + 115), v11);
v18 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v11 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v21, 0.0, 40.0);
cocos2d::CCPoint::operator+(v22, v20, v21);
v18(v11, v22);
artIconForKey(v30, v7, *((_DWORD *)this + 179));
if ( (v30[0] & 1) != 0 )
v13 = (cocos2d::CCSprite *)v30[2];
else
v13 = (cocos2d::CCSprite *)((char *)v30 + 1);
*((_DWORD *)this + 180) = cocos2d::CCSprite::createWithSpriteFrameName(v13, v12);
std::string::~string((int)v30);
v14 = *((_DWORD *)this + 180);
v22[0] = SetupArtSwitchPopup::onArt;
v22[1] = 0;
v15 = CCMenuItemSpriteExtra::create(v14, 0, (int)this, (int)SetupArtSwitchPopup::onArt, 0);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v15);
v16 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v15 + 92);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v21, *((const cocos2d::CCPoint **)this + 111));
v16(v15, v21);
SetupTriggerPopup::postSetup(this);
std::string::~string((int)v24);
std::string::~string((int)v23);
}
return v6;
}