public void DownloadItems(AsyncDownloader downloader, Action <string> setStatus) { this.downloader = downloader; DownloadMusicFiles(); digPatcher = new SoundPatcher(ResourceList.DigSounds, "dig_", "step_cloth1"); digPatcher.FetchFiles(digSoundsUri, altDigSoundsUri, this, DigSoundsExist); stepPatcher = new SoundPatcher(ResourceList.StepSounds, "step_", "classic jar"); stepPatcher.FetchFiles(stepSoundsUri, altStepSoundsUri, this, StepSoundsExist); flags = 0; foreach (var entry in ResourceList.Files) { flags |= entry.Value; } if ((flags & ResourceList.cMask) != 0) { downloader.DownloadData(jarClassicUri, false, "classic_jar"); } if ((flags & ResourceList.mMask) != 0) { downloader.DownloadData(jar162Uri, false, "162_jar"); } if ((flags & ResourceList.gMask) != 0) { downloader.DownloadData(pngGuiPatchUri, false, "gui_patch"); } if ((flags & ResourceList.tMask) != 0) { downloader.DownloadData(pngTerrainPatchUri, false, "terrain_patch"); } SetFirstStatus(setStatus); }
void DownloadMusicFiles() { string[] files = ResourceList.MusicFiles; for (int i = 0; i < files.Length; i++) { if (musicExists[i]) { continue; } string baseUri = i < 3 ? musicUri : newMusicUri; string url = baseUri + files[i] + ".ogg"; downloader.DownloadData(url, false, files[i]); } }
public void DownloadItems(AsyncDownloader downloader, Action <string> setStatus) { this.downloader = downloader; DownloadMusicFiles(); digPatcher = new SoundPatcher(digSounds, "dig_", "step_cloth1", digPath); digPatcher.FetchFiles(digSoundsUri, altDigSoundsUri, this); stepPatcher = new SoundPatcher(stepSounds, "step_", "classic jar", stepPath); stepPatcher.FetchFiles(stepSoundsUri, altStepSoundsUri, this); if (!defaultZipExists) { downloader.DownloadData(jarClassicUri, false, "classic_jar"); downloader.DownloadData(jar162Uri, false, "162_jar"); downloader.DownloadData(pngTerrainPatchUri, false, "terrain_patch"); downloader.DownloadData(pngGuiPatchUri, false, "gui_patch"); } SetFirstStatus(setStatus); }
void DownloadMusicFiles() { for (int i = 0; i < musicFiles.Length; i++) { if (musicExists[i]) { continue; } string baseUri = i < 3 ? musicUri : newMusicUri; string url = baseUri + musicFiles[i] + ".ogg"; downloader.DownloadData(url, false, musicFiles[i]); } }
public void QueueItem(string url, string identifier) { downloader.DownloadData(url, false, identifier); FilesToDownload.Add(identifier); }