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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
- type: PDA
|
||||
penSlot:
|
||||
startingItem: Pen
|
||||
priority: -1
|
||||
whitelist:
|
||||
tags:
|
||||
- Write
|
||||
@@ -177,11 +178,10 @@
|
||||
- type: PDA
|
||||
id: ClownIDCard
|
||||
penSlot:
|
||||
startingItem: CrayonOrange # no pink crayon?!?
|
||||
# Maybe this is a bad idea.
|
||||
# At least they can't just spam alt-click it.
|
||||
# You need to remove the ID & alternate between inserting and ejecting
|
||||
startingItem: CrayonOrange # no pink crayon?!?
|
||||
# ^ Still unacceptable.
|
||||
ejectSound: /Audio/Items/bikehorn.ogg
|
||||
priority: -1
|
||||
whitelist:
|
||||
tags:
|
||||
- Write
|
||||
@@ -365,6 +365,7 @@
|
||||
id: CaptainIDCard
|
||||
penSlot:
|
||||
startingItem: PenCap
|
||||
priority: -1
|
||||
whitelist:
|
||||
tags:
|
||||
- Write
|
||||
@@ -385,6 +386,7 @@
|
||||
id: HoPIDCard
|
||||
penSlot:
|
||||
startingItem: PenHop
|
||||
priority: -1
|
||||
whitelist:
|
||||
tags:
|
||||
- Write
|
||||
@@ -410,7 +412,6 @@
|
||||
- type: Icon
|
||||
state: pda-ce
|
||||
|
||||
|
||||
- type: entity
|
||||
parent: BasePDA
|
||||
id: EngineerPDA
|
||||
|
||||
Reference in New Issue
Block a user