//
// SetupShaderEffectPopup::setupShaderTrigger from 0x68d99c to 0x68dd68 (972 bytes)
//
// 1 xrefs:
// > SetupShaderEffectPopup::init @ 0x68debc
//
// 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:09 +0000
//
unsigned int __fastcall SetupShaderEffectPopup::setupShaderTrigger(SetupShaderEffectPopup *this)
{
cocos2d::CCDirector *v2; // r0
int v3; // r6
cocos2d::CCArray *v4; // r0
cocos2d::CCObject *v5; // r0
cocos2d::CCArray *v6; // r0
cocos2d::CCArray *v7; // r9
float v8; // r8
ButtonSprite *v9; // r0
cocos2d::CCObject *v10; // r11
cocos2d::CCObject *v11; // r10
cocos2d::CCArray *v13; // r0
const cocos2d::CCPoint *v14; // r10
const cocos2d::CCPoint *v15; // r9
float v16; // r0
cocos2d::CCArray *v17; // r6
cocos2d::CCArray *v18; // r0
cocos2d::CCArray *v19; // r5
int v20; // r1
cocos2d::CCObject *v21; // r0
int v22; // r1
cocos2d::CCObject *v23; // r0
int v24; // r3
_DWORD *v26; // r2
int v27; // r3
int *v28; // r2
int v29; // r9
unsigned int v30; // r5
int *v31; // r8
int v32; // r3
int v33; // t1
_DWORD *v34; // r2
float v35; // r11
int v36; // r3
char *v37; // r2
int v38; // r3
float v39; // s16
unsigned int v40; // r10
char *v41; // r12
GameObject *v42; // r2
char *v43; // r12
GameObject *v44; // t1
float TriggerValue; // r0
char *v46; // [sp+10h] [bp-4Ch]
char *v47; // [sp+10h] [bp-4Ch]
float v48; // [sp+1Ch] [bp-40h] BYREF
float v49; // [sp+20h] [bp-3Ch]
_BYTE v50[8]; // [sp+24h] [bp-38h] BYREF
_BYTE v51[8]; // [sp+2Ch] [bp-30h] BYREF
_DWORD v52[2]; // [sp+34h] [bp-28h] BYREF
int v53[3]; // [sp+3Ch] [bp-20h] BYREF
int v54; // [sp+48h] [bp-14h] BYREF
int v55; // [sp+4Ch] [bp-10h]
ButtonSprite *v56; // [sp+50h] [bp-Ch]
v54 = 0;
v55 = 0;
v56 = nullptr;
std::string::__init(&v54, "Setup Shader Trigger", 0x14u);
SetupTriggerPopup::addTitle((int)this, (unsigned __int8 *)&v54);
std::string::~string((int)&v54);
memset(v53, 0, sizeof(v53));
std::string::__init(v53, "Help", 4u);
v54 = 0;
v55 = 0;
v56 = nullptr;
std::string::__init(
&v54,
"Edits how other shader effects work. They can be limited to certain layers or disabled entirely.\n"
"Disable All disables all other shader effects.",
0x9Fu);
SetupTriggerPopup::addHelpButton((int)this, (int)v53, (int)&v54, 1065353216);
std::string::~string((int)&v54);
v2 = (cocos2d::CCDirector *)std::string::~string((int)v53);
cocos2d::CCDirector::sharedDirector(v2);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v48);
v54 = 0;
v55 = 0;
v56 = nullptr;
std::string::__init(&v54, "Disable All", 0xBu);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v52, v48 * 0.5, (float)(v49 * 0.5) + 90.0);
SetupTriggerPopup::createToggleValueControl((int)this, 192, (int)&v54, (const cocos2d::CCPoint *)v52, 0, 0, 0, 1.0);
std::string::~string((int)&v54);
v54 = 0;
v55 = 0;
v56 = nullptr;
std::string::__init(&v54, "No Player\nParticles", 0x13u);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v52, v48 * 0.5, (float)(v49 * 0.5) + 50.0);
SetupTriggerPopup::createToggleValueControl((int)this, 188, (int)&v54, (const cocos2d::CCPoint *)v52, 0, 0, 0, 1.0);
v3 = 1;
v4 = (cocos2d::CCArray *)std::string::~string((int)&v54);
v5 = (cocos2d::CCObject *)cocos2d::CCArray::create(v4);
*((_DWORD *)this + 178) = v5;
v6 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v5);
v7 = (cocos2d::CCArray *)cocos2d::CCArray::create(v6);
v46 = "bigFont.fnt";
v8 = COERCE_FLOAT(cocos2d::CCArray::create(v7));
do
{
SetupShaderEffectPopup::zLayerToString((SetupShaderEffectPopup *)&v54, v3);
if ( (v54 & 1) != 0 )
v9 = v56;
else
v9 = (ButtonSprite *)((char *)&v54 + 1);
v10 = ButtonSprite::create(
v9,
(const char *)off_DC,
0,
0.3,
0,
v46,
"GJ_button_04.png",
(const char *)0x41C80000,
*(float *)&v46);
std::string::~string((int)&v54);
cocos2d::CCArray::addObject(*((cocos2d::CCArray **)this + 178), v10);
v52[0] = SetupShaderEffectPopup::onZLayer;
v52[1] = 0;
v11 = (cocos2d::CCObject *)CCMenuItemSpriteExtra::create(
(int)v10,
0,
(int)this,
(int)SetupShaderEffectPopup::onZLayer,
0);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v11 + 36))(v11, v3);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v10 + 36))(v10, v3);
(*(void (__fastcall **)(_DWORD, cocos2d::CCObject *))(**((_DWORD **)this + 111) + 228))(
*((_DWORD *)this + 111),
v11);
if ( v3++ <= 7 )
v13 = v7;
else
v13 = (cocos2d::CCArray *)LODWORD(v8);
cocos2d::CCArray::addObject(v13, v11);
}
while ( v3 != 16 );
v14 = *((const cocos2d::CCPoint **)this + 111);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v50, v48 * 0.5, v49 * 0.5);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v51, v14);
GameToolbox::alignItemsHorisontally(*(float *)&v7, 8.0, (int)v51, 0);
v15 = *((const cocos2d::CCPoint **)this + 111);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v50, v48 * 0.5, (float)(v49 * 0.5) - 40.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v51, v15);
v16 = GameToolbox::alignItemsHorisontally(v8, 8.0, (int)v51, 0);
if ( *((_DWORD *)this + 132) )
{
v17 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)LODWORD(v16));
cocos2d::CCArray::addObject(v17, *((cocos2d::CCObject **)this + 132));
}
else
{
v17 = *((cocos2d::CCArray **)this + 133);
}
if ( v17 )
{
v18 = (cocos2d::CCArray *)cocos2d::CCArray::count(v17);
if ( v18 )
{
v19 = (cocos2d::CCArray *)cocos2d::CCArray::create(v18);
v21 = cocos2d::CCInteger::create((cocos2d::CCInteger *)&dword_C4, v20);
cocos2d::CCArray::addObject(v19, v21);
v23 = cocos2d::CCInteger::create((cocos2d::CCInteger *)((char *)&dword_C4 + 1), v22);
cocos2d::CCArray::addObject(v19, v23);
if ( v19 )
{
v26 = *((_DWORD **)v19 + 13);
if ( *v26 )
{
v27 = *v26 + 0x40000000;
v28 = (int *)v26[3];
v29 = 0;
v30 = (unsigned int)&v28[v27 - 1];
v31 = v28;
while ( (unsigned int)v31 <= v30 )
{
v33 = *v31++;
v32 = v33;
if ( !v33 )
break;
v34 = *((_DWORD **)v17 + 13);
v35 = *(float *)(v32 + 52);
if ( *v34 )
{
v36 = *v34 + 0x40000000;
v37 = (char *)v34[3];
v38 = v36 - 1;
v39 = -9999.0;
v40 = (unsigned int)&v37[4 * v38];
v41 = v37;
while ( (unsigned int)v41 <= v40 )
{
v44 = *(GameObject **)v41;
v43 = v41 + 4;
v42 = v44;
if ( !v44 )
break;
v47 = v43;
TriggerValue = SetupTriggerPopup::getTriggerValue(this, v35, v42, v38);
v41 = v47;
if ( v39 == -9999.0 )
{
v39 = TriggerValue;
}
else if ( v39 != TriggerValue )
{
goto LABEL_31;
}
}
if ( v39 != -9998.0 )
goto LABEL_35;
LABEL_31:
v29 = 1;
}
else
{
v39 = -9999.0;
LABEL_35:
if ( LODWORD(v35) == 196 )
{
*((_DWORD *)this + 179) = (int)v39;
}
else if ( LODWORD(v35) == 197 )
{
*((_DWORD *)this + 180) = (int)v39;
}
}
}
if ( v29 )
{
v24 = 0;
*((_DWORD *)this + 179) = 0;
goto LABEL_19;
}
}
}
}
}
if ( *((int *)this + 179) <= 0 )
*((_DWORD *)this + 179) = 1;
if ( *((int *)this + 180) <= 0 )
{
v24 = 15;
LABEL_19:
*((_DWORD *)this + 180) = v24;
}
return SetupShaderEffectPopup::updateZLayerButtons((cocos2d::CCArray **)this);
}