//
// SetupForceBlockPopup::init from 0x57d8cc to 0x57dcd8 (1036 bytes)
//
// 1 xrefs:
// > SetupForceBlockPopup::create @ 0x57dd4e
//
// 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 SetupForceBlockPopup::init(SetupForceBlockPopup *a1, ForceBlockGameObject *a2, cocos2d::CCArray *a3)
{
_BOOL4 v4; // r10
cocos2d::CCDirector *v5; // r0
float v6; // s15
_BYTE v8[4]; // [sp+38h] [bp-24h] BYREF
cocos2d::CCSize v9; // [sp+3Ch] [bp-20h] BYREF
cocos2d::CCPoint v10; // [sp+44h] [bp-18h] BYREF
cocos2d::CCPoint v11; // [sp+4Ch] [bp-10h] BYREF
v4 = SetupTriggerPopup::init(a1, a2, a3, 380.0, 270.0, 1);
if ( v4 )
{
SetupTriggerPopup::preSetup(a1);
sub_776584((int)&v11, "Setup Force Block");
SetupTriggerPopup::addTitle((int)a1);
sub_774008(&v11);
sub_776584((int)&v11, "OK");
SetupTriggerPopup::addCloseButton((unsigned int)a1, (ButtonSprite **)&v11);
sub_774008(&v11);
sub_776584((int)&v10, "Help");
sub_776584(
(int)&v11,
"Force is how much force is applied upon player collision.\n"
"Blocks with the same Force ID do not stack.\n"
"Relative makes force direction based on angle between player and object center.\n"
"UseRange lets you set a range to apply force from based on player position. Range calculation is based on block radius.");
SetupTriggerPopup::addHelpButton((int)a1, (int)&v10, (int)&v11, 1065353216);
sub_774008(&v11);
sub_774008(&v10);
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v9, v5);
cocos2d::CCPoint::CCPoint(&v10, v9.width * 0.5, (float)(v9.height * 0.5) + 30.0);
sub_776584((int)v8, "Force:");
cocos2d::CCPoint::CCPoint(&v11, v9.width * 0.5, (float)(v9.height * 0.5) + 80.0);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
149,
(int)v8,
&v11,
(cocos2d::CCZone *)0x3F4CCCCD,
0,
Float,
4,
0,
nullptr,
5.0,
0,
149,
0,
3,
0);
sub_774008(v8);
sub_776584((int)v8, "MinForce:");
cocos2d::CCPoint::CCPoint(&v11, (float)(v9.width * 0.5) - 80.0, (float)(v9.height * 0.5) + 80.0);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
526,
(int)v8,
&v11,
(cocos2d::CCZone *)0x3F4CCCCD,
0,
Float,
4,
0,
nullptr,
5.0,
0,
529,
0,
3,
0);
sub_774008(v8);
sub_776584((int)v8, "MaxForce:");
cocos2d::CCPoint::CCPoint(&v11, (float)(v9.width * 0.5) + 80.0, (float)(v9.height * 0.5) + 80.0);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
527,
(int)v8,
&v11,
(cocos2d::CCZone *)0x3F4CCCCD,
0,
Float,
4,
0,
nullptr,
5.0,
0,
529,
0,
3,
0);
sub_774008(v8);
sub_776584((int)v8, "Relative");
cocos2d::CCPoint::CCPoint(&v11, (float)(v9.width * 0.5) - 80.0, (float)(v9.height * 0.5) + 15.0);
SetupTriggerPopup::createToggleValueControl(a1, 528, (int)v8, &v11, 0, 0, 0, 1.0);
sub_774008(v8);
sub_776584((int)v8, "Range");
cocos2d::CCPoint::CCPoint(&v11, (float)(v9.width * 0.5) + 50.0, (float)(v9.height * 0.5) + 15.0);
SetupTriggerPopup::createToggleValueControl(a1, 529, (int)v8, &v11, 0, 0, 0, 1.0);
sub_774008(v8);
sub_776584((int)v8, "ForceID");
cocos2d::CCPoint::CCPoint(&v11, v9.width * 0.5, (float)(v9.height * 0.5) - 55.0);
SetupTriggerPopup::createValueControlAdvanced(
(unsigned int)a1,
530,
(int)v8,
&v11,
(cocos2d::CCZone *)0x3F4CCCCD,
1,
Int,
10,
1,
nullptr,
9999.0,
0,
0,
0,
0,
0);
sub_774008(v8);
v6 = COERCE_FLOAT(((int (__fastcall *)(SetupForceBlockPopup *, int))a1->getValue)(a1, 529));
a1->toggleGroup(a1, 529, v6 != 0.0);
a1->toggleGroup(a1, 149, v6 == 0.0);
SetupTriggerPopup::postSetup(a1);
}
return v4;
}