//
// CustomSongWidget::onDownload from 0x3e01b0 to 0x3e02c2 (274 bytes)
//
// 2 xrefs:
// > CustomSongWidget::musicActionFinished @ 0x3e02dc
// > CustomSongWidget::FLAlert_Clicked @ 0x3e031e
//
// 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
//
void CustomSongWidget::onDownload(CustomSongWidget *a1, cocos2d::CCObject *a2)
{
cocos2d::extension::CCScale9Sprite *m_bgSpr; // r0
GameManager *v4; // r0
MusicDownloadManager *v5; // r0
_BOOL4 m_hasSFX; // r5
MusicDownloadManager *v7; // r0
MusicDownloadManager *v8; // r0
a1->m_errorLabel->setVisible(a1->m_errorLabel, 0);
m_bgSpr = a1->m_bgSpr;
if ( m_bgSpr )
m_bgSpr->setVisible(m_bgSpr, 0);
v4 = GameManager::sharedState();
if ( !GameManager::getGameVariable(v4, "0016") )
{
v5 = MusicDownloadManager::sharedState();
MusicDownloadManager::showTOS(v5, &a1->FLAlertLayerProtocol);
return;
}
m_hasSFX = a1->m_hasSFX;
if ( a1->m_hasSFX )
{
a1->m_downloadBtn->setVisible(a1->m_downloadBtn, 0);
a1->m_cancelDownloadBtn->setVisible(a1->m_cancelDownloadBtn, 1);
if ( *((_DWORD *)MusicDownloadManager::sharedState()->m_customContentURL.m_data.m_data - 3) )
{
CustomSongWidget::startMultiAssetDownload(a1);
return;
}
LABEL_11:
a1->m_hasLibrarySongs = 1;
v7 = MusicDownloadManager::sharedState();
MusicDownloadManager::getCustomContentURL(v7);
return;
}
if ( !a1->m_songInfoObject )
return;
a1->m_sliderGroove->setVisible(a1->m_sliderGroove, 1);
a1->m_downloadBtn->setVisible(a1->m_downloadBtn, m_hasSFX);
a1->m_cancelDownloadBtn->setVisible(a1->m_cancelDownloadBtn, 1);
a1->m_deleteBtn->setVisible(a1->m_deleteBtn, m_hasSFX);
if ( a1->m_customSongID > (int)"s of X position. These triggers need to use Group ID and have Spawn Trigger enabled.\nPreview Disable disables activation while not playtesting in editor.\nSpawn Ordered spawns the triggers in order from left to right.\nUse remapping (page 2) to copy a Spawn setup to another group."
&& !*((_DWORD *)MusicDownloadManager::sharedState()->m_customContentURL.m_data.m_data - 3) )
{
goto LABEL_11;
}
if ( a1->m_songInfoObject->m_verified )
{
CustomSongWidget::startDownload(a1);
}
else
{
a1->m_isNotDownloading = 1;
v8 = MusicDownloadManager::sharedState();
MusicDownloadManager::getSongInfo(v8, a1->m_customSongID, 1);
}
}