Rework the depot, warehouse and vehicle base

A consist added to the warehouse gets a name there. The crew type stays through
loading a consist. The vehicle base window replaces the texture base. The depot
follows consists changed on the scenarios page, also with the warehouse tab
left open.
This commit is contained in:
maj00r
2026-11-01 16:06:16 +01:00
parent f152a020e3
commit 82429010d4
40 changed files with 3041 additions and 843 deletions

View File

@@ -0,0 +1,26 @@
using System;
using Avalonia.Controls;
using Avalonia.Input;
namespace StarterNG.Views;
/// <summary>A menu entry that runs something when clicked, as nearly all of them do.</summary>
internal static class MenuItems
{
/// <param name="header">The text, or a control where a row holds more than that.</param>
public static MenuItem Item(object header, Action run, bool enabled = true, KeyGesture? gesture = null)
{
var item = new MenuItem { Header = header, IsEnabled = enabled, InputGesture = gesture };
item.Click += (_, _) => run();
return item;
}
/// <summary>The entry at the end of a menu or a submenu.</summary>
public static MenuItem AddItem(this ItemsControl menu, object header, Action run, bool enabled = true,
KeyGesture? gesture = null)
{
var item = Item(header, run, enabled, gesture);
menu.Items.Add(item);
return item;
}
}