//
// CharacterColorPage::createColorMenu from 0x69d3b0 to 0x69d634 (644 bytes)
//
// 1 xrefs:
// > CharacterColorPage::init @ 0x69dc4a
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:56:20 +0000
//
ColorChannelSprite *__fastcall CharacterColorPage::createColorMenu(cocos2d::CCDictionary **this)
{
int v2; // r7
cocos2d::CCArray *v3; // r0
cocos2d::CCObject *v4; // r0
const char *v5; // r1
cocos2d::CCObject *v6; // r4
cocos2d::CCDictionary *v7; // r0
cocos2d::CCObject *v8; // r0
signed int v9; // r4
int v10; // s17
ColorChannelSprite *result; // r0
int v12; // r10
float *v13; // r6
const char *v14; // r1
cocos2d::CCSprite *v15; // r0
int v16; // r7
void (__fastcall *v17)(int, __int16 *); // r11
int v18; // r7
GameManager *v19; // r0
void (__fastcall *v20)(float *, __int16 *); // r7
GameManager *v21; // r0
int v22; // r0
int (__fastcall *v23)(int, __int16 *); // [sp+10h] [bp-5Ch]
cocos2d::CCPoint *v24; // [sp+14h] [bp-58h]
float v25[2]; // [sp+20h] [bp-4Ch] BYREF
_BYTE v26[8]; // [sp+28h] [bp-44h] BYREF
float v27[2]; // [sp+30h] [bp-3Ch] BYREF
_BYTE v28[8]; // [sp+38h] [bp-34h] BYREF
_BYTE v29[8]; // [sp+40h] [bp-2Ch] BYREF
__int16 v30; // [sp+48h] [bp-24h] BYREF
char v31; // [sp+4Ah] [bp-22h]
unsigned int (__fastcall *v32)(CharacterColorPage *, cocos2d::CCObject *); // [sp+50h] [bp-1Ch]
int v33; // [sp+54h] [bp-18h]
int v34[2]; // [sp+58h] [bp-14h] BYREF
cocos2d::CCSprite *v35; // [sp+60h] [bp-Ch]
v2 = 3;
cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)this);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v25);
v3 = (cocos2d::CCArray *)cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v26,
v25[0] * 0.5,
(float)(v25[1] * 0.5) - 59.0);
v4 = (cocos2d::CCObject *)cocos2d::CCArray::create(v3);
*(this + 136) = v4;
cocos2d::CCObject::retain(v4);
do
{
v6 = (cocos2d::CCObject *)cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"GJ_select_001.png", v5);
(*(void (__fastcall **)(cocos2d::CCObject *, int))(*(_DWORD *)v6 + 80))(v6, 1060320051);
(*(void (__fastcall **)(_DWORD, cocos2d::CCObject *, int))(*(_DWORD *)*(this + 115) + 232))(*(this + 115), v6, 11);
v7 = (cocos2d::CCDictionary *)cocos2d::CCArray::addObject(*(this + 136), v6);
--v2;
}
while ( v2 );
v8 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v7);
v9 = 0;
*(this + 135) = v8;
cocos2d::CCObject::retain(v8);
do
{
v10 = (int)floorf((float)(v9 / 18));
result = (ColorChannelSprite *)CharacterColorPage::colorForIndex((CharacterColorPage *)this, v9);
v12 = (int)result;
if ( (int)result >= 0 )
{
v13 = (float *)ColorChannelSprite::create(result);
cocos2d::CCDictionary::setObject(*(this + 135), (cocos2d::CCObject *)v13, v12);
(*(void (__fastcall **)(float *, int))(*(_DWORD *)v13 + 80))(v13, 1059481190);
v34[0] = 0;
v34[1] = 0;
v35 = nullptr;
std::string::__init(v34, "GJ_lockGray_001.png", 0x13u);
if ( (v34[0] & 1) != 0 )
v15 = v35;
else
v15 = (cocos2d::CCSprite *)((char *)v34 + 1);
v16 = cocos2d::CCSprite::createWithSpriteFrameName(v15, v14);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v16 + 80))(v16, 1061997773);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v16 + 36))(v16, 100);
(*(void (__fastcall **)(float *, int))(*(_DWORD *)v13 + 228))(v13, v16);
v17 = *(void (__fastcall **)(int, __int16 *))(*(_DWORD *)v16 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v30, v13[86] * 0.5, v13[87] * 0.5);
v17(v16, &v30);
v32 = CharacterColorPage::onPlayerColor;
v33 = 0;
v18 = CCMenuItemSpriteExtra::create((int)v13, 0, (int)this, (int)CharacterColorPage::onPlayerColor, 0);
(*(void (__fastcall **)(int, int))(*(_DWORD *)v18 + 36))(v18, v12);
(*(void (__fastcall **)(_DWORD, int))(*(_DWORD *)*(this + 111) + 228))(*(this + 111), v18);
CharacterColorPage::offsetForIndex((CharacterColorPage *)&v30, (int)this, v9);
cocos2d::CCPoint::operator*(v27, &v30, 1094713344);
v23 = *(int (__fastcall **)(int, __int16 *))(*(_DWORD *)v18 + 92);
v24 = *(this + 111);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v28,
(float)((float)((float)((float)(v9 % 18) * 24.0) - 204.0) + v27[0]) + 6.0,
(float)(96.0 - (float)((float)v10 * 24.0)) + v27[1]);
cocos2d::CCPoint::operator+(v29, v26, v28);
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)&v30, v24);
v19 = (GameManager *)v23(v18, &v30);
v20 = *(void (__fastcall **)(float *, __int16 *))(*(_DWORD *)v13 + 480);
v21 = (GameManager *)GameManager::sharedState(v19);
v22 = GameManager::colorForIdx(v21, v12);
v30 = v22;
v31 = BYTE2(v22);
v20(v13, &v30);
result = (ColorChannelSprite *)std::string::~string((int)v34);
}
++v9;
}
while ( v9 != 144 );
return result;
}