//
// CustomizeObjectLayer::onPaste from 0x140142110 to 0x140142269 (345 bytes)
//
// 2 xrefs:
// > CustomizeObjectLayer::init @ 0x140141aa5
// > ??> @ 0x14091733c
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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:27:10 +0000
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall CustomizeObjectLayer::onPaste(_QWORD *a1)
{
__int64 v2; // r14
__int64 v3; // rax
__int64 v4; // rbx
__int64 v5; // r14
__int64 v6; // rdx
unsigned int *v7; // rbx
__int64 v8; // rax
_QWORD *v9; // rbx
_QWORD *i; // rbp
__int64 v11; // rdi
__int64 v12; // rdx
int ActiveMode; // eax
const char *CString; // rdx
cocos2d::CCString *v15; // rax
void *v17; // [rsp+40h] [rbp+8h]
v2 = qword_14090BFD0;
if ( !qword_14090BFD0 )
{
v17 = operator new(0x6E8u);
qword_14090BFD0 = GameManager::GameManager(v17);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);
v2 = qword_14090BFD0;
}
v3 = a1[87];
v4 = a1[86];
v5 = *(_QWORD *)(v2 + 568);
v6 = *(_QWORD *)(v5 + 14776);
if ( v6 )
{
if ( v4 )
{
GameObject::duplicateColorMode(a1[86], v6);
*(_BYTE *)(v4 + 1156) = 1;
}
else if ( v3 )
{
v7 = *(unsigned int **)(v3 + 56);
v8 = *v7;
if ( (_DWORD)v8 )
{
v9 = *((_QWORD **)v7 + 2);
for ( i = &v9[v8 - 1]; v9 <= i; ++v9 )
{
v11 = *v9;
if ( !*v9 )
break;
GameObject::duplicateColorMode(*v9, *(_QWORD *)(v5 + 14776));
*(_BYTE *)(v11 + 1156) = 1;
}
}
}
}
CustomizeObjectLayer::updateCurrentSelection(a1);
CustomizeObjectLayer::updateColorSprite(a1);
LOBYTE(v12) = 1;
ActiveMode = CustomizeObjectLayer::getActiveMode(a1, v12);
if ( ActiveMode < 1000 )
{
if ( ActiveMode <= 0 )
{
CString = " ";
}
else
{
v15 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, (unsigned int)ActiveMode);
CString = cocos2d::CCString::getCString(v15);
}
}
else
{
CString = (const char *)GJSpecialColorSelect::textForColorIdx((unsigned int)ActiveMode);
}
(**(void (__fastcall ***)(__int64, const char *))(a1[101] + 360LL))(a1[101] + 360LL, CString);
return CustomizeObjectLayer::updateHSVButtons(a1);
}