You can now see paper on crates (with color!) (#26834)

* Implement changes on not-cooked branch

* Made it work

* Fix update appearance calls

* Fix extra indents, clean-up code, fix tests hopefully

* Fix hammy cagecrate

* Fix messing up the yml, add artifact crate specific labels back in

* Visual Studio hates yml, sad

* Seperate the colors for cargonia

* sorry json

* make label move with artifact door

* Apply suggestion changes

Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>

* Fix remaining crate offsets, add a few for livestock and graves (why are you labeling graves) and coffin label sprites (why are you labeling coffins??)

---------

Co-authored-by: Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
This commit is contained in:
Verm
2024-04-13 22:39:02 -05:00
committed by GitHub
parent cb4561fe96
commit 96ad9002f1
33 changed files with 275 additions and 61 deletions

View File

@@ -84,10 +84,7 @@ namespace Content.Server.Labels
{
_itemSlotsSystem.AddItemSlot(uid, ContainerName, component.LabelSlot);
if (!EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
return;
_appearance.SetData(uid, PaperLabelVisuals.HasLabel, false, appearance);
UpdateAppearance((uid, component));
}
private void OnComponentRemove(EntityUid uid, PaperLabelComponent component, ComponentRemove args)
@@ -131,10 +128,18 @@ namespace Content.Server.Labels
if (args.Container.ID != label.LabelSlot.ID)
return;
if (!EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
UpdateAppearance((uid, label));
}
private void UpdateAppearance(Entity<PaperLabelComponent, AppearanceComponent?> ent)
{
if (!Resolve(ent, ref ent.Comp2, false))
return;
_appearance.SetData(uid, PaperLabelVisuals.HasLabel, label.LabelSlot.HasItem, appearance);
var slot = ent.Comp1.LabelSlot;
_appearance.SetData(ent, PaperLabelVisuals.HasLabel, slot.HasItem, ent.Comp2);
if (TryComp<PaperLabelTypeComponent>(slot.Item, out var type))
_appearance.SetData(ent, PaperLabelVisuals.LabelType, type.PaperType, ent.Comp2);
}
}
}

View File

@@ -0,0 +1,16 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Labels.Components;
/// <summary>
/// Specifies the paper type (see textures/storage/crates/labels.rsi to see currently supported paper types) to show on crates this label is attached to.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class PaperLabelTypeComponent : Component
{
/// <summary>
/// The type of label to show.
/// </summary>
[DataField]
public string PaperType = "Paper";
}

View File

@@ -13,9 +13,11 @@ namespace Content.Shared.Labels
}
[Serializable, NetSerializable]
public enum PaperLabelVisuals
public enum PaperLabelVisuals : byte
{
Layer,
HasLabel,
LabelType
}
/// <summary>

View File

@@ -15,6 +15,7 @@
map: ["enum.PaperVisualLayers.Stamp"]
visible: false
- type: Paper
- type: PaperLabelType
- type: ActivatableUI
key: enum.PaperUiKey.Key
closeOnHandDeselect: false
@@ -143,6 +144,8 @@
- state: paper_stamp-generic
map: ["enum.PaperVisualLayers.Stamp"]
visible: false
- type: PaperLabelType
paperType: CaptainsPaper
- type: PaperVisuals
headerImagePath: "/Textures/Interface/Paper/paper_heading_captains_thoughts.svg.96dpi.png"
backgroundImagePath: "/Textures/Interface/Paper/paper_background_default.svg.96dpi.png"
@@ -160,19 +163,21 @@
sprite: Objects/Misc/bureaucracy.rsi
layers:
- state: paper
color: "#f7e574"
color: "#9ef5ff"
- state: paper_words
map: ["enum.PaperVisualLayers.Writing"]
color: "#f7e574"
color: "#9ef5ff"
visible: false
- state: paper_stamp-generic
map: ["enum.PaperVisualLayers.Stamp"]
visible: false
- type: PaperLabelType
paperType: Invoice
- type: PaperVisuals
backgroundImagePath: "/Textures/Interface/Paper/paper_background_default.svg.96dpi.png"
contentImagePath: "/Textures/Interface/Paper/paper_content_lined.svg.96dpi.png"
backgroundModulate: "#f7e574"
contentImageModulate: "#f7e574"
backgroundModulate: "#9ef5ff"
contentImageModulate: "#9ef5ff"
backgroundPatchMargin: 16.0, 16.0, 16.0, 16.0
contentMargin: 16.0, 16.0, 16.0, 16.0
headerImagePath: "/Textures/Interface/Paper/paper_heading_cargo_invoice.svg.96dpi.png"
@@ -184,6 +189,29 @@
name: bounty manifest
description: A paper label designating a crate as containing a bounty. Selling a crate with this label will fulfill the bounty.
components:
- type: Sprite
sprite: Objects/Misc/bureaucracy.rsi
layers:
- state: paper
color: "#f7e574"
- state: paper_words
map: ["enum.PaperVisualLayers.Writing"]
color: "#f7e574"
visible: false
- state: paper_stamp-generic
map: ["enum.PaperVisualLayers.Stamp"]
visible: false
- type: PaperLabelType
paperType: Bounty
- type: PaperVisuals
backgroundImagePath: "/Textures/Interface/Paper/paper_background_default.svg.96dpi.png"
contentImagePath: "/Textures/Interface/Paper/paper_content_lined.svg.96dpi.png"
backgroundModulate: "#f7e574"
contentImageModulate: "#f7e574"
backgroundPatchMargin: 16.0, 16.0, 16.0, 16.0
contentMargin: 16.0, 16.0, 16.0, 16.0
headerImagePath: "/Textures/Interface/Paper/paper_heading_cargo_invoice.svg.96dpi.png"
headerMargin: 0.0, 12.0, 0.0, 0.0
- type: CargoBountyLabel
- type: StaticPrice
price: 0

View File

@@ -17,8 +17,8 @@
visible: false
- state: open_overlay
map: ["enum.StorageVisualLayers.Door"]
- state: label_overlay
map: ["enum.BodyBagVisualLayers.Label"]
- state: paper
map: ["enum.PaperLabelVisuals.Layer"]
- type: Icon
sprite: Objects/Specific/Medical/Morgue/bodybags.rsi
state: bag
@@ -62,9 +62,15 @@
- type: GenericVisualizer
visuals:
enum.PaperLabelVisuals.HasLabel:
enum.BodyBagVisualLayers.Label:
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 }
enum.FoldedVisuals.State:
foldedLayer:
True: {visible: true}

View File

@@ -1,4 +1,4 @@
- type: entity
- type: entity
id: CrateArtifactContainer
parent: BaseStructureDynamic
name: artifact container
@@ -24,6 +24,8 @@
- state: locked
map: ["enum.LockVisualLayers.Lock"]
shader: unshaded
- state: paper
map: ["enum.PaperLabelVisuals.Layer"]
- type: InteractionOutline
- type: Physics
- type: Fixtures
@@ -73,6 +75,23 @@
- type: EntityStorageVisuals
stateDoorOpen: artifact_container_open
stateDoorClosed: artifact_container_door
- 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 }
enum.StorageVisuals.Open:
enum.PaperLabelVisuals.Layer:
True: { offset: "0.0,0.3125" }
False: { offset: "0.0,0.0" }
- type: LockVisuals
- type: ItemSlots
- type: ContainerContainer

View File

@@ -21,6 +21,9 @@
- state: welded
visible: false
map: ["enum.WeldableLayers.BaseWelded"]
- state: paper
sprite: Structures/Storage/Crates/labels.rsi
map: ["enum.PaperLabelVisuals.Layer"]
- type: InteractionOutline
- type: Physics
- type: Fixtures
@@ -55,6 +58,18 @@
- 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: Attach Label
@@ -106,6 +121,9 @@
- state: locked
map: ["enum.LockVisualLayers.Lock"]
shader: unshaded
- state: paper
sprite: Structures/Storage/Crates/labels.rsi
map: ["enum.PaperLabelVisuals.Layer"]
- type: Damageable
damageContainer: StructuralInorganic
damageModifierSet: StructuralMetallic

View File

@@ -138,6 +138,9 @@
map: ["enum.StorageVisualLayers.Base"]
- state: closed
map: ["enum.StorageVisualLayers.Door"]
- state: paper
sprite: Structures/Storage/Crates/labels.rsi
map: ["enum.PaperLabelVisuals.Layer"]
- type: Construction
graph: WebStructures
node: crate
@@ -320,6 +323,10 @@
- state: base
- state: closed
map: ["enum.StorageVisualLayers.Door"]
- state: paper
sprite: Structures/Storage/Crates/labels.rsi
offset: "-0.25,0.625"
map: ["enum.PaperLabelVisuals.Layer"]
- type: Icon
sprite: Structures/Storage/Crates/livestock.rsi
state: base
@@ -371,6 +378,10 @@
- state: base
- state: closed
map: ["enum.StorageVisualLayers.Door"]
- state: paper
sprite: Structures/Storage/Crates/labels.rsi
offset: "0.0,0.125"
map: ["enum.PaperLabelVisuals.Layer"]
- type: Icon
sprite: Structures/Storage/Crates/cage.rsi
- type: Destructible
@@ -424,6 +435,10 @@
- state: welded
visible: false
map: ["enum.WeldableLayers.BaseWelded"]
- state: paper
sprite: Structures/Storage/Crates/labels.rsi
offset: "0.0,-0.09375"
map: ["enum.PaperLabelVisuals.Layer"]
- type: Icon
sprite: Structures/Storage/Crates/piratechest.rsi
state: crate_icon
@@ -449,6 +464,8 @@
- state: welded
visible: false
map: ["enum.WeldableLayers.BaseWelded"]
- state: paper
map: ["enum.PaperLabelVisuals.Layer"]
- type: Icon
sprite: Structures/Storage/Crates/toybox.rsi
state: crate_icon
@@ -465,6 +482,8 @@
- state: base
- state: closed
map: ["enum.StorageVisualLayers.Door"]
- state: paper
map: ["enum.PaperLabelVisuals.Layer"]
- type: Icon
sprite: Structures/Storage/Crates/coffin.rsi
state: base
@@ -503,6 +522,10 @@
- state: base
- state: closed
map: ["enum.StorageVisualLayers.Door"]
- state: paper
sprite: Structures/Storage/Crates/labels.rsi
offset: "-0.28125,0.625"
map: ["enum.PaperLabelVisuals.Layer"]
- type: Icon
sprite: Structures/Storage/Crates/wooden_grave.rsi
state: base
@@ -547,6 +570,10 @@
- state: base
- state: closed
map: ["enum.StorageVisualLayers.Door"]
- state: paper
sprite: Structures/Storage/Crates/labels.rsi
offset: "-0.3125,0.5625"
map: ["enum.PaperLabelVisuals.Layer"]
- type: Icon
sprite: Structures/Storage/Crates/stone_grave.rsi
state: base
@@ -571,6 +598,17 @@
sprite: Structures/Storage/Crates/trashcart.rsi
- type: Sprite
sprite: Structures/Storage/Crates/trashcart.rsi
layers:
- state: base
- state: closed
map: ["enum.StorageVisualLayers.Door"]
- state: welded
visible: false
map: ["enum.WeldableLayers.BaseWelded"]
- state: paper
sprite: Structures/Storage/Crates/labels.rsi
offset: "0.0,0.03125"
map: ["enum.PaperLabelVisuals.Layer"]
- type: entity
parent: CrateBaseSecure
@@ -581,6 +619,20 @@
sprite: Structures/Storage/Crates/trashcart_jani.rsi
- type: Sprite
sprite: Structures/Storage/Crates/trashcart_jani.rsi
layers:
- state: base
- state: closed
map: ["enum.StorageVisualLayers.Door"]
- state: welded
visible: false
map: ["enum.WeldableLayers.BaseWelded"]
- state: locked
map: ["enum.LockVisualLayers.Lock"]
shader: unshaded
- state: paper
sprite: Structures/Storage/Crates/labels.rsi
offset: "0.0,0.03125"
map: ["enum.PaperLabelVisuals.Layer"]
- type: AccessReader
access: [["Janitor"]]

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

View File

@@ -1,7 +1,7 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from tgstation at https://github.com/tgstation/tgstation/commit/39659000f380583c35fb814ee2fadab24c2f8076",
"copyright": "Taken from tgstation at https://github.com/tgstation/tgstation/commit/39659000f380583c35fb814ee2fadab24c2f8076, additional label sprites by Vermidia",
"size": {
"x": 32,
"y": 32
@@ -14,10 +14,19 @@
"name": "bag_folded"
},
{
"name": "label_overlay"
"name": "paper"
},
{
"name": "open_overlay"
},
{
"name": "bounty"
},
{
"name": "captains_paper"
},
{
"name": "invoice"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 609 B

View File

@@ -5,7 +5,7 @@
"y": 32
},
"license": "CC-BY-SA-3.0",
"copyright": "Taken from baystation at commit https://github.com/Baystation12/Baystation12/commit/a929584d9db319eb7484113221be25cfa1d5dc09",
"copyright": "Taken from baystation at commit https://github.com/Baystation12/Baystation12/commit/a929584d9db319eb7484113221be25cfa1d5dc09. Label sprites by Vermidia.",
"states": [
{
"name": "artifact_container"
@@ -27,6 +27,18 @@
},
{
"name": "welded"
},
{
"name": "paper"
},
{
"name": "bounty"
},
{
"name": "captains_paper"
},
{
"name": "invoice"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 610 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 543 B

View File

@@ -1,7 +1,7 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Taken from tgstation at commit https://github.com/tgstation/tgstation/commit/32c8d0abc573d7370eb145d8ce74176d59b7eea3",
"copyright": "Taken from tgstation at commit https://github.com/tgstation/tgstation/commit/32c8d0abc573d7370eb145d8ce74176d59b7eea3. Label sprites by Vermidia.",
"size": {
"x": 32,
"y": 32
@@ -15,6 +15,18 @@
},
{
"name": "closed"
},
{
"name": "paper"
},
{
"name": "bounty"
},
{
"name": "captains_paper"
},
{
"name": "invoice"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 594 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

View File

@@ -0,0 +1,23 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Sprites by Vermidia.",
"size": {
"x": 32,
"y": 32
},
"states": [
{
"name": "paper"
},
{
"name": "bounty"
},
{
"name": "captains_paper"
},
{
"name": "invoice"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B

View File

@@ -1,7 +1,7 @@
{
"version": 1,
"license": "CC-BY-SA-3.0",
"copyright": "Made by brainfood118 (github) for ss14",
"copyright": "Made by brainfood118 (github) for ss14. Label Sprites by Vermidia.",
"size": {
"x": 32,
"y": 32
@@ -35,6 +35,18 @@
},
{
"name": "crate_open"
},
{
"name": "paper"
},
{
"name": "bounty"
},
{
"name": "captains_paper"
},
{
"name": "invoice"
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B