| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using Content.Shared.Shuttles.BUIStates;
- using Robust.Client.AutoGenerated;
- using Robust.Client.Graphics;
- using Robust.Client.UserInterface.Controls;
- using Robust.Client.UserInterface.XAML;
- namespace Content.Client.Shuttles.UI;
- [GenerateTypedNameReferences]
- public sealed partial class DockObject : PanelContainer
- {
- public BoxContainer ContentsContainer => Contents;
- public DockObject()
- {
- RobustXamlLoader.Load(this);
- IoCManager.InjectDependencies(this);
- PanelOverride = new StyleBoxFlat(new Color(30, 30, 34));
- }
- public void AddDock(DockingPortState state, ShuttleDockControl dockControl)
- {
- var viewButton = new Button()
- {
- Text = Loc.GetString("shuttle-console-view"),
- };
- viewButton.OnPressed += args =>
- {
- dockControl.SetViewedDock(state);
- };
- var container = new BoxContainer()
- {
- Orientation = BoxContainer.LayoutOrientation.Vertical,
- Children =
- {
- new Label()
- {
- Text = state.Name,
- HorizontalAlignment = HAlignment.Center,
- },
- viewButton
- }
- };
- DockContainer.AddChild(container);
- }
- public void SetName(string value)
- {
- DockedLabel.Text = value;
- }
- }
|