//
// TouchControlEditLayer::onPaste from 0x7a4838 to 0x7a4aec (692 bytes)
//
// 0 xrefs:
//
// 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:59:56 +0000
//
int __fastcall TouchControlEditLayer::onPaste(TouchControlEditLayer *this, cocos2d::CCObject *a2)
{
int v3; // r4
void (__fastcall *v4)(TouchControlEditLayer *, cocos2d::CCNode *, int); // r9
cocos2d::CCNode *v5; // r0
int *v6; // r0
int v7; // r4
void (__fastcall *v8)(TouchControlEditLayer *, cocos2d::CCNode *, int); // r9
cocos2d::CCNode *v9; // r0
GameManager *WinSize; // r0
int v12; // r3
int v13; // r11
int v14; // r2
cocos2d **v15; // r0
int v16; // r0
int v17; // r2
cocos2d **v18; // r0
int v19; // r0
GameManager *v20; // r0
int v21; // r0
void (__fastcall *v22)(TouchControlEditLayer *, cocos2d::CCNode *, int); // r9
cocos2d::CCNode *v23; // r0
int v24; // [sp+Ch] [bp-1Ch]
int v25; // [sp+Ch] [bp-1Ch]
float v26[2]; // [sp+14h] [bp-14h] BYREF
int v27; // [sp+1Ch] [bp-Ch] BYREF
int v28; // [sp+20h] [bp-8h]
int v29; // [sp+24h] [bp-4h]
int v30; // [sp+28h] [bp+0h] BYREF
int v31; // [sp+2Ch] [bp+4h]
int v32; // [sp+30h] [bp+8h]
cocos2d *v33[7]; // [sp+34h] [bp+Ch] BYREF
float v34; // [sp+50h] [bp+28h]
if ( (dword_D2E730 & 1) != 0 )
v3 = dword_D2E734;
else
v3 = (int)(unsigned __int8)dword_D2E730 >> 1;
if ( v3 )
{
v6 = LevelControlConfig::createFromB64((LevelControlConfig *)&dword_D2E730);
v7 = (int)v6;
if ( v6 && v6[13] > 0 && v6[27] != v6[28] )
{
if ( *((_DWORD *)this + 179) )
{
TouchControlEditLayer::copyTouchFrom(this, (UIButtonConfig **)v6);
}
else
{
cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v6);
WinSize = (GameManager *)cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v26);
v12 = (*(_DWORD *)(v7 + 112) - *(_DWORD *)(v7 + 108)) >> 2;
if ( *((_BYTE *)this + 712) )
{
if ( -286331153 * v12 )
{
v24 = GameManager::sharedState(WinSize);
LevelControlConfig::resolveSlot(v33, v7, *(UIButtonConfig **)(v7 + 108), v26);
WinSize = (GameManager *)UIButtonConfig::operator=((_BYTE *)(v24 + 1048), (int *)v33);
}
v14 = *(_DWORD *)(v7 + 108);
if ( (unsigned int)(-286331153 * ((*(_DWORD *)(v7 + 112) - v14) >> 2)) > 1 )
{
v15 = LevelControlConfig::resolveSlot(v33, v7, (UIButtonConfig *)(v14 + 60), v26);
v34 = v26[0] - v34;
v16 = GameManager::sharedState((GameManager *)v15);
WinSize = (GameManager *)UIButtonConfig::operator=((_BYTE *)(v16 + 1088), (int *)v33);
}
if ( (unsigned int)(-286331153 * ((*(_DWORD *)(v7 + 112) - *(_DWORD *)(v7 + 108)) >> 2)) > 2 )
{
v25 = GameManager::sharedState(WinSize);
LevelControlConfig::resolveSlot(v33, v7, (UIButtonConfig *)(*(_DWORD *)(v7 + 108) + 120), v26);
WinSize = (GameManager *)UIButtonConfig::operator=((_BYTE *)(v25 + 1128), (int *)v33);
}
v17 = *(_DWORD *)(v7 + 108);
if ( (unsigned int)(-286331153 * ((*(_DWORD *)(v7 + 112) - v17) >> 2)) > 3 )
{
v18 = LevelControlConfig::resolveSlot(v33, v7, (UIButtonConfig *)(v17 + 180), v26);
v34 = v26[0] - v34;
v19 = GameManager::sharedState((GameManager *)v18);
WinSize = (GameManager *)UIButtonConfig::operator=((_BYTE *)(v19 + 1168), (int *)v33);
}
}
else if ( -286331153 * v12 )
{
v13 = GameManager::sharedState(WinSize);
LevelControlConfig::resolveSlot(v33, v7, *(UIButtonConfig **)(v7 + 108), v26);
WinSize = (GameManager *)UIButtonConfig::operator=((_BYTE *)(v13 + 1008), (int *)v33);
}
if ( !*((_BYTE *)this + 712) )
{
v20 = (GameManager *)GameManager::sharedState(WinSize);
WinSize = (GameManager *)GameManager::setGameVariable(v20, "0113", (const char *)(*(_DWORD *)(v7 + 64) != 0));
}
v21 = GameManager::sharedState(WinSize);
GameManager::prepareDPadSettings(v21);
}
*((_BYTE *)this + 992) = 1;
TouchControlEditLayer::reloadNodes(this);
v22 = *(void (__fastcall **)(TouchControlEditLayer *, cocos2d::CCNode *, int))(*(_DWORD *)this + 232);
v27 = 0;
v28 = 0;
v29 = 0;
std::string::__init(&v27, "Pasted", 6u);
v30 = 0;
v31 = 0;
v32 = 0;
std::string::__init(&v30, &unk_B6B226, 0);
v23 = TextAlertPopup::create((int)&v27, (cocos2d::CCDelayTime *)0x3F000000, 0.6, 150, (int)&v30);
v22(this, v23, 100);
}
else
{
v8 = *(void (__fastcall **)(TouchControlEditLayer *, cocos2d::CCNode *, int))(*(_DWORD *)this + 232);
v27 = 0;
v28 = 0;
v29 = 0;
std::string::__init(&v27, "Invalid config", 0xEu);
v30 = 0;
v31 = 0;
v32 = 0;
std::string::__init(&v30, &unk_B6B226, 0);
v9 = TextAlertPopup::create((int)&v27, (cocos2d::CCDelayTime *)0x3F000000, 0.6, 150, (int)&v30);
v8(this, v9, 100);
}
}
else
{
v4 = *(void (__fastcall **)(TouchControlEditLayer *, cocos2d::CCNode *, int))(*(_DWORD *)this + 232);
v27 = 0;
v28 = 0;
v29 = 0;
std::string::__init(&v27, "Nothing copied", 0xEu);
v30 = 0;
v31 = 0;
v32 = 0;
std::string::__init(&v30, &unk_B6B226, 0);
v5 = TextAlertPopup::create((int)&v27, (cocos2d::CCDelayTime *)0x3F000000, 0.6, 150, (int)&v30);
v4(this, v5, 100);
}
std::string::~string((int)&v30);
return std::string::~string((int)&v27);
}