//
// SetupTriggerPopup::createCustomButton from 0x9e6a2c to 0x9e6e0c (992 bytes)
//
// 5 xrefs:
// > SetupKeyframePopup::init @ 0xa3bcdc
// > SetupKeyframePopup::init @ 0xa3bd74
// > SetupKeyframePopup::init @ 0xa3be0c
// > SetupKeyframePopup::init @ 0xa3bea0
// > ??> @ 0x76668
//
// 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
//
__int64 __fastcall SetupTriggerPopup::createCustomButton(
SetupTriggerPopup *a1,
int a2,
int a3,
const char **a4,
const cocos2d::CCPoint *a5,
unsigned __int8 a6,
int a7,
float a8,
float a9,
int a10)
{
cocos2d::CCArray *PageContainer; // x23
cocos2d::CCArray *GroupContainer; // x24
const char *v19; // x0
cocos2d::CCSprite *v20; // x22
CCMenuItemSpriteExtra *v21; // x20
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x28
cocos2d::CCLabelBMFont *v23; // x20
void (__fastcall *v24)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // x23
cocos2d::CCSprite *v25; // x0
const cocos2d::CCSize *(__fastcall *v26)(const cocos2d::CCNode *__hidden); // x1
void (__fastcall *v27)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x22
float height; // s1
float v29; // s0
float y; // s1
void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // x23
cocos2d::CCSprite *v33; // x0
const cocos2d::CCSize *(__fastcall *getContentSize)(const cocos2d::CCNode *__hidden); // x1
float width; // s0
float x; // [xsp+80h] [xbp+80h]
int v37; // [xsp+98h] [xbp+98h]
cocos2d::CCPoint v38; // [xsp+A0h] [xbp+A0h] BYREF
cocos2d::CCPoint v39; // [xsp+A8h] [xbp+A8h] BYREF
cocos2d::CCPoint v40; // [xsp+B0h] [xbp+B0h] BYREF
cocos2d::CCPoint v41; // 0:kr00_8.8
cocos2d::SEL_MenuHandler v42; // 0:x2.16
v37 = a6;
PageContainer = SetupTriggerPopup::getPageContainer(a1, a7);
GroupContainer = SetupTriggerPopup::getGroupContainer(a1, a10);
v19 = *a4;
if ( !*((_QWORD *)*a4 - 3) )
{
sub_D1798C(a4, "GJ_plus2Btn_001.png", 19);
v19 = *a4;
}
v20 = cocos2d::CCSprite::createWithSpriteFrameName(v19);
v20->setScale(v20, a8);
v42.adj = 1392;
v42.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v21 = CCMenuItemSpriteExtra::create(v20, nullptr, v42);
v21->setTag(v21, a2);
a1->m_buttonMenu->addChild(a1->m_buttonMenu, v21);
setPosition = v21->setPosition;
v41 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, a5);
((void (__fastcall *)(CCMenuItemSpriteExtra *, cocos2d::CCPoint *, float, float))setPosition)(v21, &v40, v41.x, v41.y);
cocos2d::CCArray::addObject(PageContainer, v21);
if ( a10 <= 0 )
{
if ( v37 )
{
cocos2d::CCPoint::CCPoint(&v38, 0.0, 4.0);
v23 = cocos2d::CCLabelBMFont::create();
a1->m_mainLayer->addChild(a1->m_mainLayer, v23);
cocos2d::CCArray::addObject(PageContainer, v23);
goto LABEL_6;
}
cocos2d::CCPoint::CCPoint(&v38, 8.0, 0.0);
v23 = cocos2d::CCLabelBMFont::create();
a1->m_mainLayer->addChild(a1->m_mainLayer, v23);
cocos2d::CCArray::addObject(PageContainer, v23);
LABEL_9:
setAnchorPoint = v23->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v40, 0.0, 0.5);
setAnchorPoint(v23, &v40);
v33 = v20;
getContentSize = v20->getContentSize;
v27 = v23->setPosition;
width = getContentSize(v33)->width;
y = v38.y;
v29 = v38.x + (float)((float)(width * 0.5) * a8);
goto LABEL_7;
}
cocos2d::CCArray::addObject(GroupContainer, v21);
if ( !v37 )
{
cocos2d::CCPoint::CCPoint(&v38, 8.0, 0.0);
v23 = cocos2d::CCLabelBMFont::create();
a1->m_mainLayer->addChild(a1->m_mainLayer, v23);
cocos2d::CCArray::addObject(PageContainer, v23);
cocos2d::CCArray::addObject(GroupContainer, v23);
goto LABEL_9;
}
cocos2d::CCPoint::CCPoint(&v38, 0.0, 4.0);
v23 = cocos2d::CCLabelBMFont::create();
a1->m_mainLayer->addChild(a1->m_mainLayer, v23);
cocos2d::CCArray::addObject(PageContainer, v23);
cocos2d::CCArray::addObject(GroupContainer, v23);
LABEL_6:
v24 = v23->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v40, 0.5, 0.0);
v24(v23, &v40);
v25 = v20;
v26 = v20->getContentSize;
v27 = v23->setPosition;
x = v38.x;
height = v26(v25)->height;
v29 = x;
y = v38.y + (float)((float)(height * 0.5) * a8);
LABEL_7:
cocos2d::CCPoint::CCPoint(&v39, v29, y);
cocos2d::CCPoint::operator+(&v40, a5, &v39);
v27(v23, &v40);
v23->setScale(v23, a9);
return _stack_chk_guard;
}