//
// GJOptionsLayer::init from 0x14039ac30 to 0x14039af8d (861 bytes)
//
// 6 xrefs:
// > FindObjectPopup::onOptions @ 0x140180bcd
// > FindObjectOptionsLayer::init @ 0x140180c45
// > GameLevelOptionsLayer::create @ 0x1403aa3c2
// > LevelOptionsLayer::init @ 0x14045d1d1
// > SFXBrowser::onSettings @ 0x14061f64f
// > ??> @ 0x140923300
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:31:14 +0000
//
char __fastcall GJOptionsLayer::init(__int64 a1, int a2, float a3, int a4)
{
char result; // al
__int64 v6; // rcx
__int64 v7; // rax
__int64 v8; // rcx
cocos2d::CCObject *v9; // rax
__int64 v10; // rcx
cocos2d::CCObject *v11; // rax
__int64 v12; // rcx
__int64 v13; // rax
__int64 v14; // rcx
struct cocos2d::CCSprite *v15; // rax
int v16; // ebx
cocos2d::CCObject *v17; // rsi
__int64 v18; // rdi
__int64 v19; // rbx
__int64 v20; // rax
__int64 v21; // rax
float v22; // xmm7_4
int v23; // eax
cocos2d::CCObject *v24; // rax
__int64 v25; // rcx
__int64 *v26; // rsi
__int64 v27; // rdi
__int64 v28; // rcx
cocos2d::CCDirector *v29; // rax
float ScreenLeft; // xmm0_4
__int64 v31; // rbx
__int64 v32; // rax
__int64 v33; // rax
cocos2d::CCSprite *v34; // rax
cocos2d::CCObject *v35; // rax
__int64 v36; // rcx
__int64 *v37; // rsi
__int64 v38; // rdi
__int64 v39; // rcx
cocos2d::CCDirector *v40; // rax
float ScreenRight; // xmm0_4
__int64 v42; // rbx
__int64 v43; // rax
__int64 v44; // rax
_BYTE v45[8]; // [rsp+40h] [rbp-38h] BYREF
_BYTE v46[8]; // [rsp+48h] [rbp-30h] BYREF
float v47; // [rsp+98h] [rbp+20h] BYREF
float v48; // [rsp+9Ch] [rbp+24h]
result = SetupTriggerPopup::init(a1, 0, 0, a4, LODWORD(a3), a2, 0);
if ( result )
{
*(_BYTE *)(a1 + 596) = 1;
v7 = cocos2d::CCDirector::sharedDirector(v6);
cocos2d::CCDirector::getWinSize(v7, &v47);
v9 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v8);
*(_QWORD *)(a1 + 1040) = v9;
cocos2d::CCObject::retain(v9);
v11 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v10);
*(_QWORD *)(a1 + 1032) = v11;
cocos2d::CCObject::retain(v11);
v13 = cocos2d::CCMenu::create(v12);
v14 = *(_QWORD *)(a1 + 584);
*(_QWORD *)(a1 + 552) = v13;
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v14 + 456LL))(v14, v13, 10);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 1200LL))(a1);
v15 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
v16 = (int)v15;
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v15 + 160LL))(v15);
v17 = CCMenuItemSpriteExtra::create(v16, 0, a1, (__int64)sub_14009D628);
*((_DWORD *)v17 + 93) = 1069547520;
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v17);
v18 = *(_QWORD *)v17;
v19 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v45,
(float)((float)(v47 * 0.5) - (float)(*(float *)(a1 + 732) * 0.5)) + 3.0,
(float)((float)(*(float *)(a1 + 736) * 0.5) + (float)(v48 * 0.5)) - 3.0);
cocos2d::CCNode::convertToNodeSpace(v19, v46, v20);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v18 + 184))(v17, v21);
v22 = v48 * 0.5;
v23 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
v24 = CCMenuItemSpriteExtra::create(v23, 0, a1, (__int64)GJOptionsLayer::onPrevPage);
v25 = *(_QWORD *)(a1 + 552);
*(_QWORD *)(a1 + 1048) = v24;
(*(void (__fastcall **)(__int64, cocos2d::CCObject *))(*(_QWORD *)v25 + 464LL))(v25, v24);
v26 = *(__int64 **)(a1 + 1048);
v27 = *v26;
v29 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v28);
ScreenLeft = cocos2d::CCDirector::getScreenLeft(v29);
v31 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v46, ScreenLeft + 20.0, v22);
cocos2d::CCNode::convertToNodeSpace(v31, v45, v32);
(*(void (__fastcall **)(__int64 *, __int64))(v27 + 184))(v26, v33);
*(_DWORD *)(*(_QWORD *)(a1 + 1048) + 372LL) = 1069547520;
v34 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_arrow_01_001.png");
LODWORD(v31) = (_DWORD)v34;
cocos2d::CCSprite::setFlipX(v34, 1);
v35 = CCMenuItemSpriteExtra::create(v31, 0, a1, (__int64)GJOptionsLayer::onNextPage);
v36 = *(_QWORD *)(a1 + 552);
*(_QWORD *)(a1 + 1056) = v35;
(*(void (__fastcall **)(__int64, cocos2d::CCObject *))(*(_QWORD *)v36 + 464LL))(v36, v35);
v37 = *(__int64 **)(a1 + 1056);
v38 = *v37;
v40 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v39);
ScreenRight = cocos2d::CCDirector::getScreenRight(v40);
v42 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v46, ScreenRight - 20.0, v22);
cocos2d::CCNode::convertToNodeSpace(v42, v45, v43);
(*(void (__fastcall **)(__int64 *, __int64))(v38 + 184))(v37, v44);
*(_DWORD *)(*(_QWORD *)(a1 + 1056) + 372LL) = 1069547520;
GJOptionsLayer::goToPage(a1, 0);
return 1;
}
return result;
}