Gate Start on crew, pick starting vehicle, loading screen and help menu

#16 and #12 Start is enabled only with crew/passenger (hold Ctrl to force); the chosen starting vehicle is carried through launch; loading-screen logo; help menu; runtime language picker.
This commit is contained in:
maj00r
2026-08-22 23:15:35 +02:00
parent 825c6f57ec
commit 13137321c1
4 changed files with 329 additions and 29 deletions

View File

@@ -0,0 +1,56 @@
using System.Threading.Tasks;
using Avalonia.Controls;
using Avalonia.Layout;
using Avalonia.Media;
namespace StarterNG.Views;
public enum MessageBoxButtons
{
YesNo
}
public static class MessageBox
{
/// <summary>Simple Yes/No dialog. Returns true for Yes.</summary>
public static async Task<bool> Show(Window owner, string message, string title, MessageBoxButtons _)
{
var win = new Window
{
Title = title,
Width = 420,
SizeToContent = SizeToContent.Height,
WindowStartupLocation = WindowStartupLocation.CenterOwner,
CanResize = false
};
bool yes = false;
var yesBtn = new Button { Content = App.Loc["Yes"], MinWidth = 80, Cursor = new Avalonia.Input.Cursor(Avalonia.Input.StandardCursorType.Hand) };
yesBtn.Classes.Add("Accent");
yesBtn.Click += (_, _) => { yes = true; win.Close(); };
var noBtn = new Button { Content = App.Loc["No"], MinWidth = 80, Cursor = new Avalonia.Input.Cursor(Avalonia.Input.StandardCursorType.Hand) };
noBtn.Classes.Add("Flat");
noBtn.Click += (_, _) => win.Close();
win.Content = new StackPanel
{
Margin = new Avalonia.Thickness(16),
Spacing = 16,
Children =
{
new TextBlock { Text = message, TextWrapping = TextWrapping.Wrap },
new StackPanel
{
Orientation = Orientation.Horizontal,
HorizontalAlignment = HorizontalAlignment.Right,
Spacing = 8,
Children = { yesBtn, noBtn }
}
}
};
await win.ShowDialog(owner);
return yes;
}
}