TrueCraft/TrueCraft.Launcher/LauncherWindow.cs

62 lines
2.0 KiB
C#
Raw Normal View History

2015-05-16 11:39:34 -06:00
using System;
using Xwt;
using System.Diagnostics;
using Xwt.Drawing;
2015-06-02 17:39:44 -06:00
using TrueCraft.Launcher.Views;
using TrueCraft.Core;
2015-08-31 19:48:08 -04:00
using System.Reflection;
2015-05-16 11:39:34 -06:00
namespace TrueCraft.Launcher
{
public class LauncherWindow : Window
{
2015-06-02 17:39:44 -06:00
public TrueCraftUser User { get; set; }
2015-05-16 11:39:34 -06:00
public HBox MainContainer { get; set; }
public ScrollView WebScrollView { get; set; }
public WebView WebView { get; set; }
2015-06-02 17:39:44 -06:00
public LoginView LoginView { get; set; }
public MainMenuView MainMenuView { get; set; }
2015-06-16 21:03:52 -04:00
public OptionView OptionView { get; set; }
2015-06-02 17:39:44 -06:00
public MultiplayerView MultiplayerView { get; set; }
2015-06-02 20:31:43 -06:00
public SingleplayerView SingleplayerView { get; set; }
2015-08-31 19:48:08 -04:00
public VBox InteractionBox { get; set; }
public ImageView TrueCraftLogoImage { get; set; }
2015-05-16 11:39:34 -06:00
public LauncherWindow()
{
this.Title = "TrueCraft Launcher";
this.Width = 1200;
2015-05-16 11:39:34 -06:00
this.Height = 576;
2015-06-02 17:39:44 -06:00
this.User = new TrueCraftUser();
2015-05-16 11:39:34 -06:00
MainContainer = new HBox();
WebScrollView = new ScrollView();
WebView = new WebView("http://truecraft.io/updates");
2015-06-02 17:39:44 -06:00
LoginView = new LoginView(this);
2015-06-16 21:03:52 -04:00
OptionView = new OptionView(this);
2015-06-02 17:39:44 -06:00
MultiplayerView = new MultiplayerView(this);
2015-06-02 20:31:43 -06:00
SingleplayerView = new SingleplayerView(this);
2015-08-31 19:48:08 -04:00
InteractionBox = new VBox();
2015-09-22 15:03:20 -04:00
using (var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("TrueCraft.Launcher.Content.truecraft_logo.png"))
TrueCraftLogoImage = new ImageView(Image.FromStream(stream).WithBoxSize(350, 75));
2015-05-16 11:39:34 -06:00
WebScrollView.Content = WebView;
MainContainer.PackStart(WebScrollView, true);
2015-08-31 19:48:08 -04:00
InteractionBox.PackStart(TrueCraftLogoImage);
InteractionBox.PackEnd(LoginView);
MainContainer.PackEnd(InteractionBox);
2015-05-16 11:39:34 -06:00
this.Content = MainContainer;
}
void ClientExited()
{
this.Show();
this.ShowInTaskbar = true;
}
}
}