//
// LevelEditorLayer::updateObjectLabel from 0x65ee94 to 0x65f350 (1212 bytes)
//
// 6 xrefs:
// > LevelEditorLayer::addSpecial @ 0x6704c4
// > LevelEditorLayer::addSpecial @ 0x670800
// > EditorUI::dynamicGroupUpdate @ 0x6c41c4
// > CollisionBlockPopup::updateEditorLabel @ 0x9094b0
// > SetupTriggerPopup::updateEditorLabel @ 0x9e54e4
// > ??> @ 0x9dbd8
//
// 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; // w2
const char *height_low; // x1
float v4; // s9
const char *v5; // x1
cocos2d::CCString *v6; // x0
size_t v7; // x0
cocos2d::CCLabelBMFont *v8; // x0
cocos2d::CCLabelBMFont *v9; // x21
void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // x24
float v11; // s8
const cocos2d::CCSize *v12; // x0
cocos2d::CCArray **p_m_pTargetArray; // x19
unsigned int *p_m_nExtraKerning; // x2
int m_nExtraKerning; // w0
unsigned __int64 m_targetColor; // x0
void *v17; // x0
const char *v18; // x0
size_t v19; // x0
cocos2d::CCString *v20; // x0
size_t v21; // x0
cocos2d::CCString *v22; // x0
unsigned int *v23; // x1
int v24; // w2
const char *v25; // [xsp+58h] [xbp+58h]
const char *v26; // [xsp+58h] [xbp+58h]
const char *CString; // [xsp+58h] [xbp+58h]
cocos2d::CCLabelBMFont *v28; // [xsp+68h] [xbp+68h] BYREF
cocos2d::CCPoint v29; // [xsp+70h] [xbp+70h] BYREF
m_objectID = a1->m_objectID;
if ( m_objectID != 1616 )
{
if ( m_objectID <= 1616 )
{
if ( m_objectID != 1268 )
{
if ( m_objectID > 1268 )
{
if ( m_objectID != 1585 )
{
if ( m_objectID <= 1585 )
{
if ( (unsigned int)(m_objectID - 1346) > 1 )
return;
}
else if ( m_objectID != 1595 && m_objectID != 1611 )
{
return;
}
}
}
else if ( m_objectID > 1007 )
{
if ( m_objectID != 1049 )
return;
}
else if ( m_objectID < 1006 && m_objectID != 899 && m_objectID != 901 )
{
return;
}
}
}
else if ( m_objectID != 2062 )
{
if ( m_objectID <= 2062 )
{
if ( m_objectID > 1817 )
{
if ( m_objectID != 1912 )
return;
}
else if ( m_objectID < 1814 && (unsigned int)(m_objectID - 1811) > 1 )
{
return;
}
}
else if ( m_objectID != 3033 )
{
if ( m_objectID <= 3033 )
{
if ( m_objectID != 2067 && m_objectID != 3016 )
return;
}
else if ( m_objectID != 3640 && m_objectID != 3660 && m_objectID != 3609 )
{
return;
}
}
}
}
height_low = (const char *)LODWORD(a1[1].m_obContentSize.height);
if ( m_objectID == 1811 )
goto LABEL_54;
if ( m_objectID <= 1811 )
{
if ( m_objectID == 899 )
{
m_targetColor = (unsigned int)a1->m_targetColor;
v28 = (cocos2d::CCLabelBMFont *)&byte_124B6C8;
if ( (int)m_targetColor > 999 )
goto LABEL_47;
goto LABEL_26;
}
goto LABEL_41;
}
if ( m_objectID != 1816 )
{
if ( m_objectID != 1817 )
{
LABEL_41:
m_targetColor = (unsigned int)height_low;
goto LABEL_42;
}
LABEL_54:
m_targetColor = *(unsigned int *)&a1[1]._displayedOpacity;
LABEL_42:
v28 = (cocos2d::CCLabelBMFont *)&byte_124B6C8;
if ( m_objectID == 3640 )
{
v20 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i\n%i",
height_low,
LODWORD(a1[1].m_sAdditionalTransform.a));
CString = cocos2d::CCString::getCString(v20);
v21 = strlen(CString);
sub_D1798C(&v28, CString, v21);
v4 = 0.0;
goto LABEL_16;
}
if ( m_objectID == 1912 )
{
v22 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i/%i",
height_low,
LODWORD(a1[1].m_sAdditionalTransform.a));
v18 = cocos2d::CCString::getCString(v22);
goto LABEL_48;
}
if ( (int)m_targetColor > 999 && m_objectID == 1006 && !LODWORD(a1[1].m_pScheduler) )
{
LABEL_47:
v18 = GJSpecialColorSelect::textForColorIdx(m_targetColor);
LABEL_48:
v26 = v18;
v19 = strlen(v18);
sub_D1798C(&v28, v26, v19);
v4 = -5.0;
goto LABEL_16;
}
LABEL_26:
GameToolbox::intToString((__int64 *)&v29, (GameToolbox *)m_targetColor);
sub_D163D4(&v28, &v29);
v17 = (void *)(*(_QWORD *)&v29 - 24LL);
if ( (__int64 *)(*(_QWORD *)&v29 - 24LL) == &qword_124B6B0 )
goto LABEL_27;
if ( &pthread_create )
{
v23 = (unsigned int *)(*(_QWORD *)&v29 - 8LL);
do
v24 = __ldaxr(v23);
while ( __stlxr(v24 - 1, v23) );
}
else
{
v24 = *(_DWORD *)(*(_QWORD *)&v29 - 8LL);
*(_DWORD *)(*(_QWORD *)&v29 - 8LL) = v24 - 1;
}
if ( v24 > 0 )
{
LABEL_27:
v4 = -5.0;
}
else
{
operator delete(v17);
v4 = -5.0;
}
goto LABEL_16;
}
v4 = 0.0;
v28 = (cocos2d::CCLabelBMFont *)&byte_124B6C8;
v5 = (const char *)*(unsigned int *)&a1[1]._displayedOpacity;
if ( BYTE5(a1[1].CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCRGBAProtocol::__vftable) )
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i.", v5);
else
v6 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)"%i", v5);
v25 = cocos2d::CCString::getCString(v6);
v7 = strlen(v25);
sub_D1798C(&v28, v25, v7);
LABEL_16:
v8 = a1->getObjectLabel(a1);
v9 = v8;
if ( v8 )
{
v8->setString(v8, (const unsigned __int8 *)v28);
}
else
{
v9 = cocos2d::CCLabelBMFont::create();
v9->setScale(v9, 0.5);
a1->addChild_0(a1, v9, 1);
a1->setObjectLabel(a1, v9);
}
setPosition = v9->setPosition;
v11 = a1->getContentSize(a1)->width * 0.5;
v12 = a1->getContentSize(a1);
cocos2d::CCPoint::CCPoint(&v29, v11, v4 + (float)(v12->height * 0.5));
setPosition(v9, &v29);
cocos2d::CCLabelBMFont::limitLabelWidth(v9, 30.0, 0.5, 0.0);
p_m_pTargetArray = &v28[-1].m_pTargetArray;
if ( &v28[-1].m_pTargetArray != (cocos2d::CCArray **)&qword_124B6B0 )
{
if ( &pthread_create )
{
p_m_nExtraKerning = (unsigned int *)&v28[-1].m_nExtraKerning;
do
m_nExtraKerning = __ldaxr(p_m_nExtraKerning);
while ( __stlxr(m_nExtraKerning - 1, p_m_nExtraKerning) );
}
else
{
m_nExtraKerning = v28[-1].m_nExtraKerning;
v28[-1].m_nExtraKerning = m_nExtraKerning - 1;
}
if ( m_nExtraKerning <= 0 )
operator delete(p_m_pTargetArray);
}
}