//
// CharacterColorPage::init from 0x10073c1f0 to 0x10073cd6b (2939 bytes)
//
// 2 xrefs:
// > CharacterColorPage::create @ 0x10073c192
// > ??> @ 0x100b9aea8
//
// 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 12:36:27 +0000
//
__int64 __fastcall CharacterColorPage::init(__int64 a1)
{
__int64 result; // rax
__int64 v3; // rax
void *v4; // rbx
double v5; // xmm0_8
char *v6; // rbx
signed int v7; // r15d
void *v8; // rax
int v9; // edx
int v10; // ecx
int v11; // r8d
int v12; // r9d
__int64 v13; // rbx
__int64 v14; // rdi
__int64 v15; // rax
__int64 v16; // rax
void *v17; // rbx
__int64 v18; // r13
__int64 v19; // rax
char *v20; // rdi
unsigned __int64 *v21; // rsi
_DWORD *v22; // rax
int v23; // ecx
char v24; // r13
float v25; // xmm0_4
char *v26; // rbx
__int64 v27; // r14
char *v28; // r13
__int64 v29; // rax
std::string::pointer data; // r14
std::string::pointer v31; // rdi
char *v32; // r15
void *v33; // rbx
__int64 v34; // r12
std::string::pointer v35; // rdi
char *v36; // r15
void *v37; // rbx
__int64 v38; // r12
char *v39; // r14
void *v40; // rbx
__int64 v41; // r15
double v42; // xmm0_8
char *v43; // rbx
char *v44; // r15
char *v45; // rbx
__int64 v46; // rax
__int64 v47; // rbx
void *v48; // rax
__int64 v49; // rbx
__int64 v50; // rbx
float v51; // [rsp+8h] [rbp-88h] BYREF
unsigned __int64 v52; // [rsp+10h] [rbp-80h] BYREF
unsigned __int64 v53; // [rsp+18h] [rbp-78h] BYREF
__int64 v54; // [rsp+20h] [rbp-70h]
unsigned int v55; // [rsp+2Ch] [rbp-64h]
__int64 v56; // [rsp+30h] [rbp-60h] BYREF
std::string v57; // [rsp+38h] [rbp-58h] BYREF
unsigned __int64 v58; // [rsp+50h] [rbp-40h] BYREF
__int64 v59; // [rsp+58h] [rbp-38h] BYREF
unsigned __int8 v60; // [rsp+63h] [rbp-2Dh]
unsigned int v61; // [rsp+64h] [rbp-2Ch]
result = FLAlertLayer::init_1((_BYTE *)a1, 150);
if ( (_BYTE)result )
{
v60 = result;
v3 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v59, v3);
sub_100278270((__int64)&v57, 0.0, 0.0, (__m128)0x42A00000u, (__m128)0x42A00000u);
v4 = cocos2d::extension::CCScale9Sprite::create_2((__int64)"GJ_square05.png", (unsigned __int64 *)&v57);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v4 + 912LL))(v4, 255);
*(_QWORD *)(a1 + 664) = 0x43E1000043960000LL;
sub_100278260((float *)&v57, 450.0, 300.0);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v4 + 320LL))(v4, &v57);
(*(void (__fastcall **)(_QWORD, void *, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v4,
0xFFFFFFFFLL);
sub_100278250((float *)&v57, *(float *)&v59 * 0.5, *((float *)&v59 + 1) * 0.5);
v5 = (*(double (__fastcall **)(void *, std::string *))(*(_QWORD *)v4 + 184LL))(v4, &v57);
v6 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_closeBtn_001.png", v5);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v6 + 160LL))(v6, 0.80000001);
v7 = 0;
v8 = CCMenuItemSpriteExtra::create((__int64)v6, 0, a1, (__int64)CharacterColorPage::onClose, 0);
LODWORD(v6) = (_DWORD)v8;
CCMenuItemSpriteExtra::setSizeMult((__int64)v8, 1.6);
v13 = sub_1008735E0((_DWORD)v6, 0, v9, v10, v11, v12);
*(_QWORD *)(a1 + 552) = v13;
sub_100278250(
(float *)&v57,
(float)((float)(*(float *)&v59 * 0.5) - (float)(*(float *)(a1 + 668) * 0.5)) + 10.0,
(float)((float)(*(float *)(a1 + 664) * 0.5) + (float)(*((float *)&v59 + 1) * 0.5)) + -10.0);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v13 + 184LL))(v13, &v57);
v14 = *(_QWORD *)(a1 + 584);
(*(void (__fastcall **)(__int64, _QWORD, __int64))(*(_QWORD *)v14 + 464LL))(v14, *(_QWORD *)(a1 + 552), 10);
v15 = sub_1007FE900(v14);
*(_QWORD *)(a1 + 672) = v15;
cocos2d::CCObject::retain(v15);
sub_100278250(
(float *)&v53,
*(float *)&v59 * 0.5,
(float)((float)(*(float *)(a1 + 664) * 0.5) + (float)(*((float *)&v59 + 1) * 0.5)) + -62.0);
v16 = GameManager::sharedState();
v55 = *(_DWORD *)(v16 + 716) - *(_DWORD *)(v16 + 720);
sub_100278270((__int64)&v57, 0.0, 0.0, (__m128)0x42A00000u, (__m128)0x42A00000u);
v17 = cocos2d::extension::CCScale9Sprite::create_2((__int64)"square02b_001.png", (unsigned __int64 *)&v57);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v17 + 912LL))(v17, 45);
sub_100278260(&v51, *(float *)(a1 + 668) + -30.0, 60.0);
(*(void (__fastcall **)(void *, float *))(*(_QWORD *)v17 + 320LL))(v17, &v51);
(*(void (__fastcall **)(_QWORD, void *, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v17, 8);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v17 + 184LL))(v17, &v53);
v57.__r_.__value_.__s.__data_[1] = 0;
*(_WORD *)&v57.__r_.__value_.__l.0 = 0;
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v17 + 960LL))(v17, &v57);
v54 = a1;
do
{
sub_1002782D0(&v57, &qword_100BE67A8);
v22 = (_DWORD *)GameManager::sharedState();
switch ( v7 )
{
case 0:
v23 = v22[179] - v22[180];
goto LABEL_11;
case 1:
v61 = v22[182] - v22[183];
v24 = 1;
goto LABEL_17;
case 2:
v23 = v22[185] - v22[186];
goto LABEL_11;
case 3:
v23 = v22[188] - v22[189];
goto LABEL_11;
case 4:
v23 = v22[191] - v22[192];
goto LABEL_11;
case 5:
v61 = v22[194] - v22[195];
v25 = -6.0;
goto LABEL_15;
case 6:
v61 = v22[197] - v22[198];
v25 = -4.0;
LABEL_15:
sub_100278250((float *)&v56, v25, 0.0);
sub_100278300(&v57, &v56);
break;
case 7:
v23 = v22[200] - v22[201];
LABEL_11:
v61 = v23;
break;
}
v24 = 0;
LABEL_17:
v26 = SimplePlayer::create(v55);
sub_100278250((float *)&v52, (float)((float)v7 * 52.0) + -182.0, 0.0);
sub_100278350((double *)&v58, &v52, (unsigned __int64 *)&v57);
sub_100278350((double *)&v56, &v53, &v58);
if ( v24 )
{
v27 = v54;
v28 = (char *)CCMenuItemSpriteExtra::create((__int64)v26, 0, v54, (__int64)CharacterColorPage::toggleShip, 0);
(*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v28 + 72LL))(v28, 1);
sub_100278260((float *)&v58, 30.0, 30.0);
(*(void (__fastcall **)(char *, unsigned __int64 *))(*(_QWORD *)v28 + 320LL))(v28, &v58);
sub_100278250((float *)&v58, 15.0, 15.0);
(*(void (__fastcall **)(char *, unsigned __int64 *))(*(_QWORD *)v26 + 184LL))(v26, &v58);
(*(void (__fastcall **)(_QWORD, char *))(**(_QWORD **)(v27 + 552) + 456LL))(*(_QWORD *)(v27 + 552), v28);
cocos2d::CCNode::convertToNodeSpace((double *)&v58, *(_QWORD *)(v27 + 552), (unsigned int *)&v56);
v19 = *(_QWORD *)v28;
v20 = v28;
v18 = v27;
v21 = &v58;
}
else
{
v18 = v54;
(*(void (__fastcall **)(_QWORD, char *, __int64))(**(_QWORD **)(v54 + 584) + 464LL))(
*(_QWORD *)(v54 + 584),
v26,
10);
v19 = *(_QWORD *)v26;
v20 = v26;
v21 = (unsigned __int64 *)&v56;
}
(*(void (__fastcall **)(char *, unsigned __int64 *))(v19 + 184))(v20, v21);
sub_1007FEBF0(*(_QWORD *)(v18 + 672), v26);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v26 + 160LL))(v26, 1.15);
SimplePlayer::updatePlayerFrame((__int64)v26, v61, v7++);
}
while ( v7 != 8 );
v29 = sub_1007FE900(v26);
*(_QWORD *)(v18 + 680) = v29;
cocos2d::CCObject::retain(v29);
*(_WORD *)&v57.__r_.__value_.__l.0 = 0;
std::string::assign(&v57, "Col1");
data = v57.__r_.__value_.__s.__data_;
v31 = v57.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v57.__r_.__value_.__s.0 & 1) != 0 )
v31 = v57.__r_.__value_.__l.__data_;
v32 = ButtonSprite::create_1(
(__int64)v31,
0x28u,
0,
0,
(__int64)"bigFont.fnt",
(__int64)"GJ_button_01.png",
0.40000001,
20.0);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v32 + 160LL))(v32, 0.85000002);
v33 = CCMenuItemSpriteExtra::create((__int64)v32, 0, v18, (__int64)CharacterColorPage::onMode, 0);
CCMenuItemSpriteExtra::setSizeMult((__int64)v33, 1.1);
(*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)v33 + 72LL))(v33, 0);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(v18 + 552) + 456LL))(*(_QWORD *)(v18 + 552), v33);
v34 = *(_QWORD *)(v18 + 552);
sub_100278250(
(float *)&v58,
(float)((float)(*(float *)(v18 + 668) * 0.5) + (float)(*(float *)&v59 * 0.5)) + -137.0,
(float)((float)(*(float *)(v18 + 664) * 0.5) + (float)(*((float *)&v59 + 1) * 0.5)) + -17.0);
cocos2d::CCNode::convertToNodeSpace((double *)&v56, v34, (unsigned int *)&v58);
(*(void (__fastcall **)(void *, __int64 *))(*(_QWORD *)v33 + 184LL))(v33, &v56);
sub_1007FEBF0(*(_QWORD *)(v18 + 680), v32);
if ( (*(_BYTE *)&v57.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v57.__r_.__value_.__l.__data_);
*(_WORD *)&v57.__r_.__value_.__l.0 = 0;
std::string::assign(&v57, "Col2");
v35 = v57.__r_.__value_.__s.__data_;
if ( (*(_BYTE *)&v57.__r_.__value_.__s.0 & 1) != 0 )
v35 = v57.__r_.__value_.__l.__data_;
v36 = ButtonSprite::create_1(
(__int64)v35,
0x28u,
0,
0,
(__int64)"bigFont.fnt",
(__int64)"GJ_button_01.png",
0.40000001,
20.0);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v36 + 160LL))(v36, 0.85000002);
v37 = CCMenuItemSpriteExtra::create((__int64)v36, 0, v18, (__int64)CharacterColorPage::onMode, 0);
CCMenuItemSpriteExtra::setSizeMult((__int64)v37, 1.1);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v37 + 72LL))(v37, 1);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(v18 + 552) + 456LL))(*(_QWORD *)(v18 + 552), v37);
v38 = *(_QWORD *)(v18 + 552);
sub_100278250(
(float *)&v58,
(float)((float)((float)(*(float *)(v18 + 668) * 0.5) + (float)(*(float *)&v59 * 0.5)) + -137.0) + 50.0,
(float)((float)(*(float *)(v18 + 664) * 0.5) + (float)(*((float *)&v59 + 1) * 0.5)) + -17.0);
cocos2d::CCNode::convertToNodeSpace((double *)&v56, v38, (unsigned int *)&v58);
(*(void (__fastcall **)(void *, __int64 *))(*(_QWORD *)v37 + 184LL))(v37, &v56);
sub_1007FEBF0(*(_QWORD *)(v18 + 680), v36);
if ( (*(_BYTE *)&v57.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v57.__r_.__value_.__l.__data_);
*(_WORD *)&v57.__r_.__value_.__l.0 = 0;
std::string::assign(&v57, "Glow");
if ( (*(_BYTE *)&v57.__r_.__value_.__s.0 & 1) != 0 )
data = v57.__r_.__value_.__l.__data_;
v39 = ButtonSprite::create_1(
(__int64)data,
0x28u,
0,
0,
(__int64)"bigFont.fnt",
(__int64)"GJ_button_01.png",
0.40000001,
20.0);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v39 + 160LL))(v39, 0.85000002);
v40 = CCMenuItemSpriteExtra::create((__int64)v39, 0, v18, (__int64)CharacterColorPage::onMode, 0);
CCMenuItemSpriteExtra::setSizeMult((__int64)v40, 1.1);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v40 + 72LL))(v40, 2);
(*(void (__fastcall **)(_QWORD, void *))(**(_QWORD **)(v18 + 552) + 456LL))(*(_QWORD *)(v18 + 552), v40);
v41 = *(_QWORD *)(v18 + 552);
sub_100278250(
(float *)&v58,
(float)((float)((float)(*(float *)(v18 + 668) * 0.5) + (float)(*(float *)&v59 * 0.5)) + -137.0) + 100.0,
(float)((float)(*(float *)(v18 + 664) * 0.5) + (float)(*((float *)&v59 + 1) * 0.5)) + -17.0);
cocos2d::CCNode::convertToNodeSpace((double *)&v56, v41, (unsigned int *)&v58);
(*(void (__fastcall **)(void *, __int64 *))(*(_QWORD *)v40 + 184LL))(v40, &v56);
sub_1007FEBF0(*(_QWORD *)(v18 + 680), v39);
if ( (*(_BYTE *)&v57.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v57.__r_.__value_.__l.__data_);
CharacterColorPage::updateIconColors(v18);
CharacterColorPage::createColorMenu(v18);
*(_QWORD *)&v42 = (unsigned int)v59;
*(float *)&v42 = (float)((float)(*(float *)&v59 * 0.5) - (float)(*(float *)(v18 + 668) * 0.5)) + 26.0;
sub_100278250(
(float *)&v57,
*(float *)&v42,
(float)((float)(*((float *)&v59 + 1) * 0.5) - (float)(*(float *)(v18 + 664) * 0.5)) + 23.0);
v43 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_checkOn_001.png", v42);
v44 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_checkOff_001.png", v42);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v43 + 160LL))(v43, 0.60000002);
(*(void (__fastcall **)(char *, float))(*(_QWORD *)v44 + 160LL))(v44, 0.60000002);
v45 = CCMenuItemToggler::create((__int64)v43, (__int64)v44, v18, (__int64)CharacterColorPage::toggleGlow, 0);
*(_QWORD *)(v18 + 712) = v45;
v46 = GameManager::sharedState();
CCMenuItemToggler::toggle((__int64)v45, *(unsigned __int8 *)(v46 + 912) ^ 1);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v18 + 552) + 456LL))(
*(_QWORD *)(v18 + 552),
*(_QWORD *)(v18 + 712));
v47 = *(_QWORD *)(v18 + 712);
cocos2d::CCNode::convertToNodeSpace((double *)&v56, *(_QWORD *)(v18 + 552), (unsigned int *)&v57);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v47 + 184LL))(v47, &v56);
CCMenuItemToggler::setSizeMult(*(_QWORD *)(v18 + 712), 1.5);
v48 = cocos2d::CCLabelBMFont::create_3((__int64)"Glow", (__int64)"bigFont.fnt");
*(_QWORD *)(v18 + 720) = v48;
(*(void (__fastcall **)(_QWORD, void *, __int64))(**(_QWORD **)(v18 + 584) + 464LL))(*(_QWORD *)(v18 + 584), v48, 2);
v49 = *(_QWORD *)(v18 + 720);
sub_100278250((float *)&v56, 0.0, 0.5);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v49 + 296LL))(v49, &v56);
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(v18 + 720) + 160LL))(*(_QWORD *)(v18 + 720), 0.44999999);
v50 = *(_QWORD *)(v18 + 720);
sub_100278250((float *)&v58, 18.0, 0.0);
sub_100278350((double *)&v56, (unsigned __int64 *)&v57, &v58);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v50 + 184LL))(v50, &v56);
CharacterColorPage::updateColorMode(v18, 0);
return v60;
}
return result;
}