WPF layout (#3346)

This commit is contained in:
Pieter-Jan Briers
2021-02-21 12:38:56 +01:00
committed by GitHub
parent 33d6975c25
commit b898443f28
121 changed files with 1420 additions and 2069 deletions

View File

@@ -90,8 +90,8 @@ namespace Content.Client.Arcade
_highscoresRootContainer = new PanelContainer _highscoresRootContainer = new PanelContainer
{ {
PanelOverride = rootBack, PanelOverride = rootBack,
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SizeFlagsHorizontal = SizeFlags.ShrinkCenter HorizontalAlignment = HAlignment.Center
}; };
var c = new Color(OverlayBackgroundColor.R,OverlayBackgroundColor.G,OverlayBackgroundColor.B,220); var c = new Color(OverlayBackgroundColor.R,OverlayBackgroundColor.G,OverlayBackgroundColor.B,220);
@@ -104,20 +104,20 @@ namespace Content.Client.Arcade
var menuInnerPanel = new PanelContainer var menuInnerPanel = new PanelContainer
{ {
PanelOverride = innerBack, PanelOverride = innerBack,
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SizeFlagsHorizontal = SizeFlags.ShrinkCenter HorizontalAlignment = HAlignment.Center
}; };
_highscoresRootContainer.AddChild(menuInnerPanel); _highscoresRootContainer.AddChild(menuInnerPanel);
var menuContainer = new VBoxContainer() var menuContainer = new VBoxContainer()
{ {
SizeFlagsHorizontal = SizeFlags.ShrinkCenter, HorizontalAlignment = HAlignment.Center,
SizeFlagsVertical = SizeFlags.ShrinkCenter VerticalAlignment = VAlignment.Center
}; };
menuContainer.AddChild(new Label{Text = Loc.GetString("Highscores")}); menuContainer.AddChild(new Label{Text = Loc.GetString("Highscores")});
menuContainer.AddChild(new Control{CustomMinimumSize = new Vector2(1,10)}); menuContainer.AddChild(new Control{MinSize = new Vector2(1,10)});
var highScoreBox = new HBoxContainer(); var highScoreBox = new HBoxContainer();
@@ -126,14 +126,14 @@ namespace Content.Client.Arcade
Align = Label.AlignMode.Center Align = Label.AlignMode.Center
}; };
highScoreBox.AddChild(_localHighscoresLabel); highScoreBox.AddChild(_localHighscoresLabel);
highScoreBox.AddChild(new Control{CustomMinimumSize = new Vector2(40,1)}); highScoreBox.AddChild(new Control{MinSize = new Vector2(40,1)});
_globalHighscoresLabel = new Label _globalHighscoresLabel = new Label
{ {
Align = Label.AlignMode.Center Align = Label.AlignMode.Center
}; };
highScoreBox.AddChild(_globalHighscoresLabel); highScoreBox.AddChild(_globalHighscoresLabel);
menuContainer.AddChild(highScoreBox); menuContainer.AddChild(highScoreBox);
menuContainer.AddChild(new Control{CustomMinimumSize = new Vector2(1,10)}); menuContainer.AddChild(new Control{MinSize = new Vector2(1,10)});
_highscoreBackButton = new Button _highscoreBackButton = new Button
{ {
Text = Loc.GetString("Back"), Text = Loc.GetString("Back"),
@@ -156,8 +156,8 @@ namespace Content.Client.Arcade
_gameOverRootContainer = new PanelContainer _gameOverRootContainer = new PanelContainer
{ {
PanelOverride = rootBack, PanelOverride = rootBack,
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SizeFlagsHorizontal = SizeFlags.ShrinkCenter HorizontalAlignment = HAlignment.Center
}; };
var innerBack = new StyleBoxTexture var innerBack = new StyleBoxTexture
@@ -169,25 +169,25 @@ namespace Content.Client.Arcade
var menuInnerPanel = new PanelContainer var menuInnerPanel = new PanelContainer
{ {
PanelOverride = innerBack, PanelOverride = innerBack,
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SizeFlagsHorizontal = SizeFlags.ShrinkCenter HorizontalAlignment = HAlignment.Center
}; };
_gameOverRootContainer.AddChild(menuInnerPanel); _gameOverRootContainer.AddChild(menuInnerPanel);
var menuContainer = new VBoxContainer var menuContainer = new VBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.ShrinkCenter, HorizontalAlignment = HAlignment.Center,
SizeFlagsVertical = SizeFlags.ShrinkCenter VerticalAlignment = VAlignment.Center
}; };
menuContainer.AddChild(new Label{Text = Loc.GetString("Gameover!"),Align = Label.AlignMode.Center}); menuContainer.AddChild(new Label{Text = Loc.GetString("Gameover!"),Align = Label.AlignMode.Center});
menuContainer.AddChild(new Control{CustomMinimumSize = new Vector2(1,10)}); menuContainer.AddChild(new Control{MinSize = new Vector2(1,10)});
_finalScoreLabel = new Label{Align = Label.AlignMode.Center}; _finalScoreLabel = new Label{Align = Label.AlignMode.Center};
menuContainer.AddChild(_finalScoreLabel); menuContainer.AddChild(_finalScoreLabel);
menuContainer.AddChild(new Control{CustomMinimumSize = new Vector2(1,10)}); menuContainer.AddChild(new Control{MinSize = new Vector2(1,10)});
_finalNewGameButton = new Button _finalNewGameButton = new Button
{ {
@@ -214,8 +214,8 @@ namespace Content.Client.Arcade
_menuRootContainer = new PanelContainer _menuRootContainer = new PanelContainer
{ {
PanelOverride = rootBack, PanelOverride = rootBack,
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SizeFlagsHorizontal = SizeFlags.ShrinkCenter HorizontalAlignment = HAlignment.Center
}; };
var innerBack = new StyleBoxTexture var innerBack = new StyleBoxTexture
@@ -227,8 +227,8 @@ namespace Content.Client.Arcade
var menuInnerPanel = new PanelContainer var menuInnerPanel = new PanelContainer
{ {
PanelOverride = innerBack, PanelOverride = innerBack,
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SizeFlagsHorizontal = SizeFlags.ShrinkCenter HorizontalAlignment = HAlignment.Center
}; };
_menuRootContainer.AddChild(menuInnerPanel); _menuRootContainer.AddChild(menuInnerPanel);
@@ -236,8 +236,8 @@ namespace Content.Client.Arcade
var menuContainer = new VBoxContainer var menuContainer = new VBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.ShrinkCenter, HorizontalAlignment = HAlignment.Center,
SizeFlagsVertical = SizeFlags.ShrinkCenter VerticalAlignment = VAlignment.Center
}; };
_newGameButton = new Button _newGameButton = new Button
@@ -250,7 +250,7 @@ namespace Content.Client.Arcade
_owner.SendAction(BlockGamePlayerAction.NewGame); _owner.SendAction(BlockGamePlayerAction.NewGame);
}; };
menuContainer.AddChild(_newGameButton); menuContainer.AddChild(_newGameButton);
menuContainer.AddChild(new Control{CustomMinimumSize = new Vector2(1,10)}); menuContainer.AddChild(new Control{MinSize = new Vector2(1,10)});
_scoreBoardButton = new Button _scoreBoardButton = new Button
{ {
@@ -259,7 +259,7 @@ namespace Content.Client.Arcade
}; };
_scoreBoardButton.OnPressed += (e) => _owner.SendAction(BlockGamePlayerAction.ShowHighscores); _scoreBoardButton.OnPressed += (e) => _owner.SendAction(BlockGamePlayerAction.ShowHighscores);
menuContainer.AddChild(_scoreBoardButton); menuContainer.AddChild(_scoreBoardButton);
_unpauseButtonMargin = new Control {CustomMinimumSize = new Vector2(1, 10), Visible = false}; _unpauseButtonMargin = new Control {MinSize = new Vector2(1, 10), Visible = false};
menuContainer.AddChild(_unpauseButtonMargin); menuContainer.AddChild(_unpauseButtonMargin);
_unpauseButton = new Button _unpauseButton = new Button
@@ -301,35 +301,35 @@ namespace Content.Client.Arcade
_levelLabel = new Label _levelLabel = new Label
{ {
Align = Label.AlignMode.Center, Align = Label.AlignMode.Center,
SizeFlagsHorizontal = SizeFlags.FillExpand HorizontalExpand = true
}; };
_gameRootContainer.AddChild(_levelLabel); _gameRootContainer.AddChild(_levelLabel);
_gameRootContainer.AddChild(new Control _gameRootContainer.AddChild(new Control
{ {
CustomMinimumSize = new Vector2(1,5) MinSize = new Vector2(1,5)
}); });
_pointsLabel = new Label _pointsLabel = new Label
{ {
Align = Label.AlignMode.Center, Align = Label.AlignMode.Center,
SizeFlagsHorizontal = SizeFlags.FillExpand HorizontalExpand = true
}; };
_gameRootContainer.AddChild(_pointsLabel); _gameRootContainer.AddChild(_pointsLabel);
_gameRootContainer.AddChild(new Control _gameRootContainer.AddChild(new Control
{ {
CustomMinimumSize = new Vector2(1,10) MinSize = new Vector2(1,10)
}); });
var gameBox = new HBoxContainer(); var gameBox = new HBoxContainer();
gameBox.AddChild(SetupHoldBox(backgroundTexture)); gameBox.AddChild(SetupHoldBox(backgroundTexture));
gameBox.AddChild(new Control gameBox.AddChild(new Control
{ {
CustomMinimumSize = new Vector2(10,1) MinSize = new Vector2(10,1)
}); });
gameBox.AddChild(SetupGameGrid(backgroundTexture)); gameBox.AddChild(SetupGameGrid(backgroundTexture));
gameBox.AddChild(new Control gameBox.AddChild(new Control
{ {
CustomMinimumSize = new Vector2(10,1) MinSize = new Vector2(10,1)
}); });
gameBox.AddChild(SetupNextBox(backgroundTexture)); gameBox.AddChild(SetupNextBox(backgroundTexture));
@@ -337,7 +337,7 @@ namespace Content.Client.Arcade
_gameRootContainer.AddChild(new Control _gameRootContainer.AddChild(new Control
{ {
CustomMinimumSize = new Vector2(1,10) MinSize = new Vector2(1,10)
}); });
_pauseButton = new Button _pauseButton = new Button
@@ -369,7 +369,7 @@ namespace Content.Client.Arcade
var gamePanel = new PanelContainer var gamePanel = new PanelContainer
{ {
PanelOverride = back, PanelOverride = back,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsStretchRatio = 60 SizeFlagsStretchRatio = 60
}; };
var backgroundPanel = new PanelContainer var backgroundPanel = new PanelContainer
@@ -393,16 +393,16 @@ namespace Content.Client.Arcade
var grid = new GridContainer var grid = new GridContainer
{ {
Columns = 1, Columns = 1,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsStretchRatio = 20 SizeFlagsStretchRatio = 20
}; };
var nextBlockPanel = new PanelContainer var nextBlockPanel = new PanelContainer
{ {
PanelOverride = previewBack, PanelOverride = previewBack,
CustomMinimumSize = BlockSize * 6.5f, MinSize = BlockSize * 6.5f,
SizeFlagsHorizontal = SizeFlags.None, HorizontalAlignment = HAlignment.Left,
SizeFlagsVertical = SizeFlags.None VerticalAlignment = VAlignment.Top
}; };
var nextCenterContainer = new CenterContainer(); var nextCenterContainer = new CenterContainer();
_nextBlockGrid = new GridContainer _nextBlockGrid = new GridContainer
@@ -431,16 +431,16 @@ namespace Content.Client.Arcade
var grid = new GridContainer var grid = new GridContainer
{ {
Columns = 1, Columns = 1,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsStretchRatio = 20 SizeFlagsStretchRatio = 20
}; };
var holdBlockPanel = new PanelContainer var holdBlockPanel = new PanelContainer
{ {
PanelOverride = previewBack, PanelOverride = previewBack,
CustomMinimumSize = BlockSize * 6.5f, MinSize = BlockSize * 6.5f,
SizeFlagsHorizontal = SizeFlags.None, HorizontalAlignment = HAlignment.Left,
SizeFlagsVertical = SizeFlags.None VerticalAlignment = VAlignment.Top
}; };
var holdCenterContainer = new CenterContainer(); var holdCenterContainer = new CenterContainer();
_holdBlockGrid = new GridContainer _holdBlockGrid = new GridContainer
@@ -625,7 +625,7 @@ namespace Content.Client.Arcade
_nextBlockGrid.AddChild(new PanelContainer _nextBlockGrid.AddChild(new PanelContainer
{ {
PanelOverride = new StyleBoxFlat {BackgroundColor = c}, PanelOverride = new StyleBoxFlat {BackgroundColor = c},
CustomMinimumSize = BlockSize, MinSize = BlockSize,
RectDrawClipMargin = 0 RectDrawClipMargin = 0
}); });
} }
@@ -647,7 +647,7 @@ namespace Content.Client.Arcade
_holdBlockGrid.AddChild(new PanelContainer _holdBlockGrid.AddChild(new PanelContainer
{ {
PanelOverride = new StyleBoxFlat {BackgroundColor = c}, PanelOverride = new StyleBoxFlat {BackgroundColor = c},
CustomMinimumSize = BlockSize, MinSize = BlockSize,
RectDrawClipMargin = 0 RectDrawClipMargin = 0
}); });
} }
@@ -665,7 +665,7 @@ namespace Content.Client.Arcade
_gameGrid.AddChild(new PanelContainer _gameGrid.AddChild(new PanelContainer
{ {
PanelOverride = new StyleBoxFlat {BackgroundColor = c}, PanelOverride = new StyleBoxFlat {BackgroundColor = c},
CustomMinimumSize = BlockSize, MinSize = BlockSize,
RectDrawClipMargin = 0 RectDrawClipMargin = 0
}); });
} }

View File

@@ -9,7 +9,6 @@ namespace Content.Client.Arcade
{ {
public class SpaceVillainArcadeMenu : SS14Window public class SpaceVillainArcadeMenu : SS14Window
{ {
protected override Vector2? CustomSize => (400, 200);
public SpaceVillainArcadeBoundUserInterface Owner { get; set; } public SpaceVillainArcadeBoundUserInterface Owner { get; set; }
private readonly Label _enemyNameLabel; private readonly Label _enemyNameLabel;
@@ -21,6 +20,7 @@ namespace Content.Client.Arcade
private readonly Button[] _gameButtons = new Button[3]; //used to disable/enable all game buttons private readonly Button[] _gameButtons = new Button[3]; //used to disable/enable all game buttons
public SpaceVillainArcadeMenu(SpaceVillainArcadeBoundUserInterface owner) public SpaceVillainArcadeMenu(SpaceVillainArcadeBoundUserInterface owner)
{ {
MinSize = SetSize = (400, 200);
Title = Loc.GetString("Space Villain"); Title = Loc.GetString("Space Villain");
Owner = owner; Owner = owner;

View File

@@ -9,7 +9,7 @@ using Robust.Shared.Utility;
namespace Content.Client.Chat namespace Content.Client.Chat
{ {
public class ChatBox : MarginContainer public class ChatBox : Control
{ {
public delegate void TextSubmitHandler(ChatBox chatBox, string text); public delegate void TextSubmitHandler(ChatBox chatBox, string text);
@@ -36,13 +36,6 @@ namespace Content.Client.Chat
public ChatBox() public ChatBox()
{ {
/*MarginLeft = -475.0f;
MarginTop = 10.0f;
MarginRight = -10.0f;
MarginBottom = 235.0f;
AnchorLeft = 1.0f;
AnchorRight = 1.0f;*/
MouseFilter = MouseFilterMode.Stop; MouseFilter = MouseFilterMode.Stop;
var outerVBox = new VBoxContainer(); var outerVBox = new VBoxContainer();
@@ -50,7 +43,7 @@ namespace Content.Client.Chat
var panelContainer = new PanelContainer var panelContainer = new PanelContainer
{ {
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#25252aaa")}, PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#25252aaa")},
SizeFlagsVertical = SizeFlags.FillExpand VerticalExpand = true
}; };
var vBox = new VBoxContainer(); var vBox = new VBoxContainer();
panelContainer.AddChild(vBox); panelContainer.AddChild(vBox);
@@ -59,15 +52,8 @@ namespace Content.Client.Chat
outerVBox.AddChild(panelContainer); outerVBox.AddChild(panelContainer);
outerVBox.AddChild(hBox); outerVBox.AddChild(hBox);
Contents = new OutputPanel {Margin = new Thickness(4, 0), VerticalExpand = true};
var contentMargin = new MarginContainer vBox.AddChild(Contents);
{
MarginLeftOverride = 4, MarginRightOverride = 4,
SizeFlagsVertical = SizeFlags.FillExpand
};
Contents = new OutputPanel();
contentMargin.AddChild(Contents);
vBox.AddChild(contentMargin);
Input = new HistoryLineEdit(); Input = new HistoryLineEdit();
Input.OnKeyBindDown += InputKeyBindDown; Input.OnKeyBindDown += InputKeyBindDown;
@@ -78,7 +64,8 @@ namespace Content.Client.Chat
{ {
Text = Loc.GetString("All"), Text = Loc.GetString("All"),
Name = "ALL", Name = "ALL",
SizeFlagsHorizontal = SizeFlags.ShrinkEnd | SizeFlags.Expand, HorizontalExpand = true,
HorizontalAlignment = HAlignment.Right,
ToggleMode = true, ToggleMode = true,
}; };

View File

@@ -74,17 +74,13 @@ namespace Content.Client.Chat
ForceRunStyleUpdate(); ForceRunStyleUpdate();
ContentHeight = bubble.CombinedMinimumSize.Y; bubble.Measure(Vector2.Infinity);
ContentHeight = bubble.DesiredSize.Y;
_verticalOffsetAchieved = -ContentHeight; _verticalOffsetAchieved = -ContentHeight;
} }
protected abstract Control BuildBubble(string text); protected abstract Control BuildBubble(string text);
protected override Vector2 CalculateMinimumSize()
{
return (base.CalculateMinimumSize().X, 0);
}
protected override void FrameUpdate(FrameEventArgs args) protected override void FrameUpdate(FrameEventArgs args)
{ {
base.FrameUpdate(args); base.FrameUpdate(args);
@@ -122,7 +118,7 @@ namespace Content.Client.Chat
LayoutContainer.SetPosition(this, screenPos); LayoutContainer.SetPosition(this, screenPos);
var height = MathHelper.Clamp(lowerCenter.Y - screenPos.Y, 0, ContentHeight); var height = MathHelper.Clamp(lowerCenter.Y - screenPos.Y, 0, ContentHeight);
LayoutContainer.SetSize(this, (Size.X, height)); SetHeight = height;
} }
private void Die() private void Die()

View File

@@ -102,7 +102,8 @@ namespace Content.Client
}; };
_userInterfaceManager.PopupRoot.AddChild(label); _userInterfaceManager.PopupRoot.AddChild(label);
var minimumSize = label.CombinedMinimumSize; label.Measure(Vector2.Infinity);
var minimumSize = label.DesiredSize;
label.InitialPos = (coordinates.Position / _userInterfaceManager.UIScale) - minimumSize / 2; label.InitialPos = (coordinates.Position / _userInterfaceManager.UIScale) - minimumSize / 2;
LayoutContainer.SetPosition(label, label.InitialPos); LayoutContainer.SetPosition(label, label.InitialPos);
@@ -149,7 +150,7 @@ namespace Content.Client
var position = Entity == null var position = Entity == null
? InitialPos ? InitialPos
: (_eyeManager.CoordinatesToScreen(Entity.Transform.Coordinates).Position / UIScale) - CombinedMinimumSize / 2; : (_eyeManager.CoordinatesToScreen(Entity.Transform.Coordinates).Position / UIScale) - DesiredSize / 2;
LayoutContainer.SetPosition(this, position - (0, 20 * (TimeLeft * TimeLeft + TimeLeft))); LayoutContainer.SetPosition(this, position - (0, 20 * (TimeLeft * TimeLeft + TimeLeft)));

View File

@@ -12,8 +12,6 @@ namespace Content.Client.Command
{ {
public class CommunicationsConsoleMenu : SS14Window public class CommunicationsConsoleMenu : SS14Window
{ {
protected override Vector2? CustomSize => new Vector2(600, 400);
private CommunicationsConsoleBoundUserInterface Owner { get; set; } private CommunicationsConsoleBoundUserInterface Owner { get; set; }
private readonly CancellationTokenSource _timerCancelTokenSource = new(); private readonly CancellationTokenSource _timerCancelTokenSource = new();
public readonly Button EmergencyShuttleButton; public readonly Button EmergencyShuttleButton;
@@ -21,25 +19,26 @@ namespace Content.Client.Command
public CommunicationsConsoleMenu(CommunicationsConsoleBoundUserInterface owner) public CommunicationsConsoleMenu(CommunicationsConsoleBoundUserInterface owner)
{ {
SetSize = MinSize = (600, 400);
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
Title = Loc.GetString("Communications Console"); Title = Loc.GetString("Communications Console");
Owner = owner; Owner = owner;
_countdownLabel = new RichTextLabel(){CustomMinimumSize = new Vector2(0, 200)}; _countdownLabel = new RichTextLabel(){MinSize = new Vector2(0, 200)};
EmergencyShuttleButton = new Button(); EmergencyShuttleButton = new Button();
EmergencyShuttleButton.OnPressed += (_) => Owner.EmergencyShuttleButtonPressed(); EmergencyShuttleButton.OnPressed += (_) => Owner.EmergencyShuttleButtonPressed();
EmergencyShuttleButton.Disabled = !owner.CanCall; EmergencyShuttleButton.Disabled = !owner.CanCall;
var vbox = new VBoxContainer() {SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsVertical = SizeFlags.FillExpand}; var vbox = new VBoxContainer() {HorizontalExpand = true, VerticalExpand = true};
vbox.AddChild(_countdownLabel); vbox.AddChild(_countdownLabel);
vbox.AddChild(EmergencyShuttleButton); vbox.AddChild(EmergencyShuttleButton);
var hbox = new HBoxContainer() {SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsVertical = SizeFlags.FillExpand}; var hbox = new HBoxContainer() {HorizontalExpand = true, VerticalExpand = true};
hbox.AddChild(new Control(){CustomMinimumSize = new Vector2(100,0), SizeFlagsHorizontal = SizeFlags.FillExpand}); hbox.AddChild(new Control(){MinSize = new Vector2(100,0), HorizontalExpand = true});
hbox.AddChild(vbox); hbox.AddChild(vbox);
hbox.AddChild(new Control(){CustomMinimumSize = new Vector2(100,0), SizeFlagsHorizontal = SizeFlags.FillExpand}); hbox.AddChild(new Control(){MinSize = new Vector2(100,0), HorizontalExpand = true});
Contents.AddChild(hbox); Contents.AddChild(hbox);

View File

@@ -1,27 +1,27 @@
<SS14Window xmlns="https://spacestation14.io"> <SS14Window xmlns="https://spacestation14.io">
<HBoxContainer SizeFlagsHorizontal="FillExpand"> <HBoxContainer HorizontalExpand="True">
<VBoxContainer SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="0.45"> <VBoxContainer HorizontalExpand="True" SizeFlagsStretchRatio="0.45">
<HBoxContainer SizeFlagsHorizontal="FillExpand" SizeFlagsVertical="FillExpand" SizeFlagsStretchRatio="0.1"> <HBoxContainer HorizontalExpand="True" VerticalExpand="True" SizeFlagsStretchRatio="0.1">
<LineEdit Name="SearchBar" PlaceHolder="Search" SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="0.6"/> <LineEdit Name="SearchBar" PlaceHolder="Search" HorizontalExpand="True" SizeFlagsStretchRatio="0.6"/>
<OptionButton Name="Category" SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="0.4"/> <OptionButton Name="Category" HorizontalExpand="True" SizeFlagsStretchRatio="0.4"/>
</HBoxContainer> </HBoxContainer>
<ItemList Name="RecipesList" SelectMode="Single" SizeFlagsVertical="FillExpand" SizeFlagsStretchRatio="0.9"/> <ItemList Name="RecipesList" SelectMode="Single" VerticalExpand="True" SizeFlagsStretchRatio="0.9"/>
</VBoxContainer> </VBoxContainer>
<Control SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="0.05"/> <Control HorizontalExpand="True" SizeFlagsStretchRatio="0.05"/>
<VBoxContainer SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="0.45"> <VBoxContainer HorizontalExpand="True" SizeFlagsStretchRatio="0.45">
<HBoxContainer Align="Center" SizeFlagsVertical="FillExpand" SizeFlagsStretchRatio="0.25"> <HBoxContainer Align="Center" VerticalExpand="True" SizeFlagsStretchRatio="0.25">
<TextureRect Name="TargetTexture" SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="0.15" Stretch="KeepCentered"/> <TextureRect Name="TargetTexture" HorizontalExpand="True" SizeFlagsStretchRatio="0.15" Stretch="KeepCentered"/>
<VBoxContainer SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="0.85"> <VBoxContainer HorizontalExpand="True" SizeFlagsStretchRatio="0.85">
<RichTextLabel Name="TargetName" SizeFlagsVertical="FillExpand" SizeFlagsStretchRatio="0.1"/> <RichTextLabel Name="TargetName" VerticalExpand="True" SizeFlagsStretchRatio="0.1"/>
<RichTextLabel Name="TargetDesc" SizeFlagsVertical="FillExpand" SizeFlagsStretchRatio="0.9"/> <RichTextLabel Name="TargetDesc" VerticalExpand="True" SizeFlagsStretchRatio="0.9"/>
</VBoxContainer> </VBoxContainer>
</HBoxContainer> </HBoxContainer>
<ItemList Name="StepList" SizeFlagsVertical="FillExpand" SizeFlagsStretchRatio="0.1"/> <ItemList Name="StepList" VerticalExpand="True" SizeFlagsStretchRatio="0.1"/>
<VBoxContainer SizeFlagsVertical="FillExpand" SizeFlagsStretchRatio="0.1"> <VBoxContainer VerticalExpand="True" SizeFlagsStretchRatio="0.1">
<Button Name="BuildButton" Disabled="True" ToggleMode="True" SizeFlagsVertical="FillExpand" SizeFlagsStretchRatio="0.5"/> <Button Name="BuildButton" Disabled="True" ToggleMode="True" VerticalExpand="True" SizeFlagsStretchRatio="0.5"/>
<HBoxContainer SizeFlagsVertical="FillExpand" SizeFlagsStretchRatio="0.5"> <HBoxContainer VerticalExpand="True" SizeFlagsStretchRatio="0.5">
<Button Name="EraseButton" ToggleMode="True" SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="0.7"/> <Button Name="EraseButton" ToggleMode="True" HorizontalExpand="True" SizeFlagsStretchRatio="0.7"/>
<Button Name="ClearButton" SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="0.3"/> <Button Name="ClearButton" HorizontalExpand="True" SizeFlagsStretchRatio="0.3"/>
</HBoxContainer> </HBoxContainer>
</VBoxContainer> </VBoxContainer>
</VBoxContainer> </VBoxContainer>

View File

@@ -6,7 +6,6 @@ using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML; using Robust.Client.UserInterface.XAML;
using Robust.Shared.IoC; using Robust.Shared.IoC;
using Robust.Shared.Localization; using Robust.Shared.Localization;
using Robust.Shared.Maths;
#nullable enable #nullable enable
@@ -57,8 +56,6 @@ namespace Content.Client.Construction
[GenerateTypedNameReferences] [GenerateTypedNameReferences]
public partial class ConstructionMenu : SS14Window, IConstructionMenuView public partial class ConstructionMenu : SS14Window, IConstructionMenuView
{ {
protected override Vector2? CustomSize => (720, 320);
public bool BuildButtonPressed public bool BuildButtonPressed
{ {
get => BuildButton.Pressed; get => BuildButton.Pressed;
@@ -82,6 +79,8 @@ namespace Content.Client.Construction
public ConstructionMenu() public ConstructionMenu()
{ {
SetSize = MinSize = (720, 320);
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
RobustXamlLoader.Load(this); RobustXamlLoader.Load(this);

View File

@@ -34,10 +34,9 @@ namespace Content.Client.GameObjects.Components.Access
private string _lastFullName; private string _lastFullName;
private string _lastJobTitle; private string _lastJobTitle;
protected override Vector2? CustomSize => (650, 270);
public IdCardConsoleWindow(IdCardConsoleBoundUserInterface owner, IPrototypeManager prototypeManager) public IdCardConsoleWindow(IdCardConsoleBoundUserInterface owner, IPrototypeManager prototypeManager)
{ {
MinSize = SetSize = (650, 270);
_owner = owner; _owner = owner;
var vBox = new VBoxContainer(); var vBox = new VBoxContainer();
@@ -60,7 +59,7 @@ namespace Content.Client.GameObjects.Components.Access
_targetIdButton.OnPressed += _ => _owner.ButtonPressed(UiButton.TargetId); _targetIdButton.OnPressed += _ => _owner.ButtonPressed(UiButton.TargetId);
// Separator // Separator
vBox.AddChild(new Control {CustomMinimumSize = (0, 8)}); vBox.AddChild(new Control {MinSize = (0, 8)});
// Name and job title line edits. // Name and job title line edits.
vBox.AddChild(new GridContainer vBox.AddChild(new GridContainer
@@ -76,7 +75,7 @@ namespace Content.Client.GameObjects.Components.Access
}), }),
(_fullNameLineEdit = new LineEdit (_fullNameLineEdit = new LineEdit
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
}), }),
(_fullNameSaveButton = new Button (_fullNameSaveButton = new Button
{ {
@@ -91,7 +90,7 @@ namespace Content.Client.GameObjects.Components.Access
}), }),
(_jobTitleLineEdit = new LineEdit (_jobTitleLineEdit = new LineEdit
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand HorizontalExpand = true
}), }),
(_jobTitleSaveButton = new Button (_jobTitleSaveButton = new Button
{ {
@@ -116,13 +115,13 @@ namespace Content.Client.GameObjects.Components.Access
_jobTitleSaveButton.OnPressed += _ => SubmitData(); _jobTitleSaveButton.OnPressed += _ => SubmitData();
// Separator // Separator
vBox.AddChild(new Control {CustomMinimumSize = (0, 8)}); vBox.AddChild(new Control {MinSize = (0, 8)});
{ {
var grid = new GridContainer var grid = new GridContainer
{ {
Columns = 5, Columns = 5,
SizeFlagsHorizontal = SizeFlags.ShrinkCenter HorizontalAlignment = HAlignment.Center
}; };
vBox.AddChild(grid); vBox.AddChild(grid);

View File

@@ -76,13 +76,13 @@ namespace Content.Client.GameObjects.Components.Actor
(SpriteView = new SpriteView { Scale = (2, 2)}), (SpriteView = new SpriteView { Scale = (2, 2)}),
new VBoxContainer new VBoxContainer
{ {
SizeFlagsVertical = SizeFlags.None, VerticalAlignment = VAlignment.Top,
Children = Children =
{ {
(NameLabel = new Label()), (NameLabel = new Label()),
(SubText = new Label (SubText = new Label
{ {
SizeFlagsVertical = SizeFlags.None, VerticalAlignment = VAlignment.Top,
StyleClasses = {StyleNano.StyleClassLabelSubText}, StyleClasses = {StyleNano.StyleClassLabelSubText},
}) })
@@ -99,7 +99,7 @@ namespace Content.Client.GameObjects.Components.Actor
AddChild(new Label AddChild(new Label
{ {
Text = Loc.GetString("Objectives"), Text = Loc.GetString("Objectives"),
SizeFlagsHorizontal = SizeFlags.ShrinkCenter HorizontalAlignment = HAlignment.Center
}); });
ObjectivesContainer = new VBoxContainer(); ObjectivesContainer = new VBoxContainer();
AddChild(ObjectivesContainer); AddChild(ObjectivesContainer);
@@ -135,11 +135,11 @@ namespace Content.Client.GameObjects.Components.Actor
{ {
Texture = objectiveCondition.SpriteSpecifier.Frame0(), Texture = objectiveCondition.SpriteSpecifier.Frame0(),
Progress = objectiveCondition.Progress, Progress = objectiveCondition.Progress,
SizeFlagsVertical = SizeFlags.ShrinkCenter VerticalAlignment = VAlignment.Center
}); });
hbox.AddChild(new Control hbox.AddChild(new Control
{ {
CustomMinimumSize = (10,0) MinSize = (10,0)
}); });
hbox.AddChild(new VBoxContainer hbox.AddChild(new VBoxContainer
{ {

View File

@@ -66,7 +66,7 @@ namespace Content.Client.GameObjects.Components.Atmos
Children = Children =
{ {
(_topContainer = new VBoxContainer()), (_topContainer = new VBoxContainer()),
new Control {CustomMinimumSize = (0, 110)} new Control {MinSize = (0, 110)}
} }
}; };
@@ -78,16 +78,9 @@ namespace Content.Client.GameObjects.Components.Atmos
var fontSmall = resourceCache.GetFont("/Fonts/Boxfont-round/Boxfont Round.ttf", 10); var fontSmall = resourceCache.GetFont("/Fonts/Boxfont-round/Boxfont Round.ttf", 10);
Button refreshButton; Button refreshButton;
var topRow = new MarginContainer var topRow = new HBoxContainer
{
MarginLeftOverride = 4,
MarginTopOverride = 2,
MarginRightOverride = 12,
MarginBottomOverride = 2,
Children =
{
new HBoxContainer
{ {
Margin = new Thickness(4, 4, 12, 2),
Children = Children =
{ {
(_nameLabel = new Label (_nameLabel = new Label
@@ -95,26 +88,24 @@ namespace Content.Client.GameObjects.Components.Atmos
Text = Loc.GetString("Gas Analyzer"), Text = Loc.GetString("Gas Analyzer"),
FontOverride = font, FontOverride = font,
FontColorOverride = StyleNano.NanoGold, FontColorOverride = StyleNano.NanoGold,
SizeFlagsVertical = SizeFlags.ShrinkCenter VerticalAlignment = VAlignment.Center
}), }),
new Control new Control
{ {
CustomMinimumSize = (20, 0), MinSize = (20, 0),
SizeFlagsHorizontal = SizeFlags.Expand HorizontalExpand = true,
}, },
(refreshButton = new Button {Text = "Refresh"}), //TODO: refresh icon? (refreshButton = new Button {Text = "Refresh"}), //TODO: refresh icon?
new Control new Control
{ {
CustomMinimumSize = (2, 0), MinSize = (2, 0),
}, },
(CloseButton = new TextureButton (CloseButton = new TextureButton
{ {
StyleClasses = {SS14Window.StyleClassWindowCloseButton}, StyleClasses = {SS14Window.StyleClassWindowCloseButton},
SizeFlagsVertical = SizeFlags.ShrinkCenter VerticalAlignment = VAlignment.Center
}) })
} }
}
}
}; };
refreshButton.OnPressed += a => refreshButton.OnPressed += a =>
@@ -127,34 +118,27 @@ namespace Content.Client.GameObjects.Components.Atmos
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#202025")}, PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#202025")},
Children = Children =
{ {
new MarginContainer (_statusContainer = new VBoxContainer
{ {
MarginLeftOverride = 8, Margin = new Thickness(8, 8, 4, 4)
MarginRightOverride = 8, })
MarginTopOverride = 4,
MarginBottomOverride = 4,
Children =
{
(_statusContainer = new VBoxContainer())
}
}
} }
}; };
_topContainer.AddChild(topRow); _topContainer.AddChild(topRow);
_topContainer.AddChild(new PanelContainer _topContainer.AddChild(new PanelContainer
{ {
CustomMinimumSize = (0, 2), MinSize = (0, 2),
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#525252ff")} PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#525252ff")}
}); });
_topContainer.AddChild(middle); _topContainer.AddChild(middle);
_topContainer.AddChild(new PanelContainer _topContainer.AddChild(new PanelContainer
{ {
CustomMinimumSize = (0, 2), MinSize = (0, 2),
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#525252ff")} PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#525252ff")}
}); });
CloseButton.OnPressed += _ => Close(); CloseButton.OnPressed += _ => Close();
LayoutContainer.SetSize(this, (300, 200)); SetSize = (300, 200);
} }
@@ -177,17 +161,19 @@ namespace Content.Client.GameObjects.Components.Atmos
}); });
_statusContainer.AddChild(new Label _statusContainer.AddChild(new Label
{ {
Text = Loc.GetString("Temperature: {0:0.#}K ({1:0.#}°C)", state.Temperature, TemperatureHelpers.KelvinToCelsius(state.Temperature)) Text = Loc.GetString("Temperature: {0:0.#}K ({1:0.#}°C)", state.Temperature,
TemperatureHelpers.KelvinToCelsius(state.Temperature))
}); });
// Return here cause all that stuff down there is gas stuff (so we don't get the seperators) // Return here cause all that stuff down there is gas stuff (so we don't get the seperators)
if (state.Gases.Length == 0) if (state.Gases.Length == 0)
{ {
return; return;
} }
// Seperator // Seperator
_statusContainer.AddChild(new Control _statusContainer.AddChild(new Control
{ {
CustomMinimumSize = new Vector2(0, 10) MinSize = new Vector2(0, 10)
}); });
// Add a table with all the gases // Add a table with all the gases
@@ -200,7 +186,7 @@ namespace Content.Client.GameObjects.Components.Atmos
tableKey, tableKey,
new Control new Control
{ {
CustomMinimumSize = new Vector2(20, 0) MinSize = new Vector2(20, 0)
}, },
tableVal tableVal
} }
@@ -210,13 +196,13 @@ namespace Content.Client.GameObjects.Components.Atmos
var minSize = 24; // This basically allows gases which are too small, to be shown properly var minSize = 24; // This basically allows gases which are too small, to be shown properly
var gasBar = new HBoxContainer var gasBar = new HBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
CustomMinimumSize = new Vector2(0, height) MinSize = new Vector2(0, height)
}; };
// Seperator // Seperator
_statusContainer.AddChild(new Control _statusContainer.AddChild(new Control
{ {
CustomMinimumSize = new Vector2(0, 10) MinSize = new Vector2(0, 10)
}); });
var totalGasAmount = 0f; var totalGasAmount = 0f;
@@ -244,8 +230,9 @@ namespace Content.Client.GameObjects.Components.Atmos
var right = (i == state.Gases.Length - 1) ? 0f : 2f; var right = (i == state.Gases.Length - 1) ? 0f : 2f;
gasBar.AddChild(new PanelContainer gasBar.AddChild(new PanelContainer
{ {
ToolTip = Loc.GetString("{0}: {1:0.##} mol ({2:0.#}%)", gas.Name, gas.Amount, (gas.Amount / totalGasAmount) * 100), ToolTip = Loc.GetString("{0}: {1:0.##} mol ({2:0.#}%)", gas.Name, gas.Amount,
SizeFlagsHorizontal = SizeFlags.FillExpand, (gas.Amount / totalGasAmount) * 100),
HorizontalExpand = true,
SizeFlagsStretchRatio = gas.Amount, SizeFlagsStretchRatio = gas.Amount,
MouseFilter = MouseFilterMode.Pass, MouseFilter = MouseFilterMode.Pass,
PanelOverride = new StyleBoxFlat PanelOverride = new StyleBoxFlat
@@ -254,9 +241,10 @@ namespace Content.Client.GameObjects.Components.Atmos
PaddingLeft = left, PaddingLeft = left,
PaddingRight = right PaddingRight = right
}, },
CustomMinimumSize = new Vector2(minSize, 0) MinSize = new Vector2(minSize, 0)
}); });
} }
_statusContainer.AddChild(gasBar); _statusContainer.AddChild(gasBar);
} }

View File

@@ -31,10 +31,9 @@ namespace Content.Client.GameObjects.Components.Atmos
public List<ReleasePressureButton> ReleasePressureButtons { get; private set; } public List<ReleasePressureButton> ReleasePressureButtons { get; private set; }
protected override Vector2? CustomSize => (300, 200);
public GasCanisterWindow() public GasCanisterWindow()
{ {
SetSize = MinSize = (300, 200);
HBoxContainer releasePressureButtons; HBoxContainer releasePressureButtons;
Contents.AddChild(new VBoxContainer Contents.AddChild(new VBoxContainer
@@ -51,7 +50,7 @@ namespace Content.Client.GameObjects.Components.Atmos
{ {
new Label(){ Text = Loc.GetString("Label: ") }, new Label(){ Text = Loc.GetString("Label: ") },
(LabelInput = new LineEdit() { Text = Name, Editable = false, (LabelInput = new LineEdit() { Text = Name, Editable = false,
CustomMinimumSize = new Vector2(200, 30)}), MinSize = new Vector2(200, 30)}),
(EditLabelBtn = new Button()), (EditLabelBtn = new Button()),
} }
}, },

View File

@@ -34,7 +34,7 @@ namespace Content.Client.GameObjects.Components.Body.Scanner
// Left half // Left half
new ScrollContainer new ScrollContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Children = Children =
{ {
(BodyPartList = new ItemList()) (BodyPartList = new ItemList())
@@ -43,13 +43,13 @@ namespace Content.Client.GameObjects.Components.Body.Scanner
// Right half // Right half
new VBoxContainer new VBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Children = Children =
{ {
// Top half of the right half // Top half of the right half
new VBoxContainer new VBoxContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
Children = Children =
{ {
(BodyPartLabel = new Label()), (BodyPartLabel = new Label()),
@@ -66,7 +66,7 @@ namespace Content.Client.GameObjects.Components.Body.Scanner
}, },
new ScrollContainer new ScrollContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
Children = Children =
{ {
(MechanismList = new ItemList()) (MechanismList = new ItemList())
@@ -77,7 +77,7 @@ namespace Content.Client.GameObjects.Components.Body.Scanner
// Bottom half of the right half // Bottom half of the right half
(MechanismInfoLabel = new RichTextLabel (MechanismInfoLabel = new RichTextLabel
{ {
SizeFlagsVertical = SizeFlags.FillExpand VerticalExpand = true
}) })
} }
} }
@@ -88,12 +88,11 @@ namespace Content.Client.GameObjects.Components.Body.Scanner
BodyPartList.OnItemSelected += BodyPartOnItemSelected; BodyPartList.OnItemSelected += BodyPartOnItemSelected;
MechanismList.OnItemSelected += MechanismOnItemSelected; MechanismList.OnItemSelected += MechanismOnItemSelected;
MinSize = SetSize = (800, 600);
} }
public BodyScannerBoundUserInterface Owner { get; } public BodyScannerBoundUserInterface Owner { get; }
protected override Vector2? CustomSize => (800, 600);
private ItemList BodyPartList { get; } private ItemList BodyPartList { get; }
private Label BodyPartLabel { get; } private Label BodyPartLabel { get; }

View File

@@ -15,10 +15,9 @@ namespace Content.Client.GameObjects.Components.Body.Surgery
private readonly VBoxContainer _optionsBox; private readonly VBoxContainer _optionsBox;
private OptionSelectedCallback _optionSelectedCallback; private OptionSelectedCallback _optionSelectedCallback;
protected override Vector2? CustomSize => (300, 400);
public SurgeryWindow() public SurgeryWindow()
{ {
MinSize = SetSize = (300, 400);
Title = Loc.GetString("Surgery"); Title = Loc.GetString("Surgery");
RectClipContent = true; RectClipContent = true;
@@ -28,15 +27,15 @@ namespace Content.Client.GameObjects.Components.Body.Surgery
{ {
new ScrollContainer new ScrollContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
HScrollEnabled = true, HScrollEnabled = true,
VScrollEnabled = true, VScrollEnabled = true,
Children = Children =
{ {
(_optionsBox = new VBoxContainer (_optionsBox = new VBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand HorizontalExpand = true
}) })
} }
} }
@@ -87,8 +86,8 @@ namespace Content.Client.GameObjects.Components.Body.Surgery
Button = new Button Button = new Button
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
ToggleMode = true, ToggleMode = true,
MouseFilter = MouseFilterMode.Stop MouseFilter = MouseFilterMode.Stop
}; };
@@ -101,16 +100,16 @@ namespace Content.Client.GameObjects.Components.Body.Surgery
{ {
(SpriteView = new SpriteView (SpriteView = new SpriteView
{ {
CustomMinimumSize = new Vector2(32.0f, 32.0f) MinSize = new Vector2(32.0f, 32.0f)
}), }),
(DisplayText = new Label (DisplayText = new Label
{ {
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
Text = "N/A", Text = "N/A",
}), }),
(new Control (new Control
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand HorizontalExpand = true
}) })
} }
}); });

View File

@@ -47,14 +47,13 @@ namespace Content.Client.GameObjects.Components.Chemistry.ChemMaster
public Button CreatePills { get; } public Button CreatePills { get; }
public Button CreateBottles { get; } public Button CreateBottles { get; }
protected override Vector2? CustomSize => (400, 200);
/// <summary> /// <summary>
/// Create and initialize the chem master UI client-side. Creates the basic layout, /// Create and initialize the chem master UI client-side. Creates the basic layout,
/// actual data isn't filled in until the server sends data about the chem master. /// actual data isn't filled in until the server sends data about the chem master.
/// </summary> /// </summary>
public ChemMasterWindow() public ChemMasterWindow()
{ {
MinSize = SetSize = (400, 200);
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
Contents.AddChild(new VBoxContainer Contents.AddChild(new VBoxContainer
@@ -67,16 +66,16 @@ namespace Content.Client.GameObjects.Components.Chemistry.ChemMaster
Children = Children =
{ {
new Label {Text = Loc.GetString("Container")}, new Label {Text = Loc.GetString("Container")},
new Control {SizeFlagsHorizontal = SizeFlags.FillExpand}, new Control {HorizontalExpand = true},
(EjectButton = new Button {Text = Loc.GetString("Eject")}) (EjectButton = new Button {Text = Loc.GetString("Eject")})
} }
}, },
//Wrap the container info in a PanelContainer so we can color it's background differently. //Wrap the container info in a PanelContainer so we can color it's background differently.
new PanelContainer new PanelContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsStretchRatio = 6, SizeFlagsStretchRatio = 6,
CustomMinimumSize = (0, 200), MinSize = (0, 200),
PanelOverride = new StyleBoxFlat PanelOverride = new StyleBoxFlat
{ {
BackgroundColor = new Color(27, 27, 30) BackgroundColor = new Color(27, 27, 30)
@@ -86,7 +85,7 @@ namespace Content.Client.GameObjects.Components.Chemistry.ChemMaster
//Currently empty, when server sends state data this will have container contents and fill volume. //Currently empty, when server sends state data this will have container contents and fill volume.
(ContainerInfo = new VBoxContainer (ContainerInfo = new VBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Children = Children =
{ {
new Label new Label
@@ -99,7 +98,7 @@ namespace Content.Client.GameObjects.Components.Chemistry.ChemMaster
}, },
//Padding //Padding
new Control {CustomMinimumSize = (0.0f, 10.0f)}, new Control {MinSize = (0.0f, 10.0f)},
//Buffer //Buffer
new HBoxContainer new HBoxContainer
@@ -107,7 +106,7 @@ namespace Content.Client.GameObjects.Components.Chemistry.ChemMaster
Children = Children =
{ {
new Label {Text = Loc.GetString("Buffer")}, new Label {Text = Loc.GetString("Buffer")},
new Control {SizeFlagsHorizontal = SizeFlags.FillExpand}, new Control {HorizontalExpand = true},
(BufferTransferButton = new Button {Text = Loc.GetString("Transfer"), Pressed = BufferModeTransfer, StyleClasses = { StyleBase.ButtonOpenRight }}), (BufferTransferButton = new Button {Text = Loc.GetString("Transfer"), Pressed = BufferModeTransfer, StyleClasses = { StyleBase.ButtonOpenRight }}),
(BufferDiscardButton = new Button {Text = Loc.GetString("Discard"), Pressed = !BufferModeTransfer, StyleClasses = { StyleBase.ButtonOpenLeft }}) (BufferDiscardButton = new Button {Text = Loc.GetString("Discard"), Pressed = !BufferModeTransfer, StyleClasses = { StyleBase.ButtonOpenLeft }})
} }
@@ -116,9 +115,9 @@ namespace Content.Client.GameObjects.Components.Chemistry.ChemMaster
//Wrap the buffer info in a PanelContainer so we can color it's background differently. //Wrap the buffer info in a PanelContainer so we can color it's background differently.
new PanelContainer new PanelContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsStretchRatio = 6, SizeFlagsStretchRatio = 6,
CustomMinimumSize = (0, 100), MinSize = (0, 100),
PanelOverride = new StyleBoxFlat PanelOverride = new StyleBoxFlat
{ {
BackgroundColor = new Color(27, 27, 30) BackgroundColor = new Color(27, 27, 30)
@@ -128,7 +127,7 @@ namespace Content.Client.GameObjects.Components.Chemistry.ChemMaster
//Buffer reagent list //Buffer reagent list
(BufferInfo = new VBoxContainer (BufferInfo = new VBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Children = Children =
{ {
new Label new Label
@@ -141,7 +140,7 @@ namespace Content.Client.GameObjects.Components.Chemistry.ChemMaster
}, },
//Padding //Padding
new Control {CustomMinimumSize = (0.0f, 10.0f)}, new Control {MinSize = (0.0f, 10.0f)},
//Packaging //Packaging
new HBoxContainer new HBoxContainer
@@ -155,9 +154,9 @@ namespace Content.Client.GameObjects.Components.Chemistry.ChemMaster
//Wrap the packaging info in a PanelContainer so we can color it's background differently. //Wrap the packaging info in a PanelContainer so we can color it's background differently.
new PanelContainer new PanelContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsStretchRatio = 6, SizeFlagsStretchRatio = 6,
CustomMinimumSize = (0, 100), MinSize = (0, 100),
PanelOverride = new StyleBoxFlat PanelOverride = new StyleBoxFlat
{ {
BackgroundColor = new Color(27, 27, 30) BackgroundColor = new Color(27, 27, 30)
@@ -167,7 +166,7 @@ namespace Content.Client.GameObjects.Components.Chemistry.ChemMaster
//Packaging options //Packaging options
(PackagingInfo = new VBoxContainer (PackagingInfo = new VBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
}), }),
} }
@@ -190,12 +189,12 @@ namespace Content.Client.GameObjects.Components.Chemistry.ChemMaster
}; };
PackagingInfo.AddChild(PillInfo); PackagingInfo.AddChild(PillInfo);
var pillPadding = new Control {SizeFlagsHorizontal = SizeFlags.FillExpand}; var pillPadding = new Control {HorizontalExpand = true};
PillInfo.AddChild(pillPadding); PillInfo.AddChild(pillPadding);
PillAmount = new SpinBox PillAmount = new SpinBox
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Value = 1 Value = 1
}; };
PillAmount.InitDefaultButtons(); PillAmount.InitDefaultButtons();
@@ -227,12 +226,12 @@ namespace Content.Client.GameObjects.Components.Chemistry.ChemMaster
}; };
PackagingInfo.AddChild(BottleInfo); PackagingInfo.AddChild(BottleInfo);
var bottlePadding = new Control {SizeFlagsHorizontal = SizeFlags.FillExpand}; var bottlePadding = new Control {HorizontalExpand = true};
BottleInfo.AddChild(bottlePadding); BottleInfo.AddChild(bottlePadding);
BottleAmount = new SpinBox BottleAmount = new SpinBox
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Value = 1 Value = 1
}; };
BottleAmount.InitDefaultButtons(); BottleAmount.InitDefaultButtons();
@@ -351,7 +350,7 @@ namespace Content.Client.GameObjects.Components.Chemistry.ChemMaster
}, },
//Padding //Padding
new Control {SizeFlagsHorizontal = SizeFlags.FillExpand}, new Control {HorizontalExpand = true},
MakeChemButton("1", ReagentUnit.New(1), reagent.ReagentId, false, StyleBase.ButtonOpenRight), MakeChemButton("1", ReagentUnit.New(1), reagent.ReagentId, false, StyleBase.ButtonOpenRight),
MakeChemButton("5", ReagentUnit.New(5), reagent.ReagentId, false, StyleBase.ButtonOpenBoth), MakeChemButton("5", ReagentUnit.New(5), reagent.ReagentId, false, StyleBase.ButtonOpenBoth),
@@ -407,7 +406,7 @@ namespace Content.Client.GameObjects.Components.Chemistry.ChemMaster
}, },
//Padding //Padding
new Control {SizeFlagsHorizontal = SizeFlags.FillExpand}, new Control {HorizontalExpand = true},
MakeChemButton("1", ReagentUnit.New(1), reagent.ReagentId, true, StyleBase.ButtonOpenRight), MakeChemButton("1", ReagentUnit.New(1), reagent.ReagentId, true, StyleBase.ButtonOpenRight),
MakeChemButton("5", ReagentUnit.New(5), reagent.ReagentId, true, StyleBase.ButtonOpenBoth), MakeChemButton("5", ReagentUnit.New(5), reagent.ReagentId, true, StyleBase.ButtonOpenBoth),

View File

@@ -61,14 +61,13 @@ namespace Content.Client.GameObjects.Components.Chemistry.ReagentDispenser
/// <summary>A grid of buttons for each reagent which can be dispensed.</summary> /// <summary>A grid of buttons for each reagent which can be dispensed.</summary>
public GridContainer ChemicalList { get; } public GridContainer ChemicalList { get; }
protected override Vector2? CustomSize => (500, 600);
/// <summary> /// <summary>
/// Create and initialize the dispenser UI client-side. Creates the basic layout, /// Create and initialize the dispenser UI client-side. Creates the basic layout,
/// actual data isn't filled in until the server sends data about the dispenser. /// actual data isn't filled in until the server sends data about the dispenser.
/// </summary> /// </summary>
public ReagentDispenserWindow() public ReagentDispenserWindow()
{ {
SetSize = MinSize = (500, 600);
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
var dispenseAmountGroup = new ButtonGroup(); var dispenseAmountGroup = new ButtonGroup();
@@ -84,7 +83,7 @@ namespace Content.Client.GameObjects.Components.Chemistry.ReagentDispenser
{ {
new Label {Text = Loc.GetString("Amount")}, new Label {Text = Loc.GetString("Amount")},
//Padding //Padding
new Control {CustomMinimumSize = (20, 0)}, new Control {MinSize = (20, 0)},
(DispenseButton1 = new Button {Text = "1", Group = dispenseAmountGroup, StyleClasses = { StyleBase.ButtonOpenRight }}), (DispenseButton1 = new Button {Text = "1", Group = dispenseAmountGroup, StyleClasses = { StyleBase.ButtonOpenRight }}),
(DispenseButton5 = new Button {Text = "5", Group = dispenseAmountGroup, StyleClasses = { StyleBase.ButtonOpenBoth }}), (DispenseButton5 = new Button {Text = "5", Group = dispenseAmountGroup, StyleClasses = { StyleBase.ButtonOpenBoth }}),
(DispenseButton10 = new Button {Text = "10", Group = dispenseAmountGroup, StyleClasses = { StyleBase.ButtonOpenBoth }}), (DispenseButton10 = new Button {Text = "10", Group = dispenseAmountGroup, StyleClasses = { StyleBase.ButtonOpenBoth }}),
@@ -97,14 +96,14 @@ namespace Content.Client.GameObjects.Components.Chemistry.ReagentDispenser
} }
}, },
//Padding //Padding
new Control {CustomMinimumSize = (0.0f, 10.0f)}, new Control {MinSize = (0.0f, 10.0f)},
//Grid of which reagents can be dispensed. //Grid of which reagents can be dispensed.
(ChemicalList = new GridContainer (ChemicalList = new GridContainer
{ {
Columns = 5 Columns = 5
}), }),
//Padding //Padding
new Control {CustomMinimumSize = (0.0f, 10.0f)}, new Control {MinSize = (0.0f, 10.0f)},
new HBoxContainer new HBoxContainer
{ {
Children = Children =
@@ -117,9 +116,9 @@ namespace Content.Client.GameObjects.Components.Chemistry.ReagentDispenser
//Wrap the container info in a PanelContainer so we can color it's background differently. //Wrap the container info in a PanelContainer so we can color it's background differently.
new PanelContainer new PanelContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsStretchRatio = 6, SizeFlagsStretchRatio = 6,
CustomMinimumSize = (0, 150), MinSize = (0, 150),
PanelOverride = new StyleBoxFlat PanelOverride = new StyleBoxFlat
{ {
BackgroundColor = new Color(27, 27, 30) BackgroundColor = new Color(27, 27, 30)
@@ -129,7 +128,7 @@ namespace Content.Client.GameObjects.Components.Chemistry.ReagentDispenser
//Currently empty, when server sends state data this will have container contents and fill volume. //Currently empty, when server sends state data this will have container contents and fill volume.
(ContainerInfo = new VBoxContainer (ContainerInfo = new VBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Children = Children =
{ {
new Label new Label

View File

@@ -1,5 +1,4 @@
#nullable enable #nullable enable
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using Robust.Client.UserInterface; using Robust.Client.UserInterface;
@@ -7,8 +6,6 @@ using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.Localization; using Robust.Shared.Localization;
using Robust.Shared.Maths; using Robust.Shared.Maths;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using static Content.Shared.GameObjects.Components.Medical.SharedCloningPodComponent; using static Content.Shared.GameObjects.Components.Medical.SharedCloningPodComponent;
namespace Content.Client.GameObjects.Components.CloningPod namespace Content.Client.GameObjects.Components.CloningPod
@@ -17,68 +14,36 @@ namespace Content.Client.GameObjects.Components.CloningPod
{ {
private Dictionary<int, string> _scanManager; private Dictionary<int, string> _scanManager;
private readonly VBoxContainer _mainVBox; private readonly VBoxContainer _scanList;
private readonly ScanListContainer _scanList;
private readonly LineEdit _searchBar;
private readonly Button _clearButton;
public readonly Button CloneButton; public readonly Button CloneButton;
public readonly Button EjectButton; public readonly Button EjectButton;
private readonly CloningScanButton _measureButton;
private CloningScanButton? _selectedButton; private CloningScanButton? _selectedButton;
private readonly Label _progressLabel; private readonly Label _progressLabel;
private readonly ProgressBar _cloningProgressBar; private readonly ProgressBar _cloningProgressBar;
private readonly Label _mindState; private readonly Label _mindState;
protected override Vector2 ContentsMinimumSize => _mainVBox?.CombinedMinimumSize ?? Vector2.Zero;
private CloningPodBoundUserInterfaceState _lastUpdate = null!; private CloningPodBoundUserInterfaceState _lastUpdate = null!;
// List of scans that are visible based on current filter criteria.
private readonly Dictionary<int, string> _filteredScans = new();
// The indices of the visible scans last time UpdateVisibleScans was ran.
// This is inclusive, so end is the index of the last scan, not right after it.
private (int start, int end) _lastScanIndices;
public int? SelectedScan; public int? SelectedScan;
protected override Vector2? CustomSize => (250, 300); public CloningPodWindow(Dictionary<int, string> scanManager)
public CloningPodWindow(
Dictionary<int, string> scanManager)
{ {
SetSize = MinSize = (250, 300);
_scanManager = scanManager; _scanManager = scanManager;
Title = Loc.GetString("Cloning Machine"); Title = Loc.GetString("Cloning Machine");
Contents.AddChild(_mainVBox = new VBoxContainer Contents.AddChild(new VBoxContainer
{ {
Children = Children =
{ {
new HBoxContainer
{
Children =
{
(_searchBar = new LineEdit
{
SizeFlagsHorizontal = SizeFlags.FillExpand,
PlaceHolder = Loc.GetString("Search")
}),
(_clearButton = new Button
{
Disabled = true,
Text = Loc.GetString("Clear"),
})
}
},
new ScrollContainer new ScrollContainer
{ {
CustomMinimumSize = new Vector2(200.0f, 0.0f), MinSize = new Vector2(200.0f, 0.0f),
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
Children = Children =
{ {
(_scanList = new ScanListContainer()) (_scanList = new VBoxContainer())
} }
}, },
new VBoxContainer new VBoxContainer
@@ -91,11 +56,9 @@ namespace Content.Client.GameObjects.Components.CloningPod
}) })
} }
}, },
(_measureButton = new CloningScanButton {Visible = false}),
(_cloningProgressBar = new ProgressBar (_cloningProgressBar = new ProgressBar
{ {
CustomMinimumSize = (200, 20), MinSize = (200, 20),
SizeFlagsHorizontal = SizeFlags.Fill,
MinValue = 0, MinValue = 0,
MaxValue = 10, MaxValue = 10,
Page = 0, Page = 0,
@@ -127,13 +90,7 @@ namespace Content.Client.GameObjects.Components.CloningPod
} }
}); });
BuildCloneList();
_searchBar.OnTextChanged += OnSearchBarTextChanged;
_clearButton.OnPressed += OnClearButtonPressed;
BuildEntityList();
_searchBar.GrabKeyboardFocus();
} }
public void Populate(CloningPodBoundUserInterfaceState state) public void Populate(CloningPodBoundUserInterfaceState state)
@@ -143,7 +100,7 @@ namespace Content.Client.GameObjects.Components.CloningPod
if (_lastUpdate == null || _lastUpdate.MindIdName.Count != state.MindIdName.Count) if (_lastUpdate == null || _lastUpdate.MindIdName.Count != state.MindIdName.Count)
{ {
_scanManager = state.MindIdName; _scanManager = state.MindIdName;
BuildEntityList(); BuildCloneList();
_lastUpdate = state; _lastUpdate = state;
} }
@@ -155,116 +112,17 @@ namespace Content.Client.GameObjects.Components.CloningPod
_mindState.FontColorOverride = state.MindPresent ? Color.Green : Color.Red; _mindState.FontColorOverride = state.MindPresent ? Color.Green : Color.Red;
} }
private void OnSearchBarTextChanged(LineEdit.LineEditEventArgs args) private void BuildCloneList()
{ {
BuildEntityList(args.Text);
_clearButton.Disabled = string.IsNullOrEmpty(args.Text);
}
private void OnClearButtonPressed(BaseButton.ButtonEventArgs args)
{
_searchBar.Clear();
BuildEntityList("");
}
private void BuildEntityList(string? searchStr = null)
{
_filteredScans.Clear();
_scanList.RemoveAllChildren();
// Reset last scan indices so it automatically updates the entire list.
_lastScanIndices = (0, -1);
_scanList.RemoveAllChildren(); _scanList.RemoveAllChildren();
_selectedButton = null; _selectedButton = null;
searchStr = searchStr?.ToLowerInvariant();
foreach (var scan in _scanManager) foreach (var scan in _scanManager)
{
if (searchStr != null && !_doesScanMatchSearch(scan.Value, searchStr))
{
continue;
}
_filteredScans.Add(scan.Key, scan.Value);
}
//TODO: set up sort
//_filteredScans.Sort((a, b) => string.Compare(a.ToString(), b.ToString(), StringComparison.Ordinal));
_scanList.TotalItemCount = _filteredScans.Count;
}
private void UpdateVisibleScans()
{
// Update visible buttons in the scan list.
// Calculate index of first scan to render based on current scroll.
var height = _measureButton.CombinedMinimumSize.Y + ScanListContainer.Separation;
var offset = -_scanList.Position.Y;
var startIndex = (int) Math.Floor(offset / height);
_scanList.ItemOffset = startIndex;
var (prevStart, prevEnd) = _lastScanIndices;
// Calculate index of final one.
var endIndex = startIndex - 1;
var spaceUsed = -height; // -height instead of 0 because else it cuts off the last button.
while (spaceUsed < _scanList.Parent!.Height)
{
spaceUsed += height;
endIndex += 1;
}
endIndex = Math.Min(endIndex, _filteredScans.Count - 1);
if (endIndex == prevEnd && startIndex == prevStart)
{
// Nothing changed so bye.
return;
}
_lastScanIndices = (startIndex, endIndex);
// Delete buttons at the start of the list that are no longer visible (scrolling down).
for (var i = prevStart; i < startIndex && i <= prevEnd; i++)
{
var control = (CloningScanButton) _scanList.GetChild(0);
DebugTools.Assert(control.Index == i);
_scanList.RemoveChild(control);
}
// Delete buttons at the end of the list that are no longer visible (scrolling up).
for (var i = prevEnd; i > endIndex && i >= prevStart; i--)
{
var control = (CloningScanButton) _scanList.GetChild(_scanList.ChildCount - 1);
DebugTools.Assert(control.Index == i);
_scanList.RemoveChild(control);
}
var array = _filteredScans.ToArray();
// Create buttons at the start of the list that are now visible (scrolling up).
for (var i = Math.Min(prevStart - 1, endIndex); i >= startIndex; i--)
{
InsertEntityButton(array[i], true, i);
}
// Create buttons at the end of the list that are now visible (scrolling down).
for (var i = Math.Max(prevEnd + 1, startIndex); i <= endIndex; i++)
{
InsertEntityButton(array[i], false, i);
}
}
// Create a spawn button and insert it into the start or end of the list.
private void InsertEntityButton(KeyValuePair<int, string> scan, bool insertFirst, int index)
{ {
var button = new CloningScanButton var button = new CloningScanButton
{ {
Scan = scan.Value, Scan = scan.Value,
Id = scan.Key, Id = scan.Key
Index = index // We track this index purely for debugging.
}; };
button.ActualButton.OnToggled += OnItemButtonToggled; button.ActualButton.OnToggled += OnItemButtonToggled;
var entityLabelText = scan.Value; var entityLabelText = scan.Value;
@@ -293,15 +151,10 @@ namespace Content.Client.GameObjects.Components.CloningPod
*/ */
_scanList.AddChild(button); _scanList.AddChild(button);
if (insertFirst)
{
button.SetPositionInParent(0);
}
} }
private static bool _doesScanMatchSearch(string scan, string searchStr) //TODO: set up sort
{ //_filteredScans.Sort((a, b) => string.Compare(a.ToString(), b.ToString(), StringComparison.Ordinal));
return scan.ToLowerInvariant().Contains(searchStr);
} }
private void OnItemButtonToggled(BaseButton.ButtonToggledEventArgs args) private void OnItemButtonToggled(BaseButton.ButtonToggledEventArgs args)
@@ -325,76 +178,6 @@ namespace Content.Client.GameObjects.Components.CloningPod
SelectedScan = item.Id; SelectedScan = item.Id;
} }
protected override void FrameUpdate(FrameEventArgs args)
{
base.FrameUpdate(args);
UpdateVisibleScans();
}
private class ScanListContainer : Container
{
// Quick and dirty container to do virtualization of the list.
// Basically, get total item count and offset to put the current buttons at.
// Get a constant minimum height and move the buttons in the list up to match the scrollbar.
private int _totalItemCount;
private int _itemOffset;
public int TotalItemCount
{
get => _totalItemCount;
set
{
_totalItemCount = value;
MinimumSizeChanged();
}
}
public int ItemOffset
{
get => _itemOffset;
set
{
_itemOffset = value;
UpdateLayout();
}
}
public const float Separation = 2;
protected override Vector2 CalculateMinimumSize()
{
if (ChildCount == 0)
{
return Vector2.Zero;
}
var first = GetChild(0);
var (minX, minY) = first.CombinedMinimumSize;
return (minX, minY * TotalItemCount + (TotalItemCount - 1) * Separation);
}
protected override void LayoutUpdateOverride()
{
if (ChildCount == 0)
{
return;
}
var first = GetChild(0);
var height = first.CombinedMinimumSize.Y;
var offset = ItemOffset * height + (ItemOffset - 1) * Separation;
foreach (var child in Children)
{
FitChildInBox(child, UIBox2.FromDimensions(0, offset, Width, height));
offset += Separation + height;
}
}
}
[DebuggerDisplay("cloningbutton {" + nameof(Index) + "}")] [DebuggerDisplay("cloningbutton {" + nameof(Index) + "}")]
private class CloningScanButton : Control private class CloningScanButton : Control
{ {
@@ -409,8 +192,8 @@ namespace Content.Client.GameObjects.Components.CloningPod
{ {
AddChild(ActualButton = new Button AddChild(ActualButton = new Button
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
ToggleMode = true, ToggleMode = true,
}); });
@@ -420,16 +203,16 @@ namespace Content.Client.GameObjects.Components.CloningPod
{ {
(EntityTextureRect = new TextureRect (EntityTextureRect = new TextureRect
{ {
CustomMinimumSize = (32, 32), MinSize = (32, 32),
SizeFlagsHorizontal = SizeFlags.ShrinkCenter, HorizontalAlignment = HAlignment.Center,
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
Stretch = TextureRect.StretchMode.KeepAspectCentered, Stretch = TextureRect.StretchMode.KeepAspectCentered,
CanShrink = true CanShrink = true
}), }),
(EntityLabel = new Label (EntityLabel = new Label
{ {
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Text = "", Text = "",
ClipText = true ClipText = true
}) })

View File

@@ -19,80 +19,52 @@ namespace Content.Client.GameObjects.Components.Wires
private readonly List<(string name, LineEdit input)> _inputs; private readonly List<(string name, LineEdit input)> _inputs;
protected override Vector2? CustomSize => (300, 250);
public ConfigurationMenu(ConfigurationBoundUserInterface owner) public ConfigurationMenu(ConfigurationBoundUserInterface owner)
{ {
MinSize = SetSize = (300, 250);
Owner = owner; Owner = owner;
_inputs = new List<(string name, LineEdit input)>(); _inputs = new List<(string name, LineEdit input)>();
Title = Loc.GetString("Device Configuration"); Title = Loc.GetString("Device Configuration");
var margin = new MarginContainer
{
MarginBottomOverride = 8,
MarginLeftOverride = 8,
MarginRightOverride = 8,
MarginTopOverride = 8
};
_baseContainer = new VBoxContainer _baseContainer = new VBoxContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsHorizontal = SizeFlags.FillExpand HorizontalExpand = true
}; };
_column = new VBoxContainer _column = new VBoxContainer
{ {
Margin = new Thickness(8),
SeparationOverride = 16, SeparationOverride = 16,
SizeFlagsVertical = SizeFlags.Fill
}; };
_row = new HBoxContainer _row = new HBoxContainer
{ {
SeparationOverride = 16, SeparationOverride = 16,
SizeFlagsHorizontal = SizeFlags.FillExpand HorizontalExpand = true
};
var buttonRow = new HBoxContainer
{
SizeFlagsHorizontal = SizeFlags.FillExpand
};
var spacer1 = new HBoxContainer
{
SizeFlagsHorizontal = SizeFlags.Expand
};
var spacer2 = new HBoxContainer()
{
SizeFlagsHorizontal = SizeFlags.Expand
}; };
var confirmButton = new Button var confirmButton = new Button
{ {
Text = Loc.GetString("Confirm"), Text = Loc.GetString("Confirm"),
SizeFlagsHorizontal = SizeFlags.ShrinkCenter, HorizontalAlignment = HAlignment.Center,
SizeFlagsVertical = SizeFlags.ShrinkCenter VerticalAlignment = VAlignment.Center
}; };
confirmButton.OnButtonUp += OnConfirm; confirmButton.OnButtonUp += OnConfirm;
buttonRow.AddChild(spacer1);
buttonRow.AddChild(confirmButton);
buttonRow.AddChild(spacer2);
var outerColumn = new ScrollContainer var outerColumn = new ScrollContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
ModulateSelfOverride = Color.FromHex("#202025") ModulateSelfOverride = Color.FromHex("#202025")
}; };
margin.AddChild(_column); outerColumn.AddChild(_column);
outerColumn.AddChild(margin);
_baseContainer.AddChild(outerColumn); _baseContainer.AddChild(outerColumn);
_baseContainer.AddChild(buttonRow); _baseContainer.AddChild(confirmButton);
Contents.AddChild(_baseContainer); Contents.AddChild(_baseContainer);
} }
@@ -103,19 +75,15 @@ namespace Content.Client.GameObjects.Components.Wires
foreach (var field in state.Config) foreach (var field in state.Config)
{ {
var margin = new MarginContainer
{
MarginRightOverride = 8
};
var label = new Label var label = new Label
{ {
Margin = new Thickness(0, 0, 8, 0),
Name = field.Key, Name = field.Key,
Text = field.Key + ":", Text = field.Key + ":",
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsStretchRatio = .2f, SizeFlagsStretchRatio = .2f,
CustomMinimumSize = new Vector2(60, 0) MinSize = new Vector2(60, 0)
}; };
var input = new LineEdit var input = new LineEdit
@@ -123,7 +91,7 @@ namespace Content.Client.GameObjects.Components.Wires
Name = field.Key + "-input", Name = field.Key + "-input",
Text = field.Value, Text = field.Value,
IsValid = Validate, IsValid = Validate,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsStretchRatio = .8f SizeFlagsStretchRatio = .8f
}; };
@@ -132,8 +100,7 @@ namespace Content.Client.GameObjects.Components.Wires
var row = new HBoxContainer(); var row = new HBoxContainer();
CopyProperties(_row, row); CopyProperties(_row, row);
margin.AddChild(label); row.AddChild(label);
row.AddChild(margin);
row.AddChild(input); row.AddChild(input);
_column.AddChild(row); _column.AddChild(row);
} }

View File

@@ -20,10 +20,9 @@ namespace Content.Client.GameObjects.Components.Crayon
private string _selected; private string _selected;
private Color _color; private Color _color;
protected override Vector2? CustomSize => (250, 300);
public CrayonWindow(CrayonBoundUserInterface owner) public CrayonWindow(CrayonBoundUserInterface owner)
{ {
MinSize = SetSize = (250, 300);
Title = Loc.GetString("Crayon"); Title = Loc.GetString("Crayon");
Owner = owner; Owner = owner;
@@ -40,7 +39,7 @@ namespace Content.Client.GameObjects.Components.Crayon
}; };
var gridScroll = new ScrollContainer() var gridScroll = new ScrollContainer()
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
Children = Children =
{ {
_grid _grid

View File

@@ -26,25 +26,18 @@ namespace Content.Client.GameObjects.Components.Disposal
public List<string> TargetList; public List<string> TargetList;
private readonly Label _tagLabel; private readonly Label _tagLabel;
protected override Vector2? CustomSize => (460, 220);
public DisposalMailingUnitWindow() public DisposalMailingUnitWindow()
{ {
MinSize = SetSize = (460, 220);
TargetList = new List<string>(); TargetList = new List<string>();
Contents.AddChild(new HBoxContainer Contents.AddChild(new HBoxContainer
{ {
Children =
{
new MarginContainer
{
MarginLeftOverride = 8,
MarginRightOverride = 8,
SizeFlagsHorizontal = SizeFlags.FillExpand,
Children = Children =
{ {
new VBoxContainer new VBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Margin = new Thickness(8, 0),
Children = Children =
{ {
new HBoxContainer new HBoxContainer
@@ -52,22 +45,22 @@ namespace Content.Client.GameObjects.Components.Disposal
Children = Children =
{ {
new Label {Text = Loc.GetString("State: ")}, new Label {Text = Loc.GetString("State: ")},
new Control {CustomMinimumSize = (4, 0)}, new Control {MinSize = (4, 0)},
(_unitState = new Label {Text = Loc.GetString("Ready")}) (_unitState = new Label {Text = Loc.GetString("Ready")})
} }
}, },
new Control {CustomMinimumSize = (0, 10)}, new Control {MinSize = (0, 10)},
new HBoxContainer new HBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Children = Children =
{ {
new Label {Text = Loc.GetString("Pressure:")}, new Label {Text = Loc.GetString("Pressure:")},
new Control {CustomMinimumSize = (4, 0)}, new Control {MinSize = (4, 0)},
(_pressureBar = new ProgressBar (_pressureBar = new ProgressBar
{ {
CustomMinimumSize = (100, 20), MinSize = (100, 20),
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
MinValue = 0, MinValue = 0,
MaxValue = 1, MaxValue = 1,
Page = 0, Page = 0,
@@ -79,45 +72,48 @@ namespace Content.Client.GameObjects.Components.Disposal
}) })
} }
}, },
new Control {CustomMinimumSize = (0, 10)}, new Control {MinSize = (0, 10)},
new HBoxContainer new HBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Children = Children =
{ {
new Label {Text = Loc.GetString("Handle:")}, new Label {Text = Loc.GetString("Handle:")},
new Control { new Control
CustomMinimumSize = (4, 0), {
SizeFlagsHorizontal = SizeFlags.FillExpand MinSize = (4, 0),
HorizontalExpand = true
}, },
(Engage = new Button (Engage = new Button
{ {
CustomMinimumSize = (16, 0), MinSize = (16, 0),
Text = Loc.GetString("Engage"), Text = Loc.GetString("Engage"),
ToggleMode = true, ToggleMode = true,
Disabled = true Disabled = true
}) })
} }
}, },
new Control {CustomMinimumSize = (0, 10)}, new Control {MinSize = (0, 10)},
new HBoxContainer new HBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Children = Children =
{ {
new Label {Text = Loc.GetString("Eject:")}, new Label {Text = Loc.GetString("Eject:")},
new Control { new Control
CustomMinimumSize = (4, 0), {
SizeFlagsHorizontal = SizeFlags.FillExpand MinSize = (4, 0),
HorizontalExpand = true
}, },
(Eject = new Button { (Eject = new Button
CustomMinimumSize = (16, 0), {
MinSize = (16, 0),
Text = Loc.GetString("Eject Contents"), Text = Loc.GetString("Eject Contents"),
//SizeFlagsHorizontal = SizeFlags.ShrinkEnd //HorizontalAlignment = HAlignment.Right
}) })
} }
}, },
new Control {CustomMinimumSize = (0, 10)}, new Control {MinSize = (0, 10)},
new HBoxContainer new HBoxContainer
{ {
Children = Children =
@@ -127,18 +123,9 @@ namespace Content.Client.GameObjects.Components.Disposal
} }
} }
}, },
}
},
new MarginContainer
{
MarginLeftOverride = 12,
MarginRightOverride = 8,
SizeFlagsHorizontal = SizeFlags.FillExpand,
Children =
{
new VBoxContainer new VBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.Fill, Margin = new Thickness(12, 0, 8, 0),
Children = Children =
{ {
new HBoxContainer new HBoxContainer
@@ -151,17 +138,17 @@ namespace Content.Client.GameObjects.Components.Disposal
} }
} }
}, },
new Control { CustomMinimumSize = new Vector2(0, 8) }, new Control {MinSize = new Vector2(0, 8)},
new HBoxContainer new HBoxContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
Children = Children =
{ {
(TargetListContainer = new ItemList (TargetListContainer = new ItemList
{ {
SelectMode = ItemList.ItemListSelectMode.Single, SelectMode = ItemList.ItemListSelectMode.Single,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand VerticalExpand = true
}) })
} }
}, },
@@ -171,8 +158,8 @@ namespace Content.Client.GameObjects.Components.Disposal
{ {
BackgroundColor = Color.FromHex("#ACBDBA") BackgroundColor = Color.FromHex("#ACBDBA")
}, },
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
CustomMinimumSize = new Vector2(0, 1), MinSize = new Vector2(0, 1),
}, },
new HBoxContainer new HBoxContainer
{ {
@@ -180,16 +167,11 @@ namespace Content.Client.GameObjects.Components.Disposal
{ {
new VBoxContainer new VBoxContainer
{ {
Children =
{
new MarginContainer
{
MarginLeftOverride = 4,
Children = Children =
{ {
new HBoxContainer new HBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, Margin = new Thickness(4, 0, 0, 0),
Children = Children =
{ {
new Label new Label
@@ -198,20 +180,16 @@ namespace Content.Client.GameObjects.Components.Disposal
}, },
new Control new Control
{ {
CustomMinimumSize = new Vector2(4, 0) MinSize = new Vector2(4, 0)
}, },
(_tagLabel = new Label (_tagLabel = new Label
{ {
Text = "-", Text = "-",
SizeFlagsVertical = SizeFlags.ShrinkEnd VerticalAlignment = VAlignment.Bottom
}) })
} }
} }
} }
},
}
}
}
} }
} }
} }

View File

@@ -16,10 +16,9 @@ namespace Content.Client.GameObjects.Components.Disposal
public readonly LineEdit TagInput; public readonly LineEdit TagInput;
public readonly Button Confirm; public readonly Button Confirm;
protected override Vector2? CustomSize => (400, 80);
public DisposalRouterWindow() public DisposalRouterWindow()
{ {
MinSize = SetSize = (400, 80);
Title = Loc.GetString("Disposal Router"); Title = Loc.GetString("Disposal Router");
Contents.AddChild(new VBoxContainer Contents.AddChild(new VBoxContainer
@@ -27,14 +26,19 @@ namespace Content.Client.GameObjects.Components.Disposal
Children = Children =
{ {
new Label {Text = Loc.GetString("Tags:")}, new Label {Text = Loc.GetString("Tags:")},
new Control {CustomMinimumSize = (0, 10)}, new Control {MinSize = (0, 10)},
new HBoxContainer new HBoxContainer
{ {
Children = Children =
{ {
(TagInput = new LineEdit {SizeFlagsHorizontal = SizeFlags.Expand, CustomMinimumSize = (320, 0), (TagInput = new LineEdit
ToolTip = Loc.GetString("A comma separated list of tags"), IsValid = tags => TagRegex.IsMatch(tags)}), {
new Control {CustomMinimumSize = (10, 0)}, HorizontalExpand = true,
MinSize = (320, 0),
ToolTip = Loc.GetString("A comma separated list of tags"),
IsValid = tags => TagRegex.IsMatch(tags)
}),
new Control {MinSize = (10, 0)},
(Confirm = new Button {Text = Loc.GetString("Confirm")}) (Confirm = new Button {Text = Loc.GetString("Confirm")})
} }
} }

View File

@@ -16,10 +16,9 @@ namespace Content.Client.GameObjects.Components.Disposal
public readonly LineEdit TagInput; public readonly LineEdit TagInput;
public readonly Button Confirm; public readonly Button Confirm;
protected override Vector2? CustomSize => (400, 80);
public DisposalTaggerWindow() public DisposalTaggerWindow()
{ {
MinSize = SetSize = (400, 80);
Title = Loc.GetString("Disposal Tagger"); Title = Loc.GetString("Disposal Tagger");
Contents.AddChild(new VBoxContainer Contents.AddChild(new VBoxContainer
@@ -27,14 +26,18 @@ namespace Content.Client.GameObjects.Components.Disposal
Children = Children =
{ {
new Label {Text = Loc.GetString("Tag:")}, new Label {Text = Loc.GetString("Tag:")},
new Control {CustomMinimumSize = (0, 10)}, new Control {MinSize = (0, 10)},
new HBoxContainer new HBoxContainer
{ {
Children = Children =
{ {
(TagInput = new LineEdit {SizeFlagsHorizontal = SizeFlags.Expand, CustomMinimumSize = (320, 0), (TagInput = new LineEdit
IsValid = tag => TagRegex.IsMatch(tag)}), {
new Control {CustomMinimumSize = (10, 0)}, HorizontalExpand = true,
MinSize = (320, 0),
IsValid = tag => TagRegex.IsMatch(tag)
}),
new Control {MinSize = (10, 0)},
(Confirm = new Button {Text = Loc.GetString("Confirm")}) (Confirm = new Button {Text = Loc.GetString("Confirm")})
} }
} }

View File

@@ -21,10 +21,10 @@ namespace Content.Client.GameObjects.Components.Disposal
public readonly Button Eject; public readonly Button Eject;
public readonly Button Power; public readonly Button Power;
protected override Vector2? CustomSize => (300, 200);
public DisposalUnitWindow() public DisposalUnitWindow()
{ {
MinSize = SetSize = (300, 200);
Contents.AddChild(new VBoxContainer Contents.AddChild(new VBoxContainer
{ {
Children = Children =
@@ -37,7 +37,7 @@ namespace Content.Client.GameObjects.Components.Disposal
(_unitState = new Label {Text = Loc.GetString("Ready")}) (_unitState = new Label {Text = Loc.GetString("Ready")})
} }
}, },
new Control {CustomMinimumSize = (0, 10)}, new Control {MinSize = (0, 10)},
new HBoxContainer new HBoxContainer
{ {
Children = Children =
@@ -45,8 +45,8 @@ namespace Content.Client.GameObjects.Components.Disposal
new Label {Text = Loc.GetString("Pressure:")}, new Label {Text = Loc.GetString("Pressure:")},
(_pressureBar = new ProgressBar (_pressureBar = new ProgressBar
{ {
CustomMinimumSize = (200, 20), MinSize = (200, 20),
SizeFlagsHorizontal = SizeFlags.ShrinkEnd, HorizontalAlignment = HAlignment.Right,
MinValue = 0, MinValue = 0,
MaxValue = 1, MaxValue = 1,
Page = 0, Page = 0,
@@ -58,7 +58,7 @@ namespace Content.Client.GameObjects.Components.Disposal
}) })
} }
}, },
new Control {CustomMinimumSize = (0, 10)}, new Control {MinSize = (0, 10)},
new HBoxContainer new HBoxContainer
{ {
Children = Children =
@@ -71,7 +71,7 @@ namespace Content.Client.GameObjects.Components.Disposal
}) })
} }
}, },
new Control {CustomMinimumSize = (0, 10)}, new Control {MinSize = (0, 10)},
new HBoxContainer new HBoxContainer
{ {
Children = Children =
@@ -80,7 +80,7 @@ namespace Content.Client.GameObjects.Components.Disposal
(Eject = new Button {Text = Loc.GetString("Eject Contents")}) (Eject = new Button {Text = Loc.GetString("Eject Contents")})
} }
}, },
new Control {CustomMinimumSize = (0, 10)}, new Control {MinSize = (0, 10)},
new HBoxContainer new HBoxContainer
{ {
Children = Children =

View File

@@ -73,7 +73,7 @@ namespace Content.Client.GameObjects.Components.Gravity
var vBox = new VBoxContainer var vBox = new VBoxContainer
{ {
CustomMinimumSize = new Vector2(250, 100) MinSize = new Vector2(250, 100)
}; };
Status = new Label Status = new Label
{ {
@@ -84,7 +84,7 @@ namespace Content.Client.GameObjects.Components.Gravity
{ {
Text = Loc.GetString(Owner.IsOn ? "Turn Off" : "Turn On"), Text = Loc.GetString(Owner.IsOn ? "Turn Off" : "Turn On"),
TextAlign = Label.AlignMode.Center, TextAlign = Label.AlignMode.Center,
CustomMinimumSize = new Vector2(150, 60) MinSize = new Vector2(150, 60)
}; };
vBox.AddChild(Status); vBox.AddChild(Status);

View File

@@ -87,7 +87,7 @@ namespace Content.Client.GameObjects.Components.HUD.Inventory
_hudButtonPocket1, _hudButtonPocket1,
_hudButtonPocket2, _hudButtonPocket2,
// keeps this "balanced" with the left, so the hands will appear perfectly in the center // keeps this "balanced" with the left, so the hands will appear perfectly in the center
new Control{CustomMinimumSize = (64, 64)} new Control{MinSize = (64, 64)}
}, },
SeparationOverride = 5 SeparationOverride = 5
}; };
@@ -226,7 +226,7 @@ namespace Content.Client.GameObjects.Components.HUD.Inventory
const int width = ButtonSize * 4 + ButtonSeparation * 3 + RightSeparation; const int width = ButtonSize * 4 + ButtonSeparation * 3 + RightSeparation;
const int height = ButtonSize * 4 + ButtonSeparation * 3; const int height = ButtonSize * 4 + ButtonSeparation * 3;
var windowContents = new LayoutContainer {CustomMinimumSize = (width, height)}; var windowContents = new LayoutContainer {MinSize = (width, height)};
Contents.AddChild(windowContents); Contents.AddChild(windowContents);
void AddButton(Slots slot, string textureName, Vector2 position) void AddButton(Slots slot, string textureName, Vector2 position)

View File

@@ -57,14 +57,14 @@ namespace Content.Client.GameObjects.Components
var wrapper = new HBoxContainer var wrapper = new HBoxContainer
{ {
SeparationOverride = 4, SeparationOverride = 4,
SizeFlagsHorizontal = SizeFlags.ShrinkCenter HorizontalAlignment = HAlignment.Center
}; };
AddChild(wrapper); AddChild(wrapper);
for (var i = 0; i < _sections.Length; i++) for (var i = 0; i < _sections.Length; i++)
{ {
var panel = new PanelContainer {CustomMinimumSize = (20, 20)}; var panel = new PanelContainer {MinSize = (20, 20)};
wrapper.AddChild(panel); wrapper.AddChild(panel);
_sections[i] = panel; _sections[i] = panel;
} }

View File

@@ -139,8 +139,6 @@ namespace Content.Client.GameObjects.Components.Kitchen
} }
protected override Vector2? CustomSize => (512, 256);
private MicrowaveBoundUserInterface Owner { get; set; } private MicrowaveBoundUserInterface Owner { get; set; }
public event Action<BaseButton.ButtonEventArgs, int> OnCookTimeSelected; public event Action<BaseButton.ButtonEventArgs, int> OnCookTimeSelected;
@@ -165,54 +163,49 @@ namespace Content.Client.GameObjects.Components.Kitchen
public MicrowaveMenu(MicrowaveBoundUserInterface owner = null) public MicrowaveMenu(MicrowaveBoundUserInterface owner = null)
{ {
SetSize = MinSize = (512, 256);
Owner = owner; Owner = owner;
Title = Loc.GetString("Microwave"); Title = Loc.GetString("Microwave");
DisableCookingPanelOverlay = new PanelContainer DisableCookingPanelOverlay = new PanelContainer
{ {
MouseFilter = MouseFilterMode.Stop, MouseFilter = MouseFilterMode.Stop,
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.Black.WithAlpha(0.60f)}, PanelOverride = new StyleBoxFlat {BackgroundColor = Color.Black.WithAlpha(0.60f)},
SizeFlagsHorizontal = SizeFlags.Fill,
SizeFlagsVertical = SizeFlags.Fill,
}; };
var hSplit = new HBoxContainer();
var hSplit = new HBoxContainer
{
SizeFlagsHorizontal = SizeFlags.Fill,
SizeFlagsVertical = SizeFlags.Fill
};
IngredientsListReagents = new ItemList IngredientsListReagents = new ItemList
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SelectMode = ItemList.ItemListSelectMode.Button, SelectMode = ItemList.ItemListSelectMode.Button,
SizeFlagsStretchRatio = 2, SizeFlagsStretchRatio = 2,
CustomMinimumSize = (100, 128) MinSize = (100, 128)
}; };
IngredientsList = new ItemList IngredientsList = new ItemList
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SelectMode = ItemList.ItemListSelectMode.Button, SelectMode = ItemList.ItemListSelectMode.Button,
SizeFlagsStretchRatio = 2, SizeFlagsStretchRatio = 2,
CustomMinimumSize = (100, 128) MinSize = (100, 128)
}; };
hSplit.AddChild(IngredientsListReagents); hSplit.AddChild(IngredientsListReagents);
//Padding between the lists. //Padding between the lists.
hSplit.AddChild(new Control hSplit.AddChild(new Control
{ {
CustomMinimumSize = (0, 5), MinSize = (0, 5),
}); });
hSplit.AddChild(IngredientsList); hSplit.AddChild(IngredientsList);
var vSplit = new VBoxContainer var vSplit = new VBoxContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
}; };
hSplit.AddChild(vSplit); hSplit.AddChild(vSplit);
@@ -243,14 +236,13 @@ namespace Content.Client.GameObjects.Components.Kitchen
//Padding //Padding
vSplit.AddChild(new Control vSplit.AddChild(new Control
{ {
CustomMinimumSize = (0, 15), MinSize = (0, 15),
SizeFlagsVertical = SizeFlags.Fill,
}); });
CookTimeButtonGroup = new ButtonGroup(); CookTimeButtonGroup = new ButtonGroup();
CookTimeButtonVbox = new VBoxContainer CookTimeButtonVbox = new VBoxContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
Align = BoxContainer.AlignMode.Center, Align = BoxContainer.AlignMode.Center,
}; };
@@ -284,14 +276,14 @@ namespace Content.Client.GameObjects.Components.Kitchen
Text = Loc.GetString("COOK TIME: 1"), Text = Loc.GetString("COOK TIME: 1"),
Align = Label.AlignMode.Center, Align = Label.AlignMode.Center,
Modulate = Color.White, Modulate = Color.White,
SizeFlagsVertical = SizeFlags.ShrinkCenter VerticalAlignment = VAlignment.Center
}; };
var innerTimerPanel = new PanelContainer var innerTimerPanel = new PanelContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
ModulateSelfOverride = Color.Red, ModulateSelfOverride = Color.Red,
CustomMinimumSize = (100, 128), MinSize = (100, 128),
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.Black.WithAlpha(0.5f)}, PanelOverride = new StyleBoxFlat {BackgroundColor = Color.Black.WithAlpha(0.5f)},
Children = Children =
@@ -312,7 +304,7 @@ namespace Content.Client.GameObjects.Components.Kitchen
new ScrollContainer() new ScrollContainer()
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
Children = Children =
{ {
@@ -326,8 +318,8 @@ namespace Content.Client.GameObjects.Components.Kitchen
TimerFacePlate = new PanelContainer() TimerFacePlate = new PanelContainer()
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Children = Children =
{ {
innerTimerPanel innerTimerPanel

View File

@@ -156,7 +156,6 @@ namespace Content.Client.GameObjects.Components.Kitchen
*/ */
private ReagentGrinderBoundUserInterface Owner { get; set; } private ReagentGrinderBoundUserInterface Owner { get; set; }
protected override Vector2? CustomSize => (512, 256);
//We'll need 4 buttons, grind, juice, eject beaker, eject the chamber contents. //We'll need 4 buttons, grind, juice, eject beaker, eject the chamber contents.
//The other 2 are referenced in the Open function. //The other 2 are referenced in the Open function.
@@ -202,11 +201,11 @@ namespace Content.Client.GameObjects.Components.Kitchen
AddChild(vSplit); AddChild(vSplit);
BoxContents = new ItemList BoxContents = new ItemList
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SelectMode = ItemList.ItemListSelectMode.Button, SelectMode = ItemList.ItemListSelectMode.Button,
SizeFlagsStretchRatio = 2, SizeFlagsStretchRatio = 2,
CustomMinimumSize = (100, 128) MinSize = (100, 128)
}; };
AddChild(BoxContents); AddChild(BoxContents);
} }
@@ -214,47 +213,44 @@ namespace Content.Client.GameObjects.Components.Kitchen
public GrinderMenu(ReagentGrinderBoundUserInterface owner = null) public GrinderMenu(ReagentGrinderBoundUserInterface owner = null)
{ {
SetSize = MinSize = (512, 256);
Owner = owner; Owner = owner;
Title = Loc.GetString("All-In-One Grinder 3000"); Title = Loc.GetString("All-In-One Grinder 3000");
var hSplit = new HBoxContainer var hSplit = new HBoxContainer();
{
SizeFlagsHorizontal = SizeFlags.Fill,
SizeFlagsVertical = SizeFlags.Fill
};
var vBoxGrindJuiceButtonPanel = new VBoxContainer var vBoxGrindJuiceButtonPanel = new VBoxContainer
{ {
SizeFlagsVertical = SizeFlags.ShrinkCenter VerticalAlignment = VAlignment.Center
}; };
GrindButton = new Button GrindButton = new Button
{ {
Text = Loc.GetString("Grind"), Text = Loc.GetString("Grind"),
TextAlign = Label.AlignMode.Center, TextAlign = Label.AlignMode.Center,
CustomMinimumSize = (64, 64) MinSize = (64, 64)
}; };
JuiceButton = new Button JuiceButton = new Button
{ {
Text = Loc.GetString("Juice"), Text = Loc.GetString("Juice"),
TextAlign = Label.AlignMode.Center, TextAlign = Label.AlignMode.Center,
CustomMinimumSize = (64, 64) MinSize = (64, 64)
}; };
vBoxGrindJuiceButtonPanel.AddChild(GrindButton); vBoxGrindJuiceButtonPanel.AddChild(GrindButton);
//inner button padding //inner button padding
vBoxGrindJuiceButtonPanel.AddChild(new Control vBoxGrindJuiceButtonPanel.AddChild(new Control
{ {
CustomMinimumSize = (0, 16), MinSize = (0, 16),
}); });
vBoxGrindJuiceButtonPanel.AddChild(JuiceButton); vBoxGrindJuiceButtonPanel.AddChild(JuiceButton);
ChamberContentBox = new LabelledContentBox(Loc.GetString("Chamber"), Loc.GetString("Eject Contents")) ChamberContentBox = new LabelledContentBox(Loc.GetString("Chamber"), Loc.GetString("Eject Contents"))
{ {
//Modulate = Color.Red, //Modulate = Color.Red,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsStretchRatio = 2, SizeFlagsStretchRatio = 2,
}; };
@@ -262,8 +258,8 @@ namespace Content.Client.GameObjects.Components.Kitchen
BeakerContentBox = new LabelledContentBox(Loc.GetString("Beaker"), Loc.GetString("Eject Beaker")) BeakerContentBox = new LabelledContentBox(Loc.GetString("Beaker"), Loc.GetString("Eject Beaker"))
{ {
//Modulate = Color.Blue, //Modulate = Color.Blue,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsStretchRatio = 2, SizeFlagsStretchRatio = 2,
}; };
@@ -272,14 +268,14 @@ namespace Content.Client.GameObjects.Components.Kitchen
//Padding between the g/j buttons panel and the itemlist boxes panel. //Padding between the g/j buttons panel and the itemlist boxes panel.
hSplit.AddChild(new Control hSplit.AddChild(new Control
{ {
CustomMinimumSize = (16, 0), MinSize = (16, 0),
}); });
hSplit.AddChild(ChamberContentBox); hSplit.AddChild(ChamberContentBox);
//Padding between the two itemlists. //Padding between the two itemlists.
hSplit.AddChild(new Control hSplit.AddChild(new Control
{ {
CustomMinimumSize = (8, 0), MinSize = (8, 0),
}); });
hSplit.AddChild(BeakerContentBox); hSplit.AddChild(BeakerContentBox);
Contents.AddChild(hSplit); Contents.AddChild(hSplit);

View File

@@ -136,8 +136,8 @@ namespace Content.Client.GameObjects.Components
Items = new ItemList Items = new ItemList
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
CustomMinimumSize = (300, 250) MinSize = (300, 250)
}; };
vBox.AddChild(Items); vBox.AddChild(Items);
Items.OnItemSelected += ItemSelected; Items.OnItemSelected += ItemSelected;
@@ -202,13 +202,13 @@ namespace Content.Client.GameObjects.Components
_slider = new Slider _slider = new Slider
{ {
StyleClasses = {styleClass}, StyleClasses = {styleClass},
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
MaxValue = byte.MaxValue MaxValue = byte.MaxValue
}; };
_textBox = new LineEdit _textBox = new LineEdit
{ {
CustomMinimumSize = (50, 0) MinSize = (50, 0)
}; };
AddChild(new HBoxContainer AddChild(new HBoxContainer
@@ -261,18 +261,17 @@ namespace Content.Client.GameObjects.Components
private readonly HairStylePicker _hairStylePicker; private readonly HairStylePicker _hairStylePicker;
private readonly FacialHairStylePicker _facialHairStylePicker; private readonly FacialHairStylePicker _facialHairStylePicker;
protected override Vector2? CustomSize => (500, 360);
public MagicMirrorWindow(MagicMirrorBoundUserInterface owner) public MagicMirrorWindow(MagicMirrorBoundUserInterface owner)
{ {
SetSize = MinSize = (500, 360);
Title = Loc.GetString("Magic Mirror"); Title = Loc.GetString("Magic Mirror");
_hairStylePicker = new HairStylePicker {SizeFlagsHorizontal = SizeFlags.FillExpand}; _hairStylePicker = new HairStylePicker {HorizontalExpand = true};
_hairStylePicker.Populate(); _hairStylePicker.Populate();
_hairStylePicker.OnHairStylePicked += newStyle => owner.HairSelected(newStyle, false); _hairStylePicker.OnHairStylePicked += newStyle => owner.HairSelected(newStyle, false);
_hairStylePicker.OnHairColorPicked += newColor => owner.HairColorSelected(newColor, false); _hairStylePicker.OnHairColorPicked += newColor => owner.HairColorSelected(newColor, false);
_facialHairStylePicker = new FacialHairStylePicker {SizeFlagsHorizontal = SizeFlags.FillExpand}; _facialHairStylePicker = new FacialHairStylePicker {HorizontalExpand = true};
_facialHairStylePicker.Populate(); _facialHairStylePicker.Populate();
_facialHairStylePicker.OnHairStylePicked += newStyle => owner.HairSelected(newStyle, true); _facialHairStylePicker.OnHairStylePicked += newStyle => owner.HairSelected(newStyle, true);
_facialHairStylePicker.OnHairColorPicked += newColor => owner.HairColorSelected(newColor, true); _facialHairStylePicker.OnHairColorPicked += newColor => owner.HairColorSelected(newColor, true);

View File

@@ -14,10 +14,10 @@ namespace Content.Client.GameObjects.Components.MedicalScanner
{ {
public readonly Button ScanButton; public readonly Button ScanButton;
private readonly Label _diagnostics; private readonly Label _diagnostics;
protected override Vector2? CustomSize => (485, 90);
public MedicalScannerWindow() public MedicalScannerWindow()
{ {
MinSize = SetSize = (485, 90);
Contents.AddChild(new VBoxContainer Contents.AddChild(new VBoxContainer
{ {
Children = Children =

View File

@@ -40,7 +40,7 @@ namespace Content.Client.GameObjects.Components.Observer
(new Control() (new Control()
{ {
CustomMinimumSize = (20, 0) MinSize = (20, 0)
}), }),
(DenyButton = new Button (DenyButton = new Button

View File

@@ -3,7 +3,7 @@
<RichTextLabel Name="Title" /> <RichTextLabel Name="Title" />
<HBoxContainer SeparationOverride="10"> <HBoxContainer SeparationOverride="10">
<RichTextLabel Name="Description" SizeFlagsHorizontal="FillExpand" /> <RichTextLabel Name="Description" HorizontalExpand="True" />
<Button Name="RequestButton" Text="Request" TextAlign="Center" SizeFlagsHorizontal="ShrinkEnd" /> <Button Name="RequestButton" Text="Request" TextAlign="Center" SizeFlagsHorizontal="ShrinkEnd" />
</HBoxContainer> </HBoxContainer>
</VBoxContainer> </VBoxContainer>

View File

@@ -1,10 +1,10 @@
<SS14Window Title="Ghost Roles" <SS14Window Title="Ghost Roles"
xmlns="https://spacestation14.io"> xmlns="https://spacestation14.io" MinSize="350 275">
<CenterContainer Name="NoRolesMessage" SizeFlagsVertical="FillExpand" SizeFlagsHorizontal="FillExpand"> <CenterContainer Name="NoRolesMessage" VerticalExpand="True" HorizontalExpand="True">
<Label Text="There are currently no available ghost roles." /> <Label Text="There are currently no available ghost roles." />
</CenterContainer> </CenterContainer>
<ScrollContainer SizeFlagsHorizontal="FillExpand" SizeFlagsVertical="FillExpand"> <ScrollContainer HorizontalExpand="True" VerticalExpand="True">
<VBoxContainer Name="EntryContainer" SizeFlagsHorizontal="FillExpand" SizeFlagsVertical="FillExpand" /> <VBoxContainer Name="EntryContainer" HorizontalExpand="True" VerticalExpand="True" />
</ScrollContainer> </ScrollContainer>
</SS14Window> </SS14Window>

View File

@@ -12,8 +12,6 @@ namespace Content.Client.GameObjects.Components.Observer.GhostRoles
{ {
public event Action<uint> RoleRequested; public event Action<uint> RoleRequested;
protected override Vector2 CalculateMinimumSize() => (350, 275);
public void ClearEntries() public void ClearEntries()
{ {
EntryContainer.DisposeAllChildren(); EntryContainer.DisposeAllChildren();

View File

@@ -8,11 +8,11 @@
</HBoxContainer> </HBoxContainer>
<HBoxContainer> <HBoxContainer>
<Label Name="RoleNameLabel" Text="Role Name" /> <Label Name="RoleNameLabel" Text="Role Name" />
<LineEdit Name="RoleName" SizeFlagsHorizontal="FillExpand" /> <LineEdit Name="RoleName" HorizontalExpand="True" />
</HBoxContainer> </HBoxContainer>
<HBoxContainer> <HBoxContainer>
<Label Name="RoleDescriptionLabel" Text="Role Description" /> <Label Name="RoleDescriptionLabel" Text="Role Description" />
<LineEdit Name="RoleDescription" SizeFlagsHorizontal="FillExpand" /> <LineEdit Name="RoleDescription" HorizontalExpand="True" />
</HBoxContainer> </HBoxContainer>
<HBoxContainer> <HBoxContainer>
<Label Name="MakeSentientLabel" Text="Make Sentient" /> <Label Name="MakeSentientLabel" Text="Make Sentient" />

View File

@@ -16,12 +16,12 @@ namespace Content.Client.GameObjects.Components.Observer.GhostRoles
{ {
RobustXamlLoader.Load(this); RobustXamlLoader.Load(this);
MakeSentientLabel.CustomMinimumSize = (150, 0); MakeSentientLabel.MinSize = (150, 0);
RoleEntityLabel.CustomMinimumSize = (150, 0); RoleEntityLabel.MinSize = (150, 0);
RoleNameLabel.CustomMinimumSize = (150, 0); RoleNameLabel.MinSize = (150, 0);
RoleName.CustomMinimumSize = (300, 0); RoleName.MinSize = (300, 0);
RoleDescriptionLabel.CustomMinimumSize = (150, 0); RoleDescriptionLabel.MinSize = (150, 0);
RoleDescription.CustomMinimumSize = (300, 0); RoleDescription.MinSize = (300, 0);
MakeButton.OnPressed += OnPressed; MakeButton.OnPressed += OnPressed;
} }

View File

@@ -221,8 +221,6 @@ namespace Content.Client.GameObjects.Components.PDA
private class PDAMenu : SS14Window private class PDAMenu : SS14Window
{ {
protected override Vector2? CustomSize => (512, 256);
private PDABoundUserInterface _owner { get; } private PDABoundUserInterface _owner { get; }
public Button FlashLightToggleButton { get; } public Button FlashLightToggleButton { get; }
@@ -275,6 +273,8 @@ namespace Content.Client.GameObjects.Components.PDA
public PDAMenu(PDABoundUserInterface owner, IPrototypeManager prototypeManager) public PDAMenu(PDABoundUserInterface owner, IPrototypeManager prototypeManager)
{ {
MinSize = SetSize = (512, 256);
_owner = owner; _owner = owner;
_prototypeManager = prototypeManager; _prototypeManager = prototypeManager;
Title = Loc.GetString("PDA"); Title = Loc.GetString("PDA");
@@ -287,20 +287,20 @@ namespace Content.Client.GameObjects.Components.PDA
IDInfoLabel = new RichTextLabel() IDInfoLabel = new RichTextLabel()
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
}; };
EjectIDButton = new Button EjectIDButton = new Button
{ {
Text = Loc.GetString("Eject ID"), Text = Loc.GetString("Eject ID"),
SizeFlagsHorizontal = SizeFlags.ShrinkCenter, HorizontalAlignment = HAlignment.Center,
SizeFlagsVertical = SizeFlags.ShrinkCenter VerticalAlignment = VAlignment.Center
}; };
EjectPenButton = new Button EjectPenButton = new Button
{ {
Text = Loc.GetString("Eject Pen"), Text = Loc.GetString("Eject Pen"),
SizeFlagsHorizontal = SizeFlags.ShrinkCenter, HorizontalAlignment = HAlignment.Center,
SizeFlagsVertical = SizeFlags.ShrinkCenter VerticalAlignment = VAlignment.Center
}; };
var innerHBoxContainer = new HBoxContainer var innerHBoxContainer = new HBoxContainer
@@ -315,7 +315,6 @@ namespace Content.Client.GameObjects.Components.PDA
IDInfoContainer = new PanelContainer IDInfoContainer = new PanelContainer
{ {
SizeFlagsHorizontal = SizeFlags.Fill,
Children = Children =
{ {
innerHBoxContainer, innerHBoxContainer,
@@ -330,9 +329,9 @@ namespace Content.Client.GameObjects.Components.PDA
var mainMenuTabContainer = new VBoxContainer var mainMenuTabContainer = new VBoxContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
CustomMinimumSize = (50, 50), MinSize = (50, 50),
Children = Children =
{ {
@@ -352,36 +351,36 @@ namespace Content.Client.GameObjects.Components.PDA
BalanceInfo = new RichTextLabel BalanceInfo = new RichTextLabel
{ {
SizeFlagsHorizontal = SizeFlags.ShrinkCenter, HorizontalAlignment = HAlignment.Center,
}; };
//Red background container. //Red background container.
var masterPanelContainer = new PanelContainer var masterPanelContainer = new PanelContainer
{ {
PanelOverride = new StyleBoxFlat { BackgroundColor = Color.Black }, PanelOverride = new StyleBoxFlat { BackgroundColor = Color.Black },
SizeFlagsVertical = SizeFlags.FillExpand VerticalExpand = true
}; };
//This contains both the panel of the category buttons and the listings box. //This contains both the panel of the category buttons and the listings box.
CategoryAndListingsContainer = new HSplitContainer CategoryAndListingsContainer = new HSplitContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
}; };
var uplinkShopScrollContainer = new ScrollContainer var uplinkShopScrollContainer = new ScrollContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsStretchRatio = 2, SizeFlagsStretchRatio = 2,
CustomMinimumSize = (100, 256) MinSize = (100, 256)
}; };
//Add the category list to the left side. The store items to center. //Add the category list to the left side. The store items to center.
var categoryListContainerBackground = new PanelContainer var categoryListContainerBackground = new PanelContainer
{ {
PanelOverride = new StyleBoxFlat { BackgroundColor = Color.Gray.WithAlpha(0.02f) }, PanelOverride = new StyleBoxFlat { BackgroundColor = Color.Gray.WithAlpha(0.02f) },
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
Children = Children =
{ {
CategoryListContainer CategoryListContainer
@@ -395,16 +394,16 @@ namespace Content.Client.GameObjects.Components.PDA
//Actual list of buttons for buying a listing from the uplink. //Actual list of buttons for buying a listing from the uplink.
UplinkListingsContainer = new VBoxContainer UplinkListingsContainer = new VBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsStretchRatio = 2, SizeFlagsStretchRatio = 2,
CustomMinimumSize = (100, 256), MinSize = (100, 256),
}; };
uplinkShopScrollContainer.AddChild(UplinkListingsContainer); uplinkShopScrollContainer.AddChild(UplinkListingsContainer);
var innerVboxContainer = new VBoxContainer var innerVboxContainer = new VBoxContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
Children = Children =
{ {
@@ -472,7 +471,7 @@ namespace Content.Client.GameObjects.Components.PDA
{ {
Text = listing.ListingName == string.Empty ? prototype.Name : listing.ListingName, Text = listing.ListingName == string.Empty ? prototype.Name : listing.ListingName,
ToolTip = listing.Description == string.Empty ? prototype.Description : listing.Description, ToolTip = listing.Description == string.Empty ? prototype.Description : listing.Description,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Modulate = _loggedInUplinkAccount.DataBalance >= listing.Price Modulate = _loggedInUplinkAccount.DataBalance >= listing.Price
? Color.White ? Color.White
: Color.Gray.WithAlpha(0.30f) : Color.Gray.WithAlpha(0.30f)
@@ -481,7 +480,7 @@ namespace Content.Client.GameObjects.Components.PDA
var priceLabel = new Label var priceLabel = new Label
{ {
Text = $"{listing.Price} TC", Text = $"{listing.Price} TC",
SizeFlagsHorizontal = SizeFlags.ShrinkEnd, HorizontalAlignment = HAlignment.Right,
Modulate = _loggedInUplinkAccount.DataBalance >= listing.Price Modulate = _loggedInUplinkAccount.DataBalance >= listing.Price
? weightedColor ? weightedColor
: Color.Gray.WithAlpha(0.30f) : Color.Gray.WithAlpha(0.30f)
@@ -490,8 +489,7 @@ namespace Content.Client.GameObjects.Components.PDA
//Padding for the price lable. //Padding for the price lable.
var pricePadding = new HBoxContainer var pricePadding = new HBoxContainer
{ {
CustomMinimumSize = (32, 1), MinSize = (32, 1),
SizeFlagsHorizontal = SizeFlags.Fill,
}; };
//Contains the name of the item and its price. Used for spacing item name and price. //Contains the name of the item and its price. Used for spacing item name and price.
@@ -516,7 +514,6 @@ namespace Content.Client.GameObjects.Components.PDA
var pdaUplinkListingButton = new PDAUplinkItemButton var pdaUplinkListingButton = new PDAUplinkItemButton
{ {
ButtonListing = listing, ButtonListing = listing,
SizeFlagsVertical = SizeFlags.Fill,
Children = Children =
{ {
listingButtonPanelContainer listingButtonPanelContainer

View File

@@ -10,10 +10,10 @@ namespace Content.Client.GameObjects.Components.Paper
{ {
private readonly RichTextLabel _label; private readonly RichTextLabel _label;
public readonly LineEdit Input; public readonly LineEdit Input;
protected override Vector2? CustomSize => (300, 300);
public PaperWindow() public PaperWindow()
{ {
MinSize = SetSize = (300, 300);
var container = new VBoxContainer(); var container = new VBoxContainer();
_label = new RichTextLabel(); _label = new RichTextLabel();
Input = new LineEdit {Visible = false}; Input = new LineEdit {Visible = false};

View File

@@ -151,7 +151,7 @@ namespace Content.Client.GameObjects.Components.Power
var chargeLabel = new Label {Text = "Charge:"}; var chargeLabel = new Label {Text = "Charge:"};
ChargeBar = new ProgressBar ChargeBar = new ProgressBar
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
MinValue = 0.0f, MinValue = 0.0f,
MaxValue = 1.0f, MaxValue = 1.0f,
Page = 0.0f, Page = 0.0f,

View File

@@ -139,18 +139,14 @@ namespace Content.Client.GameObjects.Components.Power
rows.AddChild(new Label {Text = "Press Enter to confirm."}); rows.AddChild(new Label {Text = "Press Enter to confirm."});
rows.AddChild(new Label {Text = ""}); rows.AddChild(new Label {Text = ""});
PanelRotation.SizeFlagsHorizontal = SizeFlags.FillExpand; PanelRotation.HorizontalExpand = true;
PanelVelocity.SizeFlagsHorizontal = SizeFlags.FillExpand; PanelVelocity.HorizontalExpand = true;
rows.SizeFlagsHorizontal = SizeFlags.Fill;
rows.SizeFlagsVertical = SizeFlags.Fill;
NotARadar = new SolarControlNotARadar(igt); NotARadar = new SolarControlNotARadar(igt);
var outerColumns = new HBoxContainer(); var outerColumns = new HBoxContainer();
outerColumns.AddChild(rows); outerColumns.AddChild(rows);
outerColumns.AddChild(NotARadar); outerColumns.AddChild(NotARadar);
outerColumns.SizeFlagsHorizontal = SizeFlags.Fill;
outerColumns.SizeFlagsVertical = SizeFlags.Fill;
Contents.AddChild(outerColumns); Contents.AddChild(outerColumns);
Resizable = false; Resizable = false;
} }
@@ -173,6 +169,7 @@ namespace Content.Client.GameObjects.Components.Power
public SolarControlNotARadar(IGameTiming igt) public SolarControlNotARadar(IGameTiming igt)
{ {
_gameTiming = igt; _gameTiming = igt;
MinSize = (SizeFull, SizeFull);
} }
public void UpdateState(SolarControlConsoleBoundInterfaceState ls) public void UpdateState(SolarControlConsoleBoundInterfaceState ls)
@@ -181,11 +178,6 @@ namespace Content.Client.GameObjects.Components.Power
_lastStateTime = _gameTiming.CurTime; _lastStateTime = _gameTiming.CurTime;
} }
protected override Vector2 CalculateMinimumSize()
{
return (SizeFull, SizeFull);
}
protected override void Draw(DrawingHandleScreen handle) protected override void Draw(DrawingHandleScreen handle)
{ {
int point = SizeFull / 2; int point = SizeFull / 2;

View File

@@ -14,11 +14,11 @@ namespace Content.Client.GameObjects.Components.Research
private int[] _serverIds = new int[]{}; private int[] _serverIds = new int[]{};
private int _selectedServerId = -1; private int _selectedServerId = -1;
protected override Vector2? CustomSize => (300, 300);
public ResearchClientBoundUserInterface Owner { get; set; } public ResearchClientBoundUserInterface Owner { get; set; }
public ResearchClientServerSelectionMenu() public ResearchClientServerSelectionMenu()
{ {
MinSize = SetSize = (300, 300);
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
Title = Loc.GetString("Research Server Selection"); Title = Loc.GetString("Research Server Selection");
@@ -28,19 +28,7 @@ namespace Content.Client.GameObjects.Components.Research
_servers.OnItemSelected += OnItemSelected; _servers.OnItemSelected += OnItemSelected;
_servers.OnItemDeselected += OnItemDeselected; _servers.OnItemDeselected += OnItemDeselected;
var margin = new MarginContainer() Contents.AddChild(_servers);
{
SizeFlagsVertical = SizeFlags.FillExpand,
SizeFlagsHorizontal = SizeFlags.FillExpand,
/*MarginTop = 5f,
MarginLeft = 5f,
MarginRight = -5f,
MarginBottom = -5f,*/
};
margin.AddChild(_servers);
Contents.AddChild(margin);
} }
public void OnItemSelected(ItemList.ItemListSelectedEventArgs itemListSelectedEventArgs) public void OnItemSelected(ItemList.ItemListSelectedEventArgs itemListSelectedEventArgs)

View File

@@ -186,25 +186,20 @@ namespace Content.Client.GameObjects.Components.Storage
private readonly StyleBoxFlat _hoveredBox = new() { BackgroundColor = Color.Black.WithAlpha(0.35f) }; private readonly StyleBoxFlat _hoveredBox = new() { BackgroundColor = Color.Black.WithAlpha(0.35f) };
private readonly StyleBoxFlat _unHoveredBox = new() { BackgroundColor = Color.Black.WithAlpha(0.0f) }; private readonly StyleBoxFlat _unHoveredBox = new() { BackgroundColor = Color.Black.WithAlpha(0.0f) };
protected override Vector2? CustomSize => (180, 320);
public StorageWindow() public StorageWindow()
{ {
MinSize = SetSize = (180, 320);
Title = "Storage Item"; Title = "Storage Item";
RectClipContent = true; RectClipContent = true;
var containerButton = new ContainerButton var containerButton = new ContainerButton
{ {
SizeFlagsHorizontal = SizeFlags.Fill,
SizeFlagsVertical = SizeFlags.Fill,
MouseFilter = MouseFilterMode.Pass, MouseFilter = MouseFilterMode.Pass,
}; };
var innerContainerButton = new PanelContainer var innerContainerButton = new PanelContainer
{ {
PanelOverride = _unHoveredBox, PanelOverride = _unHoveredBox,
SizeFlagsHorizontal = SizeFlags.Fill,
SizeFlagsVertical = SizeFlags.Fill,
}; };
@@ -227,20 +222,20 @@ namespace Content.Client.GameObjects.Components.Storage
_information = new Label _information = new Label
{ {
Text = "Items: 0 Volume: 0/0 Stuff", Text = "Items: 0 Volume: 0/0 Stuff",
SizeFlagsVertical = SizeFlags.ShrinkCenter VerticalAlignment = VAlignment.Center
}; };
VSplitContainer.AddChild(_information); VSplitContainer.AddChild(_information);
var listScrollContainer = new ScrollContainer var listScrollContainer = new ScrollContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
HScrollEnabled = true, HScrollEnabled = true,
VScrollEnabled = true, VScrollEnabled = true,
}; };
_entityList = new VBoxContainer _entityList = new VBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand HorizontalExpand = true
}; };
listScrollContainer.AddChild(_entityList); listScrollContainer.AddChild(_entityList);
VSplitContainer.AddChild(listScrollContainer); VSplitContainer.AddChild(listScrollContainer);
@@ -342,8 +337,8 @@ namespace Content.Client.GameObjects.Components.Storage
{ {
ActualButton = new Button ActualButton = new Button
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
ToggleMode = true, ToggleMode = true,
MouseFilter = MouseFilterMode.Stop MouseFilter = MouseFilterMode.Stop
}; };
@@ -352,11 +347,11 @@ namespace Content.Client.GameObjects.Components.Storage
var hBoxContainer = new HBoxContainer(); var hBoxContainer = new HBoxContainer();
EntitySpriteView = new SpriteView EntitySpriteView = new SpriteView
{ {
CustomMinimumSize = new Vector2(32.0f, 32.0f) MinSize = new Vector2(32.0f, 32.0f)
}; };
EntityName = new Label EntityName = new Label
{ {
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
Text = "Backpack", Text = "Backpack",
}; };
hBoxContainer.AddChild(EntitySpriteView); hBoxContainer.AddChild(EntitySpriteView);
@@ -364,11 +359,11 @@ namespace Content.Client.GameObjects.Components.Storage
EntityControl = new Control EntityControl = new Control
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand HorizontalExpand = true
}; };
EntitySize = new Label EntitySize = new Label
{ {
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
Text = "Size 6", Text = "Size 6",
Align = Label.AlignMode.Right, Align = Label.AlignMode.Right,
/*AnchorLeft = 1.0f, /*AnchorLeft = 1.0f,

View File

@@ -63,23 +63,24 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels
public StatusControl(ClientBatteryBarrelComponent parent) public StatusControl(ClientBatteryBarrelComponent parent)
{ {
MinHeight = 15;
_parent = parent; _parent = parent;
SizeFlagsHorizontal = SizeFlags.FillExpand; HorizontalExpand = true;
SizeFlagsVertical = SizeFlags.ShrinkCenter; VerticalAlignment = VAlignment.Center;
AddChild(new HBoxContainer AddChild(new HBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Children = Children =
{ {
new Control new Control
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Children = Children =
{ {
(_bulletsList = new HBoxContainer (_bulletsList = new HBoxContainer
{ {
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SeparationOverride = 4 SeparationOverride = 4
}), }),
(_noBatteryLabel = new Label (_noBatteryLabel = new Label
@@ -89,11 +90,11 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels
}) })
} }
}, },
new Control() { CustomMinimumSize = (5,0) }, new Control() { MinSize = (5,0) },
(_ammoCount = new Label (_ammoCount = new Label
{ {
StyleClasses = {StyleNano.StyleClassItemStatus}, StyleClasses = {StyleNano.StyleClassItemStatus},
SizeFlagsHorizontal = SizeFlags.ShrinkEnd, HorizontalAlignment = HAlignment.Right,
}), }),
} }
}); });
@@ -134,7 +135,7 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels
{ {
BackgroundColor = colorGone, BackgroundColor = colorGone,
}, },
CustomMinimumSize = (10, 15), MinSize = (10, 15),
}); });
} }
@@ -148,15 +149,10 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels
{ {
BackgroundColor = color, BackgroundColor = color,
}, },
CustomMinimumSize = (10, 15), MinSize = (10, 15),
}); });
} }
} }
protected override Vector2 CalculateMinimumSize()
{
return Vector2.ComponentMax((0, 15), base.CalculateMinimumSize());
}
} }
} }
} }

View File

@@ -73,30 +73,31 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels
public StatusControl(ClientBoltActionBarrelComponent parent) public StatusControl(ClientBoltActionBarrelComponent parent)
{ {
MinHeight = 15;
_parent = parent; _parent = parent;
SizeFlagsHorizontal = SizeFlags.FillExpand; HorizontalExpand = true;
SizeFlagsVertical = SizeFlags.ShrinkCenter; VerticalAlignment = VAlignment.Center;
AddChild(new VBoxContainer AddChild(new VBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SeparationOverride = 0, SeparationOverride = 0,
Children = Children =
{ {
(_bulletsListTop = new HBoxContainer {SeparationOverride = 0}), (_bulletsListTop = new HBoxContainer {SeparationOverride = 0}),
new HBoxContainer new HBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Children = Children =
{ {
new Control new Control
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Children = Children =
{ {
(_bulletsListBottom = new HBoxContainer (_bulletsListBottom = new HBoxContainer
{ {
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SeparationOverride = 0 SeparationOverride = 0
}), }),
(_noMagazineLabel = new Label (_noMagazineLabel = new Label
@@ -109,8 +110,8 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels
(_chamberedBullet = new TextureRect (_chamberedBullet = new TextureRect
{ {
Texture = StaticIoC.ResC.GetTexture("/Textures/Interface/ItemStatus/Bullets/chambered.png"), Texture = StaticIoC.ResC.GetTexture("/Textures/Interface/ItemStatus/Bullets/chambered.png"),
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SizeFlagsHorizontal = SizeFlags.ShrinkEnd | SizeFlags.Fill, HorizontalAlignment = HAlignment.Right,
}) })
} }
} }
@@ -198,11 +199,6 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels
altColor ^= true; altColor ^= true;
} }
} }
protected override Vector2 CalculateMinimumSize()
{
return Vector2.ComponentMax((0, 15), base.CalculateMinimumSize());
}
} }
} }
} }

View File

@@ -146,30 +146,31 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels
public StatusControl(ClientMagazineBarrelComponent parent) public StatusControl(ClientMagazineBarrelComponent parent)
{ {
MinHeight = 15;
_parent = parent; _parent = parent;
SizeFlagsHorizontal = SizeFlags.FillExpand; HorizontalExpand = true;
SizeFlagsVertical = SizeFlags.ShrinkCenter; VerticalAlignment = VAlignment.Center;
AddChild(new HBoxContainer AddChild(new HBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Children = Children =
{ {
(_chamberedBullet = new TextureRect (_chamberedBullet = new TextureRect
{ {
Texture = StaticIoC.ResC.GetTexture("/Textures/Interface/ItemStatus/Bullets/chambered_rotated.png"), Texture = StaticIoC.ResC.GetTexture("/Textures/Interface/ItemStatus/Bullets/chambered_rotated.png"),
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SizeFlagsHorizontal = SizeFlags.ShrinkEnd | SizeFlags.Fill, HorizontalAlignment = HAlignment.Right,
}), }),
new Control() { CustomMinimumSize = (5,0) }, new Control() { MinSize = (5,0) },
new Control new Control
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Children = Children =
{ {
(_bulletsList = new HBoxContainer (_bulletsList = new HBoxContainer
{ {
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SeparationOverride = 0 SeparationOverride = 0
}), }),
(_noMagazineLabel = new Label (_noMagazineLabel = new Label
@@ -179,11 +180,11 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels
}) })
} }
}, },
new Control() { CustomMinimumSize = (5,0) }, new Control() { MinSize = (5,0) },
(_ammoCount = new Label (_ammoCount = new Label
{ {
StyleClasses = {StyleNano.StyleClassItemStatus}, StyleClasses = {StyleNano.StyleClassItemStatus},
SizeFlagsHorizontal = SizeFlags.ShrinkEnd, HorizontalAlignment = HAlignment.Right,
}), }),
} }
}); });
@@ -232,8 +233,6 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels
{ {
Texture = texture, Texture = texture,
ModulateSelfOverride = altColor ? colorGoneA : colorGoneB, ModulateSelfOverride = altColor ? colorGoneA : colorGoneB,
SizeFlagsHorizontal = SizeFlags.Fill,
SizeFlagsVertical = SizeFlags.Fill,
Stretch = TextureRect.StretchMode.KeepCentered Stretch = TextureRect.StretchMode.KeepCentered
}); });
@@ -248,8 +247,6 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels
{ {
Texture = texture, Texture = texture,
ModulateSelfOverride = altColor ? colorA : colorB, ModulateSelfOverride = altColor ? colorA : colorB,
SizeFlagsHorizontal = SizeFlags.Fill,
SizeFlagsVertical = SizeFlags.Fill,
Stretch = TextureRect.StretchMode.KeepCentered Stretch = TextureRect.StretchMode.KeepCentered
}); });
@@ -257,11 +254,6 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels
} }
} }
protected override Vector2 CalculateMinimumSize()
{
return Vector2.ComponentMax((0, 15), base.CalculateMinimumSize());
}
public void PlayAlarmAnimation() public void PlayAlarmAnimation()
{ {
var animation = _parent._isLmgAlarmAnimation ? AlarmAnimationLmg : AlarmAnimationSmg; var animation = _parent._isLmgAlarmAnimation ? AlarmAnimationLmg : AlarmAnimationSmg;

View File

@@ -73,30 +73,31 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels
public StatusControl(ClientPumpBarrelComponent parent) public StatusControl(ClientPumpBarrelComponent parent)
{ {
MinHeight = 15;
_parent = parent; _parent = parent;
SizeFlagsHorizontal = SizeFlags.FillExpand; HorizontalExpand = true;
SizeFlagsVertical = SizeFlags.ShrinkCenter; VerticalAlignment = VAlignment.Center;
AddChild(new VBoxContainer AddChild(new VBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SeparationOverride = 0, SeparationOverride = 0,
Children = Children =
{ {
(_bulletsListTop = new HBoxContainer {SeparationOverride = 0}), (_bulletsListTop = new HBoxContainer {SeparationOverride = 0}),
new HBoxContainer new HBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Children = Children =
{ {
new Control new Control
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Children = Children =
{ {
(_bulletsListBottom = new HBoxContainer (_bulletsListBottom = new HBoxContainer
{ {
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SeparationOverride = 0 SeparationOverride = 0
}), }),
(_noMagazineLabel = new Label (_noMagazineLabel = new Label
@@ -109,8 +110,8 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels
(_chamberedBullet = new TextureRect (_chamberedBullet = new TextureRect
{ {
Texture = StaticIoC.ResC.GetTexture("/Textures/Interface/ItemStatus/Bullets/chambered.png"), Texture = StaticIoC.ResC.GetTexture("/Textures/Interface/ItemStatus/Bullets/chambered.png"),
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SizeFlagsHorizontal = SizeFlags.ShrinkEnd | SizeFlags.Fill, HorizontalAlignment = HAlignment.Right,
}) })
} }
} }
@@ -198,11 +199,6 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels
altColor ^= true; altColor ^= true;
} }
} }
protected override Vector2 CalculateMinimumSize()
{
return Vector2.ComponentMax((0, 15), base.CalculateMinimumSize());
}
} }
} }
} }

View File

@@ -64,13 +64,14 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels
public StatusControl(ClientRevolverBarrelComponent parent) public StatusControl(ClientRevolverBarrelComponent parent)
{ {
MinHeight = 15;
_parent = parent; _parent = parent;
SizeFlagsHorizontal = SizeFlags.FillExpand; HorizontalExpand = true;
SizeFlagsVertical = SizeFlags.ShrinkCenter; VerticalAlignment = VAlignment.Center;
AddChild((_bulletsList = new HBoxContainer AddChild((_bulletsList = new HBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SeparationOverride = 0 SeparationOverride = 0
})); }));
} }
@@ -119,7 +120,7 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels
// Add a outline // Add a outline
var box = new Control() var box = new Control()
{ {
CustomMinimumSize = texture.Size * scale, MinSize = texture.Size * scale,
}; };
if (i == _parent.CurrentSlot) if (i == _parent.CurrentSlot)
{ {
@@ -152,8 +153,6 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels
box.AddChild(new TextureRect box.AddChild(new TextureRect
{ {
SizeFlagsHorizontal = SizeFlags.Fill,
SizeFlagsVertical = SizeFlags.Fill,
Stretch = TextureRect.StretchMode.KeepCentered, Stretch = TextureRect.StretchMode.KeepCentered,
Texture = bulletTexture, Texture = bulletTexture,
ModulateSelfOverride = color, ModulateSelfOverride = color,
@@ -162,11 +161,6 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged.Barrels
container.AddChild(box); container.AddChild(box);
} }
} }
protected override Vector2 CalculateMinimumSize()
{
return Vector2.ComponentMax((0, 15), base.CalculateMinimumSize());
}
} }
} }
} }

View File

@@ -72,30 +72,30 @@ namespace Content.Client.GameObjects.Components.Wires
{ {
new PanelContainer new PanelContainer
{ {
CustomMinimumSize = (2, 0), MinSize = (2, 0),
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#525252ff")} PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#525252ff")}
}, },
new PanelContainer new PanelContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
MouseFilter = MouseFilterMode.Stop, MouseFilter = MouseFilterMode.Stop,
Name = "Shadow", Name = "Shadow",
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.Black.WithAlpha(0.5f)} PanelOverride = new StyleBoxFlat {BackgroundColor = Color.Black.WithAlpha(0.5f)}
}, },
new PanelContainer new PanelContainer
{ {
CustomMinimumSize = (2, 0), MinSize = (2, 0),
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#525252ff")} PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#525252ff")}
}, },
} }
}; };
var wrappingHBox = new HBoxContainer(); var wrappingHBox = new HBoxContainer();
_wiresHBox = new HBoxContainer {SeparationOverride = 4, SizeFlagsVertical = SizeFlags.ShrinkEnd}; _wiresHBox = new HBoxContainer {SeparationOverride = 4, VerticalAlignment = VAlignment.Bottom};
wrappingHBox.AddChild(new Control {CustomMinimumSize = (20, 0)}); wrappingHBox.AddChild(new Control {MinSize = (20, 0)});
wrappingHBox.AddChild(_wiresHBox); wrappingHBox.AddChild(_wiresHBox);
wrappingHBox.AddChild(new Control {CustomMinimumSize = (20, 0)}); wrappingHBox.AddChild(new Control {MinSize = (20, 0)});
bottomWrap.AddChild(bottomPanel); bottomWrap.AddChild(bottomPanel);
@@ -128,7 +128,7 @@ namespace Content.Client.GameObjects.Components.Wires
Children = Children =
{ {
(_topContainer = new VBoxContainer()), (_topContainer = new VBoxContainer()),
new Control {CustomMinimumSize = (0, 110)} new Control {MinSize = (0, 110)}
} }
}; };
@@ -140,16 +140,9 @@ namespace Content.Client.GameObjects.Components.Wires
var fontSmall = _resourceCache.GetFont("/Fonts/Boxfont-round/Boxfont Round.ttf", 10); var fontSmall = _resourceCache.GetFont("/Fonts/Boxfont-round/Boxfont Round.ttf", 10);
Button helpButton; Button helpButton;
var topRow = new MarginContainer var topRow = new HBoxContainer
{
MarginLeftOverride = 4,
MarginTopOverride = 2,
MarginRightOverride = 12,
MarginBottomOverride = 2,
Children =
{
new HBoxContainer
{ {
Margin = new Thickness(4, 2, 12, 2),
Children = Children =
{ {
(_nameLabel = new Label (_nameLabel = new Label
@@ -157,37 +150,29 @@ namespace Content.Client.GameObjects.Components.Wires
Text = Loc.GetString("Wires"), Text = Loc.GetString("Wires"),
FontOverride = font, FontOverride = font,
FontColorOverride = StyleNano.NanoGold, FontColorOverride = StyleNano.NanoGold,
SizeFlagsVertical = SizeFlags.ShrinkCenter VerticalAlignment = VAlignment.Center,
}), }),
new Control
{
CustomMinimumSize = (8, 0),
},
(_serialLabel = new Label (_serialLabel = new Label
{ {
Text = Loc.GetString("DEAD-BEEF"), Text = Loc.GetString("DEAD-BEEF"),
FontOverride = fontSmall, FontOverride = fontSmall,
FontColorOverride = Color.Gray, FontColorOverride = Color.Gray,
SizeFlagsVertical = SizeFlags.ShrinkCenter VerticalAlignment = VAlignment.Center,
Margin = new Thickness(8, 0, 20, 0),
HorizontalAlignment = HAlignment.Left,
HorizontalExpand = true,
}), }),
new Control (helpButton = new Button
{ {
CustomMinimumSize = (20, 0), Text = "?",
SizeFlagsHorizontal = SizeFlags.Expand Margin = new Thickness(0, 0, 2, 0),
}, }),
(helpButton = new Button {Text = "?"}),
new Control
{
CustomMinimumSize = (2, 0),
},
(CloseButton = new TextureButton (CloseButton = new TextureButton
{ {
StyleClasses = {SS14Window.StyleClassWindowCloseButton}, StyleClasses = {SS14Window.StyleClassWindowCloseButton},
SizeFlagsVertical = SizeFlags.ShrinkCenter VerticalAlignment = VAlignment.Center
}) })
} }
}
}
}; };
helpButton.OnPressed += a => helpButton.OnPressed += a =>
@@ -205,42 +190,33 @@ namespace Content.Client.GameObjects.Components.Wires
{ {
new HBoxContainer new HBoxContainer
{ {
Children =
{
new MarginContainer
{
MarginLeftOverride = 8,
MarginRightOverride = 8,
MarginTopOverride = 4,
MarginBottomOverride = 4,
Children = Children =
{ {
(_statusContainer = new GridContainer (_statusContainer = new GridContainer
{ {
Margin = new Thickness(8, 4),
// TODO: automatically change columns count. // TODO: automatically change columns count.
Columns = 3 Columns = 3
}) })
} }
} }
} }
}
}
}; };
_topContainer.AddChild(topRow); _topContainer.AddChild(topRow);
_topContainer.AddChild(new PanelContainer _topContainer.AddChild(new PanelContainer
{ {
CustomMinimumSize = (0, 2), MinSize = (0, 2),
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#525252ff")} PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#525252ff")}
}); });
_topContainer.AddChild(middle); _topContainer.AddChild(middle);
_topContainer.AddChild(new PanelContainer _topContainer.AddChild(new PanelContainer
{ {
CustomMinimumSize = (0, 2), MinSize = (0, 2),
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#525252ff")} PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#525252ff")}
}); });
CloseButton.OnPressed += _ => Close(); CloseButton.OnPressed += _ => Close();
LayoutContainer.SetSize(this, (300, 200)); SetSize = (320, 200);
} }
@@ -258,7 +234,7 @@ namespace Content.Client.GameObjects.Components.Wires
var type = random.Next(2); var type = random.Next(2);
var control = new WireControl(wire.Color, wire.Letter, wire.IsCut, flip, mirror, type, _resourceCache) var control = new WireControl(wire.Color, wire.Letter, wire.IsCut, flip, mirror, type, _resourceCache)
{ {
SizeFlagsVertical = SizeFlags.ShrinkEnd VerticalAlignment = VAlignment.Bottom
}; };
_wiresHBox.AddChild(control); _wiresHBox.AddChild(control);
@@ -313,11 +289,12 @@ namespace Content.Client.GameObjects.Components.Wires
public event Action WireClicked; public event Action WireClicked;
public event Action ContactsClicked; public event Action ContactsClicked;
public WireControl(WireColor color, WireLetter letter, bool isCut, bool flip, bool mirror, int type, IResourceCache resourceCache) public WireControl(WireColor color, WireLetter letter, bool isCut, bool flip, bool mirror, int type,
IResourceCache resourceCache)
{ {
_resourceCache = resourceCache; _resourceCache = resourceCache;
SizeFlagsHorizontal = SizeFlags.ShrinkCenter; HorizontalAlignment = HAlignment.Center;
MouseFilter = MouseFilterMode.Stop; MouseFilter = MouseFilterMode.Stop;
var layout = new LayoutContainer(); var layout = new LayoutContainer();
@@ -326,8 +303,8 @@ namespace Content.Client.GameObjects.Components.Wires
var greek = new Label var greek = new Label
{ {
Text = letter.Letter().ToString(), Text = letter.Letter().ToString(),
SizeFlagsVertical = SizeFlags.ShrinkEnd, VerticalAlignment = VAlignment.Bottom,
SizeFlagsHorizontal = SizeFlags.ShrinkCenter, HorizontalAlignment = HAlignment.Center,
Align = Label.AlignMode.Center, Align = Label.AlignMode.Center,
FontOverride = _resourceCache.GetFont("/Fonts/NotoSansDisplay/NotoSansDisplay-Bold.ttf", 12), FontOverride = _resourceCache.GetFont("/Fonts/NotoSansDisplay/NotoSansDisplay-Bold.ttf", 12),
FontColorOverride = Color.Gray, FontColorOverride = Color.Gray,
@@ -365,14 +342,9 @@ namespace Content.Client.GameObjects.Components.Wires
LayoutContainer.SetPosition(wire, (2, 16)); LayoutContainer.SetPosition(wire, (2, 16));
ToolTip = color.Name(); ToolTip = color.Name();
MinSize = (20, 102);
} }
protected override Vector2 CalculateMinimumSize()
{
return (20, 102);
}
protected override void KeyBindDown(GUIBoundKeyEventArgs args) protected override void KeyBindDown(GUIBoundKeyEventArgs args)
{ {
base.KeyBindDown(args); base.KeyBindDown(args);
@@ -425,7 +397,8 @@ namespace Content.Client.GameObjects.Components.Wires
private readonly IResourceCache _resourceCache; private readonly IResourceCache _resourceCache;
public WireRender(WireColor color, bool isCut, bool flip, bool mirror, int type, IResourceCache resourceCache) public WireRender(WireColor color, bool isCut, bool flip, bool mirror, int type,
IResourceCache resourceCache)
{ {
_resourceCache = resourceCache; _resourceCache = resourceCache;
_color = color; _color = color;
@@ -433,11 +406,8 @@ namespace Content.Client.GameObjects.Components.Wires
_flip = flip; _flip = flip;
_mirror = mirror; _mirror = mirror;
_type = type; _type = type;
}
protected override Vector2 CalculateMinimumSize() SetSize = (16, 50);
{
return (16, 50);
} }
protected override void Draw(DrawingHandleScreen handle) protected override void Draw(DrawingHandleScreen handle)
@@ -529,6 +499,7 @@ namespace Content.Client.GameObjects.Components.Wires
var lightContainer = new Control var lightContainer = new Control
{ {
SetSize = (20, 20),
Children = Children =
{ {
new TextureRect new TextureRect
@@ -588,10 +559,10 @@ namespace Content.Client.GameObjects.Components.Wires
Text = data.Text, Text = data.Text,
FontOverride = font, FontOverride = font,
FontColorOverride = Color.FromHex("#A1A6AE"), FontColorOverride = Color.FromHex("#A1A6AE"),
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
}); });
hBox.AddChild(lightContainer); hBox.AddChild(lightContainer);
hBox.AddChild(new Control {CustomMinimumSize = (6, 0)}); hBox.AddChild(new Control {MinSize = (6, 0)});
AddChild(hBox); AddChild(hBox);
} }
} }

View File

@@ -69,7 +69,7 @@ namespace Content.Client.GameObjects.EntitySystems.DoAfter
var doAfterBar = new DoAfterBar var doAfterBar = new DoAfterBar
{ {
SizeFlagsVertical = SizeFlags.ShrinkCenter VerticalAlignment = VAlignment.Center
}; };
_doAfterBars[message.ID] = doAfterBar; _doAfterBars[message.ID] = doAfterBar;
@@ -82,7 +82,7 @@ namespace Content.Client.GameObjects.EntitySystems.DoAfter
{ {
Texture = StaticIoC.ResC.GetTexture("/Textures/Interface/Misc/progress_bar.rsi/icon.png"), Texture = StaticIoC.ResC.GetTexture("/Textures/Interface/Misc/progress_bar.rsi/icon.png"),
TextureScale = Vector2.One * DoAfterBar.DoAfterBarScale, TextureScale = Vector2.One * DoAfterBar.DoAfterBarScale,
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
}, },
doAfterBar doAfterBar

View File

@@ -90,10 +90,11 @@ namespace Content.Client.GameObjects.EntitySystems
hBox.AddChild(new Label hBox.AddChild(new Label
{ {
Text = entity.Name, Text = entity.Name,
SizeFlagsHorizontal = Control.SizeFlags.FillExpand, HorizontalExpand = true,
}); });
var size = Vector2.ComponentMax((minWidth, 0), panel.CombinedMinimumSize); panel.Measure(Vector2.Infinity);
var size = Vector2.ComponentMax((minWidth, 0), panel.DesiredSize);
_examineTooltipOpen.Open(UIBox2.FromDimensions(popupPos, size)); _examineTooltipOpen.Open(UIBox2.FromDimensions(popupPos, size));

View File

@@ -26,14 +26,14 @@ namespace Content.Client.GameObjects.EntitySystems.HealthOverlay
CritBar = new HealthOverlayBar CritBar = new HealthOverlayBar
{ {
Visible = false, Visible = false,
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
Color = Color.Red Color = Color.Red
}; };
HealthBar = new HealthOverlayBar HealthBar = new HealthOverlayBar
{ {
Visible = false, Visible = false,
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
Color = Color.Green Color = Color.Green
}; };
@@ -45,7 +45,7 @@ namespace Content.Client.GameObjects.EntitySystems.HealthOverlay
{ {
Texture = StaticIoC.ResC.GetTexture("/Textures/Interface/Misc/health_bar.rsi/icon.png"), Texture = StaticIoC.ResC.GetTexture("/Textures/Interface/Misc/health_bar.rsi/icon.png"),
TextureScale = Vector2.One * HealthOverlayBar.HealthBarScale, TextureScale = Vector2.One * HealthOverlayBar.HealthBarScale,
SizeFlagsVertical = SizeFlags.ShrinkCenter VerticalAlignment = VAlignment.Center,
}, },
CritBar, CritBar,
HealthBar HealthBar

View File

@@ -164,7 +164,7 @@ namespace Content.Client.GameObjects.EntitySystems
{ {
_currentEntityList.List.AddChild(new PanelContainer _currentEntityList.List.AddChild(new PanelContainer
{ {
CustomMinimumSize = (0, 2), MinSize = (0, 2),
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#333")} PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#333")}
}); });
} }
@@ -176,7 +176,8 @@ namespace Content.Client.GameObjects.EntitySystems
_userInterfaceManager.ModalRoot.AddChild(_currentEntityList); _userInterfaceManager.ModalRoot.AddChild(_currentEntityList);
var size = _currentEntityList.List.CombinedMinimumSize; _currentEntityList.List.Measure(Vector2.Infinity);
var size = _currentEntityList.List.DesiredSize;
var box = UIBox2.FromDimensions(_userInterfaceManager.MousePositionScaled, size); var box = UIBox2.FromDimensions(_userInterfaceManager.MousePositionScaled, size);
_currentEntityList.Open(box); _currentEntityList.Open(box);
@@ -284,7 +285,7 @@ namespace Content.Client.GameObjects.EntitySystems
{ {
vBox.AddChild(new PanelContainer vBox.AddChild(new PanelContainer
{ {
CustomMinimumSize = (0, 2), MinSize = (0, 2),
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#333")} PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#333")}
}); });
} }
@@ -306,7 +307,7 @@ namespace Content.Client.GameObjects.EntitySystems
{ {
vBox.AddChild(new PanelContainer vBox.AddChild(new PanelContainer
{ {
CustomMinimumSize = (0, 2), MinSize = (0, 2),
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#333")} PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#333")}
}); });
} }
@@ -449,11 +450,11 @@ namespace Content.Client.GameObjects.EntitySystems
{ {
text = $"{text} ({entity.Uid})"; text = $"{text} ({entity.Uid})";
} }
control.AddChild(new MarginContainer
control.AddChild(new Label
{ {
MarginLeftOverride = 4, Margin = new Thickness(4, 0),
MarginRightOverride = 4, Text = text
Children = {new Label {Text = text}}
}); });
AddChild(control); AddChild(control);
@@ -486,7 +487,8 @@ namespace Content.Client.GameObjects.EntitySystems
var func = args.Function; var func = args.Function;
var funcId = _master._inputManager.NetworkBindMap.KeyFunctionID(args.Function); var funcId = _master._inputManager.NetworkBindMap.KeyFunctionID(args.Function);
var message = new FullInputCmdMessage(_master._gameTiming.CurTick, _master._gameTiming.TickFraction, funcId, BoundKeyState.Down, var message = new FullInputCmdMessage(_master._gameTiming.CurTick, _master._gameTiming.TickFraction,
funcId, BoundKeyState.Down,
_entity.Transform.Coordinates, _entity.Transform.Coordinates,
args.PointerLocation, _entity.Uid); args.PointerLocation, _entity.Uid);
@@ -546,12 +548,12 @@ namespace Content.Client.GameObjects.EntitySystems
{ {
(_icon = new TextureRect (_icon = new TextureRect
{ {
CustomMinimumSize = (32, 32), MinSize = (32, 32),
Stretch = TextureRect.StretchMode.KeepCentered Stretch = TextureRect.StretchMode.KeepCentered
}), }),
(_label = new Label()), (_label = new Label()),
// Padding // Padding
new Control {CustomMinimumSize = (8, 0)} new Control {MinSize = (8, 0)}
} }
}); });
} }
@@ -603,17 +605,17 @@ namespace Content.Client.GameObjects.EntitySystems
{ {
(_icon = new TextureRect (_icon = new TextureRect
{ {
CustomMinimumSize = (32, 32), MinSize = (32, 32),
Stretch = TextureRect.StretchMode.KeepCentered Stretch = TextureRect.StretchMode.KeepCentered
}), }),
(_label = new Label (_label = new Label
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand HorizontalExpand = true
}), }),
// Padding // Padding
new Control {CustomMinimumSize = (8, 0)}, new Control {MinSize = (8, 0)},
new TextureRect new TextureRect
{ {
@@ -662,7 +664,7 @@ namespace Content.Client.GameObjects.EntitySystems
{ {
popup.List.AddChild(new PanelContainer popup.List.AddChild(new PanelContainer
{ {
CustomMinimumSize = (0, 2), MinSize = (0, 2),
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#333")} PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#333")}
}); });
} }

View File

@@ -1,21 +1,32 @@
<SS14Window xmlns="https://spacestation14.io"> <SS14Window xmlns="https://spacestation14.io"
<MarginContainer Name="Margin" SizeFlagsVertical="FillExpand" SizeFlagsHorizontal="Fill"> xmlns:gfx="clr-namespace:Robust.Client.Graphics;assembly=Robust.Client">
<VBoxContainer SizeFlagsVertical="FillExpand" SizeFlagsHorizontal="FillExpand" SeparationOverride="5"> <VBoxContainer SeparationOverride="5">
<HBoxContainer SizeFlagsVertical="FillExpand" SizeFlagsHorizontal="FillExpand"> <HBoxContainer VerticalExpand="True">
<Button Name="InputButton" ToggleMode="True" Text="MIDI Input" TextAlign="Center" SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="1"/> <Button Name="InputButton" ToggleMode="True" Text="MIDI Input" TextAlign="Center"
<Control SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="2" /> HorizontalExpand="True" SizeFlagsStretchRatio="1" />
<Button Name="FileButton" Text="Play MIDI File" TextAlign="Center" SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="1"/> <Control HorizontalExpand="True" SizeFlagsStretchRatio="2" />
<Button Name="FileButton" Text="Play MIDI File" TextAlign="Center" HorizontalExpand="True"
SizeFlagsStretchRatio="1" />
</HBoxContainer> </HBoxContainer>
<HBoxContainer SizeFlagsVertical="FillExpand" SizeFlagsHorizontal="Fill"> <HBoxContainer VerticalExpand="True">
<Button Name="LoopButton" ToggleMode="True" Text="Loop" TextAlign="Center" SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="1"/> <Button Name="LoopButton" ToggleMode="True" Text="Loop" TextAlign="Center" HorizontalExpand="True"
<Control SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="2" /> SizeFlagsStretchRatio="1" />
<Button Name="StopButton" Text="Stop" TextAlign="Center" SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="1"/> <Control HorizontalExpand="True" SizeFlagsStretchRatio="2" />
<Button Name="StopButton" Text="Stop" TextAlign="Center" HorizontalExpand="True"
SizeFlagsStretchRatio="1" />
</HBoxContainer> </HBoxContainer>
<HBoxContainer SizeFlagsVertical="ShrinkEnd" SizeFlagsHorizontal="FillExpand"> <HBoxContainer VerticalExpand="True">
<Control SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="0.125"/> <Control HorizontalExpand="True" SizeFlagsStretchRatio="0.125" />
<Slider Name="PlaybackSlider" SizeFlagsHorizontal="FillExpand" /> <Slider Name="PlaybackSlider" HorizontalExpand="True" />
<Control SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="0.125"/> <Control HorizontalExpand="True" SizeFlagsStretchRatio="0.125" />
</HBoxContainer> </HBoxContainer>
</VBoxContainer> </VBoxContainer>
</MarginContainer> <PanelContainer Name="UnavailableOverlay" Visible="False" MouseFilter="Stop">
<PanelContainer.PanelOverride>
<gfx:StyleBoxFlat BackgroundColor="#000000E5" />
</PanelContainer.PanelOverride>
<Label VerticalAlignment="Center" HorizontalAlignment="Center" Align="Center"
StyleClasses="LabelBig"
Text="{Loc 'MIDI support is currently&#x0a;not available on your platform.'}" />
</PanelContainer>
</SS14Window> </SS14Window>

View File

@@ -30,8 +30,6 @@ namespace Content.Client.Instruments
private readonly InstrumentBoundUserInterface _owner; private readonly InstrumentBoundUserInterface _owner;
protected override Vector2? CustomSize => (400, 150);
public InstrumentMenu(InstrumentBoundUserInterface owner) public InstrumentMenu(InstrumentBoundUserInterface owner)
{ {
RobustXamlLoader.Load(this); RobustXamlLoader.Load(this);
@@ -50,23 +48,7 @@ namespace Content.Client.Instruments
if (!_midiManager.IsAvailable) if (!_midiManager.IsAvailable)
{ {
Margin.AddChild(new PanelContainer UnavailableOverlay.Visible = true;
{
MouseFilter = MouseFilterMode.Stop,
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.Black.WithAlpha(0.90f)},
Children =
{
new Label
{
Align = Label.AlignMode.Center,
SizeFlagsVertical = SizeFlags.ShrinkCenter,
SizeFlagsHorizontal = SizeFlags.ShrinkCenter,
StyleClasses = {StyleNano.StyleClassLabelBig},
Text = Loc.GetString("MIDI support is currently\nnot available on your platform.")
}
}
});
// We return early as to not give the buttons behavior. // We return early as to not give the buttons behavior.
return; return;
} }
@@ -77,6 +59,8 @@ namespace Content.Client.Instruments
StopButton.OnPressed += MidiStopButtonOnPressed; StopButton.OnPressed += MidiStopButtonOnPressed;
PlaybackSlider.OnValueChanged += PlaybackSliderSeek; PlaybackSlider.OnValueChanged += PlaybackSliderSeek;
PlaybackSlider.OnKeyBindUp += PlaybackSliderKeyUp; PlaybackSlider.OnKeyBindUp += PlaybackSliderKeyUp;
MinSize = SetSize = (400, 150);
} }
private void InstrumentOnMidiPlaybackEnded() private void InstrumentOnMidiPlaybackEnded()

View File

@@ -23,7 +23,6 @@ namespace Content.Client.Research
public Button QueueButton; public Button QueueButton;
public Button ServerConnectButton; public Button ServerConnectButton;
public Button ServerSyncButton; public Button ServerSyncButton;
protected override Vector2? CustomSize => (300, 450);
public LatheBoundUserInterface Owner { get; set; } public LatheBoundUserInterface Owner { get; set; }
@@ -31,28 +30,23 @@ namespace Content.Client.Research
public LatheMenu(LatheBoundUserInterface owner = null) public LatheMenu(LatheBoundUserInterface owner = null)
{ {
SetSize = MinSize = (300, 450);
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
Owner = owner; Owner = owner;
Title = "Lathe Menu"; Title = "Lathe Menu";
var margin = new MarginContainer()
{
SizeFlagsVertical = SizeFlags.FillExpand,
SizeFlagsHorizontal = SizeFlags.FillExpand,
};
var vBox = new VBoxContainer() var vBox = new VBoxContainer()
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SeparationOverride = 5, SeparationOverride = 5,
}; };
var hBoxButtons = new HBoxContainer() var hBoxButtons = new HBoxContainer()
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
}; };
@@ -60,7 +54,6 @@ namespace Content.Client.Research
{ {
Text = "Queue", Text = "Queue",
TextAlign = Label.AlignMode.Center, TextAlign = Label.AlignMode.Center,
SizeFlagsHorizontal = SizeFlags.Fill,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
}; };
@@ -68,7 +61,6 @@ namespace Content.Client.Research
{ {
Text = "Server list", Text = "Server list",
TextAlign = Label.AlignMode.Center, TextAlign = Label.AlignMode.Center,
SizeFlagsHorizontal = SizeFlags.Fill,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
}; };
@@ -76,27 +68,26 @@ namespace Content.Client.Research
{ {
Text = "Sync", Text = "Sync",
TextAlign = Label.AlignMode.Center, TextAlign = Label.AlignMode.Center,
SizeFlagsHorizontal = SizeFlags.Fill,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
}; };
var spacer = new Control() var spacer = new Control()
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsStretchRatio = 3, SizeFlagsStretchRatio = 3,
}; };
var hBoxFilter = new HBoxContainer() var hBoxFilter = new HBoxContainer()
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsStretchRatio = 1 SizeFlagsStretchRatio = 1
}; };
_searchBar = new LineEdit() _searchBar = new LineEdit()
{ {
PlaceHolder = "Search Designs", PlaceHolder = "Search Designs",
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsStretchRatio = 3 SizeFlagsStretchRatio = 3
}; };
@@ -106,7 +97,6 @@ namespace Content.Client.Research
{ {
Text = "Filter", Text = "Filter",
TextAlign = Label.AlignMode.Center, TextAlign = Label.AlignMode.Center,
SizeFlagsHorizontal = SizeFlags.Fill,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
Disabled = true, Disabled = true,
}; };
@@ -114,7 +104,7 @@ namespace Content.Client.Research
_items = new ItemList() _items = new ItemList()
{ {
SizeFlagsStretchRatio = 8, SizeFlagsStretchRatio = 8,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SelectMode = ItemList.ItemListSelectMode.Button, SelectMode = ItemList.ItemListSelectMode.Button,
}; };
@@ -124,14 +114,14 @@ namespace Content.Client.Research
{ {
PlaceHolder = "Amount", PlaceHolder = "Amount",
Text = "1", Text = "1",
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
}; };
_amountLineEdit.OnTextChanged += PopulateDisabled; _amountLineEdit.OnTextChanged += PopulateDisabled;
_materials = new ItemList() _materials = new ItemList()
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsStretchRatio = 3 SizeFlagsStretchRatio = 3
}; };
@@ -153,9 +143,7 @@ namespace Content.Client.Research
vBox.AddChild(_amountLineEdit); vBox.AddChild(_amountLineEdit);
vBox.AddChild(_materials); vBox.AddChild(_materials);
margin.AddChild(vBox); Contents.AddChild(vBox);
Contents.AddChild(margin);
} }
public void ItemSelected(ItemList.ItemListSelectedEventArgs args) public void ItemSelected(ItemList.ItemListSelectedEventArgs args)

View File

@@ -4,15 +4,13 @@ using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.CustomControls;
using Robust.Client.Utility; using Robust.Client.Utility;
using Robust.Shared.Maths; using Robust.Shared.Localization;
using Robust.Shared.ViewVariables; using Robust.Shared.ViewVariables;
namespace Content.Client.Research namespace Content.Client.Research
{ {
public class LatheQueueMenu : SS14Window public class LatheQueueMenu : SS14Window
{ {
protected override Vector2? CustomSize => (300, 450);
public LatheBoundUserInterface Owner { get; set; } public LatheBoundUserInterface Owner { get; set; }
[ViewVariables] [ViewVariables]
@@ -23,67 +21,45 @@ namespace Content.Client.Research
public LatheQueueMenu() public LatheQueueMenu()
{ {
Title = "Lathe Queue"; SetSize = MinSize = (300, 450);
Title = Loc.GetString("Lathe Queue");
var margin = new MarginContainer()
{
/*MarginTop = 5f,
MarginLeft = 5f,
MarginRight = -5f,
MarginBottom = -5f,*/
};
// margin.SetAnchorAndMarginPreset(LayoutPreset.Wide);
var vBox = new VBoxContainer(); var vBox = new VBoxContainer();
// vBox.SetAnchorAndMarginPreset(LayoutPreset.Wide);
var descMargin = new MarginContainer()
{
/*MarginTop = 5f,
MarginLeft = 5f,
MarginRight = -5f,
MarginBottom = -5f,*/
SizeFlagsHorizontal = SizeFlags.FillExpand,
SizeFlagsStretchRatio = 2,
};
var hBox = new HBoxContainer() var hBox = new HBoxContainer()
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsStretchRatio = 2,
}; };
_icon = new TextureRect() _icon = new TextureRect()
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsStretchRatio = 2, SizeFlagsStretchRatio = 2,
}; };
var vBoxInfo = new VBoxContainer() var vBoxInfo = new VBoxContainer()
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsStretchRatio = 3, SizeFlagsStretchRatio = 3,
}; };
_nameLabel = new Label() _nameLabel = new Label()
{ {
RectClipContent = true, RectClipContent = true,
SizeFlagsHorizontal = SizeFlags.Fill,
}; };
_description = new Label() _description = new Label()
{ {
RectClipContent = true, RectClipContent = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalAlignment = VAlignment.Stretch,
SizeFlagsHorizontal = SizeFlags.Fill, VerticalExpand = true
}; };
_queueList = new ItemList() _queueList = new ItemList()
{ {
SizeFlagsHorizontal = SizeFlags.Fill, VerticalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand,
SizeFlagsStretchRatio = 3, SizeFlagsStretchRatio = 3,
SelectMode = ItemList.ItemListSelectMode.None SelectMode = ItemList.ItemListSelectMode.None
}; };
@@ -94,14 +70,10 @@ namespace Content.Client.Research
hBox.AddChild(_icon); hBox.AddChild(_icon);
hBox.AddChild(vBoxInfo); hBox.AddChild(vBoxInfo);
descMargin.AddChild(hBox); vBox.AddChild(hBox);
vBox.AddChild(descMargin);
vBox.AddChild(_queueList); vBox.AddChild(_queueList);
margin.AddChild(vBox); Contents.AddChild(vBox);
Contents.AddChild(margin);
ClearInfo(); ClearInfo();
} }

View File

@@ -16,8 +16,6 @@ namespace Content.Client.Research
{ {
public ResearchConsoleBoundUserInterface Owner { get; set; } public ResearchConsoleBoundUserInterface Owner { get; set; }
protected override Vector2? CustomSize => (800, 400);
private readonly List<TechnologyPrototype> _unlockedTechnologyPrototypes = new(); private readonly List<TechnologyPrototype> _unlockedTechnologyPrototypes = new();
private readonly List<TechnologyPrototype> _unlockableTechnologyPrototypes = new(); private readonly List<TechnologyPrototype> _unlockableTechnologyPrototypes = new();
private readonly List<TechnologyPrototype> _futureTechnologyPrototypes = new(); private readonly List<TechnologyPrototype> _futureTechnologyPrototypes = new();
@@ -40,6 +38,8 @@ namespace Content.Client.Research
public ResearchConsoleMenu(ResearchConsoleBoundUserInterface owner = null) public ResearchConsoleMenu(ResearchConsoleBoundUserInterface owner = null)
{ {
SetSize = MinSize = (800, 400);
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
Title = Loc.GetString("R&D Console"); Title = Loc.GetString("R&D Console");
@@ -49,8 +49,8 @@ namespace Content.Client.Research
_unlockedTechnologies = new ItemList() _unlockedTechnologies = new ItemList()
{ {
SelectMode = ItemList.ItemListSelectMode.Button, SelectMode = ItemList.ItemListSelectMode.Button,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
}; };
_unlockedTechnologies.OnItemSelected += UnlockedTechnologySelected; _unlockedTechnologies.OnItemSelected += UnlockedTechnologySelected;
@@ -58,8 +58,8 @@ namespace Content.Client.Research
_unlockableTechnologies = new ItemList() _unlockableTechnologies = new ItemList()
{ {
SelectMode = ItemList.ItemListSelectMode.Button, SelectMode = ItemList.ItemListSelectMode.Button,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
}; };
_unlockableTechnologies.OnItemSelected += UnlockableTechnologySelected; _unlockableTechnologies.OnItemSelected += UnlockableTechnologySelected;
@@ -67,44 +67,44 @@ namespace Content.Client.Research
_futureTechnologies = new ItemList() _futureTechnologies = new ItemList()
{ {
SelectMode = ItemList.ItemListSelectMode.Button, SelectMode = ItemList.ItemListSelectMode.Button,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
}; };
_futureTechnologies.OnItemSelected += FutureTechnologySelected; _futureTechnologies.OnItemSelected += FutureTechnologySelected;
var vbox = new VBoxContainer() var vbox = new VBoxContainer()
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
}; };
var hboxTechnologies = new HBoxContainer() var hboxTechnologies = new HBoxContainer()
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsStretchRatio = 2, SizeFlagsStretchRatio = 2,
SeparationOverride = 10, SeparationOverride = 10,
}; };
var hboxSelected = new HBoxContainer() var hboxSelected = new HBoxContainer()
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsStretchRatio = 1 SizeFlagsStretchRatio = 1
}; };
var vboxPoints = new VBoxContainer() var vboxPoints = new VBoxContainer()
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
}; };
var vboxTechInfo = new VBoxContainer() var vboxTechInfo = new VBoxContainer()
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsStretchRatio = 3, SizeFlagsStretchRatio = 3,
}; };
@@ -114,8 +114,8 @@ namespace Content.Client.Research
var vboxPointsButtons = new VBoxContainer() var vboxPointsButtons = new VBoxContainer()
{ {
Align = BoxContainer.AlignMode.End, Align = BoxContainer.AlignMode.End,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
}; };
ServerSelectionButton = new Button() { Text = Loc.GetString("Server list") }; ServerSelectionButton = new Button() { Text = Loc.GetString("Server list") };
@@ -133,8 +133,8 @@ namespace Content.Client.Research
_technologyIcon = new TextureRect() _technologyIcon = new TextureRect()
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
Stretch = TextureRect.StretchMode.KeepAspectCentered, Stretch = TextureRect.StretchMode.KeepAspectCentered,
}; };

View File

@@ -46,31 +46,26 @@ namespace Content.Client.State
new VBoxContainer new VBoxContainer
{ {
SeparationOverride = 0, SeparationOverride = 0,
CustomMinimumSize = (300, 200), MinSize = (300, 200),
Children = Children =
{ {
new HBoxContainer new HBoxContainer
{ {
Children =
{
new MarginContainer
{
MarginLeftOverride = 8,
Children = Children =
{ {
new Label new Label
{ {
Margin = new Thickness(8, 0, 0, 0),
Text = Loc.GetString("Space Station 14"), Text = Loc.GetString("Space Station 14"),
StyleClasses = {StyleBase.StyleClassLabelHeading}, StyleClasses = {StyleBase.StyleClassLabelHeading},
VAlign = Label.VAlignMode.Center VAlign = Label.VAlignMode.Center
}, },
}
},
(exitButton = new Button (exitButton = new Button
{ {
Text = Loc.GetString("Exit"), Text = Loc.GetString("Exit"),
SizeFlagsHorizontal = Control.SizeFlags.ShrinkEnd | Control.SizeFlags.Expand HorizontalAlignment = Control.HAlignment.Right,
HorizontalExpand = true,
}), }),
} }
}, },
@@ -78,22 +73,16 @@ namespace Content.Client.State
// Line // Line
new HighDivider(), new HighDivider(),
new MarginContainer
{
SizeFlagsVertical = Control.SizeFlags.FillExpand,
MarginLeftOverride = 4,
MarginRightOverride = 4,
MarginTopOverride = 4,
Children =
{
new VBoxContainer new VBoxContainer
{ {
VerticalExpand = true,
Margin = new Thickness(4, 4, 4, 0),
SeparationOverride = 0, SeparationOverride = 0,
Children = Children =
{ {
new Control new Control
{ {
SizeFlagsVertical = Control.SizeFlags.FillExpand, VerticalExpand = true,
Children = Children =
{ {
(_connectingStatus = new VBoxContainer (_connectingStatus = new VBoxContainer
@@ -128,10 +117,9 @@ namespace Content.Client.State
(retryButton = new Button (retryButton = new Button
{ {
Text = "Retry", Text = "Retry",
SizeFlagsHorizontal = Control.SizeFlags.ShrinkCenter, HorizontalAlignment = Control.HAlignment.Center,
SizeFlagsVertical = VerticalExpand = true,
Control.SizeFlags.Expand | VerticalAlignment = Control.VAlignment.Bottom,
Control.SizeFlags.ShrinkEnd
}) })
} }
}), }),
@@ -154,10 +142,9 @@ namespace Content.Client.State
(reconnectButton = new Button (reconnectButton = new Button
{ {
Text = "Reconnect", Text = "Reconnect",
SizeFlagsHorizontal = Control.SizeFlags.ShrinkCenter, HorizontalAlignment = Control.HAlignment.Center,
SizeFlagsVertical = VerticalExpand = true,
Control.SizeFlags.Expand | VerticalAlignment = Control.VAlignment.Bottom,
Control.SizeFlags.ShrinkEnd
}) })
} }
}) })
@@ -165,18 +152,16 @@ namespace Content.Client.State
}, },
// Padding. // Padding.
new Control {CustomMinimumSize = (0, 8)}, new Control {MinSize = (0, 8)},
new Label new Label
{ {
Text = address, Text = address,
StyleClasses = {StyleBase.StyleClassLabelSubText}, StyleClasses = {StyleBase.StyleClassLabelSubText},
SizeFlagsHorizontal = Control.SizeFlags.ShrinkCenter, HorizontalAlignment = Control.HAlignment.Center
} }
} }
}, },
}
},
// Line // Line
new PanelContainer new PanelContainer
@@ -187,16 +172,10 @@ namespace Content.Client.State
ContentMarginTopOverride = 2 ContentMarginTopOverride = 2
}, },
}, },
new MarginContainer
{
MarginLeftOverride = 12,
MarginRightOverride = 4,
Children =
{
new HBoxContainer new HBoxContainer
{ {
SizeFlagsVertical = Control.SizeFlags.ShrinkEnd, Margin = new Thickness(12, 0, 4, 0),
VerticalAlignment = Control.VAlignment.Bottom,
Children = Children =
{ {
new Label new Label
@@ -207,13 +186,11 @@ namespace Content.Client.State
new Label new Label
{ {
Text = "ver 0.1", Text = "ver 0.1",
SizeFlagsHorizontal = HorizontalExpand = true,
Control.SizeFlags.Expand | Control.SizeFlags.ShrinkEnd, HorizontalAlignment = Control.HAlignment.Right,
StyleClasses = {StyleBase.StyleClassLabelSubText} StyleClasses = {StyleBase.StyleClassLabelSubText}
} }
} }
}
}
}, },
} }
}, },

View File

@@ -249,7 +249,7 @@ namespace Content.Client.State
UserNameBox = new LineEdit UserNameBox = new LineEdit
{ {
Text = currentUserName, PlaceHolder = "Username", Text = currentUserName, PlaceHolder = "Username",
SizeFlagsHorizontal = SizeFlags.FillExpand HorizontalExpand = true
}; };
userNameHBox.AddChild(UserNameBox); userNameHBox.AddChild(UserNameBox);
@@ -268,13 +268,13 @@ namespace Content.Client.State
vBox.AddChild(JoinPublicServerButton); vBox.AddChild(JoinPublicServerButton);
// Separator. // Separator.
vBox.AddChild(new Control {CustomMinimumSize = (0, 2)}); vBox.AddChild(new Control {MinSize = (0, 2)});
AddressBox = new LineEdit AddressBox = new LineEdit
{ {
Text = "localhost", Text = "localhost",
PlaceHolder = "server address:port", PlaceHolder = "server address:port",
SizeFlagsHorizontal = SizeFlags.FillExpand HorizontalExpand = true
}; };
vBox.AddChild(AddressBox); vBox.AddChild(AddressBox);
@@ -289,7 +289,7 @@ namespace Content.Client.State
vBox.AddChild(DirectConnectButton); vBox.AddChild(DirectConnectButton);
// Separator. // Separator.
vBox.AddChild(new Control {CustomMinimumSize = (0, 2)}); vBox.AddChild(new Control {MinSize = (0, 2)});
OptionsButton = new Button OptionsButton = new Button
{ {

View File

@@ -68,7 +68,7 @@ namespace Content.Client.UserInterface
_gameHud = IoCManager.Resolve<IGameHud>(); _gameHud = IoCManager.Resolve<IGameHud>();
Title = Loc.GetString("Actions"); Title = Loc.GetString("Actions");
CustomMinimumSize = (300, 300); MinSize = (300, 300);
Contents.AddChild(new VBoxContainer Contents.AddChild(new VBoxContainer
{ {
@@ -81,7 +81,7 @@ namespace Content.Client.UserInterface
(_searchBar = new LineEdit (_searchBar = new LineEdit
{ {
StyleClasses = { StyleNano.StyleClassActionSearchBox }, StyleClasses = { StyleNano.StyleClassActionSearchBox },
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
PlaceHolder = Loc.GetString("Search") PlaceHolder = Loc.GetString("Search")
}), }),
(_filterButton = new MultiselectOptionButton<string>() (_filterButton = new MultiselectOptionButton<string>()
@@ -97,14 +97,14 @@ namespace Content.Client.UserInterface
(_filterLabel = new Label()), (_filterLabel = new Label()),
new ScrollContainer new ScrollContainer
{ {
//TODO: needed? CustomMinimumSize = new Vector2(200.0f, 0.0f), //TODO: needed? MinSize = new Vector2(200.0f, 0.0f),
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Children = Children =
{ {
(_resultsGrid = new GridContainer (_resultsGrid = new GridContainer
{ {
MaxWidth = 300 MaxGridWidth = 300
}) })
} }
} }
@@ -136,12 +136,12 @@ namespace Content.Client.UserInterface
_dragShadow = new TextureRect _dragShadow = new TextureRect
{ {
CustomMinimumSize = (64, 64), MinSize = (64, 64),
Stretch = TextureRect.StretchMode.Scale, Stretch = TextureRect.StretchMode.Scale,
Visible = false Visible = false,
SetSize = (64, 64)
}; };
UserInterfaceManager.PopupRoot.AddChild(_dragShadow); UserInterfaceManager.PopupRoot.AddChild(_dragShadow);
LayoutContainer.SetSize(_dragShadow, (64, 64));
_dragDropHelper = new DragDropHelper<ActionMenuItem>(OnBeginActionDrag, OnContinueActionDrag, OnEndActionDrag); _dragDropHelper = new DragDropHelper<ActionMenuItem>(OnBeginActionDrag, OnContinueActionDrag, OnEndActionDrag);
} }
@@ -190,7 +190,7 @@ namespace Content.Client.UserInterface
base.Resized(); base.Resized();
// TODO: Can rework this once https://github.com/space-wizards/RobustToolbox/issues/1392 is done, // 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 // 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() private bool OnBeginActionDrag()

View File

@@ -27,13 +27,13 @@ namespace Content.Client.UserInterface
_onControlFocusExited = onControlFocusExited; _onControlFocusExited = onControlFocusExited;
Action = action; Action = action;
CustomMinimumSize = (64, 64); MinSize = (64, 64);
SizeFlagsVertical = SizeFlags.None; VerticalAlignment = VAlignment.Top;
AddChild(new TextureRect AddChild(new TextureRect
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
Stretch = TextureRect.StretchMode.Scale, Stretch = TextureRect.StretchMode.Scale,
Texture = action.Icon.Frame0() Texture = action.Icon.Frame0()
}); });

View File

@@ -16,7 +16,6 @@ using Robust.Shared.Input;
using Robust.Shared.Input.Binding; using Robust.Shared.Input.Binding;
using Robust.Shared.IoC; using Robust.Shared.IoC;
using Robust.Shared.Log; using Robust.Shared.Log;
using Robust.Shared.Maths;
using Robust.Shared.Timing; using Robust.Shared.Timing;
namespace Content.Client.UserInterface namespace Content.Client.UserInterface
@@ -75,6 +74,7 @@ namespace Content.Client.UserInterface
public ActionsUI(ClientActionsComponent actionsComponent) public ActionsUI(ClientActionsComponent actionsComponent)
{ {
SetValue(LayoutContainer.DebugProperty, true);
_actionsComponent = actionsComponent; _actionsComponent = actionsComponent;
_actionManager = IoCManager.Resolve<ActionManager>(); _actionManager = IoCManager.Resolve<ActionManager>();
_entityManager = IoCManager.Resolve<IEntityManager>(); _entityManager = IoCManager.Resolve<IEntityManager>();
@@ -83,14 +83,14 @@ namespace Content.Client.UserInterface
_menu = new ActionMenu(_actionsComponent, this); _menu = new ActionMenu(_actionsComponent, this);
LayoutContainer.SetGrowHorizontal(this, LayoutContainer.GrowDirection.End); LayoutContainer.SetGrowHorizontal(this, LayoutContainer.GrowDirection.End);
LayoutContainer.SetGrowVertical(this, LayoutContainer.GrowDirection.End); LayoutContainer.SetGrowVertical(this, LayoutContainer.GrowDirection.Constrain);
LayoutContainer.SetAnchorTop(this, 0f); LayoutContainer.SetAnchorTop(this, 0f);
LayoutContainer.SetAnchorBottom(this, 0.8f); LayoutContainer.SetAnchorBottom(this, 0.8f);
LayoutContainer.SetMarginLeft(this, 13); LayoutContainer.SetMarginLeft(this, 13);
LayoutContainer.SetMarginTop(this, 110); LayoutContainer.SetMarginTop(this, 110);
SizeFlagsHorizontal = SizeFlags.None; HorizontalAlignment = HAlignment.Left;
SizeFlagsVertical = SizeFlags.FillExpand; VerticalExpand = true;
var resourceCache = IoCManager.Resolve<IResourceCache>(); var resourceCache = IoCManager.Resolve<IResourceCache>();
@@ -101,101 +101,101 @@ namespace Content.Client.UserInterface
var panelContainer = new PanelContainer() var panelContainer = new PanelContainer()
{ {
StyleClasses = {StyleNano.StyleClassHotbarPanel}, StyleClasses = {StyleNano.StyleClassHotbarPanel},
SizeFlagsHorizontal = SizeFlags.None, HorizontalAlignment = HAlignment.Left,
SizeFlagsVertical = SizeFlags.None VerticalAlignment = VAlignment.Top
}; };
AddChild(panelContainer); AddChild(panelContainer);
var hotbarContainer = new VBoxContainer var hotbarContainer = new VBoxContainer
{ {
SeparationOverride = 3, SeparationOverride = 3,
SizeFlagsHorizontal = SizeFlags.None HorizontalAlignment = HAlignment.Left
}; };
panelContainer.AddChild(hotbarContainer); panelContainer.AddChild(hotbarContainer);
var settingsContainer = new HBoxContainer var settingsContainer = new HBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand HorizontalExpand = true
}; };
hotbarContainer.AddChild(settingsContainer); 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"); _lockTexture = resourceCache.GetTexture("/Textures/Interface/Nano/lock.svg.192dpi.png");
_unlockTexture = resourceCache.GetTexture("/Textures/Interface/Nano/lock_open.svg.192dpi.png"); _unlockTexture = resourceCache.GetTexture("/Textures/Interface/Nano/lock_open.svg.192dpi.png");
_lockButton = new TextureButton _lockButton = new TextureButton
{ {
TextureNormal = _unlockTexture, TextureNormal = _unlockTexture,
SizeFlagsHorizontal = SizeFlags.ShrinkCenter, HorizontalAlignment = HAlignment.Center,
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
Scale = (0.5f, 0.5f) Scale = (0.5f, 0.5f)
}; };
settingsContainer.AddChild(_lockButton); settingsContainer.AddChild(_lockButton);
settingsContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 2 }); settingsContainer.AddChild(new Control { HorizontalExpand = true, SizeFlagsStretchRatio = 2 });
_settingsButton = new TextureButton _settingsButton = new TextureButton
{ {
TextureNormal = resourceCache.GetTexture("/Textures/Interface/Nano/gear.svg.192dpi.png"), TextureNormal = resourceCache.GetTexture("/Textures/Interface/Nano/gear.svg.192dpi.png"),
SizeFlagsHorizontal = SizeFlags.ShrinkCenter, HorizontalAlignment = HAlignment.Center,
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
Scale = (0.5f, 0.5f) Scale = (0.5f, 0.5f)
}; };
settingsContainer.AddChild(_settingsButton); 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 // this allows a 2 column layout if window gets too small
_slotContainer = new GridContainer _slotContainer = new GridContainer
{ {
MaxHeight = CalcMaxHeight() MaxGridHeight = CalcMaxHeight()
}; };
hotbarContainer.AddChild(_slotContainer); hotbarContainer.AddChild(_slotContainer);
_loadoutContainer = new HBoxContainer _loadoutContainer = new HBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
MouseFilter = MouseFilterMode.Stop MouseFilter = MouseFilterMode.Stop
}; };
hotbarContainer.AddChild(_loadoutContainer); hotbarContainer.AddChild(_loadoutContainer);
_loadoutContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 1 }); _loadoutContainer.AddChild(new Control { HorizontalExpand = true, SizeFlagsStretchRatio = 1 });
var previousHotbarIcon = new TextureRect() var previousHotbarIcon = new TextureRect()
{ {
Texture = resourceCache.GetTexture("/Textures/Interface/Nano/left_arrow.svg.192dpi.png"), Texture = resourceCache.GetTexture("/Textures/Interface/Nano/left_arrow.svg.192dpi.png"),
SizeFlagsHorizontal = SizeFlags.ShrinkCenter, HorizontalAlignment = HAlignment.Center,
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
TextureScale = (0.5f, 0.5f) TextureScale = (0.5f, 0.5f)
}; };
_loadoutContainer.AddChild(previousHotbarIcon); _loadoutContainer.AddChild(previousHotbarIcon);
_loadoutContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 2 }); _loadoutContainer.AddChild(new Control { HorizontalExpand = true, SizeFlagsStretchRatio = 2 });
_loadoutNumber = new Label _loadoutNumber = new Label
{ {
Text = "1", Text = "1",
SizeFlagsStretchRatio = 1 SizeFlagsStretchRatio = 1
}; };
_loadoutContainer.AddChild(_loadoutNumber); _loadoutContainer.AddChild(_loadoutNumber);
_loadoutContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 2 }); _loadoutContainer.AddChild(new Control { HorizontalExpand = true, SizeFlagsStretchRatio = 2 });
var nextHotbarIcon = new TextureRect var nextHotbarIcon = new TextureRect
{ {
Texture = resourceCache.GetTexture("/Textures/Interface/Nano/right_arrow.svg.192dpi.png"), Texture = resourceCache.GetTexture("/Textures/Interface/Nano/right_arrow.svg.192dpi.png"),
SizeFlagsHorizontal = SizeFlags.ShrinkCenter, HorizontalAlignment = HAlignment.Center,
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
TextureScale = (0.5f, 0.5f) TextureScale = (0.5f, 0.5f)
}; };
_loadoutContainer.AddChild(nextHotbarIcon); _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]; _slots = new ActionSlot[ClientActionsComponent.Slots];
_dragShadow = new TextureRect _dragShadow = new TextureRect
{ {
CustomMinimumSize = (64, 64), MinSize = (64, 64),
Stretch = TextureRect.StretchMode.Scale, Stretch = TextureRect.StretchMode.Scale,
Visible = false Visible = false,
SetSize = (64, 64)
}; };
UserInterfaceManager.PopupRoot.AddChild(_dragShadow); UserInterfaceManager.PopupRoot.AddChild(_dragShadow);
LayoutContainer.SetSize(_dragShadow, (64, 64));
for (byte i = 0; i < ClientActionsComponent.Slots; i++) for (byte i = 0; i < ClientActionsComponent.Slots; i++)
{ {
@@ -205,6 +205,8 @@ namespace Content.Client.UserInterface
} }
DragDropHelper = new DragDropHelper<ActionSlot>(OnBeginActionDrag, OnContinueActionDrag, OnEndActionDrag); DragDropHelper = new DragDropHelper<ActionSlot>(OnBeginActionDrag, OnContinueActionDrag, OnEndActionDrag);
MinSize = (10, 400);
} }
protected override void EnteredTree() protected override void EnteredTree()
@@ -231,16 +233,10 @@ namespace Content.Client.UserInterface
_gameHud.ActionsButtonVisible = false; _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() protected override void Resized()
{ {
base.Resized(); base.Resized();
_slotContainer.MaxHeight = CalcMaxHeight(); _slotContainer.MaxGridHeight = CalcMaxHeight();
} }
private float CalcMaxHeight() private float CalcMaxHeight()
@@ -265,7 +261,7 @@ namespace Content.Client.UserInterface
protected override void UIScaleChanged() protected override void UIScaleChanged()
{ {
_slotContainer.MaxHeight = CalcMaxHeight(); _slotContainer.MaxGridHeight = CalcMaxHeight();
base.UIScaleChanged(); base.UIScaleChanged();
} }

View File

@@ -82,11 +82,11 @@ namespace Content.Client.UserInterface
(_amountEdit = new LineEdit (_amountEdit = new LineEdit
{ {
PlaceHolder = Loc.GetString("A number..."), PlaceHolder = Loc.GetString("A number..."),
SizeFlagsHorizontal = SizeFlags.FillExpand HorizontalExpand = true
}), }),
}, },
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand VerticalExpand = true
}, },
new HBoxContainer new HBoxContainer
{ {
@@ -94,7 +94,7 @@ namespace Content.Client.UserInterface
{ {
(_errorLabel = new Label (_errorLabel = new Label
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
ClipText = true ClipText = true
}), }),

View File

@@ -21,10 +21,9 @@ namespace Content.Client.UserInterface.AdminMenu
remove => PlayerTabControl.OnPlayerListRefresh -= value; remove => PlayerTabControl.OnPlayerListRefresh -= value;
} }
protected override Vector2? CustomSize => (500, 250);
public AdminMenuWindow() public AdminMenuWindow()
{ {
MinSize = SetSize = (500, 250);
Title = Loc.GetString("Admin Menu"); Title = Loc.GetString("Admin Menu");
RobustXamlLoader.Load(this); RobustXamlLoader.Load(this);
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);

View File

@@ -1,15 +1,15 @@
<SS14Window <SS14Window
xmlns="https://spacestation14.io"> xmlns="https://spacestation14.io">
<HBoxContainer SizeFlagsHorizontal="FillExpand"> <HBoxContainer HorizontalExpand="True">
<VBoxContainer SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="0.45"> <VBoxContainer HorizontalExpand="True" SizeFlagsStretchRatio="0.45">
<HBoxContainer SizeFlagsHorizontal="FillExpand" SizeFlagsVertical="FillExpand" <HBoxContainer HorizontalExpand="True" VerticalExpand="True"
SizeFlagsStretchRatio="0.1"> SizeFlagsStretchRatio="0.1">
<LineEdit Name="SearchBar" PlaceHolder="Search" SizeFlagsHorizontal="FillExpand" <LineEdit Name="SearchBar" PlaceHolder="Search" HorizontalExpand="True"
SizeFlagsStretchRatio="0.6" /> SizeFlagsStretchRatio="0.6" />
</HBoxContainer> </HBoxContainer>
<ItemList Name="OutfitList" SelectMode="Single" SizeFlagsVertical="FillExpand" <ItemList Name="OutfitList" SelectMode="Single" VerticalExpand="True"
SizeFlagsStretchRatio="0.9" /> SizeFlagsStretchRatio="0.9" />
<Button Name="ConfirmButton" SizeFlagsHorizontal="FillExpand" /> <Button Name="ConfirmButton" HorizontalExpand="True" />
</VBoxContainer> </VBoxContainer>
</HBoxContainer> </HBoxContainer>
</SS14Window> </SS14Window>

View File

@@ -20,12 +20,11 @@ namespace Content.Client.UserInterface.AdminMenu.SetOutfit
[Dependency] private readonly IClientConsoleHost _consoleHost = default!; [Dependency] private readonly IClientConsoleHost _consoleHost = default!;
public EntityUid? TargetEntityId { get; set; } public EntityUid? TargetEntityId { get; set; }
protected override Vector2? CustomSize => (250, 320);
private StartingGearPrototype? _selectedOutfit; private StartingGearPrototype? _selectedOutfit;
public SetOutfitMenu() public SetOutfitMenu()
{ {
MinSize = SetSize = (250, 320);
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
RobustXamlLoader.Load(this); RobustXamlLoader.Load(this);

View File

@@ -1,12 +1,10 @@
<MarginContainer <Control
xmlns="https://spacestation14.io" xmlns="https://spacestation14.io"
xmlns:amc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls" xmlns:amc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:at="clr-namespace:Content.Client.UserInterface.AdminMenu.Tabs.AdminTab" xmlns:at="clr-namespace:Content.Client.UserInterface.AdminMenu.Tabs.AdminTab"
MarginLeftOverride="4" Margin="4"
MarginTopOverride="4" MarginRightOverride="4" MinSize="50 50">
MarginBottomOverride="4"
CustomMinimumSize="50 50">
<VBoxContainer> <VBoxContainer>
<GridContainer Columns="4"> <GridContainer Columns="4">
<amc:UICommandButton Command="kick" Text="{Loc Kick}" WindowType="{x:Type at:KickWindow}" /> <amc:UICommandButton Command="kick" Text="{Loc Kick}" WindowType="{x:Type at:KickWindow}" />
@@ -16,4 +14,4 @@
<amc:CommandButton Command="permissions" Text="{Loc Permissions Panel}" /> <amc:CommandButton Command="permissions" Text="{Loc Permissions Panel}" />
</GridContainer> </GridContainer>
</VBoxContainer> </VBoxContainer>
</MarginContainer> </Control>

View File

@@ -1,11 +1,11 @@
#nullable enable #nullable enable
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface;
namespace Content.Client.UserInterface.AdminMenu.Tabs.AdminTab namespace Content.Client.UserInterface.AdminMenu.Tabs.AdminTab
{ {
[GenerateTypedNameReferences] [GenerateTypedNameReferences]
public partial class AdminTab : MarginContainer public partial class AdminTab : Control
{ {
} }
} }

View File

@@ -1,24 +1,24 @@
<SS14Window <SS14Window
xmlns="https://spacestation14.io" xmlns="https://spacestation14.io"
xmlns:cc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls" xmlns:cc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls"
Title="{Loc Ban}" CustomMinimumSize="425 162"> Title="{Loc Ban}" MinSize="425 162">
<VBoxContainer> <VBoxContainer>
<HBoxContainer> <HBoxContainer>
<Label Text="{Loc Player}" CustomMinimumSize="100 0" /> <Label Text="{Loc Player}" MinWidth="100" />
<Control CustomMinimumSize="50 0" /> <Control MinWidth="50" />
<LineEdit Name="PlayerNameLine" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" /> <LineEdit Name="PlayerNameLine" MinWidth="100" HorizontalExpand="True" />
</HBoxContainer> </HBoxContainer>
<HBoxContainer> <HBoxContainer>
<Label Text="{Loc Reason}" CustomMinimumSize="100 0" /> <Label Text="{Loc Reason}" MinSize="100 0" />
<Control CustomMinimumSize="50 0" /> <Control MinSize="50 0" />
<LineEdit Name="ReasonLine" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" /> <LineEdit Name="ReasonLine" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer> </HBoxContainer>
<HBoxContainer> <HBoxContainer>
<Label Text="{Loc Minutes}" CustomMinimumSize="100 0" /> <Label Text="{Loc Minutes}" MinWidth="100" />
<Control CustomMinimumSize="50 0" /> <Control MinWidth="50" />
<LineEdit Name="MinutesLine" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" PlaceHolder="{Loc 0 minutes for a permanent ban}" /> <LineEdit Name="MinutesLine" MinWidth="100" HorizontalExpand="True" PlaceHolder="{Loc 0 minutes for a permanent ban}" />
</HBoxContainer> </HBoxContainer>
<Control CustomMinimumSize="50 0" /> <Control MinWidth="50" />
<Button Name="SubmitButton" Text="{Loc Ban}" /> <Button Name="SubmitButton" Text="{Loc Ban}" />
</VBoxContainer> </VBoxContainer>
</SS14Window> </SS14Window>

View File

@@ -1,12 +1,12 @@
<SS14Window <SS14Window
xmlns="https://spacestation14.io" xmlns="https://spacestation14.io"
xmlns:cc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls" xmlns:cc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls"
Title="{Loc Kick}" CustomMinimumSize="425 272"> Title="{Loc Kick}" MinSize="425 272">
<VBoxContainer> <VBoxContainer>
<HBoxContainer> <HBoxContainer>
<Label Text="{Loc Reason}" CustomMinimumSize="100 0" /> <Label Text="{Loc Reason}" MinWidth="100" />
<Control CustomMinimumSize="50 0" /> <Control MinWidth="50" />
<LineEdit Name="ReasonLine" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" /> <LineEdit Name="ReasonLine" MinWidth="100" HorizontalExpand="True" />
</HBoxContainer> </HBoxContainer>
<cc:PlayerListControl Name="PlayerList" /> <cc:PlayerListControl Name="PlayerList" />
<Button Name="SubmitButton" Text="{Loc Kick}" /> <Button Name="SubmitButton" Text="{Loc Kick}" />

View File

@@ -1,8 +1,8 @@
<SS14Window <SS14Window
xmlns="https://spacestation14.io" xmlns="https://spacestation14.io"
xmlns:cc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls" xmlns:cc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls"
Title="{Loc Teleport}" CustomMinimumSize="425 230"> Title="{Loc Teleport}" MinSize="425 230">
<VBoxContainer SizeFlagsVertical="FillExpand"> <VBoxContainer>
<cc:PlayerListControl Name="PlayerList" /> <cc:PlayerListControl Name="PlayerList" />
<Button Name="SubmitButton" Text="{Loc Teleport}" /> <Button Name="SubmitButton" Text="{Loc Teleport}" />
</VBoxContainer> </VBoxContainer>

View File

@@ -1,16 +1,14 @@
<MarginContainer <Control
xmlns="https://spacestation14.io" xmlns="https://spacestation14.io"
xmlns:amc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls" xmlns:amc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:abt="clr-namespace:Content.Client.UserInterface.AdminMenu.Tabs.AdminbusTab" xmlns:abt="clr-namespace:Content.Client.UserInterface.AdminMenu.Tabs.AdminbusTab"
MarginLeftOverride="4" Margin="4"
MarginTopOverride="4" MarginRightOverride="4" MinSize="50 50">
MarginBottomOverride="4"
CustomMinimumSize="50 50">
<GridContainer <GridContainer
Columns="4"> Columns="4">
<amc:CommandButton Name="SpawnEntitiesButton" Text="{Loc Spawn Entities}" /> <amc:CommandButton Name="SpawnEntitiesButton" Text="{Loc Spawn Entities}" />
<amc:CommandButton Name="SpawnTilesButton" Text="{Loc Spawn Tiles} " /> <amc:CommandButton Name="SpawnTilesButton" Text="{Loc Spawn Tiles} " />
<amc:UICommandButton Command="events" Text="{Loc Station Events}" WindowType="{x:Type abt:StationEventsWindow}" /> <amc:UICommandButton Command="events" Text="{Loc Station Events}" WindowType="{x:Type abt:StationEventsWindow}" />
</GridContainer> </GridContainer>
</MarginContainer> </Control>

View File

@@ -2,6 +2,7 @@
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.Placement; using Robust.Client.Placement;
using Robust.Client.ResourceManagement; using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.IoC; using Robust.Shared.IoC;
@@ -11,7 +12,7 @@ using Robust.Shared.Prototypes;
namespace Content.Client.UserInterface.AdminMenu.Tabs.AdminbusTab namespace Content.Client.UserInterface.AdminMenu.Tabs.AdminbusTab
{ {
[GenerateTypedNameReferences] [GenerateTypedNameReferences]
public partial class AdminbusTab : MarginContainer public partial class AdminbusTab : Control
{ {
protected override void EnteredTree() protected override void EnteredTree()
{ {

View File

@@ -2,9 +2,9 @@
xmlns="https://spacestation14.io" Title="Kick"> xmlns="https://spacestation14.io" Title="Kick">
<VBoxContainer> <VBoxContainer>
<HBoxContainer> <HBoxContainer>
<Label Text="{Loc Event}" CustomMinimumSize="100 0" /> <Label Text="{Loc Event}" MinSize="100 0" />
<Control CustomMinimumSize="50 0" /> <Control MinSize="50 0" />
<OptionButton Name="EventsOptions" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" /> <OptionButton Name="EventsOptions" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer> </HBoxContainer>
<Button Name="PauseButton" Text="{Loc Pause}" /> <Button Name="PauseButton" Text="{Loc Pause}" />
<Button Name="ResumeButton" Text="{Loc Resume}" /> <Button Name="ResumeButton" Text="{Loc Resume}" />

View File

@@ -2,9 +2,9 @@
xmlns="https://spacestation14.io" Title="{Loc Add Atmos}"> xmlns="https://spacestation14.io" Title="{Loc Add Atmos}">
<VBoxContainer> <VBoxContainer>
<HBoxContainer> <HBoxContainer>
<Label Text="{Loc Grid}" CustomMinimumSize="100 0" /> <Label Text="{Loc Grid}" MinSize="100 0" />
<Control CustomMinimumSize="50 0" /> <Control MinSize="50 0" />
<OptionButton Name="GridOptions" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" /> <OptionButton Name="GridOptions" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer> </HBoxContainer>
<Button Name="SubmitButton" Text="{Loc Add Atmos}" /> <Button Name="SubmitButton" Text="{Loc Add Atmos}" />
</VBoxContainer> </VBoxContainer>

View File

@@ -2,29 +2,29 @@
xmlns="https://spacestation14.io" Title="{Loc Add Gas}"> xmlns="https://spacestation14.io" Title="{Loc Add Gas}">
<VBoxContainer> <VBoxContainer>
<HBoxContainer> <HBoxContainer>
<Label Text="{Loc Grid}" CustomMinimumSize="100 0" /> <Label Text="{Loc Grid}" MinSize="100 0" />
<Control CustomMinimumSize="50 0" /> <Control MinSize="50 0" />
<OptionButton Name="GridOptions" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" /> <OptionButton Name="GridOptions" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer> </HBoxContainer>
<HBoxContainer> <HBoxContainer>
<Label Text="{Loc TileX}" CustomMinimumSize="100 0" /> <Label Text="{Loc TileX}" MinSize="100 0" />
<Control CustomMinimumSize="50 0" /> <Control MinSize="50 0" />
<SpinBox Name="TileXSpin" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" /> <SpinBox Name="TileXSpin" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer> </HBoxContainer>
<HBoxContainer> <HBoxContainer>
<Label Text="{Loc TileY}" CustomMinimumSize="100 0" /> <Label Text="{Loc TileY}" MinSize="100 0" />
<Control CustomMinimumSize="50 0" /> <Control MinSize="50 0" />
<SpinBox Name="TileYSpin" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" /> <SpinBox Name="TileYSpin" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer> </HBoxContainer>
<HBoxContainer> <HBoxContainer>
<Label Text="{Loc Gas}" CustomMinimumSize="100 0" /> <Label Text="{Loc Gas}" MinSize="100 0" />
<Control CustomMinimumSize="50 0" /> <Control MinSize="50 0" />
<OptionButton Name="GasOptions" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" /> <OptionButton Name="GasOptions" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer> </HBoxContainer>
<HBoxContainer> <HBoxContainer>
<Label Text="{Loc Amount}" CustomMinimumSize="100 0" /> <Label Text="{Loc Amount}" MinSize="100 0" />
<Control CustomMinimumSize="50 0" /> <Control MinSize="50 0" />
<SpinBox Name="AmountSpin" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" /> <SpinBox Name="AmountSpin" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer> </HBoxContainer>
<Button Name="SubmitButton" Text="{Loc Add Gas}" /> <Button Name="SubmitButton" Text="{Loc Add Gas}" />
</VBoxContainer> </VBoxContainer>

View File

@@ -1,12 +1,10 @@
<MarginContainer <Control
xmlns="https://spacestation14.io" xmlns="https://spacestation14.io"
xmlns:amc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls" xmlns:amc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:at="clr-namespace:Content.Client.UserInterface.AdminMenu.Tabs.AtmosTab" xmlns:at="clr-namespace:Content.Client.UserInterface.AdminMenu.Tabs.AtmosTab"
MarginLeftOverride="4" Margin="4"
MarginTopOverride="4" MarginRightOverride="4" MinSize="50 50">
MarginBottomOverride="4"
CustomMinimumSize="50 50">
<GridContainer Columns="4"> <GridContainer Columns="4">
<amc:UICommandButton Text="{Loc Add Atmos}" Command="addatmos" WindowType="{x:Type at:AddAtmosWindow}" /> <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}" /> <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" <amc:UICommandButton Text="{Loc Set Temperature}" Command="settemp"
WindowType="{x:Type at:SetTemperatureWindow}" /> WindowType="{x:Type at:SetTemperatureWindow}" />
</GridContainer> </GridContainer>
</MarginContainer> </Control>

View File

@@ -1,11 +1,12 @@
#nullable enable #nullable enable
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
namespace Content.Client.UserInterface.AdminMenu.Tabs.AtmosTab namespace Content.Client.UserInterface.AdminMenu.Tabs.AtmosTab
{ {
[GenerateTypedNameReferences] [GenerateTypedNameReferences]
public partial class AtmosTab : MarginContainer public partial class AtmosTab : Control
{ {
} }
} }

View File

@@ -2,19 +2,19 @@
xmlns="https://spacestation14.io" Title="{Loc Fill Gas}"> xmlns="https://spacestation14.io" Title="{Loc Fill Gas}">
<VBoxContainer> <VBoxContainer>
<HBoxContainer> <HBoxContainer>
<Label Text="{Loc Grid}" CustomMinimumSize="100 0" /> <Label Text="{Loc Grid}" MinSize="100 0" />
<Control CustomMinimumSize="50 0" /> <Control MinSize="50 0" />
<OptionButton Name="GridOptions" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" /> <OptionButton Name="GridOptions" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer> </HBoxContainer>
<HBoxContainer> <HBoxContainer>
<Label Text="{Loc Gas}" CustomMinimumSize="100 0" /> <Label Text="{Loc Gas}" MinSize="100 0" />
<Control CustomMinimumSize="50 0" /> <Control MinSize="50 0" />
<OptionButton Name="GasOptions" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" /> <OptionButton Name="GasOptions" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer> </HBoxContainer>
<HBoxContainer> <HBoxContainer>
<Label Text="{Loc Amount}" CustomMinimumSize="100 0" /> <Label Text="{Loc Amount}" MinSize="100 0" />
<Control CustomMinimumSize="50 0" /> <Control MinSize="50 0" />
<SpinBox Name="AmountSpin" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" /> <SpinBox Name="AmountSpin" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer> </HBoxContainer>
<Button Name="SubmitButton" Text="{Loc Fill Gas}" /> <Button Name="SubmitButton" Text="{Loc Fill Gas}" />
</VBoxContainer> </VBoxContainer>

View File

@@ -2,24 +2,24 @@
xmlns="https://spacestation14.io" Title="{Loc Set Temperature}"> xmlns="https://spacestation14.io" Title="{Loc Set Temperature}">
<VBoxContainer> <VBoxContainer>
<HBoxContainer> <HBoxContainer>
<Label Text="{Loc Grid}" CustomMinimumSize="100 0" /> <Label Text="{Loc Grid}" MinSize="100 0" />
<Control CustomMinimumSize="50 0" /> <Control MinSize="50 0" />
<OptionButton Name="GridOptions" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" /> <OptionButton Name="GridOptions" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer> </HBoxContainer>
<HBoxContainer> <HBoxContainer>
<Label Text="{Loc TileX}" CustomMinimumSize="100 0" /> <Label Text="{Loc TileX}" MinSize="100 0" />
<Control CustomMinimumSize="50 0" /> <Control MinSize="50 0" />
<SpinBox Name="TileXSpin" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" /> <SpinBox Name="TileXSpin" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer> </HBoxContainer>
<HBoxContainer> <HBoxContainer>
<Label Text="{Loc TileY}" CustomMinimumSize="100 0" /> <Label Text="{Loc TileY}" MinSize="100 0" />
<Control CustomMinimumSize="50 0" /> <Control MinSize="50 0" />
<SpinBox Name="TileYSpin" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" /> <SpinBox Name="TileYSpin" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer> </HBoxContainer>
<HBoxContainer> <HBoxContainer>
<Label Text="{Loc Temperature}" CustomMinimumSize="100 0" /> <Label Text="{Loc Temperature}" MinSize="100 0" />
<Control CustomMinimumSize="50 0" /> <Control MinSize="50 0" />
<SpinBox Name="TemperatureSpin" CustomMinimumSize="100 0" SizeFlagsHorizontal="FillExpand" /> <SpinBox Name="TemperatureSpin" MinSize="100 0" HorizontalExpand="True" />
</HBoxContainer> </HBoxContainer>
<Button Name="SubmitButton" Text="{Loc Set Temperature}" /> <Button Name="SubmitButton" Text="{Loc Set Temperature}" />
</VBoxContainer> </VBoxContainer>

View File

@@ -1,15 +1,14 @@
<MarginContainer <Control xmlns="https://spacestation14.io">
xmlns="https://spacestation14.io"> <VBoxContainer>
<VBoxContainer SizeFlagsVertical="Fill"> <HBoxContainer>
<HBoxContainer SizeFlagsVertical="Fill"> <Label Name="PlayerCount" HorizontalExpand="True" SizeFlagsStretchRatio="0.7"
<Label Name="PlayerCount" SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="0.7"
Text="{Loc Player Count}" /> Text="{Loc Player Count}" />
<Button Name="RefreshButton" SizeFlagsHorizontal="FillExpand" SizeFlagsStretchRatio="0.3" <Button Name="RefreshButton" HorizontalExpand="True" SizeFlagsStretchRatio="0.3"
Text="{Loc Refresh}" /> Text="{Loc Refresh}" />
</HBoxContainer> </HBoxContainer>
<Control CustomMinimumSize="0 5" /> <Control MinSize="0 5" />
<ScrollContainer SizeFlagsHorizontal="FillExpand" SizeFlagsVertical="FillExpand"> <ScrollContainer HorizontalExpand="True" VerticalExpand="True">
<VBoxContainer Name="PlayerList" /> <VBoxContainer Name="PlayerList" />
</ScrollContainer> </ScrollContainer>
</VBoxContainer> </VBoxContainer>
</MarginContainer> </Control>

View File

@@ -13,7 +13,7 @@ using Robust.Shared.Maths;
namespace Content.Client.UserInterface.AdminMenu.Tabs namespace Content.Client.UserInterface.AdminMenu.Tabs
{ {
[GenerateTypedNameReferences] [GenerateTypedNameReferences]
public partial class PlayerTab : MarginContainer public partial class PlayerTab : Control
{ {
public delegate void PlayerListRefresh(); public delegate void PlayerListRefresh();
@@ -42,7 +42,7 @@ namespace Content.Client.UserInterface.AdminMenu.Tabs
var header = new HBoxContainer var header = new HBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SeparationOverride = 4, SeparationOverride = 4,
Children = Children =
{ {
@@ -50,14 +50,14 @@ namespace Content.Client.UserInterface.AdminMenu.Tabs
{ {
Text = "Name", Text = "Name",
SizeFlagsStretchRatio = 2f, SizeFlagsStretchRatio = 2f,
SizeFlagsHorizontal = SizeFlags.FillExpand HorizontalExpand = true
}, },
new VSeparator(), new VSeparator(),
new Label new Label
{ {
Text = "Player", Text = "Player",
SizeFlagsStretchRatio = 2f, SizeFlagsStretchRatio = 2f,
SizeFlagsHorizontal = SizeFlags.FillExpand HorizontalExpand = true
} }
} }
}; };
@@ -79,7 +79,7 @@ namespace Content.Client.UserInterface.AdminMenu.Tabs
{ {
var hBox = new HBoxContainer var hBox = new HBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SeparationOverride = 4, SeparationOverride = 4,
Children = Children =
{ {
@@ -87,7 +87,7 @@ namespace Content.Client.UserInterface.AdminMenu.Tabs
{ {
Text = name, Text = name,
SizeFlagsStretchRatio = 2f, SizeFlagsStretchRatio = 2f,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
ClipText = true ClipText = true
}, },
new VSeparator(), new VSeparator(),
@@ -95,7 +95,7 @@ namespace Content.Client.UserInterface.AdminMenu.Tabs
{ {
Text = player, Text = player,
SizeFlagsStretchRatio = 2f, SizeFlagsStretchRatio = 2f,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
ClipText = true ClipText = true
} }
} }
@@ -121,7 +121,7 @@ namespace Content.Client.UserInterface.AdminMenu.Tabs
{ {
public VSeparator() public VSeparator()
{ {
CustomMinimumSize = (2, 5); MinSize = (2, 5);
AddChild(new PanelContainer AddChild(new PanelContainer
{ {
PanelOverride = new StyleBoxFlat PanelOverride = new StyleBoxFlat

View File

@@ -1,14 +1,12 @@
<MarginContainer <Control
xmlns="https://spacestation14.io" xmlns="https://spacestation14.io"
xmlns:amc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls" xmlns:amc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls"
MarginLeftOverride="4" Margin="4"
MarginTopOverride="4" MarginRightOverride="4" MinSize="50 50">
MarginBottomOverride="4"
CustomMinimumSize="50 50">
<GridContainer <GridContainer
Columns="4"> Columns="4">
<amc:CommandButton Command="startround" Text="{Loc Start Round}" /> <amc:CommandButton Command="startround" Text="{Loc Start Round}" />
<amc:CommandButton Command="endround" Text="{Loc End Round}" /> <amc:CommandButton Command="endround" Text="{Loc End Round}" />
<amc:CommandButton Command="restartround" Text="{Loc Restart Round}" /> <amc:CommandButton Command="restartround" Text="{Loc Restart Round}" />
</GridContainer> </GridContainer>
</MarginContainer> </Control>

View File

@@ -1,11 +1,12 @@
#nullable enable #nullable enable
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
namespace Content.Client.UserInterface.AdminMenu.Tabs namespace Content.Client.UserInterface.AdminMenu.Tabs
{ {
[GenerateTypedNameReferences] [GenerateTypedNameReferences]
public partial class RoundTab : MarginContainer public partial class RoundTab : Control
{ {
} }
} }

View File

@@ -1,13 +1,11 @@
<MarginContainer <Control
xmlns="https://spacestation14.io" xmlns="https://spacestation14.io"
xmlns:amc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls" xmlns:amc="clr-namespace:Content.Client.UserInterface.AdminMenu.CustomControls"
MarginLeftOverride="4" Margin="4"
MarginTopOverride="4" MarginRightOverride="4" MinSize="50 50">
MarginBottomOverride="4"
CustomMinimumSize="50 50">
<GridContainer <GridContainer
Columns="4" > Columns="4" >
<amc:CommandButton Command="restart" Text="{Loc Reboot}"></amc:CommandButton> <amc:CommandButton Command="restart" Text="{Loc Reboot}"></amc:CommandButton>
<amc:CommandButton Command="shutdown" Text="{Loc Shutdown}"></amc:CommandButton> <amc:CommandButton Command="shutdown" Text="{Loc Shutdown}"></amc:CommandButton>
</GridContainer> </GridContainer>
</MarginContainer> </Control>

View File

@@ -1,14 +1,12 @@
#nullable enable #nullable enable
using Robust.Client.AutoGenerated; using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
namespace Content.Client.UserInterface.AdminMenu.Tabs namespace Content.Client.UserInterface.AdminMenu.Tabs
{ {
[GenerateTypedNameReferences] [GenerateTypedNameReferences]
public partial class ServerTab : MarginContainer public partial class ServerTab : Control
{
public ServerTab()
{ {
} }
} }
}

View File

@@ -1,7 +1,6 @@
using Content.Client.UserInterface.Stylesheets; using Content.Client.UserInterface.Stylesheets;
using Robust.Client.UserInterface; using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls; using Robust.Client.UserInterface.Controls;
using Robust.Shared.Maths;
namespace Content.Client.UserInterface namespace Content.Client.UserInterface
{ {
@@ -25,37 +24,35 @@ namespace Content.Client.UserInterface
var panelContainer = new PanelContainer var panelContainer = new PanelContainer
{ {
StyleClasses = {StyleNano.StyleClassTransparentBorderedWindowPanel}, StyleClasses = {StyleNano.StyleClassTransparentBorderedWindowPanel},
SizeFlagsHorizontal = SizeFlags.ShrinkEnd, HorizontalAlignment = HAlignment.Right,
SizeFlagsVertical = SizeFlags.None VerticalAlignment = VAlignment.Top
}; };
AddChild(panelContainer); AddChild(panelContainer);
Grid = new GridContainer Grid = new GridContainer
{ {
MaxHeight = 64, MaxGridHeight = 64,
ExpandBackwards = true ExpandBackwards = true
}; };
panelContainer.AddChild(Grid); 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() protected override void Resized()
{ {
// TODO: Can rework this once https://github.com/space-wizards/RobustToolbox/issues/1392 is done, // 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 // 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 // on constraints, otherwise we would use anchors to lay it out
base.Resized(); base.Resized();
Grid.MaxHeight = Height; Grid.MaxGridHeight = Height;
}
protected override Vector2 CalculateMinimumSize()
{
// allows us to shrink down to a single row
return (64, 64);
} }
protected override void UIScaleChanged() protected override void UIScaleChanged()
{ {
Grid.MaxHeight = Height; Grid.MaxGridHeight = Height;
base.UIScaleChanged(); base.UIScaleChanged();
} }
} }

View File

@@ -72,7 +72,7 @@ namespace Content.Client.UserInterface.Atmos.GasTank
Children = Children =
{ {
(_topContainer = new VBoxContainer()), (_topContainer = new VBoxContainer()),
new Control {CustomMinimumSize = (0, 110)} new Control {MinSize = (0, 110)}
} }
}; };
@@ -82,16 +82,9 @@ namespace Content.Client.UserInterface.Atmos.GasTank
var font = _resourceCache.GetFont("/Fonts/Boxfont-round/Boxfont Round.ttf", 13); 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,
Children =
{
new HBoxContainer
{ {
Margin = new Thickness(4, 2, 12, 2),
Children = Children =
{ {
(_lblName = new Label (_lblName = new Label
@@ -99,21 +92,17 @@ namespace Content.Client.UserInterface.Atmos.GasTank
Text = Loc.GetString("Gas Tank"), Text = Loc.GetString("Gas Tank"),
FontOverride = font, FontOverride = font,
FontColorOverride = StyleNano.NanoGold, FontColorOverride = StyleNano.NanoGold,
SizeFlagsVertical = SizeFlags.ShrinkCenter VerticalAlignment = VAlignment.Center,
HorizontalExpand = true,
HorizontalAlignment = HAlignment.Left,
Margin = new Thickness(0, 0, 20, 0),
}), }),
new Control
{
CustomMinimumSize = (20, 0),
SizeFlagsHorizontal = SizeFlags.Expand
},
(btnClose = new TextureButton (btnClose = new TextureButton
{ {
StyleClasses = {SS14Window.StyleClassWindowCloseButton}, StyleClasses = {SS14Window.StyleClassWindowCloseButton},
SizeFlagsVertical = SizeFlags.ShrinkCenter VerticalAlignment = VAlignment.Center
}) })
} }
}
}
}; };
var middle = new PanelContainer var middle = new PanelContainer
@@ -121,30 +110,23 @@ namespace Content.Client.UserInterface.Atmos.GasTank
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#202025")}, PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#202025")},
Children = Children =
{ {
new MarginContainer (_contentContainer = new VBoxContainer
{ {
MarginLeftOverride = 8, Margin = new Thickness(8, 4),
MarginRightOverride = 8, })
MarginTopOverride = 4,
MarginBottomOverride = 4,
Children =
{
(_contentContainer = new VBoxContainer())
}
}
} }
}; };
_topContainer.AddChild(topRow); _topContainer.AddChild(topRow);
_topContainer.AddChild(new PanelContainer _topContainer.AddChild(new PanelContainer
{ {
CustomMinimumSize = (0, 2), MinSize = (0, 2),
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#525252ff")} PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#525252ff")}
}); });
_topContainer.AddChild(middle); _topContainer.AddChild(middle);
_topContainer.AddChild(new PanelContainer _topContainer.AddChild(new PanelContainer
{ {
CustomMinimumSize = (0, 2), MinSize = (0, 2),
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#525252ff")} PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#525252ff")}
}); });
@@ -154,26 +136,20 @@ namespace Content.Client.UserInterface.Atmos.GasTank
//internals //internals
_lblInternals = new RichTextLabel _lblInternals = new RichTextLabel
{CustomMinimumSize = (200, 0), SizeFlagsVertical = SizeFlags.ShrinkCenter}; {MinSize = (200, 0), VerticalAlignment = VAlignment.Center};
_btnInternals = new Button {Text = Loc.GetString("Toggle")}; _btnInternals = new Button {Text = Loc.GetString("Toggle")};
_contentContainer.AddChild( _contentContainer.AddChild(
new MarginContainer
{
MarginTopOverride = 7,
Children =
{
new HBoxContainer new HBoxContainer
{ {
Margin = new Thickness(0, 7, 0, 0),
Children = {_lblInternals, _btnInternals} Children = {_lblInternals, _btnInternals}
}
}
}); });
// Separator // Separator
_contentContainer.AddChild(new Control _contentContainer.AddChild(new Control
{ {
CustomMinimumSize = new Vector2(0, 10) MinSize = new Vector2(0, 10)
}); });
_contentContainer.AddChild(new Label _contentContainer.AddChild(new Label
@@ -181,19 +157,12 @@ namespace Content.Client.UserInterface.Atmos.GasTank
Text = Loc.GetString("Output Pressure"), Text = Loc.GetString("Output Pressure"),
Align = Label.AlignMode.Center Align = Label.AlignMode.Center
}); });
_spbPressure = new FloatSpinBox {IsValid = f => f >= 0 || f <= 3000}; _spbPressure = new FloatSpinBox
_contentContainer.AddChild(
new MarginContainer
{ {
MarginRightOverride = 25, IsValid = f => f >= 0 || f <= 3000,
MarginLeftOverride = 25, Margin = new Thickness(25, 0, 25, 7)
MarginBottomOverride = 7, };
Children = _contentContainer.AddChild(_spbPressure);
{
_spbPressure
}
}
);
// Handlers // Handlers
_spbPressure.OnValueChanged += args => _spbPressure.OnValueChanged += args =>

View File

@@ -15,8 +15,6 @@ namespace Content.Client.UserInterface.Cargo
{ {
public class CargoConsoleMenu : SS14Window public class CargoConsoleMenu : SS14Window
{ {
protected override Vector2? CustomSize => (400, 600);
public CargoConsoleBoundUserInterface Owner { get; private set; } public CargoConsoleBoundUserInterface Owner { get; private set; }
public event Action<BaseButton.ButtonEventArgs> OnItemSelected; public event Action<BaseButton.ButtonEventArgs> OnItemSelected;
@@ -42,6 +40,7 @@ namespace Content.Client.UserInterface.Cargo
public CargoConsoleMenu(CargoConsoleBoundUserInterface owner) public CargoConsoleMenu(CargoConsoleBoundUserInterface owner)
{ {
SetSize = MinSize = (400, 600);
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
Owner = owner; Owner = owner;
@@ -112,7 +111,7 @@ namespace Content.Client.UserInterface.Cargo
//Text = Loc.GetString("Call Shuttle"), //Text = Loc.GetString("Call Shuttle"),
Text = Loc.GetString("Activate Telepad"), //Shuttle code pending Text = Loc.GetString("Activate Telepad"), //Shuttle code pending
TextAlign = Label.AlignMode.Center, TextAlign = Label.AlignMode.Center,
SizeFlagsHorizontal = SizeFlags.FillExpand HorizontalExpand = true
}; };
PermissionsButton = new Button() PermissionsButton = new Button()
{ {
@@ -127,13 +126,13 @@ namespace Content.Client.UserInterface.Cargo
_categories = new OptionButton _categories = new OptionButton
{ {
Prefix = Loc.GetString("Categories: "), Prefix = Loc.GetString("Categories: "),
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsStretchRatio = 1 SizeFlagsStretchRatio = 1
}; };
_searchBar = new LineEdit _searchBar = new LineEdit
{ {
PlaceHolder = Loc.GetString("Search"), PlaceHolder = Loc.GetString("Search"),
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsStretchRatio = 1 SizeFlagsStretchRatio = 1
}; };
category.AddChild(_categories); category.AddChild(_categories);
@@ -142,41 +141,41 @@ namespace Content.Client.UserInterface.Cargo
var products = new ScrollContainer() var products = new ScrollContainer()
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsStretchRatio = 6 SizeFlagsStretchRatio = 6
}; };
Products = new VBoxContainer() Products = new VBoxContainer()
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand VerticalExpand = true
}; };
products.AddChild(Products); products.AddChild(Products);
rows.AddChild(products); rows.AddChild(products);
var requestsAndOrders = new PanelContainer var requestsAndOrders = new PanelContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsStretchRatio = 6, SizeFlagsStretchRatio = 6,
PanelOverride = new StyleBoxFlat { BackgroundColor = Color.Black } PanelOverride = new StyleBoxFlat { BackgroundColor = Color.Black }
}; };
var orderScrollBox = new ScrollContainer var orderScrollBox = new ScrollContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand VerticalExpand = true
}; };
var rAndOVBox = new VBoxContainer(); var rAndOVBox = new VBoxContainer();
var requestsLabel = new Label { Text = Loc.GetString("Requests") }; var requestsLabel = new Label { Text = Loc.GetString("Requests") };
_requests = new VBoxContainer // replace with scroll box so that approval buttons can be added _requests = new VBoxContainer // replace with scroll box so that approval buttons can be added
{ {
StyleClasses = { "transparentItemList" }, StyleClasses = { "transparentItemList" },
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
}; };
var ordersLabel = new Label { Text = Loc.GetString("Orders") }; var ordersLabel = new Label { Text = Loc.GetString("Orders") };
_orders = new VBoxContainer _orders = new VBoxContainer
{ {
StyleClasses = { "transparentItemList" }, StyleClasses = { "transparentItemList" },
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
}; };
rAndOVBox.AddChild(requestsLabel); rAndOVBox.AddChild(requestsLabel);
@@ -189,7 +188,7 @@ namespace Content.Client.UserInterface.Cargo
rows.AddChild(new TextureButton rows.AddChild(new TextureButton
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
}); });
Contents.AddChild(rows); Contents.AddChild(rows);
@@ -351,30 +350,30 @@ namespace Content.Client.UserInterface.Cargo
public CargoProductRow() public CargoProductRow()
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand; HorizontalExpand = true;
MainButton = new Button MainButton = new Button
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand VerticalExpand = true
}; };
AddChild(MainButton); AddChild(MainButton);
var hBox = new HBoxContainer var hBox = new HBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand HorizontalExpand = true
}; };
Icon = new TextureRect Icon = new TextureRect
{ {
CustomMinimumSize = new Vector2(32.0f, 32.0f), MinSize = new Vector2(32.0f, 32.0f),
RectClipContent = true RectClipContent = true
}; };
hBox.AddChild(Icon); hBox.AddChild(Icon);
ProductName = new Label ProductName = new Label
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand HorizontalExpand = true
}; };
hBox.AddChild(ProductName); hBox.AddChild(ProductName);
@@ -384,7 +383,7 @@ namespace Content.Client.UserInterface.Cargo
}; };
PointCost = new Label PointCost = new Label
{ {
CustomMinimumSize = new Vector2(40.0f, 32.0f), MinSize = new Vector2(40.0f, 32.0f),
Align = Label.AlignMode.Right Align = Label.AlignMode.Right
}; };
panel.AddChild(PointCost); panel.AddChild(PointCost);
@@ -405,34 +404,34 @@ namespace Content.Client.UserInterface.Cargo
public CargoOrderRow() public CargoOrderRow()
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand; HorizontalExpand = true;
var hBox = new HBoxContainer var hBox = new HBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
}; };
Icon = new TextureRect Icon = new TextureRect
{ {
CustomMinimumSize = new Vector2(32.0f, 32.0f), MinSize = new Vector2(32.0f, 32.0f),
RectClipContent = true RectClipContent = true
}; };
hBox.AddChild(Icon); hBox.AddChild(Icon);
var vBox = new VBoxContainer var vBox = new VBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand VerticalExpand = true
}; };
ProductName = new Label ProductName = new Label
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
StyleClasses = { StyleNano.StyleClassLabelSubText }, StyleClasses = { StyleNano.StyleClassLabelSubText },
ClipText = true ClipText = true
}; };
Description = new Label Description = new Label
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
StyleClasses = { StyleNano.StyleClassLabelSubText }, StyleClasses = { StyleNano.StyleClassLabelSubText },
ClipText = true ClipText = true
}; };

View File

@@ -35,7 +35,7 @@ namespace Content.Client.UserInterface.Cargo
var amountLabel = new Label { Text = Loc.GetString("Amount:") }; var amountLabel = new Label { Text = Loc.GetString("Amount:") };
Amount = new SpinBox Amount = new SpinBox
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
Value = 1 Value = 1
}; };
Amount.SetButtons(new List<int>() { -100, -10, -1 }, new List<int>() { 1, 10, 100 }); Amount.SetButtons(new List<int>() { -100, -10, -1 }, new List<int>() { 1, 10, 100 });

View File

@@ -16,27 +16,18 @@ namespace Content.Client.UserInterface.Cargo
private int[] _accountIds = new int[] { }; private int[] _accountIds = new int[] { };
private int _selectedAccountId = -1; private int _selectedAccountId = -1;
protected override Vector2? CustomSize => (300, 300);
public CargoConsoleBoundUserInterface Owner; public CargoConsoleBoundUserInterface Owner;
public GalacticBankSelectionMenu() public GalacticBankSelectionMenu()
{ {
MinSize = SetSize = (300, 300);
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
Title = Loc.GetString("Galactic Bank Selection"); Title = Loc.GetString("Galactic Bank Selection");
_accounts = new ItemList() { SelectMode = ItemList.ItemListSelectMode.Single }; _accounts = new ItemList() { SelectMode = ItemList.ItemListSelectMode.Single };
var margin = new MarginContainer() Contents.AddChild(_accounts);
{
SizeFlagsVertical = SizeFlags.FillExpand,
SizeFlagsHorizontal = SizeFlags.FillExpand,
};
margin.AddChild(_accounts);
Contents.AddChild(margin);
} }
public void Populate(int accountCount, string[] accountNames, int[] accountIds, int selectedAccountId) public void Populate(int accountCount, string[] accountNames, int[] accountIds, int selectedAccountId)

View File

@@ -36,12 +36,9 @@ namespace Content.Client.UserInterface
{ {
_entityManager = entityManager; _entityManager = entityManager;
_preferencesManager = preferencesManager; _preferencesManager = preferencesManager;
var margin = new MarginContainer var margin = new Control
{ {
MarginBottomOverride = 20, Margin = new Thickness(20),
MarginLeftOverride = 20,
MarginRightOverride = 20,
MarginTopOverride = 20
}; };
AddChild(margin); AddChild(margin);
@@ -67,32 +64,25 @@ namespace Content.Client.UserInterface
var topHBox = new HBoxContainer var topHBox = new HBoxContainer
{ {
CustomMinimumSize = (0, 40), MinSize = (0, 40),
Children =
{
new MarginContainer
{
MarginLeftOverride = 8,
Children = Children =
{ {
new Label new Label
{ {
Margin = new Thickness(8, 0, 0, 0),
Text = Loc.GetString("Character Setup"), Text = Loc.GetString("Character Setup"),
StyleClasses = {StyleNano.StyleClassLabelHeadingBigger}, StyleClasses = {StyleNano.StyleClassLabelHeadingBigger},
VAlign = Label.VAlignMode.Center, VAlign = Label.VAlignMode.Center,
SizeFlagsHorizontal = SizeFlags.Expand | SizeFlags.ShrinkCenter
}
}
}, },
(SaveButton = new Button (SaveButton = new Button
{ {
SizeFlagsHorizontal = SizeFlags.Expand | SizeFlags.ShrinkEnd, HorizontalExpand = true,
HorizontalAlignment = HAlignment.Right,
Text = Loc.GetString("Save"), Text = Loc.GetString("Save"),
StyleClasses = {StyleNano.StyleClassButtonBig}, StyleClasses = {StyleNano.StyleClassButtonBig},
}), }),
(CloseButton = new Button (CloseButton = new Button
{ {
SizeFlagsHorizontal = SizeFlags.ShrinkEnd,
Text = Loc.GetString("Close"), Text = Loc.GetString("Close"),
StyleClasses = {StyleNano.StyleClassButtonBig}, StyleClasses = {StyleNano.StyleClassButtonBig},
}) })
@@ -112,30 +102,21 @@ namespace Content.Client.UserInterface
var hBox = new HBoxContainer var hBox = new HBoxContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SeparationOverride = 0 SeparationOverride = 0
}; };
vBox.AddChild(hBox); vBox.AddChild(hBox);
_charactersVBox = new VBoxContainer(); _charactersVBox = new VBoxContainer();
hBox.AddChild(new MarginContainer hBox.AddChild(new ScrollContainer
{ {
CustomMinimumSize = (330, 0), MinSize = (325, 0),
SizeFlagsHorizontal = SizeFlags.Fill, Margin = new Thickness(5, 5, 0, 0),
MarginTopOverride = 5,
MarginLeftOverride = 5,
Children =
{
new ScrollContainer
{
SizeFlagsVertical = SizeFlags.FillExpand,
Children = Children =
{ {
_charactersVBox _charactersVBox
} }
}
}
}); });
_createNewCharacterButton = new Button _createNewCharacterButton = new Button
@@ -152,7 +133,7 @@ namespace Content.Client.UserInterface
hBox.AddChild(new PanelContainer hBox.AddChild(new PanelContainer
{ {
PanelOverride = new StyleBoxFlat {BackgroundColor = StyleNano.NanoGold}, PanelOverride = new StyleBoxFlat {BackgroundColor = StyleNano.NanoGold},
CustomMinimumSize = (2, 0) MinSize = (2, 0)
}); });
_humanoidProfileEditor = new HumanoidProfileEditor(preferencesManager, prototypeManager, entityManager); _humanoidProfileEditor = new HumanoidProfileEditor(preferencesManager, prototypeManager, entityManager);
_humanoidProfileEditor.OnProfileChanged += newProfile => { UpdateUI(); }; _humanoidProfileEditor.OnProfileChanged += newProfile => { UpdateUI(); };
@@ -266,7 +247,7 @@ namespace Content.Client.UserInterface
{ {
Text = description, Text = description,
ClipText = true, ClipText = true,
SizeFlagsHorizontal = SizeFlags.FillExpand HorizontalExpand = true
}; };
var deleteButton = new Button var deleteButton = new Button
{ {
@@ -281,7 +262,7 @@ namespace Content.Client.UserInterface
var internalHBox = new HBoxContainer var internalHBox = new HBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SeparationOverride = 0, SeparationOverride = 0,
Children = Children =
{ {

View File

@@ -131,8 +131,8 @@ namespace Content.Client.UserInterface.Controls
SlotIndex = slotIndex; SlotIndex = slotIndex;
MouseFilter = MouseFilterMode.Stop; MouseFilter = MouseFilterMode.Stop;
CustomMinimumSize = (64, 64); MinSize = (64, 64);
SizeFlagsVertical = SizeFlags.None; VerticalAlignment = VAlignment.Top;
TooltipDelay = CustomTooltipDelay; TooltipDelay = CustomTooltipDelay;
TooltipSupplier = SupplyTooltip; TooltipSupplier = SupplyTooltip;
@@ -144,29 +144,29 @@ namespace Content.Client.UserInterface.Controls
_bigActionIcon = new TextureRect _bigActionIcon = new TextureRect
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
Stretch = TextureRect.StretchMode.Scale, Stretch = TextureRect.StretchMode.Scale,
Visible = false Visible = false
}; };
_bigItemSpriteView = new SpriteView _bigItemSpriteView = new SpriteView
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
Scale = (2,2), Scale = (2,2),
Visible = false Visible = false
}; };
_smallActionIcon = new TextureRect _smallActionIcon = new TextureRect
{ {
SizeFlagsHorizontal = SizeFlags.ShrinkEnd, HorizontalAlignment = HAlignment.Right,
SizeFlagsVertical = SizeFlags.ShrinkEnd, VerticalAlignment = VAlignment.Bottom,
Stretch = TextureRect.StretchMode.Scale, Stretch = TextureRect.StretchMode.Scale,
Visible = false Visible = false
}; };
_smallItemSpriteView = new SpriteView _smallItemSpriteView = new SpriteView
{ {
SizeFlagsHorizontal = SizeFlags.ShrinkEnd, HorizontalAlignment = HAlignment.Right,
SizeFlagsVertical = SizeFlags.ShrinkEnd, VerticalAlignment = VAlignment.Bottom,
Visible = false Visible = false
}; };
@@ -175,28 +175,26 @@ namespace Content.Client.UserInterface.Controls
// padding to the left of the number to shift it right // padding to the left of the number to shift it right
var paddingBox = new HBoxContainer() var paddingBox = new HBoxContainer()
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
CustomMinimumSize = (64, 64) MinSize = (64, 64)
}; };
paddingBox.AddChild(new Control() paddingBox.AddChild(new Control()
{ {
CustomMinimumSize = (4, 4), MinSize = (4, 4),
SizeFlagsVertical = SizeFlags.Fill
}); });
paddingBox.AddChild(_number); paddingBox.AddChild(_number);
// padding to the left of the small icon // padding to the left of the small icon
var paddingBoxItemIcon = new HBoxContainer() var paddingBoxItemIcon = new HBoxContainer()
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
CustomMinimumSize = (64, 64) MinSize = (64, 64)
}; };
paddingBoxItemIcon.AddChild(new Control() paddingBoxItemIcon.AddChild(new Control()
{ {
CustomMinimumSize = (32, 32), MinSize = (32, 32),
SizeFlagsVertical = SizeFlags.Fill
}); });
paddingBoxItemIcon.AddChild(new Control paddingBoxItemIcon.AddChild(new Control
{ {

View File

@@ -38,9 +38,18 @@ namespace Content.Client.UserInterface
var rootContainer = new TabContainer(); var rootContainer = new TabContainer();
var patronsList = new ScrollContainer(); var patronsList = new ScrollContainer
var ss14ContributorsList = new ScrollContainer(); {
var licensesList = new ScrollContainer(); HScrollEnabled = false
};
var ss14ContributorsList = new ScrollContainer
{
HScrollEnabled = false
};
var licensesList = new ScrollContainer
{
HScrollEnabled = false
};
rootContainer.AddChild(ss14ContributorsList); rootContainer.AddChild(ss14ContributorsList);
rootContainer.AddChild(patronsList); rootContainer.AddChild(patronsList);
@@ -56,14 +65,15 @@ namespace Content.Client.UserInterface
Contents.AddChild(rootContainer); Contents.AddChild(rootContainer);
CustomMinimumSize = (650, 450); SetSize = (650, 650);
} }
private void PopulateLicenses(ScrollContainer licensesList) private void PopulateLicenses(ScrollContainer licensesList)
{ {
var margin = new MarginContainer {MarginLeftOverride = 2, MarginTopOverride = 2}; var vBox = new VBoxContainer
var vBox = new VBoxContainer(); {
margin.AddChild(vBox); Margin = new Thickness(2, 2, 0, 0)
};
foreach (var entry in CreditsManager.GetLicenses().OrderBy(p => p.Name)) 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) private void PopulatePatronsList(Control patronsList)
{ {
var margin = new MarginContainer {MarginLeftOverride = 2, MarginTopOverride = 2}; var vBox = new VBoxContainer
var vBox = new VBoxContainer(); {
margin.AddChild(vBox); Margin = new Thickness(2, 2, 0, 0)
};
var patrons = LoadPatrons(); var patrons = LoadPatrons();
// Do not show "become a patron" button on Steam builds // Do not show "become a patron" button on Steam builds
@@ -95,7 +106,7 @@ namespace Content.Client.UserInterface
vBox.AddChild(patronButton = new Button vBox.AddChild(patronButton = new Button
{ {
Text = "Become a Patron", Text = "Become a Patron",
SizeFlagsHorizontal = SizeFlags.ShrinkCenter HorizontalAlignment = HAlignment.Center
}); });
patronButton.OnPressed += patronButton.OnPressed +=
@@ -107,7 +118,7 @@ namespace Content.Client.UserInterface
{ {
if (!first) if (!first)
{ {
vBox.AddChild(new Control {CustomMinimumSize = (0, 10)}); vBox.AddChild(new Control {MinSize = (0, 10)});
} }
first = false; first = false;
@@ -123,7 +134,7 @@ namespace Content.Client.UserInterface
patronsList.AddChild(margin); patronsList.AddChild(vBox);
} }
private IEnumerable<PatronEntry> LoadPatrons() private IEnumerable<PatronEntry> LoadPatrons()
@@ -140,17 +151,14 @@ namespace Content.Client.UserInterface
{ {
Button contributeButton; Button contributeButton;
var margin = new MarginContainer var vBox = new VBoxContainer
{ {
MarginLeftOverride = 2, Margin = new Thickness(2, 2, 0, 0)
MarginTopOverride = 2
}; };
var vBox = new VBoxContainer();
margin.AddChild(vBox);
vBox.AddChild(new HBoxContainer vBox.AddChild(new HBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.ShrinkCenter, HorizontalAlignment = HAlignment.Center,
SeparationOverride = 20, SeparationOverride = 20,
Children = Children =
{ {
@@ -165,7 +173,7 @@ namespace Content.Client.UserInterface
{ {
if (!first) if (!first)
{ {
vBox.AddChild(new Control {CustomMinimumSize = (0, 10)}); vBox.AddChild(new Control {MinSize = (0, 10)});
} }
first = false; first = false;
@@ -190,7 +198,7 @@ namespace Content.Client.UserInterface
AddSection("Original Space Station 13 Remake Team", "OriginalRemake.txt"); AddSection("Original Space Station 13 Remake Team", "OriginalRemake.txt");
AddSection("Special Thanks", "SpecialThanks.txt", true); AddSection("Special Thanks", "SpecialThanks.txt", true);
contributorsList.AddChild(margin); contributorsList.AddChild(vBox);
contributeButton.OnPressed += _ => contributeButton.OnPressed += _ =>
IoCManager.Resolve<IUriOpener>().OpenUri(UILinks.GitHub); IoCManager.Resolve<IUriOpener>().OpenUri(UILinks.GitHub);

View File

@@ -132,7 +132,7 @@ namespace Content.Client.UserInterface
public void Initialize() public void Initialize()
{ {
RootControl = new LC(); RootControl = new LC { Name = "AAAAAAAAAAAAAAAAAAAAAA"};
LC.SetAnchorPreset(RootControl, LC.LayoutPreset.Wide); LC.SetAnchorPreset(RootControl, LC.LayoutPreset.Wide);
var escapeTexture = _resourceCache.GetTexture("/Textures/Interface/hamburger.svg.192dpi.png"); 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) _buttonEscapeMenu = new TopButton(escapeTexture, EngineKeyFunctions.EscapeMenu, _inputManager)
{ {
ToolTip = Loc.GetString("Open escape menu."), ToolTip = Loc.GetString("Open escape menu."),
CustomMinimumSize = (70, 64), MinSize = (70, 64),
StyleClasses = {StyleBase.ButtonOpenRight} StyleClasses = {StyleBase.ButtonOpenRight}
}; };
@@ -174,7 +174,7 @@ namespace Content.Client.UserInterface
_buttonCharacterMenu = new TopButton(characterTexture, ContentKeyFunctions.OpenCharacterMenu, _inputManager) _buttonCharacterMenu = new TopButton(characterTexture, ContentKeyFunctions.OpenCharacterMenu, _inputManager)
{ {
ToolTip = Loc.GetString("Open character menu."), ToolTip = Loc.GetString("Open character menu."),
CustomMinimumSize = topMinSize, MinSize = topMinSize,
Visible = false, Visible = false,
StyleClasses = {StyleBase.ButtonSquare} StyleClasses = {StyleBase.ButtonSquare}
}; };
@@ -187,7 +187,7 @@ namespace Content.Client.UserInterface
_buttonInventoryMenu = new TopButton(inventoryTexture, ContentKeyFunctions.OpenInventoryMenu, _inputManager) _buttonInventoryMenu = new TopButton(inventoryTexture, ContentKeyFunctions.OpenInventoryMenu, _inputManager)
{ {
ToolTip = Loc.GetString("Open inventory menu."), ToolTip = Loc.GetString("Open inventory menu."),
CustomMinimumSize = topMinSize, MinSize = topMinSize,
Visible = false, Visible = false,
StyleClasses = {StyleBase.ButtonSquare} StyleClasses = {StyleBase.ButtonSquare}
}; };
@@ -200,7 +200,7 @@ namespace Content.Client.UserInterface
_buttonCraftingMenu = new TopButton(craftingTexture, ContentKeyFunctions.OpenCraftingMenu, _inputManager) _buttonCraftingMenu = new TopButton(craftingTexture, ContentKeyFunctions.OpenCraftingMenu, _inputManager)
{ {
ToolTip = Loc.GetString("Open crafting menu."), ToolTip = Loc.GetString("Open crafting menu."),
CustomMinimumSize = topMinSize, MinSize = topMinSize,
Visible = false, Visible = false,
StyleClasses = {StyleBase.ButtonSquare} StyleClasses = {StyleBase.ButtonSquare}
}; };
@@ -213,7 +213,7 @@ namespace Content.Client.UserInterface
_buttonActionsMenu = new TopButton(actionsTexture, ContentKeyFunctions.OpenActionsMenu, _inputManager) _buttonActionsMenu = new TopButton(actionsTexture, ContentKeyFunctions.OpenActionsMenu, _inputManager)
{ {
ToolTip = Loc.GetString("Open actions menu."), ToolTip = Loc.GetString("Open actions menu."),
CustomMinimumSize = topMinSize, MinSize = topMinSize,
Visible = false, Visible = false,
StyleClasses = {StyleBase.ButtonSquare} StyleClasses = {StyleBase.ButtonSquare}
}; };
@@ -226,7 +226,7 @@ namespace Content.Client.UserInterface
_buttonAdminMenu = new TopButton(adminTexture, ContentKeyFunctions.OpenAdminMenu, _inputManager) _buttonAdminMenu = new TopButton(adminTexture, ContentKeyFunctions.OpenAdminMenu, _inputManager)
{ {
ToolTip = Loc.GetString("Open admin menu."), ToolTip = Loc.GetString("Open admin menu."),
CustomMinimumSize = topMinSize, MinSize = topMinSize,
Visible = false, Visible = false,
StyleClasses = {StyleBase.ButtonSquare} StyleClasses = {StyleBase.ButtonSquare}
}; };
@@ -239,7 +239,7 @@ namespace Content.Client.UserInterface
_buttonSandboxMenu = new TopButton(sandboxTexture, ContentKeyFunctions.OpenSandboxWindow, _inputManager) _buttonSandboxMenu = new TopButton(sandboxTexture, ContentKeyFunctions.OpenSandboxWindow, _inputManager)
{ {
ToolTip = Loc.GetString("Open sandbox menu."), ToolTip = Loc.GetString("Open sandbox menu."),
CustomMinimumSize = topMinSize, MinSize = topMinSize,
Visible = false, Visible = false,
StyleClasses = {StyleBase.ButtonSquare} StyleClasses = {StyleBase.ButtonSquare}
}; };
@@ -252,7 +252,7 @@ namespace Content.Client.UserInterface
_buttonTutorial = new TopButton(tutorialTexture, ContentKeyFunctions.OpenTutorial, _inputManager) _buttonTutorial = new TopButton(tutorialTexture, ContentKeyFunctions.OpenTutorial, _inputManager)
{ {
ToolTip = Loc.GetString("Open tutorial."), ToolTip = Loc.GetString("Open tutorial."),
CustomMinimumSize = topMinSize, MinSize = topMinSize,
StyleClasses = {StyleBase.ButtonOpenLeft, TopButton.StyleClassRedTopButton}, StyleClasses = {StyleBase.ButtonOpenLeft, TopButton.StyleClassRedTopButton},
}; };
@@ -300,25 +300,25 @@ namespace Content.Client.UserInterface
LC.SetMarginBottom(centerBottomContainer, -10f); LC.SetMarginBottom(centerBottomContainer, -10f);
RootControl.AddChild(centerBottomContainer); 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(LeftInventoryQuickButtonContainer);
centerBottomContainer.AddChild(HandsContainer); centerBottomContainer.AddChild(HandsContainer);
centerBottomContainer.AddChild(RightInventoryQuickButtonContainer); centerBottomContainer.AddChild(RightInventoryQuickButtonContainer);
SuspicionContainer = new MarginContainer SuspicionContainer = new Control
{ {
SizeFlagsHorizontal = Control.SizeFlags.ShrinkCenter HorizontalAlignment = Control.HAlignment.Center
}; };
RootControl.AddChild(SuspicionContainer); RootControl.AddChild(SuspicionContainer);
@@ -330,7 +330,7 @@ namespace Content.Client.UserInterface
_topNotificationContainer = new VBoxContainer _topNotificationContainer = new VBoxContainer
{ {
CustomMinimumSize = (600, 0) MinSize = (600, 0)
}; };
RootControl.AddChild(_topNotificationContainer); RootControl.AddChild(_topNotificationContainer);
LC.SetAnchorPreset(_topNotificationContainer, LC.LayoutPreset.CenterTop); LC.SetAnchorPreset(_topNotificationContainer, LC.LayoutPreset.CenterTop);
@@ -498,21 +498,21 @@ namespace Content.Client.UserInterface
{ {
Children = Children =
{ {
new Control {CustomMinimumSize = (0, VertPad)},
(_textureRect = new TextureRect (_textureRect = new TextureRect
{ {
TextureScale = (0.5f, 0.5f), TextureScale = (0.5f, 0.5f),
Texture = texture, Texture = texture,
SizeFlagsHorizontal = SizeFlags.ShrinkCenter, HorizontalAlignment = HAlignment.Center,
SizeFlagsVertical = SizeFlags.Expand | SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
VerticalExpand = true,
Margin = new Thickness(0, VertPad),
ModulateSelfOverride = NormalColor, ModulateSelfOverride = NormalColor,
Stretch = TextureRect.StretchMode.KeepCentered Stretch = TextureRect.StretchMode.KeepCentered
}), }),
new Control {CustomMinimumSize = (0, VertPad)},
(_label = new Label (_label = new Label
{ {
Text = ShortKeyName(_function), Text = ShortKeyName(_function),
SizeFlagsHorizontal = SizeFlags.ShrinkCenter, HorizontalAlignment = HAlignment.Center,
ModulateSelfOverride = NormalColor, ModulateSelfOverride = NormalColor,
StyleClasses = {StyleClassLabelTopButton} StyleClasses = {StyleClassLabelTopButton}
}) })

View File

@@ -54,41 +54,33 @@ namespace Content.Client.UserInterface
public class GhostTargetWindow : SS14Window public class GhostTargetWindow : SS14Window
{ {
protected override Vector2? CustomSize => (300, 450);
private readonly GhostComponent _owner; private readonly GhostComponent _owner;
private readonly VBoxContainer _buttonContainer; private readonly VBoxContainer _buttonContainer;
public GhostTargetWindow(GhostComponent owner) public GhostTargetWindow(GhostComponent owner)
{ {
MinSize = SetSize = (300, 450);
Title = "Ghost Warp"; Title = "Ghost Warp";
_owner = owner; _owner = owner;
_owner.GhostRequestWarpPoint(); _owner.GhostRequestWarpPoint();
_owner.GhostRequestPlayerNames(); _owner.GhostRequestPlayerNames();
var margin = new MarginContainer()
{
SizeFlagsVertical = SizeFlags.FillExpand,
SizeFlagsHorizontal = SizeFlags.FillExpand,
};
_buttonContainer = new VBoxContainer() _buttonContainer = new VBoxContainer()
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsHorizontal = SizeFlags.Fill,
SeparationOverride = 5, SeparationOverride = 5,
}; };
var scrollBarContainer = new ScrollContainer() var scrollBarContainer = new ScrollContainer()
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsHorizontal = SizeFlags.FillExpand HorizontalExpand = true
}; };
margin.AddChild(scrollBarContainer);
scrollBarContainer.AddChild(_buttonContainer); scrollBarContainer.AddChild(_buttonContainer);
Contents.AddChild(margin); Contents.AddChild(scrollBarContainer);
} }
public void Populate() public void Populate()
@@ -107,10 +99,10 @@ namespace Content.Client.UserInterface
{ {
Text = value, Text = value,
TextAlign = Label.AlignMode.Right, TextAlign = Label.AlignMode.Right,
SizeFlagsHorizontal = SizeFlags.ShrinkCenter, HorizontalAlignment = HAlignment.Center,
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
CustomMinimumSize = (230, 20), MinSize = (230, 20),
ClipText = true, ClipText = true,
}; };
@@ -131,10 +123,10 @@ namespace Content.Client.UserInterface
{ {
Text = $"Warp: {name}", Text = $"Warp: {name}",
TextAlign = Label.AlignMode.Right, TextAlign = Label.AlignMode.Right,
SizeFlagsHorizontal = SizeFlags.ShrinkCenter, HorizontalAlignment = HAlignment.Center,
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SizeFlagsStretchRatio = 1, SizeFlagsStretchRatio = 1,
CustomMinimumSize = (230,20), MinSize = (230,20),
ClipText = true, ClipText = true,
}; };

View File

@@ -63,7 +63,8 @@ namespace Content.Client.UserInterface
public HumanoidCharacterProfile Profile; public HumanoidCharacterProfile Profile;
public event Action<HumanoidCharacterProfile> OnProfileChanged; 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>(); _random = IoCManager.Resolve<IRobustRandom>();
_prototypeManager = prototypeManager; _prototypeManager = prototypeManager;
@@ -74,17 +75,9 @@ namespace Content.Client.UserInterface
AddChild(hbox); AddChild(hbox);
#region Left #region Left
var margin = new MarginContainer
{
MarginTopOverride = 10,
MarginBottomOverride = 10,
MarginLeftOverride = 10,
MarginRightOverride = 10
};
hbox.AddChild(margin);
var vBox = new VBoxContainer(); var vBox = new VBoxContainer {Margin = new Thickness(10)};
margin.AddChild(vBox); hbox.AddChild(vBox);
var middleContainer = new HBoxContainer var middleContainer = new HBoxContainer
{ {
@@ -116,13 +109,13 @@ namespace Content.Client.UserInterface
var panel = HighlightedContainer(); var panel = HighlightedContainer();
var hBox = new HBoxContainer 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 _nameEdit = new LineEdit
{ {
CustomMinimumSize = (270, 0), MinSize = (270, 0),
SizeFlagsVertical = SizeFlags.ShrinkCenter VerticalAlignment = VAlignment.Center
}; };
_nameEdit.OnTextChanged += args => { SetName(args.Text); }; _nameEdit.OnTextChanged += args => { SetName(args.Text); };
var nameRandomButton = new Button var nameRandomButton = new Button
@@ -139,7 +132,7 @@ namespace Content.Client.UserInterface
#endregion Name #endregion Name
var tabContainer = new TabContainer { SizeFlagsVertical = SizeFlags.FillExpand }; var tabContainer = new TabContainer {VerticalExpand = true};
vBox.AddChild(tabContainer); vBox.AddChild(tabContainer);
#region Appearance #region Appearance
@@ -210,7 +203,7 @@ namespace Content.Client.UserInterface
var panel = HighlightedContainer(); var panel = HighlightedContainer();
var hBox = new HBoxContainer(); var hBox = new HBoxContainer();
var ageLabel = new Label {Text = Loc.GetString("Age:")}; var ageLabel = new Label {Text = Loc.GetString("Age:")};
_ageEdit = new LineEdit { CustomMinimumSize = (40, 0) }; _ageEdit = new LineEdit {MinSize = (40, 0)};
_ageEdit.OnTextChanged += args => _ageEdit.OnTextChanged += args =>
{ {
if (!int.TryParse(args.Text, out var newAge)) if (!int.TryParse(args.Text, out var newAge))
@@ -257,7 +250,7 @@ namespace Content.Client.UserInterface
{ {
var panel = HighlightedContainer(); var panel = HighlightedContainer();
panel.SizeFlagsHorizontal = SizeFlags.None; panel.HorizontalAlignment = HAlignment.Left;
var hairHBox = new HBoxContainer(); var hairHBox = new HBoxContainer();
_hairPicker = new HairStylePicker(); _hairPicker = new HairStylePicker();
@@ -379,7 +372,7 @@ namespace Content.Client.UserInterface
(_preferenceUnavailableButton = new OptionButton()), (_preferenceUnavailableButton = new OptionButton()),
new ScrollContainer new ScrollContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
Children = Children =
{ {
jobList jobList
@@ -433,7 +426,7 @@ namespace Content.Client.UserInterface
{ {
category.AddChild(new Control category.AddChild(new Control
{ {
CustomMinimumSize = new Vector2(0, 23), MinSize = new Vector2(0, 23),
}); });
} }
@@ -498,7 +491,7 @@ namespace Content.Client.UserInterface
{ {
new ScrollContainer new ScrollContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
Children = Children =
{ {
antagList antagList
@@ -519,6 +512,7 @@ namespace Content.Client.UserInterface
{ {
continue; continue;
} }
var selector = new AntagPreferenceSelector(antag); var selector = new AntagPreferenceSelector(antag);
antagList.AddChild(selector); antagList.AddChild(selector);
_antagPreferences.Add(selector); _antagPreferences.Add(selector);
@@ -568,7 +562,7 @@ namespace Content.Client.UserInterface
_saveButton = new Button _saveButton = new Button
{ {
Text = Loc.GetString("Save"), Text = Loc.GetString("Save"),
SizeFlagsHorizontal = SizeFlags.ShrinkCenter HorizontalAlignment = HAlignment.Center
}; };
_saveButton.OnPressed += args => { Save(); }; _saveButton.OnPressed += args => { Save(); };
panel.AddChild(_saveButton); panel.AddChild(_saveButton);
@@ -581,19 +575,10 @@ namespace Content.Client.UserInterface
#region Right #region Right
margin = new MarginContainer
{
MarginTopOverride = 10,
MarginBottomOverride = 10,
MarginLeftOverride = 10,
MarginRightOverride = 10
};
hbox.AddChild(margin);
vBox = new VBoxContainer() vBox = new VBoxContainer()
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
SizeFlagsHorizontal = SizeFlags.FillExpand, HorizontalExpand = true,
}; };
hbox.AddChild(vBox); hbox.AddChild(vBox);
@@ -605,8 +590,7 @@ namespace Content.Client.UserInterface
// Front // Front
var box = new Control() var box = new Control()
{ {
SizeFlagsHorizontal = SizeFlags.Fill, VerticalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand,
SizeFlagsStretchRatio = 1f, SizeFlagsStretchRatio = 1f,
}; };
vBox.AddChild(box); vBox.AddChild(box);
@@ -615,7 +599,7 @@ namespace Content.Client.UserInterface
Sprite = sprite, Sprite = sprite,
Scale = (6, 6), Scale = (6, 6),
OverrideDirection = Direction.South, OverrideDirection = Direction.South,
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SizeFlagsStretchRatio = 1 SizeFlagsStretchRatio = 1
}; };
box.AddChild(_previewSprite); box.AddChild(_previewSprite);
@@ -623,8 +607,7 @@ namespace Content.Client.UserInterface
// Side // Side
box = new Control() box = new Control()
{ {
SizeFlagsHorizontal = SizeFlags.Fill, VerticalExpand = true,
SizeFlagsVertical = SizeFlags.FillExpand,
SizeFlagsStretchRatio = 1f, SizeFlagsStretchRatio = 1f,
}; };
vBox.AddChild(box); vBox.AddChild(box);
@@ -633,7 +616,7 @@ namespace Content.Client.UserInterface
Sprite = sprite, Sprite = sprite,
Scale = (6, 6), Scale = (6, 6),
OverrideDirection = Direction.East, OverrideDirection = Direction.East,
SizeFlagsVertical = SizeFlags.ShrinkCenter, VerticalAlignment = VAlignment.Center,
SizeFlagsStretchRatio = 1 SizeFlagsStretchRatio = 1
}; };
box.AddChild(_previewSpriteSide); box.AddChild(_previewSpriteSide);
@@ -862,7 +845,8 @@ namespace Content.Client.UserInterface
if (job.Icon != null) 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(); icon.Texture = specifier.Frame0();
} }
@@ -871,7 +855,7 @@ namespace Content.Client.UserInterface
Children = Children =
{ {
icon, icon,
new Label {Text = job.Name, CustomMinimumSize = (175, 0)}, new Label {Text = job.Name, MinSize = (175, 0)},
_optionButton _optionButton
} }
}); });
@@ -918,6 +902,7 @@ namespace Content.Client.UserInterface
} }
}); });
} }
private void OnCheckBoxToggled(BaseButton.ButtonToggledEventArgs args) private void OnCheckBoxToggled(BaseButton.ButtonToggledEventArgs args)
{ {
PreferenceChanged?.Invoke(Preference); PreferenceChanged?.Invoke(Preference);

View File

@@ -8,7 +8,7 @@ using Robust.Shared.Maths;
namespace Content.Client.UserInterface namespace Content.Client.UserInterface
{ {
public class ItemSlotButton : MarginContainer public class ItemSlotButton : Control
{ {
private const string HighlightShader = "SelectionOutlineInrange"; private const string HighlightShader = "SelectionOutlineInrange";
@@ -29,7 +29,7 @@ namespace Content.Client.UserInterface
public ItemSlotButton(Texture texture, Texture storageTexture) public ItemSlotButton(Texture texture, Texture storageTexture)
{ {
CustomMinimumSize = (64, 64); MinSize = (64, 64);
AddChild(Button = new TextureRect AddChild(Button = new TextureRect
{ {
@@ -41,7 +41,7 @@ namespace Content.Client.UserInterface
AddChild(_highlightRect = new PanelContainer AddChild(_highlightRect = new PanelContainer
{ {
StyleClasses = { StyleNano.StyleClassHandSlotHighlight }, StyleClasses = { StyleNano.StyleClassHandSlotHighlight },
CustomMinimumSize = (32, 32), MinSize = (32, 32),
Visible = false Visible = false
}); });
@@ -63,8 +63,8 @@ namespace Content.Client.UserInterface
{ {
TextureNormal = storageTexture, TextureNormal = storageTexture,
Scale = (0.75f, 0.75f), Scale = (0.75f, 0.75f),
SizeFlagsHorizontal = SizeFlags.ShrinkEnd, HorizontalAlignment = HAlignment.Right,
SizeFlagsVertical = SizeFlags.ShrinkEnd, VerticalAlignment = VAlignment.Bottom,
Visible = false, Visible = false,
}); });
@@ -92,8 +92,6 @@ namespace Content.Client.UserInterface
AddChild(CooldownDisplay = new CooldownGraphic AddChild(CooldownDisplay = new CooldownGraphic
{ {
SizeFlagsHorizontal = SizeFlags.Fill,
SizeFlagsVertical = SizeFlags.Fill,
Visible = false, Visible = false,
}); });
} }

View File

@@ -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> /// <summary>
@@ -156,11 +159,5 @@ namespace Content.Client.UserInterface
_activeStatusComponents.Add((statusComponent, control)); _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));
}
} }
} }

View File

@@ -24,8 +24,6 @@ namespace Content.Client.UserInterface
[Dependency] private readonly IClientConsoleHost _consoleHost = default!; [Dependency] private readonly IClientConsoleHost _consoleHost = default!;
[Dependency] private readonly IClientGameTicker _gameTicker = default!; [Dependency] private readonly IClientGameTicker _gameTicker = default!;
protected override Vector2? CustomSize => (360, 560);
public event Action<string> SelectedId; public event Action<string> SelectedId;
private readonly Dictionary<string, JobButton> _jobButtons = new(); private readonly Dictionary<string, JobButton> _jobButtons = new();
@@ -33,6 +31,7 @@ namespace Content.Client.UserInterface
public LateJoinGui() public LateJoinGui()
{ {
MinSize = SetSize = (360, 560);
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
Title = Loc.GetString("Late Join"); Title = Loc.GetString("Late Join");
@@ -44,7 +43,7 @@ namespace Content.Client.UserInterface
{ {
new ScrollContainer new ScrollContainer
{ {
SizeFlagsVertical = SizeFlags.FillExpand, VerticalExpand = true,
Children = Children =
{ {
jobList jobList
@@ -77,7 +76,7 @@ namespace Content.Client.UserInterface
{ {
category.AddChild(new Control 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 var jobSelector = new HBoxContainer
{ {
SizeFlagsHorizontal = SizeFlags.FillExpand HorizontalExpand = true
}; };
var icon = new TextureRect var icon = new TextureRect

Some files were not shown because too many files have changed in this diff Show More