Add a bool to disable buckling on InteractHand (#30001)

This commit is contained in:
ShadowCommander
2024-08-25 10:09:51 -07:00
committed by GitHub
parent 2d70c7d473
commit 5c0753b136
3 changed files with 8 additions and 1 deletions

View File

@@ -90,6 +90,12 @@ public sealed partial class StrapComponent : Component
/// </summary> /// </summary>
[DataField] [DataField]
public float BuckleDoafterTime = 2f; public float BuckleDoafterTime = 2f;
/// <summary>
/// Whether InteractHand will buckle the user to the strap.
/// </summary>
[DataField]
public bool BuckleOnInteractHand = true;
} }
public enum StrapPosition public enum StrapPosition

View File

@@ -84,7 +84,7 @@ public abstract partial class SharedBuckleSystem
if (!TryComp(args.User, out BuckleComponent? buckle)) if (!TryComp(args.User, out BuckleComponent? buckle))
return; return;
if (buckle.BuckledTo == null) if (buckle.BuckledTo == null && component.BuckleOnInteractHand)
TryBuckle(args.User, args.User, uid, buckle, popup: true); TryBuckle(args.User, args.User, uid, buckle, popup: true);
else if (buckle.BuckledTo == uid) else if (buckle.BuckledTo == uid)
TryUnbuckle(args.User, args.User, buckle, popup: true); TryUnbuckle(args.User, args.User, buckle, popup: true);

View File

@@ -55,6 +55,7 @@
rotation: -90 rotation: -90
buckleOffset: "0,0.15" buckleOffset: "0,0.15"
unbuckleOffset: "0,0.15" unbuckleOffset: "0,0.15"
buckleOnInteractHand: False
- type: Appearance - type: Appearance
- type: GenericVisualizer - type: GenericVisualizer
visuals: visuals: