//
// CharacterColorPage::updateIconColors from 0xb519c8 to 0xb51b68 (416 bytes)
//
// 4 xrefs:
// > CharacterColorPage::toggleGlow @ 0xb51b9c
// > CharacterColorPage::onPlayerColor @ 0xb51cf8
// > CharacterColorPage::init @ 0xb529d8
// > ??> @ 0x9c2e0
//
// 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::updateIconColors(cocos2d::CCArray **this)
{
unsigned int v2; // w20
GameManager *v3; // x0
char v4; // w22
GameManager *v5; // x19
__int64 v6; // x0
int v7; // w0
GameManager *v8; // x19
__int64 v9; // x0
int v10; // w0
__int64 v11; // x0
int v12; // w1
GameManager *v13; // x0
GameManager *v14; // x0
int v15; // w0
SimplePlayer *v16; // x19
GameManager *v17; // x0
__int64 v18; // x0
int v20; // [xsp+58h] [xbp+58h]
__int16 v21; // [xsp+60h] [xbp+60h] BYREF
char v22; // [xsp+62h] [xbp+62h]
__int16 v23; // [xsp+68h] [xbp+68h]
char v24; // [xsp+6Ah] [xbp+6Ah]
__int16 v25; // [xsp+70h] [xbp+70h] BYREF
char v26; // [xsp+72h] [xbp+72h]
v2 = 0;
v3 = (GameManager *)GameManager::sharedState(_stack_chk_guard);
v4 = *((_BYTE *)v3 + 912);
v5 = (GameManager *)GameManager::sharedState(v3);
v6 = GameManager::sharedState(v5);
v7 = GameManager::colorForIdx(v5, *(_DWORD *)(v6 + 812) - *(_DWORD *)(v6 + 816));
v22 = BYTE2(v7);
v21 = v7;
v8 = (GameManager *)GameManager::sharedState((GameManager *)v7);
v9 = GameManager::sharedState(v8);
v10 = GameManager::colorForIdx(v8, *(_DWORD *)(v9 + 824) - *(_DWORD *)(v9 + 828));
v24 = BYTE2(v10);
v23 = v10;
v11 = GameManager::sharedState((GameManager *)v10);
v12 = *(_DWORD *)(v11 + 836);
v13 = (GameManager *)*(unsigned int *)(v11 + 840);
v20 = v12 - (_DWORD)v13;
v14 = (GameManager *)GameManager::sharedState(v13);
v15 = GameManager::colorForIdx(v14, v20);
v25 = v15;
v26 = BYTE2(v15);
while ( v2 < (unsigned int)cocos2d::CCArray::count(*(this + 84)) )
{
v16 = (SimplePlayer *)cocos2d::CCArray::objectAtIndex(*(this + 84), v2);
(*(void (__fastcall **)(SimplePlayer *, __int16 *))(*(_QWORD *)v16 + 960LL))(v16, &v21);
v17 = (GameManager *)SimplePlayer::setSecondColor(v16);
*((_BYTE *)v16 + 660) = v4;
v18 = GameManager::sharedState(v17);
if ( *(_DWORD *)(v18 + 836) - *(_DWORD *)(v18 + 840) < 0 )
SimplePlayer::disableCustomGlowColor((__int64)v16);
else
SimplePlayer::enableCustomGlowColor((__int64)v16, (__int64)&v25);
++v2;
SimplePlayer::updateColors(v16);
}
return _stack_chk_guard;
}