//
// SetupSequenceTriggerPopup::init from 0x140443440 to 0x140444644 (4612 bytes)
//
// 2 xrefs:
// > SetupSequenceTriggerPopup::create @ 0x140443401
// > ??> @ 0x1406da4cc
//
// 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
//
// Hidden C++ exception states: #wind=6
bool SetupSequenceTriggerPopup::init(SetupSequenceTriggerPopup *a1, SequenceTriggerGameObject *a2)
{
bool result; // al
__int64 v4; // rcx
cocos2d::CCArray *v5; // rax
__int64 v6; // rcx
cocos2d::CCDirector *v7; // rax
struct cocos2d::CCLabelBMFont *v8; // rdi
cocos2d::CCLabelBMFont_vtbl *v9; // rbx
const cocos2d::CCPoint *v10; // rax
ButtonSprite *v11; // rbx
CCMenuItemSpriteExtra *v12; // rax
_BYTE *v13; // rax
_BYTE *v14; // rcx
const char *v15; // rdx
__int64 v16; // r8
char *v17; // rdi
__int64 v18; // rbx
struct cocos2d::CCPoint v19; // rax
float v20; // xmm0_4
double ValueControlAdvanced; // xmm0_8
int i; // esi
void (*v23)(SetupSequenceTriggerPopup *, cocos2d::CCObject *); // r12
unsigned __int64 v24; // rdi
_BYTE *v25; // rbx
unsigned __int64 v26; // rcx
__int64 v27; // rbx
char *v28; // r14
void *v29; // rcx
unsigned __int64 v30; // rdi
_BYTE *v31; // rbx
unsigned __int64 v32; // rcx
__int64 v33; // rbx
_QWORD *v34; // rax
__int128 v35; // xmm0
unsigned __int64 v36; // rdi
_BYTE *v37; // rbx
unsigned __int64 v38; // rcx
__int64 v39; // rbx
char *v40; // r14
void *v41; // rcx
_BYTE *v42; // rbx
unsigned __int64 v43; // rcx
void *v44; // r14
void *v45; // rcx
void **v46; // rcx
struct cocos2d::CCSprite *v47; // rax
int v48; // r8d
cocos2d::CCSprite *v49; // rbx
void **v50; // rax
ButtonSprite *v51; // rax
CCMenuItemSpriteExtra *v52; // rbx
float v53; // xmm0_4
void *v54; // rcx
void *v55; // rcx
struct cocos2d::CCRect *v56; // rax
struct cocos2d::extension::CCScale9Sprite *v57; // rdi
__int64 v58; // rdx
cocos2d::extension::CCScale9Sprite_vtbl *v59; // rbx
const cocos2d::CCSize *v60; // rax
float v61; // xmm0_4
cocos2d::extension::CCScale9Sprite_vtbl *v62; // rbx
__int64 v63; // rax
float v64; // xmm0_4
double v65; // xmm0_8
double v66; // xmm0_8
int v67; // r8d
int v68; // r9d
int v69; // r8d
int v70; // r9d
int v71; // r8d
int v72; // r9d
int v73; // r8d
int v74; // r9d
int v75; // r8d
int v76; // r9d
int v77; // eax
_BOOL8 v78; // r8
bool v79; // [rsp+30h] [rbp-D8h]
__int64 v80; // [rsp+80h] [rbp-88h]
__int64 v81; // [rsp+80h] [rbp-88h]
ButtonSprite *v82; // [rsp+88h] [rbp-80h] BYREF
void **v83; // [rsp+90h] [rbp-78h] BYREF
float v84; // [rsp+98h] [rbp-70h]
float v85; // [rsp+9Ch] [rbp-6Ch]
char v86[8]; // [rsp+A0h] [rbp-68h] BYREF
char v87[8]; // [rsp+A8h] [rbp-60h] BYREF
char v88[8]; // [rsp+B0h] [rbp-58h] BYREF
__int128 v89; // [rsp+B8h] [rbp-50h] BYREF
__int64 v90; // [rsp+C8h] [rbp-40h]
__int64 v91; // [rsp+D0h] [rbp-38h]
struct cocos2d::CCPoint v92; // [rsp+D8h] [rbp-30h] BYREF
void *v93[2]; // [rsp+E0h] [rbp-28h] BYREF
__int64 v94; // [rsp+F0h] [rbp-18h]
unsigned __int64 v95; // [rsp+F8h] [rbp-10h]
void *v96[2]; // [rsp+100h] [rbp-8h] BYREF
__int64 v97; // [rsp+110h] [rbp+8h]
unsigned __int64 v98; // [rsp+118h] [rbp+10h]
result = SetupTriggerPopup::init(a1, a2, nullptr, 420.0, 300.0, 1);
if ( !result )
return result;
a1->m_disableTextDelegate = 1;
a1->determineStartValues(a1);
v5 = (cocos2d::CCArray *)cocos2d::CCArray::create(v4);
a1->m_groupButtons = v5;
cocos2d::CCObject::retain(v5);
v7 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v6);
cocos2d::CCDirector::getWinSize(v7);
v8 = cocos2d::CCLabelBMFont::create("Sequence Trigger", "goldFont.fnt");
a1->m_mainLayer->addChild_1(a1->m_mainLayer, v8);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v8->setScale_0)(v8);
v9 = v8->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v85 * 0.5, v84 * 0.5);
v9->setPosition_0(v8, v10);
v82 = (ButtonSprite *)operator new(0x2C0u);
v11 = ButtonSprite::ButtonSprite(v82);
if ( v11 )
{
if ( ButtonSprite::init_1(v11, "OK", 40, 0, 0.80000001, 1, "goldFont.fnt", "GJ_button_01.png", 30.0) )
{
cocos2d::CCObject::autorelease(v11);
}
else
{
((void (__fastcall *)(ButtonSprite *, __int64))v11->~ButtonSprite)(v11, 1);
v11 = nullptr;
}
}
v12 = CCMenuItemSpriteExtra::create(v11, nullptr, a1, (cocos2d::SEL_MenuHandler *)sub_14009BEF0);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v12);
v82 = (ButtonSprite *)v93;
*(_OWORD *)v93 = 0;
v94 = 0;
v95 = 15;
v13 = sub_14003AA10(0x1F0u);
v93[0] = v13;
v94 = 485;
v95 = 495;
v14 = v13;
v15 = "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.";
v16 = 3;
do
{
*(_OWORD *)v14 = *(_OWORD *)v15;
*((_OWORD *)v14 + 1) = *((_OWORD *)v15 + 1);
*((_OWORD *)v14 + 2) = *((_OWORD *)v15 + 2);
*((_OWORD *)v14 + 3) = *((_OWORD *)v15 + 3);
*((_OWORD *)v14 + 4) = *((_OWORD *)v15 + 4);
*((_OWORD *)v14 + 5) = *((_OWORD *)v15 + 5);
*((_OWORD *)v14 + 6) = *((_OWORD *)v15 + 6);
v14 += 128;
*((_OWORD *)v14 - 1) = *((_OWORD *)v15 + 7);
v15 += 128;
--v16;
}
while ( v16 );
*(_OWORD *)v14 = *(_OWORD *)v15;
*((_OWORD *)v14 + 1) = *((_OWORD *)v15 + 1);
*((_OWORD *)v14 + 2) = *((_OWORD *)v15 + 2);
*((_OWORD *)v14 + 3) = *((_OWORD *)v15 + 3);
*((_OWORD *)v14 + 4) = *((_OWORD *)v15 + 4);
*((_OWORD *)v14 + 5) = *((_OWORD *)v15 + 5);
*((_DWORD *)v14 + 24) = *((_DWORD *)v15 + 24);
v14[100] = v15[100];
v13[485] = 0;
v89 = 0;
v90 = 4;
v91 = 15;
strcpy((char *)&v89, "Help");
v17 = InfoAlertButton::create((__int64)&v89, (__int64)v93);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, (cocos2d::CCNode *)v17);
v18 = *(_QWORD *)v17;
cocos2d::CCPoint::CCPoint(a1->m_width * 0.5, (float)((float)(v84 * 0.5) - (float)(a1->m_width * 0.5)) + 18.0);
v19 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, (const struct cocos2d::CCPoint *)v96);
v20 = (*(float (__fastcall **)(char *, struct cocos2d::CCPoint))(v18 + 184))(v17, v19);
cocos2d::CCPoint::CCPoint(v20, (float)(v84 * 0.5) - 65.0);
v96[0] = &v89;
v90 = 8;
v91 = 15;
v89 = 0x3A444970756F7247uLL;
cocos2d::CCPoint::CCPoint(0.0, -55.0);
cocos2d::CCPoint::operator+(v87, &v82);
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
-1,
(unsigned int)&v89,
(unsigned int)&v82,
1060320051,
1,
3,
6,
1,
0,
1120403456,
0,
0,
0,
2,
0,
v82);
v83 = v93;
*(_OWORD *)v93 = 0;
v94 = 6;
v95 = 15;
strcpy((char *)v93, "Count:");
cocos2d::CCPoint::CCPoint(0.0, 55.0);
cocos2d::CCPoint::operator+(v87, &v82);
ValueControlAdvanced = SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
-2,
(unsigned int)v93,
(unsigned int)&v82,
1060320051,
1,
2,
6,
1,
0,
1120403456,
0,
0,
0,
2);
cocos2d::CCPoint::CCPoint(*(float *)&ValueControlAdvanced, 130.0);
cocos2d::CCPoint::operator+(v87, &v82);
cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v92);
for ( i = 0; i < 4; ++i )
{
v23 = SetupSequenceTriggerPopup::onAddChance;
*(_OWORD *)v93 = 0;
v94 = 0;
v95 = 15;
v93[0] = sub_14003AA10(0x20u);
v94 = 20;
v95 = 31;
strcpy((char *)v93[0], "edit_addCBtn_001.png");
*(_OWORD *)v96 = 0;
v97 = 0;
v98 = 15;
v96[0] = sub_14003AA10(0x20u);
v97 = 16;
v98 = 31;
strcpy((char *)v96[0], "GJ_button_01.png");
if ( i == 1 )
{
v24 = v95;
if ( v95 < 0x14 )
{
v26 = v95 >> 1;
if ( v95 <= 0x7FFFFFFFFFFFFFFFLL - (v95 >> 1) )
{
v27 = 31;
if ( v26 + v95 > 0x1F )
v27 = v26 + v95;
}
else
{
v27 = 0x7FFFFFFFFFFFFFFFLL;
}
v28 = (char *)sub_14003AA10(v27 + 1);
v94 = 20;
v95 = v27;
strcpy(v28, "edit_delCBtn_001.png");
if ( v24 > 0xF )
{
v29 = v93[0];
if ( v24 + 1 >= 0x1000 )
{
v29 = *((void **)v93[0] - 1);
if ( (unsigned __int64)((char *)v93[0] - (char *)v29 - 8) > 0x1F )
goto LABEL_70;
}
j_j_free(v29);
}
v93[0] = v28;
}
else
{
v25 = v93[0];
v94 = 20;
memmove(v93[0], "edit_delCBtn_001.png", 0x14u);
v25[20] = 0;
}
v23 = SetupSequenceTriggerPopup::onDeleteSelected;
v30 = v98;
if ( v98 >= 0x10 )
{
v31 = v96[0];
v97 = 16;
memmove(v96[0], "GJ_button_06.png", 0x10u);
v31[16] = 0;
goto LABEL_52;
}
v32 = v98 >> 1;
if ( v98 <= 0x7FFFFFFFFFFFFFFFLL - (v98 >> 1) )
{
v33 = 31;
if ( v98 + v32 > 0x1F )
v33 = v98 + v32;
}
else
{
v33 = 0x7FFFFFFFFFFFFFFFLL;
}
v34 = sub_14003AA10(v33 + 1);
v35 = *(_OWORD *)"GJ_button_06.png";
}
else
{
if ( i < 2 )
goto LABEL_52;
v36 = v95;
if ( v95 < 0x12 )
{
v38 = v95 >> 1;
if ( v95 <= 0x7FFFFFFFFFFFFFFFLL - (v95 >> 1) )
{
v39 = 31;
if ( v95 + v38 > 0x1F )
v39 = v95 + v38;
}
else
{
v39 = 0x7FFFFFFFFFFFFFFFLL;
}
v40 = (char *)sub_14003AA10(v39 + 1);
v94 = 18;
v95 = v39;
strcpy(v40, "edit_upBtn_001.png");
if ( v36 > 0xF )
{
v41 = v93[0];
if ( v36 + 1 >= 0x1000 )
{
v41 = *((void **)v93[0] - 1);
if ( (unsigned __int64)((char *)v93[0] - (char *)v41 - 8) > 0x1F )
LABEL_70:
invalid_parameter_noinfo_noreturn();
}
j_j_free(v41);
}
v93[0] = v40;
}
else
{
v37 = v93[0];
v94 = 18;
memmove(v93[0], "edit_upBtn_001.png", 0x12u);
v37[18] = 0;
}
v23 = SetupSequenceTriggerPopup::onChangeOrder;
v30 = v98;
if ( v98 >= 0x10 )
{
v42 = v96[0];
v97 = 16;
memmove(v96[0], "GJ_button_05.png", 0x10u);
v42[16] = 0;
goto LABEL_52;
}
v43 = v98 >> 1;
if ( v98 <= 0x7FFFFFFFFFFFFFFFLL - (v98 >> 1) )
{
v33 = 31;
if ( v43 + v98 > 0x1F )
v33 = v43 + v98;
}
else
{
v33 = 0x7FFFFFFFFFFFFFFFLL;
}
v34 = sub_14003AA10(v33 + 1);
v35 = *(_OWORD *)"GJ_button_05.png";
}
v97 = 16;
v98 = v33;
*(_OWORD *)v34 = v35;
*((_BYTE *)v34 + 16) = 0;
v44 = v34;
if ( v30 > 0xF )
{
v45 = v96[0];
if ( v30 + 1 >= 0x1000 )
{
v45 = *((void **)v96[0] - 1);
if ( (unsigned __int64)((char *)v96[0] - (char *)v45 - 8) > 0x1F )
goto LABEL_70;
}
j_j_free(v45);
}
v96[0] = v44;
LABEL_52:
v46 = v93;
if ( v95 > 0xF )
v46 = (void **)v93[0];
v47 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v46);
v49 = v47;
if ( i == 2 || i == 3 )
((void (__fastcall *)(struct cocos2d::CCSprite *))v47->setRotation)(v47);
v50 = v96;
if ( v98 > 0xF )
v50 = (void **)v96[0];
v51 = ButtonSprite::create(v49, 32, v48, 32.0, 1.0, v79, (const char *)v50, 1);
v52 = CCMenuItemSpriteExtra::create(v51, nullptr, a1, (cocos2d::SEL_MenuHandler *)v23);
((void (__fastcall *)(CCMenuItemSpriteExtra *))v52->setScale_0)(v52);
HIDWORD(v52->m_pDisabledImage) = 1058642330;
v53 = ((float (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild_1)(
a1->m_buttonMenu,
v52);
cocos2d::CCPoint::CCPoint(v53, (float)i * 32.0);
cocos2d::CCPoint::operator+(&v92, &v82);
v52->setPosition_0(v52, (const cocos2d::CCPoint *)&v82);
v52->setTag(v52, i);
if ( v98 > 0xF )
{
v54 = v96[0];
if ( v98 + 1 >= 0x1000 )
{
v54 = *((void **)v96[0] - 1);
if ( (unsigned __int64)((char *)v96[0] - (char *)v54 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v54);
}
v97 = 0;
v98 = 15;
LOBYTE(v96[0]) = 0;
if ( v95 > 0xF )
{
v55 = v93[0];
if ( v95 + 1 >= 0x1000 )
{
v55 = *((void **)v93[0] - 1);
if ( (unsigned __int64)((char *)v93[0] - (char *)v55 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v55);
}
}
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v96, 0.0, 0.0, 80.0, 80.0);
v57 = cocos2d::extension::CCScale9Sprite::create("square02_001.png", v56);
LOBYTE(v58) = 50;
v57->setOpacity(&v57->cocos2d::CCRGBAProtocol, v58);
v59 = v57->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v83, 370.0, 90.0);
v59->setContentSize(v57, v60);
v61 = ((float (__fastcall *)(cocos2d::CCLayer *, struct cocos2d::extension::CCScale9Sprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v57,
0xFFFFFFFFLL);
v62 = v57->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
cocos2d::CCPoint::CCPoint(v61, v84 * 0.5);
v64 = ((float (__fastcall *)(struct cocos2d::extension::CCScale9Sprite *, __int64))v62->setPosition_0)(v57, v63);
v65 = cocos2d::CCPoint::CCPoint(v64, v84 * 0.5);
v83 = v93;
v93[1] = nullptr;
v94 = 7;
v95 = 15;
v93[0] = (void *)0x3A746E496E694DLL;
cocos2d::CCPoint::CCPoint(*(float *)&v65, -91.0);
cocos2d::CCPoint::operator+(v88, &v82);
LOBYTE(v80) = 0;
SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
437,
(unsigned int)v93,
(unsigned int)&v82,
1059481190,
0,
1,
6,
0,
0,
1065353216,
0,
0,
1,
2,
v80);
v83 = v93;
*(_OWORD *)v93 = 0;
v94 = 6;
v95 = 15;
strcpy((char *)v93, "Reset:");
cocos2d::CCPoint::CCPoint(0.0, 91.0);
cocos2d::CCPoint::operator+(v88, &v82);
LOBYTE(v81) = 0;
v66 = SetupTriggerPopup::createValueControlAdvanced(
(_DWORD)a1,
438,
(unsigned int)v93,
(unsigned int)&v82,
1059481190,
0,
1,
6,
0,
0,
1065353216,
0,
0,
1,
2,
v81);
cocos2d::CCPoint::CCPoint(*(float *)&v66, -25.0);
cocos2d::CCPoint::operator+(v88, v86);
LODWORD(v62) = (int)a1->getValue(a1, 436);
LODWORD(v57) = (int)a1->getValue(a1, 439);
v83 = v93;
v93[1] = (void *)112;
v94 = 9;
v95 = 15;
v93[0] = (void *)0x6F74530A65646F4DLL;
cocos2d::CCPoint::CCPoint(6.7422043e22, -158.0);
cocos2d::CCPoint::operator+(v86, &v82);
LOBYTE(v67) = (_DWORD)v62 == 0;
SetupTriggerPopup::createCustomToggleValueControl((_DWORD)a1, 0, v67, v68, (__int64)v93, (__int64)&v82, 0, 0, 0);
v83 = v93;
v93[1] = (void *)112;
v94 = 9;
v95 = 15;
v93[0] = (void *)0x6F6F4C0A65646F4DLL;
cocos2d::CCPoint::CCPoint(6.7422043e22, -79.0);
cocos2d::CCPoint::operator+(v86, &v82);
LOBYTE(v69) = (_DWORD)v62 == 1;
SetupTriggerPopup::createCustomToggleValueControl((_DWORD)a1, 1, v69, v70, (__int64)v93, (__int64)&v82, 0, 0, 0);
v83 = v93;
v93[1] = (void *)116;
v94 = 9;
v95 = 15;
v93[0] = (void *)0x73614C0A65646F4DLL;
cocos2d::CCPoint::CCPoint(6.7422043e22, 0.0);
cocos2d::CCPoint::operator+(v86, &v82);
LOBYTE(v71) = (_DWORD)v62 == 2;
SetupTriggerPopup::createCustomToggleValueControl((_DWORD)a1, 2, v71, v72, (__int64)v93, (__int64)&v82, 0, 0, 0);
v83 = v93;
v93[1] = (void *)27756;
v94 = 10;
v95 = 15;
v93[0] = (void *)0x75460A7465736552LL;
cocos2d::CCPoint::CCPoint(7.1837755e22, 79.0);
cocos2d::CCPoint::operator+(v86, &v82);
LOBYTE(v73) = (_DWORD)v57 != 1;
SetupTriggerPopup::createCustomToggleValueControl((_DWORD)a1, 100, v73, v74, (__int64)v93, (__int64)&v82, 0, 0, 0);
v83 = v93;
v93[1] = (void *)28773;
v94 = 10;
v95 = 15;
v93[0] = (void *)0x74530A7465736552LL;
cocos2d::CCPoint::CCPoint(7.1837755e22, 158.0);
cocos2d::CCPoint::operator+(v86, &v82);
LOBYTE(v75) = (_DWORD)v57 == 1;
SetupTriggerPopup::createCustomToggleValueControl((_DWORD)a1, 101, v75, v76, (__int64)v93, (__int64)&v82, 0, 0, 0);
v83 = v93;
v94 = 12;
v95 = 15;
strcpy((char *)v93, "Unique\nRemap");
BYTE5(v93[1]) = 0;
HIWORD(v93[1]) = 0;
cocos2d::CCPoint::CCPoint(a1->m_height * 0.5, (float)(v84 * 0.5) + 55.0);
SetupTriggerPopup::createToggleValueControl((_DWORD)a1, 505, (unsigned int)v93, v77, 0, 0, 0, 1065353216);
SetupTriggerPopup::createMultiTriggerItemsDefaultHorizontal(a1);
SetupSequenceTriggerPopup::updateGroupIDButtons(a1);
a1->updateDefaultTriggerValues(a1);
a1->m_disableTextDelegate = 0;
if ( cocos2d::CCDictionary::objectForKey(a1->m_valueToggles, -2) )
{
LOBYTE(v78) = 1;
a1->updateToggleItem(a1, -2, v78);
}
else
{
SetupTriggerPopup::updateValueControls(a1, -2, 1.0);
}
SetupTriggerPopup::valueChanged(a1, -2, 1.0);
return 1;
}