# SPDX-FileCopyrightText: 2023 CommieFlowers <rasmus.cedergren@hotmail.com>
# SPDX-FileCopyrightText: 2023 Julian Giebel <juliangiebel@live.de>
# SPDX-FileCopyrightText: 2023 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Vordenburg <114301317+Vordenburg@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 rolfero <45628623+rolfero@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Emisse <99158783+Emisse@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Errant <35878406+Errant-4@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Flareguy <78941145+Flareguy@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 IProduceWidgets <107586145+IProduceWidgets@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 JustCone <141039037+JustCone14@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Mervill <mervills.email@gmail.com>
# SPDX-FileCopyrightText: 2024 MrFippik <48425912+MrFippik@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 PJBot <pieterjan.briers+bot@gmail.com>
# SPDX-FileCopyrightText: 2024 Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
# SPDX-FileCopyrightText: 2024 Piras314 <p1r4s@proton.me>
# SPDX-FileCopyrightText: 2024 Plykiya <58439124+Plykiya@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 PopGamer46 <yt1popgamer@gmail.com>
# SPDX-FileCopyrightText: 2024 Spessmann <156740760+Spessmann@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Winkarst <74284083+Winkarst-cpu@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 avery <51971268+graevy@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 coolboy911 <85909253+coolboy911@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deltanedas <@deltanedas:kde.org>
# SPDX-FileCopyrightText: 2024 lunarcomets <140772713+lunarcomets@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2024 plykiya <plykiya@protonmail.com>
# SPDX-FileCopyrightText: 2024 saintmuntzer <47153094+saintmuntzer@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 themias <89101928+themias@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  id: SignalTimer
  name: signal timer
  description: It's a timer for sending timed signals to things.
  placement:
    mode: SnapgridCenter
    snap:
    - Wallmount
  components:
  - type: StationAiWhitelist
  - type: Transform
    anchored: true
  - type: WallMount
    arc: 360
  - type: Clickable
  - type: InteractionOutline
  - type: Sprite
    drawdepth: SmallObjects
    sprite: Structures/Wallmounts/switch.rsi
    state: on
  - type: Appearance
  - type: Rotatable
  - type: SignalTimer
    canEditLabel: false
  - type: DeviceLinkSource
    ports:
      - Start
      - Timer
  - type: DeviceLinkSink
    ports:
      - Trigger
  - type: ActivatableUI
    key: enum.SignalTimerUiKey.Key
  - type: UserInterface
    interfaces:
      enum.SignalTimerUiKey.Key:
        type: SignalTimerBoundUserInterface
  - type: ApcPowerReceiver
    powerLoad: 100
  - type: Electrified
    enabled: false
    usesApcPower: true
  - type: ExtensionCableReceiver
  - type: ActivatableUIRequiresPower
  - type: Construction
    graph: Timer
    node: signal
    containers:
    - board
  - type: ContainerContainer
    containers:
      board: !type:Container
  - type: ContainerFill
    containers:
      board: [ SignalTimerElectronics ]

- type: entity
  id: ScreenTimer
  parent: SignalTimer
  name: screen timer
  description: It's a timer for sending timed signals to things, with a built-in screen.
  components:
  - type: SignalTimer
    canEditLabel: true
  - type: TextScreenVisuals
    color: FloralWhite
    textOffset: 0,6
    timerOffset: 0,6
    # textLength: 5 This field does not exist. Bug?
    rows: 1
  - type: Sprite
    drawdepth: WallMountedItems
    sprite: Structures/Wallmounts/signalscreen.rsi
    state: signalscreen
    noRot: true
  - type: Construction
    graph: Timer
    node: screen
    containers:
    - board
  - type: ContainerFill
    containers:
      board: [ ScreenTimerElectronics ]

- type: entity
  id: BrigTimer
  parent: ScreenTimer
  name: brig timer
  description: It's a timer for brig cells.
  components:
  - type: AccessReader
    access: [["Security"]]
  - type: Construction
    graph: Timer
    node: brig
    containers:
    - board
  - type: ContainerFill
    containers:
      board: [ BrigTimerElectronics ]

# Construction Frame

- type: entity
  categories: [ HideSpawnMenu ]
  id: TimerFrame
  name: timer frame
  description: A construction frame for a timer.
  placement:
    mode: SnapgridCenter
  components:
  - type: Clickable
  - type: InteractionOutline
  - type: Transform
    anchored: true
  - type: Sprite
    drawdepth: WallMountedItems
    sprite: Structures/Wallmounts/signalscreen.rsi
    state: signalscreen
  - type: Construction
    graph: Timer
    node: frame
  - type: WallMount