Add customizable buckled status effect icon per strap

This commit is contained in:
DrSmugleaf
2020-07-04 14:14:39 +02:00
parent 47118e8301
commit abfe86be81
2 changed files with 9 additions and 1 deletions

View File

@@ -55,7 +55,7 @@ namespace Content.Server.GameObjects.Components.Mobs
{
status.ChangeStatusEffectIcon(StatusEffect.Buckled,
Buckled
? "/Textures/Mob/UI/Buckle/buckled.png"
? BuckledTo!.BuckledIcon
: "/Textures/Mob/UI/Buckle/unbuckled.png");
}
}

View File

@@ -20,6 +20,7 @@ namespace Content.Server.GameObjects.Components.Strap
private StrapPosition _position;
private string _buckleSound;
private string _unbuckleSound;
private string _buckledIcon;
private int _rotation;
private int _size;
@@ -53,6 +54,12 @@ namespace Content.Server.GameObjects.Components.Strap
[ViewVariables]
public string UnbuckleSound => _unbuckleSound;
/// <summary>
/// The icon to be displayed as a status when buckled
/// </summary>
[ViewVariables]
public string BuckledIcon => _buckledIcon;
/// <summary>
/// The angle in degrees to rotate the player by when they get strapped
/// </summary>
@@ -123,6 +130,7 @@ namespace Content.Server.GameObjects.Components.Strap
serializer.DataField(ref _position, "position", StrapPosition.None);
serializer.DataField(ref _buckleSound, "buckleSound", "/Audio/effects/buckle.ogg");
serializer.DataField(ref _unbuckleSound, "unbuckleSound", "/Audio/effects/unbuckle.ogg");
serializer.DataField(ref _buckledIcon, "buckledIcon", "/Textures/Mob/UI/Buckle/buckled.png");
serializer.DataField(ref _rotation, "rotation", 0);
var defaultSize = 100;