//
// SetupOptionsTriggerPopup::addOption from 0x540330 to 0x5404a8 (376 bytes)
//
// 13 xrefs:
// > SetupOptionsTriggerPopup::init @ 0x5405d4
// > SetupOptionsTriggerPopup::init @ 0x5405f0
// > SetupOptionsTriggerPopup::init @ 0x54060c
// > SetupOptionsTriggerPopup::init @ 0x540628
// > SetupOptionsTriggerPopup::init @ 0x540644
// > SetupOptionsTriggerPopup::init @ 0x540660
// > SetupOptionsTriggerPopup::init @ 0x54067c
// > SetupOptionsTriggerPopup::init @ 0x5406aa
// > SetupOptionsTriggerPopup::init @ 0x5406c8
// > SetupOptionsTriggerPopup::init @ 0x5406e6
// > SetupOptionsTriggerPopup::init @ 0x540704
// > SetupOptionsTriggerPopup::init @ 0x540722
// > SetupOptionsTriggerPopup::init @ 0x540740
//
// 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
//
int __fastcall SetupOptionsTriggerPopup::addOption(SetupTriggerPopup *a1, int a2)
{
SetupTriggerPopup *v4; // r10
int v5; // s16
cocos2d::CCLabelBMFont *v6; // r5
void (__fastcall *setAnchorPoint)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::CCPoint *); // r7
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r8
int result; // r0
char v10[4]; // [sp+28h] [bp+4h] BYREF
cocos2d::CCPoint v11; // [sp+2Ch] [bp+8h] BYREF
cocos2d::CCPoint v12; // [sp+34h] [bp+10h] BYREF
v4 = a1 + 1;
v5 = (int)((float (__fastcall *)(SetupTriggerPopup *))a1->getValue)(a1);
v6 = cocos2d::CCLabelBMFont::create();
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v6->setScale)(v6, 1050253722);
setAnchorPoint = v6->setAnchorPoint;
cocos2d::CCPoint::CCPoint(&v12, 0.0, 0.5);
setAnchorPoint(v6, &v12);
a1->m_mainLayer->addChild(a1->m_mainLayer, v6);
setPosition = v6->setPosition;
cocos2d::CCPoint::CCPoint(&v11, -100.0, 0.0);
cocos2d::CCPoint::operator+(&v12, v4, &v11);
setPosition(v6, &v12);
SetupTriggerPopup::addObjectToPage(a1, v6, a1[1].m_nLuaID);
sub_776584((int)v10, "On");
cocos2d::CCPoint::CCPoint(&v11, 40.0, 0.0);
cocos2d::CCPoint::operator+(&v12, v4, &v11);
SetupTriggerPopup::createCustomToggleValueControl(
a1,
a2,
v5 == 1,
1,
(std::string)v10,
(cocos2d::CCPoint)(unsigned int)&v12,
a1[1].m_nLuaID,
0);
sub_774008(v10);
sub_776584((int)v10, "Off");
cocos2d::CCPoint::CCPoint(&v11, 100.0, 0.0);
cocos2d::CCPoint::operator+(&v12, v4, &v11);
SetupTriggerPopup::createCustomToggleValueControl(
a1,
-a2,
v5 == -1,
1,
(std::string)v10,
(cocos2d::CCPoint)(unsigned int)&v12,
a1[1].m_nLuaID,
0);
result = sub_774008(v10);
*(float *)&a1[1].m_uID = *(float *)&a1[1].m_uID - 30.0;
return result;
}