//
// SetIDPopup::init from 0x1403a5520 to 0x1403a5ee8 (2504 bytes)
//
// 5 xrefs:
// > SetIDPopup::create @ 0x1403a54bd
// > SetColorIDPopup::init @ 0x1403a6409
// > SetFolderPopup::init @ 0x1403a6872
// > SetLevelOrderPopup::init @ 0x1404310f5
// > ??> @ 0x14092375c
//
// 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:18 +0000
//
// Hidden C++ exception states: #wind=3
char __fastcall SetIDPopup::init(
__int64 a1,
int a2,
int a3,
int a4,
_QWORD *a5,
_QWORD *a6,
char a7,
int a8,
float a9,
char a10,
char a11)
{
__int64 v15; // rdx
__int64 v17; // rdx
__int64 v18; // rdx
__int64 v19; // rcx
__int64 v20; // rax
__int64 v21; // rax
float v22; // xmm8_4
__int64 v23; // rax
__int64 *v24; // rdi
__int64 v25; // rbx
__int64 v26; // rax
__int64 v27; // rbx
__int64 v28; // rax
const char *v29; // rcx
struct cocos2d::CCLabelBMFont *v30; // rdi
__int64 v31; // rbx
__int64 v32; // rax
_QWORD *v33; // rdi
cocos2d::CCObject *v34; // rbx
cocos2d::CCObject *v35; // rax
struct cocos2d::CCMenu *v36; // rax
__int64 v37; // rdi
__int64 v38; // rbx
__int64 v39; // rax
__int64 v40; // rax
_QWORD *v41; // rdi
__int64 v42; // rdx
void (__fastcall *v43)(_QWORD *, __int64); // r8
__int64 v44; // rdx
__int64 v45; // rcx
char *v46; // rax
__int64 v47; // rcx
__int64 v48; // rcx
__int64 v49; // rcx
__int64 v50; // rcx
int v51; // eax
cocos2d::CCObject *v52; // rsi
__int64 v53; // rdi
__int64 v54; // rbx
__int64 v55; // rax
__int64 v56; // rax
struct cocos2d::CCSprite *v57; // rax
struct cocos2d::CCSprite *v58; // rbx
cocos2d::CCObject *v59; // rbx
__int64 v60; // rax
struct cocos2d::CCSprite *v61; // rax
struct cocos2d::CCSprite *v62; // rbx
cocos2d::CCObject *v63; // rbx
__int64 v64; // rax
struct cocos2d::CCSprite *v65; // rax
cocos2d::CCObject *v66; // rsi
__int64 v67; // rdi
__int64 v68; // rbx
__int64 v69; // rax
__int64 v70; // rax
void *v71; // [rsp+58h] [rbp-B0h] BYREF
float v72; // [rsp+60h] [rbp-A8h] BYREF
float v73; // [rsp+64h] [rbp-A4h]
__int128 v74; // [rsp+68h] [rbp-A0h] BYREF
__int64 v75; // [rsp+78h] [rbp-90h]
__int64 v76; // [rsp+80h] [rbp-88h]
__int64 v77; // [rsp+88h] [rbp-80h]
_BYTE v78[8]; // [rsp+90h] [rbp-78h] BYREF
_BYTE v79[8]; // [rsp+98h] [rbp-70h] BYREF
_BYTE v80[16]; // [rsp+A0h] [rbp-68h] BYREF
_QWORD *v81; // [rsp+B0h] [rbp-58h]
_QWORD *v82; // [rsp+B8h] [rbp-50h]
v81 = a5;
v82 = a6;
LODWORD(v71) = -1778384896;
if ( cocos2d::CCLayerColor::initWithColor((cocos2d::CCLayerColor *)a1, (const struct cocos2d::_ccColor4B *)&v71) )
{
*(_DWORD *)(a1 + 672) = a2;
*(_DWORD *)(a1 + 680) = a3;
*(_DWORD *)(a1 + 684) = a4;
*(_DWORD *)(a1 + 688) = a8;
*(_BYTE *)(a1 + 676) = 1;
LOBYTE(v15) = -106;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)(a1 + 408) + 40LL))(a1 + 408, v15);
FLAlertLayer::incrementForcePrio((struct cocos2d::CCObject *)a1);
*(_BYTE *)(a1 + 596) = 1;
LOBYTE(v17) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 920LL))(a1, v17);
LOBYTE(v18) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 992LL))(a1, v18);
v20 = cocos2d::CCDirector::sharedDirector(v19);
cocos2d::CCDirector::getWinSize(v20, &v72);
v21 = cocos2d::CCLayer::create();
*(_QWORD *)(a1 + 584) = v21;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 464LL))(a1, v21);
v22 = fmaxf(a9, 0.0);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)((char *)&v74 + 8), 0.0, 0.0, 80.0, 80.0);
v24 = (__int64 *)cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", v23);
v25 = *v24;
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v71, 220.0, 150.0);
(*(void (__fastcall **)(__int64 *, __int64))(v25 + 312))(v24, v26);
(*(void (__fastcall **)(_QWORD, __int64 *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v24,
4294967294LL);
v27 = *v24;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v71, v72 * 0.5, (float)(v73 * 0.5) + v22);
(*(void (__fastcall **)(__int64 *, __int64))(v27 + 184))(v24, v28);
v29 = (const char *)a5;
if ( a5[3] > 0xFu )
v29 = (const char *)*a5;
v30 = cocos2d::CCLabelBMFont::create(v29, "goldFont.fnt");
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCLabelBMFont *))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v30);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *))(*(_QWORD *)v30 + 160LL))(v30);
v31 = *(_QWORD *)v30;
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v71,
v72 * 0.5,
(float)((float)((float)(v73 * 0.5) + 75.0) - 18.0) + v22);
(*(void (__fastcall **)(struct cocos2d::CCLabelBMFont *, __int64))(v31 + 184))(v30, v32);
v33 = a6;
if ( a6[3] > 0xFu )
v33 = (_QWORD *)*a6;
v71 = operator new(0x2C8u);
v34 = (cocos2d::CCObject *)ButtonSprite::ButtonSprite((__int64)v71);
if ( v34 )
{
if ( ButtonSprite::init_1(
(__int64)v34,
(__int64)v33,
40,
0,
1061997773,
1,
"goldFont.fnt",
(__int64)"GJ_button_01.png",
1106247680) )
{
cocos2d::CCObject::autorelease(v34);
}
else
{
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v34 + 8LL))(v34, 1);
LODWORD(v34) = 0;
}
}
v35 = CCMenuItemSpriteExtra::create((int)v34, 0, a1, (__int64)SetIDPopup::onClose);
v36 = cocos2d::CCMenu::create(v35, 0);
*(_QWORD *)(a1 + 552) = v36;
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCMenu *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v36,
10);
v37 = **(_QWORD **)(a1 + 552);
v38 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v71,
v72 * 0.5,
(float)((float)((float)(v73 * 0.5) - 75.0) + 24.0) + v22);
(*(void (__fastcall **)(__int64, __int64))(v37 + 184))(v38, v39);
*(_DWORD *)(a1 + 640) = -1;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v74, v72 * 0.5, (float)((float)(v73 * 0.5) + 5.0) + v22);
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v80, 0.0, 0.0, 40.0, 40.0);
v40 = cocos2d::CCRect::CCRect((cocos2d::CCRect *)((char *)&v74 + 8), (const struct cocos2d::CCRect *)v80);
v41 = (_QWORD *)cocos2d::extension::CCScale9Sprite::create("square02b_small.png", v40);
v42 = v41[40];
v43 = *(void (__fastcall **)(_QWORD *, __int64))(v42 + 40);
LOBYTE(v42) = 100;
v43(v41 + 40, v42);
LOWORD(v71) = 0;
BYTE2(v71) = 0;
(*(void (__fastcall **)(_QWORD *, void **))v41[40])(v41 + 40, &v71);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)v79, 50.0, 30.0);
(*(void (__fastcall **)(_QWORD *, _BYTE *))(*v41 + 312LL))(v41, v79);
(*(void (__fastcall **)(_QWORD, _QWORD *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(
*(_QWORD *)(a1 + 584),
v41,
0xFFFFFFFFLL);
(*(void (__fastcall **)(_QWORD *, __int128 *))(*v41 + 184LL))(v41, &v74);
v46 = CCTextInputNode::create(v45, v44, (__int64)"Num");
*(_QWORD *)(a1 + 664) = v46;
(*(void (__fastcall **)(_QWORD, char *, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v46, 20);
(*(void (__fastcall **)(_QWORD, __int128 *))(**(_QWORD **)(a1 + 664) + 184LL))(*(_QWORD *)(a1 + 664), &v74);
v47 = *(_QWORD *)(a1 + 664);
*(_DWORD *)(v47 + 564) = 1058642330;
CCTextInputNode::refreshLabel(v47);
v48 = *(_QWORD *)(a1 + 664);
*(_DWORD *)(v48 + 560) = 1128792064;
CCTextInputNode::refreshLabel(v48);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(*(_QWORD *)(a1 + 664) + 592LL) + 336LL))(
*(_QWORD *)(*(_QWORD *)(a1 + 664) + 592LL),
0);
*(_DWORD *)(*(_QWORD *)(a1 + 664) + 608LL) = 8;
v76 = 10;
v77 = 15;
*((_QWORD *)&v74 + 1) = *(_QWORD *)"0123456789";
v75 = *(unsigned __int16 *)"89";
BYTE2(v75) = 0;
CCTextInputNode::setAllowedChars(*(_QWORD *)(a1 + 664), (void **)&v74 + 1);
LOWORD(v71) = -21896;
v49 = *(_QWORD *)(a1 + 664);
*(_WORD *)(v49 + 572) = -21896;
*(_BYTE *)(v49 + 574) = -16;
CCTextInputNode::refreshLabel(v49);
v50 = *(_QWORD *)(a1 + 664);
*(_DWORD *)(v50 + 568) = 1056964608;
CCTextInputNode::refreshLabel(v50);
*(_QWORD *)(*(_QWORD *)(a1 + 664) + 600LL) = a1 + 544;
*(_BYTE *)(*(_QWORD *)(a1 + 664) + 424LL) = a10;
if ( a7 )
{
v51 = (unsigned int)cocos2d::CCSprite::createWithSpriteFrameName("GJ_resetBtn_001.png");
v52 = CCMenuItemSpriteExtra::create(v51, 0, a1, (__int64)SetIDPopup::onResetValue);
*((_DWORD *)v52 + 93) = 1066192077;
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(
*(_QWORD *)(a1 + 552),
v52);
v53 = *(_QWORD *)v52;
v54 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)&v71,
(float)((float)(v72 * 0.5) + 110.0) - 20.0,
(float)((float)((float)(v73 * 0.5) + 75.0) - 20.0) + v22);
cocos2d::CCNode::convertToNodeSpace(v54, (char *)&v74 + 8, v55);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v53 + 184))(v52, v56);
}
cocos2d::CCNode::convertToNodeSpace(*(_QWORD *)(a1 + 552), v78, &v74);
v57 = cocos2d::CCSprite::createWithSpriteFrameName("edit_leftBtn_001.png");
v58 = v57;
if ( a11 )
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v57 + 352LL))(v57);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v58 + 160LL))(v58);
v59 = CCMenuItemSpriteExtra::create((int)v58, 0, a1, (__int64)SetIDPopup::onItemIDArrow);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v59);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v59 + 64LL))(v59, 1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)((char *)&v74 + 8), -50.0, 0.0);
cocos2d::CCPoint::operator+(v78, &v71, v60);
(*(void (__fastcall **)(cocos2d::CCObject *, void **))(*(_QWORD *)v59 + 184LL))(v59, &v71);
*((_DWORD *)v59 + 93) = 0x40000000;
v61 = cocos2d::CCSprite::createWithSpriteFrameName("edit_rightBtn_001.png");
v62 = v61;
if ( a11 )
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v61 + 352LL))(v61);
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v62 + 160LL))(v62);
v63 = CCMenuItemSpriteExtra::create((int)v62, 0, a1, (__int64)SetIDPopup::onItemIDArrow);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v63);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v63 + 64LL))(v63, 2);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)((char *)&v74 + 8), 50.0, 0.0);
cocos2d::CCPoint::operator+(v78, &v71, v64);
(*(void (__fastcall **)(cocos2d::CCObject *, void **))(*(_QWORD *)v63 + 184LL))(v63, &v71);
*((_DWORD *)v63 + 93) = 0x40000000;
v65 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_closeBtn_001.png");
LODWORD(v63) = (_DWORD)v65;
(*(void (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v65 + 160LL))(v65);
v66 = CCMenuItemSpriteExtra::create((int)v63, 0, a1, (__int64)SetIDPopup::onCancel);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**(_QWORD **)(a1 + 552) + 464LL))(*(_QWORD *)(a1 + 552), v66);
*((_DWORD *)v66 + 93) = 1070386381;
v67 = *(_QWORD *)v66;
v68 = *(_QWORD *)(a1 + 552);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)((char *)&v74 + 8),
(float)((float)(v72 * 0.5) - 110.0) + 10.0,
(float)((float)((float)(v73 * 0.5) + 75.0) - 10.0) + v22);
cocos2d::CCNode::convertToNodeSpace(v68, &v71, v69);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(v67 + 184))(v66, v70);
SetIDPopup::updateTextInputLabel(a1);
*(_BYTE *)(a1 + 676) = 0;
sub_14003D310((__int64)a5);
sub_14003D310((__int64)a6);
return 1;
}
else
{
sub_14003D310((__int64)a5);
sub_14003D310((__int64)a6);
return 0;
}
}