//
// SetupTriggerPopup::createPageButtons from 0x9e44a0 to 0x9e47e0 (832 bytes)
//
// 16 xrefs:
// > SetupSpawnPopup::init @ 0x8eb6c4
// > SetupRotateCommandPopup::init @ 0x929ad0
// > SetupSongTriggerPopup::init @ 0x9aa7cc
// > SetupOptionsTriggerPopup::init @ 0x9e2bf4
// > SetupAreaMoveTriggerPopup::init @ 0xa0bca4
// > SetupAreaTransformTriggerPopup::init @ 0xa0cd8c
// > SetupAreaRotateTriggerPopup::init @ 0xa0d958
// > SetupAreaFadeTriggerPopup::init @ 0xa0e4a0
// > SetupAreaTintTriggerPopup::init @ 0xa0f2b8
// > SetupAreaTriggerPopup::init @ 0xa0fe10
// > SetupAdvFollowPopup::init @ 0xa1971c
// > SetupKeyframeAnimPopup::init @ 0xa3aae0
// > SetupSFXPopup::init @ 0xa40f70
// > SetupSFXEditPopup::init @ 0xa4214c
// > SelectEventLayer::init @ 0xa55c90
// > ??> @ 0x6c7b0
//
// 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
//
void SetupTriggerPopup::createPageButtons(SetupTriggerPopup *a1, float a2, int a3)
{
char *v4; // x21
cocos2d::CCString *v6; // x0
size_t v7; // x0
cocos2d::CCDirector *v8; // x0
cocos2d::CCMenu *m_buttonMenu; // x25
float v10; // s9
cocos2d::CCSprite *v11; // x21
CCMenuItemSpriteExtra *v12; // x0
cocos2d::CCMenu *v13; // x2
CCMenuItemSpriteExtra *m_prevButton; // x25
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x27
cocos2d::CCSprite *v16; // x25
CCMenuItemSpriteExtra *v17; // x0
cocos2d::CCMenu *v18; // x2
CCMenuItemSpriteExtra *m_nextButton; // x25
void (__fastcall *v20)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x26
char *p_m_fBrVertexMod; // x21
unsigned int *p_m_fTextureTop; // x19
int m_fTextureTop_low; // w0
const char *CString; // [xsp+78h] [xbp+78h]
cocos2d::CCSprite *v25; // [xsp+80h] [xbp+80h] BYREF
float v26; // [xsp+88h] [xbp+88h]
float v27; // [xsp+8Ch] [xbp+8Ch]
_BYTE v28[8]; // [xsp+90h] [xbp+90h] BYREF
cocos2d::CCPoint v29; // [xsp+98h] [xbp+98h] BYREF
cocos2d::CCPoint v30; // [xsp+A0h] [xbp+A0h] BYREF
cocos2d::SEL_MenuHandler v31; // 0:x2.16
cocos2d::SEL_MenuHandler v32; // 0:x2.16
LODWORD(v4) = a3;
if ( a3 < 0 )
{
v25 = (cocos2d::CCSprite *)&byte_124B6C8;
}
else
{
if ( a3 > 3 )
{
v4 = (char *)&dword_0 + 3;
v25 = (cocos2d::CCSprite *)&byte_124B6C8;
LABEL_4:
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"GJ_arrow_0%i_001.png",
(const char *)(unsigned int)v4);
CString = cocos2d::CCString::getCString(v6);
v7 = strlen(CString);
sub_D1798C(&v25, CString, v7);
goto LABEL_5;
}
v25 = (cocos2d::CCSprite *)&byte_124B6C8;
if ( a3 )
goto LABEL_4;
}
sub_D1798C(&v25, "edit_leftBtn_001.png", 20);
LODWORD(v4) = 0;
LABEL_5:
v8 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v8);
m_buttonMenu = a1->m_buttonMenu;
cocos2d::CCPoint::CCPoint(&v30, v26 * 0.5, v27 * 0.5);
cocos2d::CCNode::convertToNodeSpace(m_buttonMenu, &v30);
if ( (_DWORD)v4 )
v10 = 0.7;
else
v10 = 1.0;
v11 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v25);
v11->setScale(v11, v10);
v31.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v31.adj = (size_t)SetupTriggerPopup::onPage;
v12 = CCMenuItemSpriteExtra::create(v11, nullptr, v31);
v13 = a1->m_buttonMenu;
a1->m_prevButton = v12;
v13->addChild(v13, v12);
a1->m_prevButton->setTag(a1->m_prevButton, -1);
m_prevButton = a1->m_prevButton;
setPosition = m_prevButton->setPosition;
cocos2d::CCPoint::CCPoint(&v29, -a2, 0.0);
cocos2d::CCPoint::operator+(&v30, v28, &v29);
setPosition(m_prevButton, &v30);
CCMenuItemSpriteExtra::setSizeMult(a1->m_prevButton, 2.0);
v16 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v25);
cocos2d::CCSprite::setFlipX(v16, 1);
v16->setScale(v16, v10);
v32.adj = (size_t)SetupTriggerPopup::onPage;
v32.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v17 = CCMenuItemSpriteExtra::create(v16, nullptr, v32);
v18 = a1->m_buttonMenu;
a1->m_nextButton = v17;
v18->addChild(v18, v17);
a1->m_nextButton->setTag(a1->m_nextButton, 1);
m_nextButton = a1->m_nextButton;
v20 = m_nextButton->setPosition;
cocos2d::CCPoint::CCPoint(&v29, a2, 0.0);
cocos2d::CCPoint::operator+(&v30, v28, &v29);
v20(m_nextButton, &v30);
CCMenuItemSpriteExtra::setSizeMult(a1->m_nextButton, 2.0);
p_m_fBrVertexMod = (char *)&v25[-1].m_fBrVertexMod;
if ( (__int64 *)&v25[-1].m_fBrVertexMod != &qword_124B6B0 )
{
if ( &pthread_create )
{
p_m_fTextureTop = (unsigned int *)&v25[-1].m_fTextureTop;
do
m_fTextureTop_low = __ldaxr(p_m_fTextureTop);
while ( __stlxr(m_fTextureTop_low - 1, p_m_fTextureTop) );
}
else
{
m_fTextureTop_low = LODWORD(v25[-1].m_fTextureTop);
LODWORD(v25[-1].m_fTextureTop) = m_fTextureTop_low - 1;
}
if ( m_fTextureTop_low <= 0 )
operator delete(p_m_fBrVertexMod);
}
}