Remove TexturePack command as it was replaced by gui long ago.

This commit is contained in:
UnknownShadow200 2015-10-23 18:33:51 +11:00
parent 8c8a850fad
commit f2d60c70e3
3 changed files with 11 additions and 35 deletions

View File

@ -17,7 +17,6 @@ namespace ClassicalSharp.Commands {
RegisterCommand( new HelpCommand() ); RegisterCommand( new HelpCommand() );
RegisterCommand( new InfoCommand() ); RegisterCommand( new InfoCommand() );
RegisterCommand( new RenderTypeCommand() ); RegisterCommand( new RenderTypeCommand() );
RegisterCommand( new TexturePackCommand() );
} }
public void RegisterCommand( Command command ) { public void RegisterCommand( Command command ) {

View File

@ -1,8 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Text; using System.Text;
using ClassicalSharp.TexturePack;
using ClassicalSharp.Renderers; using ClassicalSharp.Renderers;
namespace ClassicalSharp.Commands { namespace ClassicalSharp.Commands {
@ -111,6 +109,7 @@ namespace ClassicalSharp.Commands {
"&bnormal: &eDefault renderer, with all environmental effects enabled.", "&bnormal: &eDefault renderer, with all environmental effects enabled.",
"&blegacy: &eMay be slightly slower than normal, but produces the same environmental effects.", "&blegacy: &eMay be slightly slower than normal, but produces the same environmental effects.",
"&blegacyfast: &eSacrifices clouds, fog and overhead sky for faster performance.", "&blegacyfast: &eSacrifices clouds, fog and overhead sky for faster performance.",
"&bnormalfast: &eSacrifices clouds, fog and overhead sky for faster performance.",
}; };
} }
@ -119,18 +118,21 @@ namespace ClassicalSharp.Commands {
if( property == null ) { if( property == null ) {
game.Chat.Add( "&e/client rendertype: &cYou didn't specify a new render type." ); game.Chat.Add( "&e/client rendertype: &cYou didn't specify a new render type." );
} else if( Utils.CaselessEquals( property, "legacyfast" ) ) { } else if( Utils.CaselessEquals( property, "legacyfast" ) ) {
SetNewRenderType( true, true, true ); SetNewRenderType( true, true );
game.Chat.Add( "&e/client rendertype: &fRender type is now fast legacy." ); game.Chat.Add( "&e/client rendertype: &fRender type is now fast legacy." );
} else if( Utils.CaselessEquals( property, "legacy" ) ) { } else if( Utils.CaselessEquals( property, "legacy" ) ) {
SetNewRenderType( true, false, true ); SetNewRenderType( true, false );
game.Chat.Add( "&e/client rendertype: &fRender type is now legacy." ); game.Chat.Add( "&e/client rendertype: &fRender type is now legacy." );
} else if( Utils.CaselessEquals( property, "normal" ) ) { } else if( Utils.CaselessEquals( property, "normal" ) ) {
SetNewRenderType( false, false, false ); SetNewRenderType( false, false );
game.Chat.Add( "&e/client rendertype: &fRender type is now normal." ); game.Chat.Add( "&e/client rendertype: &fRender type is now normal." );
} else if( Utils.CaselessEquals( property, "normalfast" ) ) {
SetNewRenderType( false, true );
game.Chat.Add( "&e/client rendertype: &fRender type is now normalfast." );
} }
} }
void SetNewRenderType( bool legacy, bool minimal, bool legacyEnv ) { void SetNewRenderType( bool legacy, bool minimal ) {
game.MapEnvRenderer.SetUseLegacyMode( legacy ); game.MapEnvRenderer.SetUseLegacyMode( legacy );
if( minimal ) { if( minimal ) {
game.EnvRenderer.Dispose(); game.EnvRenderer.Dispose();
@ -142,31 +144,7 @@ namespace ClassicalSharp.Commands {
game.EnvRenderer = new StandardEnvRenderer( game ); game.EnvRenderer = new StandardEnvRenderer( game );
game.EnvRenderer.Init(); game.EnvRenderer.Init();
} }
((StandardEnvRenderer)game.EnvRenderer).SetUseLegacyMode( legacyEnv ); ((StandardEnvRenderer)game.EnvRenderer).SetUseLegacyMode( legacy );
}
}
}
/// <summary> Command that changes the client's texture pack. </summary>
public sealed class TexturePackCommand : Command {
public TexturePackCommand() {
Name = "TexturePack";
Help = new [] {
"&a/client texturepack [path]",
"&bpath: &eLoads a texture pack from the specified path.",
};
}
public override void Execute( CommandReader reader ) {
string path = reader.NextAll();
if( String.IsNullOrEmpty( path ) ) return;
try {
TexturePackExtractor extractor = new TexturePackExtractor();
extractor.Extract( path, game );
} catch( FileNotFoundException ) {
game.Chat.Add( "&e/client texturepack: Couldn't find file \"" + path + "\"" );
} }
} }
} }

View File

@ -35,13 +35,12 @@ Alternatively, you can use [CSLauncher](https://github.com/umby24/CSLauncher/rel
this launcher is very similar to ClassiCube's launcher and is simpler to use. (Thanks Umby24 for making this launcher) this launcher is very similar to ClassiCube's launcher and is simpler to use. (Thanks Umby24 for making this launcher)
###### *Mono specific* ###### *Mono specific*
*You must use either build using Mono compiler or define `__MonoCS__` when building, otherwise you will get runtime errors when decompressing the map using Mono.* *You must use either build using the Mono compiler or define `__MonoCS__` when building, otherwise you will get runtime errors when decompressing the map using Mono.*
*Also when using older mono versions, you may need to run `mozroots --import --sync` to import trusted root certificates, otherwise you will get an 'Error writing headers' exception.* *Also when using older mono versions, you may need to run `mozroots --import --sync` to import trusted root certificates, otherwise you will get an 'Error writing headers' exception.*
#### Important notes #### Tips
* Press escape (after joining a world) to switch to the pause menu. * Press escape (after joining a world) to switch to the pause menu.
* Pause menu -> Options -> Key mappings lists all of the key combinations used by the client. * Pause menu -> Options -> Key mappings lists all of the key combinations used by the client.
* Note that toggling 'vsync' to off will minimise CPU usage, while on will maximimise chunk loading speed. * Note that toggling 'vsync' to off will minimise CPU usage, while on will maximimise chunk loading speed.
* Press F to cycle view distance. A smaller number of visible chunks can improve performance. * Press F to cycle view distance. A smaller number of visible chunks can improve performance.