From 0159b1ba0531d4838737bd84c9953c82598a7b9c Mon Sep 17 00:00:00 2001 From: William Moorehouse Date: Tue, 16 Jun 2015 21:37:00 -0400 Subject: [PATCH] Removed texture pack extraction from launcher --- TrueCraft.Core/TexturePack.cs | 12 +++++++++++- TrueCraft.Launcher/Views/OptionView.cs | 10 +++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/TrueCraft.Core/TexturePack.cs b/TrueCraft.Core/TexturePack.cs index 4c84fdf..b3ef19a 100644 --- a/TrueCraft.Core/TexturePack.cs +++ b/TrueCraft.Core/TexturePack.cs @@ -19,7 +19,17 @@ namespace TrueCraft.Core /// public const string ImageFile = "pack.png"; - + /// + /// + /// + public static string TexturePackPath + { + get + { + return System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), + ".truecraft/texturepacks/"); + } + } /// /// diff --git a/TrueCraft.Launcher/Views/OptionView.cs b/TrueCraft.Launcher/Views/OptionView.cs index c03d55e..1f7e70c 100644 --- a/TrueCraft.Launcher/Views/OptionView.cs +++ b/TrueCraft.Launcher/Views/OptionView.cs @@ -60,17 +60,13 @@ namespace TrueCraft.Launcher.Views { var texturePack = _texturePacks[TexturePackListView.SelectedRow]; if (_lastTexturePack != texturePack) - { - // TODO: Enforce a file structure so only certain named files are extracted. - texturePack.ExtractTo("Content"); - _lastTexturePack = texturePack; - } + UserSettings.Local.SelectedTexturePack = texturePack.Path; }; OpenFolderButton.Clicked += (sender, e) => { // TODO: Implement cross-platform logic here. - var dir = new DirectoryInfo("./Content/TexturePacks"); + var dir = new DirectoryInfo(TexturePack.TexturePackPath); Process.Start(dir.FullName); }; @@ -91,7 +87,7 @@ namespace TrueCraft.Launcher.Views private void LoadTexturePacks() { - var zips = Directory.EnumerateFiles("Content/TexturePacks/"); + var zips = Directory.EnumerateFiles(TexturePack.TexturePackPath); foreach (var zip in zips) { var texturePack = new TexturePack(zip);