From 611f26c4a9d6b2f4bd36af7fdedf736fee7a27ab Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Thu, 22 Oct 2015 20:44:03 +1100 Subject: [PATCH] Fix a bug I introduced by only negating, rather than negating the negation. --- ClassicalSharp/2D/Screens/ChatScreen.cs | 8 ++++---- ClassicalSharp/2D/Screens/NormalScreen.cs | 3 --- ClassicalSharp/Entities/LocalPlayer.cs | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/ClassicalSharp/2D/Screens/ChatScreen.cs b/ClassicalSharp/2D/Screens/ChatScreen.cs index ebbc1c952..d8e9f93e7 100644 --- a/ClassicalSharp/2D/Screens/ChatScreen.cs +++ b/ClassicalSharp/2D/Screens/ChatScreen.cs @@ -10,7 +10,6 @@ namespace ClassicalSharp { public ChatScreen( Game game ) : base( game ) { } - public int ChatInputYOffset, ChatLogYOffset; const int chatLines = 12; Texture announcementTex; TextInputWidget textInput; @@ -67,9 +66,10 @@ namespace ClassicalSharp { chatFont = new Font( "Arial", game.Chat.FontSize ); chatInputFont = new Font( "Arial", game.Chat.FontSize, FontStyle.Bold ); announcementFont = new Font( "Arial", 14 ); + const int blockSize = 40; textInput = new TextInputWidget( game, chatFont, chatInputFont ); - textInput.YOffset = ChatInputYOffset; + textInput.YOffset = blockSize * 2 + blockSize / 2; status = new TextGroupWidget( game, 3, chatFont ); status.VerticalAnchor = Anchor.LeftOrTop; status.HorizontalAnchor = Anchor.BottomOrRight; @@ -77,11 +77,11 @@ namespace ClassicalSharp { bottomRight = new TextGroupWidget( game, 3, chatFont ); bottomRight.VerticalAnchor = Anchor.BottomOrRight; bottomRight.HorizontalAnchor = Anchor.BottomOrRight; - bottomRight.YOffset = ChatInputYOffset; + bottomRight.YOffset = blockSize + blockSize / 2; bottomRight.Init(); normalChat = new TextGroupWidget( game, chatLines, chatFont ); normalChat.XOffset = 10; - normalChat.YOffset = ChatLogYOffset; + normalChat.YOffset = blockSize * 3; normalChat.HorizontalAnchor = Anchor.LeftOrTop; normalChat.VerticalAnchor = Anchor.BottomOrRight; normalChat.Init(); diff --git a/ClassicalSharp/2D/Screens/NormalScreen.cs b/ClassicalSharp/2D/Screens/NormalScreen.cs index d504011ea..2faca2af9 100644 --- a/ClassicalSharp/2D/Screens/NormalScreen.cs +++ b/ClassicalSharp/2D/Screens/NormalScreen.cs @@ -76,9 +76,6 @@ namespace ClassicalSharp { public override void Init() { playerFont = new Font( "Arial", 12 ); chat = new ChatScreen( game ); - const int blockSize = 40; - chat.ChatLogYOffset = blockSize + blockSize; - chat.ChatInputYOffset = blockSize + blockSize / 2; chat.Init(); hotbar = new BlockHotbarWidget( game ); hotbar.Init(); diff --git a/ClassicalSharp/Entities/LocalPlayer.cs b/ClassicalSharp/Entities/LocalPlayer.cs index 99981b9bf..ed96aeea2 100644 --- a/ClassicalSharp/Entities/LocalPlayer.cs +++ b/ClassicalSharp/Entities/LocalPlayer.cs @@ -126,7 +126,7 @@ namespace ClassicalSharp { BoundingBox bounds = CollisionBounds; bounds.Min.Y += 1; - bool isSolid = !TouchesAny( bounds, + bool isSolid = TouchesAny( bounds, b => info.CollideType[b] != BlockCollideType.WalkThrough || b == (byte)Block.Rope ); bool pastJumpPoint = Position.Y % 1 >= 0.4; if( isSolid || !pastJumpPoint )