Add priorities to items slots (#8748)
This commit is contained in:
@@ -198,5 +198,11 @@ namespace Content.Shared.Containers.ItemSlots
|
||||
// Convenience properties
|
||||
public bool HasItem => ContainerSlot?.ContainedEntity != null;
|
||||
public EntityUid? Item => ContainerSlot?.ContainedEntity;
|
||||
|
||||
/// <summary>
|
||||
/// Priority for use with the eject & insert verbs for this slot.
|
||||
/// </summary>
|
||||
[DataField("priority")]
|
||||
public int Priority = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -431,6 +431,7 @@ namespace Content.Shared.Containers.ItemSlots
|
||||
verb.Text = Loc.GetString(slot.EjectVerbText);
|
||||
}
|
||||
|
||||
verb.Priority = slot.Priority;
|
||||
args.Verbs.Add(verb);
|
||||
}
|
||||
}
|
||||
@@ -462,6 +463,7 @@ namespace Content.Shared.Containers.ItemSlots
|
||||
else
|
||||
takeVerb.Text = Loc.GetString(slot.EjectVerbText);
|
||||
|
||||
takeVerb.Priority = slot.Priority;
|
||||
args.Verbs.Add(takeVerb);
|
||||
}
|
||||
|
||||
@@ -500,6 +502,7 @@ namespace Content.Shared.Containers.ItemSlots
|
||||
insertVerb.Text = verbSubject;
|
||||
}
|
||||
|
||||
insertVerb.Priority = slot.Priority;
|
||||
args.Verbs.Add(insertVerb);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user