using Content.Shared.Nutrition.EntitySystems;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
namespace Content.Shared.Nutrition.Components;
///
/// A drink or food that can be opened.
/// Starts closed, open it with Z or E.
///
[NetworkedComponent, AutoGenerateComponentState]
[RegisterComponent, Access(typeof(SharedOpenableSystem))]
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.
///
[DataField, AutoNetworkedField]
public bool Opened;
///
/// If this is false you cant press Z to open it.
/// Requires an OpenBehavior damage threshold or other logic to open.
///
[DataField, AutoNetworkedField]
public bool OpenableByHand = true;
///
/// Text shown when examining and its open.
///
[DataField]
public LocId ExamineText = "drink-component-on-examine-is-opened";
///
/// The locale id for the popup shown when IsClosed is called and closed. Needs a "owner" entity argument passed to it.
/// 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.
///
[DataField]
public LocId ClosedPopup = "drink-component-try-use-drink-not-open";
///
/// Text to show in the verb menu for the "Open" action.
/// You may want to change this for non-drinks, i.e. "Peel", "Unwrap"
///
[DataField]
public LocId OpenVerbText = "openable-component-verb-open";
///
/// Text to show in the verb menu for the "Close" action.
/// You may want to change this for non-drinks, i.e. "Wrap"
///
[DataField]
public LocId CloseVerbText = "openable-component-verb-close";
///
/// Sound played when opening.
///
[DataField]
public SoundSpecifier Sound = new SoundCollectionSpecifier("canOpenSounds");
///
/// Can this item be closed again after opening?
///
[DataField, AutoNetworkedField]
public bool Closeable;
///
/// Sound played when closing.
///
[DataField]
public SoundSpecifier? CloseSound;
}