//
// SetupAnimationPopup::init from 0x1405a0510 to 0x1405a1258 (3400 bytes)
//
// 2 xrefs:
// > SetupAnimationPopup::create @ 0x1405a04ca
// > ??> @ 0x14092d3c8
//
// This function is hookable on this platform (idp: pc, 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 11:34:37 +0000
//
// Hidden C++ exception states: #wind=4
char __fastcall SetupAnimationPopup::init(__int64 a1, int a2, int a3, int a4)
{
char result; // al
__int64 v6; // rcx
__int64 v7; // rax
struct cocos2d::CCLabelBMFont *v8; // rdi
__int64 v9; // rbx
__int64 v10; // rax
cocos2d::CCObject *v11; // rbx
cocos2d::CCObject *v12; // rax
char v13; // di
int v14; // ebx
size_t v15; // r14
unsigned __int64 v16; // rax
__int64 v17; // rcx
void **v18; // r8
cocos2d::CCString *v19; // rax
char *CString; // rax
size_t v21; // r8
void *v22; // rcx
char v23; // di
unsigned int v24; // ebx
void **v25; // r8
cocos2d::CCString *v26; // rax
char *v27; // rax
size_t v28; // r8
char v29; // di
unsigned int v30; // ebx
void **v31; // r8
cocos2d::CCString *v32; // rax
char *v33; // rax
size_t v34; // r8
void **v35; // rdx
size_t v36; // r8
char *v37; // rsi
__int64 v38; // rdi
__int64 v39; // rbx
__int64 v40; // rax
__int64 v41; // rax
const struct cocos2d::CCPoint *v42; // rax
char *v43; // rbx
void *v44; // r8
__int64 v45; // rax
struct cocos2d::CCLabelBMFont *v46; // rbx
__int64 v47; // rax
__int64 v48; // rax
_QWORD *v49; // rdi
__int64 v50; // rdx
void (__fastcall *v51)(_QWORD *, __int64); // r8
__int64 v52; // rbx
__int64 v53; // rax
__int64 v54; // rdx
__int64 v55; // rcx
char *v56; // rax
__int64 v57; // rcx
__int64 v58; // rcx
__int64 v59; // rcx
__int64 v60; // rcx
struct cocos2d::CCSprite *v61; // rax
cocos2d::CCObject *v62; // rbx
__int64 v63; // rax
struct cocos2d::CCSprite *v64; // rax
cocos2d::CCObject *v65; // rbx
__int64 v66; // rax
cocos2d::CCString *v67; // rax
const char *v68; // rax
void *v69; // rcx
__int128 *v70; // [rsp+68h] [rbp-A0h] BYREF
float v71; // [rsp+70h] [rbp-98h] BYREF
float v72; // [rsp+74h] [rbp-94h]
_BYTE v73[8]; // [rsp+78h] [rbp-90h] BYREF
_BYTE v74[8]; // [rsp+80h] [rbp-88h] BYREF
_BYTE v75[8]; // [rsp+88h] [rbp-80h] BYREF
__int128 v76; // [rsp+90h] [rbp-78h] BYREF
__int64 v77; // [rsp+A0h] [rbp-68h]
__int64 v78; // [rsp+A8h] [rbp-60h]
void *Block[2]; // [rsp+B0h] [rbp-58h] BYREF
__int64 v80; // [rsp+C0h] [rbp-48h]
unsigned __int64 v81; // [rsp+C8h] [rbp-40h]
void *Src[2]; // [rsp+D0h] [rbp-38h] BYREF
__int64 v83; // [rsp+E0h] [rbp-28h]
unsigned __int64 v84; // [rsp+E8h] [rbp-20h]
result = SetupTriggerPopup::init(a1, a2, a3, a4, 1131413504, 1, 0);
if ( !result )
return result;
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1096LL))(a1);
v7 = cocos2d::CCDirector::sharedDirector(v6);
cocos2d::CCDirector::getWinSize(v7, &v71);
v8 = cocos2d::CCLabelBMFont::create("Setup Animation", "goldFont.fnt");
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v8);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v8 + 160LL))(v8);
v9 = *(_QWORD *)v8;
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v70,
v71 * 0.5,
(float)((float)(v72 * 0.5) + (float)(*(float *)(a1 + 736) * 0.5)) - 18.0);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v9 + 184))(v8, v10);
v70 = (__int128 *)operator new(0x2C8u);
v11 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite((__int64)v70);
if ( v11 )
{
if ( ButtonSprite::init_1(
(__int64)v11,
(__int64)"OK",
40,
0,
1061997773,
1,
"goldFont.fnt",
(__int64)"GJ_button_01.png",
1106247680) )
{
cocos2d::CCObject::autorelease(v11);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v11 + 8LL))(v11, 1);
LODWORD(v11) = 0;
}
}
v12 = CCMenuItemSpriteExtra::create((int)v11, 0, a1, (__int64)sub_14009D628);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v12);
*(_OWORD *)Src = 0;
Src[0] = sub_14003D460(0x90u);
v83 = 140;
v84 = 143;
strcpy(
(char *)Src[0],
"Animates certain objects. Can also be used to activate animate on trigger objects.\n"
"The Animation ID specifies the animation:");
sub_140044D80(Src, "\nBig Beast: ", 0x14u);
v13 = 1;
v14 = 0;
v15 = -1;
do
{
if ( !v14 )
{
*(_OWORD *)Block = 0;
v17 = 4;
strcpy((char *)Block, "bite");
goto LABEL_16;
}
if ( v14 == 1 )
{
Block[1] = nullptr;
v17 = 8;
Block[0] = (void *)0x31306B6361747461LL;
LABEL_16:
v16 = 15;
v81 = 15;
goto LABEL_17;
}
v16 = 15;
v81 = 15;
if ( v14 == 2 )
{
v17 = 12;
strcpy((char *)Block, "attack01_end");
BYTE5(Block[1]) = 0;
HIWORD(Block[1]) = 0;
}
else
{
*(_OWORD *)Block = 0;
if ( v14 == 3 )
{
v17 = 6;
strcpy((char *)Block, "idle01");
}
else
{
v17 = 0;
LOBYTE(Block[0]) = 0;
}
}
LABEL_17:
v80 = v17;
if ( v17 )
{
if ( v14 )
{
sub_140044D80(Src, ", ", 2u);
v16 = v81;
}
v18 = Block;
if ( v16 > 0xF )
v18 = (void **)Block[0];
v19 = cocos2d::CCString::createWithFormat("%i: %s", v14, (const char *)v18);
CString = (char *)cocos2d::CCString::getCString(v19);
v21 = -1;
do
++v21;
while ( CString[v21] );
sub_140044D80(Src, CString, v21);
++v14;
v16 = v81;
}
else
{
v13 = 0;
}
if ( v16 > 0xF )
{
v22 = Block[0];
if ( v16 + 1 >= 0x1000 )
{
v22 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v22 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v22);
}
}
while ( v13 );
sub_140044D80(Src, "\n\nBat: ", 0xFu);
v23 = 1;
v24 = 0;
do
{
AnimatedGameObject::animationForID(Block, v24, 1584);
if ( v80 )
{
if ( v24 )
sub_140044D80(Src, ", ", 2u);
v25 = Block;
if ( v81 > 0xF )
v25 = (void **)Block[0];
v26 = cocos2d::CCString::createWithFormat("%i: %s", v24, (const char *)v25);
v27 = (char *)cocos2d::CCString::getCString(v26);
v28 = -1;
do
++v28;
while ( v27[v28] );
sub_140044D80(Src, v27, v28);
++v24;
}
else
{
v23 = 0;
}
sub_14003D310((__int64)Block);
}
while ( v23 );
sub_140044D80(Src, "\n\nSpikeball: ", 0x15u);
v29 = 1;
v30 = 0;
do
{
AnimatedGameObject::animationForID(Block, v30, 2012);
if ( v80 )
{
if ( v30 )
sub_140044D80(Src, ", ", 2u);
v31 = Block;
if ( v81 > 0xF )
v31 = (void **)Block[0];
v32 = cocos2d::CCString::createWithFormat("%i: %s", v30, (const char *)v31);
v33 = (char *)cocos2d::CCString::getCString(v32);
v34 = -1;
do
++v34;
while ( v33[v34] );
sub_140044D80(Src, v33, v34);
++v30;
}
else
{
v29 = 0;
}
sub_14003D310((__int64)Block);
}
while ( v29 );
v70 = &v76;
v35 = Src;
if ( v84 > 0xF )
v35 = (void **)Src[0];
v76 = 0;
v77 = 0;
v78 = 0;
v36 = -1;
do
++v36;
while ( *((_BYTE *)v35 + v36) );
sub_14003D230(&v76, v35, v36);
*(_OWORD *)Block = 0;
v80 = 4;
v81 = 15;
strcpy((char *)Block, "Help");
v37 = InfoAlertButton::create((__int64)Block, (__int64)&v76);
(*(void (__fastcall **)(_QWORD, char *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v37);
v38 = *(_QWORD *)v37;
v39 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v70,
(float)((float)(v71 * 0.5) - (float)(*(float *)(a1 + 732) * 0.5)) + 18.0,
(float)((float)(*(float *)(a1 + 736) * 0.5) + (float)(v72 * 0.5)) - 18.0);
cocos2d::CCNode::convertToNodeSpace(v39, v73, v40);
(*(void (__fastcall **)(char *, __int64))(v38 + 184))(v37, v41);
Block[1] = nullptr;
v80 = 8;
v81 = 15;
Block[0] = (void *)0x44492070756F7247LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v73, v71 * 0.5, (float)(v72 * 0.5) + 40.0);
v43 = IDNameInput::create(a1, a1 + 544, 1, 0, (__int64)Block, v42, 1065353216, 6, 0, 0, 0);
if ( v81 > 0xF )
{
v44 = Block[0];
if ( v81 + 1 >= 0x1000 )
{
v44 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v44 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v44);
}
v80 = 0;
v81 = 15;
LOBYTE(Block[0]) = 0;
if ( v43 )
v45 = *((_QWORD *)v43 + 48);
else
v45 = 0;
*(_QWORD *)(a1 + 1000) = v45;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v74, v71 * 0.5, (float)(v72 * 0.5) - 25.0);
v46 = cocos2d::CCLabelBMFont::create("Animation ID", "goldFont.fnt");
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v46);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v46 + 160LL))(v46);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v73, 0.0, 30.0);
cocos2d::CCPoint::operator+(v74, &v70, v47);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int128 **))(*(_QWORD *)v46 + 184LL))(v46, &v70);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)Block, 0.0, 0.0, 40.0, 40.0);
v49 = (_QWORD *)cocos2d::extension::CCScale9Sprite::create("square02b_small.png", v48);
v50 = v49[40];
v51 = *(void (__fastcall **)(_QWORD *, __int64))(v50 + 40);
LOBYTE(v50) = 100;
v51(v49 + 40, v50);
LOWORD(v70) = 0;
BYTE2(v70) = 0;
(*(void (__fastcall **)(_QWORD *, __int128 **))v49[40])(v49 + 40, &v70);
v52 = *v49;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v73, 50.0, 30.0);
(*(void (__fastcall **)(_QWORD *, __int64))(v52 + 312))(v49, v53);
(*(void (__fastcall **)(_QWORD, _QWORD *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v49,
0xFFFFFFFFLL);
(*(void (__fastcall **)(_QWORD *, _BYTE *))(*v49 + 184LL))(v49, v74);
v56 = CCTextInputNode::create(v55, v54, (__int64)"Num");
*(_QWORD *)(a1 + 1008) = v56;
(*(void (__fastcall **)(_QWORD, char *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v56, 20);
(*(void (__fastcall **)(_QWORD, _BYTE *))(**(_QWORD **)(a1 + 1008) + 184LL))(*(_QWORD *)(a1 + 1008), v74);
v57 = *(_QWORD *)(a1 + 1008);
*(_DWORD *)(v57 + 564) = 1058642330;
CCTextInputNode::refreshLabel(v57);
v58 = *(_QWORD *)(a1 + 1008);
*(_DWORD *)(v58 + 560) = 1128792064;
CCTextInputNode::refreshLabel(v58);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(*(_QWORD *)(a1 + 1008) + 592LL) + 336LL))(
*(_QWORD *)(*(_QWORD *)(a1 + 1008) + 592LL),
0);
*(_DWORD *)(*(_QWORD *)(a1 + 1008) + 608LL) = 6;
v80 = 10;
v81 = 15;
Block[0] = *(void **)"0123456789";
Block[1] = (void *)*(unsigned __int16 *)"89";
BYTE2(Block[1]) = 0;
CCTextInputNode::setAllowedChars(*(_QWORD *)(a1 + 1008), Block);
LOWORD(v70) = -21896;
v59 = *(_QWORD *)(a1 + 1008);
*(_WORD *)(v59 + 572) = -21896;
*(_BYTE *)(v59 + 574) = -16;
CCTextInputNode::refreshLabel(v59);
v60 = *(_QWORD *)(a1 + 1008);
*(_DWORD *)(v60 + 568) = 1056964608;
CCTextInputNode::refreshLabel(v60);
*(_QWORD *)(*(_QWORD *)(a1 + 1008) + 600LL) = a1 + 544;
*(_BYTE *)(*(_QWORD *)(a1 + 1008) + 424LL) = 1;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 1008) + 64LL))(*(_QWORD *)(a1 + 1008), 1);
cocos2d::CCNode::convertToNodeSpace(*(_QWORD *)(a1 + 552), v75, v74);
v61 = cocos2d::CCSprite::createWithSpriteFrameName("edit_leftBtn_001.png");
LODWORD(v52) = (_DWORD)v61;
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v61 + 160LL))(v61);
v62 = CCMenuItemSpriteExtra::create(v52, 0, a1, (__int64)SetupAnimationPopup::onAnimationIDArrow);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v62);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v62 + 64LL))(v62, 1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v73, -50.0, 0.0);
cocos2d::CCPoint::operator+(v75, &v70, v63);
(*(void (__fastcall **)(cocos2d::CCObject *, __int128 **))(*(_QWORD *)v62 + 184LL))(v62, &v70);
*((_DWORD *)v62 + 93) = 0x40000000;
v64 = cocos2d::CCSprite::createWithSpriteFrameName("edit_rightBtn_001.png");
LODWORD(v62) = (_DWORD)v64;
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v64 + 160LL))(v64);
v65 = CCMenuItemSpriteExtra::create((int)v62, 0, a1, (__int64)SetupAnimationPopup::onAnimationIDArrow);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v65);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v65 + 64LL))(v65, 2);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v73, 50.0, 0.0);
cocos2d::CCPoint::operator+(v75, &v70, v66);
(*(void (__fastcall **)(cocos2d::CCObject *, __int128 **))(*(_QWORD *)v65 + 184LL))(v65, &v70);
*((_DWORD *)v65 + 93) = 0x40000000;
*(_BYTE *)(a1 + 744) = 1;
v67 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, *(unsigned int *)(a1 + 1016));
v68 = cocos2d::CCString::getCString(v67);
v76 = 0;
v77 = 0;
v78 = 0;
do
++v15;
while ( v68[v15] );
sub_14003D230(&v76, v68, v15);
CCTextInputNode::setString(*(_QWORD **)(a1 + 1000), &v76);
*(_BYTE *)(a1 + 744) = 0;
SetupAnimationPopup::updateAnimationTextInputLabel(a1);
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
*(_BYTE *)(a1 + 744) = 0;
if ( v84 > 0xF )
{
v69 = Src[0];
if ( v84 + 1 >= 0x1000 )
{
v69 = *((void **)Src[0] - 1);
if ( (unsigned __int64)((char *)Src[0] - (char *)v69 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v69);
}
return 1;
}