//
// EditorSoundConfigInfoLayer::FLAlert_Clicked from 0x7887e8 to 0x788b62 (890 bytes)
//
// 1 xrefs:
// > `non-virtual thunk to'EditorSoundConfigInfoLayer::FLAlert_Clicked @ 0x788bac
//
// 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:34 +0000
//
int *__fastcall EditorSoundConfigInfoLayer::FLAlert_Clicked(int *this, FLAlertLayer *a2, int a3)
{
int *v3; // r4
int *v4; // r0
int v5; // r1
int v6; // r3
int *v7; // r7
int v8; // r0
int *v9; // r0
int v10; // r3
const char *v11; // r9
size_t v12; // r0
int *v13; // r0
int *v14; // r0
int v15; // r3
unsigned int v16; // r0
FLAlertLayer *v17; // r0
cocos2d::CCArray **v18; // r0
int v19; // r2
int v20; // r3
GJEditorSoundConfig *v21; // r1
int *v22; // r0
EditorSoundBrowserLayer *v23; // r0
cocos2d::CCArray **v24; // r0
int *v25; // r0
int v26; // r3
unsigned int v27; // r0
int v28; // [sp+Ch] [bp-38h] BYREF
int v29; // [sp+10h] [bp-34h]
int v30; // [sp+14h] [bp-30h]
char v31[4]; // [sp+18h] [bp-2Ch] BYREF
int v32; // [sp+1Ch] [bp-28h]
const char *v33; // [sp+20h] [bp-24h]
char *v34[3]; // [sp+24h] [bp-20h] BYREF
int v35; // [sp+30h] [bp-14h] BYREF
int v36; // [sp+34h] [bp-10h]
int v37; // [sp+38h] [bp-Ch]
v3 = this;
if ( a3 )
{
this = (int *)(*(int (__fastcall **)(FLAlertLayer *))(*(_DWORD *)a2 + 32))(a2);
if ( this == (int *)&stru_1B4C.st_other )
{
v4 = v3;
v5 = 0;
return EditorSoundConfigInfoLayer::applyConfig(v4, v5, v5);
}
if ( this == (int *)((char *)&stru_1B5C.st_name + 2) )
{
if ( v3[188] != 2 || (v6 = v3[187]) == 0 || *(int *)(v6 + 268) <= 0 )
{
v4 = v3;
v5 = 1;
return EditorSoundConfigInfoLayer::applyConfig(v4, v5, v5);
}
v7 = &v28;
v28 = 0;
v29 = 0;
v30 = 0;
v24 = (cocos2d::CCArray **)EditorSFXManager::sharedState((EditorSFXManager *)((char *)&stru_1B5C.st_name + 2));
if ( EditorSFXManager::applyMyConfig(v24, *(_DWORD *)(v3[187] + 268), 1, &v28) )
{
*(_DWORD *)v31 = 0;
v32 = 0;
v33 = nullptr;
std::string::__init((int *)v31, "Sound pack merged into your current sounds.", 0x2Bu);
v25 = FLAlertLayer::create(0, (cocos2d::CCLabelBMFont *)"Applied", (int)v31, (ButtonSprite *)"OK", nullptr);
(*(void (__fastcall **)(int *))(*v25 + 656))(v25);
goto LABEL_23;
}
if ( (v28 & 1) != 0 )
v26 = v29;
else
v26 = (int)(unsigned __int8)v28 >> 1;
if ( v26 )
{
std::string::basic_string((int *)v31, (int)&v28);
}
else
{
*(_DWORD *)v31 = 0;
v32 = 0;
v33 = nullptr;
std::string::__init((int *)v31, "Failed to apply sound pack.", 0x1Bu);
}
if ( (v31[0] & 1) != 0 )
v11 = v33;
else
v11 = &v31[1];
LABEL_22:
v35 = 0;
v36 = 0;
v37 = 0;
v12 = strlen(v11);
std::string::__init(&v35, v11, v12);
v13 = FLAlertLayer::create(0, (cocos2d::CCLabelBMFont *)"Error", (int)&v35, (ButtonSprite *)"OK", nullptr);
(*(void (__fastcall **)(int *))(*v13 + 656))(v13);
std::string::~string((int)&v35);
LABEL_23:
std::string::~string((int)v31);
goto LABEL_26;
}
if ( this == (int *)((char *)&stru_1B4C.st_shndx + 1) )
{
if ( !v3[187] )
return this;
v7 = &v28;
v28 = 0;
v29 = 0;
v30 = 0;
v8 = EditorSFXManager::sharedState((EditorSFXManager *)((char *)&stru_1B4C.st_shndx + 1));
if ( EditorSFXManager::overwriteMyConfigFromLive(v8, *(_DWORD *)(v3[187] + 268), &v28) )
{
*(_DWORD *)v31 = 0;
v32 = 0;
v33 = nullptr;
std::string::__init((int *)v31, "Sound pack updated with your current sound settings.", 0x34u);
v9 = FLAlertLayer::create(0, (cocos2d::CCLabelBMFont *)"Saved", (int)v31, (ButtonSprite *)"OK", nullptr);
(*(void (__fastcall **)(int *))(*v9 + 656))(v9);
std::string::~string((int)v31);
EditorSoundConfigInfoLayer::buildSummary((EditorSoundConfigInfoLayer *)v3);
EditorSoundConfigInfoLayer::refreshActionButtons((EditorSoundConfigInfoLayer *)v3);
LABEL_26:
v14 = v7;
return (int *)std::string::~string((int)v14);
}
if ( (v28 & 1) != 0 )
v10 = v29;
else
v10 = (int)(unsigned __int8)v28 >> 1;
if ( v10 )
{
std::string::basic_string((int *)v31, (int)&v28);
}
else
{
*(_DWORD *)v31 = 0;
v32 = 0;
v33 = nullptr;
std::string::__init((int *)v31, "Failed to overwrite.", 0x14u);
}
if ( (v31[0] & 1) != 0 )
v11 = v33;
else
v11 = &v31[1];
goto LABEL_22;
}
if ( this == (int *)&stru_1B4C.st_shndx )
{
v7 = &v35;
v35 = 0;
v36 = 0;
v37 = 0;
std::string::__init(&v35, &unk_B6B226, 0);
memset(v34, 0, sizeof(v34));
EditorSoundConfigInfoLayer::startServerDelete((GameLevelManager *)v3, (unsigned __int8 *)&v35, v34);
std::__vector_base::~__vector_base(v34);
goto LABEL_26;
}
if ( this == (int *)&stru_1B5C )
{
v15 = v3[187];
if ( !v15 )
return this;
if ( v3[188] == 2 && *(int *)(v15 + 268) > 0 )
{
v16 = EditorSFXManager::sharedState((EditorSFXManager *)&stru_1B5C);
EditorSFXManager::removeMyConfig(v16, *(_DWORD *)(v3[187] + 268));
}
else
{
v27 = EditorSFXManager::sharedState((EditorSFXManager *)&stru_1B5C);
EditorSFXManager::removeFavoriteConfig(v27, *(_DWORD *)(v3[187] + 264));
}
v17 = (FLAlertLayer *)v3[189];
if ( v17 )
EditorSoundBrowserLayer::onConfigListChanged(v17);
return (int *)(*(int (__fastcall **)(int *, _DWORD))(*v3 + 684))(v3, 0);
}
if ( this == (int *)((char *)&stru_1B5C.st_name + 3) )
return (int *)EditorSoundConfigInfoLayer::startSFXDownload((EditorSoundConfigInfoLayer *)v3);
if ( this == (int *)((char *)&stru_1B5C.st_name + 1) && v3[187] )
{
v18 = (cocos2d::CCArray **)EditorSFXManager::sharedState((EditorSFXManager *)((char *)&stru_1B5C.st_name + 1));
v21 = (GJEditorSoundConfig *)EditorSFXManager::copyFavoriteToMyConfig(
v18,
(GJEditorSoundConfig *)v3[187],
v19,
v20);
if ( !v21 )
{
v35 = 0;
v36 = 0;
v37 = 0;
std::string::__init(&v35, "You already have 50 sound packs. Delete some first.", 0x33u);
v22 = FLAlertLayer::create(
0,
(cocos2d::CCLabelBMFont *)"Limit Reached",
(int)&v35,
(ButtonSprite *)"OK",
nullptr);
(*(void (__fastcall **)(int *))(*v22 + 656))(v22);
v14 = &v35;
return (int *)std::string::~string((int)v14);
}
v23 = (EditorSoundBrowserLayer *)v3[189];
if ( v23 )
EditorSoundBrowserLayer::onConfigCopiedToMyLists(v23, v21);
return (int *)(*(int (__fastcall **)(int *, _DWORD))(*v3 + 684))(v3, 0);
}
}
return this;
}