//
// ColorSelectPopup::textChanged from 0x1004a24d8 to 0x1004a280c (820 bytes)
//
// 2 xrefs:
// > sub_1004A28DC @ 0x1004a28e0
// > ??> @ 0x10097cd18
//
// 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 11:06:02 +0000
//
void __fastcall ColorSelectPopup::textChanged(__int64 a1, __int64 a2)
{
int v4; // w0
int v5; // w21
double v6; // d8
char *v7; // x22
char v8; // w21
int v9; // w0
int v10; // w0
int v11; // w0
__int16 v12; // w8
char *v13; // x20
int v14; // w8
size_t v15; // x21
int v16; // w0
char *v17; // x20
float v18; // s0
void *v19; // x0
float v20; // s0
float v21; // s1
_BOOL4 v22; // w8
_BOOL4 v23; // w9
char *v24; // x20
int v25; // w8
void *__p[2]; // [xsp+10h] [xbp-60h] BYREF
char v27; // [xsp+27h] [xbp-49h]
char __s[8]; // [xsp+28h] [xbp-48h] BYREF
char v29; // [xsp+3Fh] [xbp-31h]
if ( (*(_BYTE *)(a1 + 744) & 1) == 0 )
{
v4 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
if ( v4 > 7 )
{
if ( (unsigned int)(v4 - 8) < 3 )
{
CCTextInputNode::getString(a2, __s);
if ( v29 < 0 )
{
v7 = *(char **)__s;
v5 = atoi(*(const char **)__s);
operator delete(v7);
}
else
{
v5 = atoi(__s);
}
if ( (v5 & ~(v5 >> 31)) >= 255 )
v8 = -1;
else
v8 = v5 & ~(v5 >> 31);
v9 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
switch ( v9 )
{
case 10:
*(_BYTE *)(a1 + 1114) = v8;
break;
case 9:
*(_BYTE *)(a1 + 1113) = v8;
break;
case 8:
*(_BYTE *)(a1 + 1112) = v8;
break;
}
v12 = *(_WORD *)(a1 + 1112);
__s[2] = *(_BYTE *)(a1 + 1114);
*(_WORD *)__s = v12;
LABEL_30:
(*(void (__fastcall **)(_QWORD, char *))(**(_QWORD **)(a1 + 1032) + 1360LL))(*(_QWORD *)(a1 + 1032), __s);
return;
}
if ( v4 != 11 )
return;
CCTextInputNode::getString(*(_QWORD *)(a1 + 1288), __s);
if ( v29 < 0 )
{
v15 = strlen(*(const char **)__s);
operator delete(*(void **)__s);
if ( v15 != 6 )
return;
}
else if ( strlen(__s) != 6 )
{
return;
}
CCTextInputNode::getString(*(_QWORD *)(a1 + 1288), __p);
v16 = sub_1004A1E60((const char *)__p);
*(_WORD *)(a1 + 1112) = v16;
*(_BYTE *)(a1 + 1114) = BYTE2(v16);
if ( v27 < 0 )
{
operator delete(__p[0]);
v16 = *(unsigned __int16 *)(a1 + 1112) | (*(unsigned __int8 *)(a1 + 1114) << 16);
}
*(_WORD *)__s = v16;
__s[2] = BYTE2(v16);
goto LABEL_30;
}
switch ( v4 )
{
case 3:
CCTextInputNode::getString(a2, __s);
if ( v29 < 0 )
{
v13 = *(char **)__s;
*(_DWORD *)(a1 + 1168) = atoi(*(const char **)__s);
operator delete(v13);
v10 = *(_DWORD *)(a1 + 1168);
}
else
{
v10 = atoi(__s);
*(_DWORD *)(a1 + 1168) = v10;
}
v14 = v10 & ~(v10 >> 31);
if ( v14 >= 999 )
v14 = 999;
*(_DWORD *)(a1 + 1168) = v14;
sub_1004A2460(a1);
sub_1001AD6E0(a1);
break;
case 4:
CCTextInputNode::getString(a2, __s);
if ( v29 < 0 )
{
v24 = *(char **)__s;
*(_DWORD *)(a1 + 1176) = atoi(*(const char **)__s);
operator delete(v24);
v11 = *(_DWORD *)(a1 + 1176);
}
else
{
v11 = atoi(__s);
*(_DWORD *)(a1 + 1176) = v11;
}
v25 = v11 & ~(v11 >> 31);
if ( v25 >= 999 )
v25 = 999;
*(_DWORD *)(a1 + 1176) = v25;
sub_1004A2828(a1);
break;
case 5:
CCTextInputNode::getString(a2, __s);
if ( v29 < 0 )
{
v17 = *(char **)__s;
v6 = atof(*(const char **)__s);
operator delete(v17);
}
else
{
v6 = atof(__s);
}
v18 = v6;
v19 = sub_1003065B0("%.02f", v18);
*(float *)(a1 + 1128) = cocos2d::CCString::floatValue((__int64)v19);
sub_1004A1908(a1);
v20 = *(float *)(a1 + 1128) / 10.0;
v21 = 1.0;
v22 = v20 >= 1.0;
v23 = v20 > 0.0 || v20 >= 1.0;
if ( v20 <= 0.0 )
v22 = 1;
if ( !v23 )
v21 = 0.0;
if ( v22 )
v20 = v21;
Slider::setValue(*(_QWORD *)(a1 + 1056), v20);
break;
}
}
}