//
// LevelEditorLayer::updateObjectLabel from 0x799050 to 0x79945c (1036 bytes)
//
// 5 xrefs:
// > LevelEditorLayer::addSpecial @ 0x7a060c
// > LevelEditorLayer::addSpecial @ 0x7a0948
// > EditorUI::dynamicGroupUpdate @ 0x7d3cf0
// > SetupTriggerPopup::updateEditorLabel @ 0xb1b9a0
// > ??> @ 0xcfa78
//
// 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:53:35 +0000
//
__int64 __fastcall LevelEditorLayer::updateObjectLabel(LevelEditorLayer *this, GameObject *a2)
{
int v3; // w2
const char *v4; // x1
float v5; // s9
const char *v6; // x1
cocos2d::CCString *v7; // x0
char *CString; // x0
__int64 v9; // x0
const char *v10; // x2
cocos2d::CCLabelBMFont *v11; // x21
char *v12; // x1
void (__fastcall *v13)(cocos2d::CCLabelBMFont *, _BYTE *); // x22
float v14; // s8
__int64 v15; // x0
unsigned __int64 v16; // x0
char *v18; // x0
cocos2d::CCLabelBMFont *v19; // x0
cocos2d::CCString *v20; // x0
char *v21; // x0
cocos2d::CCString *v22; // x0
_BYTE v23[8]; // [xsp+40h] [xbp+40h] BYREF
unsigned __int64 v24; // [xsp+48h] [xbp+48h] BYREF
unsigned __int64 v25; // [xsp+50h] [xbp+50h]
void *v26; // [xsp+58h] [xbp+58h]
unsigned __int64 v27[3]; // [xsp+60h] [xbp+60h] BYREF
v3 = *((_DWORD *)this + 257);
if ( v3 != 1616 )
{
if ( v3 <= 1616 )
{
if ( v3 != 1268 )
{
if ( v3 > 1268 )
{
if ( v3 != 1585 )
{
if ( v3 <= 1585 )
{
if ( (unsigned int)(v3 - 1346) > 1 )
return _stack_chk_guard;
}
else if ( v3 != 1595 && v3 != 1611 )
{
return _stack_chk_guard;
}
}
}
else if ( v3 > 1007 )
{
if ( v3 != 1049 )
return _stack_chk_guard;
}
else if ( v3 < 1006 && v3 != 899 && v3 != 901 )
{
return _stack_chk_guard;
}
}
}
else if ( v3 != 2062 )
{
if ( v3 <= 2062 )
{
if ( v3 > 1817 )
{
if ( v3 != 1912 )
return _stack_chk_guard;
}
else if ( v3 < 1814 && (unsigned int)(v3 - 1811) > 1 )
{
return _stack_chk_guard;
}
}
else if ( v3 != 3033 )
{
if ( v3 <= 3033 )
{
if ( v3 != 2067 && v3 != 3016 )
return _stack_chk_guard;
}
else if ( v3 != 3640 && v3 != 3660 && v3 != 3609 )
{
return _stack_chk_guard;
}
}
}
}
v4 = (const char *)*((unsigned int *)this + 366);
if ( v3 != 1811 )
{
if ( v3 <= 1811 )
{
if ( v3 == 899 )
{
v16 = *((unsigned int *)this + 256);
v24 = 0;
v25 = 0;
v26 = nullptr;
if ( (int)v16 > 999 )
goto LABEL_44;
goto LABEL_24;
}
goto LABEL_38;
}
if ( v3 == 1816 )
{
v5 = 0.0;
v24 = 0;
v25 = 0;
v26 = nullptr;
v6 = (const char *)*((unsigned int *)this + 420);
if ( *((_BYTE *)this + 1677) )
v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i.", v6);
else
v7 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", v6);
CString = (char *)cocos2d::CCString::getCString(v7);
std::string::assign((__int64 *)&v24, CString);
goto LABEL_16;
}
if ( v3 != 1817 )
{
LABEL_38:
v16 = (unsigned int)v4;
goto LABEL_39;
}
}
v16 = *((unsigned int *)this + 420);
LABEL_39:
v24 = 0;
v25 = 0;
v26 = nullptr;
if ( v3 == 3640 )
{
v20 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i\n%i",
v4,
*((unsigned int *)this + 367));
v21 = (char *)cocos2d::CCString::getCString(v20);
std::string::assign((__int64 *)&v24, v21);
v5 = 0.0;
goto LABEL_16;
}
if ( v3 == 1912 )
{
v22 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i/%i",
v4,
*((unsigned int *)this + 367));
v18 = (char *)cocos2d::CCString::getCString(v22);
goto LABEL_45;
}
if ( (int)v16 > 999 && v3 == 1006 )
{
LODWORD(v4) = *((_DWORD *)this + 402);
if ( !(_DWORD)v4 )
{
LABEL_44:
v18 = (char *)GJSpecialColorSelect::textForColorIdx((GJSpecialColorSelect *)v16, (int)v4);
LABEL_45:
std::string::assign((__int64 *)&v24, v18);
v5 = -5.0;
goto LABEL_16;
}
}
LABEL_24:
GameToolbox::intToString(v27, (GameToolbox *)v16);
LOWORD(v24) = 0;
v5 = -5.0;
std::string::reserve((__int64 *)&v24, 0);
v24 = v27[0];
v25 = v27[1];
v26 = (void *)v27[2];
LABEL_16:
v9 = (*(__int64 (__fastcall **)(LevelEditorLayer *))(*(_QWORD *)this + 1704LL))(this);
v11 = (cocos2d::CCLabelBMFont *)v9;
if ( v9 )
{
v12 = (char *)&v24 + 1;
if ( (v24 & 1) != 0 )
v12 = (char *)v26;
(*(void (__fastcall **)(__int64, char *))(*(_QWORD *)v9 + 928LL))(v9, v12);
}
else
{
v19 = (cocos2d::CCLabelBMFont *)((char *)&v24 + 1);
if ( (v24 & 1) != 0 )
v19 = (cocos2d::CCLabelBMFont *)v26;
v11 = (cocos2d::CCLabelBMFont *)cocos2d::CCLabelBMFont::create(v19, "bigFont.fnt", v10);
(*(void (__fastcall **)(cocos2d::CCLabelBMFont *, float))(*(_QWORD *)v11 + 160LL))(v11, 0.5);
(*(void (__fastcall **)(LevelEditorLayer *, cocos2d::CCLabelBMFont *, __int64))(*(_QWORD *)this + 464LL))(
this,
v11,
1);
(*(void (__fastcall **)(LevelEditorLayer *, cocos2d::CCLabelBMFont *))(*(_QWORD *)this + 1712LL))(this, v11);
}
v13 = *(void (__fastcall **)(cocos2d::CCLabelBMFont *, _BYTE *))(*(_QWORD *)v11 + 184LL);
v14 = *(float *)(*(__int64 (__fastcall **)(LevelEditorLayer *))(*(_QWORD *)this + 328LL))(this) * 0.5;
v15 = (*(__int64 (__fastcall **)(LevelEditorLayer *))(*(_QWORD *)this + 328LL))(this);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v23, v14, v5 + (float)(*(float *)(v15 + 4) * 0.5));
v13(v11, v23);
cocos2d::CCLabelBMFont::limitLabelWidth(v11, 30.0, 0.5, 0.0);
if ( (v24 & 1) != 0 )
operator delete(v26);
return _stack_chk_guard;
}