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:
Jezithyr
2022-10-12 01:16:23 -07:00
committed by GitHub
parent d09fbc1849
commit 571dd4e6d5
168 changed files with 6940 additions and 7817 deletions

View File

@@ -23,7 +23,6 @@ namespace Content.Shared.Administration
protected void LogBwoink(BwoinkTextMessage message)
{
Logger.InfoS("c.s.go.es.bwoink", $"@{message.UserId}: {message.Text}");
}
[Serializable, NetSerializable]

View File

@@ -33,6 +33,10 @@ namespace Content.Shared.CCVar
/*
* Ambience
*/
//TODO: This is so that this compiles, yell at me if this is still in
public static readonly CVarDef<bool> AmbienceBasicEnabled =
CVarDef.Create("ambiance.basic_enabled", true, CVar.CLIENTONLY | CVar.ARCHIVE);
/// <summary>
/// How long we'll wait until re-sampling nearby objects for ambience. Should be pretty fast, but doesn't have to match the tick rate.

View File

@@ -0,0 +1,19 @@
namespace Content.Shared.Chat;
public static class ChatChannelExtensions
{
public static Color TextColor(this ChatChannel channel)
{
return channel switch
{
ChatChannel.Server => Color.Orange,
ChatChannel.Radio => Color.LimeGreen,
ChatChannel.LOOC => Color.MediumTurquoise,
ChatChannel.OOC => Color.LightSkyBlue,
ChatChannel.Dead => Color.MediumPurple,
ChatChannel.Admin => Color.Red,
ChatChannel.Whisper => Color.DarkGray,
_ => Color.LightGray
};
}
}

View File

@@ -1,11 +1,11 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Shared.ActionBlocker;
using Content.Shared.Administration.Logs;
using Content.Shared.Hands.Components;
using Content.Shared.Interaction;
using Robust.Shared.Containers;
using Robust.Shared.Input.Binding;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
namespace Content.Shared.Hands.EntitySystems;
@@ -16,7 +16,7 @@ public abstract partial class SharedHandsSystem : EntitySystem
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
[Dependency] private readonly SharedContainerSystem _containerSystem = default!;
protected Action<SharedHandsComponent?>? OnHandSetActive;
protected event Action<SharedHandsComponent?>? OnHandSetActive;
public override void Initialize()
{

View File

@@ -26,7 +26,7 @@ namespace Content.Shared.Input
public static readonly BoundKeyFunction OpenInventoryMenu = "OpenInventoryMenu";
public static readonly BoundKeyFunction SmartEquipBackpack = "SmartEquipBackpack";
public static readonly BoundKeyFunction SmartEquipBelt = "SmartEquipBelt";
public static readonly BoundKeyFunction OpenInfo = "OpenInfo";
public static readonly BoundKeyFunction OpenAHelp = "OpenAHelp";
public static readonly BoundKeyFunction SwapHands = "SwapHands";
public static readonly BoundKeyFunction ThrowItemInHand = "ThrowItemInHand";
public static readonly BoundKeyFunction TryPullObject = "TryPullObject";
@@ -71,9 +71,10 @@ namespace Content.Shared.Input
public static BoundKeyFunction[] GetHotbarBoundKeys() =>
new[]
{
Hotbar0, Hotbar1, Hotbar2, Hotbar3, Hotbar4, Hotbar5, Hotbar6, Hotbar7, Hotbar8, Hotbar9
Hotbar1, Hotbar2, Hotbar3, Hotbar4, Hotbar5, Hotbar6, Hotbar7, Hotbar8, Hotbar9, Hotbar0
};
public static readonly BoundKeyFunction Loadout0 = "Loadout0";
public static readonly BoundKeyFunction Loadout1 = "Loadout1";
public static readonly BoundKeyFunction Loadout2 = "Loadout2";
public static readonly BoundKeyFunction Loadout3 = "Loadout3";
@@ -87,7 +88,7 @@ namespace Content.Shared.Input
public static BoundKeyFunction[] GetLoadoutBoundKeys() =>
new[]
{
Loadout1, Loadout2, Loadout3, Loadout4, Loadout5, Loadout6, Loadout7, Loadout8, Loadout9
Loadout1, Loadout2, Loadout3, Loadout4, Loadout5, Loadout6, Loadout7, Loadout8, Loadout9, Loadout0
};
public static readonly BoundKeyFunction Vote0 = "Vote0";

View File

@@ -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;
}
}

View File

@@ -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;
}
}

View File

@@ -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
}