//
// EditorUI::doPasteObjects from 0x6f31ec to 0x6f335a (366 bytes)
//
// 3 xrefs:
// > EditorUI::handleEditorAction @ 0x6f20a8
// > EditorUI::onPaste @ 0x6f338e
// > EditorCommandsPopup::onCommand @ 0x77a820
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:57:37 +0000
//
int __fastcall EditorUI::doPasteObjects(EditorUI *this, int a2)
{
int result; // r0
int v5; // r5
int v6; // r3
int v7; // r5
GameManager *v8; // r0
int v9; // r3
int v10; // r0
cocos2d::CCArray *v11; // r8
cocos2d::CCDirector *v12; // r0
const cocos2d::CCPoint *v13; // r9
float v14[2]; // [sp+0h] [bp-34h] BYREF
_BYTE v15[8]; // [sp+8h] [bp-2Ch] BYREF
float v16[2]; // [sp+10h] [bp-24h] BYREF
_BYTE v17[8]; // [sp+18h] [bp-1Ch] BYREF
int v18[3]; // [sp+20h] [bp-14h] BYREF
result = GameManager::sharedState(this);
v5 = *(unsigned __int8 *)(result + 388);
if ( (v5 & 1) != 0 )
v6 = *(_DWORD *)(result + 392);
else
v6 = v5 >> 1;
if ( !v6 )
return result;
v7 = *(_DWORD *)(*((_DWORD *)this + 236) + 11868) - *(_DWORD *)(*((_DWORD *)this + 236) + 11872);
v8 = (GameManager *)GameManager::sharedState((GameManager *)result);
v9 = *((_DWORD *)v8 + 100) + v7;
if ( v9 > 80000 )
{
if ( !*(_BYTE *)(*(_DWORD *)(*((_DWORD *)this + 236) + 1408) + 985) )
return EditorUI::showMaxError((int)this);
goto LABEL_7;
}
if ( v9 > 40000 )
{
LABEL_7:
if ( !*(_BYTE *)(*(_DWORD *)(*((_DWORD *)this + 236) + 1408) + 984) )
return EditorUI::showMaxBasicError((int)this);
}
v10 = GameManager::sharedState(v8);
std::string::basic_string(v18, v10 + 388);
v11 = EditorUI::pasteObjects((int)this, (unsigned __int8 *)v18, a2, 0);
std::string::~string((int)v18);
EditorBuildStats::noteAction(*((_DWORD *)this + 236) + 12104);
if ( v11 )
{
v12 = (cocos2d::CCDirector *)cocos2d::CCArray::count(v11);
if ( v12 )
{
cocos2d::CCDirector::sharedDirector(v12);
cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v14);
v13 = *(const cocos2d::CCPoint **)(*((_DWORD *)this + 236) + 2436);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v17,
v14[0] * 0.5,
(float)(*((float *)this + 158) * 0.5) + (float)(v14[1] * 0.5));
cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v15, v13);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v16, (const cocos2d::CCPoint *)v15);
EditorUI::getGridSnappedPos((int)v17, (int)this, v16);
cocos2d::CCPoint::operator=(v15, v17);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v17, (const cocos2d::CCPoint *)v15);
EditorUI::repositionObjectsToCenter(this, v11, (int)v17);
}
}
EditorUI::updateButtons((cocos2d::CCArray **)this);
return EditorUI::updateObjectInfoLabel((cocos2d::CCArray **)this);
}