//
// SetupRandTriggerPopup::init from 0x635ea0 to 0x6364e4 (1604 bytes)
//
// 1 xrefs:
// > SetupRandTriggerPopup::create @ 0x63674c
//
// 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:55:20 +0000
//
int __fastcall SetupRandTriggerPopup::init(SetupRandTriggerPopup *this, EffectGameObject *a2, cocos2d::CCArray *a3)
{
int v4; // r11
cocos2d::CCDirector *v5; // r0
const char *v6; // r2
int v7; // r6
void (__fastcall *v8)(int, _DWORD *); // r9
ButtonSprite *v9; // r0
int v10; // r0
int v11; // r9
const cocos2d::CCPoint *v12; // r10
void (__fastcall *v13)(int, _DWORD *); // r7
int v14; // r7
int v15; // r8
int v16; // r3
const char *v17; // r2
int v18; // r6
void (__fastcall *v19)(int, _DWORD *); // r7
int v20; // r6
void (__fastcall *v21)(int, _DWORD *); // r10
char *v22; // r2
int *v23; // r0
int v24; // r10
int v25; // r0
int v26; // r10
Slider *v27; // r0
int v28; // r5
void (__fastcall *v29)(int, _BYTE *); // r9
float v30; // s15
char *v32; // [sp+8h] [bp-B4h]
int v33; // [sp+10h] [bp-ACh]
void (__fastcall *v34)(int, int); // [sp+24h] [bp-98h]
int v35; // [sp+28h] [bp-94h]
float v36; // [sp+2Ch] [bp-90h] BYREF
float v37; // [sp+30h] [bp-8Ch]
_BYTE v38[8]; // [sp+34h] [bp-88h] BYREF
_BYTE v39[8]; // [sp+3Ch] [bp-80h] BYREF
_BYTE v40[8]; // [sp+44h] [bp-78h] BYREF
_BYTE v41[4]; // [sp+4Ch] [bp-70h] BYREF
float v42; // [sp+50h] [bp-6Ch]
_BYTE v43[8]; // [sp+54h] [bp-68h] BYREF
_BYTE v44[8]; // [sp+5Ch] [bp-60h] BYREF
_BYTE v45[8]; // [sp+64h] [bp-58h] BYREF
_BYTE v46[8]; // [sp+6Ch] [bp-50h] BYREF
int v47; // [sp+74h] [bp-48h]
int v48; // [sp+78h] [bp-44h]
int v49[3]; // [sp+7Ch] [bp-40h] BYREF
int v50; // [sp+88h] [bp-34h] BYREF
int v51; // [sp+8Ch] [bp-30h]
int v52; // [sp+90h] [bp-2Ch]
_BYTE v53[16]; // [sp+94h] [bp-28h] BYREF
_DWORD v54[4]; // [sp+A4h] [bp-18h] BYREF
v4 = SetupTriggerPopup::init(this, a2, a3, 360.0, 280.0, 1, 0.0);
if ( v4 )
{
v5 = (cocos2d::CCDirector *)(*(int (__fastcall **)(SetupRandTriggerPopup *))(*(_DWORD *)this + 680))(this);
cocos2d::CCDirector::sharedDirector(v5);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v36);
v7 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Random Trigger", "goldFont.fnt", v6);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 115) + 228))(*((_DWORD *)this + 115), v7);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v7 + 80))(v7, 1060320051);
v8 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v7 + 92);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v54,
v36 * 0.5,
(float)((float)(*((float *)this + 140) * 0.5) + (float)(v37 * 0.5)) - 18.0);
v8(v7, v54);
v9 = ButtonSprite::create(
(ButtonSprite *)"OK",
(const char *)&word_28,
0,
0.8,
1,
"goldFont.fnt",
"GJ_button_01.png",
COERCE_CONST_CHAR_(30.0),
*(float *)&v33);
v47 = 684;
v48 = 1;
v10 = CCMenuItemSpriteExtra::create((int)v9, 0, (int)this, 684, 1);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v10);
memset(v49, 0, sizeof(v49));
std::string::__init(v49, "Help", 4u);
v50 = 0;
v51 = 0;
v52 = 0;
std::string::__init(
&v50,
"Triggers one of two groups randomly.\n"
"Chance is how likely it is that the first group is triggered.\n"
"For example, setting this to 80% means that there is 80% chance that Group ID 1 is triggered and 20% chanc"
"e that Group ID 2 is triggered.",
0x10Cu);
v11 = InfoAlertButton::create((char *)v49, (int)&v50, 1065353216);
std::string::~string((int)&v50);
std::string::~string((int)v49);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 111) + 228))(*((_DWORD *)this + 111), v11);
v12 = *((const cocos2d::CCPoint **)this + 111);
v13 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v11 + 92);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v53,
(float)((float)(v36 * 0.5) - (float)(*((float *)this + 139) * 0.5)) + 18.0,
(float)((float)(*((float *)this + 140) * 0.5) + (float)(v37 * 0.5)) - 18.0);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v54, v12);
v13(v11, v54);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v38, v36 * 0.5, (float)(v37 * 0.5) + 50.0);
v50 = 0;
v51 = 0;
v52 = 0;
std::string::__init(&v50, "Group ID 1", 0xAu);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v53, -90.0, 0.0);
cocos2d::CCPoint::operator+(v54, v38, v53);
v14 = IDNameInput::create((int)this, (int)this + 440, 1, 3, (int)&v50, (int)v54, 1.0, 6, 0, 0, 0);
std::string::~string((int)&v50);
v50 = 0;
v51 = 0;
v52 = 0;
std::string::__init(&v50, "Group ID 2", 0xAu);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v53, 90.0, 0.0);
cocos2d::CCPoint::operator+(v54, v38, v53);
v15 = IDNameInput::create((int)this, (int)this + 440, 1, 5, (int)&v50, (int)v54, 1.0, 6, 0, 0, 0);
std::string::~string((int)&v50);
if ( v14 )
v14 = *(_DWORD *)(v14 + 300);
*((_DWORD *)this + 181) = v14;
if ( v15 )
v16 = *(_DWORD *)(v15 + 300);
else
v16 = 0;
*((_DWORD *)this + 182) = v16;
SetupRandTriggerPopup::updateTextInputLabel(this);
SetupRandTriggerPopup::updateTextInputLabel2(this);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v39, v36 * 0.5, (float)(v37 * 0.5) - 10.0);
v18 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Chance %: ", "goldFont.fnt", v17);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v18 + 80))(v18, 1060320051);
(*(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v18 + 92))(v18, v39);
v19 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v18 + 148);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v54, 1.0, 0.5);
v19(v18, v54);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 115) + 228))(*((_DWORD *)this + 115), v18);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v53, 0.0, 0.0, 40.0, 40.0);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v54, (const cocos2d::CCRect *)v53);
v20 = cocos2d::extension::CCScale9Sprite::create("square02_small.png", v54);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v20 + 456))(v20, 100);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v40, 70.0, 30.0);
(*(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v20 + 160))(v20, v40);
(*(void (__fastcall **)(_DWORD, int, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v20, -1);
v21 = *(void (__fastcall **)(int, _DWORD *))(*(_DWORD *)v20 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v46, 45.0, 0.0);
cocos2d::CCPoint::operator+(v54, v39, v46);
v21(v20, v54);
if ( *((float *)this + 180) == -99999.0 )
v22 = "Mixed";
else
v22 = "Num";
v23 = CCTextInputNode::create(
(CCTextInputNode *)0x42480000,
40.0,
v22,
"Thonburi",
(const char *)&dword_18,
"bigFont.fnt",
v32);
*((_DWORD *)this + 178) = v23;
(*(void (__fastcall **)(_DWORD, int *, int))(**((_DWORD **)this + 115) + 232))(*((_DWORD *)this + 115), v23, 20);
v24 = *((_DWORD *)this + 178);
v34 = *(void (__fastcall **)(int, int))(*(_DWORD *)v24 + 92);
v25 = (*(int (__fastcall **)(int))(*(_DWORD *)v20 + 96))(v20);
v34(v24, v25);
CCTextInputNode::setMaxLabelScale(*((_DWORD *)this + 178), 0.6);
CCTextInputNode::setMaxLabelWidth(*((_DWORD *)this + 178), 200.0);
(*(void (__fastcall **)(_DWORD, _DWORD))(**(_DWORD **)(*((_DWORD *)this + 178) + 416) + 172))(
*(_DWORD *)(*((_DWORD *)this + 178) + 416),
0);
*(_DWORD *)(*((_DWORD *)this + 178) + 424) = 7;
v26 = *((_DWORD *)this + 178);
v50 = 0;
v51 = 0;
v52 = 0;
std::string::__init(&v50, "0123456789.", 0xBu);
CCTextInputNode::setAllowedChars(v26, (unsigned __int8 *)&v50);
std::string::~string((int)&v50);
LOWORD(v35) = -21896;
BYTE2(v35) = -16;
CCTextInputNode::setLabelPlaceholderColor(*((_DWORD *)this + 178), v35);
CCTextInputNode::setLabelPlaceholderScale(*((_DWORD *)this + 178), 0.5);
*(_BYTE *)(*((_DWORD *)this + 178) + 324) = 1;
*(_DWORD *)(*((_DWORD *)this + 178) + 420) = (char *)this + 440;
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 178) + 36))(*((_DWORD *)this + 178), 4);
v54[1] = 0;
v54[0] = SetupRandTriggerPopup::sliderChanged;
v27 = (Slider *)Slider::create((int)this, (int)SetupRandTriggerPopup::sliderChanged, 0, 0.8);
*((_DWORD *)this + 179) = v27;
Slider::setBarVisibility(v27, 0);
(*(void (__fastcall **)(_DWORD, _DWORD))(**((_DWORD **)this + 115) + 228))(
*((_DWORD *)this + 115),
*((_DWORD *)this + 179));
v28 = *((_DWORD *)this + 179);
v29 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v28 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v45, 0.0, -32.0);
cocos2d::CCPoint::operator+(v46, v39, v45);
v29(v28, v46);
v30 = *((float *)this + 180) / 100.0;
if ( v30 >= 100.0 )
{
v30 = 100.0;
}
else if ( v30 <= 0.0 )
{
v30 = 0.0;
}
Slider::setValue(*((Slider **)this + 179), v30);
SetupRandTriggerPopup::updateChanceLabel(this, nullptr);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v41,
(float)((float)(v36 * 0.5) - (float)(*((float *)this + 139) * 0.5)) + 20.0,
(float)((float)(v37 * 0.5) - (float)(*((float *)this + 140) * 0.5)) + 20.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v43, 0.0, 30.0);
cocos2d::CCPoint::operator+(v44, v41, v43);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v46, (const cocos2d::CCPoint *)v41);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v45,
(float)((float)(*((float *)this + 139) * 0.5) + (float)(v36 * 0.5)) - 80.0,
v42 + 30.0);
SetupTriggerPopup::createMultiTriggerItems(this, v44, v46, v45);
*((_BYTE *)this + 568) = 0;
}
return v4;
}