//
// CreatorSettingsPopup::setTextPopupClosed from 0x1008b7070 to 0x1008b7290 (544 bytes)
//
// 2 xrefs:
// > sub_1008B72E0 @ 0x1008b72ec
// > ??> @ 0x100baf1d8
//
// 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 12:37:24 +0000
//
void __fastcall CreatorSettingsPopup::setTextPopupClosed(_QWORD *a1, __int64 a2, std::string *a3)
{
__int64 v5; // r15
__int64 v6; // rdi
__int64 v7; // r14
__int64 v8; // rax
int v9; // r15d
bool updated; // r14
__int64 v11; // rax
char *v12; // rax
std::string __str; // [rsp+0h] [rbp-80h] BYREF
__int128 v14; // [rsp+18h] [rbp-68h] BYREF
void *v15; // [rsp+28h] [rbp-58h]
std::string v16; // [rsp+30h] [rbp-50h] BYREF
std::string v17[2]; // [rsp+50h] [rbp-30h] BYREF
if ( a2 && *(_BYTE *)(a2 + 681) )
return;
v5 = a1[130];
if ( (*(_BYTE *)&a3->__r_.__value_.__s.0 & 1) != 0 )
sub_10001AD30(&v16, a3->__r_.__value_.__l.__data_, a3->__r_.__value_.__l.__size_);
else
v16 = *a3;
LevelTools::base64EncodeString(&__str, &v16);
std::string::operator=((std::string *)(v5 + 368), &__str);
if ( (*(_BYTE *)&__str.__r_.__value_.__s.0 & 1) != 0 )
{
operator delete(__str.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&v16.__r_.__value_.__s.0 & 1) == 0 )
{
LABEL_8:
v6 = a1[131];
if ( !v6 )
goto LABEL_10;
goto LABEL_9;
}
}
else if ( (*(_BYTE *)&v16.__r_.__value_.__s.0 & 1) == 0 )
{
goto LABEL_8;
}
operator delete(v16.__r_.__value_.__l.__data_);
v6 = a1[131];
if ( v6 )
LABEL_9:
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v6 + 16LL))(v6, a3);
LABEL_10:
if ( *(_DWORD *)(a1[130] + 328LL) > *(_DWORD *)(a1[130] + 332LL) )
{
*(_QWORD *)(GameLevelManager::sharedState() + 1360) = a1 + 127;
v7 = GameLevelManager::sharedState();
v8 = a1[130];
v9 = *(_DWORD *)(v8 + 328) - *(_DWORD *)(v8 + 332);
if ( (*(_BYTE *)(v8 + 368) & 1) != 0 )
sub_10001AD30(v17, *(const void **)(v8 + 384), *(_QWORD *)(v8 + 376));
else
v17[0] = *(std::string *)(v8 + 368);
updated = GameLevelManager::updateDescription(v7, v9, v17);
if ( (*(_BYTE *)&v17[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(v17[0].__r_.__value_.__l.__data_);
if ( updated )
{
v11 = a1[132];
if ( v11 )
{
*(_QWORD *)(v11 + 664) = 0;
a1[132] = 0;
}
v15 = operator new(0x1Au);
*(_QWORD *)&v14 = 27;
*((_QWORD *)&v14 + 1) = 23;
strcpy((char *)v15, "Updating description...");
v12 = UploadActionPopup::create((__int64)(a1 + 128), &v14);
a1[132] = v12;
if ( (v14 & 1) != 0 )
{
operator delete(v15);
v12 = (char *)a1[132];
}
(*(void (__fastcall **)(char *))(*(_QWORD *)v12 + 1312LL))(v12);
}
}
}