//
// SetupSequenceTriggerPopup::init from 0x580420 to 0x580cfc (2268 bytes)
//
// 1 xrefs:
// > SetupSequenceTriggerPopup::create @ 0x580e94
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
bool SetupSequenceTriggerPopup::init(SetupSequenceTriggerPopup *a1, SequenceTriggerGameObject *a2)
{
cocos2d::CCArray *v3; // r0
cocos2d::CCArray *v4; // r0
cocos2d::CCDirector *v5; // r0
cocos2d::CCLabelBMFont *v6; // r6
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
ButtonSprite *v8; // r0
CCMenuItemSpriteExtra *v9; // r0
CCMenuItemSpriteExtra *v10; // r10
cocos2d::CCMenu *v11; // r8
int v12; // r8
char *v13; // r1
cocos2d::CCSprite *v14; // r0
ButtonSprite *v15; // r9
ButtonSprite *v16; // r0
CCMenuItemSpriteExtra *v17; // r9
cocos2d::CCMenu *v18; // r0
cocos2d::CCNode *v19; // r11
void (__fastcall *setContentSize)(cocos2d::CCNode *__hidden, const cocos2d::CCSize *); // r8
void (__fastcall *v21)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
int v22; // r10
int v23; // s17
float v25; // [sp+10h] [bp-9Ch]
bool v26; // [sp+10h] [bp-9Ch]
_BOOL4 v27; // [sp+34h] [bp-78h]
void (__fastcall *v28)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+38h] [bp-74h]
void (__fastcall *v29)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // [sp+38h] [bp-74h]
cocos2d::CCMenu *m_buttonMenu; // [sp+40h] [bp-6Ch]
cocos2d::CCSprite *v31; // [sp+58h] [bp-54h] BYREF
cocos2d::CCSize v32; // [sp+5Ch] [bp-50h] BYREF
cocos2d::CCPoint v33; // [sp+64h] [bp-48h] BYREF
cocos2d::CCPoint v34; // [sp+6Ch] [bp-40h] BYREF
cocos2d::CCPoint v35; // [sp+74h] [bp-38h] BYREF
_DWORD v36[2]; // [sp+7Ch] [bp-30h] BYREF
cocos2d::CCPoint v37; // [sp+84h] [bp-28h] BYREF
int v38; // [sp+8Ch] [bp-20h]
int v39; // [sp+90h] [bp-1Ch]
cocos2d::CCRect v40; // [sp+94h] [bp-18h] BYREF
cocos2d::CCRect v41; // 0:r2.8,8:^0.8
v27 = SetupTriggerPopup::init(a1, a2, nullptr, 420.0, 300.0, 1);
if ( v27 )
{
SetupTriggerPopup::preSetup(a1);
v4 = (cocos2d::CCArray *)cocos2d::CCArray::create(v3);
a1->m_groupButtons = v4;
cocos2d::CCObject::retain(v4);
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v32, v5);
v6 = cocos2d::CCLabelBMFont::create();
a1->m_mainLayer->addChild(a1->m_mainLayer, v6);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v6->setScale)(v6, 1060320051);
setPosition = v6->setPosition;
cocos2d::CCPoint::CCPoint(
&v40.origin,
v32.width * 0.5,
(float)((float)(a1->m_height * 0.5) + (float)(v32.height * 0.5)) - 18.0);
setPosition(v6, &v40.origin);
v8 = ButtonSprite::create(
(ButtonSprite *)"OK",
(const char *)&word_28,
0,
0.8,
1,
"goldFont.fnt",
"GJ_button_01.png",
(const char *)0x41F00000,
v25);
v38 = 660;
v39 = 1;
v9 = CCMenuItemSpriteExtra::create(v8, nullptr, (cocos2d::SEL_MenuHandler)((unsigned int)a1 | 0x29400000000LL));
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v9);
sub_776584((int)&v37, "Help");
sub_776584(
(int)&v40,
"Activates a sequence of triggers. Every time it is called, the sequence is advanced one step.\n"
"GroupID is called the amount of times given by Count.\n"
"MinInt is the minimum interval between each step.\n"
"Mode Stop stops the sequence at the end.\n"
"Mode Loop restarts the sequence after ending.\n"
"Mode Last calls last group after the end.\n"
"Reset Full and Reset Step go back in the sequence if activation does not happen in a set time.");
v10 = InfoAlertButton::create((int)&v37, (int)&v40, 1065353216);
sub_774008(&v40);
sub_774008(&v37);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v10);
v28 = v10->setPosition;
m_buttonMenu = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(
&v37,
(float)((float)(v32.width * 0.5) - (float)(a1->m_width * 0.5)) + 18.0,
(float)((float)(a1->m_height * 0.5) + (float)(v32.height * 0.5)) - 18.0);
cocos2d::CCNode::convertToNodeSpace(&v40.origin, m_buttonMenu, &v37);
v28(v10, &v40.origin);
cocos2d::CCPoint::CCPoint(&v33, (float)(v32.width * 0.5) - 65.0, (float)(v32.height * 0.5) + 82.0);
sub_776584((int)v36, "GroupID:");
cocos2d::CCPoint::CCPoint(&v37, -55.0, 0.0);
cocos2d::CCPoint::operator+(&v40, &v33, &v37);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
-1,
(int)v36,
&v40.origin,
(cocos2d::CCZone *)0x3F333333,
1,
Uint,
6,
1,
nullptr,
100.0,
0,
0,
0,
2,
0);
sub_774008(v36);
sub_776584((int)v36, "Count:");
cocos2d::CCPoint::CCPoint(&v37, 55.0, 0.0);
cocos2d::CCPoint::operator+(&v40, &v33, &v37);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
-2,
(int)v36,
&v40.origin,
(cocos2d::CCZone *)0x3F333333,
1,
Int,
6,
1,
nullptr,
100.0,
0,
0,
0,
2,
0);
sub_774008(v36);
v11 = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(&v37, 130.0, 0.0);
cocos2d::CCPoint::operator+(&v40, &v33, &v37);
cocos2d::CCNode::convertToNodeSpace(&v34, v11, &v40.origin);
v12 = 0;
while ( 1 )
{
v36[0] = SetupSequenceTriggerPopup::onAddChance;
v36[1] = 0;
sub_776584((int)&v31, "edit_addCBtn_001.png");
sub_776584((int)&v35, "GJ_button_01.png");
if ( v12 == 1 )
break;
if ( v12 > 1 )
{
sub_7753D4((int)&v31, "edit_upBtn_001.png");
v13 = "GJ_button_05.png";
v36[0] = SetupSequenceTriggerPopup::onChangeOrder;
goto LABEL_5;
}
LABEL_6:
v14 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v31);
v15 = (ButtonSprite *)v14;
if ( v12 == 2 || v12 == 3 )
((void (__fastcall *)(cocos2d::CCSprite *))v14->setRotation)(v14);
v16 = ButtonSprite::create(
v15,
(cocos2d::CCSprite *)&dword_20,
0,
32.0,
1.0,
(_BOOL4)&dword_0 + 1,
(char *)LODWORD(v35.x),
(const char *)&dword_0 + 1,
v26);
v17 = CCMenuItemSpriteExtra::create(v16, nullptr, (cocos2d::SEL_MenuHandler)__PAIR64__(v36[0], (unsigned int)a1));
((void (__fastcall *)(CCMenuItemSpriteExtra *, int))v17->setScale)(v17, 1058642330);
v18 = a1->m_buttonMenu;
v17->m_baseScale = 0.6;
v18->addChild(v18, v17);
v29 = v17->setPosition;
cocos2d::CCPoint::CCPoint(&v37, (float)v12 * 32.0, 0.0);
cocos2d::CCPoint::operator+(&v40, &v34, &v37);
v29(v17, &v40.origin);
v17->setTag(v17, v12);
sub_774008(&v35);
++v12;
sub_774008(&v31);
if ( v12 == 4 )
{
cocos2d::CCRect::CCRect(&v40, 0.0, 0.0, 80.0, 80.0);
v19 = (cocos2d::CCNode *)cocos2d::extension::CCScale9Sprite::create(
(cocos2d::extension::CCScale9Sprite *)"square02_001.png",
(const char *)&v40,
v41);
((void (__fastcall *)(cocos2d::CCNode *, int))v19->__vftable[1].~CCNode_0)(v19, 50);
setContentSize = v19->setContentSize;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v40, 370.0, 90.0);
setContentSize(v19, (const cocos2d::CCSize *)&v40);
a1->m_mainLayer->addChild_0(a1->m_mainLayer, v19, -1);
v21 = v19->setPosition;
cocos2d::CCPoint::CCPoint(&v40.origin, v32.width * 0.5, (float)(v32.height * 0.5) + 14.0);
v21(v19, &v40.origin);
cocos2d::CCPoint::CCPoint(&v35, v32.width * 0.5, (float)(v32.height * 0.5) - 50.0);
sub_776584((int)v36, "MinInt:");
cocos2d::CCPoint::CCPoint(&v37, -91.0, -0.0);
cocos2d::CCPoint::operator+(&v40, &v35, &v37);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
437,
(int)v36,
&v40.origin,
(cocos2d::CCZone *)0x3F266666,
0,
Float,
6,
0,
nullptr,
1.0,
0,
0,
1,
2,
0);
sub_774008(v36);
sub_776584((int)v36, "Reset:");
cocos2d::CCPoint::CCPoint(&v37, 91.0, -0.0);
cocos2d::CCPoint::operator+(&v40, &v35, &v37);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
438,
(int)v36,
&v40.origin,
(cocos2d::CCZone *)0x3F266666,
0,
Float,
6,
0,
nullptr,
1.0,
0,
0,
1,
2,
0);
sub_774008(v36);
cocos2d::CCPoint::CCPoint(&v40.origin, -25.0, -34.0);
cocos2d::CCPoint::operator+(v36, &v35, &v40);
v22 = (int)COERCE_FLOAT(((int (__fastcall *)(SetupSequenceTriggerPopup *, int))a1->getValue)(a1, 436));
v23 = (int)COERCE_FLOAT(((int (__fastcall *)(SetupSequenceTriggerPopup *, int))a1->getValue)(a1, 439));
sub_776584((int)&v31, "Mode\nStop");
cocos2d::CCPoint::CCPoint(&v37, -158.0, 0.0);
cocos2d::CCPoint::operator+(&v40, v36, &v37);
SetupTriggerPopup::createCustomToggleValueControl(
a1,
0,
v22 == 0,
1,
(std::string)&v31,
(cocos2d::CCPoint)(unsigned int)&v40,
0,
0);
sub_774008(&v31);
sub_776584((int)&v31, "Mode\nLoop");
cocos2d::CCPoint::CCPoint(&v37, -79.0, 0.0);
cocos2d::CCPoint::operator+(&v40, v36, &v37);
SetupTriggerPopup::createCustomToggleValueControl(
a1,
1,
v22 == 1,
1,
(std::string)&v31,
(cocos2d::CCPoint)(unsigned int)&v40,
0,
0);
sub_774008(&v31);
sub_776584((int)&v31, "Mode\nLast");
cocos2d::CCPoint::CCPoint(&v37, 0.0, 0.0);
cocos2d::CCPoint::operator+(&v40, v36, &v37);
SetupTriggerPopup::createCustomToggleValueControl(
a1,
2,
v22 == 2,
1,
(std::string)&v31,
(cocos2d::CCPoint)(unsigned int)&v40,
0,
0);
sub_774008(&v31);
sub_776584((int)&v31, "Reset\nFull");
cocos2d::CCPoint::CCPoint(&v37, 79.0, 0.0);
cocos2d::CCPoint::operator+(&v40, v36, &v37);
SetupTriggerPopup::createCustomToggleValueControl(
a1,
100,
v23 != 1,
1,
(std::string)&v31,
(cocos2d::CCPoint)(unsigned int)&v40,
0,
0);
sub_774008(&v31);
sub_776584((int)&v31, "Reset\nStep");
cocos2d::CCPoint::CCPoint(&v37, 158.0, 0.0);
cocos2d::CCPoint::operator+(&v40, v36, &v37);
SetupTriggerPopup::createCustomToggleValueControl(
a1,
101,
v23 == 1,
1,
(std::string)&v31,
(cocos2d::CCPoint)(unsigned int)&v40,
0,
0);
sub_774008(&v31);
sub_776584((int)&v37, "Unique\nRemap");
cocos2d::CCPoint::CCPoint(
&v40.origin,
(float)(v32.width * 0.5) + 55.0,
(float)((float)(v32.height * 0.5) - (float)(a1->m_height * 0.5)) + 20.0);
SetupTriggerPopup::createToggleValueControl(a1, 505, (int)&v37, &v40.origin, 0, 0, 0, 1.0);
sub_774008(&v37);
SetupTriggerPopup::createMultiTriggerItemsDefaultHorizontal(a1);
SetupSequenceTriggerPopup::updateGroupIDButtons(a1);
SetupTriggerPopup::postSetup(a1);
SetupTriggerPopup::updateValue(a1, -2, 1.0);
return v27;
}
}
sub_7753D4((int)&v31, "edit_delCBtn_001.png");
v13 = "GJ_button_06.png";
v36[0] = SetupSequenceTriggerPopup::onDeleteSelected;
LABEL_5:
sub_7753D4((int)&v35, v13);
goto LABEL_6;
}
return v27;
}