From e67cdcf6ba359f01975ab4b187f32b7338a398c1 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Thu, 6 Oct 2016 22:33:04 +1100 Subject: [PATCH] Launcher: Reduce clutter at main menu by moving stuff to settings screen. --- Launcher2/Gui/Screens/MainScreen.cs | 14 +++--------- Launcher2/Gui/Views/ChooseModeView.cs | 2 +- Launcher2/Gui/Views/MainView.cs | 33 ++++++++------------------- Launcher2/Gui/Views/SettingsView.cs | 30 ++++++++++++++++++------ Launcher2/Launcher2.csproj | 2 +- 5 files changed, 37 insertions(+), 44 deletions(-) diff --git a/Launcher2/Gui/Screens/MainScreen.cs b/Launcher2/Gui/Screens/MainScreen.cs index a5e025fd4..670398f23 100644 --- a/Launcher2/Gui/Screens/MainScreen.cs +++ b/Launcher2/Gui/Screens/MainScreen.cs @@ -43,14 +43,14 @@ namespace Launcher.Gui.Screens { string currentVer = Program.AppName.Substring( spaceIndex + 1 ); bool update = new Version( latestVer ) > new Version( currentVer ); - view.updateText = update ? "&aNew release available" : "&eUp to date "; + view.updateText = update ? "&aNew release" : "&eUp to date"; game.RedrawBackground(); Resize(); SelectWidget( selectedWidget ); } void FailedUpdateCheck( UpdateCheckTask task ) { - view.updateText = "&cUpdate check failed "; + view.updateText = "&cCheck failed"; game.RedrawBackground(); Resize(); SelectWidget( selectedWidget ); @@ -63,15 +63,7 @@ namespace Launcher.Gui.Screens { (x, y) => game.SetScreen( new DirectConnectScreen( game ) ); widgets[view.spIndex].OnClick = (x, y) => Client.Start( widgets[0].Text, ref game.ShouldExit ); - - if( widgets[view.colIndex] != null ) - widgets[view.colIndex].OnClick = - (x, y) => game.SetScreen( new ColoursScreen( game ) ); - - widgets[view.updatesIndex].OnClick = - (x, y) => game.SetScreen( new UpdatesScreen( game ) ); - widgets[view.modeIndex].OnClick = - (x, y) => game.SetScreen( new ChooseModeScreen( game, false ) ); + widgets[view.settingsIndex].OnClick = (x, y) => game.SetScreen( new SettingsScreen( game ) ); SetupInputHandlers(); diff --git a/Launcher2/Gui/Views/ChooseModeView.cs b/Launcher2/Gui/Views/ChooseModeView.cs index 757a0c25f..db737e083 100644 --- a/Launcher2/Gui/Views/ChooseModeView.cs +++ b/Launcher2/Gui/Views/ChooseModeView.cs @@ -71,7 +71,7 @@ namespace Launcher.Gui.Views { } else { backIndex = widgetIndex; Makers.Button( this, "Back", 80, 35, titleFont ) - .SetLocation( Anchor.Centre, Anchor.Centre, 0, 175 ); + .SetLocation( Anchor.Centre, Anchor.Centre, 0, 170 ); } } } diff --git a/Launcher2/Gui/Views/MainView.cs b/Launcher2/Gui/Views/MainView.cs index 7983106e8..e5f805286 100644 --- a/Launcher2/Gui/Views/MainView.cs +++ b/Launcher2/Gui/Views/MainView.cs @@ -4,16 +4,16 @@ using System.Drawing; using ClassicalSharp; using Launcher.Gui.Widgets; -namespace Launcher.Gui.Views { +namespace Launcher.Gui.Views { public sealed partial class MainView : IView { Font buttonFont, updateFont; - internal int loginIndex, resIndex, dcIndex, spIndex, colIndex, statusIndex; - internal int updatesIndex, modeIndex, sslIndex, settingsIndex; + internal int loginIndex, resIndex, dcIndex, spIndex, statusIndex; + internal int sslIndex, settingsIndex; const int buttonWidth = 220, buttonHeight = 35, sideButtonWidth = 150; public MainView( LauncherWindow game ) : base( game ) { - widgets = new Widget[14]; + widgets = new Widget[11]; } public override void Init() { @@ -38,7 +38,7 @@ namespace Launcher.Gui.Views { } - internal string updateText = "&eChecking for updates.."; + internal string updateText = "&eChecking.."; protected override void MakeWidgets() { widgetIndex = 0; MakeInput( Get( 0 ), 280, false, 16, "&7Username.." ) @@ -63,25 +63,7 @@ namespace Launcher.Gui.Views { spIndex = widgetIndex; Makers.Button( this, "Singleplayer", 200, buttonHeight, buttonFont ) .SetLocation( Anchor.Centre, Anchor.Centre, 0, 110 ); - - - colIndex = widgetIndex; - Makers.Button( this, "Colours", 110, buttonHeight, buttonFont ) - .SetLocation( Anchor.LeftOrTop, Anchor.BottomOrRight, 10, -10 ); - if( game.ClassicBackground ) - widgets[widgetIndex - 1].Visible = false; - modeIndex = widgetIndex; - Makers.Button( this, "Choose mode", 200, buttonHeight, buttonFont ) - .SetLocation( Anchor.Centre, Anchor.BottomOrRight, 0, -10 ); - - updatesIndex = widgetIndex; - Makers.Button( this, "Updates", 110, buttonHeight, buttonFont ) - .SetLocation( Anchor.BottomOrRight, Anchor.BottomOrRight, -10, -10 ); - Makers.Label( this, updateText, updateFont ) - .SetLocation( Anchor.BottomOrRight, Anchor.BottomOrRight, -10, -50 ); - - sslIndex = widgetIndex; bool sslVisible = widgets[sslIndex] != null && widgets[sslIndex].Visible; Makers.Checkbox( this, textFont, true, 30 ) @@ -91,8 +73,11 @@ namespace Launcher.Gui.Views { widgets[sslIndex].Visible = sslVisible; widgets[sslIndex + 1].Visible = sslVisible; + Makers.Label( this, updateText, updateFont ) + .SetLocation( Anchor.BottomOrRight, Anchor.LeftOrTop, -5, 50 ); + settingsIndex = widgetIndex; - Makers.Bitmap( this, Bitmaps.OptionsIndices, + Makers.Bitmap( this, Bitmaps.OptionsIndices, Bitmaps.OptionsPalette, Bitmaps.OptionsSize ) .SetLocation( Anchor.BottomOrRight, Anchor.LeftOrTop, -5, 5 ); } diff --git a/Launcher2/Gui/Views/SettingsView.cs b/Launcher2/Gui/Views/SettingsView.cs index b6d944659..388bf2b88 100644 --- a/Launcher2/Gui/Views/SettingsView.cs +++ b/Launcher2/Gui/Views/SettingsView.cs @@ -9,7 +9,7 @@ namespace Launcher.Gui.Views { internal int backIndex, updatesIndex, modeIndex, coloursIndex; public SettingsView( LauncherWindow game ) : base( game ) { - widgets = new Widget[3]; + widgets = new Widget[7]; } public override void Init() { @@ -22,16 +22,32 @@ namespace Launcher.Gui.Views { widgetIndex = 0; int middle = game.Width / 2; - modeIndex = widgetIndex; - Makers.Button( this, "Choose mode", 145, 35, titleFont ) - .SetLocation( Anchor.LeftOrTop, Anchor.Centre, middle - 250, -72 ); - Makers.Label( this, "&eChange the client's mode/features", textFont ) - .SetLocation( Anchor.LeftOrTop, Anchor.Centre, middle - 85, -72 - 12 ); + updatesIndex = widgetIndex; + Makers.Button( this, "Updates", 110, 35, titleFont ) + .SetLocation( Anchor.Centre, Anchor.Centre, -135, -120 ); + Makers.Label( this, "&eGet the latest stuff", textFont ) + .SetLocation( Anchor.Centre, Anchor.Centre, 10, -120 ); + modeIndex = widgetIndex; + Makers.Button( this, "Mode", 110, 35, titleFont ) + .SetLocation( Anchor.Centre, Anchor.Centre, -135, -70 ); + Makers.Label( this, "&eChange the enabled features", textFont ) + .SetLocation( Anchor.Centre, Anchor.Centre, 55, -70 ); + + coloursIndex = widgetIndex; + Makers.Button( this, "Colours", 110, 35, titleFont ) + .SetLocation( Anchor.Centre, Anchor.Centre, -135, -20 ); + Makers.Label( this, "&eChange how the launcher looks", textFont ) + .SetLocation( Anchor.Centre, Anchor.Centre, 65, -20 ); + + if( game.ClassicBackground ) { + widgets[coloursIndex].Visible = false; + widgets[coloursIndex + 1].Visible = false; + } backIndex = widgetIndex; Makers.Button( this, "Back", 80, 35, titleFont ) - .SetLocation( Anchor.Centre, Anchor.Centre, 0, 175 ); + .SetLocation( Anchor.Centre, Anchor.Centre, 0, 170 ); } } } \ No newline at end of file diff --git a/Launcher2/Launcher2.csproj b/Launcher2/Launcher2.csproj index 59ae4f254..15758ebb9 100644 --- a/Launcher2/Launcher2.csproj +++ b/Launcher2/Launcher2.csproj @@ -4,7 +4,7 @@ {3E84ACC1-27B4-401B-A359-6AAE4DF6C9B5} Debug AnyCPU - Exe + WinExe Launcher Launcher2 v2.0