Add verbs to Open/Close Openable containers, and add optional seals (#24780)
* Implement closing; add open/close verbs * Add breakable seals * Allow custom verb names; make condiment bottles closeable * Remove pointless VV annotations and false defaults * Split Sealable off into a new component * Should have a Closed event too * Oh hey, there are icons I could use * Ternary operator * Add support for seal visualizers * Moved Sealable to Shared, added networking * Replaced bottle_close1.ogg
This commit is contained in:
@@ -14,20 +14,20 @@ public sealed partial class OpenableComponent : Component
|
||||
/// Whether this drink or food is opened or not.
|
||||
/// Drinks can only be drunk or poured from/into when open, and food can only be eaten when open.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField]
|
||||
public bool Opened;
|
||||
|
||||
/// <summary>
|
||||
/// If this is false you cant press Z to open it.
|
||||
/// Requires an OpenBehavior damage threshold or other logic to open.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField]
|
||||
public bool OpenableByHand = true;
|
||||
|
||||
/// <summary>
|
||||
/// Text shown when examining and its open.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField]
|
||||
public LocId ExamineText = "drink-component-on-examine-is-opened";
|
||||
|
||||
/// <summary>
|
||||
@@ -35,12 +35,38 @@ public sealed partial class OpenableComponent : Component
|
||||
/// Defaults to the popup drink uses since its "correct".
|
||||
/// It's still generic enough that you should change it if you make openable non-drinks, i.e. unwrap it first, peel it first.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField]
|
||||
public LocId ClosedPopup = "drink-component-try-use-drink-not-open";
|
||||
|
||||
/// <summary>
|
||||
/// Text to show in the verb menu for the "Open" action.
|
||||
/// You may want to change this for non-drinks, i.e. "Peel", "Unwrap"
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public LocId OpenVerbText = "openable-component-verb-open";
|
||||
|
||||
/// <summary>
|
||||
/// Text to show in the verb menu for the "Close" action.
|
||||
/// You may want to change this for non-drinks, i.e. "Wrap"
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public LocId CloseVerbText = "openable-component-verb-close";
|
||||
|
||||
/// <summary>
|
||||
/// Sound played when opening.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public SoundSpecifier Sound = new SoundCollectionSpecifier("canOpenSounds");
|
||||
|
||||
/// <summary>
|
||||
/// Can this item be closed again after opening?
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public bool Closeable;
|
||||
|
||||
/// <summary>
|
||||
/// Sound played when closing.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public SoundSpecifier? CloseSound;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user