//
// CharacterColorPage::createColorMenu from 0xb51fd4 to 0xb523a0 (972 bytes)
//
// 2 xrefs:
// > CharacterColorPage::init @ 0xb529e0
// > ??> @ 0xb8e28
//
// This function is hookable on this platform (idp: arm, 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 13:01:59 +0000
//
__int64 __fastcall CharacterColorPage::createColorMenu(CharacterColorPage *this)
{
int v2; // w20
cocos2d::CCDirector *v3; // x0
cocos2d::CCArray *v4; // x0
cocos2d::CCObject *v5; // x0
const char *v6; // x1
cocos2d::CCObject *v7; // x19
cocos2d::CCDictionary *v8; // x0
cocos2d::CCObject *v9; // x0
signed int v10; // w19
float v11; // s8
__int64 v12; // x0
int v13; // w23
float *v14; // x20
cocos2d::CCSprite *v15; // x0
__int64 v16; // x28
void (__fastcall *v17)(__int64, __int64 *); // x24
__int64 v18; // x24
cocos2d::CCNode *v19; // x28
void (__fastcall *v20)(float *, __int64 *); // x24
GameManager *v21; // x0
unsigned __int64 v22; // x0
void (__fastcall *v24)(__int64, __int64 *); // [xsp+98h] [xbp+98h]
__int64 v25; // [xsp+A0h] [xbp+A0h] BYREF
_BYTE v26[8]; // [xsp+A8h] [xbp+A8h] BYREF
float v27; // [xsp+B0h] [xbp+B0h]
float v28; // [xsp+B4h] [xbp+B4h]
_BYTE v29[8]; // [xsp+B8h] [xbp+B8h] BYREF
__int64 v30; // [xsp+C0h] [xbp+C0h] BYREF
__int64 v31; // [xsp+C8h] [xbp+C8h] BYREF
char *v32[2]; // [xsp+D0h] [xbp+D0h] BYREF
cocos2d::CCSprite *v33; // [xsp+E0h] [xbp+E0h]
v2 = 3;
v3 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(_stack_chk_guard);
cocos2d::CCDirector::getWinSize(&v25, v3);
v4 = (cocos2d::CCArray *)cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v26,
*(float *)&v25 * 0.5,
(float)(*((float *)&v25 + 1) * 0.5) + -59.0);
v5 = (cocos2d::CCObject *)cocos2d::CCArray::create(v4);
*((_QWORD *)this + 87) = v5;
cocos2d::CCObject::retain(v5);
do
{
v7 = (cocos2d::CCObject *)cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_select_001.png", v6);
(*(void (__fastcall **)(cocos2d::CCObject *, float))(*(_QWORD *)v7 + 160LL))(v7, 0.7);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v7,
11);
v8 = (cocos2d::CCDictionary *)cocos2d::CCArray::addObject(*((cocos2d::CCArray **)this + 87), v7);
--v2;
}
while ( v2 );
v9 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v8);
*((_QWORD *)this + 86) = v9;
v10 = 0;
cocos2d::CCObject::retain(v9);
do
{
v11 = floorf((float)(v10 / 18));
v12 = CharacterColorPage::colorForIndex(this, v10);
v13 = v12;
if ( (v12 & 0x80000000) == 0 )
{
v14 = (float *)ColorChannelSprite::create((ColorChannelSprite *)v12);
cocos2d::CCDictionary::setObject(*((cocos2d::CCDictionary **)this + 86), (cocos2d::CCObject *)v14, v13);
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v14 + 160LL))(v14, 0.65);
v32[0] = nullptr;
v32[1] = nullptr;
v33 = nullptr;
std::string::__init((__int64 *)v32, "GJ_lockGray_001.png", 0x13u);
v15 = (cocos2d::CCSprite *)((char *)v32 + 1);
if ( ((__int64)v32[0] & 1) != 0 )
v15 = v33;
v16 = cocos2d::CCSprite::createWithSpriteFrameName(v15, (const char *)LOBYTE(v32[0]));
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v16 + 160LL))(v16, 0.8);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v16 + 72LL))(v16, 100);
(*(void (__fastcall **)(float *, __int64))(*(_QWORD *)v14 + 456LL))(v14, v16);
v17 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v16 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v31, v14[108] * 0.5, v14[109] * 0.5);
v17(v16, &v31);
v18 = CCMenuItemSpriteExtra::create((__int64)v14, 0, (__int64)this, (__int64)CharacterColorPage::onPlayerColor, 0);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v18 + 72LL))(v18, (unsigned int)v13);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 69) + 456LL))(*((_QWORD *)this + 69), v18);
CharacterColorPage::offsetForIndex(v10, (cocos2d::CCPoint *)&v31);
cocos2d::CCPoint::operator*(&v31, 12.0);
v24 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v18 + 184LL);
v19 = *((cocos2d::CCNode **)this + 69);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v29,
(float)((float)((float)((float)(v10 % 18) * 24.0) + -204.0) + v27) + 6.0,
(float)(96.0 - (float)((float)(int)v11 * 24.0)) + v28);
cocos2d::CCPoint::operator+(&v30, v26);
cocos2d::CCNode::convertToNodeSpace(&v31, v19, (const cocos2d::CCPoint *)&v30);
v24(v18, &v31);
v20 = *(void (__fastcall **)(float *, __int64 *))(*(_QWORD *)v14 + 960LL);
v21 = (GameManager *)GameManager::sharedState(*(GameManager **)v14);
v22 = GameManager::colorForIdx(v21, v13);
LOWORD(v31) = v22;
BYTE2(v31) = BYTE2(v22);
v20(v14, &v31);
if ( ((__int64)v32[0] & 1) != 0 )
operator delete(v33);
}
++v10;
}
while ( v10 != 144 );
return _stack_chk_guard;
}