//
// LevelEditorLayer::updateObjectLabel from 0x4698fc to 0x469bc2 (710 bytes)
//
// 3 xrefs:
// > LevelEditorLayer::addSpecial @ 0x46e34a
// > EditorUI::dynamicGroupUpdate @ 0x48df24
// > SetupTriggerPopup::updateEditorLabel @ 0x676e6e
//
// 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:48:59 +0000
//
int __fastcall LevelEditorLayer::updateObjectLabel(int this, GameObject *a2)
{
const char **v2; // r4
int v3; // r3
int v4; // r2
unsigned int v5; // r2
bool v6; // zf
const char *v7; // r1
GJSpecialColorSelect *v8; // r2
float v9; // s16
char *v10; // r0
cocos2d::CCString *v11; // r0
cocos2d::CCString *v12; // r0
char *CString; // r0
char *v14; // r0
int v15; // r1
int v16; // r0
int v17; // r1
cocos2d::CCLabelBMFont *v18; // r2
int v19; // r0
cocos2d::CCLabelBMFont *v20; // r6
cocos2d::CCLabelBMFont *v21; // r0
void (__fastcall *v22)(cocos2d::CCLabelBMFont *, _BYTE *); // r8
float v23; // s18
int v24; // r0
_BYTE v25[8]; // [sp+4h] [bp-24h] BYREF
int v26; // [sp+Ch] [bp-1Ch] BYREF
int v27; // [sp+10h] [bp-18h]
cocos2d::CCLabelBMFont *v28; // [sp+14h] [bp-14h]
int v29; // [sp+18h] [bp-10h] BYREF
int v30; // [sp+1Ch] [bp-Ch]
cocos2d::CCLabelBMFont *v31; // [sp+20h] [bp-8h]
v2 = (const char **)this;
v3 = *(_DWORD *)(this + 892);
if ( v3 == 1616 )
goto LABEL_33;
if ( v3 > 1616 )
{
if ( v3 == 2062 )
goto LABEL_33;
if ( v3 > 2062 )
{
if ( v3 == 3033 )
goto LABEL_33;
if ( v3 > 3033 )
{
if ( v3 == 3640 || v3 == 3660 )
goto LABEL_33;
v4 = 3609;
}
else
{
if ( v3 == 2067 )
goto LABEL_33;
v4 = 3016;
}
goto LABEL_30;
}
if ( v3 > 1817 )
{
v6 = v3 == 1912;
goto LABEL_31;
}
if ( v3 >= 1814 )
goto LABEL_33;
v5 = v3 - 1811;
LABEL_20:
if ( v5 > 1 )
return this;
goto LABEL_33;
}
if ( v3 == 1268 )
goto LABEL_33;
if ( v3 <= 1268 )
{
if ( v3 >= 1008 )
{
v4 = 1049;
}
else
{
if ( v3 >= 1006 || v3 == 899 )
goto LABEL_33;
v4 = 901;
}
goto LABEL_30;
}
if ( v3 == 1585 )
goto LABEL_33;
if ( v3 <= 1585 )
{
v5 = v3 - 1346;
goto LABEL_20;
}
if ( v3 == 1595 )
goto LABEL_33;
v4 = 1611;
LABEL_30:
v6 = v3 == v4;
LABEL_31:
if ( !v6 )
return this;
LABEL_33:
v7 = *(const char **)(this + 1284);
if ( v3 == 1811 )
goto LABEL_39;
if ( v3 > 1811 )
{
if ( v3 == 1816 )
{
v8 = *(GJSpecialColorSelect **)(this + 1500);
v9 = 0.0;
goto LABEL_43;
}
if ( v3 != 1817 )
goto LABEL_41;
LABEL_39:
v8 = *(GJSpecialColorSelect **)(this + 1500);
goto LABEL_42;
}
if ( v3 != 899 )
{
LABEL_41:
v8 = *(GJSpecialColorSelect **)(this + 1284);
goto LABEL_42;
}
v8 = *(GJSpecialColorSelect **)(this + 888);
LABEL_42:
v9 = -5.0;
LABEL_43:
v26 = 0;
v27 = 0;
v28 = nullptr;
switch ( v3 )
{
case 1816:
if ( *(_BYTE *)(this + 1497) )
v10 = "%i.";
else
v10 = "%i";
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)v10, v2[375], v8);
goto LABEL_52;
case 3640:
v12 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i\n%i",
v7,
*(_DWORD *)(this + 1288));
CString = (char *)cocos2d::CCString::getCString(v12);
std::string::assign(&v26, CString);
v9 = 0.0;
break;
case 1912:
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i/%i",
v7,
*(_DWORD *)(this + 1288));
LABEL_52:
v14 = (char *)cocos2d::CCString::getCString(v11);
LABEL_66:
std::string::assign(&v26, v14);
break;
default:
if ( (int)v8 >= 1000 )
{
v15 = 899;
if ( v3 == 899 || (v15 = 1006, v3 == 1006) && !*(_DWORD *)(this + 1428) )
{
v14 = (char *)GJSpecialColorSelect::textForColorIdx(v8, v15);
goto LABEL_66;
}
}
GameToolbox::intToString((GameToolbox *)&v29, (int)v8);
LOWORD(v26) = 0;
std::string::reserve(&v26, 0);
v16 = v29;
v17 = v30;
v18 = v31;
v29 = 0;
v30 = 0;
v31 = nullptr;
v26 = v16;
v27 = v17;
v28 = v18;
std::string::~string((int)&v29);
break;
}
v19 = (*((int (__fastcall **)(const char **))*v2 + 213))(v2);
v20 = (cocos2d::CCLabelBMFont *)v19;
if ( v19 )
{
(*(void (**)(void))(*(_DWORD *)v19 + 464))();
}
else
{
if ( (v26 & 1) != 0 )
v21 = v28;
else
v21 = (cocos2d::CCLabelBMFont *)((char *)&v26 + 1);
v20 = (cocos2d::CCLabelBMFont *)cocos2d::CCLabelBMFont::create(
v21,
"bigFont.fnt",
(const char *)((unsigned __int8)v26 << 31));
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, int))(*(_DWORD *)v20 + 80))(v20, 1056964608);
(*((void (__fastcall **)(const char **, cocos2d::CCLabelBMFont *, int))*v2 + 58))(v2, v20, 1);
(*((void (__fastcall **)(const char **, cocos2d::CCLabelBMFont *))*v2 + 214))(v2, v20);
}
v22 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, _BYTE *))(*(_DWORD *)v20 + 92);
v23 = *(float *)(*((int (__fastcall **)(const char **))*v2 + 41))(v2);
v24 = (*((int (__fastcall **)(const char **))*v2 + 41))(v2);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v25, v23 * 0.5, v9 + (float)(*(float *)(v24 + 4) * 0.5));
v22(v20, v25);
cocos2d::CCLabelBMFont::limitLabelWidth(v20, 30.0, 0.5, 0.0);
return std::string::~string((int)&v26);
}