]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add BasePaperLabelable and BasePaperLabelableVisualized abstract prototypes (#41807)
authorHitlinemoss <209321380+Hitlinemoss@users.noreply.github.com>
Tue, 9 Dec 2025 14:48:57 +0000 (09:48 -0500)
committerGitHub <noreply@github.com>
Tue, 9 Dec 2025 14:48:57 +0000 (14:48 +0000)
* Add BasePaperLabelable to base_item.yml

* CrateGeneric now parents from BasePaperLabelable

* TWO types of BaseParcelWrapable

* Body bags use BasePaperLabelable

* Artifact containers use BasePaperLabelable

* Lockers now use BasePaperLabelable

* Comment cleanup + redundancies

* Seeds now use BasePaperLabelable (but need more paper sprites in the future)

* Parcel wrap bugfix

* Remove redundant components from crates

* Fix testfail tied to ContainerContainer component

* Fixed bad line alignment

* Gas canisters now use BasePaperLabelableVisualized

* Comment updates

* Other comment update

Resources/Prototypes/Entities/Objects/Misc/parcel_wrap.yml
Resources/Prototypes/Entities/Objects/Specific/Hydroponics/seeds.yml
Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml
Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/artifact_equipment.yml
Resources/Prototypes/Entities/Objects/base_item.yml
Resources/Prototypes/Entities/Structures/Storage/Canisters/gas_canisters.yml
Resources/Prototypes/Entities/Structures/Storage/Closets/base_structureclosets.yml
Resources/Prototypes/Entities/Structures/Storage/Crates/base_structurecrates.yml

index e2130d26793c531c864861ea517989c21580465b..c553948891c6ac147e00def06248450f3d212886 100644 (file)
@@ -43,6 +43,7 @@
 
 - type: entity
   abstract: true
+  parent: BasePaperLabelable # We use this instead of BasePaperLabelableVisualized because WrappedParcel needs its own GenericVisualizer component for the parcel itself, and WrappedParcelHumanoid currently doesn't have label sprites at all
   id: BaseWrappedParcel
   name: wrapped parcel
   description: Something wrapped up in paper. I wonder what's inside...
       params:
         volume: -4
     unwrapTrash: ParcelWrapTrash
-  - type: ItemSlots
-  - type: PaperLabel
-    labelSlot:
-      insertVerbText: comp-paper-label-insert
-      ejectVerbText: comp-paper-label-eject
-      whitelist:
-        components:
-        - Paper
-      blacklist:
-        tags:
-        - Book
   - type: Damageable
     damageContainer: Inorganic
   - type: Destructible
     - Recyclable # Parcel entity is recyclable, and when it's destroyed, it'll drop its contents.
 
 - type: entity
-  parent: [BaseItem, BaseWrappedParcel]
+  parent: [ BaseItem, BaseWrappedParcel ]
   id: WrappedParcel
   components:
   - type: Appearance
index ca6270ab646b1c418b79ce18cf960551471fa9fc..d8b458a0b399e48fd0de379b3ddfead498c33615 100644 (file)
@@ -1,5 +1,5 @@
 - type: entity
-  parent: BaseItem
+  parent: [ BaseItem, BasePaperLabelable ] #TODO: Add sprites for different types of paper, replace BasePaperLabelable with BasePaperLabelableVisualized
   id: SeedBase
   abstract: true
   components:
       size: Tiny
     - type: StaticPrice
       price: 20
-    - type: ItemSlots
-    - type: ContainerContainer
-      containers:
-        paper_label: !type:ContainerSlot
-    - type: PaperLabel
-      labelSlot:
-        insertVerbText: comp-paper-label-insert
-        ejectVerbText: comp-paper-label-eject
-        whitelist:
-          components:
-          - Paper
-        blacklist:
-          tags:
-          - Book
     - type: PhysicalComposition
 
 - type: entity
index bb043699d6eccc8d6d51a3d70c47245482ae925b..0dca01a6bcf46003f287c81149e37a4b1d65a78f 100644 (file)
@@ -1,6 +1,6 @@
 - type: entity
   id: BodyBag
-  parent: BaseDeployFoldable
+  parent: [ BaseDeployFoldable, BasePaperLabelableVisualized ]
   name: body bag
   description: A plastic bag designed for the storage and transportation of cadavers to stop body decomposition.
   components:
     openSound:
       path: /Audio/Misc/zip.ogg
   - type: EntityStorageLayingDownOverride
-  - type: PaperLabel
-    labelSlot:
-      insertVerbText: comp-paper-label-insert
-      ejectVerbText: comp-paper-label-eject
-      whitelist:
-        components:
-        - Paper
-      blacklist:
-        tags:
-        - Book
   - type: Appearance
   - type: EntityStorageVisuals
     stateDoorOpen: open_overlay
@@ -88,7 +78,6 @@
           False: {visible: true}
   - type: Pullable
   - type: AntiRottingContainer
-  - type: ItemSlots
   - type: ContainerContainer
     containers:
       entity_storage: !type:Container
index 8352933f8bd0026ec609a8c99bdac61f3cd0ab7b..fd9d11f90e7e3e35ed0ea6f7bfdf5114e440c4c2 100644 (file)
@@ -1,6 +1,6 @@
 - type: entity
+  parent: [ BaseStructureDynamic, BasePaperLabelableVisualized ]
   id: CrateArtifactContainer
-  parent: BaseStructureDynamic
   name: artifact container
   description: Used to safely contain and move artifacts.
   components:
           behaviors:
             - !type:DoActsBehavior
               acts: ["Destruction"]
-    - type: PaperLabel
-      labelSlot:
-        insertVerbText: comp-paper-label-insert
-        ejectVerbText: comp-paper-label-eject
-        whitelist:
-          components:
-            - Paper
-        blacklist:
-          tags:
-          - Book
     - type: Appearance
     - type: EntityStorageVisuals
       stateDoorOpen: artifact_container_open
@@ -95,7 +85,6 @@
             True: { offset: "0.0,0.3125" }
             False: { offset: "0.0,0.0" }
     - type: LockVisuals
-    - type: ItemSlots
     - type: ContainerContainer
       containers:
         entity_storage: !type:Container
index 8490ba0042d7b32a64e4e14ce55e86651b059d32..ca7e78033d79a691865a12f33372f5002b9274f4 100644 (file)
           Open: { visible: true }
           Closed: { visible: false }
 
+# Defines the behavior (but not the visuals!) for attaching paper labels to objects (e.g crates, parcels).
+# Use this (NOT BasePaperLabelableVisualized) if the child prototype allows paper labels but has no sprites for it.
+# Note that if an entity has its own ContainerContainer component then paper_label needs to be added to that too, or else there's bugs.
+- type: entity
+  id: BasePaperLabelable
+  abstract: true
+  components:
+  - type: ContainerContainer
+    containers:
+      paper_label: !type:ContainerSlot
+  - type: ItemSlots
+  - type: PaperLabel
+    labelSlot:
+      insertVerbText: comp-paper-label-insert
+      ejectVerbText: comp-paper-label-eject
+      whitelist:
+        components:
+        - Paper
+      blacklist:
+        tags:
+        - Book
+
+# Defines both the behavior (via parenting) and the visuals for attaching paper labels to objects (e.g crates, parcels).
+# Use this (NOT BasePaperLabelable) if the child prototype has sprites for paper labels.
+# The GenericVisualizer used here ONLY manages the paper label. If the child prototype has a unique GenericVisualizer for some reason or another,
+# then that will also need to handle the paper label too, since it'll completely overwrite the one here.
+# You should still parent from this instead of BasePaperLabelable since if that unique GenericVisualizer is missing for some reason this one works as a failsafe.
+# (Though it might not really matter in practice.)
+# In any case, the actual Sprite component for the label layer still needs to be defined on a per-item basis!
+# And again note that if an entity has its own ContainerContainer component then paper_label needs to be added to that too, or else there's bugs.
+- type: entity
+  parent: BasePaperLabelable
+  id: BasePaperLabelableVisualized
+  abstract: true
+  components:
+  - type: Appearance
+  - type: GenericVisualizer
+    visuals:
+      enum.PaperLabelVisuals.HasLabel:
+        enum.PaperLabelVisuals.Layer:
+          True: { visible: true }
+          False: { visible: false }
+      enum.PaperLabelVisuals.LabelType:
+        enum.PaperLabelVisuals.Layer:
+          Paper: { state: paper }
+          Bounty: { state: bounty }
+          CaptainsPaper: { state: captains_paper }
+          Invoice: { state: invoice }
+
 # PowerCellSlot parents
 - type: entity
   id: PowerCellSlotSmallItem
index 3bacc4442b0d329331c88f9f753454ed1d90eb39..38ec6f8cc494bcb30f17de43b7f4972b3d77cdec 100644 (file)
@@ -1,6 +1,6 @@
 - type: entity
   abstract: true
-  parent: BaseStructureDynamic
+  parent: [ BaseStructureDynamic, BasePaperLabelableVisualized ]
   id: GasCanister
   name: gas canister
   description: A canister that can contain any type of gas. It can be attached to connector ports using a wrench.
           nodeGroupID: Pipe
           rotationsEnabled: false
           volume: 1
-    - type: ItemSlots
     - type: GasPortable
     - type: GasCanister
       gasTankSlot:
             - GasTank
     - type: StaticPrice
       price: 200
-    - type: PaperLabel
-      labelSlot:
-        insertVerbText: comp-paper-label-insert
-        ejectVerbText: comp-paper-label-eject
-        whitelist:
-          components:
-          - Paper
-        blacklist:
-          tags:
-          - Book
     - type: AccessReader
       access: [["Atmospherics"], ["Engineering"], ["Research"]]
     - type: Lock
index 181321d28037fb6438e83b27f37840c1c5722f7e..839e5ef1fbef9c9b8265fd83c507b27b62a63cb6 100644 (file)
@@ -1,6 +1,6 @@
 - type: entity
   id: ClosetBase
-  parent: BaseStructureDynamic
+  parent: [ BaseStructureDynamic, BasePaperLabelableVisualized ]
   name: closet
   description: A standard-issue Nanotrasen storage unit.
   abstract: true
       sprite: Structures/Storage/closet_labels.rsi
       map: ["enum.PaperLabelVisuals.Layer"]
   - type: MovedByPressure
-  - type: PaperLabel
-    labelSlot:
-      insertVerbText: comp-paper-label-insert
-      ejectVerbText: comp-paper-label-eject
-      whitelist:
-        components:
-        - Paper
-      blacklist:
-        tags:
-        - Book
-  - type: ItemSlots
   - type: DamageOnHighSpeedImpact
     damage:
       types:
index 635cdee16e5557af58890fa817e4ce0193e0ec33..6d5d48c76751b84af7154d72722577af25e0818d 100644 (file)
@@ -1,5 +1,5 @@
 - type: entity
-  parent: BaseStructureDynamic
+  parent: [ BaseStructureDynamic, BasePaperLabelableVisualized ]
   id: CrateGeneric
   categories: [ HideSpawnMenu ]
   name: crate
       - !type:PlaySoundBehavior
         sound:
           collection: MetalBreak
-  - type: Appearance
   - type: EntityStorageVisuals
     stateDoorOpen: open
     stateDoorClosed: closed
-  - type: GenericVisualizer
-    visuals:
-      enum.PaperLabelVisuals.HasLabel:
-        enum.PaperLabelVisuals.Layer:
-          True: { visible: true }
-          False: { visible: false }
-      enum.PaperLabelVisuals.LabelType:
-        enum.PaperLabelVisuals.Layer:
-          Paper: { state: paper }
-          Bounty: { state: bounty }
-          CaptainsPaper: { state: captains_paper }
-          Invoice: { state: invoice }
-  - type: PaperLabel
-    labelSlot:
-      insertVerbText: comp-paper-label-insert
-      ejectVerbText: comp-paper-label-eject
-      whitelist:
-        components:
-        - Paper
-      blacklist:
-        tags:
-        - Book
   - type: ContainerContainer
     containers:
       entity_storage: !type:Container
       paper_label: !type:ContainerSlot
-  - type: ItemSlots
   - type: StaticPrice
     price: 75
   - type: Construction