//
// SetupGradientPopup::init from 0x6871e0 to 0x687b76 (2454 bytes)
//
// 1 xrefs:
// > SetupGradientPopup::create @ 0x687d94
//
// 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:06 +0000
//
GameManager *__fastcall SetupGradientPopup::init(
cocos2d::CCArray **this,
GradientTriggerObject *a2,
cocos2d::CCArray *a3)
{
cocos2d::CCDirector *v4; // r0
ButtonSprite *v5; // r0
int v6; // r0
cocos2d::CCArray *v7; // r0
cocos2d::CCObject *v8; // r0
int v9; // r7
const char *v10; // r2
cocos2d::CCObject *v11; // r5
void (__fastcall *v12)(cocos2d::CCObject *, _DWORD *); // r9
int v13; // s15
const char *v14; // r2
int v15; // r6
void (__fastcall *v16)(int, _DWORD *); // r5
cocos2d::CCArray *v17; // r0
int v18; // r5
void (__fastcall *v19)(int, _DWORD *); // r7
int v20; // r6
const char *v21; // r1
cocos2d::CCSprite *v22; // r5
int v23; // r8
const char *v24; // r1
int v25; // r8
int v26; // r8
const cocos2d::CCPoint *v27; // r11
int v28; // r9
int v29; // r6
cocos2d::CCArray *MultiTriggerItemsCorner; // r0
cocos2d::CCObject *v31; // r0
cocos2d::CCArray *v32; // r0
cocos2d::CCArray *v33; // r10
float v34; // r9
ButtonSprite *v35; // r0
cocos2d::CCObject *v36; // r11
cocos2d::CCObject *v37; // r8
cocos2d::CCArray *v39; // r0
const cocos2d::CCPoint *v40; // r6
const cocos2d::CCPoint *v41; // r6
float v43; // [sp+10h] [bp-ACh]
float v44; // [sp+10h] [bp-ACh]
GameManager *v45; // [sp+30h] [bp-8Ch]
char *v46; // [sp+34h] [bp-88h]
char *v47; // [sp+34h] [bp-88h]
char *v48; // [sp+34h] [bp-88h]
char *v49; // [sp+38h] [bp-84h]
cocos2d::CCPoint *v50; // [sp+40h] [bp-7Ch]
float v51; // [sp+4Ch] [bp-70h] BYREF
float v52; // [sp+50h] [bp-6Ch]
_BYTE v53[8]; // [sp+54h] [bp-68h] BYREF
_BYTE v54[8]; // [sp+5Ch] [bp-60h] BYREF
_BYTE v55[8]; // [sp+64h] [bp-58h] BYREF
_BYTE v56[8]; // [sp+6Ch] [bp-50h] BYREF
_BYTE v57[8]; // [sp+74h] [bp-48h] BYREF
int v58; // [sp+7Ch] [bp-40h]
int v59; // [sp+80h] [bp-3Ch]
int (__fastcall *v60)(SetupGradientPopup *, cocos2d::CCObject *); // [sp+84h] [bp-38h]
int v61; // [sp+88h] [bp-34h]
_DWORD v62[2]; // [sp+8Ch] [bp-30h] BYREF
_DWORD v63[2]; // [sp+94h] [bp-28h] BYREF
int v64[3]; // [sp+9Ch] [bp-20h] BYREF
int v65; // [sp+A8h] [bp-14h] BYREF
int v66; // [sp+ACh] [bp-10h]
ButtonSprite *v67; // [sp+B0h] [bp-Ch]
v45 = SetupTriggerPopup::init((SetupTriggerPopup *)this, a2, a3, 420.0, 290.0, (_BYTE *)&dword_0 + 1, 0.0);
if ( v45 )
{
v4 = (cocos2d::CCDirector *)(*((int (__fastcall **)(cocos2d::CCArray **))*this + 170))(this);
cocos2d::CCDirector::sharedDirector(v4);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v51);
v65 = 0;
v66 = 0;
v67 = nullptr;
std::string::__init(&v65, "Setup Gradient Effect", 0x15u);
SetupTriggerPopup::addTitle((int)this, (unsigned __int8 *)&v65);
std::string::~string((int)&v65);
memset(v64, 0, sizeof(v64));
std::string::__init(v64, "Help", 4u);
v65 = 0;
v66 = 0;
v67 = nullptr;
std::string::__init(
&v65,
"Creates a gradient with set colors in a given area.\n"
"U, D, L, and R must be set to a group at each side of the area.\n"
"Use Vertex Mode to set corners of the area instead.\n"
"Blending changes the gradient method.\n"
"Use ID to give a gradient a unique identifier that can be used to disable it with another of these triggers.",
0x162u);
SetupTriggerPopup::addHelpButton((int)this, (int)v64, (int)&v65, 1065353216);
std::string::~string((int)&v65);
std::string::~string((int)v64);
v5 = ButtonSprite::create(
(ButtonSprite *)"OK",
(const char *)&word_28,
0,
0.8,
1,
"goldFont.fnt",
"GJ_button_01.png",
(const char *)0x41F00000,
v43);
v58 = 684;
v59 = 1;
v6 = CCMenuItemSpriteExtra::create((int)v5, 0, (int)this, 684, 1);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 111) + 228))(*(this + 111), v6);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v53, v51 * 0.5, (float)(v52 * 0.5) + 85.0);
v65 = 0;
v66 = 0;
v67 = nullptr;
std::string::__init(&v65, &unk_B6B226, 0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v62, -153.0, 0.0);
cocos2d::CCPoint::operator+(v63, v53, v62);
IDNameInput::create((int)this, (int)(this + 110), 1, 203, (int)&v65, (int)v63, 0.58, 6, 0, 0, 1);
std::string::~string((int)&v65);
v65 = 0;
v66 = 0;
v67 = nullptr;
std::string::__init(&v65, &unk_B6B226, 0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v62, -51.0, 0.0);
cocos2d::CCPoint::operator+(v63, v53, v62);
IDNameInput::create((int)this, (int)(this + 110), 1, 204, (int)&v65, (int)v63, 0.58, 6, 0, 0, 1);
std::string::~string((int)&v65);
v65 = 0;
v66 = 0;
v67 = nullptr;
std::string::__init(&v65, &unk_B6B226, 0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v62, 51.0, 0.0);
cocos2d::CCPoint::operator+(v63, v53, v62);
IDNameInput::create((int)this, (int)(this + 110), 1, 205, (int)&v65, (int)v63, 0.58, 6, 0, 0, 1);
std::string::~string((int)&v65);
v65 = 0;
v66 = 0;
v67 = nullptr;
std::string::__init(&v65, &unk_B6B226, 0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v62, 153.0, 0.0);
cocos2d::CCPoint::operator+(v63, v53, v62);
IDNameInput::create((int)this, (int)(this + 110), 1, 206, (int)&v65, (int)v63, 0.58, 6, 0, 0, 1);
v7 = (cocos2d::CCArray *)std::string::~string((int)&v65);
v8 = (cocos2d::CCObject *)cocos2d::CCArray::create(v7);
v9 = 0;
*(this + 182) = v8;
cocos2d::CCObject::retain(v8);
do
{
v11 = (cocos2d::CCObject *)cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)" ", "goldFont.fnt", v10);
v12 = *(void (__fastcall **)(cocos2d::CCObject *, _DWORD *))(*(_DWORD *)v11 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v63, 0.5, 0.5);
v12(v11, v63);
(*(void (__fastcall **)(_DWORD, cocos2d::CCObject *))(*(_DWORD *)*(this + 115) + 228))(*(this + 115), v11);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v11 + 80))(v11, 1056964608);
v13 = v9++;
v46 = *(char **)(*(_DWORD *)v11 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v62, (float)((float)v13 - 1.5) * 102.0, 19.0);
cocos2d::CCPoint::operator+(v63, v53, v62);
((void (__fastcall *)(cocos2d::CCObject *, _DWORD *))v46)(v11, v63);
cocos2d::CCArray::addObject(*(this + 182), v11);
}
while ( v9 != 4 );
SetupGradientPopup::updateGradientLabels(this, 0);
v65 = 0;
v66 = 0;
v67 = nullptr;
std::string::__init(&v65, "Vertex\nMode", 0xBu);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v63,
(float)((float)(*((float *)this + 139) * 0.5) + (float)(v51 * 0.5)) - 72.0,
(float)((float)(*((float *)this + 140) * 0.5) + (float)(v52 * 0.5)) - 20.0);
SetupTriggerPopup::createToggleValueControl((int)this, 207, (int)&v65, (const cocos2d::CCPoint *)v63, 0, 0, 0, 1.0);
std::string::~string((int)&v65);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v54, (float)(v51 * 0.5) + 145.0, (float)(v52 * 0.5) + 40.0);
v65 = 0;
v66 = 0;
v67 = nullptr;
std::string::__init(&v65, "Disable", 7u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v63, (const cocos2d::CCPoint *)v54);
SetupTriggerPopup::createToggleValueControl((int)this, 208, (int)&v65, (const cocos2d::CCPoint *)v63, 0, 0, 0, 0.8);
std::string::~string((int)&v65);
v65 = 0;
v66 = 0;
v67 = nullptr;
std::string::__init(&v65, "Disable\nAll", 0xBu);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v62, 0.0, -25.0);
cocos2d::CCPoint::operator+(v63, v54, v62);
SetupTriggerPopup::createToggleValueControl((int)this, 508, (int)&v65, (const cocos2d::CCPoint *)v63, 0, 0, 0, 0.8);
std::string::~string((int)&v65);
v65 = 0;
v66 = 0;
v67 = nullptr;
std::string::__init(&v65, "Preview\nOpacity", 0xFu);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v63,
(float)((float)(*((float *)this + 139) * 0.5) + (float)(v51 * 0.5)) - 72.0,
(float)((float)(v52 * 0.5) - (float)(*((float *)this + 140) * 0.5)) + 40.0);
SetupTriggerPopup::createValueControlAdvanced(
this,
456,
(unsigned __int8 *)&v65,
(int)v63,
1059481190,
0,
1,
5,
0,
0,
0,
0,
0,
0,
2,
0);
std::string::~string((int)&v65);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v55, (float)(v51 * 0.5) - 20.0, (float)(v52 * 0.5) + 60.0);
v65 = 0;
v66 = 0;
v67 = nullptr;
std::string::__init(&v65, "Gradient ID", 0xBu);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v62, 75.0, -25.0);
cocos2d::CCPoint::operator+(v63, v55, v62);
IDNameInput::create((int)this, (int)(this + 110), 7, 209, (int)&v65, (int)v63, 0.7, 6, 0, 0, 0);
std::string::~string((int)&v65);
v15 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Blending", "goldFont.fnt", v14);
v16 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v15 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v62, -85.0, 0.0);
cocos2d::CCPoint::operator+(v63, v55, v62);
v16(v15, v63);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 115) + 228))(*(this + 115), v15);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v15 + 80))(v15, 1058642330);
v17 = (cocos2d::CCArray *)cocos2d::CCLabelBMFont::create(
(cocos2d::CCLabelBMFont *)" ",
"bigFont.fnt",
"bigFont.fnt");
*(this + 178) = v17;
(*(void (__fastcall **)(_DWORD, cocos2d::CCArray *))(*(_DWORD *)*(this + 115) + 228))(*(this + 115), v17);
v18 = (int)*(this + 178);
v19 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v18 + 92);
v20 = (*(int (__fastcall **)(int))(*(_DWORD *)v15 + 96))(v15);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v62, 0.0, -25.0);
cocos2d::CCPoint::operator+(v63, v20, v62);
v19(v18, v63);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 178) + 80))(*(this + 178), 1056964608);
SetupGradientPopup::updateBlendingLabel((SetupGradientPopup *)this);
v22 = (cocos2d::CCSprite *)cocos2d::CCSprite::createWithSpriteFrameName(
(cocos2d::CCSprite *)"GJ_arrow_01_001.png",
v21);
cocos2d::CCSprite::setFlipX(v22, 1);
(*(void (__fastcall **)(cocos2d::CCSprite *, int))(*(_DWORD *)v22 + 80))(v22, 1058642330);
v60 = SetupGradientPopup::onBlending;
v61 = 0;
v23 = CCMenuItemSpriteExtra::create((int)v22, 0, (int)this, (int)SetupGradientPopup::onBlending, 0);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 111) + 228))(*(this + 111), v23);
v47 = *(char **)(*(_DWORD *)v23 + 92);
v50 = *(this + 111);
v49 = (char *)(*(int (__fastcall **)(_DWORD))(*(_DWORD *)*(this + 178) + 96))(*(this + 178));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v57, 75.0, 0.0);
cocos2d::CCPoint::operator+(v62, v49, v57);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v63, v50);
((void (__fastcall *)(int, _DWORD *))v47)(v23, v63);
CCMenuItemSpriteExtra::setSizeMult(v23, 1.4);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v23 + 36))(v23, 1);
v25 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_arrow_01_001.png", v24);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v25 + 80))(v25, 1058642330);
v62[0] = SetupGradientPopup::onBlending;
v62[1] = 0;
v26 = CCMenuItemSpriteExtra::create(v25, 0, (int)this, (int)SetupGradientPopup::onBlending, 0);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 111) + 228))(*(this + 111), v26);
v27 = *(this + 111);
v48 = *(char **)(*(_DWORD *)v26 + 92);
v28 = (*(int (__fastcall **)(_DWORD))(*(_DWORD *)*(this + 178) + 96))(*(this + 178));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v56, -75.0, 0.0);
cocos2d::CCPoint::operator+(v57, v28, v56);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v63, v27);
((void (__fastcall *)(int, _DWORD *))v48)(v26, v63);
CCMenuItemSpriteExtra::setSizeMult(v26, 1.4);
v29 = 1;
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)v26 + 36))(v26, 0);
MultiTriggerItemsCorner = (cocos2d::CCArray *)SetupTriggerPopup::createMultiTriggerItemsCorner((SetupTriggerPopup *)this);
v31 = (cocos2d::CCObject *)cocos2d::CCArray::create(MultiTriggerItemsCorner);
*(this + 180) = v31;
v32 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v31);
v33 = (cocos2d::CCArray *)cocos2d::CCArray::create(v32);
v34 = COERCE_FLOAT(cocos2d::CCArray::create(v33));
do
{
SetupShaderEffectPopup::zLayerToString((SetupShaderEffectPopup *)&v65, v29);
if ( (v65 & 1) != 0 )
v35 = v67;
else
v35 = (ButtonSprite *)((char *)&v65 + 1);
v36 = ButtonSprite::create(
v35,
(const char *)off_DC,
0,
0.3,
0,
"bigFont.fnt",
"GJ_button_04.png",
(const char *)0x41C80000,
v44);
std::string::~string((int)&v65);
cocos2d::CCArray::addObject(*(this + 180), v36);
v63[0] = SetupGradientPopup::onZLayer;
v63[1] = 0;
v37 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::create(
(int)v36,
0,
(int)this,
(int)SetupGradientPopup::onZLayer,
0);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v37 + 36))(v37, v29);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v36 + 36))(v36, v29);
(*(void (__fastcall **)(_DWORD, cocos2d::CCObject *))(*(_DWORD *)*(this + 111) + 228))(*(this + 111), v37);
if ( v29++ <= 7 )
v39 = v33;
else
v39 = (cocos2d::CCArray *)LODWORD(v34);
cocos2d::CCArray::addObject(v39, v37);
}
while ( v29 != 16 );
SetupGradientPopup::updateZLayerButtons(this);
v40 = *(this + 111);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v56, (float)(v51 * 0.5) - 20.0, (float)(v52 * 0.5) - 10.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v57, v40);
GameToolbox::alignItemsHorisontally(*(float *)&v33, 8.0, (int)v57, 0);
v41 = *(this + 111);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v56, (float)(v51 * 0.5) - 20.0, (float)(v52 * 0.5) - 50.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v57, v41);
GameToolbox::alignItemsHorisontally(v34, 8.0, (int)v57, 0);
(*((void (__fastcall **)(cocos2d::CCArray **))*this + 179))(this);
*((_BYTE *)this + 568) = 0;
}
return v45;
}