WPF layout (#3346)
This commit is contained in:
committed by
GitHub
parent
33d6975c25
commit
b898443f28
@@ -139,8 +139,6 @@ namespace Content.Client.GameObjects.Components.Kitchen
|
||||
}
|
||||
|
||||
|
||||
protected override Vector2? CustomSize => (512, 256);
|
||||
|
||||
private MicrowaveBoundUserInterface Owner { get; set; }
|
||||
|
||||
public event Action<BaseButton.ButtonEventArgs, int> OnCookTimeSelected;
|
||||
@@ -165,54 +163,49 @@ namespace Content.Client.GameObjects.Components.Kitchen
|
||||
|
||||
public MicrowaveMenu(MicrowaveBoundUserInterface owner = null)
|
||||
{
|
||||
SetSize = MinSize = (512, 256);
|
||||
|
||||
Owner = owner;
|
||||
Title = Loc.GetString("Microwave");
|
||||
DisableCookingPanelOverlay = new PanelContainer
|
||||
{
|
||||
MouseFilter = MouseFilterMode.Stop,
|
||||
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.Black.WithAlpha(0.60f)},
|
||||
SizeFlagsHorizontal = SizeFlags.Fill,
|
||||
SizeFlagsVertical = SizeFlags.Fill,
|
||||
};
|
||||
|
||||
|
||||
var hSplit = new HBoxContainer
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.Fill,
|
||||
SizeFlagsVertical = SizeFlags.Fill
|
||||
};
|
||||
var hSplit = new HBoxContainer();
|
||||
|
||||
IngredientsListReagents = new ItemList
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
HorizontalExpand = true,
|
||||
SelectMode = ItemList.ItemListSelectMode.Button,
|
||||
SizeFlagsStretchRatio = 2,
|
||||
CustomMinimumSize = (100, 128)
|
||||
MinSize = (100, 128)
|
||||
};
|
||||
|
||||
IngredientsList = new ItemList
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
HorizontalExpand = true,
|
||||
SelectMode = ItemList.ItemListSelectMode.Button,
|
||||
SizeFlagsStretchRatio = 2,
|
||||
CustomMinimumSize = (100, 128)
|
||||
MinSize = (100, 128)
|
||||
};
|
||||
|
||||
hSplit.AddChild(IngredientsListReagents);
|
||||
//Padding between the lists.
|
||||
hSplit.AddChild(new Control
|
||||
{
|
||||
CustomMinimumSize = (0, 5),
|
||||
MinSize = (0, 5),
|
||||
});
|
||||
|
||||
hSplit.AddChild(IngredientsList);
|
||||
|
||||
var vSplit = new VBoxContainer
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
HorizontalExpand = true,
|
||||
};
|
||||
|
||||
hSplit.AddChild(vSplit);
|
||||
@@ -243,14 +236,13 @@ namespace Content.Client.GameObjects.Components.Kitchen
|
||||
//Padding
|
||||
vSplit.AddChild(new Control
|
||||
{
|
||||
CustomMinimumSize = (0, 15),
|
||||
SizeFlagsVertical = SizeFlags.Fill,
|
||||
MinSize = (0, 15),
|
||||
});
|
||||
|
||||
CookTimeButtonGroup = new ButtonGroup();
|
||||
CookTimeButtonVbox = new VBoxContainer
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
Align = BoxContainer.AlignMode.Center,
|
||||
};
|
||||
|
||||
@@ -284,14 +276,14 @@ namespace Content.Client.GameObjects.Components.Kitchen
|
||||
Text = Loc.GetString("COOK TIME: 1"),
|
||||
Align = Label.AlignMode.Center,
|
||||
Modulate = Color.White,
|
||||
SizeFlagsVertical = SizeFlags.ShrinkCenter
|
||||
VerticalAlignment = VAlignment.Center
|
||||
};
|
||||
|
||||
var innerTimerPanel = new PanelContainer
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
ModulateSelfOverride = Color.Red,
|
||||
CustomMinimumSize = (100, 128),
|
||||
MinSize = (100, 128),
|
||||
PanelOverride = new StyleBoxFlat {BackgroundColor = Color.Black.WithAlpha(0.5f)},
|
||||
|
||||
Children =
|
||||
@@ -312,7 +304,7 @@ namespace Content.Client.GameObjects.Components.Kitchen
|
||||
|
||||
new ScrollContainer()
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
|
||||
Children =
|
||||
{
|
||||
@@ -326,8 +318,8 @@ namespace Content.Client.GameObjects.Components.Kitchen
|
||||
|
||||
TimerFacePlate = new PanelContainer()
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
HorizontalExpand = true,
|
||||
Children =
|
||||
{
|
||||
innerTimerPanel
|
||||
|
||||
@@ -156,7 +156,6 @@ namespace Content.Client.GameObjects.Components.Kitchen
|
||||
*/
|
||||
|
||||
private ReagentGrinderBoundUserInterface Owner { get; set; }
|
||||
protected override Vector2? CustomSize => (512, 256);
|
||||
|
||||
//We'll need 4 buttons, grind, juice, eject beaker, eject the chamber contents.
|
||||
//The other 2 are referenced in the Open function.
|
||||
@@ -202,11 +201,11 @@ namespace Content.Client.GameObjects.Components.Kitchen
|
||||
AddChild(vSplit);
|
||||
BoxContents = new ItemList
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
HorizontalExpand = true,
|
||||
SelectMode = ItemList.ItemListSelectMode.Button,
|
||||
SizeFlagsStretchRatio = 2,
|
||||
CustomMinimumSize = (100, 128)
|
||||
MinSize = (100, 128)
|
||||
};
|
||||
AddChild(BoxContents);
|
||||
}
|
||||
@@ -214,47 +213,44 @@ namespace Content.Client.GameObjects.Components.Kitchen
|
||||
|
||||
public GrinderMenu(ReagentGrinderBoundUserInterface owner = null)
|
||||
{
|
||||
SetSize = MinSize = (512, 256);
|
||||
Owner = owner;
|
||||
Title = Loc.GetString("All-In-One Grinder 3000");
|
||||
|
||||
var hSplit = new HBoxContainer
|
||||
{
|
||||
SizeFlagsHorizontal = SizeFlags.Fill,
|
||||
SizeFlagsVertical = SizeFlags.Fill
|
||||
};
|
||||
var hSplit = new HBoxContainer();
|
||||
|
||||
var vBoxGrindJuiceButtonPanel = new VBoxContainer
|
||||
{
|
||||
SizeFlagsVertical = SizeFlags.ShrinkCenter
|
||||
VerticalAlignment = VAlignment.Center
|
||||
};
|
||||
|
||||
GrindButton = new Button
|
||||
{
|
||||
Text = Loc.GetString("Grind"),
|
||||
TextAlign = Label.AlignMode.Center,
|
||||
CustomMinimumSize = (64, 64)
|
||||
MinSize = (64, 64)
|
||||
};
|
||||
|
||||
JuiceButton = new Button
|
||||
{
|
||||
Text = Loc.GetString("Juice"),
|
||||
TextAlign = Label.AlignMode.Center,
|
||||
CustomMinimumSize = (64, 64)
|
||||
MinSize = (64, 64)
|
||||
};
|
||||
|
||||
vBoxGrindJuiceButtonPanel.AddChild(GrindButton);
|
||||
//inner button padding
|
||||
vBoxGrindJuiceButtonPanel.AddChild(new Control
|
||||
{
|
||||
CustomMinimumSize = (0, 16),
|
||||
MinSize = (0, 16),
|
||||
});
|
||||
vBoxGrindJuiceButtonPanel.AddChild(JuiceButton);
|
||||
|
||||
ChamberContentBox = new LabelledContentBox(Loc.GetString("Chamber"), Loc.GetString("Eject Contents"))
|
||||
{
|
||||
//Modulate = Color.Red,
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
HorizontalExpand = true,
|
||||
SizeFlagsStretchRatio = 2,
|
||||
|
||||
};
|
||||
@@ -262,8 +258,8 @@ namespace Content.Client.GameObjects.Components.Kitchen
|
||||
BeakerContentBox = new LabelledContentBox(Loc.GetString("Beaker"), Loc.GetString("Eject Beaker"))
|
||||
{
|
||||
//Modulate = Color.Blue,
|
||||
SizeFlagsVertical = SizeFlags.FillExpand,
|
||||
SizeFlagsHorizontal = SizeFlags.FillExpand,
|
||||
VerticalExpand = true,
|
||||
HorizontalExpand = true,
|
||||
SizeFlagsStretchRatio = 2,
|
||||
};
|
||||
|
||||
@@ -272,14 +268,14 @@ namespace Content.Client.GameObjects.Components.Kitchen
|
||||
//Padding between the g/j buttons panel and the itemlist boxes panel.
|
||||
hSplit.AddChild(new Control
|
||||
{
|
||||
CustomMinimumSize = (16, 0),
|
||||
MinSize = (16, 0),
|
||||
});
|
||||
hSplit.AddChild(ChamberContentBox);
|
||||
|
||||
//Padding between the two itemlists.
|
||||
hSplit.AddChild(new Control
|
||||
{
|
||||
CustomMinimumSize = (8, 0),
|
||||
MinSize = (8, 0),
|
||||
});
|
||||
hSplit.AddChild(BeakerContentBox);
|
||||
Contents.AddChild(hSplit);
|
||||
|
||||
Reference in New Issue
Block a user