//
// SetupPickupTriggerPopup::init from 0x4f8640 to 0x4f8a14 (980 bytes)
//
// 1 xrefs:
// > SetupPickupTriggerPopup::create @ 0x4f8b8a
//
// 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 SetupPickupTriggerPopup::init(SetupPickupTriggerPopup *a1, EffectGameObject *a2, cocos2d::CCArray *a3)
{
_BOOL4 v4; // r11
cocos2d::CCDirector *v5; // r0
cocos2d::CCPoint v6; // r2
int v7; // s19
int v9; // [sp+Ch] [bp-60h]
cocos2d::CCFloat *v10; // [sp+14h] [bp-58h]
cocos2d::CCFloat *v11; // [sp+14h] [bp-58h]
_BYTE v12[4]; // [sp+40h] [bp-2Ch] BYREF
cocos2d::CCSize v13; // [sp+44h] [bp-28h] BYREF
cocos2d::CCPoint v14; // [sp+4Ch] [bp-20h] BYREF
cocos2d::CCPoint v15; // [sp+54h] [bp-18h] BYREF
_BYTE v16[8]; // [sp+5Ch] [bp-10h] BYREF
v4 = SetupTriggerPopup::init(a1, a2, a3, 300.0, 250.0, 1);
if ( v4 )
{
SetupTriggerPopup::preSetup(a1);
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v13, v5);
sub_776584((int)v16, "Pickup Trigger");
SetupTriggerPopup::addTitle(a1, (std::string)v16);
sub_774008(v16);
sub_776584((int)v16, "OK");
SetupTriggerPopup::addCloseButton(a1, (std::string)v16);
sub_774008(v16);
sub_776584((int)&v15, "Help");
sub_776584(
(int)v16,
"Changes the value of an Item ID by adding Count to the previous value.\n"
"Use Multiply or Divide to modify in another way than addition.\n"
"Override specifies the exact value to change to instead of modifying the previous value.");
SetupTriggerPopup::addHelpButton(a1, (std::string)&v15, (std::string)v16, 1.0);
sub_774008(v16);
sub_774008(&v15);
cocos2d::CCPoint::CCPoint(&v14, v13.width * 0.5, v13.height * 0.5);
sub_776584((int)v12, "ItemID");
cocos2d::CCPoint::CCPoint(&v15, -50.0, 50.0);
cocos2d::CCPoint::operator+(v16, &v14, &v15);
SetupTriggerPopup::createValueControlAdvanced(
(int)a1,
80,
(int)v12,
(int)v16,
0.8,
1,
3,
6,
1,
nullptr,
100.0,
0,
0,
0,
2,
0);
sub_774008(v12);
cocos2d::CCPoint::CCPoint(&v15, -5.0, 80.0);
cocos2d::CCPoint::operator+(v16, &v14, &v15);
sub_776584((int)v12, (char *)&unk_939830);
LODWORD(v6.x) = v16;
v6.y = 0.8;
SetupTriggerPopup::createPlusButton(a1, 80, v6, COERCE_FLOAT(v12), 0, 0, v9);
sub_774008(v12);
v7 = (int)COERCE_FLOAT(((int (__fastcall *)(SetupPickupTriggerPopup *, int))a1->getValue)(a1, 88));
sub_776584((int)v12, "Multiply");
cocos2d::CCPoint::CCPoint(&v15, 50.0, 70.0);
cocos2d::CCPoint::operator+(v16, &v14, &v15);
SetupTriggerPopup::createCustomToggleValueControl(
a1,
1,
v7 == 1,
1,
(std::string)v12,
(cocos2d::CCPoint)(unsigned int)v16,
0,
0,
(int)v10);
sub_774008(v12);
sub_776584((int)v12, "Divide");
cocos2d::CCPoint::CCPoint(&v15, 50.0, 30.0);
cocos2d::CCPoint::operator+(v16, &v14, &v15);
SetupTriggerPopup::createCustomToggleValueControl(
a1,
2,
v7 == 2,
1,
(std::string)v12,
(cocos2d::CCPoint)(unsigned int)v16,
0,
0,
(int)v11);
sub_774008(v12);
sub_776584((int)v12, "Count");
cocos2d::CCPoint::CCPoint(&v15, -50.0, -20.0);
cocos2d::CCPoint::operator+(v16, &v14, &v15);
SetupTriggerPopup::createValueControlAdvanced(
(int)a1,
77,
(int)v12,
(int)v16,
0.8,
1,
2,
6,
1,
nullptr,
100.0,
0,
1,
0,
2,
0);
sub_774008(v12);
sub_776584((int)v12, "Override");
cocos2d::CCPoint::CCPoint(&v15, 50.0, -20.0);
cocos2d::CCPoint::operator+(v16, &v14, &v15);
SetupTriggerPopup::createToggleValueControl((int)a1, 139, (int)v12, (int)v16, 0, 0, 1, 1.0);
sub_774008(v12);
sub_776584((int)v12, "Modifier:");
cocos2d::CCPoint::CCPoint(&v15, 0.0, -20.0);
cocos2d::CCPoint::operator+(v16, &v14, &v15);
SetupTriggerPopup::createValueControlAdvanced(
(int)a1,
449,
(int)v12,
(int)v16,
0.8,
0,
1,
6,
0,
nullptr,
10.0,
0,
2,
0,
3,
0);
sub_774008(v12);
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
SetupPickupTriggerPopup::updateState(a1);
SetupTriggerPopup::postSetup(a1);
}
return v4;
}