# SPDX-FileCopyrightText: 2024 Aidenkrz <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2024 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  abstract: true
  id: BaseItemCabinet
  components:
  - type: Openable
    openOnActivate: true
    closeable: true
    sound:
      path: /Audio/Machines/machine_switch.ogg
    closeSound:
      path: /Audio/Machines/machine_switch.ogg
  - type: ItemCabinet
  - type: ItemSlots
  - type: ContainerContainer
    containers:
      ItemCabinet: !type:ContainerSlot
  - type: Appearance
  # perfect for most things but you can always replace it
  - type: GenericVisualizer
    visuals:
      enum.ItemCabinetVisuals.ContainsItem:
        enum.ItemCabinetVisuals.Layer:
          True: { visible: true }
          False: { visible: false }
      enum.OpenableVisuals.Opened:
        enum.OpenableVisuals.Layer:
          True: { state: open }
          False: { state: closed }

- type: entity
  abstract: true
  parent: BaseItemCabinet
  id: BaseItemCabinetGlass
  components:
  - type: GenericVisualizer
    visuals:
      enum.ItemCabinetVisuals.ContainsItem:
        enum.ItemCabinetVisuals.Layer:
          True: { visible: true }
          False: { visible: false }
      enum.OpenableVisuals.Opened:
        enum.OpenableVisuals.Layer:
          True: { state: glass-up }
          False: { state: glass }