WPF layout (#3346)
This commit is contained in:
committed by
GitHub
parent
33d6975c25
commit
b898443f28
@@ -68,7 +68,7 @@ namespace Content.Client.UserInterface
|
||||
_gameHud = IoCManager.Resolve<IGameHud>();
|
||||
|
||||
Title = Loc.GetString("Actions");
|
||||
CustomMinimumSize = (300, 300);
|
||||
MinSize = (300, 300);
|
||||
|
||||
Contents.AddChild(new VBoxContainer
|
||||
{
|
||||
@@ -81,7 +81,7 @@ namespace Content.Client.UserInterface
|
||||
(_searchBar = new LineEdit
|
||||
{
|
||||
StyleClasses = { StyleNano.StyleClassActionSearchBox },
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
PlaceHolder = Loc.GetString("Search")
|
||||
}),
|
||||
(_filterButton = new MultiselectOptionButton<string>()
|
||||
@@ -97,14 +97,14 @@ namespace Content.Client.UserInterface
|
||||
(_filterLabel = new Label()),
|
||||
new ScrollContainer
|
||||
{
|
||||
//TODO: needed? CustomMinimumSize = new Vector2(200.0f, 0.0f),
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
//TODO: needed? MinSize = new Vector2(200.0f, 0.0f),
|
||||
VerticalExpand = true,
|
||||
HorizontalExpand = true,
|
||||
Children =
|
||||
{
|
||||
(_resultsGrid = new GridContainer
|
||||
{
|
||||
MaxWidth = 300
|
||||
MaxGridWidth = 300
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -136,12 +136,12 @@ namespace Content.Client.UserInterface
|
||||
|
||||
_dragShadow = new TextureRect
|
||||
{
|
||||
CustomMinimumSize = (64, 64),
|
||||
MinSize = (64, 64),
|
||||
Stretch = TextureRect.StretchMode.Scale,
|
||||
Visible = false
|
||||
Visible = false,
|
||||
SetSize = (64, 64)
|
||||
};
|
||||
UserInterfaceManager.PopupRoot.AddChild(_dragShadow);
|
||||
LayoutContainer.SetSize(_dragShadow, (64, 64));
|
||||
|
||||
_dragDropHelper = new DragDropHelper<ActionMenuItem>(OnBeginActionDrag, OnContinueActionDrag, OnEndActionDrag);
|
||||
}
|
||||
@@ -190,7 +190,7 @@ namespace Content.Client.UserInterface
|
||||
base.Resized();
|
||||
// TODO: Can rework this once https://github.com/space-wizards/RobustToolbox/issues/1392 is done,
|
||||
// currently no good way to let the grid know what size it has to "work with", so must manually resize
|
||||
_resultsGrid.MaxWidth = Width;
|
||||
_resultsGrid.MaxGridWidth = Width;
|
||||
}
|
||||
|
||||
private bool OnBeginActionDrag()
|
||||
|
||||
@@ -27,13 +27,13 @@ namespace Content.Client.UserInterface
|
||||
_onControlFocusExited = onControlFocusExited;
|
||||
Action = action;
|
||||
|
||||
CustomMinimumSize = (64, 64);
|
||||
SizeFlagsVertical = SizeFlags.None;
|
||||
MinSize = (64, 64);
|
||||
VerticalAlignment = VAlignment.Top;
|
||||
|
||||
AddChild(new TextureRect
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
VerticalExpand = true,
|
||||
Stretch = TextureRect.StretchMode.Scale,
|
||||
Texture = action.Icon.Frame0()
|
||||
});
|
||||
|
||||
@@ -16,7 +16,6 @@ using Robust.Shared.Input;
|
||||
using Robust.Shared.Input.Binding;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Client.UserInterface
|
||||
@@ -75,6 +74,7 @@ namespace Content.Client.UserInterface
|
||||
|
||||
public ActionsUI(ClientActionsComponent actionsComponent)
|
||||
{
|
||||
SetValue(LayoutContainer.DebugProperty, true);
|
||||
_actionsComponent = actionsComponent;
|
||||
_actionManager = IoCManager.Resolve<ActionManager>();
|
||||
_entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
@@ -83,14 +83,14 @@ namespace Content.Client.UserInterface
|
||||
_menu = new ActionMenu(_actionsComponent, this);
|
||||
|
||||
LayoutContainer.SetGrowHorizontal(this, LayoutContainer.GrowDirection.End);
|
||||
LayoutContainer.SetGrowVertical(this, LayoutContainer.GrowDirection.End);
|
||||
LayoutContainer.SetGrowVertical(this, LayoutContainer.GrowDirection.Constrain);
|
||||
LayoutContainer.SetAnchorTop(this, 0f);
|
||||
LayoutContainer.SetAnchorBottom(this, 0.8f);
|
||||
LayoutContainer.SetMarginLeft(this, 13);
|
||||
LayoutContainer.SetMarginTop(this, 110);
|
||||
|
||||
SizeFlagsHorizontal = SizeFlags.None;
|
||||
SizeFlagsVertical = SizeFlags.FillExpand;
|
||||
HorizontalAlignment = HAlignment.Left;
|
||||
VerticalExpand = true;
|
||||
|
||||
var resourceCache = IoCManager.Resolve<IResourceCache>();
|
||||
|
||||
@@ -101,101 +101,101 @@ namespace Content.Client.UserInterface
|
||||
var panelContainer = new PanelContainer()
|
||||
{
|
||||
StyleClasses = {StyleNano.StyleClassHotbarPanel},
|
||||
SizeFlagsHorizontal = SizeFlags.None,
|
||||
SizeFlagsVertical = SizeFlags.None
|
||||
HorizontalAlignment = HAlignment.Left,
|
||||
VerticalAlignment = VAlignment.Top
|
||||
};
|
||||
AddChild(panelContainer);
|
||||
|
||||
var hotbarContainer = new VBoxContainer
|
||||
{
|
||||
SeparationOverride = 3,
|
||||
SizeFlagsHorizontal = SizeFlags.None
|
||||
HorizontalAlignment = HAlignment.Left
|
||||
};
|
||||
panelContainer.AddChild(hotbarContainer);
|
||||
|
||||
var settingsContainer = new HBoxContainer
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand
|
||||
HorizontalExpand = true
|
||||
};
|
||||
hotbarContainer.AddChild(settingsContainer);
|
||||
|
||||
settingsContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 1 });
|
||||
settingsContainer.AddChild(new Control { HorizontalExpand = true, SizeFlagsStretchRatio = 1 });
|
||||
_lockTexture = resourceCache.GetTexture("/Textures/Interface/Nano/lock.svg.192dpi.png");
|
||||
_unlockTexture = resourceCache.GetTexture("/Textures/Interface/Nano/lock_open.svg.192dpi.png");
|
||||
_lockButton = new TextureButton
|
||||
{
|
||||
TextureNormal = _unlockTexture,
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
|
||||
SizeFlagsVertical = SizeFlags.ShrinkCenter,
|
||||
HorizontalAlignment = HAlignment.Center,
|
||||
VerticalAlignment = VAlignment.Center,
|
||||
SizeFlagsStretchRatio = 1,
|
||||
Scale = (0.5f, 0.5f)
|
||||
};
|
||||
settingsContainer.AddChild(_lockButton);
|
||||
settingsContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 2 });
|
||||
settingsContainer.AddChild(new Control { HorizontalExpand = true, SizeFlagsStretchRatio = 2 });
|
||||
_settingsButton = new TextureButton
|
||||
{
|
||||
TextureNormal = resourceCache.GetTexture("/Textures/Interface/Nano/gear.svg.192dpi.png"),
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
|
||||
SizeFlagsVertical = SizeFlags.ShrinkCenter,
|
||||
HorizontalAlignment = HAlignment.Center,
|
||||
VerticalAlignment = VAlignment.Center,
|
||||
SizeFlagsStretchRatio = 1,
|
||||
Scale = (0.5f, 0.5f)
|
||||
};
|
||||
settingsContainer.AddChild(_settingsButton);
|
||||
settingsContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 1 });
|
||||
settingsContainer.AddChild(new Control { HorizontalExpand = true, SizeFlagsStretchRatio = 1 });
|
||||
|
||||
// this allows a 2 column layout if window gets too small
|
||||
_slotContainer = new GridContainer
|
||||
{
|
||||
MaxHeight = CalcMaxHeight()
|
||||
MaxGridHeight = CalcMaxHeight()
|
||||
};
|
||||
hotbarContainer.AddChild(_slotContainer);
|
||||
|
||||
_loadoutContainer = new HBoxContainer
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
MouseFilter = MouseFilterMode.Stop
|
||||
};
|
||||
hotbarContainer.AddChild(_loadoutContainer);
|
||||
|
||||
_loadoutContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 1 });
|
||||
_loadoutContainer.AddChild(new Control { HorizontalExpand = true, SizeFlagsStretchRatio = 1 });
|
||||
var previousHotbarIcon = new TextureRect()
|
||||
{
|
||||
Texture = resourceCache.GetTexture("/Textures/Interface/Nano/left_arrow.svg.192dpi.png"),
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
|
||||
SizeFlagsVertical = SizeFlags.ShrinkCenter,
|
||||
HorizontalAlignment = HAlignment.Center,
|
||||
VerticalAlignment = VAlignment.Center,
|
||||
SizeFlagsStretchRatio = 1,
|
||||
TextureScale = (0.5f, 0.5f)
|
||||
};
|
||||
_loadoutContainer.AddChild(previousHotbarIcon);
|
||||
_loadoutContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 2 });
|
||||
_loadoutContainer.AddChild(new Control { HorizontalExpand = true, SizeFlagsStretchRatio = 2 });
|
||||
_loadoutNumber = new Label
|
||||
{
|
||||
Text = "1",
|
||||
SizeFlagsStretchRatio = 1
|
||||
};
|
||||
_loadoutContainer.AddChild(_loadoutNumber);
|
||||
_loadoutContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 2 });
|
||||
_loadoutContainer.AddChild(new Control { HorizontalExpand = true, SizeFlagsStretchRatio = 2 });
|
||||
var nextHotbarIcon = new TextureRect
|
||||
{
|
||||
Texture = resourceCache.GetTexture("/Textures/Interface/Nano/right_arrow.svg.192dpi.png"),
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
|
||||
SizeFlagsVertical = SizeFlags.ShrinkCenter,
|
||||
HorizontalAlignment = HAlignment.Center,
|
||||
VerticalAlignment = VAlignment.Center,
|
||||
SizeFlagsStretchRatio = 1,
|
||||
TextureScale = (0.5f, 0.5f)
|
||||
};
|
||||
_loadoutContainer.AddChild(nextHotbarIcon);
|
||||
_loadoutContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 1 });
|
||||
_loadoutContainer.AddChild(new Control { HorizontalExpand = true, SizeFlagsStretchRatio = 1 });
|
||||
|
||||
_slots = new ActionSlot[ClientActionsComponent.Slots];
|
||||
|
||||
_dragShadow = new TextureRect
|
||||
{
|
||||
CustomMinimumSize = (64, 64),
|
||||
MinSize = (64, 64),
|
||||
Stretch = TextureRect.StretchMode.Scale,
|
||||
Visible = false
|
||||
Visible = false,
|
||||
SetSize = (64, 64)
|
||||
};
|
||||
UserInterfaceManager.PopupRoot.AddChild(_dragShadow);
|
||||
LayoutContainer.SetSize(_dragShadow, (64, 64));
|
||||
|
||||
for (byte i = 0; i < ClientActionsComponent.Slots; i++)
|
||||
{
|
||||
@@ -205,6 +205,8 @@ namespace Content.Client.UserInterface
|
||||
}
|
||||
|
||||
DragDropHelper = new DragDropHelper<ActionSlot>(OnBeginActionDrag, OnContinueActionDrag, OnEndActionDrag);
|
||||
|
||||
MinSize = (10, 400);
|
||||
}
|
||||
|
||||
protected override void EnteredTree()
|
||||
@@ -231,16 +233,10 @@ namespace Content.Client.UserInterface
|
||||
_gameHud.ActionsButtonVisible = false;
|
||||
}
|
||||
|
||||
protected override Vector2 CalculateMinimumSize()
|
||||
{
|
||||
// allows us to shrink down to a 2-column layout minimum
|
||||
return (10, 400);
|
||||
}
|
||||
|
||||
protected override void Resized()
|
||||
{
|
||||
base.Resized();
|
||||
_slotContainer.MaxHeight = CalcMaxHeight();
|
||||
_slotContainer.MaxGridHeight = CalcMaxHeight();
|
||||
}
|
||||
|
||||
private float CalcMaxHeight()
|
||||
@@ -265,7 +261,7 @@ namespace Content.Client.UserInterface
|
||||
|
||||
protected override void UIScaleChanged()
|
||||
{
|
||||
_slotContainer.MaxHeight = CalcMaxHeight();
|
||||
_slotContainer.MaxGridHeight = CalcMaxHeight();
|
||||
base.UIScaleChanged();
|
||||
}
|
||||
|
||||
|
||||
@@ -82,11 +82,11 @@ namespace Content.Client.UserInterface
|
||||
(_amountEdit = new LineEdit
|
||||
{
|
||||
PlaceHolder = Loc.GetString("A number..."),
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand
|
||||
HorizontalExpand = true
|
||||
}),
|
||||
},
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
SizeFlagsVertical = SizeFlags.FillExpand
|
||||
HorizontalExpand = true,
|
||||
VerticalExpand = true
|
||||
},
|
||||
new HBoxContainer
|
||||
{
|
||||
@@ -94,7 +94,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
(_errorLabel = new Label
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
ClipText = true
|
||||
}),
|
||||
|
||||
|
||||
@@ -21,10 +21,9 @@ namespace Content.Client.UserInterface.AdminMenu
|
||||
remove => PlayerTabControl.OnPlayerListRefresh -= value;
|
||||
}
|
||||
|
||||
protected override Vector2? CustomSize => (500, 250);
|
||||
|
||||
public AdminMenuWindow()
|
||||
{
|
||||
MinSize = SetSize = (500, 250);
|
||||
Title = Loc.GetString("Admin Menu");
|
||||
RobustXamlLoader.Load(this);
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<SS14Window
|
||||
xmlns="https://spacestation14.io">
|
||||
<HBoxContainer SizeFlagsHorizontal="FillExpand">
|
||||
<VBoxContainer SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="0.45">
|
||||
<HBoxContainer SizeFlagsHorizontal="FillExpand" SizeFlagsVertical="FillExpand"
|
||||
<HBoxContainer HorizontalExpand="True">
|
||||
<VBoxContainer HorizontalExpand="True" SizeFlagsStretchRatio="0.45">
|
||||
<HBoxContainer HorizontalExpand="True" VerticalExpand="True"
|
||||
SizeFlagsStretchRatio="0.1">
|
||||
<LineEdit Name="SearchBar" PlaceHolder="Search" SizeFlagsHorizontal="FillExpand"
|
||||
<LineEdit Name="SearchBar" PlaceHolder="Search" HorizontalExpand="True"
|
||||
SizeFlagsStretchRatio="0.6" />
|
||||
</HBoxContainer>
|
||||
<ItemList Name="OutfitList" SelectMode="Single" SizeFlagsVertical="FillExpand"
|
||||
<ItemList Name="OutfitList" SelectMode="Single" VerticalExpand="True"
|
||||
SizeFlagsStretchRatio="0.9" />
|
||||
<Button Name="ConfirmButton" SizeFlagsHorizontal="FillExpand" />
|
||||
<Button Name="ConfirmButton" HorizontalExpand="True" />
|
||||
</VBoxContainer>
|
||||
</HBoxContainer>
|
||||
</SS14Window>
|
||||
|
||||
@@ -20,12 +20,11 @@ namespace Content.Client.UserInterface.AdminMenu.SetOutfit
|
||||
[Dependency] private readonly IClientConsoleHost _consoleHost = default!;
|
||||
|
||||
public EntityUid? TargetEntityId { get; set; }
|
||||
protected override Vector2? CustomSize => (250, 320);
|
||||
|
||||
private StartingGearPrototype? _selectedOutfit;
|
||||
|
||||
public SetOutfitMenu()
|
||||
{
|
||||
MinSize = SetSize = (250, 320);
|
||||
IoCManager.InjectDependencies(this);
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
<MarginContainer
|
||||
<Control
|
||||
xmlns="https://spacestation14.io"
|
||||
xmlns:amc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:at="clr-namespace:Content.Client.UserInterface.AdminMenu.Tabs.AdminTab"
|
||||
MarginLeftOverride="4"
|
||||
MarginTopOverride="4" MarginRightOverride="4"
|
||||
MarginBottomOverride="4"
|
||||
CustomMinimumSize="50 50">
|
||||
Margin="4"
|
||||
MinSize="50 50">
|
||||
<VBoxContainer>
|
||||
<GridContainer Columns="4">
|
||||
<amc:UICommandButton Command="kick" Text="{Loc Kick}" WindowType="{x:Type at:KickWindow}" />
|
||||
@@ -16,4 +14,4 @@
|
||||
<amc:CommandButton Command="permissions" Text="{Loc Permissions Panel}" />
|
||||
</GridContainer>
|
||||
</VBoxContainer>
|
||||
</MarginContainer>
|
||||
</Control>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#nullable enable
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface;
|
||||
|
||||
namespace Content.Client.UserInterface.AdminMenu.Tabs.AdminTab
|
||||
{
|
||||
[GenerateTypedNameReferences]
|
||||
public partial class AdminTab : MarginContainer
|
||||
public partial class AdminTab : Control
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
<SS14Window
|
||||
xmlns="https://spacestation14.io"
|
||||
xmlns:cc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls"
|
||||
Title="{Loc Ban}" CustomMinimumSize="425 162">
|
||||
Title="{Loc Ban}" MinSize="425 162">
|
||||
<VBoxContainer>
|
||||
<HBoxContainer>
|
||||
<Label Text="{Loc Player}" CustomMinimumSize="100 0" />
|
||||
<Control CustomMinimumSize="50 0" />
|
||||
<LineEdit Name="PlayerNameLine" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" />
|
||||
<Label Text="{Loc Player}" MinWidth="100" />
|
||||
<Control MinWidth="50" />
|
||||
<LineEdit Name="PlayerNameLine" MinWidth="100" HorizontalExpand="True" />
|
||||
</HBoxContainer>
|
||||
<HBoxContainer>
|
||||
<Label Text="{Loc Reason}" CustomMinimumSize="100 0" />
|
||||
<Control CustomMinimumSize="50 0" />
|
||||
<LineEdit Name="ReasonLine" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" />
|
||||
<Label Text="{Loc Reason}" MinSize="100 0" />
|
||||
<Control MinSize="50 0" />
|
||||
<LineEdit Name="ReasonLine" MinSize="100 0" HorizontalExpand="True" />
|
||||
</HBoxContainer>
|
||||
<HBoxContainer>
|
||||
<Label Text="{Loc Minutes}" CustomMinimumSize="100 0" />
|
||||
<Control CustomMinimumSize="50 0" />
|
||||
<LineEdit Name="MinutesLine" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" PlaceHolder="{Loc 0 minutes for a permanent ban}" />
|
||||
<Label Text="{Loc Minutes}" MinWidth="100" />
|
||||
<Control MinWidth="50" />
|
||||
<LineEdit Name="MinutesLine" MinWidth="100" HorizontalExpand="True" PlaceHolder="{Loc 0 minutes for a permanent ban}" />
|
||||
</HBoxContainer>
|
||||
<Control CustomMinimumSize="50 0" />
|
||||
<Control MinWidth="50" />
|
||||
<Button Name="SubmitButton" Text="{Loc Ban}" />
|
||||
</VBoxContainer>
|
||||
</SS14Window>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<SS14Window
|
||||
xmlns="https://spacestation14.io"
|
||||
xmlns:cc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls"
|
||||
Title="{Loc Kick}" CustomMinimumSize="425 272">
|
||||
Title="{Loc Kick}" MinSize="425 272">
|
||||
<VBoxContainer>
|
||||
<HBoxContainer>
|
||||
<Label Text="{Loc Reason}" CustomMinimumSize="100 0" />
|
||||
<Control CustomMinimumSize="50 0" />
|
||||
<LineEdit Name="ReasonLine" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" />
|
||||
<Label Text="{Loc Reason}" MinWidth="100" />
|
||||
<Control MinWidth="50" />
|
||||
<LineEdit Name="ReasonLine" MinWidth="100" HorizontalExpand="True" />
|
||||
</HBoxContainer>
|
||||
<cc:PlayerListControl Name="PlayerList" />
|
||||
<Button Name="SubmitButton" Text="{Loc Kick}" />
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<SS14Window
|
||||
xmlns="https://spacestation14.io"
|
||||
xmlns:cc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls"
|
||||
Title="{Loc Teleport}" CustomMinimumSize="425 230">
|
||||
<VBoxContainer SizeFlagsVertical="FillExpand">
|
||||
Title="{Loc Teleport}" MinSize="425 230">
|
||||
<VBoxContainer>
|
||||
<cc:PlayerListControl Name="PlayerList" />
|
||||
<Button Name="SubmitButton" Text="{Loc Teleport}" />
|
||||
</VBoxContainer>
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
<MarginContainer
|
||||
<Control
|
||||
xmlns="https://spacestation14.io"
|
||||
xmlns:amc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:abt="clr-namespace:Content.Client.UserInterface.AdminMenu.Tabs.AdminbusTab"
|
||||
MarginLeftOverride="4"
|
||||
MarginTopOverride="4" MarginRightOverride="4"
|
||||
MarginBottomOverride="4"
|
||||
CustomMinimumSize="50 50">
|
||||
Margin="4"
|
||||
MinSize="50 50">
|
||||
<GridContainer
|
||||
Columns="4">
|
||||
<amc:CommandButton Name="SpawnEntitiesButton" Text="{Loc Spawn Entities}" />
|
||||
<amc:CommandButton Name="SpawnTilesButton" Text="{Loc Spawn Tiles} " />
|
||||
<amc:UICommandButton Command="events" Text="{Loc Station Events}" WindowType="{x:Type abt:StationEventsWindow}" />
|
||||
</GridContainer>
|
||||
</MarginContainer>
|
||||
</Control>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.Placement;
|
||||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Shared.IoC;
|
||||
@@ -11,7 +12,7 @@ using Robust.Shared.Prototypes;
|
||||
namespace Content.Client.UserInterface.AdminMenu.Tabs.AdminbusTab
|
||||
{
|
||||
[GenerateTypedNameReferences]
|
||||
public partial class AdminbusTab : MarginContainer
|
||||
public partial class AdminbusTab : Control
|
||||
{
|
||||
protected override void EnteredTree()
|
||||
{
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
xmlns="https://spacestation14.io" Title="Kick">
|
||||
<VBoxContainer>
|
||||
<HBoxContainer>
|
||||
<Label Text="{Loc Event}" CustomMinimumSize="100 0" />
|
||||
<Control CustomMinimumSize="50 0" />
|
||||
<OptionButton Name="EventsOptions" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" />
|
||||
<Label Text="{Loc Event}" MinSize="100 0" />
|
||||
<Control MinSize="50 0" />
|
||||
<OptionButton Name="EventsOptions" MinSize="100 0" HorizontalExpand="True" />
|
||||
</HBoxContainer>
|
||||
<Button Name="PauseButton" Text="{Loc Pause}" />
|
||||
<Button Name="ResumeButton" Text="{Loc Resume}" />
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
xmlns="https://spacestation14.io" Title="{Loc Add Atmos}">
|
||||
<VBoxContainer>
|
||||
<HBoxContainer>
|
||||
<Label Text="{Loc Grid}" CustomMinimumSize="100 0" />
|
||||
<Control CustomMinimumSize="50 0" />
|
||||
<OptionButton Name="GridOptions" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" />
|
||||
<Label Text="{Loc Grid}" MinSize="100 0" />
|
||||
<Control MinSize="50 0" />
|
||||
<OptionButton Name="GridOptions" MinSize="100 0" HorizontalExpand="True" />
|
||||
</HBoxContainer>
|
||||
<Button Name="SubmitButton" Text="{Loc Add Atmos}" />
|
||||
</VBoxContainer>
|
||||
|
||||
@@ -2,29 +2,29 @@
|
||||
xmlns="https://spacestation14.io" Title="{Loc Add Gas}">
|
||||
<VBoxContainer>
|
||||
<HBoxContainer>
|
||||
<Label Text="{Loc Grid}" CustomMinimumSize="100 0" />
|
||||
<Control CustomMinimumSize="50 0" />
|
||||
<OptionButton Name="GridOptions" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" />
|
||||
<Label Text="{Loc Grid}" MinSize="100 0" />
|
||||
<Control MinSize="50 0" />
|
||||
<OptionButton Name="GridOptions" MinSize="100 0" HorizontalExpand="True" />
|
||||
</HBoxContainer>
|
||||
<HBoxContainer>
|
||||
<Label Text="{Loc TileX}" CustomMinimumSize="100 0" />
|
||||
<Control CustomMinimumSize="50 0" />
|
||||
<SpinBox Name="TileXSpin" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" />
|
||||
<Label Text="{Loc TileX}" MinSize="100 0" />
|
||||
<Control MinSize="50 0" />
|
||||
<SpinBox Name="TileXSpin" MinSize="100 0" HorizontalExpand="True" />
|
||||
</HBoxContainer>
|
||||
<HBoxContainer>
|
||||
<Label Text="{Loc TileY}" CustomMinimumSize="100 0" />
|
||||
<Control CustomMinimumSize="50 0" />
|
||||
<SpinBox Name="TileYSpin" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" />
|
||||
<Label Text="{Loc TileY}" MinSize="100 0" />
|
||||
<Control MinSize="50 0" />
|
||||
<SpinBox Name="TileYSpin" MinSize="100 0" HorizontalExpand="True" />
|
||||
</HBoxContainer>
|
||||
<HBoxContainer>
|
||||
<Label Text="{Loc Gas}" CustomMinimumSize="100 0" />
|
||||
<Control CustomMinimumSize="50 0" />
|
||||
<OptionButton Name="GasOptions" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" />
|
||||
<Label Text="{Loc Gas}" MinSize="100 0" />
|
||||
<Control MinSize="50 0" />
|
||||
<OptionButton Name="GasOptions" MinSize="100 0" HorizontalExpand="True" />
|
||||
</HBoxContainer>
|
||||
<HBoxContainer>
|
||||
<Label Text="{Loc Amount}" CustomMinimumSize="100 0" />
|
||||
<Control CustomMinimumSize="50 0" />
|
||||
<SpinBox Name="AmountSpin" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" />
|
||||
<Label Text="{Loc Amount}" MinSize="100 0" />
|
||||
<Control MinSize="50 0" />
|
||||
<SpinBox Name="AmountSpin" MinSize="100 0" HorizontalExpand="True" />
|
||||
</HBoxContainer>
|
||||
<Button Name="SubmitButton" Text="{Loc Add Gas}" />
|
||||
</VBoxContainer>
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
<MarginContainer
|
||||
<Control
|
||||
xmlns="https://spacestation14.io"
|
||||
xmlns:amc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:at="clr-namespace:Content.Client.UserInterface.AdminMenu.Tabs.AtmosTab"
|
||||
MarginLeftOverride="4"
|
||||
MarginTopOverride="4" MarginRightOverride="4"
|
||||
MarginBottomOverride="4"
|
||||
CustomMinimumSize="50 50">
|
||||
Margin="4"
|
||||
MinSize="50 50">
|
||||
<GridContainer Columns="4">
|
||||
<amc:UICommandButton Text="{Loc Add Atmos}" Command="addatmos" WindowType="{x:Type at:AddAtmosWindow}" />
|
||||
<amc:UICommandButton Text="{Loc Add Gas}" Command="addgas" WindowType="{x:Type at:AddGasWindow}" />
|
||||
@@ -14,4 +12,4 @@
|
||||
<amc:UICommandButton Text="{Loc Set Temperature}" Command="settemp"
|
||||
WindowType="{x:Type at:SetTemperatureWindow}" />
|
||||
</GridContainer>
|
||||
</MarginContainer>
|
||||
</Control>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#nullable enable
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
|
||||
namespace Content.Client.UserInterface.AdminMenu.Tabs.AtmosTab
|
||||
{
|
||||
[GenerateTypedNameReferences]
|
||||
public partial class AtmosTab : MarginContainer
|
||||
public partial class AtmosTab : Control
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
xmlns="https://spacestation14.io" Title="{Loc Fill Gas}">
|
||||
<VBoxContainer>
|
||||
<HBoxContainer>
|
||||
<Label Text="{Loc Grid}" CustomMinimumSize="100 0" />
|
||||
<Control CustomMinimumSize="50 0" />
|
||||
<OptionButton Name="GridOptions" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" />
|
||||
<Label Text="{Loc Grid}" MinSize="100 0" />
|
||||
<Control MinSize="50 0" />
|
||||
<OptionButton Name="GridOptions" MinSize="100 0" HorizontalExpand="True" />
|
||||
</HBoxContainer>
|
||||
<HBoxContainer>
|
||||
<Label Text="{Loc Gas}" CustomMinimumSize="100 0" />
|
||||
<Control CustomMinimumSize="50 0" />
|
||||
<OptionButton Name="GasOptions" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" />
|
||||
<Label Text="{Loc Gas}" MinSize="100 0" />
|
||||
<Control MinSize="50 0" />
|
||||
<OptionButton Name="GasOptions" MinSize="100 0" HorizontalExpand="True" />
|
||||
</HBoxContainer>
|
||||
<HBoxContainer>
|
||||
<Label Text="{Loc Amount}" CustomMinimumSize="100 0" />
|
||||
<Control CustomMinimumSize="50 0" />
|
||||
<SpinBox Name="AmountSpin" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" />
|
||||
<Label Text="{Loc Amount}" MinSize="100 0" />
|
||||
<Control MinSize="50 0" />
|
||||
<SpinBox Name="AmountSpin" MinSize="100 0" HorizontalExpand="True" />
|
||||
</HBoxContainer>
|
||||
<Button Name="SubmitButton" Text="{Loc Fill Gas}" />
|
||||
</VBoxContainer>
|
||||
|
||||
@@ -2,24 +2,24 @@
|
||||
xmlns="https://spacestation14.io" Title="{Loc Set Temperature}">
|
||||
<VBoxContainer>
|
||||
<HBoxContainer>
|
||||
<Label Text="{Loc Grid}" CustomMinimumSize="100 0" />
|
||||
<Control CustomMinimumSize="50 0" />
|
||||
<OptionButton Name="GridOptions" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" />
|
||||
<Label Text="{Loc Grid}" MinSize="100 0" />
|
||||
<Control MinSize="50 0" />
|
||||
<OptionButton Name="GridOptions" MinSize="100 0" HorizontalExpand="True" />
|
||||
</HBoxContainer>
|
||||
<HBoxContainer>
|
||||
<Label Text="{Loc TileX}" CustomMinimumSize="100 0" />
|
||||
<Control CustomMinimumSize="50 0" />
|
||||
<SpinBox Name="TileXSpin" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" />
|
||||
<Label Text="{Loc TileX}" MinSize="100 0" />
|
||||
<Control MinSize="50 0" />
|
||||
<SpinBox Name="TileXSpin" MinSize="100 0" HorizontalExpand="True" />
|
||||
</HBoxContainer>
|
||||
<HBoxContainer>
|
||||
<Label Text="{Loc TileY}" CustomMinimumSize="100 0" />
|
||||
<Control CustomMinimumSize="50 0" />
|
||||
<SpinBox Name="TileYSpin" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" />
|
||||
<Label Text="{Loc TileY}" MinSize="100 0" />
|
||||
<Control MinSize="50 0" />
|
||||
<SpinBox Name="TileYSpin" MinSize="100 0" HorizontalExpand="True" />
|
||||
</HBoxContainer>
|
||||
<HBoxContainer>
|
||||
<Label Text="{Loc Temperature}" CustomMinimumSize="100 0" />
|
||||
<Control CustomMinimumSize="50 0" />
|
||||
<SpinBox Name="TemperatureSpin" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" />
|
||||
<Label Text="{Loc Temperature}" MinSize="100 0" />
|
||||
<Control MinSize="50 0" />
|
||||
<SpinBox Name="TemperatureSpin" MinSize="100 0" HorizontalExpand="True" />
|
||||
</HBoxContainer>
|
||||
<Button Name="SubmitButton" Text="{Loc Set Temperature}" />
|
||||
</VBoxContainer>
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
<MarginContainer
|
||||
xmlns="https://spacestation14.io">
|
||||
<VBoxContainer SizeFlagsVertical="Fill">
|
||||
<HBoxContainer SizeFlagsVertical="Fill">
|
||||
<Label Name="PlayerCount" SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="0.7"
|
||||
<Control xmlns="https://spacestation14.io">
|
||||
<VBoxContainer>
|
||||
<HBoxContainer>
|
||||
<Label Name="PlayerCount" HorizontalExpand="True" SizeFlagsStretchRatio="0.7"
|
||||
Text="{Loc Player Count}" />
|
||||
<Button Name="RefreshButton" SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="0.3"
|
||||
<Button Name="RefreshButton" HorizontalExpand="True" SizeFlagsStretchRatio="0.3"
|
||||
Text="{Loc Refresh}" />
|
||||
</HBoxContainer>
|
||||
<Control CustomMinimumSize="0 5" />
|
||||
<ScrollContainer SizeFlagsHorizontal="FillExpand" SizeFlagsVertical="FillExpand">
|
||||
<Control MinSize="0 5" />
|
||||
<ScrollContainer HorizontalExpand="True" VerticalExpand="True">
|
||||
<VBoxContainer Name="PlayerList" />
|
||||
</ScrollContainer>
|
||||
</VBoxContainer>
|
||||
</MarginContainer>
|
||||
</Control>
|
||||
|
||||
@@ -13,7 +13,7 @@ using Robust.Shared.Maths;
|
||||
namespace Content.Client.UserInterface.AdminMenu.Tabs
|
||||
{
|
||||
[GenerateTypedNameReferences]
|
||||
public partial class PlayerTab : MarginContainer
|
||||
public partial class PlayerTab : Control
|
||||
{
|
||||
public delegate void PlayerListRefresh();
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace Content.Client.UserInterface.AdminMenu.Tabs
|
||||
|
||||
var header = new HBoxContainer
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
SeparationOverride = 4,
|
||||
Children =
|
||||
{
|
||||
@@ -50,14 +50,14 @@ namespace Content.Client.UserInterface.AdminMenu.Tabs
|
||||
{
|
||||
Text = "Name",
|
||||
SizeFlagsStretchRatio = 2f,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand
|
||||
HorizontalExpand = true
|
||||
},
|
||||
new VSeparator(),
|
||||
new Label
|
||||
{
|
||||
Text = "Player",
|
||||
SizeFlagsStretchRatio = 2f,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand
|
||||
HorizontalExpand = true
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -79,7 +79,7 @@ namespace Content.Client.UserInterface.AdminMenu.Tabs
|
||||
{
|
||||
var hBox = new HBoxContainer
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
SeparationOverride = 4,
|
||||
Children =
|
||||
{
|
||||
@@ -87,7 +87,7 @@ namespace Content.Client.UserInterface.AdminMenu.Tabs
|
||||
{
|
||||
Text = name,
|
||||
SizeFlagsStretchRatio = 2f,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
ClipText = true
|
||||
},
|
||||
new VSeparator(),
|
||||
@@ -95,7 +95,7 @@ namespace Content.Client.UserInterface.AdminMenu.Tabs
|
||||
{
|
||||
Text = player,
|
||||
SizeFlagsStretchRatio = 2f,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
ClipText = true
|
||||
}
|
||||
}
|
||||
@@ -121,7 +121,7 @@ namespace Content.Client.UserInterface.AdminMenu.Tabs
|
||||
{
|
||||
public VSeparator()
|
||||
{
|
||||
CustomMinimumSize = (2, 5);
|
||||
MinSize = (2, 5);
|
||||
AddChild(new PanelContainer
|
||||
{
|
||||
PanelOverride = new StyleBoxFlat
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
<MarginContainer
|
||||
<Control
|
||||
xmlns="https://spacestation14.io"
|
||||
xmlns:amc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls"
|
||||
MarginLeftOverride="4"
|
||||
MarginTopOverride="4" MarginRightOverride="4"
|
||||
MarginBottomOverride="4"
|
||||
CustomMinimumSize="50 50">
|
||||
Margin="4"
|
||||
MinSize="50 50">
|
||||
<GridContainer
|
||||
Columns="4">
|
||||
<amc:CommandButton Command="startround" Text="{Loc Start Round}" />
|
||||
<amc:CommandButton Command="endround" Text="{Loc End Round}" />
|
||||
<amc:CommandButton Command="restartround" Text="{Loc Restart Round}" />
|
||||
</GridContainer>
|
||||
</MarginContainer>
|
||||
</Control>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
#nullable enable
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
|
||||
namespace Content.Client.UserInterface.AdminMenu.Tabs
|
||||
{
|
||||
[GenerateTypedNameReferences]
|
||||
public partial class RoundTab : MarginContainer
|
||||
public partial class RoundTab : Control
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
<MarginContainer
|
||||
<Control
|
||||
xmlns="https://spacestation14.io"
|
||||
xmlns:amc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls"
|
||||
MarginLeftOverride="4"
|
||||
MarginTopOverride="4" MarginRightOverride="4"
|
||||
MarginBottomOverride="4"
|
||||
CustomMinimumSize="50 50">
|
||||
Margin="4"
|
||||
MinSize="50 50">
|
||||
<GridContainer
|
||||
Columns="4" >
|
||||
<amc:CommandButton Command="restart" Text="{Loc Reboot}"></amc:CommandButton>
|
||||
<amc:CommandButton Command="shutdown" Text="{Loc Shutdown}"></amc:CommandButton>
|
||||
</GridContainer>
|
||||
</MarginContainer>
|
||||
</Control>
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
#nullable enable
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
|
||||
namespace Content.Client.UserInterface.AdminMenu.Tabs
|
||||
{
|
||||
[GenerateTypedNameReferences]
|
||||
public partial class ServerTab : MarginContainer
|
||||
public partial class ServerTab : Control
|
||||
{
|
||||
public ServerTab()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using Content.Client.UserInterface.Stylesheets;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Shared.Maths;
|
||||
|
||||
namespace Content.Client.UserInterface
|
||||
{
|
||||
@@ -25,37 +24,35 @@ namespace Content.Client.UserInterface
|
||||
var panelContainer = new PanelContainer
|
||||
{
|
||||
StyleClasses = {StyleNano.StyleClassTransparentBorderedWindowPanel},
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkEnd,
|
||||
SizeFlagsVertical = SizeFlags.None
|
||||
HorizontalAlignment = HAlignment.Right,
|
||||
VerticalAlignment = VAlignment.Top
|
||||
};
|
||||
AddChild(panelContainer);
|
||||
|
||||
Grid = new GridContainer
|
||||
{
|
||||
MaxHeight = 64,
|
||||
MaxGridHeight = 64,
|
||||
ExpandBackwards = true
|
||||
};
|
||||
panelContainer.AddChild(Grid);
|
||||
|
||||
MinSize = (64, 64);
|
||||
}
|
||||
|
||||
// This makes no sense but I'm leaving it in place in case I break anything by removing it.
|
||||
|
||||
protected override void Resized()
|
||||
{
|
||||
// TODO: Can rework this once https://github.com/space-wizards/RobustToolbox/issues/1392 is done,
|
||||
// this is here because there isn't currently a good way to allow the grid to adjust its height based
|
||||
// on constraints, otherwise we would use anchors to lay it out
|
||||
base.Resized();
|
||||
Grid.MaxHeight = Height;
|
||||
}
|
||||
|
||||
protected override Vector2 CalculateMinimumSize()
|
||||
{
|
||||
// allows us to shrink down to a single row
|
||||
return (64, 64);
|
||||
Grid.MaxGridHeight = Height;
|
||||
}
|
||||
|
||||
protected override void UIScaleChanged()
|
||||
{
|
||||
Grid.MaxHeight = Height;
|
||||
Grid.MaxGridHeight = Height;
|
||||
base.UIScaleChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace Content.Client.UserInterface.Atmos.GasTank
|
||||
Children =
|
||||
{
|
||||
(_topContainer = new VBoxContainer()),
|
||||
new Control {CustomMinimumSize = (0, 110)}
|
||||
new Control {MinSize = (0, 110)}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -82,37 +82,26 @@ namespace Content.Client.UserInterface.Atmos.GasTank
|
||||
|
||||
var font = _resourceCache.GetFont("/Fonts/Boxfont-round/Boxfont Round.ttf", 13);
|
||||
|
||||
var topRow = new MarginContainer
|
||||
var topRow = new HBoxContainer
|
||||
{
|
||||
MarginLeftOverride = 4,
|
||||
MarginTopOverride = 2,
|
||||
MarginRightOverride = 12,
|
||||
MarginBottomOverride = 2,
|
||||
Margin = new Thickness(4, 2, 12, 2),
|
||||
Children =
|
||||
{
|
||||
new HBoxContainer
|
||||
(_lblName = new Label
|
||||
{
|
||||
Children =
|
||||
{
|
||||
(_lblName = new Label
|
||||
{
|
||||
Text = Loc.GetString("Gas Tank"),
|
||||
FontOverride = font,
|
||||
FontColorOverride = StyleNano.NanoGold,
|
||||
SizeFlagsVertical = SizeFlags.ShrinkCenter
|
||||
}),
|
||||
new Control
|
||||
{
|
||||
CustomMinimumSize = (20, 0),
|
||||
SizeFlagsHorizontal = SizeFlags.Expand
|
||||
},
|
||||
(btnClose = new TextureButton
|
||||
{
|
||||
StyleClasses = {SS14Window.StyleClassWindowCloseButton},
|
||||
SizeFlagsVertical = SizeFlags.ShrinkCenter
|
||||
})
|
||||
}
|
||||
}
|
||||
Text = Loc.GetString("Gas Tank"),
|
||||
FontOverride = font,
|
||||
FontColorOverride = StyleNano.NanoGold,
|
||||
VerticalAlignment = VAlignment.Center,
|
||||
HorizontalExpand = true,
|
||||
HorizontalAlignment = HAlignment.Left,
|
||||
Margin = new Thickness(0, 0, 20, 0),
|
||||
}),
|
||||
(btnClose = new TextureButton
|
||||
{
|
||||
StyleClasses = {SS14Window.StyleClassWindowCloseButton},
|
||||
VerticalAlignment = VAlignment.Center
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
@@ -121,30 +110,23 @@ namespace Content.Client.UserInterface.Atmos.GasTank
|
||||
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#202025")},
|
||||
Children =
|
||||
{
|
||||
new MarginContainer
|
||||
(_contentContainer = new VBoxContainer
|
||||
{
|
||||
MarginLeftOverride = 8,
|
||||
MarginRightOverride = 8,
|
||||
MarginTopOverride = 4,
|
||||
MarginBottomOverride = 4,
|
||||
Children =
|
||||
{
|
||||
(_contentContainer = new VBoxContainer())
|
||||
}
|
||||
}
|
||||
Margin = new Thickness(8, 4),
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
_topContainer.AddChild(topRow);
|
||||
_topContainer.AddChild(new PanelContainer
|
||||
{
|
||||
CustomMinimumSize = (0, 2),
|
||||
MinSize = (0, 2),
|
||||
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#525252ff")}
|
||||
});
|
||||
_topContainer.AddChild(middle);
|
||||
_topContainer.AddChild(new PanelContainer
|
||||
{
|
||||
CustomMinimumSize = (0, 2),
|
||||
MinSize = (0, 2),
|
||||
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#525252ff")}
|
||||
});
|
||||
|
||||
@@ -154,26 +136,20 @@ namespace Content.Client.UserInterface.Atmos.GasTank
|
||||
|
||||
//internals
|
||||
_lblInternals = new RichTextLabel
|
||||
{CustomMinimumSize = (200, 0), SizeFlagsVertical = SizeFlags.ShrinkCenter};
|
||||
{MinSize = (200, 0), VerticalAlignment = VAlignment.Center};
|
||||
_btnInternals = new Button {Text = Loc.GetString("Toggle")};
|
||||
|
||||
_contentContainer.AddChild(
|
||||
new MarginContainer
|
||||
new HBoxContainer
|
||||
{
|
||||
MarginTopOverride = 7,
|
||||
Children =
|
||||
{
|
||||
new HBoxContainer
|
||||
{
|
||||
Children = {_lblInternals, _btnInternals}
|
||||
}
|
||||
}
|
||||
Margin = new Thickness(0, 7, 0, 0),
|
||||
Children = {_lblInternals, _btnInternals}
|
||||
});
|
||||
|
||||
// Separator
|
||||
_contentContainer.AddChild(new Control
|
||||
{
|
||||
CustomMinimumSize = new Vector2(0, 10)
|
||||
MinSize = new Vector2(0, 10)
|
||||
});
|
||||
|
||||
_contentContainer.AddChild(new Label
|
||||
@@ -181,19 +157,12 @@ namespace Content.Client.UserInterface.Atmos.GasTank
|
||||
Text = Loc.GetString("Output Pressure"),
|
||||
Align = Label.AlignMode.Center
|
||||
});
|
||||
_spbPressure = new FloatSpinBox {IsValid = f => f >= 0 || f <= 3000};
|
||||
_contentContainer.AddChild(
|
||||
new MarginContainer
|
||||
{
|
||||
MarginRightOverride = 25,
|
||||
MarginLeftOverride = 25,
|
||||
MarginBottomOverride = 7,
|
||||
Children =
|
||||
{
|
||||
_spbPressure
|
||||
}
|
||||
}
|
||||
);
|
||||
_spbPressure = new FloatSpinBox
|
||||
{
|
||||
IsValid = f => f >= 0 || f <= 3000,
|
||||
Margin = new Thickness(25, 0, 25, 7)
|
||||
};
|
||||
_contentContainer.AddChild(_spbPressure);
|
||||
|
||||
// Handlers
|
||||
_spbPressure.OnValueChanged += args =>
|
||||
|
||||
@@ -15,8 +15,6 @@ namespace Content.Client.UserInterface.Cargo
|
||||
{
|
||||
public class CargoConsoleMenu : SS14Window
|
||||
{
|
||||
protected override Vector2? CustomSize => (400, 600);
|
||||
|
||||
public CargoConsoleBoundUserInterface Owner { get; private set; }
|
||||
|
||||
public event Action<BaseButton.ButtonEventArgs> OnItemSelected;
|
||||
@@ -42,6 +40,7 @@ namespace Content.Client.UserInterface.Cargo
|
||||
|
||||
public CargoConsoleMenu(CargoConsoleBoundUserInterface owner)
|
||||
{
|
||||
SetSize = MinSize = (400, 600);
|
||||
IoCManager.InjectDependencies(this);
|
||||
Owner = owner;
|
||||
|
||||
@@ -112,7 +111,7 @@ namespace Content.Client.UserInterface.Cargo
|
||||
//Text = Loc.GetString("Call Shuttle"),
|
||||
Text = Loc.GetString("Activate Telepad"), //Shuttle code pending
|
||||
TextAlign = Label.AlignMode.Center,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand
|
||||
HorizontalExpand = true
|
||||
};
|
||||
PermissionsButton = new Button()
|
||||
{
|
||||
@@ -127,13 +126,13 @@ namespace Content.Client.UserInterface.Cargo
|
||||
_categories = new OptionButton
|
||||
{
|
||||
Prefix = Loc.GetString("Categories: "),
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
SizeFlagsStretchRatio = 1
|
||||
};
|
||||
_searchBar = new LineEdit
|
||||
{
|
||||
PlaceHolder = Loc.GetString("Search"),
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
SizeFlagsStretchRatio = 1
|
||||
};
|
||||
category.AddChild(_categories);
|
||||
@@ -142,41 +141,41 @@ namespace Content.Client.UserInterface.Cargo
|
||||
|
||||
var products = new ScrollContainer()
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
VerticalExpand = true,
|
||||
SizeFlagsStretchRatio = 6
|
||||
};
|
||||
Products = new VBoxContainer()
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
SizeFlagsVertical = SizeFlags.FillExpand
|
||||
HorizontalExpand = true,
|
||||
VerticalExpand = true
|
||||
};
|
||||
products.AddChild(Products);
|
||||
rows.AddChild(products);
|
||||
|
||||
var requestsAndOrders = new PanelContainer
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
SizeFlagsStretchRatio = 6,
|
||||
PanelOverride = new StyleBoxFlat { BackgroundColor = Color.Black }
|
||||
};
|
||||
var orderScrollBox = new ScrollContainer
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand
|
||||
VerticalExpand = true
|
||||
};
|
||||
var rAndOVBox = new VBoxContainer();
|
||||
var requestsLabel = new Label { Text = Loc.GetString("Requests") };
|
||||
_requests = new VBoxContainer // replace with scroll box so that approval buttons can be added
|
||||
{
|
||||
StyleClasses = { "transparentItemList" },
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
SizeFlagsStretchRatio = 1,
|
||||
};
|
||||
var ordersLabel = new Label { Text = Loc.GetString("Orders") };
|
||||
_orders = new VBoxContainer
|
||||
{
|
||||
StyleClasses = { "transparentItemList" },
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
SizeFlagsStretchRatio = 1,
|
||||
};
|
||||
rAndOVBox.AddChild(requestsLabel);
|
||||
@@ -189,7 +188,7 @@ namespace Content.Client.UserInterface.Cargo
|
||||
|
||||
rows.AddChild(new TextureButton
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
});
|
||||
Contents.AddChild(rows);
|
||||
|
||||
@@ -351,30 +350,30 @@ namespace Content.Client.UserInterface.Cargo
|
||||
|
||||
public CargoProductRow()
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand;
|
||||
HorizontalExpand = true;
|
||||
|
||||
MainButton = new Button
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
SizeFlagsVertical = SizeFlags.FillExpand
|
||||
HorizontalExpand = true,
|
||||
VerticalExpand = true
|
||||
};
|
||||
AddChild(MainButton);
|
||||
|
||||
var hBox = new HBoxContainer
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand
|
||||
HorizontalExpand = true
|
||||
};
|
||||
|
||||
Icon = new TextureRect
|
||||
{
|
||||
CustomMinimumSize = new Vector2(32.0f, 32.0f),
|
||||
MinSize = new Vector2(32.0f, 32.0f),
|
||||
RectClipContent = true
|
||||
};
|
||||
hBox.AddChild(Icon);
|
||||
|
||||
ProductName = new Label
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand
|
||||
HorizontalExpand = true
|
||||
};
|
||||
hBox.AddChild(ProductName);
|
||||
|
||||
@@ -384,7 +383,7 @@ namespace Content.Client.UserInterface.Cargo
|
||||
};
|
||||
PointCost = new Label
|
||||
{
|
||||
CustomMinimumSize = new Vector2(40.0f, 32.0f),
|
||||
MinSize = new Vector2(40.0f, 32.0f),
|
||||
Align = Label.AlignMode.Right
|
||||
};
|
||||
panel.AddChild(PointCost);
|
||||
@@ -405,34 +404,34 @@ namespace Content.Client.UserInterface.Cargo
|
||||
|
||||
public CargoOrderRow()
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand;
|
||||
HorizontalExpand = true;
|
||||
|
||||
var hBox = new HBoxContainer
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
};
|
||||
|
||||
Icon = new TextureRect
|
||||
{
|
||||
CustomMinimumSize = new Vector2(32.0f, 32.0f),
|
||||
MinSize = new Vector2(32.0f, 32.0f),
|
||||
RectClipContent = true
|
||||
};
|
||||
hBox.AddChild(Icon);
|
||||
|
||||
var vBox = new VBoxContainer
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
SizeFlagsVertical = SizeFlags.FillExpand
|
||||
HorizontalExpand = true,
|
||||
VerticalExpand = true
|
||||
};
|
||||
ProductName = new Label
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
StyleClasses = { StyleNano.StyleClassLabelSubText },
|
||||
ClipText = true
|
||||
};
|
||||
Description = new Label
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
StyleClasses = { StyleNano.StyleClassLabelSubText },
|
||||
ClipText = true
|
||||
};
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Content.Client.UserInterface.Cargo
|
||||
var amountLabel = new Label { Text = Loc.GetString("Amount:") };
|
||||
Amount = new SpinBox
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
Value = 1
|
||||
};
|
||||
Amount.SetButtons(new List<int>() { -100, -10, -1 }, new List<int>() { 1, 10, 100 });
|
||||
|
||||
@@ -16,27 +16,18 @@ namespace Content.Client.UserInterface.Cargo
|
||||
private int[] _accountIds = new int[] { };
|
||||
private int _selectedAccountId = -1;
|
||||
|
||||
protected override Vector2? CustomSize => (300, 300);
|
||||
|
||||
public CargoConsoleBoundUserInterface Owner;
|
||||
|
||||
public GalacticBankSelectionMenu()
|
||||
{
|
||||
MinSize = SetSize = (300, 300);
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
Title = Loc.GetString("Galactic Bank Selection");
|
||||
|
||||
_accounts = new ItemList() { SelectMode = ItemList.ItemListSelectMode.Single };
|
||||
|
||||
var margin = new MarginContainer()
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
};
|
||||
|
||||
margin.AddChild(_accounts);
|
||||
|
||||
Contents.AddChild(margin);
|
||||
Contents.AddChild(_accounts);
|
||||
}
|
||||
|
||||
public void Populate(int accountCount, string[] accountNames, int[] accountIds, int selectedAccountId)
|
||||
|
||||
@@ -36,12 +36,9 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
_entityManager = entityManager;
|
||||
_preferencesManager = preferencesManager;
|
||||
var margin = new MarginContainer
|
||||
var margin = new Control
|
||||
{
|
||||
MarginBottomOverride = 20,
|
||||
MarginLeftOverride = 20,
|
||||
MarginRightOverride = 20,
|
||||
MarginTopOverride = 20
|
||||
Margin = new Thickness(20),
|
||||
};
|
||||
|
||||
AddChild(margin);
|
||||
@@ -67,32 +64,25 @@ namespace Content.Client.UserInterface
|
||||
|
||||
var topHBox = new HBoxContainer
|
||||
{
|
||||
CustomMinimumSize = (0, 40),
|
||||
MinSize = (0, 40),
|
||||
Children =
|
||||
{
|
||||
new MarginContainer
|
||||
new Label
|
||||
{
|
||||
MarginLeftOverride = 8,
|
||||
Children =
|
||||
{
|
||||
new Label
|
||||
{
|
||||
Text = Loc.GetString("Character Setup"),
|
||||
StyleClasses = {StyleNano.StyleClassLabelHeadingBigger},
|
||||
VAlign = Label.VAlignMode.Center,
|
||||
SizeFlagsHorizontal = SizeFlags.Expand | SizeFlags.ShrinkCenter
|
||||
}
|
||||
}
|
||||
Margin = new Thickness(8, 0, 0, 0),
|
||||
Text = Loc.GetString("Character Setup"),
|
||||
StyleClasses = {StyleNano.StyleClassLabelHeadingBigger},
|
||||
VAlign = Label.VAlignMode.Center,
|
||||
},
|
||||
(SaveButton = new Button
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.Expand | SizeFlags.ShrinkEnd,
|
||||
HorizontalExpand = true,
|
||||
HorizontalAlignment = HAlignment.Right,
|
||||
Text = Loc.GetString("Save"),
|
||||
StyleClasses = {StyleNano.StyleClassButtonBig},
|
||||
}),
|
||||
(CloseButton = new Button
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkEnd,
|
||||
Text = Loc.GetString("Close"),
|
||||
StyleClasses = {StyleNano.StyleClassButtonBig},
|
||||
})
|
||||
@@ -112,29 +102,20 @@ namespace Content.Client.UserInterface
|
||||
|
||||
var hBox = new HBoxContainer
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
SeparationOverride = 0
|
||||
};
|
||||
vBox.AddChild(hBox);
|
||||
|
||||
_charactersVBox = new VBoxContainer();
|
||||
|
||||
hBox.AddChild(new MarginContainer
|
||||
hBox.AddChild(new ScrollContainer
|
||||
{
|
||||
CustomMinimumSize = (330, 0),
|
||||
SizeFlagsHorizontal = SizeFlags.Fill,
|
||||
MarginTopOverride = 5,
|
||||
MarginLeftOverride = 5,
|
||||
MinSize = (325, 0),
|
||||
Margin = new Thickness(5, 5, 0, 0),
|
||||
Children =
|
||||
{
|
||||
new ScrollContainer
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
Children =
|
||||
{
|
||||
_charactersVBox
|
||||
}
|
||||
}
|
||||
_charactersVBox
|
||||
}
|
||||
});
|
||||
|
||||
@@ -152,7 +133,7 @@ namespace Content.Client.UserInterface
|
||||
hBox.AddChild(new PanelContainer
|
||||
{
|
||||
PanelOverride = new StyleBoxFlat {BackgroundColor = StyleNano.NanoGold},
|
||||
CustomMinimumSize = (2, 0)
|
||||
MinSize = (2, 0)
|
||||
});
|
||||
_humanoidProfileEditor = new HumanoidProfileEditor(preferencesManager, prototypeManager, entityManager);
|
||||
_humanoidProfileEditor.OnProfileChanged += newProfile => { UpdateUI(); };
|
||||
@@ -266,7 +247,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
Text = description,
|
||||
ClipText = true,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand
|
||||
HorizontalExpand = true
|
||||
};
|
||||
var deleteButton = new Button
|
||||
{
|
||||
@@ -281,7 +262,7 @@ namespace Content.Client.UserInterface
|
||||
|
||||
var internalHBox = new HBoxContainer
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
SeparationOverride = 0,
|
||||
Children =
|
||||
{
|
||||
|
||||
@@ -131,8 +131,8 @@ namespace Content.Client.UserInterface.Controls
|
||||
SlotIndex = slotIndex;
|
||||
MouseFilter = MouseFilterMode.Stop;
|
||||
|
||||
CustomMinimumSize = (64, 64);
|
||||
SizeFlagsVertical = SizeFlags.None;
|
||||
MinSize = (64, 64);
|
||||
VerticalAlignment = VAlignment.Top;
|
||||
TooltipDelay = CustomTooltipDelay;
|
||||
TooltipSupplier = SupplyTooltip;
|
||||
|
||||
@@ -144,29 +144,29 @@ namespace Content.Client.UserInterface.Controls
|
||||
|
||||
_bigActionIcon = new TextureRect
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
VerticalExpand = true,
|
||||
Stretch = TextureRect.StretchMode.Scale,
|
||||
Visible = false
|
||||
};
|
||||
_bigItemSpriteView = new SpriteView
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
VerticalExpand = true,
|
||||
Scale = (2,2),
|
||||
Visible = false
|
||||
};
|
||||
_smallActionIcon = new TextureRect
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkEnd,
|
||||
SizeFlagsVertical = SizeFlags.ShrinkEnd,
|
||||
HorizontalAlignment = HAlignment.Right,
|
||||
VerticalAlignment = VAlignment.Bottom,
|
||||
Stretch = TextureRect.StretchMode.Scale,
|
||||
Visible = false
|
||||
};
|
||||
_smallItemSpriteView = new SpriteView
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkEnd,
|
||||
SizeFlagsVertical = SizeFlags.ShrinkEnd,
|
||||
HorizontalAlignment = HAlignment.Right,
|
||||
VerticalAlignment = VAlignment.Bottom,
|
||||
Visible = false
|
||||
};
|
||||
|
||||
@@ -175,28 +175,26 @@ namespace Content.Client.UserInterface.Controls
|
||||
// padding to the left of the number to shift it right
|
||||
var paddingBox = new HBoxContainer()
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
CustomMinimumSize = (64, 64)
|
||||
HorizontalExpand = true,
|
||||
VerticalExpand = true,
|
||||
MinSize = (64, 64)
|
||||
};
|
||||
paddingBox.AddChild(new Control()
|
||||
{
|
||||
CustomMinimumSize = (4, 4),
|
||||
SizeFlagsVertical = SizeFlags.Fill
|
||||
MinSize = (4, 4),
|
||||
});
|
||||
paddingBox.AddChild(_number);
|
||||
|
||||
// padding to the left of the small icon
|
||||
var paddingBoxItemIcon = new HBoxContainer()
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
CustomMinimumSize = (64, 64)
|
||||
HorizontalExpand = true,
|
||||
VerticalExpand = true,
|
||||
MinSize = (64, 64)
|
||||
};
|
||||
paddingBoxItemIcon.AddChild(new Control()
|
||||
{
|
||||
CustomMinimumSize = (32, 32),
|
||||
SizeFlagsVertical = SizeFlags.Fill
|
||||
MinSize = (32, 32),
|
||||
});
|
||||
paddingBoxItemIcon.AddChild(new Control
|
||||
{
|
||||
|
||||
@@ -38,9 +38,18 @@ namespace Content.Client.UserInterface
|
||||
|
||||
var rootContainer = new TabContainer();
|
||||
|
||||
var patronsList = new ScrollContainer();
|
||||
var ss14ContributorsList = new ScrollContainer();
|
||||
var licensesList = new ScrollContainer();
|
||||
var patronsList = new ScrollContainer
|
||||
{
|
||||
HScrollEnabled = false
|
||||
};
|
||||
var ss14ContributorsList = new ScrollContainer
|
||||
{
|
||||
HScrollEnabled = false
|
||||
};
|
||||
var licensesList = new ScrollContainer
|
||||
{
|
||||
HScrollEnabled = false
|
||||
};
|
||||
|
||||
rootContainer.AddChild(ss14ContributorsList);
|
||||
rootContainer.AddChild(patronsList);
|
||||
@@ -56,14 +65,15 @@ namespace Content.Client.UserInterface
|
||||
|
||||
Contents.AddChild(rootContainer);
|
||||
|
||||
CustomMinimumSize = (650, 450);
|
||||
SetSize = (650, 650);
|
||||
}
|
||||
|
||||
private void PopulateLicenses(ScrollContainer licensesList)
|
||||
{
|
||||
var margin = new MarginContainer {MarginLeftOverride = 2, MarginTopOverride = 2};
|
||||
var vBox = new VBoxContainer();
|
||||
margin.AddChild(vBox);
|
||||
var vBox = new VBoxContainer
|
||||
{
|
||||
Margin = new Thickness(2, 2, 0, 0)
|
||||
};
|
||||
|
||||
foreach (var entry in CreditsManager.GetLicenses().OrderBy(p => p.Name))
|
||||
{
|
||||
@@ -77,14 +87,15 @@ namespace Content.Client.UserInterface
|
||||
}
|
||||
}
|
||||
|
||||
licensesList.AddChild(margin);
|
||||
licensesList.AddChild(vBox);
|
||||
}
|
||||
|
||||
private void PopulatePatronsList(Control patronsList)
|
||||
{
|
||||
var margin = new MarginContainer {MarginLeftOverride = 2, MarginTopOverride = 2};
|
||||
var vBox = new VBoxContainer();
|
||||
margin.AddChild(vBox);
|
||||
var vBox = new VBoxContainer
|
||||
{
|
||||
Margin = new Thickness(2, 2, 0, 0)
|
||||
};
|
||||
var patrons = LoadPatrons();
|
||||
|
||||
// Do not show "become a patron" button on Steam builds
|
||||
@@ -95,7 +106,7 @@ namespace Content.Client.UserInterface
|
||||
vBox.AddChild(patronButton = new Button
|
||||
{
|
||||
Text = "Become a Patron",
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter
|
||||
HorizontalAlignment = HAlignment.Center
|
||||
});
|
||||
|
||||
patronButton.OnPressed +=
|
||||
@@ -107,7 +118,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
if (!first)
|
||||
{
|
||||
vBox.AddChild(new Control {CustomMinimumSize = (0, 10)});
|
||||
vBox.AddChild(new Control {MinSize = (0, 10)});
|
||||
}
|
||||
|
||||
first = false;
|
||||
@@ -123,7 +134,7 @@ namespace Content.Client.UserInterface
|
||||
|
||||
|
||||
|
||||
patronsList.AddChild(margin);
|
||||
patronsList.AddChild(vBox);
|
||||
}
|
||||
|
||||
private IEnumerable<PatronEntry> LoadPatrons()
|
||||
@@ -140,17 +151,14 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
Button contributeButton;
|
||||
|
||||
var margin = new MarginContainer
|
||||
var vBox = new VBoxContainer
|
||||
{
|
||||
MarginLeftOverride = 2,
|
||||
MarginTopOverride = 2
|
||||
Margin = new Thickness(2, 2, 0, 0)
|
||||
};
|
||||
var vBox = new VBoxContainer();
|
||||
margin.AddChild(vBox);
|
||||
|
||||
vBox.AddChild(new HBoxContainer
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
|
||||
HorizontalAlignment = HAlignment.Center,
|
||||
SeparationOverride = 20,
|
||||
Children =
|
||||
{
|
||||
@@ -165,7 +173,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
if (!first)
|
||||
{
|
||||
vBox.AddChild(new Control {CustomMinimumSize = (0, 10)});
|
||||
vBox.AddChild(new Control {MinSize = (0, 10)});
|
||||
}
|
||||
|
||||
first = false;
|
||||
@@ -190,7 +198,7 @@ namespace Content.Client.UserInterface
|
||||
AddSection("Original Space Station 13 Remake Team", "OriginalRemake.txt");
|
||||
AddSection("Special Thanks", "SpecialThanks.txt", true);
|
||||
|
||||
contributorsList.AddChild(margin);
|
||||
contributorsList.AddChild(vBox);
|
||||
|
||||
contributeButton.OnPressed += _ =>
|
||||
IoCManager.Resolve<IUriOpener>().OpenUri(UILinks.GitHub);
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace Content.Client.UserInterface
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
RootControl = new LC();
|
||||
RootControl = new LC { Name = "AAAAAAAAAAAAAAAAAAAAAA"};
|
||||
LC.SetAnchorPreset(RootControl, LC.LayoutPreset.Wide);
|
||||
|
||||
var escapeTexture = _resourceCache.GetTexture("/Textures/Interface/hamburger.svg.192dpi.png");
|
||||
@@ -162,7 +162,7 @@ namespace Content.Client.UserInterface
|
||||
_buttonEscapeMenu = new TopButton(escapeTexture, EngineKeyFunctions.EscapeMenu, _inputManager)
|
||||
{
|
||||
ToolTip = Loc.GetString("Open escape menu."),
|
||||
CustomMinimumSize = (70, 64),
|
||||
MinSize = (70, 64),
|
||||
StyleClasses = {StyleBase.ButtonOpenRight}
|
||||
};
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace Content.Client.UserInterface
|
||||
_buttonCharacterMenu = new TopButton(characterTexture, ContentKeyFunctions.OpenCharacterMenu, _inputManager)
|
||||
{
|
||||
ToolTip = Loc.GetString("Open character menu."),
|
||||
CustomMinimumSize = topMinSize,
|
||||
MinSize = topMinSize,
|
||||
Visible = false,
|
||||
StyleClasses = {StyleBase.ButtonSquare}
|
||||
};
|
||||
@@ -187,7 +187,7 @@ namespace Content.Client.UserInterface
|
||||
_buttonInventoryMenu = new TopButton(inventoryTexture, ContentKeyFunctions.OpenInventoryMenu, _inputManager)
|
||||
{
|
||||
ToolTip = Loc.GetString("Open inventory menu."),
|
||||
CustomMinimumSize = topMinSize,
|
||||
MinSize = topMinSize,
|
||||
Visible = false,
|
||||
StyleClasses = {StyleBase.ButtonSquare}
|
||||
};
|
||||
@@ -200,7 +200,7 @@ namespace Content.Client.UserInterface
|
||||
_buttonCraftingMenu = new TopButton(craftingTexture, ContentKeyFunctions.OpenCraftingMenu, _inputManager)
|
||||
{
|
||||
ToolTip = Loc.GetString("Open crafting menu."),
|
||||
CustomMinimumSize = topMinSize,
|
||||
MinSize = topMinSize,
|
||||
Visible = false,
|
||||
StyleClasses = {StyleBase.ButtonSquare}
|
||||
};
|
||||
@@ -213,7 +213,7 @@ namespace Content.Client.UserInterface
|
||||
_buttonActionsMenu = new TopButton(actionsTexture, ContentKeyFunctions.OpenActionsMenu, _inputManager)
|
||||
{
|
||||
ToolTip = Loc.GetString("Open actions menu."),
|
||||
CustomMinimumSize = topMinSize,
|
||||
MinSize = topMinSize,
|
||||
Visible = false,
|
||||
StyleClasses = {StyleBase.ButtonSquare}
|
||||
};
|
||||
@@ -226,7 +226,7 @@ namespace Content.Client.UserInterface
|
||||
_buttonAdminMenu = new TopButton(adminTexture, ContentKeyFunctions.OpenAdminMenu, _inputManager)
|
||||
{
|
||||
ToolTip = Loc.GetString("Open admin menu."),
|
||||
CustomMinimumSize = topMinSize,
|
||||
MinSize = topMinSize,
|
||||
Visible = false,
|
||||
StyleClasses = {StyleBase.ButtonSquare}
|
||||
};
|
||||
@@ -239,7 +239,7 @@ namespace Content.Client.UserInterface
|
||||
_buttonSandboxMenu = new TopButton(sandboxTexture, ContentKeyFunctions.OpenSandboxWindow, _inputManager)
|
||||
{
|
||||
ToolTip = Loc.GetString("Open sandbox menu."),
|
||||
CustomMinimumSize = topMinSize,
|
||||
MinSize = topMinSize,
|
||||
Visible = false,
|
||||
StyleClasses = {StyleBase.ButtonSquare}
|
||||
};
|
||||
@@ -252,7 +252,7 @@ namespace Content.Client.UserInterface
|
||||
_buttonTutorial = new TopButton(tutorialTexture, ContentKeyFunctions.OpenTutorial, _inputManager)
|
||||
{
|
||||
ToolTip = Loc.GetString("Open tutorial."),
|
||||
CustomMinimumSize = topMinSize,
|
||||
MinSize = topMinSize,
|
||||
StyleClasses = {StyleBase.ButtonOpenLeft, TopButton.StyleClassRedTopButton},
|
||||
};
|
||||
|
||||
@@ -300,25 +300,25 @@ namespace Content.Client.UserInterface
|
||||
LC.SetMarginBottom(centerBottomContainer, -10f);
|
||||
RootControl.AddChild(centerBottomContainer);
|
||||
|
||||
HandsContainer = new MarginContainer
|
||||
HandsContainer = new Control
|
||||
{
|
||||
SizeFlagsVertical = Control.SizeFlags.ShrinkEnd
|
||||
VerticalAlignment = Control.VAlignment.Bottom,
|
||||
};
|
||||
RightInventoryQuickButtonContainer = new MarginContainer
|
||||
RightInventoryQuickButtonContainer = new Control
|
||||
{
|
||||
SizeFlagsVertical = Control.SizeFlags.ShrinkEnd
|
||||
VerticalAlignment = Control.VAlignment.Bottom,
|
||||
};
|
||||
LeftInventoryQuickButtonContainer = new MarginContainer
|
||||
LeftInventoryQuickButtonContainer = new Control
|
||||
{
|
||||
SizeFlagsVertical = Control.SizeFlags.ShrinkEnd
|
||||
VerticalAlignment = Control.VAlignment.Bottom,
|
||||
};
|
||||
centerBottomContainer.AddChild(LeftInventoryQuickButtonContainer);
|
||||
centerBottomContainer.AddChild(HandsContainer);
|
||||
centerBottomContainer.AddChild(RightInventoryQuickButtonContainer);
|
||||
|
||||
SuspicionContainer = new MarginContainer
|
||||
SuspicionContainer = new Control
|
||||
{
|
||||
SizeFlagsHorizontal = Control.SizeFlags.ShrinkCenter
|
||||
HorizontalAlignment = Control.HAlignment.Center
|
||||
};
|
||||
|
||||
RootControl.AddChild(SuspicionContainer);
|
||||
@@ -330,7 +330,7 @@ namespace Content.Client.UserInterface
|
||||
|
||||
_topNotificationContainer = new VBoxContainer
|
||||
{
|
||||
CustomMinimumSize = (600, 0)
|
||||
MinSize = (600, 0)
|
||||
};
|
||||
RootControl.AddChild(_topNotificationContainer);
|
||||
LC.SetAnchorPreset(_topNotificationContainer, LC.LayoutPreset.CenterTop);
|
||||
@@ -498,21 +498,21 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
Children =
|
||||
{
|
||||
new Control {CustomMinimumSize = (0, VertPad)},
|
||||
(_textureRect = new TextureRect
|
||||
{
|
||||
TextureScale = (0.5f, 0.5f),
|
||||
Texture = texture,
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
|
||||
SizeFlagsVertical = SizeFlags.Expand | SizeFlags.ShrinkCenter,
|
||||
HorizontalAlignment = HAlignment.Center,
|
||||
VerticalAlignment = VAlignment.Center,
|
||||
VerticalExpand = true,
|
||||
Margin = new Thickness(0, VertPad),
|
||||
ModulateSelfOverride = NormalColor,
|
||||
Stretch = TextureRect.StretchMode.KeepCentered
|
||||
}),
|
||||
new Control {CustomMinimumSize = (0, VertPad)},
|
||||
(_label = new Label
|
||||
{
|
||||
Text = ShortKeyName(_function),
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
|
||||
HorizontalAlignment = HAlignment.Center,
|
||||
ModulateSelfOverride = NormalColor,
|
||||
StyleClasses = {StyleClassLabelTopButton}
|
||||
})
|
||||
|
||||
@@ -54,41 +54,33 @@ namespace Content.Client.UserInterface
|
||||
|
||||
public class GhostTargetWindow : SS14Window
|
||||
{
|
||||
protected override Vector2? CustomSize => (300, 450);
|
||||
private readonly GhostComponent _owner;
|
||||
private readonly VBoxContainer _buttonContainer;
|
||||
|
||||
public GhostTargetWindow(GhostComponent owner)
|
||||
{
|
||||
MinSize = SetSize = (300, 450);
|
||||
Title = "Ghost Warp";
|
||||
_owner = owner;
|
||||
_owner.GhostRequestWarpPoint();
|
||||
_owner.GhostRequestPlayerNames();
|
||||
|
||||
var margin = new MarginContainer()
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
};
|
||||
|
||||
_buttonContainer = new VBoxContainer()
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
SizeFlagsHorizontal = SizeFlags.Fill,
|
||||
VerticalExpand = true,
|
||||
SeparationOverride = 5,
|
||||
|
||||
};
|
||||
|
||||
var scrollBarContainer = new ScrollContainer()
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand
|
||||
VerticalExpand = true,
|
||||
HorizontalExpand = true
|
||||
};
|
||||
|
||||
margin.AddChild(scrollBarContainer);
|
||||
scrollBarContainer.AddChild(_buttonContainer);
|
||||
|
||||
Contents.AddChild(margin);
|
||||
Contents.AddChild(scrollBarContainer);
|
||||
}
|
||||
|
||||
public void Populate()
|
||||
@@ -107,10 +99,10 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
Text = value,
|
||||
TextAlign = Label.AlignMode.Right,
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
|
||||
SizeFlagsVertical = SizeFlags.ShrinkCenter,
|
||||
HorizontalAlignment = HAlignment.Center,
|
||||
VerticalAlignment = VAlignment.Center,
|
||||
SizeFlagsStretchRatio = 1,
|
||||
CustomMinimumSize = (230, 20),
|
||||
MinSize = (230, 20),
|
||||
ClipText = true,
|
||||
};
|
||||
|
||||
@@ -131,10 +123,10 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
Text = $"Warp: {name}",
|
||||
TextAlign = Label.AlignMode.Right,
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
|
||||
SizeFlagsVertical = SizeFlags.ShrinkCenter,
|
||||
HorizontalAlignment = HAlignment.Center,
|
||||
VerticalAlignment = VAlignment.Center,
|
||||
SizeFlagsStretchRatio = 1,
|
||||
CustomMinimumSize = (230,20),
|
||||
MinSize = (230,20),
|
||||
ClipText = true,
|
||||
};
|
||||
|
||||
|
||||
@@ -63,7 +63,8 @@ namespace Content.Client.UserInterface
|
||||
public HumanoidCharacterProfile Profile;
|
||||
public event Action<HumanoidCharacterProfile> OnProfileChanged;
|
||||
|
||||
public HumanoidProfileEditor(IClientPreferencesManager preferencesManager, IPrototypeManager prototypeManager, IEntityManager entityManager)
|
||||
public HumanoidProfileEditor(IClientPreferencesManager preferencesManager, IPrototypeManager prototypeManager,
|
||||
IEntityManager entityManager)
|
||||
{
|
||||
_random = IoCManager.Resolve<IRobustRandom>();
|
||||
_prototypeManager = prototypeManager;
|
||||
@@ -74,17 +75,9 @@ namespace Content.Client.UserInterface
|
||||
AddChild(hbox);
|
||||
|
||||
#region Left
|
||||
var margin = new MarginContainer
|
||||
{
|
||||
MarginTopOverride = 10,
|
||||
MarginBottomOverride = 10,
|
||||
MarginLeftOverride = 10,
|
||||
MarginRightOverride = 10
|
||||
};
|
||||
hbox.AddChild(margin);
|
||||
|
||||
var vBox = new VBoxContainer();
|
||||
margin.AddChild(vBox);
|
||||
var vBox = new VBoxContainer {Margin = new Thickness(10)};
|
||||
hbox.AddChild(vBox);
|
||||
|
||||
var middleContainer = new HBoxContainer
|
||||
{
|
||||
@@ -116,13 +109,13 @@ namespace Content.Client.UserInterface
|
||||
var panel = HighlightedContainer();
|
||||
var hBox = new HBoxContainer
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand
|
||||
VerticalExpand = true
|
||||
};
|
||||
var nameLabel = new Label { Text = Loc.GetString("Name:") };
|
||||
var nameLabel = new Label {Text = Loc.GetString("Name:")};
|
||||
_nameEdit = new LineEdit
|
||||
{
|
||||
CustomMinimumSize = (270, 0),
|
||||
SizeFlagsVertical = SizeFlags.ShrinkCenter
|
||||
MinSize = (270, 0),
|
||||
VerticalAlignment = VAlignment.Center
|
||||
};
|
||||
_nameEdit.OnTextChanged += args => { SetName(args.Text); };
|
||||
var nameRandomButton = new Button
|
||||
@@ -139,7 +132,7 @@ namespace Content.Client.UserInterface
|
||||
|
||||
#endregion Name
|
||||
|
||||
var tabContainer = new TabContainer { SizeFlagsVertical = SizeFlags.FillExpand };
|
||||
var tabContainer = new TabContainer {VerticalExpand = true};
|
||||
vBox.AddChild(tabContainer);
|
||||
|
||||
#region Appearance
|
||||
@@ -161,7 +154,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
var panel = HighlightedContainer();
|
||||
var hBox = new HBoxContainer();
|
||||
var sexLabel = new Label { Text = Loc.GetString("Sex:") };
|
||||
var sexLabel = new Label {Text = Loc.GetString("Sex:")};
|
||||
|
||||
var sexButtonGroup = new ButtonGroup();
|
||||
|
||||
@@ -209,8 +202,8 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
var panel = HighlightedContainer();
|
||||
var hBox = new HBoxContainer();
|
||||
var ageLabel = new Label { Text = Loc.GetString("Age:") };
|
||||
_ageEdit = new LineEdit { CustomMinimumSize = (40, 0) };
|
||||
var ageLabel = new Label {Text = Loc.GetString("Age:")};
|
||||
_ageEdit = new LineEdit {MinSize = (40, 0)};
|
||||
_ageEdit.OnTextChanged += args =>
|
||||
{
|
||||
if (!int.TryParse(args.Text, out var newAge))
|
||||
@@ -230,7 +223,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
var panel = HighlightedContainer();
|
||||
var hBox = new HBoxContainer();
|
||||
var genderLabel = new Label { Text = Loc.GetString("Pronouns:") };
|
||||
var genderLabel = new Label {Text = Loc.GetString("Pronouns:")};
|
||||
|
||||
_genderButton = new OptionButton();
|
||||
|
||||
@@ -257,7 +250,7 @@ namespace Content.Client.UserInterface
|
||||
|
||||
{
|
||||
var panel = HighlightedContainer();
|
||||
panel.SizeFlagsHorizontal = SizeFlags.None;
|
||||
panel.HorizontalAlignment = HAlignment.Left;
|
||||
var hairHBox = new HBoxContainer();
|
||||
|
||||
_hairPicker = new HairStylePicker();
|
||||
@@ -316,7 +309,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
var panel = HighlightedContainer();
|
||||
var hBox = new HBoxContainer();
|
||||
var clothingLabel = new Label { Text = Loc.GetString("Clothing:") };
|
||||
var clothingLabel = new Label {Text = Loc.GetString("Clothing:")};
|
||||
|
||||
_clothingButton = new OptionButton();
|
||||
|
||||
@@ -342,7 +335,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
var panel = HighlightedContainer();
|
||||
var hBox = new HBoxContainer();
|
||||
var backpackLabel = new Label { Text = Loc.GetString("Backpack:") };
|
||||
var backpackLabel = new Label {Text = Loc.GetString("Backpack:")};
|
||||
|
||||
_backpackButton = new OptionButton();
|
||||
|
||||
@@ -379,7 +372,7 @@ namespace Content.Client.UserInterface
|
||||
(_preferenceUnavailableButton = new OptionButton()),
|
||||
new ScrollContainer
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
Children =
|
||||
{
|
||||
jobList
|
||||
@@ -433,7 +426,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
category.AddChild(new Control
|
||||
{
|
||||
CustomMinimumSize = new Vector2(0, 23),
|
||||
MinSize = new Vector2(0, 23),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -498,7 +491,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
new ScrollContainer
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
Children =
|
||||
{
|
||||
antagList
|
||||
@@ -519,6 +512,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var selector = new AntagPreferenceSelector(antag);
|
||||
antagList.AddChild(selector);
|
||||
_antagPreferences.Add(selector);
|
||||
@@ -568,7 +562,7 @@ namespace Content.Client.UserInterface
|
||||
_saveButton = new Button
|
||||
{
|
||||
Text = Loc.GetString("Save"),
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter
|
||||
HorizontalAlignment = HAlignment.Center
|
||||
};
|
||||
_saveButton.OnPressed += args => { Save(); };
|
||||
panel.AddChild(_saveButton);
|
||||
@@ -581,19 +575,10 @@ namespace Content.Client.UserInterface
|
||||
|
||||
#region Right
|
||||
|
||||
margin = new MarginContainer
|
||||
{
|
||||
MarginTopOverride = 10,
|
||||
MarginBottomOverride = 10,
|
||||
MarginLeftOverride = 10,
|
||||
MarginRightOverride = 10
|
||||
};
|
||||
hbox.AddChild(margin);
|
||||
|
||||
vBox = new VBoxContainer()
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
HorizontalExpand = true,
|
||||
};
|
||||
hbox.AddChild(vBox);
|
||||
|
||||
@@ -605,8 +590,7 @@ namespace Content.Client.UserInterface
|
||||
// Front
|
||||
var box = new Control()
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.Fill,
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
SizeFlagsStretchRatio = 1f,
|
||||
};
|
||||
vBox.AddChild(box);
|
||||
@@ -615,7 +599,7 @@ namespace Content.Client.UserInterface
|
||||
Sprite = sprite,
|
||||
Scale = (6, 6),
|
||||
OverrideDirection = Direction.South,
|
||||
SizeFlagsVertical = SizeFlags.ShrinkCenter,
|
||||
VerticalAlignment = VAlignment.Center,
|
||||
SizeFlagsStretchRatio = 1
|
||||
};
|
||||
box.AddChild(_previewSprite);
|
||||
@@ -623,8 +607,7 @@ namespace Content.Client.UserInterface
|
||||
// Side
|
||||
box = new Control()
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.Fill,
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
SizeFlagsStretchRatio = 1f,
|
||||
};
|
||||
vBox.AddChild(box);
|
||||
@@ -633,7 +616,7 @@ namespace Content.Client.UserInterface
|
||||
Sprite = sprite,
|
||||
Scale = (6, 6),
|
||||
OverrideDirection = Direction.East,
|
||||
SizeFlagsVertical = SizeFlags.ShrinkCenter,
|
||||
VerticalAlignment = VAlignment.Center,
|
||||
SizeFlagsStretchRatio = 1
|
||||
};
|
||||
box.AddChild(_previewSpriteSide);
|
||||
@@ -862,7 +845,8 @@ namespace Content.Client.UserInterface
|
||||
|
||||
if (job.Icon != null)
|
||||
{
|
||||
var specifier = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Interface/Misc/job_icons.rsi"), job.Icon);
|
||||
var specifier = new SpriteSpecifier.Rsi(new ResourcePath("/Textures/Interface/Misc/job_icons.rsi"),
|
||||
job.Icon);
|
||||
icon.Texture = specifier.Frame0();
|
||||
}
|
||||
|
||||
@@ -871,7 +855,7 @@ namespace Content.Client.UserInterface
|
||||
Children =
|
||||
{
|
||||
icon,
|
||||
new Label {Text = job.Name, CustomMinimumSize = (175, 0)},
|
||||
new Label {Text = job.Name, MinSize = (175, 0)},
|
||||
_optionButton
|
||||
}
|
||||
});
|
||||
@@ -918,6 +902,7 @@ namespace Content.Client.UserInterface
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void OnCheckBoxToggled(BaseButton.ButtonToggledEventArgs args)
|
||||
{
|
||||
PreferenceChanged?.Invoke(Preference);
|
||||
|
||||
@@ -8,7 +8,7 @@ using Robust.Shared.Maths;
|
||||
|
||||
namespace Content.Client.UserInterface
|
||||
{
|
||||
public class ItemSlotButton : MarginContainer
|
||||
public class ItemSlotButton : Control
|
||||
{
|
||||
private const string HighlightShader = "SelectionOutlineInrange";
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Content.Client.UserInterface
|
||||
|
||||
public ItemSlotButton(Texture texture, Texture storageTexture)
|
||||
{
|
||||
CustomMinimumSize = (64, 64);
|
||||
MinSize = (64, 64);
|
||||
|
||||
AddChild(Button = new TextureRect
|
||||
{
|
||||
@@ -41,7 +41,7 @@ namespace Content.Client.UserInterface
|
||||
AddChild(_highlightRect = new PanelContainer
|
||||
{
|
||||
StyleClasses = { StyleNano.StyleClassHandSlotHighlight },
|
||||
CustomMinimumSize = (32, 32),
|
||||
MinSize = (32, 32),
|
||||
Visible = false
|
||||
});
|
||||
|
||||
@@ -63,8 +63,8 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
TextureNormal = storageTexture,
|
||||
Scale = (0.75f, 0.75f),
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkEnd,
|
||||
SizeFlagsVertical = SizeFlags.ShrinkEnd,
|
||||
HorizontalAlignment = HAlignment.Right,
|
||||
VerticalAlignment = VAlignment.Bottom,
|
||||
Visible = false,
|
||||
});
|
||||
|
||||
@@ -92,8 +92,6 @@ namespace Content.Client.UserInterface
|
||||
|
||||
AddChild(CooldownDisplay = new CooldownGraphic
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.Fill,
|
||||
SizeFlagsVertical = SizeFlags.Fill,
|
||||
Visible = false,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -64,7 +64,10 @@ namespace Content.Client.UserInterface
|
||||
}
|
||||
}
|
||||
});
|
||||
SizeFlagsVertical = SizeFlags.ShrinkEnd;
|
||||
VerticalAlignment = VAlignment.Bottom;
|
||||
|
||||
// TODO: Depending on if its a two-hand panel or not
|
||||
MinSize = (150, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -156,11 +159,5 @@ namespace Content.Client.UserInterface
|
||||
_activeStatusComponents.Add((statusComponent, control));
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Depending on if its a two-hand panel or not
|
||||
protected override Vector2 CalculateMinimumSize()
|
||||
{
|
||||
return Vector2.ComponentMax(base.CalculateMinimumSize(), (150, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,8 +24,6 @@ namespace Content.Client.UserInterface
|
||||
[Dependency] private readonly IClientConsoleHost _consoleHost = default!;
|
||||
[Dependency] private readonly IClientGameTicker _gameTicker = default!;
|
||||
|
||||
protected override Vector2? CustomSize => (360, 560);
|
||||
|
||||
public event Action<string> SelectedId;
|
||||
|
||||
private readonly Dictionary<string, JobButton> _jobButtons = new();
|
||||
@@ -33,6 +31,7 @@ namespace Content.Client.UserInterface
|
||||
|
||||
public LateJoinGui()
|
||||
{
|
||||
MinSize = SetSize = (360, 560);
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
Title = Loc.GetString("Late Join");
|
||||
@@ -44,7 +43,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
new ScrollContainer
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
Children =
|
||||
{
|
||||
jobList
|
||||
@@ -77,7 +76,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
category.AddChild(new Control
|
||||
{
|
||||
CustomMinimumSize = new Vector2(0, 23),
|
||||
MinSize = new Vector2(0, 23),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -104,7 +103,7 @@ namespace Content.Client.UserInterface
|
||||
|
||||
var jobSelector = new HBoxContainer
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand
|
||||
HorizontalExpand = true
|
||||
};
|
||||
|
||||
var icon = new TextureRect
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace Content.Client.UserInterface
|
||||
CharacterSetupButton = new Button
|
||||
{
|
||||
Text = Loc.GetString("Customize"),
|
||||
SizeFlagsHorizontal = SizeFlags.None
|
||||
HorizontalAlignment = HAlignment.Left
|
||||
};
|
||||
|
||||
_summaryLabel = new Label();
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<PanelContainer StyleClasses="AngleRect" />
|
||||
<VBoxContainer>
|
||||
<!-- Top row -->
|
||||
<HBoxContainer CustomMinimumSize="0 40">
|
||||
<HBoxContainer MinSize="0 40">
|
||||
<MarginContainer MarginLeftOverride="8">
|
||||
<Label StyleClasses="LabelHeadingBigger" VAlign="Center" Text="{Loc 'Lobby'}" />
|
||||
</MarginContainer>
|
||||
@@ -30,9 +30,9 @@
|
||||
</PanelContainer.PanelOverride>
|
||||
</PanelContainer>
|
||||
<!-- Middle section with the two vertical panels -->
|
||||
<HBoxContainer SizeFlagsVertical="FillExpand">
|
||||
<HBoxContainer VerticalExpand="True">
|
||||
<!-- Left panel -->
|
||||
<VBoxContainer Name="CLeftPanelContainer" SizeFlagsHorizontal="FillExpand">
|
||||
<VBoxContainer Name="CLeftPanelContainer" HorizontalExpand="True">
|
||||
<cui:StripeBack>
|
||||
<MarginContainer MarginLeftOverride="3" MarginRightOverride="3" MarginBottomOverride="3"
|
||||
MarginTopOverride="3">
|
||||
@@ -40,39 +40,39 @@
|
||||
<Button Name="CObserveButton" Text="{Loc 'Observe'}" StyleClasses="ButtonBig" />
|
||||
<Label Name="CStartTime" Align="Right"
|
||||
FontColorOverride="{x:Static maths:Color.DarkGray}"
|
||||
StyleClasses="LabelBig" SizeFlagsHorizontal="FillExpand" />
|
||||
StyleClasses="LabelBig" HorizontalExpand="True" />
|
||||
<Button Name="CReadyButton" ToggleMode="True" Text="{Loc 'Ready Up'}"
|
||||
StyleClasses="ButtonBig" />
|
||||
</HBoxContainer>
|
||||
</MarginContainer>
|
||||
</cui:StripeBack>
|
||||
<MarginContainer SizeFlagsVertical="FillExpand" MarginLeftOverride="3" MarginRightOverride="3"
|
||||
<MarginContainer VerticalExpand="True" MarginLeftOverride="3" MarginRightOverride="3"
|
||||
MarginBottomOverride="3"
|
||||
MarginTopOverride="3">
|
||||
<chat:ChatBox Name="CChat" />
|
||||
</MarginContainer>
|
||||
</VBoxContainer>
|
||||
<!-- Gold line -->
|
||||
<PanelContainer CustomMinimumSize="2 0">
|
||||
<PanelContainer MinSize="2 0">
|
||||
<PanelContainer.PanelOverride>
|
||||
<gfx:StyleBoxFlat BackgroundColor="{x:Static style:StyleNano.NanoGold}" />
|
||||
</PanelContainer.PanelOverride>
|
||||
</PanelContainer>
|
||||
<!-- Right panel -->
|
||||
<Control SizeFlagsHorizontal="FillExpand">
|
||||
<Control HorizontalExpand="True">
|
||||
<VBoxContainer>
|
||||
<!-- Player list -->
|
||||
<cui:NanoHeading Text="{Loc 'Online Players'}" />
|
||||
<MarginContainer SizeFlagsVertical="FillExpand"
|
||||
<MarginContainer VerticalExpand="True"
|
||||
MarginRightOverride="3" MarginLeftOverride="3"
|
||||
MarginBottomOverride="3" MarginTopOverride="3">
|
||||
<cui:LobbyPlayerList Name="COnlinePlayerList"
|
||||
SizeFlagsHorizontal="FillExpand"
|
||||
SizeFlagsVertical="FillExpand" />
|
||||
HorizontalExpand="True"
|
||||
VerticalExpand="True" />
|
||||
</MarginContainer>
|
||||
<!-- Server info -->
|
||||
<cui:NanoHeading Text="{Loc 'Server Info'}" />
|
||||
<MarginContainer SizeFlagsVertical="FillExpand"
|
||||
<MarginContainer VerticalExpand="True"
|
||||
MarginRightOverride="3" MarginLeftOverride="3"
|
||||
MarginBottomOverride="2" MarginTopOverride="3">
|
||||
<cui:ServerInfo Name="CServerInfo" />
|
||||
|
||||
@@ -30,13 +30,14 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
ServerName.SizeFlagsHorizontal = SizeFlags.Expand | SizeFlags.ShrinkCenter;
|
||||
ServerName.HorizontalExpand = true;
|
||||
ServerName.HorizontalAlignment = HAlignment.Center;
|
||||
|
||||
CharacterPreview = new LobbyCharacterPreviewPanel(
|
||||
entityManager,
|
||||
preferencesManager)
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.None
|
||||
HorizontalAlignment = HAlignment.Left
|
||||
};
|
||||
|
||||
CLeftPanelContainer.AddChild(CharacterPreview);
|
||||
@@ -67,7 +68,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
var hbox = new HBoxContainer
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
};
|
||||
|
||||
// Player Name
|
||||
@@ -88,7 +89,7 @@ namespace Content.Client.UserInterface
|
||||
Text = name
|
||||
}
|
||||
},
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand
|
||||
HorizontalExpand = true
|
||||
});
|
||||
// Status
|
||||
hbox.AddChild(new PanelContainer()
|
||||
@@ -108,7 +109,7 @@ namespace Content.Client.UserInterface
|
||||
Text = status
|
||||
}
|
||||
},
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
SizeFlagsStretchRatio = 0.2f,
|
||||
});
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Content.Client.UserInterface
|
||||
};
|
||||
AddChild(_panel);
|
||||
|
||||
SizeFlagsHorizontal = SizeFlags.None;
|
||||
HorizontalAlignment = HAlignment.Left;
|
||||
}
|
||||
|
||||
public string Text
|
||||
@@ -28,15 +28,5 @@ namespace Content.Client.UserInterface
|
||||
get => _label.Text;
|
||||
set => _label.Text = value;
|
||||
}
|
||||
|
||||
protected override Vector2 CalculateMinimumSize()
|
||||
{
|
||||
return _panel.CombinedMinimumSize;
|
||||
}
|
||||
|
||||
protected override void LayoutUpdateOverride()
|
||||
{
|
||||
FitChildInBox(_panel, SizeBox);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Shared;
|
||||
using Robust.Shared.Configuration;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Maths;
|
||||
|
||||
namespace Content.Client.UserInterface
|
||||
{
|
||||
@@ -27,20 +28,24 @@ namespace Content.Client.UserInterface
|
||||
|
||||
var vBox = new VBoxContainer();
|
||||
|
||||
var contents = new VBoxContainer();
|
||||
var contents = new VBoxContainer
|
||||
{
|
||||
Margin = new Thickness(2, 2, 2, 0),
|
||||
VerticalExpand = true,
|
||||
};
|
||||
|
||||
MasterVolumeSlider = new Slider
|
||||
{
|
||||
MinValue = 0.0f,
|
||||
MaxValue = 100.0f,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
CustomMinimumSize = (80, 8),
|
||||
HorizontalExpand = true,
|
||||
MinSize = (80, 8),
|
||||
Rounded = true
|
||||
};
|
||||
|
||||
MasterVolumeLabel = new Label
|
||||
{
|
||||
CustomMinimumSize = (48, 0),
|
||||
MinSize = (48, 0),
|
||||
Align = Label.AlignMode.Right
|
||||
};
|
||||
|
||||
@@ -48,20 +53,20 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
Children =
|
||||
{
|
||||
new Control {CustomMinimumSize = (4, 0)},
|
||||
new Control {MinSize = (4, 0)},
|
||||
new Label {Text = Loc.GetString("Master Volume:")},
|
||||
new Control {CustomMinimumSize = (8, 0)},
|
||||
new Control {MinSize = (8, 0)},
|
||||
MasterVolumeSlider,
|
||||
new Control {CustomMinimumSize = (8, 0)},
|
||||
new Control {MinSize = (8, 0)},
|
||||
MasterVolumeLabel,
|
||||
new Control { CustomMinimumSize = (4, 0) },
|
||||
new Control { MinSize = (4, 0) },
|
||||
}
|
||||
});
|
||||
|
||||
ApplyButton = new Button
|
||||
{
|
||||
Text = Loc.GetString("Apply"), TextAlign = Label.AlignMode.Center,
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkEnd
|
||||
HorizontalAlignment = HAlignment.Right
|
||||
};
|
||||
|
||||
vBox.AddChild(new Label
|
||||
@@ -71,23 +76,13 @@ namespace Content.Client.UserInterface
|
||||
StyleClasses = { StyleNano.StyleClassLabelKeyText }
|
||||
});
|
||||
|
||||
vBox.AddChild(new MarginContainer
|
||||
{
|
||||
MarginLeftOverride = 2,
|
||||
MarginTopOverride = 2,
|
||||
MarginRightOverride = 2,
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
Children =
|
||||
{
|
||||
contents
|
||||
}
|
||||
});
|
||||
vBox.AddChild(contents);
|
||||
|
||||
ResetButton = new Button
|
||||
{
|
||||
Text = Loc.GetString("Reset all"),
|
||||
StyleClasses = { StyleBase.ButtonCaution },
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkEnd
|
||||
HorizontalAlignment = HAlignment.Right
|
||||
};
|
||||
|
||||
vBox.AddChild(new StripeBack
|
||||
@@ -99,12 +94,12 @@ namespace Content.Client.UserInterface
|
||||
new HBoxContainer
|
||||
{
|
||||
Align = BoxContainer.AlignMode.End,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
VerticalExpand = true,
|
||||
Children =
|
||||
{
|
||||
ResetButton,
|
||||
new Control { CustomMinimumSize = (2, 0) },
|
||||
new Control { MinSize = (2, 0) },
|
||||
ApplyButton
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,11 @@ namespace Content.Client.UserInterface
|
||||
_cfg = cfg;
|
||||
var vBox = new VBoxContainer();
|
||||
|
||||
var contents = new VBoxContainer();
|
||||
var contents = new VBoxContainer
|
||||
{
|
||||
Margin = new Thickness(2, 2, 2, 0),
|
||||
VerticalExpand = true,
|
||||
};
|
||||
|
||||
VSyncCheckBox = new CheckBox {Text = Loc.GetString("VSync")};
|
||||
contents.AddChild(VSyncCheckBox);
|
||||
@@ -48,7 +52,7 @@ namespace Content.Client.UserInterface
|
||||
contents.AddChild(FullscreenCheckBox);
|
||||
FullscreenCheckBox.OnToggled += OnCheckBoxToggled;
|
||||
|
||||
LightingPresetOption = new OptionButton {CustomMinimumSize = (100, 0)};
|
||||
LightingPresetOption = new OptionButton {MinSize = (100, 0)};
|
||||
LightingPresetOption.AddItem(Loc.GetString("Very Low"));
|
||||
LightingPresetOption.AddItem(Loc.GetString("Low"));
|
||||
LightingPresetOption.AddItem(Loc.GetString("Medium"));
|
||||
@@ -60,7 +64,7 @@ namespace Content.Client.UserInterface
|
||||
Children =
|
||||
{
|
||||
new Label {Text = Loc.GetString("Lighting Quality:")},
|
||||
new Control {CustomMinimumSize = (4, 0)},
|
||||
new Control {MinSize = (4, 0)},
|
||||
LightingPresetOption
|
||||
}
|
||||
});
|
||||
@@ -68,7 +72,7 @@ namespace Content.Client.UserInterface
|
||||
ApplyButton = new Button
|
||||
{
|
||||
Text = Loc.GetString("Apply"), TextAlign = Label.AlignMode.Center,
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkEnd
|
||||
HorizontalAlignment = HAlignment.Right
|
||||
};
|
||||
|
||||
var resourceCache = IoCManager.Resolve<IResourceCache>();
|
||||
@@ -88,28 +92,18 @@ namespace Content.Client.UserInterface
|
||||
Children =
|
||||
{
|
||||
new Label {Text = Loc.GetString("UI Scale:")},
|
||||
new Control {CustomMinimumSize = (4, 0)},
|
||||
new Control {MinSize = (4, 0)},
|
||||
_uiScaleOption
|
||||
}
|
||||
});
|
||||
|
||||
contents.AddChild(new Placeholder(resourceCache)
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
PlaceholderText = "Viewport settings"
|
||||
});
|
||||
|
||||
vBox.AddChild(new MarginContainer
|
||||
{
|
||||
MarginLeftOverride = 2,
|
||||
MarginTopOverride = 2,
|
||||
MarginRightOverride = 2,
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
Children =
|
||||
{
|
||||
contents
|
||||
}
|
||||
});
|
||||
vBox.AddChild(contents);
|
||||
|
||||
vBox.AddChild(new StripeBack
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@ using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Shared.Input;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
@@ -39,25 +40,15 @@ namespace Content.Client.UserInterface
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
Button resetAllButton;
|
||||
var vBox = new VBoxContainer();
|
||||
var vBox = new VBoxContainer {Margin = new Thickness(2, 0, 0, 0)};
|
||||
AddChild(new VBoxContainer
|
||||
{
|
||||
Children =
|
||||
{
|
||||
new ScrollContainer
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
Children =
|
||||
{
|
||||
new MarginContainer
|
||||
{
|
||||
MarginLeftOverride = 2,
|
||||
Children =
|
||||
{
|
||||
vBox
|
||||
}
|
||||
}
|
||||
}
|
||||
VerticalExpand = true,
|
||||
Children = {vBox}
|
||||
},
|
||||
|
||||
new StripeBack
|
||||
@@ -70,7 +61,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
Children =
|
||||
{
|
||||
new Control {CustomMinimumSize = (2, 0)},
|
||||
new Control {MinSize = (2, 0)},
|
||||
new Label
|
||||
{
|
||||
StyleClasses = {StyleBase.StyleClassLabelSubText},
|
||||
@@ -80,7 +71,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
Text = "Reset ALL keybinds",
|
||||
StyleClasses = {StyleBase.ButtonCaution},
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkEnd | SizeFlags.Expand
|
||||
HorizontalAlignment = HAlignment.Right
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -89,7 +80,7 @@ namespace Content.Client.UserInterface
|
||||
}
|
||||
});
|
||||
|
||||
resetAllButton.OnPressed += args =>
|
||||
resetAllButton.OnPressed += _ =>
|
||||
{
|
||||
_deferCommands.Add(() =>
|
||||
{
|
||||
@@ -104,7 +95,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
if (!first)
|
||||
{
|
||||
vBox.AddChild(new Control {CustomMinimumSize = (0, 8)});
|
||||
vBox.AddChild(new Control {MinSize = (0, 8)});
|
||||
}
|
||||
|
||||
first = false;
|
||||
@@ -409,22 +400,23 @@ namespace Content.Client.UserInterface
|
||||
var name = new Label
|
||||
{
|
||||
Text = Loc.GetString(niceName),
|
||||
SizeFlagsHorizontal = SizeFlags.Expand
|
||||
HorizontalExpand = true,
|
||||
HorizontalAlignment = HAlignment.Left
|
||||
};
|
||||
|
||||
BindButton1 = new BindButton(parent, this, StyleBase.ButtonOpenRight);
|
||||
BindButton2 = new BindButton(parent, this, StyleBase.ButtonOpenLeft);
|
||||
ResetButton = new Button {Text = "Reset", StyleClasses = {StyleBase.ButtonCaution}};
|
||||
ResetButton = new Button {Text = Loc.GetString("Reset"), StyleClasses = {StyleBase.ButtonCaution}};
|
||||
|
||||
var hBox = new HBoxContainer
|
||||
{
|
||||
Children =
|
||||
{
|
||||
new Control {CustomMinimumSize = (5, 0)},
|
||||
new Control {MinSize = (5, 0)},
|
||||
name,
|
||||
BindButton1,
|
||||
BindButton2,
|
||||
new Control {CustomMinimumSize = (10, 0)},
|
||||
new Control {MinSize = (10, 0)},
|
||||
ResetButton
|
||||
}
|
||||
};
|
||||
@@ -464,7 +456,7 @@ namespace Content.Client.UserInterface
|
||||
|
||||
Button.OnKeyBindDown += ButtonOnOnKeyBindDown;
|
||||
|
||||
CustomMinimumSize = (200, 0);
|
||||
MinSize = (200, 0);
|
||||
}
|
||||
|
||||
private void ButtonOnOnKeyBindDown(GUIBoundKeyEventArgs args)
|
||||
|
||||
@@ -15,10 +15,9 @@ namespace Content.Client.UserInterface
|
||||
[Dependency] private readonly IConfigurationManager _configManager = default!;
|
||||
[Dependency] private readonly IClydeAudio _clydeAudio = default!;
|
||||
|
||||
protected override Vector2? CustomSize => (800, 450);
|
||||
|
||||
public OptionsMenu()
|
||||
{
|
||||
SetSize = MinSize = (800, 450);
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
Title = Loc.GetString("Game Options");
|
||||
|
||||
@@ -53,6 +53,7 @@ namespace Content.Client.ParticleAccelerator
|
||||
|
||||
public ParticleAcceleratorControlMenu(ParticleAcceleratorBoundUserInterface owner)
|
||||
{
|
||||
SetSize = (400, 300);
|
||||
_greyScaleShader = IoCManager.Resolve<IPrototypeManager>().Index<ShaderPrototype>("Greyscale").Instance();
|
||||
|
||||
Owner = owner;
|
||||
@@ -128,13 +129,14 @@ namespace Content.Client.ParticleAccelerator
|
||||
var closeButton = new TextureButton
|
||||
{
|
||||
StyleClasses = {"windowCloseButton"},
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkEnd
|
||||
HorizontalAlignment = HAlignment.Right,
|
||||
Margin = new Thickness(0, 0, 8, 0)
|
||||
};
|
||||
closeButton.OnPressed += args => Close();
|
||||
|
||||
var serviceManual = new Label
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
|
||||
HorizontalAlignment = HAlignment.Center,
|
||||
StyleClasses = {StyleBase.StyleClassLabelSubText},
|
||||
Text = Loc.GetString("Refer to p.132 of service manual")
|
||||
};
|
||||
@@ -144,10 +146,9 @@ namespace Content.Client.ParticleAccelerator
|
||||
{
|
||||
Children =
|
||||
{
|
||||
new MarginContainer
|
||||
new Control
|
||||
{
|
||||
MarginLeftOverride = 2,
|
||||
MarginTopOverride = 2,
|
||||
Margin = new Thickness(2, 2, 0, 0),
|
||||
Children =
|
||||
{
|
||||
new Label
|
||||
@@ -156,185 +157,154 @@ namespace Content.Client.ParticleAccelerator
|
||||
FontOverride = font,
|
||||
FontColorOverride = StyleNano.NanoGold,
|
||||
},
|
||||
new MarginContainer
|
||||
{
|
||||
MarginRightOverride = 8,
|
||||
Children =
|
||||
{
|
||||
closeButton
|
||||
}
|
||||
}
|
||||
closeButton
|
||||
}
|
||||
},
|
||||
new PanelContainer
|
||||
{
|
||||
PanelOverride = new StyleBoxFlat {BackgroundColor = StyleNano.NanoGold},
|
||||
CustomMinimumSize = (0, 2),
|
||||
MinSize = (0, 2),
|
||||
},
|
||||
new Control
|
||||
{
|
||||
CustomMinimumSize = (0, 4)
|
||||
MinSize = (0, 4)
|
||||
},
|
||||
|
||||
new HBoxContainer
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
Children =
|
||||
{
|
||||
new MarginContainer
|
||||
new VBoxContainer
|
||||
{
|
||||
MarginLeftOverride = 4,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
Margin = new Thickness(4, 0, 0, 0),
|
||||
HorizontalExpand = true,
|
||||
Children =
|
||||
{
|
||||
new VBoxContainer
|
||||
new HBoxContainer
|
||||
{
|
||||
Children =
|
||||
{
|
||||
new HBoxContainer
|
||||
new Label
|
||||
{
|
||||
Children =
|
||||
{
|
||||
new Label
|
||||
{
|
||||
Text = Loc.GetString("Power: "),
|
||||
SizeFlagsHorizontal = SizeFlags.Expand
|
||||
},
|
||||
_offButton,
|
||||
_onButton
|
||||
}
|
||||
Text = Loc.GetString("Power: "),
|
||||
HorizontalExpand = true,
|
||||
HorizontalAlignment = HAlignment.Left,
|
||||
},
|
||||
new HBoxContainer
|
||||
{
|
||||
Children =
|
||||
{
|
||||
new Label
|
||||
{
|
||||
Text = Loc.GetString("Strength: "),
|
||||
SizeFlagsHorizontal = SizeFlags.Expand
|
||||
},
|
||||
_stateSpinBox
|
||||
}
|
||||
},
|
||||
new Control
|
||||
{
|
||||
CustomMinimumSize = (0, 10),
|
||||
},
|
||||
_drawLabel,
|
||||
new Control
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.Expand
|
||||
},
|
||||
(_alarmControl = new VBoxContainer
|
||||
{
|
||||
Children =
|
||||
{
|
||||
new Label
|
||||
{
|
||||
Text = Loc.GetString("PARTICLE STRENGTH\nLIMITER FAILURE"),
|
||||
FontColorOverride = Color.Red,
|
||||
Align = Label.AlignMode.Center
|
||||
},
|
||||
serviceManual
|
||||
}
|
||||
}),
|
||||
_offButton,
|
||||
_onButton
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
new MarginContainer
|
||||
{
|
||||
CustomMinimumSize = (186, 0),
|
||||
Children =
|
||||
{
|
||||
new VBoxContainer
|
||||
},
|
||||
new HBoxContainer
|
||||
{
|
||||
Children =
|
||||
{
|
||||
(_statusLabel = new Label
|
||||
new Label
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter
|
||||
}),
|
||||
new Control
|
||||
{
|
||||
CustomMinimumSize = (0, 20)
|
||||
Text = Loc.GetString("Strength: "),
|
||||
HorizontalExpand = true,
|
||||
HorizontalAlignment = HAlignment.Left,
|
||||
},
|
||||
new PanelContainer
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
|
||||
PanelOverride = back2,
|
||||
Children =
|
||||
{
|
||||
new GridContainer
|
||||
{
|
||||
Columns = 3,
|
||||
VSeparationOverride = 0,
|
||||
HSeparationOverride = 0,
|
||||
Children =
|
||||
{
|
||||
new Control {CustomMinimumSize = imgSize},
|
||||
(_endCapTexture = Segment("end_cap")),
|
||||
new Control {CustomMinimumSize = imgSize},
|
||||
(_controlBoxTexture = Segment("control_box")),
|
||||
(_fuelChamberTexture = Segment("fuel_chamber")),
|
||||
new Control {CustomMinimumSize = imgSize},
|
||||
new Control {CustomMinimumSize = imgSize},
|
||||
(_powerBoxTexture = Segment("power_box")),
|
||||
new Control {CustomMinimumSize = imgSize},
|
||||
(_emitterLeftTexture = Segment("emitter_left")),
|
||||
(_emitterCenterTexture = Segment("emitter_center")),
|
||||
(_emitterRightTexture = Segment("emitter_right")),
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
(_scanButton = new Button
|
||||
{
|
||||
Text = Loc.GetString("Scan Parts"),
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter
|
||||
})
|
||||
_stateSpinBox
|
||||
}
|
||||
}
|
||||
},
|
||||
new Control
|
||||
{
|
||||
MinSize = (0, 10),
|
||||
},
|
||||
_drawLabel,
|
||||
new Control
|
||||
{
|
||||
VerticalExpand = true,
|
||||
},
|
||||
(_alarmControl = new VBoxContainer
|
||||
{
|
||||
Children =
|
||||
{
|
||||
new Label
|
||||
{
|
||||
Text = Loc.GetString("PARTICLE STRENGTH\nLIMITER FAILURE"),
|
||||
FontColorOverride = Color.Red,
|
||||
Align = Label.AlignMode.Center
|
||||
},
|
||||
serviceManual
|
||||
}
|
||||
}),
|
||||
}
|
||||
},
|
||||
new VBoxContainer
|
||||
{
|
||||
MinSize = (186, 0),
|
||||
Children =
|
||||
{
|
||||
(_statusLabel = new Label
|
||||
{
|
||||
HorizontalAlignment = HAlignment.Center
|
||||
}),
|
||||
new Control
|
||||
{
|
||||
MinSize = (0, 20)
|
||||
},
|
||||
new PanelContainer
|
||||
{
|
||||
HorizontalAlignment = HAlignment.Center,
|
||||
PanelOverride = back2,
|
||||
Children =
|
||||
{
|
||||
new GridContainer
|
||||
{
|
||||
Columns = 3,
|
||||
VSeparationOverride = 0,
|
||||
HSeparationOverride = 0,
|
||||
Children =
|
||||
{
|
||||
new Control {MinSize = imgSize},
|
||||
(_endCapTexture = Segment("end_cap")),
|
||||
new Control {MinSize = imgSize},
|
||||
(_controlBoxTexture = Segment("control_box")),
|
||||
(_fuelChamberTexture = Segment("fuel_chamber")),
|
||||
new Control {MinSize = imgSize},
|
||||
new Control {MinSize = imgSize},
|
||||
(_powerBoxTexture = Segment("power_box")),
|
||||
new Control {MinSize = imgSize},
|
||||
(_emitterLeftTexture = Segment("emitter_left")),
|
||||
(_emitterCenterTexture = Segment("emitter_center")),
|
||||
(_emitterRightTexture = Segment("emitter_right")),
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
(_scanButton = new Button
|
||||
{
|
||||
Text = Loc.GetString("Scan Parts"),
|
||||
HorizontalAlignment = HAlignment.Center
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
new StripeBack
|
||||
{
|
||||
Children =
|
||||
{
|
||||
new MarginContainer
|
||||
new Label
|
||||
{
|
||||
MarginLeftOverride = 4,
|
||||
MarginTopOverride = 4,
|
||||
MarginBottomOverride = 4,
|
||||
Children =
|
||||
{
|
||||
new Label
|
||||
{
|
||||
Text = Loc.GetString("Ensure containment field is active before operation"),
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
|
||||
StyleClasses = {StyleBase.StyleClassLabelSubText},
|
||||
}
|
||||
}
|
||||
Margin = new Thickness(4, 4, 0, 4),
|
||||
Text = Loc.GetString("Ensure containment field is active before operation"),
|
||||
HorizontalAlignment = HAlignment.Center,
|
||||
StyleClasses = {StyleBase.StyleClassLabelSubText},
|
||||
}
|
||||
}
|
||||
},
|
||||
new MarginContainer
|
||||
new HBoxContainer
|
||||
{
|
||||
MarginLeftOverride = 12,
|
||||
Margin = new Thickness(12, 0, 0, 0),
|
||||
Children =
|
||||
{
|
||||
new HBoxContainer
|
||||
new Label
|
||||
{
|
||||
Children =
|
||||
{
|
||||
new Label
|
||||
{
|
||||
Text = "FOO-BAR-BAZ",
|
||||
StyleClasses = {StyleBase.StyleClassLabelSubText}
|
||||
}
|
||||
}
|
||||
Text = "FOO-BAR-BAZ",
|
||||
StyleClasses = {StyleBase.StyleClassLabelSubText}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -398,11 +368,6 @@ namespace Content.Client.ParticleAccelerator
|
||||
return DragMode.Move;
|
||||
}
|
||||
|
||||
protected override Vector2 CalculateMinimumSize()
|
||||
{
|
||||
return (400, 300);
|
||||
}
|
||||
|
||||
public void DataUpdate(ParticleAcceleratorUIState uiState)
|
||||
{
|
||||
_assembled = uiState.Assembled;
|
||||
@@ -504,6 +469,7 @@ namespace Content.Client.ParticleAccelerator
|
||||
|
||||
AddChild(_base = new TextureRect {Texture = _rsi[$"{name}c"].Frame0});
|
||||
AddChild(_unlit = new TextureRect());
|
||||
MinSize = _rsi.Size;
|
||||
}
|
||||
|
||||
public void SetPowerState(ParticleAcceleratorUIState state, bool exists)
|
||||
@@ -537,11 +503,6 @@ namespace Content.Client.ParticleAccelerator
|
||||
|
||||
_unlit.Texture = rState.Frame0;
|
||||
}
|
||||
|
||||
protected override Vector2 CalculateMinimumSize()
|
||||
{
|
||||
return _rsi.Size;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,7 +246,8 @@ namespace Content.Client.UserInterface.Permissions
|
||||
al.AddChild(new Label
|
||||
{
|
||||
Text = flagsText,
|
||||
SizeFlagsHorizontal = Control.SizeFlags.ShrinkCenter | Control.SizeFlags.Expand
|
||||
HorizontalExpand = true,
|
||||
HorizontalAlignment = Control.HAlignment.Center,
|
||||
});
|
||||
|
||||
var editButton = new Button {Text = Loc.GetString("Edit")};
|
||||
@@ -269,7 +270,8 @@ namespace Content.Client.UserInterface.Permissions
|
||||
_menu.AdminRanksList.AddChild(new Label
|
||||
{
|
||||
Text = flagsText,
|
||||
SizeFlagsHorizontal = Control.SizeFlags.ShrinkCenter | Control.SizeFlags.Expand
|
||||
HorizontalExpand = true,
|
||||
HorizontalAlignment = Control.HAlignment.Center,
|
||||
});
|
||||
var editButton = new Button {Text = Loc.GetString("Edit")};
|
||||
editButton.OnPressed += _ => OnEditRankPressed(kv);
|
||||
@@ -306,16 +308,16 @@ namespace Content.Client.UserInterface.Permissions
|
||||
AddAdminButton = new Button
|
||||
{
|
||||
Text = Loc.GetString("Add Admin"),
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkEnd
|
||||
HorizontalAlignment = HAlignment.Right
|
||||
};
|
||||
|
||||
AddAdminRankButton = new Button
|
||||
{
|
||||
Text = Loc.GetString("Add Admin Rank"),
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkEnd
|
||||
HorizontalAlignment = HAlignment.Right
|
||||
};
|
||||
|
||||
AdminsList = new GridContainer {Columns = 5, SizeFlagsVertical = SizeFlags.FillExpand};
|
||||
AdminsList = new GridContainer {Columns = 5, VerticalExpand = true};
|
||||
var adminVBox = new VBoxContainer
|
||||
{
|
||||
Children = {AdminsList, AddAdminButton},
|
||||
@@ -352,6 +354,7 @@ namespace Content.Client.UserInterface.Permissions
|
||||
|
||||
public EditAdminWindow(PermissionsEui ui, PermissionsEuiState.AdminData? data)
|
||||
{
|
||||
SetSize = MinSize = (600, 400);
|
||||
SourceData = data;
|
||||
|
||||
Control nameControl;
|
||||
@@ -372,7 +375,7 @@ namespace Content.Client.UserInterface.Permissions
|
||||
|
||||
TitleEdit = new LineEdit {PlaceHolder = Loc.GetString("Custom title, leave blank to inherit rank title.")};
|
||||
RankButton = new OptionButton();
|
||||
SaveButton = new Button {Text = Loc.GetString("Save"), SizeFlagsHorizontal = SizeFlags.ShrinkEnd | SizeFlags.Expand};
|
||||
SaveButton = new Button {Text = Loc.GetString("Save"), HorizontalAlignment = HAlignment.Right};
|
||||
|
||||
RankButton.AddItem(Loc.GetString("No rank"), NoRank);
|
||||
foreach (var (rId, rank) in ui._ranks)
|
||||
@@ -470,7 +473,7 @@ namespace Content.Client.UserInterface.Permissions
|
||||
{
|
||||
new VBoxContainer
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
Children =
|
||||
{
|
||||
nameControl,
|
||||
@@ -480,7 +483,7 @@ namespace Content.Client.UserInterface.Permissions
|
||||
},
|
||||
permGrid
|
||||
},
|
||||
SizeFlagsVertical = SizeFlags.FillExpand
|
||||
VerticalExpand = true
|
||||
},
|
||||
bottomButtons
|
||||
}
|
||||
@@ -509,8 +512,6 @@ namespace Content.Client.UserInterface.Permissions
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected override Vector2? CustomSize => (600, 400);
|
||||
}
|
||||
|
||||
private sealed class EditAdminRankWindow : SS14Window
|
||||
@@ -523,6 +524,7 @@ namespace Content.Client.UserInterface.Permissions
|
||||
|
||||
public EditAdminRankWindow(PermissionsEui ui, KeyValuePair<int, PermissionsEuiState.AdminRankData>? data)
|
||||
{
|
||||
MinSize = SetSize = (600, 400);
|
||||
SourceId = data?.Key;
|
||||
|
||||
NameEdit = new LineEdit
|
||||
@@ -535,7 +537,11 @@ namespace Content.Client.UserInterface.Permissions
|
||||
NameEdit.Text = data.Value.Value.Name;
|
||||
}
|
||||
|
||||
SaveButton = new Button {Text = Loc.GetString("Save"), SizeFlagsHorizontal = SizeFlags.ShrinkEnd | SizeFlags.Expand};
|
||||
SaveButton = new Button {
|
||||
Text = Loc.GetString("Save"),
|
||||
HorizontalAlignment = HAlignment.Right,
|
||||
HorizontalExpand = true
|
||||
};
|
||||
var flagsBox = new VBoxContainer();
|
||||
|
||||
foreach (var flag in AdminFlagsHelper.AllFlags)
|
||||
@@ -594,8 +600,6 @@ namespace Content.Client.UserInterface.Permissions
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
protected override Vector2? CustomSize => (600, 400);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,8 +19,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
_label = new Label
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.Fill,
|
||||
SizeFlagsVertical = SizeFlags.Fill,
|
||||
VerticalAlignment = VAlignment.Stretch,
|
||||
Align = Label.AlignMode.Center,
|
||||
VAlign = Label.VAlignMode.Center
|
||||
};
|
||||
|
||||
@@ -2,11 +2,9 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Content.Client.Utility;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Maths;
|
||||
using static Content.Shared.GameTicking.SharedGameTicker;
|
||||
|
||||
namespace Content.Client.UserInterface
|
||||
@@ -16,10 +14,10 @@ namespace Content.Client.UserInterface
|
||||
private VBoxContainer RoundEndSummaryTab { get; }
|
||||
private VBoxContainer PlayerManifestoTab { get; }
|
||||
private TabContainer RoundEndWindowTabs { get; }
|
||||
protected override Vector2? CustomSize => (520, 580);
|
||||
|
||||
public RoundEndSummaryWindow(string gm, string roundEnd, TimeSpan roundTimeSpan, List<RoundEndPlayerInfo> info)
|
||||
{
|
||||
MinSize = SetSize = (520, 580);
|
||||
|
||||
Title = Loc.GetString("Round End Summary");
|
||||
|
||||
@@ -66,7 +64,7 @@ namespace Content.Client.UserInterface
|
||||
|
||||
//Initialize what will be the list of players display.
|
||||
var scrollContainer = new ScrollContainer();
|
||||
scrollContainer.SizeFlagsVertical = SizeFlags.FillExpand;
|
||||
scrollContainer.VerticalExpand = true;
|
||||
var innerScrollContainer = new VBoxContainer();
|
||||
|
||||
//Put observers at the bottom of the list. Put antags on top.
|
||||
@@ -74,10 +72,7 @@ namespace Content.Client.UserInterface
|
||||
//Create labels for each player info.
|
||||
foreach (var playerInfo in manifestSortedList)
|
||||
{
|
||||
var playerInfoText = new RichTextLabel()
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.Fill,
|
||||
};
|
||||
var playerInfoText = new RichTextLabel();
|
||||
|
||||
if (playerInfo.Observer)
|
||||
{
|
||||
@@ -100,23 +95,11 @@ namespace Content.Client.UserInterface
|
||||
scrollContainer.AddChild(innerScrollContainer);
|
||||
//Attach the entire ScrollContainer that holds all the playerinfo.
|
||||
PlayerManifestoTab.AddChild(scrollContainer);
|
||||
// TODO: 1240 Overlap, remove once it's fixed. Temp Hack to make the lines not overlap
|
||||
PlayerManifestoTab.OnVisibilityChanged += PlayerManifestoTab_OnVisibilityChanged;
|
||||
|
||||
//Finally, display the window.
|
||||
OpenCentered();
|
||||
MoveToFront();
|
||||
}
|
||||
|
||||
private void PlayerManifestoTab_OnVisibilityChanged(Control obj)
|
||||
{
|
||||
if (obj.Visible)
|
||||
{
|
||||
// For some reason the lines get not properly drawn with the right height
|
||||
// so we just force a update
|
||||
ForceRunLayoutUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
_richTextLabel = new RichTextLabel
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand
|
||||
VerticalExpand = true
|
||||
};
|
||||
AddChild(_richTextLabel);
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ namespace Content.Client.UserInterface
|
||||
get => _hasTopEdge;
|
||||
set
|
||||
{
|
||||
MinimumSizeChanged();
|
||||
_hasTopEdge = value;
|
||||
InvalidateMeasure();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Content.Client.UserInterface
|
||||
set
|
||||
{
|
||||
_hasBottomEdge = value;
|
||||
MinimumSizeChanged();
|
||||
InvalidateMeasure();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,37 +42,36 @@ namespace Content.Client.UserInterface
|
||||
set
|
||||
{
|
||||
_hasMargins = value;
|
||||
MinimumSizeChanged();
|
||||
InvalidateMeasure();
|
||||
}
|
||||
}
|
||||
|
||||
protected override Vector2 CalculateMinimumSize()
|
||||
protected override Vector2 MeasureOverride(Vector2 availableSize)
|
||||
{
|
||||
var padSize = HasMargins ? PadSize : 0;
|
||||
var padSizeTotal = 0f;
|
||||
|
||||
if (HasBottomEdge)
|
||||
padSizeTotal += padSize + EdgeSize;
|
||||
if (HasTopEdge)
|
||||
padSizeTotal += padSize + EdgeSize;
|
||||
|
||||
var size = Vector2.Zero;
|
||||
|
||||
availableSize.Y -= padSizeTotal;
|
||||
|
||||
foreach (var child in Children)
|
||||
{
|
||||
size = Vector2.ComponentMax(size, child.CombinedMinimumSize);
|
||||
child.Measure(availableSize);
|
||||
size = Vector2.ComponentMax(size, child.DesiredSize);
|
||||
}
|
||||
|
||||
var padSize = HasMargins ? PadSize : 0;
|
||||
|
||||
if (HasBottomEdge)
|
||||
{
|
||||
size += (0, padSize + EdgeSize);
|
||||
}
|
||||
|
||||
if (HasTopEdge)
|
||||
{
|
||||
size += (0, padSize + EdgeSize);
|
||||
}
|
||||
|
||||
return size;
|
||||
return size + (0, padSizeTotal);
|
||||
}
|
||||
|
||||
protected override void LayoutUpdateOverride()
|
||||
protected override Vector2 ArrangeOverride(Vector2 finalSize)
|
||||
{
|
||||
var box = SizeBox;
|
||||
var box = new UIBox2(Vector2.Zero, finalSize);
|
||||
|
||||
var padSize = HasMargins ? PadSize : 0;
|
||||
|
||||
@@ -88,10 +87,13 @@ namespace Content.Client.UserInterface
|
||||
|
||||
foreach (var child in Children)
|
||||
{
|
||||
FitChildInBox(child, box);
|
||||
child.Arrange(box);
|
||||
}
|
||||
|
||||
return finalSize;
|
||||
}
|
||||
|
||||
|
||||
protected override void Draw(DrawingHandleScreen handle)
|
||||
{
|
||||
UIBox2 centerBox = PixelSizeBox;
|
||||
@@ -107,7 +109,8 @@ namespace Content.Client.UserInterface
|
||||
if (HasBottomEdge)
|
||||
{
|
||||
centerBox += (0, 0, 0, -((padSize + EdgeSize) * UIScale));
|
||||
handle.DrawRect(new UIBox2(0, centerBox.Bottom, PixelWidth, PixelHeight - padSize * UIScale), EdgeColor);
|
||||
handle.DrawRect(new UIBox2(0, centerBox.Bottom, PixelWidth, PixelHeight - padSize * UIScale),
|
||||
EdgeColor);
|
||||
}
|
||||
|
||||
GetActualStyleBox()?.Draw(handle, centerBox);
|
||||
|
||||
@@ -9,17 +9,16 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
public class StrippingMenu : SS14Window
|
||||
{
|
||||
protected override Vector2? CustomSize => new Vector2(400, 600);
|
||||
|
||||
private readonly VBoxContainer _vboxContainer;
|
||||
|
||||
public StrippingMenu(string title)
|
||||
{
|
||||
MinSize = SetSize = (400, 600);
|
||||
Title = title;
|
||||
|
||||
_vboxContainer = new VBoxContainer()
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
SeparationOverride = 5,
|
||||
};
|
||||
|
||||
@@ -43,7 +42,7 @@ namespace Content.Client.UserInterface
|
||||
|
||||
_vboxContainer.AddChild(new HBoxContainer()
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
HorizontalExpand = true,
|
||||
SeparationOverride = 5,
|
||||
Children =
|
||||
{
|
||||
@@ -53,7 +52,7 @@ namespace Content.Client.UserInterface
|
||||
},
|
||||
new Control()
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand
|
||||
HorizontalExpand = true
|
||||
},
|
||||
button,
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Content.Client.UserInterface.Suspicion
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
RoleButton.OnPressed += RoleButtonPressed;
|
||||
RoleButton.CustomMinimumSize = (200, 60);
|
||||
RoleButton.MinSize = (200, 60);
|
||||
}
|
||||
|
||||
private void RoleButtonPressed(ButtonEventArgs obj)
|
||||
|
||||
@@ -44,21 +44,21 @@ namespace Content.Client.UserInterface
|
||||
{
|
||||
TextureNormal = resourceCache.GetTexture(TextureHigh),
|
||||
StyleClasses = {StyleClassTargetDollZone},
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter
|
||||
HorizontalAlignment = HAlignment.Center
|
||||
};
|
||||
|
||||
_buttonMiddle = new TextureButton
|
||||
{
|
||||
TextureNormal = resourceCache.GetTexture(TextureMiddle),
|
||||
StyleClasses = {StyleClassTargetDollZone},
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter
|
||||
HorizontalAlignment = HAlignment.Center
|
||||
};
|
||||
|
||||
_buttonLow = new TextureButton
|
||||
{
|
||||
TextureNormal = resourceCache.GetTexture(TextureLow),
|
||||
StyleClasses = {StyleClassTargetDollZone},
|
||||
SizeFlagsHorizontal = SizeFlags.ShrinkCenter
|
||||
HorizontalAlignment = HAlignment.Center
|
||||
};
|
||||
|
||||
_buttonHigh.OnPressed += _ => ActiveZone = TargetingZone.High;
|
||||
|
||||
@@ -36,10 +36,9 @@ namespace Content.Client.UserInterface
|
||||
[color=#a4885c]AlignWall[/color] snaps to vertical halftiles.
|
||||
[color=#a4885c]AlignWallProper[/color] snaps the entity to the middle of the tile edges";
|
||||
|
||||
protected override Vector2? CustomSize => (520, 580);
|
||||
|
||||
public TutorialWindow()
|
||||
{
|
||||
MinSize = SetSize = (520, 580);
|
||||
Title = "The Tutorial!";
|
||||
|
||||
//Get section header font
|
||||
|
||||
Reference in New Issue
Block a user