diff options
| author | william341 <[email protected]> | 2017-05-28 12:37:00 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-05-28 12:37:00 -0700 |
| commit | 771c20cfb3a703e0f1550fdcf9eb07b78298c944 (patch) | |
| tree | 59cb532e15ebff313fdba2be264d78ec0033f407 /ShiftOS.WinForms/Applications/Downloader.cs | |
| parent | 496b0cbf8659c99203f48210fd39c572400ae623 (diff) | |
| parent | c7ba7d733c756d196f98dd4533289a1ef4db715f (diff) | |
| download | shiftos_thereturn-771c20cfb3a703e0f1550fdcf9eb07b78298c944.tar.gz shiftos_thereturn-771c20cfb3a703e0f1550fdcf9eb07b78298c944.tar.bz2 shiftos_thereturn-771c20cfb3a703e0f1550fdcf9eb07b78298c944.zip | |
Merge pull request #1 from shiftos-game/master
welp, no longer a dev.
Diffstat (limited to 'ShiftOS.WinForms/Applications/Downloader.cs')
| -rw-r--r-- | ShiftOS.WinForms/Applications/Downloader.cs | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/ShiftOS.WinForms/Applications/Downloader.cs b/ShiftOS.WinForms/Applications/Downloader.cs index b1b7ed9..b3d2cea 100644 --- a/ShiftOS.WinForms/Applications/Downloader.cs +++ b/ShiftOS.WinForms/Applications/Downloader.cs @@ -41,8 +41,12 @@ using System.IO.Compression; namespace ShiftOS.WinForms.Applications { - [Launcher("Downloader", false, null, "Networking")] + [MultiplayerOnly] + [Launcher("Downloader", true, "al_downloader", "Networking")] [DefaultIcon("iconDownloader")] + [WinOpen("downloader")] + [DefaultTitle("Downloader")] + [RequiresUpgrade("downloader")] public partial class Downloader : UserControl, IShiftOSWindow { public Downloader() @@ -173,18 +177,13 @@ namespace ShiftOS.WinForms.Applications /// <returns>Download speed in bytes.</returns> public static int GetDownloadSpeed() { - switch (SaveSystem.CurrentSave.ShiftnetSubscription) - { - case 0: - return 256/*B*/; - case 1: - return 1024 * 1024/*KB*/; - case 2: - return 1024 * 10240/*KB*/; - case 3: - return 1024 * 1024 * 1024/*MB*/; - } - return 256; + return GetAllSubscriptions()[SaveSystem.CurrentSave.ShiftnetSubscription].DownloadSpeed; + } + + public static ShiftOS.Objects.EngineShiftnetSubscription[] GetAllSubscriptions() + { + //For now we'll have them hard-coded into the client but in future they'll be in the MUD. + return JsonConvert.DeserializeObject<ShiftOS.Objects.EngineShiftnetSubscription[]>(Properties.Resources.ShiftnetServices); } public static void StartDownload(Download down) |
