From: Hitlinemoss <209321380+Hitlinemoss@users.noreply.github.com> Date: Tue, 9 Dec 2025 14:48:57 +0000 (-0500) Subject: Add BasePaperLabelable and BasePaperLabelableVisualized abstract prototypes (#41807) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=6dbd2f6acc53a50630e9daea743353ff1612a923;p=space-station-14.git Add BasePaperLabelable and BasePaperLabelableVisualized abstract prototypes (#41807) * 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 --- diff --git a/Resources/Prototypes/Entities/Objects/Misc/parcel_wrap.yml b/Resources/Prototypes/Entities/Objects/Misc/parcel_wrap.yml index e2130d2679..c553948891 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/parcel_wrap.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/parcel_wrap.yml @@ -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... @@ -64,17 +65,6 @@ 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 @@ -107,7 +97,7 @@ - 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 diff --git a/Resources/Prototypes/Entities/Objects/Specific/Hydroponics/seeds.yml b/Resources/Prototypes/Entities/Objects/Specific/Hydroponics/seeds.yml index ca6270ab64..d8b458a0b3 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Hydroponics/seeds.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Hydroponics/seeds.yml @@ -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: @@ -23,20 +23,6 @@ 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 diff --git a/Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml b/Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml index bb043699d6..0dca01a6bc 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Medical/morgue.yml @@ -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: @@ -54,16 +54,6 @@ 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 diff --git a/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/artifact_equipment.yml b/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/artifact_equipment.yml index 8352933f8b..fd9d11f90e 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/artifact_equipment.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Xenoarchaeology/artifact_equipment.yml @@ -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: @@ -64,16 +64,6 @@ 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 diff --git a/Resources/Prototypes/Entities/Objects/base_item.yml b/Resources/Prototypes/Entities/Objects/base_item.yml index 8490ba0042..ca7e78033d 100644 --- a/Resources/Prototypes/Entities/Objects/base_item.yml +++ b/Resources/Prototypes/Entities/Objects/base_item.yml @@ -76,6 +76,55 @@ 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 diff --git a/Resources/Prototypes/Entities/Structures/Storage/Canisters/gas_canisters.yml b/Resources/Prototypes/Entities/Structures/Storage/Canisters/gas_canisters.yml index 3bacc4442b..38ec6f8cc4 100644 --- a/Resources/Prototypes/Entities/Structures/Storage/Canisters/gas_canisters.yml +++ b/Resources/Prototypes/Entities/Structures/Storage/Canisters/gas_canisters.yml @@ -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. @@ -113,7 +113,6 @@ nodeGroupID: Pipe rotationsEnabled: false volume: 1 - - type: ItemSlots - type: GasPortable - type: GasCanister gasTankSlot: @@ -124,16 +123,6 @@ - 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 diff --git a/Resources/Prototypes/Entities/Structures/Storage/Closets/base_structureclosets.yml b/Resources/Prototypes/Entities/Structures/Storage/Closets/base_structureclosets.yml index 181321d280..839e5ef1fb 100644 --- a/Resources/Prototypes/Entities/Structures/Storage/Closets/base_structureclosets.yml +++ b/Resources/Prototypes/Entities/Structures/Storage/Closets/base_structureclosets.yml @@ -1,6 +1,6 @@ - type: entity id: ClosetBase - parent: BaseStructureDynamic + parent: [ BaseStructureDynamic, BasePaperLabelableVisualized ] name: closet description: A standard-issue Nanotrasen storage unit. abstract: true @@ -25,17 +25,6 @@ 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: diff --git a/Resources/Prototypes/Entities/Structures/Storage/Crates/base_structurecrates.yml b/Resources/Prototypes/Entities/Structures/Storage/Crates/base_structurecrates.yml index 635cdee16e..6d5d48c767 100644 --- a/Resources/Prototypes/Entities/Structures/Storage/Crates/base_structurecrates.yml +++ b/Resources/Prototypes/Entities/Structures/Storage/Crates/base_structurecrates.yml @@ -1,5 +1,5 @@ - type: entity - parent: BaseStructureDynamic + parent: [ BaseStructureDynamic, BasePaperLabelableVisualized ] id: CrateGeneric categories: [ HideSpawnMenu ] name: crate @@ -55,37 +55,13 @@ - !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