static void Main(string[] args) { Application.Initialize(); Config = LibreLancer.GameConfig.Create(); if (Environment.OSVersion.Platform != PlatformID.MacOSX && Environment.OSVersion.Platform != PlatformID.Unix) { //Check WMP for video playback object legacyWMPCheck = Microsoft.Win32.Registry.GetValue(@"HKEY_LOCAL_MACHINE\Software\Microsoft\Active Setup\Installed Components\{22d6f312-b0f6-11d0-94ab-0080c74c7e95}", "IsInstalled", null); if (legacyWMPCheck == null || legacyWMPCheck.ToString() != "1") { new CrashWindow( "Uh oh!", "Missing Components", new StreamReader(typeof(Program).Assembly.GetManifestResourceStream("Launcher.WMPMessage.txt")).ReadToEnd(), true).Show(); Application.Run(); } else { ShowLauncher(); } } else { ShowLauncher(); } }
public MainWindow() { config = LibreLancer.GameConfig.Create(); Title = "Librelancer"; var wrap = new TableLayout(); wrap.Rows.Add(new TableRow(new HeaderBar())); var layout = new TableLayout(); //Freelancer Path freelancerPath = new TextBox() { Text = config.FreelancerPath }; var flpath = new TableLayout() { Padding = 2, Spacing = new Size(2, 0) }; flpath.Rows.Add(new TableRow( new Label() { Text = "Freelancer Directory:" }, new TableCell(freelancerPath, true), new Button(FolderBrowse) { Text = ".." } )); layout.Rows.Add(flpath); //Width & Height bufferWidth = new NumericMaskedTextBox <int>() { Value = config.BufferWidth }; bufferHeight = new NumericMaskedTextBox <int>() { Value = config.BufferHeight }; var res = new TableLayout() { Padding = 2, Spacing = new Size(2, 0) }; res.Rows.Add(new TableRow( new Label() { Text = "Resolution:" }, new TableCell(bufferWidth) { ScaleWidth = true }, new Label() { Text = "x" }, new TableCell(bufferHeight) { ScaleWidth = true })); layout.Rows.Add(res); //Options skipIntroMovies = new CheckBox() { Text = "Skip Intro Movies" }; if (Program.introForceDisable) { skipIntroMovies.Enabled = false; skipIntroMovies.Checked = true; } else { skipIntroMovies.Checked = !config.IntroMovies; } layout.Rows.Add(skipIntroMovies); muteMusic = new CheckBox() { Text = "Mute Music", Checked = config.MuteMusic }; layout.Rows.Add(muteMusic); vsync = new CheckBox() { Text = "VSync", Checked = config.VSync }; layout.Rows.Add(vsync); //Spacer layout.Rows.Add(new TableRow() { ScaleHeight = true }); //Launch var end = new TableLayout() { Padding = 2, Spacing = new Size(2, 0) }; end.Rows.Add(new TableRow(new TableCell() { ScaleWidth = true }, new Button(LaunchClicked) { Text = "Launch" })); layout.Rows.Add(end); wrap.Rows.Add(new TableRow(layout) { ScaleHeight = true }); Content = wrap; }
public MainWindow() { config = LibreLancer.GameConfig.Create(); Title = "Librelancer"; var wrap = new TableLayout(); wrap.Rows.Add(new TableRow(new HeaderBar())); var layout = new TableLayout(); //Freelancer Path freelancerPath = new TextBox() { Text = config.FreelancerPath }; var flpath = new TableLayout() { Padding = 2, Spacing = new Size(2, 0) }; flpath.Rows.Add(new TableRow( new Label() { Text = "Freelancer Directory:", VerticalAlignment = VerticalAlignment.Center }, new TableCell(freelancerPath, true), new Button(FolderBrowse) { Text = ".." } )); layout.Rows.Add(flpath); //Width & Height bufferWidth = new NumericMaskedTextBox <int>() { Value = config.BufferWidth }; bufferHeight = new NumericMaskedTextBox <int>() { Value = config.BufferHeight }; var res = new TableLayout() { Padding = 2, Spacing = new Size(2, 0) }; res.Rows.Add(new TableRow( new Label() { Text = "Resolution:", VerticalAlignment = VerticalAlignment.Center }, new TableCell(bufferWidth) { ScaleWidth = true }, new Label() { Text = "x", VerticalAlignment = VerticalAlignment.Center }, new TableCell(bufferHeight) { ScaleWidth = true })); layout.Rows.Add(res); //Options skipIntroMovies = new CheckBox() { Text = "Skip Intro Movies" }; if (Program.introForceDisable) { skipIntroMovies.Enabled = false; skipIntroMovies.Checked = true; } else { skipIntroMovies.Checked = !config.IntroMovies; } layout.Rows.Add(skipIntroMovies); masterVolume = new Slider() { MinValue = 0, MaxValue = 1000, Value = (int)(config.MasterVolume * 1000), Orientation = Orientation.Horizontal, TickFrequency = 0, SnapToTick = false, Style = "volslider" }; var layoutMaster = new TableLayout( new TableRow(new Label() { Text = "Master Volume: ", VerticalAlignment = VerticalAlignment.Center }, masterVolume) ); layout.Rows.Add(layoutMaster); sfxVolume = new Slider() { MinValue = 0, MaxValue = 1000, Value = (int)(config.SfxVolume * 1000), Orientation = Orientation.Horizontal, TickFrequency = 0, SnapToTick = false, Style = "volslider" }; var layoutSfx = new TableLayout( new TableRow(new Label() { Text = "Sfx Volume: ", VerticalAlignment = VerticalAlignment.Center }, sfxVolume) ); layout.Rows.Add(layoutSfx); musicVolume = new Slider() { MinValue = 0, MaxValue = 1000, Value = (int)(config.MusicVolume * 1000), Orientation = Orientation.Horizontal, TickFrequency = 0, SnapToTick = false, Style = "volslider" }; var layoutMusic = new TableLayout( new TableRow(new Label() { Text = "Music Volume: ", VerticalAlignment = VerticalAlignment.Center }, musicVolume) ); layout.Rows.Add(layoutMusic); vsync = new CheckBox() { Text = "VSync", Checked = config.VSync }; layout.Rows.Add(vsync); //Spacer layout.Rows.Add(new TableRow() { ScaleHeight = true }); //Launch var end = new TableLayout() { Padding = 2, Spacing = new Size(2, 0) }; end.Rows.Add(new TableRow(new TableCell() { ScaleWidth = true }, new Button(LaunchClicked) { Text = "Launch" })); layout.Rows.Add(end); wrap.Rows.Add(new TableRow(layout) { ScaleHeight = true }); Content = wrap; }