private void DownloadMap(object sender, EventArgs e) { if (BeatmapManager.Current != null) { //check it matches the downloadable copy FileNetRequest request = new FileNetRequest(BeatmapManager.Current.Filename + "_", Urls.PATH_MAPS + Path.GetFileName(BeatmapManager.Current.Filename)); request.onFinish += c_DownloadFileCompleted; NetManager.AddRequest(request); ((pSprite)sender).IsClickable = false; GameBase.ShowMessage("Downloading update...", Color.YellowGreen, 2000); } else { try { Process.Start(string.Format(Urls.BEATMAP_LISTING, Match.beatmapId)); } catch { } } }
/// <summary> /// If the avatar is to be displayed, and it is available, we will load it or download then load it. /// </summary> internal bool CheckAvatar() { if (StatsLoaded && !AvatarLoaded && Sprites != null && AvatarFilename != null) { AvatarLoaded = true; if (!File.Exists("Avatars\\" + AvatarFilename) && AvatarFilename.Length > 0) { FileNetRequest request = new FileNetRequest("Avatars\\" + AvatarFilename, "http://osu.ppy.sh/forum/download.php?avatar=" + AvatarFilename); request.onFinish += wc_AvatarDownloadComplete; NetManager.AddRequest(request); return(false); } UpdateAvatar(); } return(true); }