mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-28 07:55:38 -04:00
Merge branch 'master' of github.com:UnknownShadow200/ClassicalSharp
This commit is contained in:
commit
8098ebdc1d
@ -25,7 +25,7 @@ namespace Launcher.Gui.Screens {
|
|||||||
|
|
||||||
if( view.backIndex >= 0 ) {
|
if( view.backIndex >= 0 ) {
|
||||||
widgets[view.backIndex].OnClick = (x, y)
|
widgets[view.backIndex].OnClick = (x, y)
|
||||||
=> game.SetScreen( new MainScreen( game ) );
|
=> game.SetScreen( new SettingsScreen( game ) );
|
||||||
}
|
}
|
||||||
Resize();
|
Resize();
|
||||||
}
|
}
|
||||||
@ -52,7 +52,7 @@ namespace Launcher.Gui.Screens {
|
|||||||
Options.Set( "nostalgia-classicoptions", classic );
|
Options.Set( "nostalgia-classicoptions", classic );
|
||||||
Options.Save();
|
Options.Save();
|
||||||
|
|
||||||
game.SetScreen( new MainScreen( game ) );
|
game.SetScreen( new SettingsScreen( game ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Dispose() {
|
public override void Dispose() {
|
||||||
|
@ -21,7 +21,7 @@ namespace Launcher.Gui.Screens {
|
|||||||
view.Init();
|
view.Init();
|
||||||
|
|
||||||
widgets[view.defIndex].OnClick = (x, y) => ResetColours();
|
widgets[view.defIndex].OnClick = (x, y) => ResetColours();
|
||||||
widgets[view.defIndex + 1].OnClick = (x, y) => game.SetScreen( new MainScreen( game ) );
|
widgets[view.defIndex + 1].OnClick = (x, y) => game.SetScreen( new SettingsScreen( game ) );
|
||||||
SetupInputHandlers();
|
SetupInputHandlers();
|
||||||
for( int i = 0; i < widgets.Length; i++ ) {
|
for( int i = 0; i < widgets.Length; i++ ) {
|
||||||
InputWidget input = widgets[i] as InputWidget;
|
InputWidget input = widgets[i] as InputWidget;
|
||||||
|
@ -43,14 +43,14 @@ namespace Launcher.Gui.Screens {
|
|||||||
string currentVer = Program.AppName.Substring( spaceIndex + 1 );
|
string currentVer = Program.AppName.Substring( spaceIndex + 1 );
|
||||||
bool update = new Version( latestVer ) > new Version( currentVer );
|
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();
|
game.RedrawBackground();
|
||||||
Resize();
|
Resize();
|
||||||
SelectWidget( selectedWidget, 0, 0 );
|
SelectWidget( selectedWidget, 0, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
void FailedUpdateCheck( UpdateCheckTask task ) {
|
void FailedUpdateCheck( UpdateCheckTask task ) {
|
||||||
view.updateText = "&cUpdate check failed ";
|
view.updateText = "&cCheck failed";
|
||||||
game.RedrawBackground();
|
game.RedrawBackground();
|
||||||
Resize();
|
Resize();
|
||||||
SelectWidget( selectedWidget, 0, 0 );
|
SelectWidget( selectedWidget, 0, 0 );
|
||||||
@ -63,15 +63,7 @@ namespace Launcher.Gui.Screens {
|
|||||||
(x, y) => game.SetScreen( new DirectConnectScreen( game ) );
|
(x, y) => game.SetScreen( new DirectConnectScreen( game ) );
|
||||||
widgets[view.spIndex].OnClick =
|
widgets[view.spIndex].OnClick =
|
||||||
(x, y) => Client.Start( widgets[0].Text, ref game.ShouldExit );
|
(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 =
|
widgets[view.settingsIndex].OnClick =
|
||||||
(x, y) => game.SetScreen( new SettingsScreen( game ) );
|
(x, y) => game.SetScreen( new SettingsScreen( game ) );
|
||||||
SetupInputHandlers();
|
SetupInputHandlers();
|
||||||
|
@ -22,15 +22,14 @@ namespace Launcher.Gui.Screens {
|
|||||||
public override void Init() {
|
public override void Init() {
|
||||||
base.Init();
|
base.Init();
|
||||||
view.Init();
|
view.Init();
|
||||||
|
SetWidgetHandlers();
|
||||||
|
Resize();
|
||||||
|
|
||||||
if( game.checkTask != null && game.checkTask.Done && game.checkTask.Success )
|
if( game.checkTask != null && game.checkTask.Done && game.checkTask.Success )
|
||||||
SuccessfulUpdateCheck( game.checkTask );
|
SuccessfulUpdateCheck( game.checkTask );
|
||||||
|
|
||||||
checkTask = new UpdateCheckTask();
|
checkTask = new UpdateCheckTask();
|
||||||
checkTask.CheckForUpdatesAsync();
|
checkTask.CheckForUpdatesAsync();
|
||||||
|
|
||||||
SetWidgetHandlers();
|
|
||||||
Resize();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Build dev, stable;
|
Build dev, stable;
|
||||||
@ -76,7 +75,7 @@ namespace Launcher.Gui.Screens {
|
|||||||
widgets[view.devIndex + 1].OnClick = (x, y) => UpdateBuild( false, false );
|
widgets[view.devIndex + 1].OnClick = (x, y) => UpdateBuild( false, false );
|
||||||
|
|
||||||
widgets[view.backIndex].OnClick =
|
widgets[view.backIndex].OnClick =
|
||||||
(x, y) => game.SetScreen( new MainScreen( game ) );
|
(x, y) => game.SetScreen( new SettingsScreen( game ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateBuild( bool release, bool dx ) {
|
void UpdateBuild( bool release, bool dx ) {
|
||||||
|
@ -71,7 +71,7 @@ namespace Launcher.Gui.Views {
|
|||||||
} else {
|
} else {
|
||||||
backIndex = widgetIndex;
|
backIndex = widgetIndex;
|
||||||
Makers.Button( this, "Back", 80, 35, titleFont )
|
Makers.Button( this, "Back", 80, 35, titleFont )
|
||||||
.SetLocation( Anchor.Centre, Anchor.Centre, 0, 175 );
|
.SetLocation( Anchor.Centre, Anchor.Centre, 0, 170 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,28 +37,28 @@ namespace Launcher.Gui.Views {
|
|||||||
widgetIndex = 0;
|
widgetIndex = 0;
|
||||||
|
|
||||||
MakeInput( Get( 0 ), 330, false, 32, "&7Username.." )
|
MakeInput( Get( 0 ), 330, false, 32, "&7Username.." )
|
||||||
.SetLocation( Anchor.Centre, Anchor.Centre, 0, -100 );
|
.SetLocation( Anchor.Centre, Anchor.Centre, 0, -120 );
|
||||||
MakeInput( Get( 1 ), 330, false, 64, "&7IP address:Port number.." )
|
MakeInput( Get( 1 ), 330, false, 64, "&7IP address:Port number.." )
|
||||||
.SetLocation( Anchor.Centre, Anchor.Centre, 0, -50 );
|
.SetLocation( Anchor.Centre, Anchor.Centre, 0, -75 );
|
||||||
MakeInput( Get( 2 ), 330, false, 32, "&7Mppass.." )
|
MakeInput( Get( 2 ), 330, false, 32, "&7Mppass.." )
|
||||||
.SetLocation( Anchor.Centre, Anchor.Centre, 0, 0 );
|
.SetLocation( Anchor.Centre, Anchor.Centre, 0, -30 );
|
||||||
|
|
||||||
connectIndex = widgetIndex;
|
connectIndex = widgetIndex;
|
||||||
Makers.Button( this, "Connect", 110, 35, titleFont )
|
Makers.Button( this, "Connect", 110, 35, titleFont )
|
||||||
.SetLocation( Anchor.Centre, Anchor.Centre, -110, 50 );
|
.SetLocation( Anchor.Centre, Anchor.Centre, -110, 20 );
|
||||||
backIndex = widgetIndex;
|
backIndex = widgetIndex;
|
||||||
Makers.Button( this, "Back", 80, 35, titleFont )
|
Makers.Button( this, "Back", 80, 35, titleFont )
|
||||||
.SetLocation( Anchor.Centre, Anchor.Centre, 125, 50 );
|
.SetLocation( Anchor.Centre, Anchor.Centre, 125, 20 );
|
||||||
|
|
||||||
statusIndex = widgetIndex;
|
statusIndex = widgetIndex;
|
||||||
Makers.Label( this, "", textFont )
|
Makers.Label( this, "", textFont )
|
||||||
.SetLocation( Anchor.Centre, Anchor.Centre, 0, 100 );
|
.SetLocation( Anchor.Centre, Anchor.Centre, 0, 70 );
|
||||||
Makers.Label( this, "Use classicube.net for skins", textFont )
|
Makers.Label( this, "Use classicube.net for skins", textFont )
|
||||||
.SetLocation( Anchor.Centre, Anchor.Centre, 30, 130 );
|
.SetLocation( Anchor.Centre, Anchor.Centre, 30, 100 );
|
||||||
|
|
||||||
ccSkinsIndex = widgetIndex;
|
ccSkinsIndex = widgetIndex;
|
||||||
Makers.Checkbox( this, booleanFont, true, 30 )
|
Makers.Checkbox( this, booleanFont, true, 30 )
|
||||||
.SetLocation( Anchor.Centre, Anchor.Centre, -110, 130 );
|
.SetLocation( Anchor.Centre, Anchor.Centre, -110, 100 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,16 +4,16 @@ using System.Drawing;
|
|||||||
using ClassicalSharp;
|
using ClassicalSharp;
|
||||||
using Launcher.Gui.Widgets;
|
using Launcher.Gui.Widgets;
|
||||||
|
|
||||||
namespace Launcher.Gui.Views {
|
namespace Launcher.Gui.Views {
|
||||||
public sealed partial class MainView : IView {
|
public sealed partial class MainView : IView {
|
||||||
|
|
||||||
Font buttonFont, updateFont;
|
Font buttonFont, updateFont;
|
||||||
internal int loginIndex, resIndex, dcIndex, spIndex, colIndex, statusIndex;
|
internal int loginIndex, resIndex, dcIndex, spIndex, statusIndex;
|
||||||
internal int updatesIndex, modeIndex, sslIndex, settingsIndex;
|
internal int sslIndex, settingsIndex;
|
||||||
const int buttonWidth = 220, buttonHeight = 35, sideButtonWidth = 150;
|
const int buttonWidth = 220, buttonHeight = 35, sideButtonWidth = 150;
|
||||||
|
|
||||||
public MainView( LauncherWindow game ) : base( game ) {
|
public MainView( LauncherWindow game ) : base( game ) {
|
||||||
widgets = new Widget[14];
|
widgets = new Widget[11];
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Init() {
|
public override void Init() {
|
||||||
@ -38,17 +38,17 @@ namespace Launcher.Gui.Views {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
internal string updateText = "&eChecking for updates..";
|
internal string updateText = "&eChecking..";
|
||||||
protected override void MakeWidgets() {
|
protected override void MakeWidgets() {
|
||||||
widgetIndex = 0;
|
widgetIndex = 0;
|
||||||
MakeInput( Get( 0 ), 280, false, 16, "&7Username.." )
|
MakeInput( Get( 0 ), 280, false, 16, "&7Username.." )
|
||||||
.SetLocation( Anchor.Centre, Anchor.Centre, 0, -120 );
|
.SetLocation( Anchor.Centre, Anchor.Centre, 0, -120 );
|
||||||
MakeInput( Get( 1 ), 280, true, 64, "&7Password.." )
|
MakeInput( Get( 1 ), 280, true, 64, "&7Password.." )
|
||||||
.SetLocation( Anchor.Centre, Anchor.Centre, 0, -70 );
|
.SetLocation( Anchor.Centre, Anchor.Centre, 0, -75 );
|
||||||
|
|
||||||
loginIndex = widgetIndex;
|
loginIndex = widgetIndex;
|
||||||
Makers.Button( this, "Sign in", 100, buttonHeight, buttonFont )
|
Makers.Button( this, "Sign in", 100, buttonHeight, buttonFont )
|
||||||
.SetLocation( Anchor.Centre, Anchor.Centre, -90, -20 );
|
.SetLocation( Anchor.Centre, Anchor.Centre, -90, -25 );
|
||||||
statusIndex = widgetIndex;
|
statusIndex = widgetIndex;
|
||||||
Makers.Label( this, Get( statusIndex ), textFont )
|
Makers.Label( this, Get( statusIndex ), textFont )
|
||||||
.SetLocation( Anchor.Centre, Anchor.Centre, 0, 20 );
|
.SetLocation( Anchor.Centre, Anchor.Centre, 0, 20 );
|
||||||
@ -56,32 +56,14 @@ namespace Launcher.Gui.Views {
|
|||||||
|
|
||||||
resIndex = widgetIndex;
|
resIndex = widgetIndex;
|
||||||
Makers.Button( this, "Resume", 100, buttonHeight, buttonFont )
|
Makers.Button( this, "Resume", 100, buttonHeight, buttonFont )
|
||||||
.SetLocation( Anchor.Centre, Anchor.Centre, 90, -20 );
|
.SetLocation( Anchor.Centre, Anchor.Centre, 90, -25 );
|
||||||
dcIndex = widgetIndex;
|
dcIndex = widgetIndex;
|
||||||
Makers.Button( this, "Direct connect", 200, buttonHeight, buttonFont )
|
Makers.Button( this, "Direct connect", 200, buttonHeight, buttonFont )
|
||||||
.SetLocation( Anchor.Centre, Anchor.Centre, 0, 60 );
|
.SetLocation( Anchor.Centre, Anchor.Centre, 0, 60 );
|
||||||
spIndex = widgetIndex;
|
spIndex = widgetIndex;
|
||||||
Makers.Button( this, "Singleplayer", 200, buttonHeight, buttonFont )
|
Makers.Button( this, "Singleplayer", 200, buttonHeight, buttonFont )
|
||||||
.SetLocation( Anchor.Centre, Anchor.Centre, 0, 110 );
|
.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;
|
sslIndex = widgetIndex;
|
||||||
bool sslVisible = widgets[sslIndex] != null && widgets[sslIndex].Visible;
|
bool sslVisible = widgets[sslIndex] != null && widgets[sslIndex].Visible;
|
||||||
Makers.Checkbox( this, textFont, true, 30 )
|
Makers.Checkbox( this, textFont, true, 30 )
|
||||||
@ -91,8 +73,11 @@ namespace Launcher.Gui.Views {
|
|||||||
widgets[sslIndex].Visible = sslVisible;
|
widgets[sslIndex].Visible = sslVisible;
|
||||||
widgets[sslIndex + 1].Visible = sslVisible;
|
widgets[sslIndex + 1].Visible = sslVisible;
|
||||||
|
|
||||||
|
Makers.Label( this, updateText, updateFont )
|
||||||
|
.SetLocation( Anchor.BottomOrRight, Anchor.LeftOrTop, -5, 50 );
|
||||||
|
|
||||||
settingsIndex = widgetIndex;
|
settingsIndex = widgetIndex;
|
||||||
Makers.Bitmap( this, Bitmaps.OptionsIndices,
|
Makers.Bitmap( this, Bitmaps.OptionsIndices,
|
||||||
Bitmaps.OptionsPalette, Bitmaps.OptionsSize )
|
Bitmaps.OptionsPalette, Bitmaps.OptionsSize )
|
||||||
.SetLocation( Anchor.BottomOrRight, Anchor.LeftOrTop, -5, 5 );
|
.SetLocation( Anchor.BottomOrRight, Anchor.LeftOrTop, -5, 5 );
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ namespace Launcher.Gui.Views {
|
|||||||
internal int backIndex, updatesIndex, modeIndex, coloursIndex;
|
internal int backIndex, updatesIndex, modeIndex, coloursIndex;
|
||||||
|
|
||||||
public SettingsView( LauncherWindow game ) : base( game ) {
|
public SettingsView( LauncherWindow game ) : base( game ) {
|
||||||
widgets = new Widget[3];
|
widgets = new Widget[7];
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Init() {
|
public override void Init() {
|
||||||
@ -22,16 +22,32 @@ namespace Launcher.Gui.Views {
|
|||||||
widgetIndex = 0;
|
widgetIndex = 0;
|
||||||
int middle = game.Width / 2;
|
int middle = game.Width / 2;
|
||||||
|
|
||||||
modeIndex = widgetIndex;
|
updatesIndex = widgetIndex;
|
||||||
Makers.Button( this, "Choose mode", 145, 35, titleFont )
|
Makers.Button( this, "Updates", 110, 35, titleFont )
|
||||||
.SetLocation( Anchor.LeftOrTop, Anchor.Centre, middle - 250, -72 );
|
.SetLocation( Anchor.Centre, Anchor.Centre, -135, -120 );
|
||||||
Makers.Label( this, "&eChange the client's mode/features", textFont )
|
Makers.Label( this, "&eGet the latest stuff", textFont )
|
||||||
.SetLocation( Anchor.LeftOrTop, Anchor.Centre, middle - 85, -72 - 12 );
|
.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;
|
backIndex = widgetIndex;
|
||||||
Makers.Button( this, "Back", 80, 35, titleFont )
|
Makers.Button( this, "Back", 80, 35, titleFont )
|
||||||
.SetLocation( Anchor.Centre, Anchor.Centre, 0, 175 );
|
.SetLocation( Anchor.Centre, Anchor.Centre, 0, 170 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user