//
// PlatformerControlsPopup::onLevelControlsRefreshed from 0xcfbad0 to 0xcfbcc0 (496 bytes)
//
// 3 xrefs:
// > `non-virtual thunk to'PlatformerControlsPopup::onLevelControlsRefreshed @ 0xcfbcc8
// > ??> @ 0x101710
// > ??> @ 0x1505bc8
//
// This function is hookable on this platform (idp: arm, 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 13:06:51 +0000
//
__int64 __fastcall PlatformerControlsPopup::onLevelControlsRefreshed(PlatformerControlsPopup *this, int a2, int a3)
{
__int64 v5; // x0
__int64 v7; // x0
__int64 v8; // x0
const char *v9; // x1
__int64 v10; // x2
void (__fastcall *v11)(PlatformerControlsPopup *, __int64, __int64); // x24
size_t v12; // x0
__int64 v13; // x0
char *v14; // [xsp+48h] [xbp+48h]
__int64 v15[2]; // [xsp+58h] [xbp+58h] BYREF
void *v16; // [xsp+68h] [xbp+68h]
__int64 v17[2]; // [xsp+70h] [xbp+70h] BYREF
void *v18; // [xsp+80h] [xbp+80h]
v5 = *((_QWORD *)this + 131);
if ( v5 && a2 == *(_DWORD *)(v5 + 328) - *(_DWORD *)(v5 + 332) )
{
v7 = *((_QWORD *)this + 148);
if ( v7 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v7 + 344LL))(v7, 0);
v8 = *((_QWORD *)this + 147);
if ( v8 )
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v8 + 344LL))(v8, 1);
if ( a3 == 1 )
{
v9 = "Already up to date";
}
else if ( a3 == 2 )
{
v9 = "No controls found";
}
else if ( a3 )
{
v9 = "Update failed";
}
else
{
v9 = "Creator controls updated";
}
v10 = *(_QWORD *)this;
v14 = (char *)v9;
v15[0] = 0;
v11 = *(void (__fastcall **)(PlatformerControlsPopup *, __int64, __int64))(v10 + 464);
v15[1] = 0;
v16 = nullptr;
v12 = strlen(v9);
std::string::__init(v15, v14, v12);
v17[0] = 0;
v17[1] = 0;
v18 = nullptr;
std::string::__init(v17, &byte_11B8890, 0);
v13 = TextAlertPopup::create((char *)v15, 150, (char *)v17, 0.5, 0.6);
v11(this, v13, 100);
if ( (v17[0] & 1) != 0 )
operator delete(v18);
if ( (v15[0] & 1) != 0 )
operator delete(v16);
if ( (a3 & 0xFFFFFFFD) == 0 )
{
*((_BYTE *)this + 1096) = 1;
PlatformerControlsPopup::reapplyRuntime(this);
}
PlatformerControlsPopup::syncSourceUI(this);
PlatformerControlsPopup::refreshApplyVisible((__int64)this);
}
return _stack_chk_guard;
}