//
// SetItemIDLayer::init from 0x4f23bc to 0x4f27d2 (1046 bytes)
//
// 1 xrefs:
// > SetItemIDLayer::create @ 0x4f294a
//
// 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 SetItemIDLayer::init(SetItemIDLayer *a1, EffectGameObject *a2, cocos2d::CCArray *a3)
{
_BOOL4 v4; // r10
cocos2d::CCDirector *v5; // r0
int v6; // s16
cocos2d::CCPoint v8; // [sp+4h] [bp-68h]
cocos2d::CCPoint v9; // [sp+4h] [bp-68h]
cocos2d::CCPoint v10; // [sp+4h] [bp-68h]
cocos2d::CCFloat *v11; // [sp+14h] [bp-58h]
cocos2d::CCFloat *v12; // [sp+14h] [bp-58h]
cocos2d::CCFloat *v13; // [sp+14h] [bp-58h]
cocos2d::CCFloat *v14; // [sp+14h] [bp-58h]
cocos2d::CCFloat *v15; // [sp+14h] [bp-58h]
int v16; // [sp+30h] [bp-3Ch]
_BYTE v17[4]; // [sp+40h] [bp-2Ch] BYREF
cocos2d::CCSize v18; // [sp+44h] [bp-28h] BYREF
cocos2d::CCPoint v19; // [sp+4Ch] [bp-20h] BYREF
cocos2d::CCPoint v20; // [sp+54h] [bp-18h] BYREF
_BYTE v21[8]; // [sp+5Ch] [bp-10h] BYREF
v4 = SetupTriggerPopup::init(a1, a2, a3, 300.0, 260.0, 1);
if ( v4 )
{
SetupTriggerPopup::preSetup(a1);
sub_776584((int)v21, "Counter Label");
SetupTriggerPopup::addTitle(a1, (std::string)v21);
sub_774008(v21);
sub_776584((int)v21, "OK");
SetupTriggerPopup::addCloseButton(a1, (std::string)v21);
sub_774008(v21);
sub_776584((int)&v20, "Help");
sub_776584(
(int)v21,
"Displays a set counter value depending on the setting. By default it displays Item ID.\n"
"Use Time Counter to make it function as a timer.\n"
"MainTime shows the exact game time.\n"
"Use Points to show linked collectables.\n"
"Attempts displays the current attempt.\n"
"Left and Right Align changes the alignment of the display.");
SetupTriggerPopup::addHelpButton(a1, (std::string)&v20, (std::string)v21, 1.0);
sub_774008(v21);
sub_774008(&v20);
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v18, v5);
cocos2d::CCPoint::CCPoint(&v19, v18.width * 0.5, v18.height * 0.5);
sub_776584((int)v17, "ItemID");
cocos2d::CCPoint::CCPoint(&v20, -60.0, 50.0);
cocos2d::CCPoint::operator+(v21, &v19, &v20);
SetupTriggerPopup::createValueControlAdvanced(
(int)a1,
80,
(int)v17,
(int)v21,
0.8,
1,
3,
6,
1,
nullptr,
100.0,
0,
0,
0,
2,
0);
sub_774008(v17);
sub_776584((int)v17, "Time\nCounter");
cocos2d::CCPoint::CCPoint(&v20, -60.0, 0.0);
cocos2d::CCPoint::operator+(v21, &v19, &v20);
SetupTriggerPopup::createToggleValueControl((int)a1, 466, (int)v17, (int)v21, 0, 0, 0, 1.0);
sub_774008(v17);
sub_776584((int)v17, "Seconds\nOnly");
cocos2d::CCPoint::CCPoint(&v20, 60.0, 0.0);
cocos2d::CCPoint::operator+(v21, &v19, &v20);
SetupTriggerPopup::createToggleValueControl((int)a1, 389, (int)v17, (int)v21, 0, 0, 0, 1.0);
sub_774008(v17);
v6 = (int)COERCE_FLOAT(((int (__fastcall *)(SetItemIDLayer *, int))a1->getValue)(a1, 391));
sub_776584((int)v17, "Left\nAlign");
cocos2d::CCPoint::CCPoint(&v20, 60.0, 80.0);
cocos2d::CCPoint::operator+(v21, &v19, &v20);
SetupTriggerPopup::createCustomToggleValueControl(
a1,
1,
v6 == 1,
1,
(std::string)v17,
(cocos2d::CCPoint)(unsigned int)v21,
0,
0,
(int)v11);
sub_774008(v17);
sub_776584((int)v17, "Right\nAlign");
cocos2d::CCPoint::CCPoint(&v20, 60.0, 40.0);
cocos2d::CCPoint::operator+(v21, &v19, &v20);
SetupTriggerPopup::createCustomToggleValueControl(
a1,
2,
v6 == 2,
1,
(std::string)v17,
(cocos2d::CCPoint)(unsigned int)v21,
0,
0,
(int)v12);
sub_774008(v17);
v16 = (int)a1->getValue(a1, 390);
sub_776584((int)v17, "MainTime");
cocos2d::CCPoint::CCPoint(&v20, -90.0, -60.0);
cocos2d::CCPoint::operator+(v21, &v19, &v20);
LODWORD(v8.x) = v21;
LODWORD(v8.y) = 1;
SetupTriggerPopup::createCustomToggleValueControl(a1, -1, v16 == -1, 1, (std::string)v17, v8, 0, 0, (int)v13);
sub_774008(v17);
sub_776584((int)v17, "Points");
cocos2d::CCPoint::CCPoint(&v20, -15.0, -60.0);
cocos2d::CCPoint::operator+(v21, &v19, &v20);
LODWORD(v9.x) = v21;
LODWORD(v9.y) = 1;
SetupTriggerPopup::createCustomToggleValueControl(a1, -2, v16 == -2, 1, (std::string)v17, v9, 0, 0, (int)v14);
sub_774008(v17);
sub_776584((int)v17, "Attempts");
cocos2d::CCPoint::CCPoint(&v20, 60.0, -60.0);
cocos2d::CCPoint::operator+(v21, &v19, &v20);
LODWORD(v10.x) = v21;
LODWORD(v10.y) = 1;
SetupTriggerPopup::createCustomToggleValueControl(a1, -3, v16 == -3, 1, (std::string)v17, v10, 0, 0, (int)v15);
sub_774008(v17);
SetupTriggerPopup::postSetup(a1);
}
return v4;
}