//
// LevelEditorLayer::updateObjectLabel from 0x10035de00 to 0x10035e1a0 (928 bytes)
//
// 4 xrefs:
// > CollisionBlockPopup::updateEditorLabel @ 0x100085864
// > SetupTriggerPopup::updateEditorLabel @ 0x10012fae4
// > LevelEditorLayer::addSpecial @ 0x100359c7c
// > EditorUI::dynamicGroupUpdate @ 0x1003f308c
//
// 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 __fastcall LevelEditorLayer::updateObjectLabel(GameObject *a1)
{
int m_objectID; // w8
bool v3; // zf
bool v4; // zf
bool v5; // zf
bool v6; // zf
float height; // w9
__int64 height_low; // x0
float v9; // s8
const char *v10; // x1
cocos2d::CCString *v11; // x0
const char *CString; // x0
cocos2d::CCString *v13; // x0
cocos2d::CCString *v14; // x0
const char *v15; // x0
__int64 v16; // x0
cocos2d::CCLabelBMFont *v17; // x20
std::string *p_p; // x1
float v19; // s9
__int64 v20; // x0
__n128 v21; // q0
__n128 v22; // q1
std::string v23; // [xsp+18h] [xbp-58h] BYREF
std::string __p; // [xsp+30h] [xbp-40h] BYREF
m_objectID = a1->m_objectID;
if ( m_objectID <= 1810 )
{
if ( m_objectID > 1267 )
{
v6 = (unsigned int)(m_objectID - 1585) > 0x1F || ((1 << (m_objectID - 49)) & 0x84000401) == 0;
if ( !v6 || (unsigned int)(m_objectID - 1346) < 2 || m_objectID == 1268 )
goto LABEL_38;
}
else
{
v4 = (unsigned int)(m_objectID - 1006) > 0x2B
|| ((1LL << ((unsigned __int8)m_objectID + 18)) & 0x80000000003LL) == 0;
if ( !v4 || m_objectID == 899 || m_objectID == 901 )
goto LABEL_38;
}
}
else
{
if ( m_objectID <= 2061 )
{
v3 = (unsigned int)(m_objectID - 1811) > 6 || m_objectID == 1813;
if ( v3 && m_objectID != 1912 )
return;
LABEL_38:
height = a1[1].m_obContentSize.height;
if ( m_objectID > 1815 )
{
if ( m_objectID == 1816 )
{
memset(&__p, 0, sizeof(__p));
v9 = 0.0;
if ( BYTE5(a1[1].CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCRGBAProtocol::__vftable) )
v11 = (cocos2d::CCString *)sub_100268F4C("%i.");
else
v11 = (cocos2d::CCString *)sub_100268F4C("%i");
CString = cocos2d::CCString::getCString(v11);
std::string::assign(&__p, CString);
goto LABEL_62;
}
height_low = LODWORD(a1[1].m_obContentSize.height);
if ( m_objectID != 1817 )
goto LABEL_45;
}
else
{
if ( m_objectID == 899 )
{
height_low = (unsigned int)a1->m_targetColor;
memset(&__p, 0, sizeof(__p));
if ( (int)height_low <= 999 )
{
LABEL_50:
GameToolbox::intToString(height_low, &v23);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
__p = v23;
v9 = -5.0;
goto LABEL_62;
}
goto LABEL_54;
}
height_low = LODWORD(a1[1].m_obContentSize.height);
if ( m_objectID != 1811 )
{
LABEL_45:
memset(&__p, 0, sizeof(__p));
if ( m_objectID == 3640 )
{
v14 = (cocos2d::CCString *)sub_100268F4C("%i\n%i", LODWORD(height), LODWORD(a1[1].m_sAdditionalTransform.a));
v15 = cocos2d::CCString::getCString(v14);
v9 = 0.0;
std::string::assign(&__p, v15);
goto LABEL_62;
}
if ( m_objectID == 1912 )
{
v13 = (cocos2d::CCString *)sub_100268F4C("%i/%i", LODWORD(height), LODWORD(a1[1].m_sAdditionalTransform.a));
v10 = cocos2d::CCString::getCString(v13);
goto LABEL_60;
}
if ( (int)height_low <= 999 || m_objectID != 1006 || LODWORD(a1[1].m_pScheduler) )
goto LABEL_50;
LABEL_54:
v10 = GJSpecialColorSelect::textForColorIdx(height_low);
LABEL_60:
v9 = -5.0;
std::string::assign(&__p, v10);
LABEL_62:
v16 = ((__int64 (__fastcall *)(GameObject *))a1->getObjectLabel)(a1);
v17 = (cocos2d::CCLabelBMFont *)v16;
if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
p_p = &__p;
else
p_p = (std::string *)__p.__r_.__value_.__r.__words[0];
if ( v16 )
{
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v16 + 912LL))(v16, p_p);
}
else
{
v17 = cocos2d::CCLabelBMFont::create_1((const char *)p_p, "bigFont.fnt");
((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v17->setScale)(v17, 0.5);
((void (__fastcall *)(GameObject *, cocos2d::CCLabelBMFont *, __int64))a1->addChild_0)(a1, v17, 1);
((void (__fastcall *)(GameObject *, cocos2d::CCLabelBMFont *))a1->setObjectLabel)(a1, v17);
}
v19 = *(float *)((__int64 (__fastcall *)(GameObject *))a1->getContentSize)(a1);
v20 = ((__int64 (__fastcall *)(GameObject *))a1->getContentSize)(a1);
v21.n128_f32[0] = v19 * 0.5;
v22.n128_f32[0] = v9 + (float)(*(float *)(v20 + 4) * 0.5);
sub_100022980(v21, v22, &v23);
((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v17->setPosition)(v17, &v23);
cocos2d::CCLabelBMFont::limitLabelWidth(v17, 30.0, 0.5, 0.0);
if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__p.__r_.__value_.__l.__data_);
return;
}
}
height_low = *(unsigned int *)&a1[1]._displayedOpacity;
goto LABEL_45;
}
if ( m_objectID <= 3032 )
{
if ( m_objectID != 2062 && m_objectID != 2067 && m_objectID != 3016 )
return;
goto LABEL_38;
}
v5 = (unsigned int)(m_objectID - 3609) > 0x33
|| ((1LL << ((unsigned __int8)m_objectID - 25)) & 0x8000080000001LL) == 0;
if ( !v5 || m_objectID == 3033 )
goto LABEL_38;
}
}