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

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