Stacked sprite visualizer (#3096)

* Add Stack Visualizer

* Add cigarette pack resources

Adds transparent layers for visualizing cigarettes

* Add Bag Open/Close Visualizer

So storage opened in inventory can have different icons when opened
or closed.

* Create a component that only enumerates single item

Used for creating stuff like matchbox, or cigarettes. As a bonus.
It will only update stack visualizer for that particullar item.

* Refactoring stuff

* Fix other usage of stack in Resources

* Add docs

* Apply suggestions from code review

Apply metalgearsloth suggestions

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>

* Applied suggestions from metalgearsloth

* Changed SingleItemStorageComponent to StorageCounterComponent

Difference. New component doesn't spawn items, merely counts them.

* Refactored StackVisualizer

* Fix breakage with master

* Update Resources/Prototypes/Entities/Objects/Consumable/fancy.yml

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>

* Update with MGS suggestions

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Ygg01
2021-02-17 14:02:36 +01:00
committed by GitHub
parent 83f102ea75
commit 55d65889ae
20 changed files with 655 additions and 134 deletions

View File

@@ -1,4 +1,6 @@
- type: entity
- type: Tag
id: Cigarette
- type: entity
name: "Base Cigarette"
id: BaseCigarette
parent: BaseItem
@@ -13,6 +15,9 @@
Slots: [ mask ]
HeldPrefix: unlit
size: 1
- type: Tag
tags:
- Cigarette
- type: Smoking
duration: 30
- type: Appearance
@@ -33,10 +38,25 @@
components:
- type: Sprite
sprite: Objects/Consumable/Fancy/cigarettes.rsi
netsync: false
layers:
- state: cig
- type: StorageFill
contents:
- name: Cigarette
amount: 6
- type: StorageCounter
countTag: Cigarette
- type: Appearance
visuals:
- type: BagOpenCloseVisualizer
openIcon: cig_open
- type: StackVisualizer
composite: true
stackLayers:
- cigarette_1
- cigarette_2
- cigarette_3
- cigarette_4
- cigarette_5
- cigarette_6

View File

@@ -4,9 +4,9 @@
abstract: true
parent: BaseItem
components:
- type: Stack
- type: Material
- type: ItemStatus
- type: Stack
- type: Material
- type: ItemStatus
- type: entity
name: steel sheet
@@ -14,21 +14,21 @@
parent: MaterialStack
suffix: Full
components:
- type: Material
materials:
- key: enum.MaterialKeys.Stack
mat: steel
- type: Stack
stacktype: enum.StackType.Metal
- type: Sprite
sprite: Objects/Materials/sheets.rsi
state: metal
- type: Item
sprite: Objects/Materials/sheets.rsi
HeldPrefix: metal
- type: FloorTile
outputs:
- underplating
- type: Material
materials:
- key: enum.MaterialKeys.Stack
mat: steel
- type: Stack
stacktype: enum.StackType.Metal
- type: Sprite
sprite: Objects/Materials/sheets.rsi
state: metal
- type: Item
sprite: Objects/Materials/sheets.rsi
HeldPrefix: metal
- type: FloorTile
outputs:
- underplating
- type: entity
id: SteelSheet1
@@ -36,9 +36,9 @@
parent: MetalStack
suffix: 1
components:
- type: Stack
stacktype: enum.StackType.Metal
count: 1
- type: Stack
stacktype: enum.StackType.Metal
count: 1
- type: entity
name: glass sheet
@@ -46,18 +46,18 @@
parent: MaterialStack
suffix: Full
components:
- type: Material
materials:
- key: enum.MaterialKeys.Stack
mat: glass
- type: Stack
stacktype: enum.StackType.Glass
- type: Sprite
sprite: Objects/Materials/sheets.rsi
state: glass
- type: Item
sprite: Objects/Materials/sheets.rsi
HeldPrefix: glass
- type: Material
materials:
- key: enum.MaterialKeys.Stack
mat: glass
- type: Stack
stacktype: enum.StackType.Glass
- type: Sprite
sprite: Objects/Materials/sheets.rsi
state: glass
- type: Item
sprite: Objects/Materials/sheets.rsi
HeldPrefix: glass
- type: entity
id: GlassSheet1
@@ -65,9 +65,9 @@
parent: GlassStack
suffix: 1
components:
- type: Stack
stacktype: enum.StackType.Glass
count: 1
- type: Stack
stacktype: enum.StackType.Glass
count: 1
- type: entity
name: Reinforced Glass
@@ -94,9 +94,9 @@
parent: rglass
suffix: 1
components:
- type: Stack
StackType: enum.StackType.ReinforcedGlass
count: 1
- type: Stack
StackType: enum.StackType.ReinforcedGlass
count: 1
- type: entity
@@ -134,15 +134,23 @@
parent: MaterialStack
suffix: Full
components:
- type: Material
materials:
- key: enum.MaterialKeys.Stack
mat: gold
- type: Stack
stacktype: enum.StackType.Gold
- type: Sprite
sprite: Objects/Materials/materials.rsi
state: goldbar_30
- type: Material
materials:
- key: enum.MaterialKeys.Stack
mat: gold
- type: Stack
stacktype: enum.StackType.Gold
- type: Sprite
sprite: Objects/Materials/materials.rsi
state: goldbar_30
netsync: false
- type: Appearance
visuals:
- type: StackVisualizer
stackLayers:
- goldbar_10
- goldbar_20
- goldbar_30
- type: entity
id: GoldStack1
@@ -150,11 +158,11 @@
parent: GoldStack
suffix: 1
components:
- type: Sprite
sprite: Objects/Materials/materials.rsi
state: goldbar_10
- type: Stack
count: 1
- type: Sprite
sprite: Objects/Materials/materials.rsi
state: goldbar_10
- type: Stack
count: 1
- type: entity
name: plasma ore

View File

@@ -1,4 +1,3 @@
# If you're looking at the rsi for this file, you'll probably be confused why
# I didn't just use an alpha for most of this stuff. Well icons don't have the
# ability to have applied colors yet in GUIs. -Swept
@@ -10,14 +9,16 @@
name: cable stack
suffix: Full
components:
- type: Stack
stacktype: enum.StackType.Cable
- type: Sprite
sprite: Objects/Tools/cables.rsi
- type: Item
sprite: Objects/Tools/cables.rsi
- type: WirePlacer
- type: Clickable
- type: Stack
stacktype: enum.StackType.Cable
- type: Sprite
sprite: Objects/Tools/cables.rsi
netsync: false
- type: Item
sprite: Objects/Tools/cables.rsi
- type: WirePlacer
- type: Clickable
- type: entity
id: HVWireStack
@@ -25,16 +26,23 @@
name: HV cable coil
suffix: Full
components:
- type: Stack
stacktype: enum.StackType.HVCable
- type: Sprite
state: coilhv-30
- type: Item
size: 10
HeldPrefix: coilhv
- type: WirePlacer
wirePrototypeID: HVWire
blockingWireType: HighVoltage
- type: Stack
stacktype: enum.StackType.HVCable
- type: Sprite
state: coilhv-30
- type: Item
size: 10
HeldPrefix: coilhv
- type: WirePlacer
wirePrototypeID: HVWire
blockingWireType: HighVoltage
- type: Appearance
visuals:
- type: StackVisualizer
stackLayers:
- coilhv-10
- coilhv-20
- coilhv-30
- type: entity
parent: HVWireStack
@@ -42,7 +50,7 @@
suffix: 1
components:
- type: Sprite
state: coilhv-10
state: coilhv-10
- type: Item
size: 3
- type: Stack
@@ -55,14 +63,21 @@
description: Low-Voltage stack of wires for connecting APCs to machines and other purposes.
suffix: Full
components:
- type: Sprite
state: coillv-30
- type: Item
size: 10
HeldPrefix: coillv
- type: WirePlacer
wirePrototypeID: ApcExtensionCable
blockingWireType: Apc
- type: Sprite
state: coillv-30
- type: Item
size: 10
HeldPrefix: coillv
- type: WirePlacer
wirePrototypeID: ApcExtensionCable
blockingWireType: Apc
- type: Appearance
visuals:
- type: StackVisualizer
stackLayers:
- coillv-10
- coillv-20
- coillv-30
- type: entity
parent: ApcExtensionCableStack
@@ -92,6 +107,13 @@
- type: WirePlacer
wirePrototypeID: MVWire
blockingWireType: MediumVoltage
- type: Appearance
visuals:
- type: StackVisualizer
stackLayers:
- coilmv-10
- coilmv-20
- coilmv-30
- type: entity
parent: MVWireStack

Binary file not shown.

After

Width:  |  Height:  |  Size: 117 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

View File

@@ -15,6 +15,24 @@
},
{
"name": "cig_open"
},
{
"name": "cigarette_1"
},
{
"name": "cigarette_2"
},
{
"name": "cigarette_3"
},
{
"name": "cigarette_4"
},
{
"name": "cigarette_5"
},
{
"name": "cigarette_6"
}
]
}