//
// PlatformerControlsPopup::onUpload from 0x79e128 to 0x79e306 (478 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:51 +0000
//
int __fastcall PlatformerControlsPopup::onUpload(int this, cocos2d::CCObject *a2)
{
int *v2; // r4
int v3; // r2
int v4; // r3
int v5; // r2
GJGameLevel *v6; // r0
int v7; // r3
int v8; // r2
int v9; // r3
int v10; // r3
int *v11; // r6
int *v12; // r0
int v13; // r2
void (__fastcall *v14)(int *, cocos2d::CCNode *, int); // r9
cocos2d::CCNode *v15; // r0
GameLevelManager *v16; // r0
GameManager *v17; // r9
const char *v18; // r8
int v19; // r8
int v20; // r2
int v21; // r2
int v22; // r3
int v23; // [sp+Ch] [bp-50h] BYREF
size_t v24; // [sp+10h] [bp-4Ch]
const void *v25; // [sp+14h] [bp-48h]
int v26[3]; // [sp+18h] [bp-44h] BYREF
int v27[3]; // [sp+24h] [bp-38h] BYREF
int v28[3]; // [sp+30h] [bp-2Ch] BYREF
int v29; // [sp+3Ch] [bp-20h] BYREF
size_t v30; // [sp+40h] [bp-1Ch]
const void *v31; // [sp+44h] [bp-18h]
int v32[3]; // [sp+48h] [bp-14h] BYREF
v2 = (int *)this;
v3 = *(_DWORD *)(this + 728);
if ( v3 )
{
v4 = *(_DWORD *)(v3 + 268);
v5 = *(_DWORD *)(v3 + 272);
if ( v4 - v5 > 0 )
{
PlatformerControlsPopup::commitCustomDraft(this, (int)a2, v5);
PlatformerControlsPopup::refreshClassUI((PlatformerControlsPopup *)v2);
v6 = GJGameLevel::shippedControls((GJGameLevel *)&v23, v2[182]);
if ( (v23 & 1) != 0 )
v7 = v24;
else
v7 = (int)(unsigned __int8)v23 >> 1;
if ( v7 )
{
v16 = (GameLevelManager *)GameLevelManager::sharedState(v6);
*((_DWORD *)v16 + 222) = v2 + 178;
v17 = (GameManager *)GameLevelManager::sharedState(v16);
v18 = (const char *)(*(_DWORD *)(v2[182] + 268) - *(_DWORD *)(v2[182] + 272));
v29 = 0;
v30 = 0;
v31 = nullptr;
if ( (v23 & 1) != 0 )
{
std::string::__init(&v29, v25, v24);
}
else
{
v29 = v23;
v30 = v24;
v31 = v25;
}
v19 = GameLevelManager::uploadLevelControls(v17, v18, (int)&v29);
std::string::~string((int)&v29);
if ( v19 )
{
v20 = v2[200];
if ( v20 )
{
*(_DWORD *)(v20 + 520) = 0;
v2[200] = 0;
}
memset(v32, 0, sizeof(v32));
std::string::__init(v32, "Uploading controls...", 0x15u);
v2[200] = UploadActionPopup::create((int)(v2 + 179), (int)v32, v21, v22);
std::string::~string((int)v32);
(*(void (__fastcall **)(int))(*(_DWORD *)v2[200] + 656))(v2[200]);
}
}
else
{
v8 = v2[182];
v9 = *(unsigned __int8 *)(v8 + 1328);
if ( (v9 & 1) != 0 )
v10 = *(_DWORD *)(v8 + 1332);
else
v10 = v9 >> 1;
if ( v10 )
{
v11 = v26;
memset(v26, 0, sizeof(v26));
std::string::__init(v26, "Nothing selected. Remove the uploaded controls from this level?", 0x3Fu);
v12 = FLAlertLayer::create(
(int)(v2 + 181),
(cocos2d::CCLabelBMFont *)"Remove Controls",
(int)v26,
(ButtonSprite *)"Cancel",
(ButtonSprite *)"Remove");
(*(void (__fastcall **)(int *))(*v12 + 656))(v12);
}
else
{
v13 = *v2;
v11 = v27;
memset(v27, 0, sizeof(v27));
v14 = *(void (__fastcall **)(int *, cocos2d::CCNode *, int))(v13 + 232);
std::string::__init(v27, "Nothing selected", 0x10u);
memset(v28, 0, sizeof(v28));
std::string::__init(v28, &unk_B6B226, 0);
v15 = TextAlertPopup::create((int)v27, (cocos2d::CCDelayTime *)0x3F000000, 0.6, 150, (int)v28);
v14(v2, v15, 100);
std::string::~string((int)v28);
}
std::string::~string((int)v11);
}
return std::string::~string((int)&v23);
}
}
return this;
}