//
// LevelEditorLayer::updateObjectLabel from 0x367240 to 0x3674cc (652 bytes)
//
// 4 xrefs:
// > LevelEditorLayer::addSpecial @ 0x370a4a
// > EditorUI::dynamicGroupUpdate @ 0x3a636a
// > CollisionBlockPopup::updateEditorLabel @ 0x4cd5c0
// > SetupTriggerPopup::updateEditorLabel @ 0x541c7e
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void LevelEditorLayer::updateObjectLabel(GameObject *a1)
{
int m_objectID; // r3
int v3; // r2
unsigned int v4; // r2
bool v5; // zf
float b; // r1
float v7; // r2
float v8; // s16
char *v9; // r0
cocos2d::CCString *v10; // r0
cocos2d::CCString *v11; // r0
char *CString; // r0
char *v13; // r0
cocos2d::CCLabelBMFont *v14; // r0
cocos2d::CCLabelBMFont *v15; // r6
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r9
float width; // s18
const cocos2d::CCSize *v18; // r0
cocos2d::CCLabelBMFont *v19; // [sp+0h] [bp-14h] BYREF
cocos2d::CCPoint v20; // [sp+4h] [bp-10h] BYREF
m_objectID = a1->m_objectID;
if ( m_objectID == 1616 )
goto LABEL_33;
if ( m_objectID > 1616 )
{
if ( m_objectID == 2062 )
goto LABEL_33;
if ( m_objectID > 2062 )
{
if ( m_objectID == 3033 )
goto LABEL_33;
if ( m_objectID > 3033 )
{
if ( m_objectID == 3640 || m_objectID == 3660 )
goto LABEL_33;
v3 = 3609;
}
else
{
if ( m_objectID == 2067 )
goto LABEL_33;
v3 = 3016;
}
goto LABEL_30;
}
if ( m_objectID > 1817 )
{
v5 = m_objectID == 1912;
goto LABEL_31;
}
if ( m_objectID >= 1814 )
goto LABEL_33;
v4 = m_objectID - 1811;
LABEL_20:
if ( v4 > 1 )
return;
goto LABEL_33;
}
if ( m_objectID == 1268 )
goto LABEL_33;
if ( m_objectID <= 1268 )
{
if ( m_objectID >= 1008 )
{
v3 = 1049;
}
else
{
if ( m_objectID >= 1006 || m_objectID == 899 )
goto LABEL_33;
v3 = 901;
}
goto LABEL_30;
}
if ( m_objectID == 1585 )
goto LABEL_33;
if ( m_objectID <= 1585 )
{
v4 = m_objectID - 1346;
goto LABEL_20;
}
if ( m_objectID == 1595 )
goto LABEL_33;
v3 = 1611;
LABEL_30:
v5 = m_objectID == v3;
LABEL_31:
if ( !v5 )
return;
LABEL_33:
b = a1[1].m_sAdditionalTransform.b;
if ( m_objectID == 1811 )
goto LABEL_39;
if ( m_objectID > 1811 )
{
if ( m_objectID == 1816 )
{
v7 = *(float *)&a1[1].m_pobTexture;
v8 = 0.0;
goto LABEL_43;
}
if ( m_objectID != 1817 )
goto LABEL_41;
LABEL_39:
v7 = *(float *)&a1[1].m_pobTexture;
goto LABEL_42;
}
if ( m_objectID != 899 )
{
LABEL_41:
v7 = a1[1].m_sAdditionalTransform.b;
goto LABEL_42;
}
v7 = *(float *)&a1->m_targetColor;
LABEL_42:
v8 = -5.0;
LABEL_43:
v19 = (cocos2d::CCLabelBMFont *)&unk_ACDDA8;
switch ( m_objectID )
{
case 1816:
if ( BYTE1(a1[1].m_sBlendFunc.dst) )
v9 = "%i.";
else
v9 = "%i";
v10 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)v9,
(const char *)a1[1].m_pobTexture,
v7);
goto LABEL_52;
case 3640:
v11 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i\n%i",
(const char *)LODWORD(b),
a1[1].m_sAdditionalTransform.c);
CString = (char *)cocos2d::CCString::getCString(v11);
sub_7753D4((int)&v19, CString);
v8 = 0.0;
break;
case 1912:
v10 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i/%i",
(const char *)LODWORD(b),
a1[1].m_sAdditionalTransform.c);
LABEL_52:
v13 = (char *)cocos2d::CCString::getCString(v10);
LABEL_63:
sub_7753D4((int)&v19, v13);
break;
default:
if ( SLODWORD(v7) >= 1000 && (m_objectID == 899 || m_objectID == 1006 && !*(_DWORD *)&a1[1].m_bUseChildIndex) )
{
v13 = (char *)GJSpecialColorSelect::textForColorIdx(SLODWORD(v7));
goto LABEL_63;
}
GameToolbox::intToString((GameToolbox *)&v20, SLODWORD(v7));
sub_774794(&v19, &v20);
sub_774008(&v20);
break;
}
v14 = a1->getObjectLabel(a1);
v15 = v14;
if ( v14 )
{
v14->setString(v14, (const unsigned __int8 *)v19);
}
else
{
v15 = cocos2d::CCLabelBMFont::create();
((void (__fastcall *)(cocos2d::CCLabelBMFont *, int))v15->setScale)(v15, 1056964608);
a1->addChild_0(a1, v15, 1);
a1->setObjectLabel(a1, v15);
}
setPosition = v15->setPosition;
width = a1->getContentSize(a1)->width;
v18 = a1->getContentSize(a1);
cocos2d::CCPoint::CCPoint(&v20, width * 0.5, v8 + (float)(v18->height * 0.5));
setPosition(v15, &v20);
cocos2d::CCLabelBMFont::limitLabelWidth(v15, 30.0, 0.5, 0.0);
sub_774008(&v19);
}