//
// ColorSelectPopup::onDefault from 0x4df3c8 to 0x4df55e (406 bytes)
//
// 0 xrefs:
//
// 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:50:59 +0000
//
int __fastcall ColorSelectPopup::onDefault(ColorSelectPopup *this, cocos2d::CCObject *a2)
{
int result; // r0
int v4; // r0
int v5; // r5
const char *v6; // r1
int v7; // r3
int *v8; // r3
int ColorAction; // r0
void (__fastcall *v10)(ColorSelectPopup *, int, int); // r9
int *v11; // r3
unsigned int v12; // r7
int *v13; // r8
int v14; // r5
int v15; // t1
int v16; // r0
int v17; // r0
int v18; // r5
char v19; // r3
char v20; // r1
int v21; // [sp+8h] [bp-24h]
int v22[3]; // [sp+Ch] [bp-20h] BYREF
int v23[3]; // [sp+18h] [bp-14h] BYREF
result = GameManager::sharedState(this);
if ( *(_DWORD *)(result + 408) )
{
if ( *((_DWORD *)this + 132) )
{
v4 = GameManager::sharedState((GameManager *)result);
result = GJEffectManager::getColorAction(
*(GJEffectManager **)(*(_DWORD *)(*(_DWORD *)(v4 + 408) + 2084) + 264),
*(_DWORD *)(*((_DWORD *)this + 132) + 888));
v5 = result;
if ( result )
{
BYTE1(v21) = *(_BYTE *)(result + 69);
BYTE2(v21) = *(_BYTE *)(result + 70);
LOBYTE(v21) = *(_BYTE *)(result + 68);
ColorSelectPopup::selectColor((int)this, v21, BYTE1(v21));
if ( *((_DWORD *)this + 194) != *(unsigned __int8 *)(v5 + 80) )
ColorSelectPopup::onToggleTintMode(this, nullptr);
*((_DWORD *)this + 195) = *(_DWORD *)(v5 + 92);
ColorSelectPopup::updateOpacity(this);
ColorSelectPopup::updateOpacityLabel((int)this, v6);
result = *((_DWORD *)this + 184);
if ( result )
return Slider::setValue((Slider *)result, *((float *)this + 195));
}
}
else
{
v7 = *((_DWORD *)this + 133);
if ( v7 )
{
v8 = *(int **)(v7 + 52);
ColorAction = *v8;
if ( *v8 )
{
v11 = (int *)v8[3];
v12 = (unsigned int)&v11[ColorAction - 1];
v13 = v11;
while ( (unsigned int)v13 <= v12 )
{
v15 = *v13++;
v14 = v15;
if ( !v15 )
break;
v17 = GameManager::sharedState((GameManager *)ColorAction);
ColorAction = GJEffectManager::getColorAction(
*(GJEffectManager **)(*(_DWORD *)(*(_DWORD *)(v17 + 408) + 2084) + 264),
*(_DWORD *)(v14 + 888));
if ( ColorAction )
{
v18 = v14 + 1276;
v19 = *(_BYTE *)(ColorAction + 70);
v20 = *(_BYTE *)(ColorAction + 68);
*(_BYTE *)(v18 - 7) = *(_BYTE *)(ColorAction + 69);
*(_BYTE *)(v18 - 6) = v19;
*(_BYTE *)(v18 - 8) = v20;
*(_BYTE *)(v18 + 31) = *(_BYTE *)(ColorAction + 80);
*(_DWORD *)v18 = *(_DWORD *)(ColorAction + 92);
*((_DWORD *)this + 195) = *(_DWORD *)(ColorAction + 92);
}
}
}
v10 = *(void (__fastcall **)(ColorSelectPopup *, int, int))(*(_DWORD *)this + 232);
memset(v22, 0, sizeof(v22));
std::string::__init(v22, "Defaults Loaded", 0xFu);
memset(v23, 0, sizeof(v23));
std::string::__init(v23, &unk_B6B226, 0);
v16 = TextAlertPopup::create(v22, 1056964608, 1058642330, 150, v23);
v10(this, v16, 100);
std::string::~string((int)v23);
return std::string::~string((int)v22);
}
}
}
return result;
}