Hud refactor (#7202)
Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com> Co-authored-by: Jezithyr <jmaster9999@gmail.com> Co-authored-by: Jezithyr <Jezithyr@gmail.com> Co-authored-by: Visne <39844191+Visne@users.noreply.github.com> Co-authored-by: wrexbe <wrexbe@protonmail.com> Co-authored-by: wrexbe <81056464+wrexbe@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
namespace Content.Shared.Inventory.Events;
|
||||
namespace Content.Shared.Inventory.Events;
|
||||
|
||||
public abstract class EquippedEventBase : EntityEventArgs
|
||||
{
|
||||
@@ -17,6 +17,11 @@ public abstract class EquippedEventBase : EntityEventArgs
|
||||
/// </summary>
|
||||
public readonly string Slot;
|
||||
|
||||
/// <summary>
|
||||
/// The slot group the entity got equipped in.
|
||||
/// </summary>
|
||||
public readonly string SlotGroup;
|
||||
|
||||
/// <summary>
|
||||
/// Slotflags of the slot the entity just got equipped to.
|
||||
/// </summary>
|
||||
@@ -27,6 +32,7 @@ public abstract class EquippedEventBase : EntityEventArgs
|
||||
Equipee = equipee;
|
||||
Equipment = equipment;
|
||||
Slot = slotDefinition.Name;
|
||||
SlotGroup = slotDefinition.SlotGroup;
|
||||
SlotFlags = slotDefinition.SlotFlags;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,11 +17,17 @@ public abstract class UnequippedEventBase : EntityEventArgs
|
||||
/// </summary>
|
||||
public readonly string Slot;
|
||||
|
||||
/// <summary>
|
||||
/// The slot group the entity got unequipped from.
|
||||
/// </summary>
|
||||
public readonly string SlotGroup;
|
||||
|
||||
public UnequippedEventBase(EntityUid equipee, EntityUid equipment, SlotDefinition slotDefinition)
|
||||
{
|
||||
Equipee = equipee;
|
||||
Equipment = equipment;
|
||||
Slot = slotDefinition.Name;
|
||||
SlotGroup = slotDefinition.SlotGroup;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,32 +6,28 @@ namespace Content.Shared.Inventory;
|
||||
[Prototype("inventoryTemplate")]
|
||||
public sealed class InventoryTemplatePrototype : IPrototype
|
||||
{
|
||||
[IdDataFieldAttribute]
|
||||
public string ID { get; } = string.Empty;
|
||||
[IdDataFieldAttribute] public string ID { get; } = string.Empty;
|
||||
|
||||
[DataField("slots")]
|
||||
public SlotDefinition[] Slots { get; } = Array.Empty<SlotDefinition>();
|
||||
[DataField("slots")] public SlotDefinition[] Slots { get; } = Array.Empty<SlotDefinition>();
|
||||
}
|
||||
|
||||
[DataDefinition]
|
||||
public sealed class SlotDefinition
|
||||
{
|
||||
[DataField("name", required: true)] public string Name { get; } = string.Empty;
|
||||
|
||||
[DataField("slotTexture")] public string TextureName { get; } = "pocket";
|
||||
|
||||
[DataField("slotFlags")] public SlotFlags SlotFlags { get; } = SlotFlags.PREVENTEQUIP;
|
||||
|
||||
[DataField("showInWindow")] public bool ShowInWindow { get; } = true;
|
||||
[DataField("slotGroup")] public string SlotGroup { get; } = "Default";
|
||||
[DataField("stripTime")] public float StripTime { get; } = 4f;
|
||||
|
||||
[DataField("uiContainer")] public SlotUIContainer UIContainer { get; } = SlotUIContainer.None;
|
||||
[DataField("uiWindowPos", required: true)]
|
||||
public Vector2i UIWindowPosition { get; }
|
||||
|
||||
[DataField("uiWindowPos", required: true)] public Vector2i UIWindowPosition { get; }
|
||||
|
||||
//todo this is supreme shit and ideally slots should be stored in a given equipmentslotscomponent on each equipment
|
||||
[DataField("dependsOn")] public string? DependsOn { get; }
|
||||
|
||||
[DataField("displayName", required: true)] public string DisplayName { get; } = string.Empty;
|
||||
[DataField("displayName", required: true)]
|
||||
public string DisplayName { get; } = string.Empty;
|
||||
|
||||
[DataField("stripHidden")] public bool StripHidden { get; }
|
||||
|
||||
@@ -50,11 +46,3 @@ public sealed class SlotDefinition
|
||||
/// </summary>
|
||||
[DataField("blacklist")] public EntityWhitelist? Blacklist = null;
|
||||
}
|
||||
|
||||
public enum SlotUIContainer
|
||||
{
|
||||
None,
|
||||
BottomLeft,
|
||||
BottomRight,
|
||||
Top
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user