diff --git a/ClassicalSharp/Game/Game.cs b/ClassicalSharp/Game/Game.cs index 122f9f1ba..10d06a293 100644 --- a/ClassicalSharp/Game/Game.cs +++ b/ClassicalSharp/Game/Game.cs @@ -77,9 +77,13 @@ namespace ClassicalSharp { string defTexturePack = "default.zip"; public string DefaultTexturePack { - get { return File.Exists( defTexturePack ) + get { + return File.Exists( defTexturePack ) ? defTexturePack : "default.zip"; } - set { defTexturePack = value; } + set { + defTexturePack = value; + Options.Set( OptionsKey.DefaultTexturePack, value ); + } } void LoadAtlas( Bitmap bmp ) { diff --git a/ClassicalSharp/Utils/Options.cs b/ClassicalSharp/Utils/Options.cs index 5356b7164..dcaa85409 100644 --- a/ClassicalSharp/Utils/Options.cs +++ b/ClassicalSharp/Utils/Options.cs @@ -13,6 +13,7 @@ namespace ClassicalSharp { public const string Speed = "speedmultiplier"; public const string ChatLines = "chatlines"; public const string ArialChatFont = "arialchatfont"; + public const string DefaultTexturePack = "defaulttexpack"; public const string MouseLeft = "mouseleft"; public const string MouseMiddle = "mousemiddle"; diff --git a/Launcher2/Gui/Screens/MainScreen.cs b/Launcher2/Gui/Screens/MainScreen.cs index 30806875e..8a0bad1ab 100644 --- a/Launcher2/Gui/Screens/MainScreen.cs +++ b/Launcher2/Gui/Screens/MainScreen.cs @@ -69,7 +69,7 @@ namespace Launcher2 { MakeButtonAt( "Singleplayer", Anchor.Centre, Anchor.Centre, buttonWidth, buttonHeight, 0, 0, - (x, y) => Client.Start( "default.zip" ) ); + (x, y) => Client.Start( "" ) ); MakeButtonAt( "Check for updates", Anchor.Centre, Anchor.Centre, buttonWidth, buttonHeight, 0, 100, diff --git a/Launcher2/LauncherWindow.Background.cs b/Launcher2/LauncherWindow.Background.cs index 8b26afddc..3fb5f1ec7 100644 --- a/Launcher2/LauncherWindow.Background.cs +++ b/Launcher2/LauncherWindow.Background.cs @@ -12,9 +12,15 @@ namespace Launcher2 { bool useTexture = false; internal void TryLoadTexturePack() { - if( !File.Exists( "default.zip" ) ) return; + Options.Load(); + string texPack = Options.Get( OptionsKey.DefaultTexturePack ) ?? "default.zip"; - using( Stream fs = new FileStream( "default.zip", FileMode.Open, FileAccess.Read, FileShare.Read ) ) { + if( !File.Exists( texPack ) ) + texPack = "default.zip"; + if( !File.Exists( texPack ) ) + return; + + using( Stream fs = new FileStream( texPack, FileMode.Open, FileAccess.Read, FileShare.Read ) ) { ZipReader reader = new ZipReader(); reader.ShouldProcessZipEntry = (f) => f == "terrain.png"; diff --git a/Launcher2/Utils/Client.cs b/Launcher2/Utils/Client.cs index 1ed10cdb9..1e5ed9f7a 100644 --- a/Launcher2/Utils/Client.cs +++ b/Launcher2/Utils/Client.cs @@ -18,6 +18,9 @@ namespace Launcher2 { public static bool Start( string args ) { Process process = null; + Options.Load(); + string texPack = Options.Get( OptionsKey.DefaultTexturePack ) ?? "default.zip"; + args = args + " " + texPack; if( !File.Exists( "ClassicalSharp.exe" ) ) return false;