//
// CustomSongWidget::onCancelDownload from 0x1400caaa0 to 0x1400cab26 (134 bytes)
//
// 2 xrefs:
// > CustomSongWidget::init @ 0x1400c8855
// > ??> @ 0x1406c82e0
//
// 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::onCancelDownload(CustomSongWidget *a1, cocos2d::CCObject *a2)
{
int m_customSongID; // ebx
MusicDownloadManager *v4; // rsi
cocos2d::CCString *v5; // rax
const char *CString; // rbx
__int64 AchievementsWithID; // rax
m_customSongID = a1->m_customSongID;
v4 = MusicDownloadManager::sharedState();
v5 = cocos2d::CCString::createWithFormat("d_%i", m_customSongID);
CString = cocos2d::CCString::getCString(v5);
AchievementsWithID = AchievementManager::getAchievementsWithID((__int64)v4, (__int64)CString);
if ( AchievementsWithID )
*(_BYTE *)(AchievementsWithID + 204) = 1;
MusicDownloadManager::removeDLFromActive(v4, CString);
a1->downloadSongFailed(&a1->MusicDownloadDelegate, a1->m_customSongID, DownloadCancelled);
}