Added TextureButton for opening Storage items

This commit is contained in:
ShadowCommander
2019-07-27 03:32:25 -07:00
parent d3053c3c8c
commit e5d9634cfe
2 changed files with 17 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using Content.Shared.GameObjects.Components.Inventory;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
@@ -16,7 +16,7 @@ namespace Content.Client.GameObjects
public Action<BaseButton.ButtonEventArgs> OnPressed { get; set; }
public InventoryButton(EquipmentSlotDefines.Slots slot, Texture texture)
public InventoryButton(EquipmentSlotDefines.Slots slot, Texture texture, Texture storageTexture)
{
Slot = slot;
@@ -25,7 +25,7 @@ namespace Content.Client.GameObjects
AddChild(Button = new TextureButton
{
TextureNormal = texture,
Scale = (2, 2),
Scale = (2, 2)
});
Button.OnPressed += e => OnPressed?.Invoke(e);
@@ -35,6 +35,15 @@ namespace Content.Client.GameObjects
MouseFilter = MouseFilterMode.Ignore,
Scale = (2, 2)
});
AddChild(Button = new TextureButton
{
TextureNormal = storageTexture,
Scale = (0.75f, 0.75f),
SizeFlagsHorizontal = SizeFlags.ShrinkEnd,
SizeFlagsVertical = SizeFlags.ShrinkEnd,
Visible = false
});
}
}
}