//
// PlatformerControlsPopup::onLevelControlsRefreshed from 0x140451460 to 0x1404515fc (412 bytes)
//
// 2 xrefs:
// > ??> @ 0x140794e78
// > ??> @ 0x1409277b8
//
// 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:32:27 +0000
//
// Hidden C++ exception states: #wind=1
void __fastcall PlatformerControlsPopup::onLevelControlsRefreshed(__int64 a1, __int64 a2, int a3)
{
__int64 v5; // rcx
__int64 v6; // rcx
__int64 v7; // rcx
const char *v8; // rdx
size_t v9; // r8
__int64 v10; // rbx
__int64 v11; // rdx
__int64 v12; // r8
cocos2d::CCNode *v13; // rax
__int64 v14; // rdx
__int64 v15; // rax
bool v16; // bl
__int64 v17; // rcx
__int128 v18; // [rsp+30h] [rbp-58h] BYREF
__int64 v19; // [rsp+40h] [rbp-48h]
__int64 v20; // [rsp+48h] [rbp-40h]
__int128 v21; // [rsp+50h] [rbp-38h] BYREF
__int64 v22; // [rsp+60h] [rbp-28h]
__int64 v23; // [rsp+68h] [rbp-20h]
v5 = *(_QWORD *)(a1 + 16);
if ( v5 && *(_DWORD *)(v5 + 328) - *(_DWORD *)(v5 + 332) == (_DWORD)a2 )
{
v6 = *(_QWORD *)(a1 + 160);
if ( v6 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v6 + 336LL))(v6, 0);
v7 = *(_QWORD *)(a1 + 152);
if ( v7 )
{
LOBYTE(a2) = 1;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v7 + 336LL))(v7, a2);
}
v8 = "Update failed";
if ( a3 )
{
if ( a3 == 1 )
{
v8 = (const char *)&xmmword_1407268C8;
}
else if ( a3 == 2 )
{
v8 = "No controls found";
}
}
else
{
v8 = "Creator controls updated";
}
v18 = 0;
v19 = 0;
v20 = 15;
LOBYTE(v18) = 0;
v21 = 0;
v22 = 0;
v23 = 0;
v9 = -1;
do
++v9;
while ( v8[v9] );
sub_14003D230(&v21, v8, v9);
v10 = *(_QWORD *)(a1 - 1016);
v13 = TextAlertPopup::create((__int64)&v21, v11, v12, 150, (__int64)&v18);
(*(void (__fastcall **)(__int64, cocos2d::CCNode *, __int64))(v10 + 456))(a1 - 1016, v13, 100);
if ( (a3 & 0xFFFFFFFD) == 0 )
{
*(_BYTE *)(a1 + 72) = 1;
PlatformerControlsPopup::reapplyRuntime();
}
PlatformerControlsPopup::syncSourceUI((_QWORD *)(a1 - 1016), v14);
v15 = *(_QWORD *)(a1 + 16);
v16 = v15 && *(_QWORD *)(v15 + 2040);
v17 = *(_QWORD *)(a1 + 144);
if ( v17 )
{
(*(void (__fastcall **)(__int64, bool))(*(_QWORD *)v17 + 336LL))(v17, v16);
(*(void (__fastcall **)(_QWORD, bool))(**(_QWORD **)(a1 + 144) + 936LL))(*(_QWORD *)(a1 + 144), v16);
}
}
}