//
// EditorUI::editButtonUsable from 0x7c495c to 0x7c4e10 (1204 bytes)
//
// 3 xrefs:
// > EditorUI::toggleEditObjectButton @ 0x7c5b3c
// > EditorUI::editObject @ 0x7c8ae4
// > ??> @ 0xccdf0
//
// 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 12:54:08 +0000
//
__int64 __fastcall EditorUI::editButtonUsable(EditorUI *this)
{
GameObject *v1; // x1
cocos2d::CCArray *v3; // x2
GameObject *v4; // x0
GameObject *v5; // x0
unsigned int v6; // w21
GameObject *v7; // x0
unsigned int v8; // w21
int v9; // w0
unsigned int v11; // w21
unsigned int v12; // w21
GameObject *v13; // x0
int v14; // [xsp+3Ch] [xbp+3Ch] BYREF
int v15; // [xsp+40h] [xbp+40h] BYREF
int v16; // [xsp+44h] [xbp+44h] BYREF
v1 = *((GameObject **)this + 187);
v3 = *((cocos2d::CCArray **)this + 112);
v14 = -1;
v15 = -1;
v16 = -1;
EditorUI::getGroupInfo(this, v1, v3, &v14, &v15, &v16);
if ( v14 > 1914 )
{
if ( v14 != 2999 )
{
if ( v14 > 2999 )
{
if ( v14 > 3615 )
{
if ( v14 <= 3643 )
{
if ( v14 >= 3640 || (unsigned int)(v14 - 3617) <= 3 )
return 1;
goto LABEL_11;
}
if ( v14 != 3655 )
{
if ( v14 > 3655 )
{
if ( (unsigned int)(v14 - 3660) > 3 )
goto LABEL_11;
}
else if ( v14 != 3645 )
{
goto LABEL_11;
}
}
}
else if ( v14 < 3612 )
{
if ( v14 > 3033 )
{
if ( v14 == 3600 || v14 >= 3600 && (unsigned int)(v14 - 3602) <= 7 )
return 1;
goto LABEL_11;
}
if ( v14 >= 3029 || v14 == 3022 )
return 1;
if ( v14 > 3022 )
{
if ( v14 != 3024 )
goto LABEL_11;
}
else if ( (unsigned int)(v14 - 3006) > 0xA )
{
goto LABEL_11;
}
}
}
else if ( v14 > 2069 )
{
if ( v14 != 2907 )
{
if ( v14 > 2907 )
{
if ( v14 >= 2909 && (v14 <= 2917 || (unsigned int)(v14 - 2919) <= 6) )
return 1;
}
else if ( v14 >= 2899 && (v14 <= 2901 || (unsigned int)(v14 - 2903) <= 2) )
{
return 1;
}
goto LABEL_11;
}
}
else if ( v14 < 2066 )
{
if ( v14 > 1935 )
{
if ( v14 >= 2015 && (v14 <= 2016 || (unsigned int)(v14 - 2062) <= 1) )
return 1;
}
else if ( v14 >= 1931 || (unsigned int)(v14 - 1916) <= 1 )
{
return 1;
}
goto LABEL_11;
}
}
return 1;
}
if ( v14 >= 1912 )
return 1;
if ( v14 <= 901 )
{
if ( v14 < 899 )
{
if ( v14 > 203 )
{
if ( v14 != 660 )
{
if ( v14 > 660 )
{
if ( v14 >= 717 && (v14 <= 718 || (unsigned int)(v14 - 743) <= 2) )
return 1;
}
else if ( v14 == 221 || v14 >= 221 && (unsigned int)(v14 - 286) <= 1 )
{
return 1;
}
goto LABEL_11;
}
}
else if ( v14 < 200 )
{
if ( v14 <= 33 )
{
if ( v14 >= 29 || (unsigned int)(v14 - 12) <= 1 )
return 1;
goto LABEL_11;
}
if ( v14 != 105 )
{
if ( v14 > 105 )
{
if ( v14 == 111 || v14 == 142 )
return 1;
goto LABEL_11;
}
if ( v14 != 47 )
goto LABEL_11;
}
}
}
return 1;
}
if ( v14 == 1520 )
return 1;
if ( v14 > 1520 )
{
if ( v14 != 1616 )
{
if ( v14 > 1616 )
{
if ( v14 >= 1811 && (v14 <= 1812 || (unsigned int)(v14 - 1814) <= 5) )
return 1;
goto LABEL_11;
}
if ( v14 != 1595 )
{
if ( v14 > 1595 )
{
if ( (unsigned int)(v14 - 1611) > 2 )
goto LABEL_11;
}
else if ( v14 != 1585 )
{
goto LABEL_11;
}
}
}
return 1;
}
if ( v14 == 1268 )
return 1;
if ( v14 > 1268 )
{
if ( v14 != 1334 )
{
if ( v14 > 1334 )
{
if ( (unsigned int)(v14 - 1346) > 1 )
goto LABEL_11;
}
else if ( v14 != 1331 )
{
goto LABEL_11;
}
}
return 1;
}
if ( v14 > 1007 )
{
if ( v14 != 1049 )
goto LABEL_11;
return 1;
}
if ( v14 >= 1006 || v14 == 915 )
return 1;
LABEL_11:
v4 = *((GameObject **)this + 187);
if ( v4 )
{
if ( GameObject::isBasicTrigger(v4) )
return 1;
v5 = *((GameObject **)this + 187);
if ( v5 )
{
if ( GameObject::canChangeCustomColor(v5) )
return 1;
}
}
v6 = 0;
if ( (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 112)) )
{
while ( v6 < (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 112)) )
{
v7 = (GameObject *)cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 112), v6);
if ( GameObject::canChangeCustomColor(v7) )
return 1;
++v6;
}
}
v8 = 0;
if ( (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 112)) )
{
while ( v8 < (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 112)) )
{
v9 = *(_DWORD *)(cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 112), v8) + 1028);
if ( v9 != 744 )
{
if ( v9 > 744 )
{
if ( v9 < 899 || v9 > 900 && v9 != 915 )
goto LABEL_79;
}
else if ( v9 < 29 || v9 > 30 && v9 != 105 )
{
goto LABEL_79;
}
}
++v8;
}
return 1;
}
LABEL_79:
v11 = 0;
if ( (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 112)) )
{
while ( v11 < (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 112)) )
{
if ( (unsigned int)(*(_DWORD *)(cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 112), v11) + 1028)
- 3006) > 4 )
goto LABEL_80;
++v11;
}
return 1;
}
LABEL_80:
v12 = 0;
if ( (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 112)) )
{
while ( v12 < (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 112)) )
{
v13 = (GameObject *)cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 112), v12);
if ( !GameObject::isSpawnableTrigger(v13) )
return 0;
++v12;
}
return 1;
}
return 0;
}