//
// EditorUI::onDuplicate from 0x6f3958 to 0x6f3a82 (298 bytes)
//
// 2 xrefs:
// > EditorUI::startFreeMoveTouch @ 0x6effc2
// > EditorUI::handleEditorAction @ 0x6f19e4
//
// 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::onDuplicate(int this, cocos2d::CCObject *a2)
{
int v2; // r4
EditorSFXManager *v3; // r0
int v4; // r5
int v5; // r0
cocos2d::CCArray *v6; // r6
_BYTE v7[12]; // [sp+Ch] [bp-20h] BYREF
int v8[3]; // [sp+18h] [bp-14h] BYREF
v2 = this;
if ( !*(_DWORD *)(this + 996) )
{
this = cocos2d::CCArray::count(*(cocos2d::CCArray **)(this + 668));
if ( !this )
return this;
}
v3 = (EditorSFXManager *)EditorSFXManager::sharedState((EditorSFXManager *)this);
EditorSFXManager::playAction(v3, 103);
v4 = *(_DWORD *)(*(_DWORD *)(v2 + 944) + 11868) - *(_DWORD *)(*(_DWORD *)(v2 + 944) + 11872);
v5 = cocos2d::CCArray::count(*(cocos2d::CCArray **)(v2 + 668)) + v4;
if ( v5 > 80000 )
{
if ( !*(_BYTE *)(*(_DWORD *)(*(_DWORD *)(v2 + 944) + 1408) + 985) )
return EditorUI::showMaxError(v2);
goto LABEL_5;
}
if ( v5 > 40000 )
{
LABEL_5:
if ( !*(_BYTE *)(*(_DWORD *)(*(_DWORD *)(v2 + 944) + 1408) + 984) )
return EditorUI::showMaxBasicError(v2);
}
if ( cocos2d::CCArray::count(*(cocos2d::CCArray **)(v2 + 668)) )
{
v6 = *(cocos2d::CCArray **)(v2 + 668);
}
else
{
v6 = (cocos2d::CCArray *)cocos2d::CCArray::create(nullptr);
cocos2d::CCArray::addObject(v6, *(cocos2d::CCObject **)(v2 + 996));
}
EditorUI::copyObjects((EditorUI *)v7, (cocos2d::CCArray *)v2, (int)v6, 0, 0);
*(_BYTE *)(*(_DWORD *)(v2 + 944) + 11784) = 1;
std::string::basic_string(v8, (int)v7);
EditorUI::pasteObjects(v2, (unsigned __int8 *)v8, 0, 0);
std::string::~string((int)v8);
*(_BYTE *)(*(_DWORD *)(v2 + 944) + 11784) = 0;
EditorBuildStats::noteAction(*(_DWORD *)(v2 + 944) + 12104);
EditorUI::updateButtons((cocos2d::CCArray **)v2);
EditorUI::updateObjectInfoLabel((cocos2d::CCArray **)v2);
return std::string::~string((int)v7);
}