//
// CustomSFXWidget::onDownload from 0x1400c1a30 to 0x1400c1b25 (245 bytes)
//
// 3 xrefs:
// > CustomSFXWidget::FLAlert_Clicked @ 0x1400c295a
// > CustomSFXWidget::init @ 0x1400c0d69
// > ??> @ 0x1406c7f80
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=1
void CustomSFXWidget::onDownload(CustomSFXWidget *a1, cocos2d::CCObject *a2)
{
GameManager *v3; // rcx
MusicDownloadManager *v4; // rcx
_BOOL8 v5; // rdx
MusicDownloadManager *v6; // rax
void *v7; // [rsp+30h] [rbp+8h]
a1->m_errorLabel->setVisible(a1->m_errorLabel, 0);
if ( a1->m_sfxObject )
{
v3 = (GameManager *)qword_1406C2ED8;
if ( !qword_1406C2ED8 )
{
v7 = operator new(0x668u);
qword_1406C2ED8 = sub_14017AB00(v7);
(*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);
v3 = (GameManager *)qword_1406C2ED8;
}
if ( GameManager::getGameVariable(v3, "0016") )
{
CustomSFXWidget::showLoadingArt(a1);
a1->m_downloadButton->setVisible(a1->m_downloadButton, 0);
LOBYTE(v5) = 1;
a1->m_cancelButton->setVisible(a1->m_cancelButton, v5);
a1->m_deleteButton->setVisible(a1->m_deleteButton, 0);
a1->m_showCancel = 0;
v6 = MusicDownloadManager::sharedState();
MusicDownloadManager::downloadSFX(v6, a1->m_sfxID);
CustomSFXWidget::startMonitorDownload(a1);
}
else
{
MusicDownloadManager::sharedState();
MusicDownloadManager::showTOS(v4, &a1->FLAlertLayerProtocol);
}
}
}