//
// SetupRandTriggerPopup::init from 0xab3584 to 0xab3e50 (2252 bytes)
//
// 2 xrefs:
// > SetupRandTriggerPopup::create @ 0xab40c4
// > ??> @ 0x9df78
//
// 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 13:00:58 +0000
//
__int64 __fastcall SetupRandTriggerPopup::init(CCTextInputNode **this, EffectGameObject *a2, cocos2d::CCArray *a3)
{
unsigned __int8 v4; // w0
unsigned int v5; // w24
cocos2d::CCDirector *v7; // x0
cocos2d::CCDirector *v8; // x0
const char *v9; // x2
__int64 v10; // x23
void (__fastcall *v11)(__int64, __int64 *); // x27
const char *v12; // x6
__int64 v13; // x0
__int64 v14; // x0
__int64 v15; // x26
__int64 v16; // x26
__int64 v17; // x25
CCTextInputNode *v18; // x0
CCTextInputNode *v19; // x0
const char *v20; // x2
__int64 v21; // x28
__int64 v22; // x23
void (__fastcall *v23)(__int64, __int64 *); // x28
const char *v24; // x4
char *v25; // x0
__int64 v26; // x0
__int64 v27; // x28
__int64 v28; // x0
__int64 (__fastcall *v29)(__int64); // x1
void (__fastcall *v30)(__int64, __int64); // x23
__int64 v31; // x0
__int64 v32; // x23
Slider *v33; // x0
__int64 v34; // x22
void (__fastcall *v35)(__int64, __int64 *); // x23
float v36; // s0
int v37; // [xsp+8h] [xbp-8h]
cocos2d::CCNode *v38; // [xsp+90h] [xbp+80h]
void (__fastcall *v39)(__int64, __int64 *); // [xsp+98h] [xbp+88h]
void (__fastcall *v40)(__int64, __int64 *); // [xsp+98h] [xbp+88h]
int v41; // [xsp+A0h] [xbp+90h]
__int64 v42; // [xsp+A8h] [xbp+98h] BYREF
_BYTE v43[8]; // [xsp+B0h] [xbp+A0h] BYREF
_BYTE v44[8]; // [xsp+B8h] [xbp+A8h] BYREF
_BYTE v45[8]; // [xsp+C0h] [xbp+B0h] BYREF
_BYTE v46[4]; // [xsp+C8h] [xbp+B8h] BYREF
float v47; // [xsp+CCh] [xbp+BCh]
_BYTE v48[8]; // [xsp+D0h] [xbp+C0h] BYREF
__int64 v49; // [xsp+D8h] [xbp+C8h] BYREF
_BYTE v50[8]; // [xsp+E0h] [xbp+D0h] BYREF
_BYTE v51[16]; // [xsp+E8h] [xbp+D8h] BYREF
__int64 v52[2]; // [xsp+F8h] [xbp+E8h] BYREF
__int64 v53[2]; // [xsp+108h] [xbp+F8h] BYREF
void *v54; // [xsp+118h] [xbp+108h]
__int64 v55; // [xsp+120h] [xbp+110h] BYREF
__int64 v56; // [xsp+128h] [xbp+118h]
void *v57; // [xsp+130h] [xbp+120h]
v4 = SetupTriggerPopup::init((SetupTriggerPopup *)this, a2, a3, 360.0, 280.0, 1, 0.0);
v5 = v4;
if ( v4 )
{
v7 = (cocos2d::CCDirector *)(*((__int64 (__fastcall **)(CCTextInputNode **))*this + 170))(this);
v8 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v7);
cocos2d::CCDirector::getWinSize(&v42, v8);
v10 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Random Trigger", "goldFont.fnt", v9);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 73) + 456LL))(*(this + 73), v10);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v10 + 160LL))(v10, 0.7);
v11 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v10 + 184LL);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v52,
*(float *)&v42 * 0.5,
(float)((float)(*((float *)this + 184) * 0.5) + (float)(*((float *)&v42 + 1) * 0.5)) - 18.0);
v11(v10, v52);
v13 = ButtonSprite::create(
(ButtonSprite *)"OK",
(const char *)&qword_28,
0,
1,
0.8,
"goldFont.fnt",
"GJ_button_01.png",
v12,
30.0);
v14 = CCMenuItemSpriteExtra::create(v13, 0, (__int64)this, 1368, 1);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 69) + 456LL))(*(this + 69), v14);
v53[0] = 0;
v53[1] = 0;
v54 = nullptr;
std::string::__init(v53, "Help", 4u);
v55 = 0;
v56 = 0;
v57 = nullptr;
std::string::__init(
&v55,
"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);
v15 = InfoAlertButton::create((char *)v53, (char *)&v55, 1.0);
if ( (v55 & 1) != 0 )
operator delete(v57);
if ( (v53[0] & 1) != 0 )
operator delete(v54);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 69) + 456LL))(*(this + 69), v15);
v39 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v15 + 184LL);
v38 = *(this + 69);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v51,
18.0 - (float)((float)(*((float *)this + 183) * 0.5) - (float)(*(float *)&v42 * 0.5)),
(float)((float)(*((float *)this + 184) * 0.5) + (float)(*((float *)&v42 + 1) * 0.5)) - 18.0);
cocos2d::CCNode::convertToNodeSpace(v52, v38, (const cocos2d::CCPoint *)v51);
v39(v15, v52);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v43, *(float *)&v42 * 0.5, (float)(*((float *)&v42 + 1) * 0.5) + 50.0);
v55 = 0;
v56 = 0;
v57 = nullptr;
std::string::__init(&v55, "Group ID 1", 0xAu);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v51, -90.0, 0.0);
cocos2d::CCPoint::operator+(v52, v43);
v16 = IDNameInput::create(this, this + 68, 1, 3, &v55, v52, 6, 0, 1.0, 0, 0);
if ( (v55 & 1) != 0 )
operator delete(v57);
v55 = 0;
v56 = 0;
v57 = nullptr;
std::string::__init(&v55, "Group ID 2", 0xAu);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v51, 90.0, 0.0);
cocos2d::CCPoint::operator+(v52, v43);
LOBYTE(v37) = 0;
v17 = IDNameInput::create(this, this + 68, 1, 5, &v55, v52, 6, 0, 1.0, 0, v37);
if ( (v55 & 1) != 0 )
operator delete(v57);
if ( v16 )
v18 = *(CCTextInputNode **)(v16 + 384);
else
v18 = nullptr;
*(this + 130) = v18;
if ( v17 )
v19 = *(CCTextInputNode **)(v17 + 384);
else
v19 = nullptr;
*(this + 131) = v19;
SetupRandTriggerPopup::updateTextInputLabel((SetupRandTriggerPopup *)this);
SetupRandTriggerPopup::updateTextInputLabel2((SetupRandTriggerPopup *)this);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v44,
*(float *)&v42 * 0.5,
(float)(*((float *)&v42 + 1) * 0.5) + -10.0);
v21 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Chance %: ", "goldFont.fnt", v20);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v21 + 160LL))(v21, 0.7);
(*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v21 + 184LL))(v21, v44);
v40 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v21 + 296LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v52, 1.0, 0.5);
v40(v21, v52);
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 73) + 456LL))(*(this + 73), v21);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v51, 0.0, 0.0, 40.0, 40.0);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v52, (const cocos2d::CCRect *)v51);
v22 = cocos2d::extension::CCScale9Sprite::create("square02_small.png", v52);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v22 + 912LL))(v22, 100);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v45, 70.0, 30.0);
(*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v22 + 320LL))(v22, v45);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(*(_QWORD *)*(this + 73) + 464LL))(
*(this + 73),
v22,
0xFFFFFFFFLL);
v23 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v22 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v50, 45.0, 0.0);
cocos2d::CCPoint::operator+(v52, v44);
v23(v22, v52);
if ( *((float *)this + 258) == -99999.0 )
v25 = "Mixed";
else
v25 = "Num";
v26 = CCTextInputNode::create(
(CCTextInputNode *)v25,
50.0,
40.0,
"Thonburi",
(const char *)&off_18,
"bigFont.fnt",
v24);
*(this + 127) = (CCTextInputNode *)v26;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(*(_QWORD *)*(this + 73) + 464LL))(*(this + 73), v26, 20);
v27 = (__int64)*(this + 127);
v28 = v22;
v29 = *(__int64 (__fastcall **)(__int64))(*(_QWORD *)v22 + 192LL);
v30 = *(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v27 + 184LL);
v31 = v29(v28);
v30(v27, v31);
CCTextInputNode::setMaxLabelScale(*(this + 127), 0.6);
CCTextInputNode::setMaxLabelWidth(*(this + 127), 200.0);
(*(void (__fastcall **)(_QWORD, _QWORD))(**((_QWORD **)*(this + 127) + 72) + 344LL))(
*((_QWORD *)*(this + 127) + 72),
0);
*((_DWORD *)*(this + 127) + 148) = 7;
v55 = 0;
v32 = (__int64)*(this + 127);
v56 = 0;
v57 = nullptr;
std::string::__init(&v55, "0123456789.", 0xBu);
CCTextInputNode::setAllowedChars(v32, (__int64)&v55);
if ( (v55 & 1) != 0 )
operator delete(v57);
LOWORD(v41) = -21896;
BYTE2(v41) = -16;
CCTextInputNode::setLabelPlaceholderColor((__int64)*(this + 127), v41);
CCTextInputNode::setLabelPlaceholderScale(*(this + 127), 0.5);
*((_BYTE *)*(this + 127) + 424) = 1;
*((_QWORD *)*(this + 127) + 73) = this + 68;
(*(void (__fastcall **)(_QWORD, __int64))(*(_QWORD *)*(this + 127) + 72LL))(*(this + 127), 4);
v33 = (Slider *)Slider::create((int)this, (int)SetupRandTriggerPopup::sliderChanged, 0, 0.8);
*(this + 128) = v33;
Slider::setBarVisibility(v33);
(*(void (__fastcall **)(_QWORD, _QWORD))(*(_QWORD *)*(this + 73) + 456LL))(*(this + 73), *(this + 128));
v34 = (__int64)*(this + 128);
v35 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v34 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v50, 0.0, -32.0);
cocos2d::CCPoint::operator+(v52, v44);
v35(v34, v52);
v36 = *((float *)this + 258) / 100.0;
if ( v36 >= 100.0 )
{
v36 = 100.0;
}
else if ( v36 <= 0.0 )
{
v36 = 0.0;
}
Slider::setValue(*(this + 128), v36);
SetupRandTriggerPopup::updateChanceLabel((SetupRandTriggerPopup *)this, 0);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v46,
20.0 - (float)((float)(*((float *)this + 183) * 0.5) - (float)(*(float *)&v42 * 0.5)),
20.0 - (float)((float)(*((float *)this + 184) * 0.5) - (float)(*((float *)&v42 + 1) * 0.5)));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v48, 0.0, 30.0);
cocos2d::CCPoint::operator+(&v49, v46);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v52, (const cocos2d::CCPoint *)v46);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v50,
(float)((float)(*((float *)this + 183) * 0.5) + (float)(*(float *)&v42 * 0.5)) - 80.0,
v47 + 30.0);
SetupTriggerPopup::createMultiTriggerItems(this, &v49, v52, v50);
*((_BYTE *)this + 744) = 0;
}
return v5;
}