From b0dd9d06511215f6c107e36399911a7f76c78b5e Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Wed, 25 Nov 2015 18:57:01 +1100 Subject: [PATCH] Add placeholder options for music, sound, and gui.png. --- ClassicalSharp/2D/Screens/Menu/GuiOptionsScreen.cs | 10 +++++++--- ClassicalSharp/2D/Screens/Menu/OptionsScreen.cs | 12 +++++++++++- ClassicalSharp/Game/Game.cs | 3 ++- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/ClassicalSharp/2D/Screens/Menu/GuiOptionsScreen.cs b/ClassicalSharp/2D/Screens/Menu/GuiOptionsScreen.cs index 0512f948e..486f6bd70 100644 --- a/ClassicalSharp/2D/Screens/Menu/GuiOptionsScreen.cs +++ b/ClassicalSharp/2D/Screens/Menu/GuiOptionsScreen.cs @@ -24,13 +24,17 @@ namespace ClassicalSharp { g.RefreshHud(); } ), - Make( -140, 50, "Clickable chat", Anchor.Centre, OnWidgetClick, + Make( -140, 50, "Use gui.png (WIP)", Anchor.Centre, OnWidgetClick, + g => g.UseGuiPng ? "yes" : "no", + (g, v) => game.UseGuiPng = v == "yes" ), + + // Column 2 + Make( 140, -100, "Clickable chat", Anchor.Centre, OnWidgetClick, g => g.ClickableChat ? "yes" : "no", (g, v) => { g.ClickableChat = v == "yes"; Options.Set( OptionsKey.ClickableChat, v == "yes" ); } ), - // Column 2 Make( 140, -50, "Chat scale", Anchor.Centre, OnWidgetClick, g => g.ChatScale.ToString(), (g, v) => { g.ChatScale = Single.Parse( v ); @@ -64,10 +68,10 @@ namespace ClassicalSharp { new RealValidator( 0.25f, 5f ), new BooleanValidator(), + new BooleanValidator(), new RealValidator( 0.25f, 5f ), new IntegerValidator( 1, 30 ), new BooleanValidator(), - new BooleanValidator(), }; okayIndex = buttons.Length - 1; } diff --git a/ClassicalSharp/2D/Screens/Menu/OptionsScreen.cs b/ClassicalSharp/2D/Screens/Menu/OptionsScreen.cs index 013cb54f6..f8e7c3b57 100644 --- a/ClassicalSharp/2D/Screens/Menu/OptionsScreen.cs +++ b/ClassicalSharp/2D/Screens/Menu/OptionsScreen.cs @@ -15,6 +15,10 @@ namespace ClassicalSharp { buttons = new ButtonWidget[] { // Column 1 + Make( -140, -150, "Use sound (WIP)", Anchor.Centre, OnWidgetClick, + g => g.UseSound ? "yes" : "no", + (g, v) => g.UseSound = v == "yes" ), + Make( -140, -100, "Show hover names", Anchor.Centre, OnWidgetClick, g => g.Players.ShowHoveredNames ? "yes" : "no", (g, v) => { g.Players.ShowHoveredNames = v == "yes"; @@ -37,13 +41,17 @@ namespace ClassicalSharp { // Column 2 !network.IsSinglePlayer ? null : - Make( 140, -150, "Singleplayer physics", Anchor.Centre, OnWidgetClick, + Make( 140, -200, "Singleplayer physics", Anchor.Centre, OnWidgetClick, g => ((SinglePlayerServer)network).physics.Enabled ? "yes" : "no", (g, v) => { ((SinglePlayerServer)network).physics.Enabled = v == "yes"; Options.Set( OptionsKey.SingleplayerPhysics, v == "yes" ); }), + Make( 140, -150, "Use music (WIP)", Anchor.Centre, OnWidgetClick, + g => g.UseMusic ? "yes" : "no", + (g, v) => g.UseMusic = v == "yes" ), + Make( 140, -100, "View bobbing", Anchor.Centre, OnWidgetClick, g => g.ViewBobbing ? "yes" : "no", (g, v) => { g.ViewBobbing = v == "yes"; @@ -73,6 +81,7 @@ namespace ClassicalSharp { buttons[2].Metadata = typeof(FpsLimitMethod); validators = new MenuInputValidator[] { + new BooleanValidator(), new BooleanValidator(), new RealValidator( 0.1f, 50 ), new EnumValidator(), @@ -82,6 +91,7 @@ namespace ClassicalSharp { new BooleanValidator(), new BooleanValidator(), new BooleanValidator(), + new BooleanValidator(), new IntegerValidator( 1, 100 ), }; okayIndex = buttons.Length - 1; diff --git a/ClassicalSharp/Game/Game.cs b/ClassicalSharp/Game/Game.cs index 6889c7e92..df64cdbda 100644 --- a/ClassicalSharp/Game/Game.cs +++ b/ClassicalSharp/Game/Game.cs @@ -75,7 +75,8 @@ namespace ClassicalSharp { public int ChatLines = 12; public bool ClickableChat, HideGui, ShowFPS = true; internal float HudScale = 1.0f, ChatScale = 1.0f; - public bool ViewBobbing; + public bool ViewBobbing, UseGuiPng; + public bool UseSound, UseMusic; public Animations Animations; internal int CloudsTextureId, RainTextureId, SnowTextureId;