//
// CharacterColorPage::onPlayerColor from 0x100153ad8 to 0x100153cb0 (472 bytes)
//
// 1 xrefs:
// > CharacterColorPage::createColorMenu @ 0x100153508
//
// 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 10:59:40 +0000
//
__int64 __fastcall CharacterColorPage::onPlayerColor(__int64 a1, __int64 a2)
{
__int64 v4; // x22
__int64 v5; // x21
__int64 result; // x0
__int64 v7; // x0
__int64 v8; // x0
__int64 v9; // x0
__int64 v10; // x0
int v11; // w8
_DWORD *v12; // x22
float v13; // s0
_DWORD *v14; // x22
float v15; // s0
_DWORD *v16; // x22
float v17; // s0
__int64 v18; // x21
__int64 v19; // x22
__int64 v20; // x23
__int64 v21; // x0
__n128 v22; // q0
__int64 v23; // [xsp+0h] [xbp-40h] BYREF
__int64 v24; // [xsp+8h] [xbp-38h] BYREF
if ( *(_DWORD *)(a1 + 660) )
v4 = 3;
else
v4 = 2;
v5 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
result = sub_100153D58(a1, v5, v4);
if ( (_DWORD)result )
{
v7 = sub_100153CFC(result, *(unsigned int *)(a1 + 660));
if ( (_DWORD)v7 == (_DWORD)v5 )
{
result = *(_QWORD *)(a1 + 704);
if ( result )
return (*(__int64 (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)result + 8LL))(result, v5, v4);
}
else
{
v8 = GameManager::sharedState(v7);
*(_BYTE *)(v8 + 656) = 0;
v9 = GameManager::sharedState(v8);
v10 = GameManager::colorForIdx(v9, v5);
v11 = *(_DWORD *)(a1 + 660);
switch ( v11 )
{
case 2:
v16 = (_DWORD *)GameManager::sharedState(v10);
v16[211] = v5;
v17 = vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0;
v16[210] = (int)v17;
v16[209] = v5 + (int)v17;
break;
case 1:
v14 = (_DWORD *)GameManager::sharedState(v10);
v14[208] = v5;
v15 = vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0;
v14[207] = (int)v15;
v14[206] = v5 + (int)v15;
break;
case 0:
v12 = (_DWORD *)GameManager::sharedState(v10);
v12[205] = v5;
v13 = vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0;
v12[204] = (int)v13;
v12[203] = v5 + (int)v13;
break;
}
v18 = sub_1002E75A0(*(_QWORD *)(a1 + 696), *(unsigned int *)(a1 + 660));
v19 = *(_QWORD *)(a1 + 584);
v20 = *(_QWORD *)(a1 + 552);
v21 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2);
cocos2d::CCNode::convertToWorldSpace(&v23, v20, v21);
cocos2d::CCNode::convertToNodeSpace(&v24, v19, &v23, v22);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v18 + 184LL))(v18, &v24);
return CharacterColorPage::updateIconColors(a1);
}
}
return result;
}