Item strip delay dependant on slot. (#8900)
This commit is contained in:
parent
634dbd53af
commit
76963c6d5a
|
|
@ -9,13 +9,21 @@ namespace Content.Server.Strip
|
|||
[Access(typeof(StrippableSystem))]
|
||||
public sealed class StrippableComponent : SharedStrippableComponent
|
||||
{
|
||||
/// <summary>
|
||||
/// How long it takes to open the strip menu.
|
||||
/// This should be relatively short so it's not a hassle
|
||||
/// but so it also doesn't open immediately during melee combat
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[DataField("openDelay")]
|
||||
public float OpenDelay = 4f;
|
||||
public float OpenDelay = 1f;
|
||||
|
||||
/// <summary>
|
||||
/// The strip delay for hands.
|
||||
/// </summary>
|
||||
[ViewVariables]
|
||||
[DataField("delay")]
|
||||
public float StripDelay = 2f;
|
||||
[DataField("handDelay")]
|
||||
public float HandStripDelay = 3f;
|
||||
|
||||
public override bool Drop(DragDropEvent args)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -274,7 +274,13 @@ namespace Content.Server.Strip
|
|||
return true;
|
||||
}
|
||||
|
||||
var doAfterArgs = new DoAfterEventArgs(user, component.StripDelay, CancellationToken.None, component.Owner)
|
||||
if (!_inventorySystem.TryGetSlot(component.Owner, slot, out var slotDef))
|
||||
{
|
||||
Logger.Error($"{ToPrettyString(user)} attempted to place an item in a non-existent inventory slot ({slot}) on {ToPrettyString(component.Owner)}");
|
||||
return;
|
||||
}
|
||||
|
||||
var doAfterArgs = new DoAfterEventArgs(user, slotDef.StripTime, CancellationToken.None, component.Owner)
|
||||
{
|
||||
ExtraCheck = Check,
|
||||
BreakOnStun = true,
|
||||
|
|
@ -328,7 +334,7 @@ namespace Content.Server.Strip
|
|||
return true;
|
||||
}
|
||||
|
||||
var doAfterArgs = new DoAfterEventArgs(user, component.StripDelay, CancellationToken.None, component.Owner)
|
||||
var doAfterArgs = new DoAfterEventArgs(user, component.HandStripDelay, CancellationToken.None, component.Owner)
|
||||
{
|
||||
ExtraCheck = Check,
|
||||
BreakOnStun = true,
|
||||
|
|
@ -374,7 +380,13 @@ namespace Content.Server.Strip
|
|||
return true;
|
||||
}
|
||||
|
||||
var doAfterArgs = new DoAfterEventArgs(user, component.StripDelay, CancellationToken.None, component.Owner)
|
||||
if (!_inventorySystem.TryGetSlot(component.Owner, slot, out var slotDef))
|
||||
{
|
||||
Logger.Error($"{ToPrettyString(user)} attempted to place an item in a non-existent inventory slot ({slot}) on {ToPrettyString(component.Owner)}");
|
||||
return;
|
||||
}
|
||||
|
||||
var doAfterArgs = new DoAfterEventArgs(user, slotDef.StripTime, CancellationToken.None, component.Owner)
|
||||
{
|
||||
ExtraCheck = Check,
|
||||
BreakOnStun = true,
|
||||
|
|
@ -425,7 +437,7 @@ namespace Content.Server.Strip
|
|||
return true;
|
||||
}
|
||||
|
||||
var doAfterArgs = new DoAfterEventArgs(user, component.StripDelay, CancellationToken.None, component.Owner)
|
||||
var doAfterArgs = new DoAfterEventArgs(user, component.HandStripDelay, CancellationToken.None, component.Owner)
|
||||
{
|
||||
ExtraCheck = Check,
|
||||
BreakOnStun = true,
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@ public sealed class SlotDefinition
|
|||
|
||||
[DataField("slotFlags")] public SlotFlags SlotFlags { get; } = SlotFlags.PREVENTEQUIP;
|
||||
|
||||
[DataField("stripTime")] public float StripTime { get; } = 3f;
|
||||
|
||||
[DataField("uiContainer")] public SlotUIContainer UIContainer { get; } = SlotUIContainer.None;
|
||||
|
||||
[DataField("uiWindowPos", required: true)] public Vector2i UIWindowPosition { get; }
|
||||
|
|
|
|||
|
|
@ -4,18 +4,21 @@
|
|||
- name: shoes
|
||||
slotTexture: shoes
|
||||
slotFlags: FEET
|
||||
stripTime: 2
|
||||
uiContainer: Top
|
||||
uiWindowPos: 1,3
|
||||
displayName: Shoes
|
||||
- name: jumpsuit
|
||||
slotTexture: uniform
|
||||
slotFlags: INNERCLOTHING
|
||||
stripTime: 5
|
||||
uiContainer: Top
|
||||
uiWindowPos: 0,2
|
||||
displayName: Jumpsuit
|
||||
- name: outerClothing
|
||||
slotTexture: suit
|
||||
slotFlags: OUTERCLOTHING
|
||||
stripTime: 5
|
||||
uiContainer: Top
|
||||
uiWindowPos: 1,2
|
||||
displayName: Suit
|
||||
|
|
@ -40,12 +43,14 @@
|
|||
- name: eyes
|
||||
slotTexture: glasses
|
||||
slotFlags: EYES
|
||||
stripTime: 2
|
||||
uiContainer: Top
|
||||
uiWindowPos: 0,0
|
||||
displayName: Eyes
|
||||
- name: ears
|
||||
slotTexture: ears
|
||||
slotFlags: EARS
|
||||
stripTime: 2
|
||||
uiContainer: Top
|
||||
uiWindowPos: 2,0
|
||||
displayName: Ears
|
||||
|
|
@ -58,6 +63,7 @@
|
|||
- name: pocket1
|
||||
slotTexture: pocket
|
||||
slotFlags: POCKET
|
||||
stripTime: 2
|
||||
uiContainer: BottomRight
|
||||
uiWindowPos: 0,3
|
||||
dependsOn: jumpsuit
|
||||
|
|
@ -65,6 +71,7 @@
|
|||
- name: pocket2
|
||||
slotTexture: pocket
|
||||
slotFlags: POCKET
|
||||
stripTime: 2
|
||||
uiContainer: BottomRight
|
||||
uiWindowPos: 2,3
|
||||
dependsOn: jumpsuit
|
||||
|
|
@ -72,6 +79,7 @@
|
|||
- name: suitstorage
|
||||
slotTexture: suit_storage
|
||||
slotFlags: SUITSTORAGE
|
||||
stripTime: 2
|
||||
uiContainer: BottomLeft
|
||||
uiWindowPos: 2,0
|
||||
dependsOn: outerClothing
|
||||
|
|
@ -79,6 +87,7 @@
|
|||
- name: id
|
||||
slotTexture: id
|
||||
slotFlags: IDCARD
|
||||
stripTime: 5
|
||||
uiContainer: BottomRight
|
||||
uiWindowPos: 2,1
|
||||
dependsOn: jumpsuit
|
||||
|
|
@ -86,12 +95,14 @@
|
|||
- name: belt
|
||||
slotTexture: belt
|
||||
slotFlags: BELT
|
||||
stripTime: 5
|
||||
uiContainer: BottomLeft
|
||||
uiWindowPos: 3,1
|
||||
displayName: Belt
|
||||
- name: back
|
||||
slotTexture: back
|
||||
slotFlags: BACK
|
||||
stripTime: 5
|
||||
uiContainer: BottomLeft
|
||||
uiWindowPos: 3,0
|
||||
displayName: Back
|
||||
|
|
|
|||
Loading…
Reference in New Issue