Fix colour codes not being trimmed from own skin name, launcher should auto-focus to search box.

This commit is contained in:
UnknownShadow200 2015-11-20 10:44:29 +11:00
parent 83e1a9c8fc
commit e94e53f348
5 changed files with 9 additions and 7 deletions

View File

@ -113,7 +113,6 @@ namespace ClassicalSharp {
canPlace[tile] = true; canPlace[tile] = true;
canDelete[tile] = true; canDelete[tile] = true;
} }
canPlace[(int)Block.Grass] = false;
canPlace[(int)Block.Lava] = false; canPlace[(int)Block.Lava] = false;
canPlace[(int)Block.Water] = false; canPlace[(int)Block.Water] = false;
canPlace[(int)Block.StillLava] = false; canPlace[(int)Block.StillLava] = false;

View File

@ -38,9 +38,9 @@ namespace ClassicalSharp {
get { return (float)GetMaxHeight( jumpVel ); } get { return (float)GetMaxHeight( jumpVel ); }
} }
public LocalPlayer( Game window ) : base( window ) { public LocalPlayer( Game game ) : base( game ) {
DisplayName = window.Username; DisplayName = game.Username;
SkinName = window.Username; SkinName = game.Username;
SkinIdentifier = "skin_" + SkinName; SkinIdentifier = "skin_" + SkinName;
InitRenderingData(); InitRenderingData();
} }
@ -253,7 +253,6 @@ namespace ClassicalSharp {
Inventory inv = game.Inventory; Inventory inv = game.Inventory;
inv.CanPlace[(int)Block.Bedrock] = value == 0x64; inv.CanPlace[(int)Block.Bedrock] = value == 0x64;
inv.CanDelete[(int)Block.Bedrock] = value == 0x64; inv.CanDelete[(int)Block.Bedrock] = value == 0x64;
inv.CanPlace[(int)Block.Grass] = value == 0x64;
inv.CanPlace[(int)Block.Water] = value == 0x64; inv.CanPlace[(int)Block.Water] = value == 0x64;
inv.CanPlace[(int)Block.StillWater] = value == 0x64; inv.CanPlace[(int)Block.StillWater] = value == 0x64;

View File

@ -9,7 +9,7 @@ namespace ClassicalSharp {
int tickCount; int tickCount;
public NetPlayer( string displayName, string skinName, Game game ) : base( game ) { public NetPlayer( string displayName, string skinName, Game game ) : base( game ) {
DisplayName = displayName; DisplayName = displayName;
SkinName = Utils.StripColours( skinName ); SkinName = skinName;
SkinIdentifier = "skin_" + SkinName; SkinIdentifier = "skin_" + SkinName;
InitRenderingData(); InitRenderingData();
} }

View File

@ -255,6 +255,7 @@ namespace ClassicalSharp {
} }
void AddEntity( byte entityId, string displayName, string skinName, bool readPosition ) { void AddEntity( byte entityId, string displayName, string skinName, bool readPosition ) {
skinName = Utils.StripColours( skinName );
if( entityId != 0xFF ) { if( entityId != 0xFF ) {
Player oldPlayer = game.Players[entityId]; Player oldPlayer = game.Players[entityId];
if( oldPlayer != null ) { if( oldPlayer != null ) {
@ -266,7 +267,7 @@ namespace ClassicalSharp {
game.AsyncDownloader.DownloadSkin( skinName ); game.AsyncDownloader.DownloadSkin( skinName );
} else { } else {
game.LocalPlayer.SkinName = skinName; game.LocalPlayer.SkinName = skinName;
game.LocalPlayer.SkinIdentifier = "skin_" + game.LocalPlayer.SkinName; game.LocalPlayer.SkinIdentifier = "skin_" + skinName;
game.AsyncDownloader.DownloadSkin( skinName ); game.AsyncDownloader.DownloadSkin( skinName );
} }
if( readPosition ) { if( readPosition ) {

View File

@ -62,7 +62,10 @@ namespace Launcher2 {
base.Init(); base.Init();
game.Window.Mouse.WheelChanged += MouseWheelChanged; game.Window.Mouse.WheelChanged += MouseWheelChanged;
game.Window.Mouse.ButtonUp += MouseButtonUp; game.Window.Mouse.ButtonUp += MouseButtonUp;
Resize(); Resize();
selectedWidget = widgets[1];
InputClick( 0, 0 );
} }
public override void Resize() { public override void Resize() {