add the ability to override the equipped state sprite clothing system uses for custom prototypes. (#15294)
This commit is contained in:
@@ -142,9 +142,15 @@ public sealed class ClientClothingSystem : ClothingSystem
|
|||||||
var correctedSlot = slot;
|
var correctedSlot = slot;
|
||||||
TemporarySlotMap.TryGetValue(correctedSlot, out correctedSlot);
|
TemporarySlotMap.TryGetValue(correctedSlot, out correctedSlot);
|
||||||
|
|
||||||
var state = (clothing.EquippedPrefix == null)
|
|
||||||
? $"equipped-{correctedSlot}"
|
|
||||||
: $"{clothing.EquippedPrefix}-equipped-{correctedSlot}";
|
var state = $"equipped-{correctedSlot}";
|
||||||
|
|
||||||
|
if (clothing.EquippedPrefix != null)
|
||||||
|
state = $"{clothing.EquippedPrefix}-equipped-{correctedSlot}";
|
||||||
|
|
||||||
|
if (clothing.EquippedState != null)
|
||||||
|
state = $"{clothing.EquippedState}";
|
||||||
|
|
||||||
// species specific
|
// species specific
|
||||||
if (speciesId != null && rsi.TryGetState($"{state}-{speciesId}", out _))
|
if (speciesId != null && rsi.TryGetState($"{state}-{speciesId}", out _))
|
||||||
|
|||||||
@@ -40,6 +40,15 @@ public sealed class ClothingComponent : Component
|
|||||||
[DataField("equippedPrefix")]
|
[DataField("equippedPrefix")]
|
||||||
public string? EquippedPrefix;
|
public string? EquippedPrefix;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Allows the equipped state to be directly overwritten.
|
||||||
|
/// useful when prototyping INNERCLOTHING items into OUTERCLOTHING items without duplicating/modifying RSIs etc.
|
||||||
|
/// </summary>
|
||||||
|
[Access(typeof(ClothingSystem))]
|
||||||
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
|
[DataField("equippedState")]
|
||||||
|
public string? EquippedState;
|
||||||
|
|
||||||
[ViewVariables(VVAccess.ReadWrite)]
|
[ViewVariables(VVAccess.ReadWrite)]
|
||||||
[DataField("sprite")]
|
[DataField("sprite")]
|
||||||
public string? RsiPath;
|
public string? RsiPath;
|
||||||
|
|||||||
Reference in New Issue
Block a user