//
// EditorUI::findAndSelectObject from 0x1000333e0 to 0x10003358d (429 bytes)
//
// 1 xrefs:
// > EditorUI::setIDPopupClosed @ 0x100033361
//
// 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 EditorUI::findAndSelectObject(EditorUI *a1, int a2, bool a3)
{
LevelEditorLayer *m_editorLayer; // rdi
GameObject *Object; // r14
cocos2d::CCDirector *v6; // rsi
float *v7; // rax
__int64 v8; // rax
cocos2d::CCLayer *m_objectLayer; // r15
CCCircleWave *v10; // r14
_BYTE v11[8]; // [rsp+0h] [rbp-30h] BYREF
float v12[2]; // [rsp+8h] [rbp-28h] BYREF
float v13; // [rsp+10h] [rbp-20h]
float v14; // [rsp+14h] [rbp-1Ch]
double v15; // 0:xmm0_8.8
m_editorLayer = a1->m_editorLayer;
if ( !a3 )
{
Object = GJBaseGameLayer::tryGetObject(m_editorLayer, a2);
if ( !Object )
return;
goto LABEL_5;
}
Object = LevelEditorLayer::findGameObject(m_editorLayer, a2);
if ( Object )
{
LABEL_5:
EditorUI::selectObject(a1, Object, 0);
v6 = cocos2d::CCDirector::sharedDirector();
*(cocos2d::CCSize *)&v15 = cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v12);
v14 = ((float (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCDirector *, double))a1->m_editorLayer->m_objectLayer->getScale)(
a1->m_editorLayer->m_objectLayer,
v6,
v15);
v7 = (float *)((__int64 (__fastcall *)(GameObject *))Object->getPosition)(Object);
v13 = (float)(v12[0] * 0.5) - (float)(*v7 * v14);
v8 = ((__int64 (__fastcall *)(GameObject *))Object->getPosition)(Object);
sub_10028CBE0(v11, v13, (float)(0.5 * v12[1]) - (float)(v14 * *(float *)(v8 + 4)));
((void (__fastcall *)(cocos2d::CCLayer *, _BYTE *))a1->m_editorLayer->m_objectLayer->setPosition)(
a1->m_editorLayer->m_objectLayer,
v11);
EditorUI::constrainGameLayerPosition(a1, -100.0, -100.0);
m_objectLayer = a1->m_editorLayer->m_objectLayer;
((void (__fastcall *)(GameObject *))Object->getPosition)(Object);
cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)v12, (const cocos2d::CCPoint *)m_objectLayer);
sub_10028CC60(v11, v12);
v10 = CCCircleWave::create(1.0, 50.0, 0.80000001, 0, 0);
v10->m_color.b = -1;
*(_WORD *)&v10->m_color.r = -1;
((void (__fastcall *)(CCCircleWave *, _BYTE *))v10->setPosition)(v10, v11);
((void (__fastcall *)(EditorUI *, CCCircleWave *, _QWORD))a1->addChild_0)(a1, v10, 0);
v10->m_circleMode = Outline;
}
}