//
// SetupOpacityPopup::init from 0x1405bfce0 to 0x1405c07a9 (2761 bytes)
//
// 2 xrefs:
// > SetupOpacityPopup::create @ 0x1405bfc93
// > ??> @ 0x14092e0d0
//
// 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:47 +0000
//
// Hidden C++ exception states: #wind=3
char __fastcall SetupOpacityPopup::init(__int64 a1, int a2, int a3, int a4)
{
char result; // al
__int64 v6; // rcx
__int64 v7; // rax
cocos2d::CCObject *v8; // rbx
cocos2d::CCObject *v9; // rax
char *v10; // rsi
__int64 v11; // rdi
__int64 v12; // rbx
__int64 v13; // rax
__int64 v14; // rax
const struct cocos2d::CCPoint *v15; // rax
char *v16; // rbx
void *v17; // r8
__int64 v18; // rax
cocos2d::CCString *v19; // rax
const char *CString; // rax
size_t v21; // r8
struct cocos2d::CCLabelBMFont *v22; // rdi
__int64 v23; // rbx
__int64 v24; // rax
__int64 v25; // rax
_QWORD *v26; // rsi
__int64 v27; // rdx
void (__fastcall *v28)(_QWORD *, __int64); // r9
__int64 v29; // rax
__int64 v30; // rdx
__int64 v31; // rcx
const char *v32; // r8
char *v33; // rax
__int64 v34; // rdi
__int64 v35; // rbx
__int64 v36; // rax
__int64 v37; // rcx
__int64 v38; // rcx
__int64 v39; // rcx
__int64 v40; // rcx
__int64 v41; // r8
cocos2d::CCLayer *v42; // rax
__int64 v43; // rax
float v44; // xmm1_4
__int64 v45; // rcx
struct cocos2d::CCLabelBMFont *v46; // rax
__int64 v47; // rdi
__int64 v48; // rbx
__int64 v49; // rax
__int64 v50; // r8
cocos2d::CCLayer *v51; // rax
__int64 v52; // rax
__int64 v53; // rbx
__int64 v54; // rax
__int64 v55; // rcx
__int64 v56; // rsi
float Value; // xmm0_4
float v58; // xmm3_4
__int64 v59; // rdi
__int64 v60; // rbx
__int64 v61; // rax
void **v62; // [rsp+60h] [rbp-A0h] BYREF
float v63; // [rsp+68h] [rbp-98h] BYREF
float v64; // [rsp+6Ch] [rbp-94h]
_BYTE v65[8]; // [rsp+70h] [rbp-90h] BYREF
__int16 v66; // [rsp+78h] [rbp-88h]
_BYTE v67[8]; // [rsp+80h] [rbp-80h] BYREF
__int128 v68; // [rsp+88h] [rbp-78h] BYREF
__int64 v69; // [rsp+98h] [rbp-68h]
__int64 v70; // [rsp+A0h] [rbp-60h]
_BYTE v71[8]; // [rsp+A8h] [rbp-58h] BYREF
_BYTE v72[8]; // [rsp+B0h] [rbp-50h] BYREF
_BYTE v73[16]; // [rsp+B8h] [rbp-48h] BYREF
void *Block[2]; // [rsp+C8h] [rbp-38h] BYREF
__int64 v75; // [rsp+D8h] [rbp-28h]
unsigned __int64 v76; // [rsp+E0h] [rbp-20h]
result = SetupTriggerPopup::init(a1, a2, a3, a4, 1133576192, 1, 0);
if ( result )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1096LL))(a1);
v7 = cocos2d::CCDirector::sharedDirector(v6);
cocos2d::CCDirector::getWinSize(v7, &v63);
*(_OWORD *)Block = 0;
v75 = 0;
v76 = 0;
Block[0] = sub_14003D460(0x20u);
v75 = 20;
v76 = 31;
strcpy((char *)Block[0], "Setup Opacity Effect");
SetupTriggerPopup::addTitle(a1, Block);
v62 = (void **)operator new(0x2C8u);
v8 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite((__int64)v62);
if ( v8 )
{
if ( ButtonSprite::init_1(
(__int64)v8,
(__int64)"OK",
40,
0,
1061997773,
1,
"goldFont.fnt",
(__int64)"GJ_button_01.png",
1106247680) )
{
cocos2d::CCObject::autorelease(v8);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v8 + 8LL))(v8, 1);
LODWORD(v8) = 0;
}
}
v9 = CCMenuItemSpriteExtra::create((int)v8, 0, a1, (__int64)sub_14009D628);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v9);
v62 = Block;
*(_OWORD *)Block = 0;
v75 = 0;
v76 = 0;
Block[0] = sub_14003D460(0x90u);
v75 = 129;
v76 = 143;
strcpy(
(char *)Block[0],
"Changes the opacity of a group. If any objects in the group have a color channel with opacity, the values are multiplied.");
v68 = 0;
v69 = 4;
v70 = 15;
strcpy((char *)&v68, "Help");
v10 = InfoAlertButton::create((__int64)&v68, (__int64)Block);
(*(void (__fastcall **)(_QWORD, char *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v10);
v11 = *(_QWORD *)v10;
v12 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v62,
(float)((float)(v63 * 0.5) - (float)(*(float *)(a1 + 732) * 0.5)) + 18.0,
(float)((float)(*(float *)(a1 + 736) * 0.5) + (float)(v64 * 0.5)) - 18.0);
cocos2d::CCNode::convertToNodeSpace(v12, v65, v13);
(*(void (__fastcall **)(char *, __int64))(v11 + 184))(v10, v14);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v71, v63 * 0.5, (float)(v64 * 0.5) + 65.0);
Block[1] = nullptr;
v75 = 8;
v76 = 15;
Block[0] = (void *)0x44492070756F7247LL;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v65, (const struct cocos2d::CCPoint *)v71);
v16 = IDNameInput::create(a1, a1 + 544, 1, 3, (__int64)Block, v15, 1065353216, 6, 0, 0, 0);
if ( v76 > 0xF )
{
v17 = Block[0];
if ( v76 + 1 >= 0x1000 )
{
v17 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v17 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v17);
}
v75 = 0;
v76 = 15;
LOBYTE(Block[0]) = 0;
if ( v16 )
v18 = *((_QWORD *)v16 + 48);
else
v18 = 0;
*(_QWORD *)(a1 + 1000) = v18;
*(_BYTE *)(a1 + 744) = 1;
v19 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, *(unsigned int *)(a1 + 1048));
CString = cocos2d::CCString::getCString(v19);
v68 = 0;
v69 = 0;
v70 = 0;
v21 = -1;
do
++v21;
while ( CString[v21] );
sub_14003D230(&v68, CString, v21);
CCTextInputNode::setString(*(_QWORD **)(a1 + 1000), &v68);
*(_BYTE *)(a1 + 744) = 0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v67, v63 * 0.5, (float)(v64 * 0.5) + 20.0);
v22 = cocos2d::CCLabelBMFont::create("Fade Time: ", "goldFont.fnt");
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v22 + 160LL))(v22);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, _BYTE *))(*(_QWORD *)v22 + 184LL))(v22, v67);
v23 = *(_QWORD *)v22;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v65, 1.0, 0.5);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v23 + 288))(v22, v24);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v22);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v73, 0.0, 0.0, 40.0, 40.0);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)Block, (const struct cocos2d::CCRect *)v73);
v26 = (_QWORD *)cocos2d::extension::CCScale9Sprite::create("square02_small.png", v25);
v27 = v26[40];
v28 = *(void (__fastcall **)(_QWORD *, __int64))(v27 + 40);
LOBYTE(v27) = 100;
v28(v26 + 40, v27);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v72, 70.0, 30.0);
(*(void (__fastcall **)(_QWORD *, _BYTE *))(*v26 + 312LL))(v26, v72);
(*(void (__fastcall **)(_QWORD, _QWORD *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v26,
0xFFFFFFFFLL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v65, 45.0, 0.0);
cocos2d::CCPoint::operator+(v67, &v62, v29);
(*(void (__fastcall **)(_QWORD *, void ***))(*v26 + 184LL))(v26, &v62);
v32 = "Num";
if ( *(float *)(a1 + 1044) == -99999.0 )
v32 = "Mixed";
v33 = CCTextInputNode::create(v31, v30, (__int64)v32);
*(_QWORD *)(a1 + 1008) = v33;
(*(void (__fastcall **)(_QWORD, char *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v33, 20);
v34 = **(_QWORD **)(a1 + 1008);
v35 = *(_QWORD *)(a1 + 1008);
v36 = (*(__int64 (__fastcall **)(_QWORD *))(*v26 + 200LL))(v26);
(*(void (__fastcall **)(__int64, __int64))(v34 + 184))(v35, v36);
v37 = *(_QWORD *)(a1 + 1008);
*(_DWORD *)(v37 + 564) = 1058642330;
CCTextInputNode::refreshLabel(v37);
v38 = *(_QWORD *)(a1 + 1008);
*(_DWORD *)(v38 + 560) = 1128792064;
CCTextInputNode::refreshLabel(v38);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(*(_QWORD *)(a1 + 1008) + 592LL) + 336LL))(
*(_QWORD *)(*(_QWORD *)(a1 + 1008) + 592LL),
0);
*(_DWORD *)(*(_QWORD *)(a1 + 1008) + 608LL) = 4;
v75 = 11;
v76 = 15;
Block[0] = (void *)0x3736353433323130LL;
Block[1] = (void *)3029304;
CCTextInputNode::setAllowedChars(*(_QWORD *)(a1 + 1008), Block);
v66 = -21896;
v39 = *(_QWORD *)(a1 + 1008);
*(_WORD *)(v39 + 572) = -21896;
*(_BYTE *)(v39 + 574) = -16;
CCTextInputNode::refreshLabel(v39);
v40 = *(_QWORD *)(a1 + 1008);
*(_DWORD *)(v40 + 568) = 1056964608;
CCTextInputNode::refreshLabel(v40);
*(_BYTE *)(*(_QWORD *)(a1 + 1008) + 424LL) = 1;
*(_QWORD *)(*(_QWORD *)(a1 + 1008) + 600LL) = a1 + 544;
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 1008) + 64LL))(*(_QWORD *)(a1 + 1008), 4);
v42 = Slider::create(
a1,
(__int64)SetupOpacityPopup::sliderChanged,
v41,
"slidergroove.png",
(__int64)"sliderthumb.png",
(__int64)"sliderthumbsel.png",
0.80000001);
*(_QWORD *)(a1 + 1024) = v42;
(*(void (__fastcall **)(_QWORD, cocos2d::CCLayer *))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v42);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v65, 0.0, -32.0);
cocos2d::CCPoint::operator+(v67, &v62, v43);
(*(void (__fastcall **)(_QWORD, void ***))(**(_QWORD **)(a1 + 1024) + 184LL))(*(_QWORD *)(a1 + 1024), &v62);
v44 = fminf(1.0, *(float *)(a1 + 1044) / 10.0);
if ( v44 < 0.0 )
v44 = 0.0;
Slider::setValue(*(_QWORD *)(a1 + 1024), v44);
v45 = *(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 1024) + 408LL) + 456LL);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v45 + 64LL))(v45, 1);
SetupOpacityPopup::updateDurLabel(a1, 0);
v46 = cocos2d::CCLabelBMFont::create(" ", "goldFont.fnt");
*(_QWORD *)(a1 + 1016) = v46;
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v46);
v47 = **(_QWORD **)(a1 + 1016);
v48 = *(_QWORD *)(a1 + 1016);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v65, v63 * 0.5, (float)(v64 * 0.5) - 40.0);
(*(void (__fastcall **)(__int64, __int64))(v47 + 184))(v48, v49);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1016) + 160LL))(*(_QWORD *)(a1 + 1016));
v51 = Slider::create(
a1,
(__int64)SetupOpacityPopup::sliderChanged,
v50,
"slidergroove.png",
(__int64)"sliderthumb.png",
(__int64)"sliderthumbsel.png",
1.0);
*(_QWORD *)(a1 + 1032) = v51;
(*(void (__fastcall **)(_QWORD, cocos2d::CCLayer *))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v51);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v65, 0.0, -23.0);
v53 = v52;
v54 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 1016) + 200LL))(*(_QWORD *)(a1 + 1016));
cocos2d::CCPoint::operator+(v54, &v62, v53);
(*(void (__fastcall **)(_QWORD, void ***))(**(_QWORD **)(a1 + 1032) + 184LL))(*(_QWORD *)(a1 + 1032), &v62);
v55 = *(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 1032) + 408LL) + 456LL);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v55 + 64LL))(v55, 2);
SetupOpacityPopup::updateOpacityLabel(a1);
v56 = *(_QWORD *)(a1 + 1032);
SliderThumb::setValue(*(float **)(*(_QWORD *)(v56 + 408) + 456LL), *(float *)(a1 + 1040));
Value = SliderThumb::getValue(*(float **)(*(_QWORD *)(v56 + 408) + 456LL));
v58 = *(float *)(v56 + 432);
if ( (float)(Value * v58) <= v58 )
v58 = Value * v58;
v59 = **(_QWORD **)(v56 + 416);
v60 = *(_QWORD *)(v56 + 416);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)Block, 0.0, 0.0, v58, *(float *)(v56 + 436));
(*(void (__fastcall **)(__int64, __int64))(v59 + 992))(v60, v61);
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
*(_BYTE *)(a1 + 744) = 0;
return 1;
}
return result;
}