mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-17 11:35:08 -04:00
Save default texture pack, use default pack in launcher.
This commit is contained in:
parent
5218124c6c
commit
14daffe9f0
@ -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 ) {
|
||||
|
@ -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";
|
||||
|
@ -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,
|
||||
|
@ -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";
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user