//
// SetupShakePopup::init from 0x100664240 to 0x100664a9b (2139 bytes)
//
// 1 xrefs:
// > SetupShakePopup::create @ 0x1006641f9
//
// 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 __fastcall SetupShakePopup::init(SetupShakePopup *a1, EffectGameObject *a2, cocos2d::CCArray *a3)
{
bool result; // al
cocos2d::CCLabelBMFont *v5; // r14
ButtonSprite *v6; // rax
CCMenuItemSpriteExtra *v7; // rax
char *v8; // r14
cocos2d::CCMenu *m_buttonMenu; // r15
int i; // r13d
float *v11; // rax
const char *data; // rdi
cocos2d::CCLabelBMFont *v13; // r14
cocos2d::extension::CCScale9Sprite *v14; // r14
const char *v15; // rdi
CCTextInputNode *v16; // r12
__int64 v17; // rax
Slider *v18; // r14
SliderThumb *Thumb; // rax
float v20; // xmm0_4
SliderThumb *v21; // rax
SliderThumb *v22; // rax
__m128 v23; // [rsp+0h] [rbp-100h] BYREF
TextInputDelegate *v24; // [rsp+10h] [rbp-F0h]
float *p_m_strength; // [rsp+18h] [rbp-E8h]
float *p_m_duration; // [rsp+20h] [rbp-E0h]
float *p_m_interval; // [rsp+28h] [rbp-D8h]
__int128 v28; // [rsp+30h] [rbp-D0h] BYREF
void *v29; // [rsp+40h] [rbp-C0h]
std::string v30; // [rsp+48h] [rbp-B8h] BYREF
std::string v31; // [rsp+60h] [rbp-A0h] BYREF
unsigned __int64 v32[2]; // [rsp+78h] [rbp-88h] BYREF
unsigned __int64 v33; // [rsp+88h] [rbp-78h] BYREF
double v34; // [rsp+90h] [rbp-70h] BYREF
unsigned __int64 v35; // [rsp+98h] [rbp-68h] BYREF
std::string v36; // [rsp+A0h] [rbp-60h] BYREF
unsigned __int64 v37; // [rsp+C0h] [rbp-40h] BYREF
float v38; // [rsp+C8h] [rbp-38h] BYREF
float v39; // [rsp+CCh] [rbp-34h]
float v40; // [rsp+D0h] [rbp-30h]
bool v41; // [rsp+D7h] [rbp-29h]
double v42; // 0:xmm0_8.8
double v43; // 0:xmm0_8.8
cocos2d::CCRect v44; // 0:xmm0_8.8,8:xmm1_8.8
result = SetupTriggerPopup::init(a1, a2, a3, 300.0, 285.0, 1);
if ( result )
{
v41 = result;
((void (__fastcall *)(SetupShakePopup *))a1->determineStartValues)(a1);
cocos2d::CCDirector::sharedDirector();
*(cocos2d::CCSize *)&v42 = cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v38);
v5 = cocos2d::CCLabelBMFont::create_3("Setup Shake", "bigFont.fnt");
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *, double))a1->m_mainLayer->addChild)(
a1->m_mainLayer,
v5,
v42);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v5->setScale)(v5, 0.5);
sub_10028CBE0((float *)&v36, v38 * 0.5, (float)((float)(a1->m_height * 0.5) + (float)(v39 * 0.5)) + -14.0);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v5->setPosition)(v5, &v36);
v6 = ButtonSprite::create_1("OK", 40, 0, 0.80000001, 1, "goldFont.fnt", "GJ_button_01.png", 30.0);
v7 = CCMenuItemSpriteExtra::create(v6, nullptr, a1, (cocos2d::SEL_MenuHandler)0x529uLL);
((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v7);
LOBYTE(v28) = 8;
strcpy((char *)&v28 + 1, "Help");
v30.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0xF8u);
v30.__r_.__value_.__r.__words[0] = 249;
v30.__r_.__value_.__l.__size_ = 247;
strcpy(
v30.__r_.__value_.__l.__data_,
"Shakes the screen for a set duration.\n"
"Strength is how intense the shake is.\n"
"Interval is how often the screen shakes. Leaving this at 0 means that every frame shakes.\n"
"Avoid overusing this effect as it can cause bad gameplay.");
v8 = InfoAlertButton::create(&v28, &v30, 1.0);
if ( (*(_BYTE *)&v30.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v30.__r_.__value_.__l.__data_);
if ( (v28 & 1) != 0 )
operator delete(v29);
((void (__fastcall *)(cocos2d::CCMenu *, char *))a1->m_buttonMenu->addChild)(a1->m_buttonMenu, v8);
m_buttonMenu = a1->m_buttonMenu;
sub_10028CBE0(
(float *)v32,
(float)((float)(v38 * 0.5) - (float)(a1->m_width * 0.5)) + 18.0,
(float)((float)(a1->m_height * 0.5) + (float)(v39 * 0.5)) + -18.0);
*(cocos2d::CCPoint *)&v43 = cocos2d::CCNode::convertToNodeSpace(
(cocos2d::CCNode *)&v36,
(const cocos2d::CCPoint *)m_buttonMenu);
(*(void (__fastcall **)(char *, std::string *, double))(*(_QWORD *)v8 + 184LL))(v8, &v36, v43);
SetupTriggerPopup::createMultiTriggerItemsDefault(a1);
sub_10028CBE0((float *)&v33, v38 * 0.5, (float)(v39 * 0.5) + 95.0);
p_m_duration = &a1->m_duration;
p_m_interval = &a1->m_interval;
p_m_strength = &a1->m_strength;
v24 = &a1->TextInputDelegate;
for ( i = 1; i != -2; --i )
{
sub_10028CC30(&v37);
memset(&v36, 0, sizeof(v36));
if ( i == 1 )
{
sub_10028CC90(&v37, (double *)&v33);
std::string::assign(&v36, "Strength: ");
v11 = p_m_strength;
}
else if ( i )
{
sub_10028CBE0(v23.f32, 0.0, -120.0);
sub_10028CCE0((double *)v32, &v33, (unsigned __int64 *)&v23);
sub_10028CC90(&v37, (double *)v32);
std::string::assign(&v36, "Duration: ");
v11 = p_m_duration;
}
else
{
sub_10028CBE0(v23.f32, 0.0, -60.0);
sub_10028CCE0((double *)v32, &v33, (unsigned __int64 *)&v23);
sub_10028CC90(&v37, (double *)v32);
std::string::assign(&v36, "Interval: ");
v11 = p_m_interval;
}
data = v36.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v36.__r_.__value_.__s.0 & 1) != 0 )
data = v36.__r_.__value_.__l.__data_;
v40 = *v11;
v13 = cocos2d::CCLabelBMFont::create_3(data, "goldFont.fnt");
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v13->setScale)(v13, 0.69999999);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, unsigned __int64 *))v13->setPosition)(v13, &v37);
sub_10028CBE0((float *)v32, 1.0, 0.5);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, unsigned __int64 *))v13->setAnchorPoint)(v13, v32);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild)(
a1->m_mainLayer,
v13);
v44.size = 0;
sub_10028CC00((__int64)v32, 0.0, 0.0, (__m128)0x42200000u, (__m128)0x42200000u);
*(double *)&v44.origin = sub_10028D180(&v23, v32);
v14 = cocos2d::extension::CCScale9Sprite::create_2("square02_small.png", v44);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, __int64))v14->setOpacity)(v14, 100);
sub_10028CBF0(v23.f32, 70.0, 30.0);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, __m128 *))v14->setContentSize)(v14, &v23);
((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::extension::CCScale9Sprite *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v14,
0xFFFFFFFFLL);
sub_10028CBE0((float *)&v35, 45.0, 0.0);
sub_10028CCE0(&v34, &v37, &v35);
((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, double *))v14->setPosition)(v14, &v34);
v15 = "Mixed";
if ( v40 != -99999.0 )
v15 = "Num";
v16 = CCTextInputNode::create(50.0, 40.0, v15, "Thonburi", 24, "bigFont.fnt");
((void (__fastcall *)(cocos2d::CCLayer *, CCTextInputNode *, __int64))a1->m_mainLayer->addChild_0)(
a1->m_mainLayer,
v16,
20);
v17 = ((__int64 (__fastcall *)(cocos2d::extension::CCScale9Sprite *))v14->getPosition)(v14);
((void (__fastcall *)(CCTextInputNode *, __int64))v16->setPosition)(v16, v17);
CCTextInputNode::setMaxLabelScale(v16, 0.60000002);
CCTextInputNode::setMaxLabelWidth(v16, 200.0);
((void (__fastcall *)(cocos2d::CCTextFieldTTF *, _QWORD))v16->m_textField->setVisible)(v16->m_textField, 0);
v16->m_maxLabelLength = 4;
v31.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)22;
strcpy(v31.__r_.__value_.__s.__data_, "0123456789.");
CCTextInputNode::setAllowedChars((std::string *)v16, &v31);
if ( (*(_BYTE *)&v31.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v31.__r_.__value_.__l.__data_);
CCTextInputNode::setLabelPlaceholderColor(v16, (cocos2d::ccColor3B)-1004936);
CCTextInputNode::setLabelPlaceholderScale(v16, 0.5);
v16->m_numberInput = 1;
v16->m_delegate = v24;
v18 = Slider::create_1(a1, (cocos2d::SEL_MenuHandler)(unsigned __int64)SetupShakePopup::sliderChanged, 0.80000001);
Slider::setBarVisibility(v18, 0);
((void (__fastcall *)(cocos2d::CCLayer *, Slider *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v18);
sub_10028CBE0((float *)&v35, 0.0, -32.0);
sub_10028CCE0(&v34, &v37, &v35);
((void (__fastcall *)(Slider *, double *))v18->setPosition)(v18, &v34);
if ( i == 1 )
{
a1->m_strengthInput = v16;
((void (__fastcall *)(CCTextInputNode *, __int64))v16->setTag)(v16, 6);
a1->m_strengthSlider = v18;
Thumb = Slider::getThumb(v18);
((void (__fastcall *)(SliderThumb *, __int64))Thumb->setTag)(Thumb, 4);
v20 = v40 / 5.0;
}
else if ( i )
{
a1->m_durationInput = v16;
((void (__fastcall *)(CCTextInputNode *, __int64))v16->setTag)(v16, 5);
a1->m_durationSlider = v18;
v21 = Slider::getThumb(v18);
((void (__fastcall *)(SliderThumb *, __int64))v21->setTag)(v21, 3);
v20 = v40 * 0.5;
}
else
{
a1->m_intervalInput = v16;
((void (__fastcall *)(CCTextInputNode *, __int64))v16->setTag)(v16, 8);
a1->m_intervalSlider = v18;
v22 = Slider::getThumb(v18);
((void (__fastcall *)(SliderThumb *, __int64))v22->setTag)(v22, 7);
v20 = v40 / 0.1;
}
Slider::setValue(v18, fmaxf(fminf(v20, 1.0), 0.0));
if ( (*(_BYTE *)&v36.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v36.__r_.__value_.__l.__data_);
}
SetupShakePopup::updateShakeLabel(a1, 0);
SetupShakePopup::updateDurLabel(a1, 0);
SetupShakePopup::updateIntervalLabel(a1, 0);
a1->m_disableTextDelegate = 0;
return v41;
}
return result;
}