From a6d0bf15b3b4ac96ea33d2482a7503ad69e54bdd Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Mon, 4 Jan 2016 09:44:52 +1100 Subject: [PATCH] You can use down arrow back to the original text you had typed in before pressing up, also fix 'Hacks enabled' cycling the camera. --- ClassicalSharp/2D/Widgets/ButtonWidget.cs | 4 ++-- ClassicalSharp/2D/Widgets/Chat/TextInputWidget.Handlers.cs | 4 ++++ ClassicalSharp/Game/Game.cs | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ClassicalSharp/2D/Widgets/ButtonWidget.cs b/ClassicalSharp/2D/Widgets/ButtonWidget.cs index d0a2f3ba6..9a1138416 100644 --- a/ClassicalSharp/2D/Widgets/ButtonWidget.cs +++ b/ClassicalSharp/2D/Widgets/ButtonWidget.cs @@ -39,7 +39,7 @@ namespace ClassicalSharp { new TextureRec( 0, 66/256f, 200/256f, 20/256f ) ); static Texture selectedTex = new Texture( 0, 0, 0, 0, 0, new TextureRec( 0, 86/256f, 200/256f, 20/256f ) ); - static Texture disdabledTex = new Texture( 0, 0, 0, 0, 0, + static Texture disabledTex = new Texture( 0, 0, 0, 0, 0, new TextureRec( 0, 46/256f, 200/256f, 20/256f ) ); public string Text; public void SetText( string text ) { @@ -61,7 +61,7 @@ namespace ClassicalSharp { if( !texture.IsValid ) return; Texture backTex = Active ? selectedTex : shadowTex; - if( Disabled ) backTex = disdabledTex; + if( Disabled ) backTex = disabledTex; backTex.ID = game.UseClassicGui ? game.GuiClassicTexId : game.GuiTexId; backTex.X1 = X; backTex.Y1 = Y; diff --git a/ClassicalSharp/2D/Widgets/Chat/TextInputWidget.Handlers.cs b/ClassicalSharp/2D/Widgets/Chat/TextInputWidget.Handlers.cs index 2d6d7273d..2adb5defc 100644 --- a/ClassicalSharp/2D/Widgets/Chat/TextInputWidget.Handlers.cs +++ b/ClassicalSharp/2D/Widgets/Chat/TextInputWidget.Handlers.cs @@ -89,7 +89,10 @@ namespace ClassicalSharp { } } + string originalText; void UpKey() { + if( typingLogPos == game.Chat.InputLog.Count ) + originalText = chatInputText.ToString(); if( game.Chat.InputLog.Count > 0 ) { typingLogPos--; if( typingLogPos < 0 ) typingLogPos = 0; @@ -107,6 +110,7 @@ namespace ClassicalSharp { chatInputText.Clear(); if( typingLogPos >= game.Chat.InputLog.Count ) { typingLogPos = game.Chat.InputLog.Count; + chatInputText.Append( 0, originalText ); } else { chatInputText.Append( 0, game.Chat.InputLog[typingLogPos] ); } diff --git a/ClassicalSharp/Game/Game.cs b/ClassicalSharp/Game/Game.cs index f52fc437c..d7d3ea955 100644 --- a/ClassicalSharp/Game/Game.cs +++ b/ClassicalSharp/Game/Game.cs @@ -365,7 +365,7 @@ namespace ClassicalSharp { //else if( Camera == forwardThirdPersonCam ) Camera = firstPersonZoomCam; else Camera = firstPersonCam; - if( !LocalPlayer.CanUseThirdPersonCamera ) + if( !LocalPlayer.CanUseThirdPersonCamera || !LocalPlayer.HacksEnabled ) Camera = firstPersonCam; PerspectiveCamera newCam = (PerspectiveCamera)Camera; newCam.delta = oldCam.delta;