//
// SetupTriggerPopup::createCustomButton from 0x1404774b0 to 0x140477723 (627 bytes)
//
// 5 xrefs:
// > SetupKeyframePopup::init @ 0x1404260c8
// > SetupKeyframePopup::init @ 0x140426163
// > SetupKeyframePopup::init @ 0x1404261f4
// > SetupKeyframePopup::init @ 0x140426298
// > ??> @ 0x1406db720
//
// 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=2
void __fastcall SetupTriggerPopup::createCustomButton(
SetupTriggerPopup *a1,
int a2,
const char *a3,
__int64 a4,
__int64 a5)
{
float v5; // xmm0_4
__int64 v10; // rcx
struct cocos2d::CCObject *v11; // rax
cocos2d::CCArray *v12; // rbp
const char *v13; // rcx
struct cocos2d::CCSprite *v14; // r12
CCMenuItemSpriteExtra *v15; // rdi
CCMenuItemSpriteExtra_vtbl *v16; // rbx
struct cocos2d::CCPoint v17; // rax
double v18; // xmm0_8
const char *v19; // rcx
struct cocos2d::CCLabelBMFont *v20; // rdi
cocos2d::CCLabelBMFont_vtbl *v21; // rbx
double v22; // xmm0_8
const cocos2d::CCPoint *v23; // rax
struct cocos2d::CCPoint v24; // [rsp+20h] [rbp-88h] BYREF
cocos2d::CCPoint v25[4]; // [rsp+28h] [rbp-80h] BYREF
v25[2] = (cocos2d::CCPoint)a3;
v25[3] = (cocos2d::CCPoint)a4;
while ( !cocos2d::CCArray::count(a1->m_pageContainers) )
{
v11 = (struct cocos2d::CCObject *)cocos2d::CCArray::create(v10);
cocos2d::CCArray::addObject(a1->m_pageContainers, v11);
}
v12 = (cocos2d::CCArray *)cocos2d::CCArray::objectAtIndex(a1->m_pageContainers, 0);
SetupTriggerPopup::getGroupContainer(a1, 0);
if ( !*(_QWORD *)(a4 + 16) )
sub_14003CCE0((void **)a4, "GJ_plus2Btn_001.png", 0x13u);
v13 = (const char *)a4;
if ( *(_QWORD *)(a4 + 24) > 0xFu )
v13 = *(const char **)a4;
v14 = cocos2d::CCSprite::createWithSpriteFrameName(v13);
((void (__fastcall *)(struct cocos2d::CCSprite *))v14->setScale_0)(v14);
v15 = CCMenuItemSpriteExtra::create(v14, nullptr, a1, (cocos2d::SEL_MenuHandler *)sub_1401377B4);
v15->setTag(v15, a2);
a1->m_buttonMenu->addChild_1(a1->m_buttonMenu, v15);
v16 = v15->cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v17 = cocos2d::CCNode::convertToNodeSpace(a1->m_buttonMenu, &v24);
((void (__fastcall *)(CCMenuItemSpriteExtra *, struct cocos2d::CCPoint))v16->setPosition_0)(v15, v17);
cocos2d::CCArray::addObject(v12, v15);
cocos2d::CCPoint::CCPoint(v5, 0.0);
v18 = cocos2d::CCPoint::CCPoint(v25);
v19 = a3;
if ( *((_QWORD *)a3 + 3) > 0xFu )
v19 = *(const char **)a3;
v20 = cocos2d::CCLabelBMFont::create(v19, "goldFont.fnt");
a1->m_mainLayer->addChild_1(a1->m_mainLayer, v20);
cocos2d::CCArray::addObject(v12, v20);
v21 = v20->cocos2d::CCSpriteBatchNode::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;
v22 = cocos2d::CCPoint::CCPoint(*(float *)&v18, 0.5);
v21->setAnchorPoint(v20, v23);
v14->getContentSize(v14);
cocos2d::CCPoint::CCPoint(*(float *)&v22, v25[0].x);
cocos2d::CCPoint::operator+(a5, &v24);
v20->setPosition_0(v20, &v24);
((void (__fastcall *)(struct cocos2d::CCLabelBMFont *))v20->setScale_0)(v20);
sub_14003A830((__int64)a3);
sub_14003A830(a4);
}