Requires https://github.com/space-wizards/RobustToolbox/pull/5023 This uses the new engine features (above) to add a displacement map shader. This allows deforming a sprite based on another sprite. Primary use case is automatically adapting human clothing sprites to different species, something we want to make species like Vox a reality. A basic example of wiring this up with Vox has been added. The system is however incredibly simple and **will** need more work by a content developer to select and toggle displacement maps when appropriate. I am leaving that to somebody else. For example right now the displacement map is applied even if a species already has custom-fit sprites for a piece of clothing, such as the grey jumpsuit for Vox. Basic Aseprite plugins to help with authoring displacement maps have also been made.
29 lines
1.0 KiB
C#
29 lines
1.0 KiB
C#
using Robust.Shared.Containers;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
|
|
|
namespace Content.Shared.Inventory;
|
|
|
|
[RegisterComponent, NetworkedComponent]
|
|
[Access(typeof(InventorySystem))]
|
|
public sealed partial class InventoryComponent : Component
|
|
{
|
|
[DataField("templateId", customTypeSerializer: typeof(PrototypeIdSerializer<InventoryTemplatePrototype>))]
|
|
public string TemplateId { get; private set; } = "human";
|
|
|
|
[DataField("speciesId")] public string? SpeciesId { get; set; }
|
|
|
|
[DataField] public string JumpsuitShader = "StencilDraw";
|
|
[DataField] public Dictionary<string, SlotDisplacementData> Displacements = [];
|
|
|
|
public SlotDefinition[] Slots = Array.Empty<SlotDefinition>();
|
|
public ContainerSlot[] Containers = Array.Empty<ContainerSlot>();
|
|
|
|
[DataDefinition]
|
|
public sealed partial class SlotDisplacementData
|
|
{
|
|
[DataField(required: true)]
|
|
public PrototypeLayerData Layer = default!;
|
|
}
|
|
}
|