//
// SetupGradientPopup::init from 0x9fa3d4 to 0x9fb5f0 (4636 bytes)
//
// 2 xrefs:
// > SetupGradientPopup::create @ 0x9fb7e8
// > ??> @ 0x6e340
//
// 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 SetupGradientPopup::init(SetupGradientPopup *a1, GradientTriggerObject *a2, cocos2d::CCArray *a3)
{
cocos2d::CCDirector *v5; // x0
cocos2d::CCPoint *p_m_textOffset; // x0
const char *v7; // x6
cocos2d::CCPoint *v8; // x0
void *v9; // x0
cocos2d::CCNode *v10; // x0
CCMenuItemSpriteExtra *v11; // x0
float v12; // s3
float v13; // s4
cocos2d::CCPoint *v14; // x0
float v15; // s3
float v16; // s4
cocos2d::CCPoint *v17; // x0
float v18; // s3
float v19; // s4
cocos2d::CCPoint *v20; // x0
float v21; // s3
float v22; // s4
cocos2d::CCArray *v23; // x0
cocos2d::CCArray *v24; // x0
int v25; // w19
cocos2d::CCLabelBMFont *v26; // x27
void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // x28
float v28; // s0
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x28
cocos2d::CCPoint *v30; // x0
cocos2d::CCPoint *v31; // x19
void *v32; // x0
cocos2d::CCPoint *v33; // x0
float v34; // s3
float v35; // s4
cocos2d::CCPoint *v36; // x0
float v37; // s3
float v38; // s4
cocos2d::CCPoint *v39; // x0
long double v40; // q0
cocos2d::CCPoint *v41; // x0
unsigned int v42; // w19
cocos2d::CCLabelBMFont *v43; // x27
cocos2d::CCLabelBMFont *v44; // x0
cocos2d::CCLayer *m_mainLayer; // x3
cocos2d::CCLabelBMFont *m_blendingLabel; // x28
cocos2d::CCLabelBMFont *v47; // x0
const cocos2d::CCPoint *(__fastcall *getPosition)(cocos2d::CCNode *__hidden); // x1
void (__fastcall *v49)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x27
cocos2d::CCSprite *v50; // x27
CCMenuItemSpriteExtra *v51; // x27
cocos2d::CCLabelBMFont *v52; // x0
cocos2d::CCMenu *m_buttonMenu; // x4
cocos2d::CCLabelBMFont_vtbl *v54; // x1
const cocos2d::CCPoint *(__fastcall *v55)(cocos2d::CCNode *__hidden); // x1
cocos2d::CCSprite *v56; // x28
CCMenuItemSpriteExtra *v57; // x27
CCMenuItemSpriteExtra_vtbl *v58; // x2
cocos2d::CCLabelBMFont *v59; // x0
cocos2d::CCLabelBMFont_vtbl *v60; // x1
void (__fastcall *v61)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x28
cocos2d::CCArray *v62; // x0
cocos2d::CCArray *v63; // x0
cocos2d::CCArray *v64; // x0
int v65; // w1
const char *v66; // x6
cocos2d::CCNode *v67; // x26
cocos2d::CCPoint *v68; // x0
CCMenuItemSpriteExtra *v69; // x27
cocos2d::CCMenu *v70; // x19
cocos2d::CCMenu *v71; // x19
unsigned int *v72; // x1
int v73; // w2
unsigned int *v74; // x1
int v75; // w2
unsigned int *p_m_caption; // x1
int m_data; // w2
unsigned int *v78; // x1
int v79; // w2
unsigned int *v80; // x1
int v81; // w2
unsigned int *v82; // x1
int v83; // w2
unsigned int *v84; // x1
int v85; // w2
unsigned int *v86; // x1
int v87; // w2
unsigned int *v88; // x1
int v89; // w2
unsigned int *v90; // x1
int v91; // w2
unsigned int *v92; // x1
int v93; // w2
unsigned int *v94; // x1
int v95; // w2
unsigned int *v96; // x1
int v97; // w2
unsigned int *v98; // x1
int v99; // w2
cocos2d::CCPoint *v100[2]; // [xsp+30h] [xbp+0h] BYREF
cocos2d::CCPoint *v101; // [xsp+C0h] [xbp+90h]
bool v102; // [xsp+CFh] [xbp+9Fh]
cocos2d::CCArray *v103; // [xsp+D0h] [xbp+A0h]
cocos2d::CCArray *v104; // [xsp+D8h] [xbp+A8h]
float v105; // [xsp+F0h] [xbp+C0h]
float v106; // [xsp+F4h] [xbp+C4h]
cocos2d::CCPoint v107; // [xsp+F8h] [xbp+C8h] BYREF
char v108; // [xsp+100h] [xbp+D0h] BYREF
cocos2d::CCPoint v109; // [xsp+108h] [xbp+D8h] BYREF
cocos2d::CCPoint v110; // [xsp+110h] [xbp+E0h] BYREF
cocos2d::CCPoint v111; // [xsp+118h] [xbp+E8h] BYREF
ButtonSprite *v112; // [xsp+120h] [xbp+F0h] BYREF
cocos2d::CCPoint v113; // 0:kr08_8.8
cocos2d::CCPoint v114; // 0:kr10_8.8
cocos2d::SEL_MenuHandler v115; // 0:x2.16
cocos2d::SEL_MenuHandler v116; // 0:x2.16
cocos2d::SEL_MenuHandler v117; // 0:x2.16
cocos2d::SEL_MenuHandler v118; // 0:x2.16
cocos2d::CCPoint v119; // 0:s0.4,4:s1.4
cocos2d::CCPoint v120; // 0:s0.4,4:s1.4
cocos2d::CCPoint v121; // 0:s0.4,4:s1.4
cocos2d::CCPoint v122; // 0:s0.4,4:s1.4
cocos2d::CCPoint v123; // 0:s0.4,4:s1.4
cocos2d::CCPoint v124; // 0:s0.4,4:s1.4
cocos2d::CCPoint v125; // 0:s1.4,4:s2.4
cocos2d::CCPoint v126; // 0:s1.4,4:s2.4
v102 = SetupTriggerPopup::init(a1, a2, a3, 420.0, 290.0, 1);
if ( v102 )
{
a1->determineStartValues(a1);
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v5);
sub_D153B8((unsigned int)v100 + 240, "Setup Gradient Effect");
SetupTriggerPopup::addTitle((__int64)a1);
p_m_textOffset = &v112[-1].m_textOffset;
if ( &v112[-1].m_textOffset != (cocos2d::CCPoint *)&qword_124B6B0 )
{
if ( &pthread_create )
{
p_m_caption = (unsigned int *)&v112[-1].m_caption;
do
m_data = __ldaxr(p_m_caption);
while ( __stlxr(m_data - 1, p_m_caption) );
}
else
{
m_data = (int)v112[-1].m_caption.m_data.m_data;
LODWORD(v112[-1].m_caption.m_data.m_data) = m_data - 1;
}
if ( m_data <= 0 )
operator delete(p_m_textOffset);
}
v101 = (cocos2d::CCPoint *)&v108;
sub_D153B8((int)&v111, "Help");
sub_D153B8(
(unsigned int)v100 + 240,
"Creates a gradient with set colors in a given area.\n"
"U, D, L, and R must be set to a group at each side of the area.\n"
"Use Vertex Mode to set corners of the area instead.\n"
"Blending changes the gradient method.\n"
"Use ID to give a gradient a unique identifier that can be used to disable it with another of these triggers.");
SetupTriggerPopup::addHelpButton((__int64)a1, 1.0);
v8 = &v112[-1].m_textOffset;
if ( &v112[-1].m_textOffset != (cocos2d::CCPoint *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v84 = (unsigned int *)&v112[-1].m_caption;
do
v85 = __ldaxr(v84);
while ( __stlxr(v85 - 1, v84) );
}
else
{
v85 = (int)v112[-1].m_caption.m_data.m_data;
LODWORD(v112[-1].m_caption.m_data.m_data) = v85 - 1;
}
if ( v85 <= 0 )
operator delete(v8);
}
v9 = (void *)(*(_QWORD *)&v111 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v111 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v80 = (unsigned int *)(*(_QWORD *)&v111 - 8LL);
do
v81 = __ldaxr(v80);
while ( __stlxr(v81 - 1, v80) );
}
else
{
v81 = *(_DWORD *)(*(_QWORD *)&v111 - 8LL);
*(_DWORD *)(*(_QWORD *)&v111 - 8LL) = v81 - 1;
}
if ( v81 <= 0 )
operator delete(v9);
}
v10 = (cocos2d::CCNode *)ButtonSprite::create(
(ButtonSprite *)"OK",
(const char *)&qword_28,
0,
1,
0.8,
"goldFont.fnt",
"GJ_button_01.png",
v7,
30.0);
v115.adj = 1320;
v115.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v11 = CCMenuItemSpriteExtra::create(v10, nullptr, v115);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v11);
cocos2d::CCPoint::CCPoint(&v107, (float)(v105 * 0.5) + -20.0, (float)(v106 * 0.5) + 90.0);
sub_D153B8((unsigned int)v100 + 240, " ");
cocos2d::CCPoint::CCPoint(&v110, -135.0, 0.0);
cocos2d::CCPoint::operator+(&v111, &v107, &v110);
v119.y = 0.0;
v119.x = 0.7;
SetupTriggerPopup::createValueControlAdvanced(
a1,
0xCBu,
v119,
0.0,
v12,
v13,
(std::string)&v112,
&v111,
Float,
Int,
5,
0,
0,
0,
0,
2,
0);
v14 = &v112[-1].m_textOffset;
if ( &v112[-1].m_textOffset != (cocos2d::CCPoint *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v88 = (unsigned int *)&v112[-1].m_caption;
do
v89 = __ldaxr(v88);
while ( __stlxr(v89 - 1, v88) );
}
else
{
v89 = (int)v112[-1].m_caption.m_data.m_data;
LODWORD(v112[-1].m_caption.m_data.m_data) = v89 - 1;
}
if ( v89 <= 0 )
operator delete(v14);
}
sub_D153B8((unsigned int)v100 + 240, " ");
cocos2d::CCPoint::CCPoint(&v110, -45.0, 0.0);
cocos2d::CCPoint::operator+(&v111, &v107, &v110);
v120.y = 0.0;
v120.x = 0.7;
SetupTriggerPopup::createValueControlAdvanced(
a1,
0xCCu,
v120,
0.0,
v15,
v16,
(std::string)&v112,
&v111,
Float,
Int,
5,
0,
0,
0,
0,
2,
0);
v17 = &v112[-1].m_textOffset;
if ( &v112[-1].m_textOffset != (cocos2d::CCPoint *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v78 = (unsigned int *)&v112[-1].m_caption;
do
v79 = __ldaxr(v78);
while ( __stlxr(v79 - 1, v78) );
}
else
{
v79 = (int)v112[-1].m_caption.m_data.m_data;
LODWORD(v112[-1].m_caption.m_data.m_data) = v79 - 1;
}
if ( v79 <= 0 )
operator delete(v17);
}
sub_D153B8((unsigned int)v100 + 240, " ");
cocos2d::CCPoint::CCPoint(&v110, 45.0, 0.0);
cocos2d::CCPoint::operator+(&v111, &v107, &v110);
v121.y = 0.0;
v121.x = 0.7;
SetupTriggerPopup::createValueControlAdvanced(
a1,
0xCDu,
v121,
0.0,
v18,
v19,
(std::string)&v112,
&v111,
Float,
Int,
5,
0,
0,
0,
0,
2,
0);
v20 = &v112[-1].m_textOffset;
if ( &v112[-1].m_textOffset != (cocos2d::CCPoint *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v92 = (unsigned int *)&v112[-1].m_caption;
do
v93 = __ldaxr(v92);
while ( __stlxr(v93 - 1, v92) );
}
else
{
v93 = (int)v112[-1].m_caption.m_data.m_data;
LODWORD(v112[-1].m_caption.m_data.m_data) = v93 - 1;
}
if ( v93 <= 0 )
operator delete(v20);
}
sub_D153B8((unsigned int)v100 + 240, " ");
cocos2d::CCPoint::CCPoint(&v110, 135.0, 0.0);
cocos2d::CCPoint::operator+(&v111, &v107, &v110);
v122.y = 0.0;
v122.x = 0.7;
SetupTriggerPopup::createValueControlAdvanced(
a1,
0xCEu,
v122,
0.0,
v21,
v22,
(std::string)&v112,
&v111,
Float,
Int,
5,
0,
0,
0,
0,
2,
0);
v23 = (cocos2d::CCArray *)&v112[-1].m_textOffset;
if ( &v112[-1].m_textOffset != (cocos2d::CCPoint *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v86 = (unsigned int *)&v112[-1].m_caption;
do
v87 = __ldaxr(v86);
while ( __stlxr(v87 - 1, v86) );
}
else
{
v87 = (int)v112[-1].m_caption.m_data.m_data;
LODWORD(v112[-1].m_caption.m_data.m_data) = v87 - 1;
}
if ( v87 <= 0 )
operator delete(v23);
}
v24 = (cocos2d::CCArray *)cocos2d::CCArray::create(v23);
a1->m_gradientLabels = v24;
v25 = 0;
v104 = (cocos2d::CCArray *)" ";
v103 = (cocos2d::CCArray *)"goldFont.fnt";
cocos2d::CCObject::retain(v24);
do
{
v26 = cocos2d::CCLabelBMFont::create();
setAnchorPoint = v26->setAnchorPoint;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v112, 1.0, 0.5);
setAnchorPoint(v26, (const cocos2d::CCPoint *)&v112);
a1->m_mainLayer->addChild(a1->m_mainLayer, v26);
v26->setScale(v26, 0.5);
v28 = (float)v25++;
setPosition = v26->setPosition;
cocos2d::CCPoint::CCPoint(&v111, (float)(v28 - 1.5) * 90.0, 0.0);
cocos2d::CCPoint::operator+(&v112, &v107, &v111);
setPosition(v26, (const cocos2d::CCPoint *)&v112);
cocos2d::CCArray::addObject(a1->m_gradientLabels, v26);
}
while ( v25 != 4 );
SetupGradientPopup::updateGradientLabels(a1, 0);
sub_D153B8((unsigned int)v100 + 240, "Vertex\nMode");
cocos2d::CCPoint::CCPoint(
&v111,
(float)((float)(a1->m_width * 0.5) + (float)(v105 * 0.5)) - 72.0,
(float)((float)(a1->m_height * 0.5) + (float)(v106 * 0.5)) - 20.0);
SetupTriggerPopup::createToggleValueControl(a1, 207, 1.0, (__int64)&v112, &v111, 0, 0, 0);
v30 = &v112[-1].m_textOffset;
if ( &v112[-1].m_textOffset != (cocos2d::CCPoint *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v96 = (unsigned int *)&v112[-1].m_caption;
do
v97 = __ldaxr(v96);
while ( __stlxr(v97 - 1, v96) );
}
else
{
v97 = (int)v112[-1].m_caption.m_data.m_data;
LODWORD(v112[-1].m_caption.m_data.m_data) = v97 - 1;
}
if ( v97 <= 0 )
operator delete(v30);
}
v31 = v101;
cocos2d::CCPoint::CCPoint(v101, (float)(v105 * 0.5) + 145.0, (float)(v106 * 0.5) + 40.0);
sub_D153B8((int)&v111, "Disable");
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v112, v31);
SetupTriggerPopup::createToggleValueControl(a1, 208, 0.8, (__int64)&v111, (const cocos2d::CCPoint *)&v112, 0, 0, 0);
v32 = (void *)(*(_QWORD *)&v111 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v111 - 24LL) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v82 = (unsigned int *)(*(_QWORD *)&v111 - 8LL);
do
v83 = __ldaxr(v82);
while ( __stlxr(v83 - 1, v82) );
}
else
{
v83 = *(_DWORD *)(*(_QWORD *)&v111 - 8LL);
*(_DWORD *)(*(_QWORD *)&v111 - 8LL) = v83 - 1;
}
if ( v83 <= 0 )
operator delete(v32);
}
sub_D153B8((unsigned int)v100 + 240, "Disable\nAll");
cocos2d::CCPoint::CCPoint(&v110, 0.0, -25.0);
cocos2d::CCPoint::operator+(&v111, v101, &v110);
SetupTriggerPopup::createToggleValueControl(a1, 508, 0.8, (__int64)&v112, &v111, 0, 0, 0);
v33 = &v112[-1].m_textOffset;
if ( &v112[-1].m_textOffset != (cocos2d::CCPoint *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v94 = (unsigned int *)&v112[-1].m_caption;
do
v95 = __ldaxr(v94);
while ( __stlxr(v95 - 1, v94) );
}
else
{
v95 = (int)v112[-1].m_caption.m_data.m_data;
LODWORD(v112[-1].m_caption.m_data.m_data) = v95 - 1;
}
if ( v95 <= 0 )
operator delete(v33);
}
sub_D153B8((unsigned int)v100 + 240, "Preview\nOpacity");
cocos2d::CCPoint::CCPoint(
&v111,
(float)((float)(a1->m_width * 0.5) + (float)(v105 * 0.5)) - 72.0,
40.0 - (float)((float)(a1->m_height * 0.5) - (float)(v106 * 0.5)));
v123.y = 0.0;
v123.x = 0.65;
SetupTriggerPopup::createValueControlAdvanced(
a1,
0x1C8u,
v123,
0.0,
v34,
v35,
(std::string)&v112,
&v111,
(InputValueType)0,
Float,
5,
0,
0,
0,
0,
2,
0);
v36 = &v112[-1].m_textOffset;
if ( &v112[-1].m_textOffset != (cocos2d::CCPoint *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v90 = (unsigned int *)&v112[-1].m_caption;
do
v91 = __ldaxr(v90);
while ( __stlxr(v91 - 1, v90) );
}
else
{
v91 = (int)v112[-1].m_caption.m_data.m_data;
LODWORD(v112[-1].m_caption.m_data.m_data) = v91 - 1;
}
if ( v91 <= 0 )
operator delete(v36);
}
cocos2d::CCPoint::CCPoint(&v109, (float)(v105 * 0.5) + -20.0, (float)(v106 * 0.5) + 60.0);
sub_D153B8((unsigned int)v100 + 240, "ID");
cocos2d::CCPoint::CCPoint(&v110, 75.0, -25.0);
cocos2d::CCPoint::operator+(&v111, &v109, &v110);
v124.y = 0.0;
v124.x = 0.7;
SetupTriggerPopup::createValueControlAdvanced(
a1,
0xD1u,
v124,
0.0,
v37,
v38,
(std::string)&v112,
&v111,
Float,
Int,
3,
1u,
0,
0,
0,
2,
0);
v39 = &v112[-1].m_textOffset;
if ( &v112[-1].m_textOffset != (cocos2d::CCPoint *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v98 = (unsigned int *)&v112[-1].m_caption;
do
v99 = __ldaxr(v98);
while ( __stlxr(v99 - 1, v98) );
}
else
{
v99 = (int)v112[-1].m_caption.m_data.m_data;
LODWORD(v112[-1].m_caption.m_data.m_data) = v99 - 1;
}
if ( v99 <= 0 )
operator delete(v39);
}
cocos2d::CCPoint::CCPoint(&v110, 95.0, 0.0);
cocos2d::CCPoint::operator+(&v111, &v109, &v110);
sub_D153B8((int)&v112, &byte_F288A0);
LODWORD(v40) = 1061997773;
SetupTriggerPopup::createPlusButton(a1, 209, &v111, (const char **)&v112, 0, 0, v40);
v41 = &v112[-1].m_textOffset;
if ( &v112[-1].m_textOffset != (cocos2d::CCPoint *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v74 = (unsigned int *)&v112[-1].m_caption;
do
v75 = __ldaxr(v74);
while ( __stlxr(v75 - 1, v74) );
}
else
{
v75 = (int)v112[-1].m_caption.m_data.m_data;
LODWORD(v112[-1].m_caption.m_data.m_data) = v75 - 1;
}
if ( v75 <= 0 )
operator delete(v41);
}
v42 = 1;
v43 = cocos2d::CCLabelBMFont::create();
v104 = (cocos2d::CCArray *)v43->setPosition;
cocos2d::CCPoint::CCPoint(&v111, -85.0, 0.0);
cocos2d::CCPoint::operator+(&v112, &v109, &v111);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, ButtonSprite **))v104)(v43, &v112);
a1->m_mainLayer->addChild(a1->m_mainLayer, v43);
v43->setScale(v43, 0.6);
v44 = cocos2d::CCLabelBMFont::create();
m_mainLayer = a1->m_mainLayer;
a1->m_blendingLabel = v44;
m_mainLayer->addChild(m_mainLayer, v44);
m_blendingLabel = a1->m_blendingLabel;
v47 = v43;
getPosition = v43->getPosition;
v49 = m_blendingLabel->setPosition;
v104 = (cocos2d::CCArray *)getPosition(v47);
cocos2d::CCPoint::CCPoint(&v111, 0.0, -25.0);
cocos2d::CCPoint::operator+(&v112, v104, &v111);
v49(m_blendingLabel, (const cocos2d::CCPoint *)&v112);
a1->m_blendingLabel->setScale(a1->m_blendingLabel, 0.5);
SetupGradientPopup::updateBlendingLabel(a1);
v50 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
cocos2d::CCSprite::setFlipX(v50, 1);
v50->setScale(v50, 0.6);
v116.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v116.adj = (size_t)SetupGradientPopup::onBlending;
v51 = CCMenuItemSpriteExtra::create(v50, nullptr, v116);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v51);
v52 = a1->m_blendingLabel;
m_buttonMenu = a1->m_buttonMenu;
v54 = v52->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v103 = (cocos2d::CCArray *)v51->setPosition;
v55 = v54->getPosition;
v101 = (cocos2d::CCPoint *)m_buttonMenu;
v104 = (cocos2d::CCArray *)v55(v52);
cocos2d::CCPoint::CCPoint(&v110, 75.0, 0.0);
cocos2d::CCPoint::operator+(&v111, v104, &v110);
v113 = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v101, &v111);
((void (__fastcall *)(CCMenuItemSpriteExtra *, ButtonSprite **, float, float))v103)(v51, &v112, v113.x, v113.y);
CCMenuItemSpriteExtra::setSizeMult(v51, 1.4);
v51->setTag(v51, 1);
v56 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v56->setScale(v56, 0.6);
v117.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v117.adj = (size_t)SetupGradientPopup::onBlending;
v57 = CCMenuItemSpriteExtra::create(v56, nullptr, v117);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v57);
v58 = v57->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v59 = a1->m_blendingLabel;
v60 = v59->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v103 = (cocos2d::CCArray *)a1->m_buttonMenu;
v61 = v58->setPosition;
v104 = (cocos2d::CCArray *)v60->getPosition(v59);
cocos2d::CCPoint::CCPoint(&v110, -75.0, 0.0);
cocos2d::CCPoint::operator+(&v111, v104, &v110);
v114 = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v103, &v111);
((void (__fastcall *)(CCMenuItemSpriteExtra *, ButtonSprite **, float, float))v61)(v57, &v112, v114.x, v114.y);
CCMenuItemSpriteExtra::setSizeMult(v57, 1.4);
v57->setTag(v57, 0);
SetupTriggerPopup::createMultiTriggerItemsCorner(a1);
v63 = (cocos2d::CCArray *)cocos2d::CCArray::create(v62);
a1->m_layerButtons = v63;
cocos2d::CCObject::retain(v63);
v103 = (cocos2d::CCArray *)cocos2d::CCArray::create(v64);
v104 = (cocos2d::CCArray *)cocos2d::CCArray::create(v103);
do
{
while ( 1 )
{
SetupShaderEffectPopup::zLayerToString((SetupShaderEffectPopup *)v42, v65);
v67 = (cocos2d::CCNode *)ButtonSprite::create(
v112,
(const char *)&qword_D8 + 4,
0,
0,
0.3,
"bigFont.fnt",
"GJ_button_04.png",
v66,
25.0);
v68 = &v112[-1].m_textOffset;
if ( &v112[-1].m_textOffset != (cocos2d::CCPoint *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v72 = (unsigned int *)&v112[-1].m_caption;
do
v73 = __ldaxr(v72);
while ( __stlxr(v73 - 1, v72) );
}
else
{
v73 = (int)v112[-1].m_caption.m_data.m_data;
LODWORD(v112[-1].m_caption.m_data.m_data) = v73 - 1;
}
if ( v73 <= 0 )
operator delete(v68);
}
cocos2d::CCArray::addObject(a1->m_layerButtons, v67);
v118.adj = (size_t)SetupGradientPopup::onZLayer;
v118.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v69 = CCMenuItemSpriteExtra::create(v67, nullptr, v118);
v69->setTag(v69, v42);
v67->setTag(v67, v42);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v69);
if ( (int)v42 <= 7 )
break;
++v42;
cocos2d::CCArray::addObject(v104, v69);
if ( v42 == 16 )
goto LABEL_23;
}
++v42;
cocos2d::CCArray::addObject(v103, v69);
}
while ( v42 != 16 );
LABEL_23:
SetupGradientPopup::updateZLayerButtons(a1);
v70 = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(&v111, (float)(v105 * 0.5) + -20.0, (float)(v106 * 0.5) + -10.0);
LODWORD(v125.x) = COERCE_UNSIGNED_INT(cocos2d::CCNode::convertToNodeSpace(v70, &v111).y);
GameToolbox::alignItemsHorisontally(v103, 8.0, v125, (bool)&v112);
v71 = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(&v111, (float)(v105 * 0.5) + -20.0, (float)(v106 * 0.5) + -50.0);
LODWORD(v126.x) = COERCE_UNSIGNED_INT(cocos2d::CCNode::convertToNodeSpace(v71, &v111).y);
GameToolbox::alignItemsHorisontally(v104, 8.0, v126, (bool)&v112);
a1->updateDefaultTriggerValues(a1);
a1->m_disableTextDelegate = 0;
}
return v102;
}