Blood-Red Magboots now correctly show if magboots are active (#38013)

* Change JetPack Item Visuals to use GenericVisualizer instead of AppearanceChangeEvents

* Fix YAML indentation for jetpacks.yml
This commit is contained in:
Funce
2025-06-04 23:10:06 +12:00
committed by GitHub
parent 146ba7edbb
commit 148fb5ca23
3 changed files with 38 additions and 33 deletions

View File

@@ -34,10 +34,6 @@ public sealed class JetpackSystem : SharedJetpackSystem
{ {
Appearance.TryGetData<bool>(uid, JetpackVisuals.Enabled, out var enabled, args.Component); Appearance.TryGetData<bool>(uid, JetpackVisuals.Enabled, out var enabled, args.Component);
var state = "icon" + (enabled ? "-on" : "");
if (args.Sprite != null)
_sprite.LayerSetRsiState((uid, args.Sprite), 0, state);
if (TryComp<ClothingComponent>(uid, out var clothing)) if (TryComp<ClothingComponent>(uid, out var clothing))
_clothing.SetEquippedPrefix(uid, enabled ? "on" : null, clothing); _clothing.SetEquippedPrefix(uid, enabled ? "on" : null, clothing);
} }

View File

@@ -202,4 +202,5 @@ public abstract class SharedJetpackSystem : EntitySystem
public enum JetpackVisuals : byte public enum JetpackVisuals : byte
{ {
Enabled, Enabled,
Layer
} }

View File

@@ -25,35 +25,43 @@
name: jetpack name: jetpack
description: It's a jetpack. It can hold 5 L of gas. description: It's a jetpack. It can hold 5 L of gas.
components: components:
- type: Sprite - type: Sprite
sprite: Objects/Tanks/Jetpacks/blue.rsi sprite: Objects/Tanks/Jetpacks/blue.rsi
state: icon layers:
- type: Item - state: icon
sprite: Objects/Tanks/Jetpacks/blue.rsi map: ["enum.JetpackVisuals.Layer"]
size: Huge - type: Item
- type: UserInterface sprite: Objects/Tanks/Jetpacks/blue.rsi
interfaces: size: Huge
enum.SharedGasTankUiKey.Key: - type: UserInterface
type: GasTankBoundUserInterface interfaces:
- type: UseDelay enum.SharedGasTankUiKey.Key:
delays: type: GasTankBoundUserInterface
gasTank: - type: UseDelay
length: 1.0 delays:
- type: Clothing gasTank:
sprite: Objects/Tanks/Jetpacks/blue.rsi length: 1.0
quickEquip: false - type: Clothing
slots: sprite: Objects/Tanks/Jetpacks/blue.rsi
- Back quickEquip: false
- type: GasTank slots:
outputPressure: 21.3 - Back
air: - type: GasTank
volume: 5 outputPressure: 21.3
temperature: 293.15 air:
- type: Jetpack volume: 5
moleUsage: 0.00085 temperature: 293.15
- type: Appearance - type: Jetpack
- type: StaticPrice moleUsage: 0.00085
price: 100 - type: Appearance
- type: GenericVisualizer
visuals:
enum.JetpackVisuals.Enabled:
enum.JetpackVisuals.Layer:
True: {state: icon-on}
False: {state: icon}
- type: StaticPrice
price: 100
- type: entity - type: entity
parent: BaseAction parent: BaseAction