//
// CharacterColorPage::onMode from 0xb51de4 to 0xb51fd4 (496 bytes)
//
// 3 xrefs:
// > ??> @ 0xdde18
// > CharacterColorPage::init @ 0xb52900
// > ??> @ 0x1546a60
//
// 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::onMode(CharacterColorPage *this, cocos2d::CCObject *a2)
{
GameManager *v3; // x0
int v4; // w20
__int64 v6; // x0
DialogLayer *v7; // x0
DialogLayer *v8; // x20
__int64 v9; // [xsp+30h] [xbp+30h] BYREF
size_t v10; // [xsp+38h] [xbp+38h]
void *v11; // [xsp+40h] [xbp+40h]
__int64 v12[2]; // [xsp+48h] [xbp+48h] BYREF
void *v13; // [xsp+58h] [xbp+58h]
__int64 v14; // [xsp+60h] [xbp+60h] BYREF
size_t v15; // [xsp+68h] [xbp+68h]
void *v16; // [xsp+70h] [xbp+70h]
v3 = (GameManager *)(*(__int64 (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)a2 + 64LL))(a2);
v4 = (int)v3;
if ( (_DWORD)v3 != 2
|| (v6 = GameManager::sharedState(v3), (unsigned __int8)GameManager::isIconUnlocked(v6, 2, 0x63u)) )
{
CharacterColorPage::updateColorMode(this, v4);
}
else
{
v9 = 0;
v10 = 0;
v11 = nullptr;
std::string::__init(&v9, "Complete 10 Map Packs to unlock Glow.", 0x3Du);
v12[0] = 0;
v12[1] = 0;
v13 = nullptr;
std::string::__init(v12, "The Shopkeeper", 0xEu);
v14 = 0;
v15 = 0;
v16 = nullptr;
if ( (v9 & 1) != 0 )
{
std::string::__init(&v14, v11, v10);
}
else
{
v14 = v9;
v15 = v10;
v16 = v11;
}
v7 = (DialogLayer *)DialogObject::create((char *)v12, (char *)&v14, 5, 0, 0xFFFFFF, 1.0);
v8 = (DialogLayer *)DialogLayer::create(v7, (DialogObject *)((char *)&dword_0 + 2));
if ( (v14 & 1) != 0 )
operator delete(v16);
if ( (v12[0] & 1) != 0 )
operator delete(v13);
(*(void (__fastcall **)(_QWORD, DialogLayer *, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
v8,
100);
DialogLayer::updateChatPlacement((__int64)v8, 0);
DialogLayer::animateInRandomSide(v8);
if ( (v9 & 1) != 0 )
operator delete(v11);
}
return _stack_chk_guard;
}