diff --git a/Content.Client/Light/HandheldLightSystem.cs b/Content.Client/Light/HandheldLightSystem.cs index d25b28756f..2a5aa949ff 100644 --- a/Content.Client/Light/HandheldLightSystem.cs +++ b/Content.Client/Light/HandheldLightSystem.cs @@ -44,7 +44,7 @@ public sealed class HandheldLightSystem : SharedHandheldLightSystem return; } - if (!_appearance.TryGetData(uid, ToggleableLightVisuals.Enabled, out var enabled, args.Component)) + if (!_appearance.TryGetData(uid, ToggleableVisuals.Enabled, out var enabled, args.Component)) { return; } diff --git a/Content.Client/Toggleable/ToggleableLightVisualsComponent.cs b/Content.Client/Toggleable/ToggleableLightVisualsComponent.cs deleted file mode 100644 index c42d5a7faa..0000000000 --- a/Content.Client/Toggleable/ToggleableLightVisualsComponent.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Content.Shared.Hands.Components; - -namespace Content.Client.Toggleable; - -/// -/// Component that handles the toggling the visuals of some light emitting entity. -/// -/// -/// This will toggle the visibility of layers on an entity's sprite, the in-hand visuals, and the clothing/equipment -/// visuals. This will modify the color of any attached point lights. -/// -[RegisterComponent] -public sealed partial class ToggleableLightVisualsComponent : Component -{ - /// - /// Sprite layer that will have its visibility toggled when this item is toggled. - /// - [DataField("spriteLayer")] - public string? SpriteLayer = "light"; - - /// - /// Layers to add to the sprite of the player that is holding this entity (while the component is toggled on). - /// - [DataField("inhandVisuals")] - public Dictionary> InhandVisuals = new(); - - /// - /// Layers to add to the sprite of the player that is wearing this entity (while the component is toggled on). - /// - [DataField("clothingVisuals")] - public Dictionary> ClothingVisuals = new(); -} diff --git a/Content.Client/Toggleable/ToggleableLightVisualsSystem.cs b/Content.Client/Toggleable/ToggleableLightVisualsSystem.cs deleted file mode 100644 index ce940225bf..0000000000 --- a/Content.Client/Toggleable/ToggleableLightVisualsSystem.cs +++ /dev/null @@ -1,126 +0,0 @@ -using Content.Client.Clothing; -using Content.Client.Items.Systems; -using Content.Shared.Clothing; -using Content.Shared.Hands; -using Content.Shared.Inventory; -using Content.Shared.Item; -using Content.Shared.Toggleable; -using Robust.Client.GameObjects; -using Robust.Shared.Utility; -using System.Linq; - -namespace Content.Client.Toggleable; - -public sealed class ToggleableLightVisualsSystem : VisualizerSystem -{ - [Dependency] private readonly SharedItemSystem _itemSys = default!; - [Dependency] private readonly SharedPointLightSystem _lights = default!; - - public override void Initialize() - { - base.Initialize(); - SubscribeLocalEvent(OnGetHeldVisuals, after: new[] { typeof(ItemSystem) }); - SubscribeLocalEvent(OnGetEquipmentVisuals, after: new[] { typeof(ClientClothingSystem) }); - } - - protected override void OnAppearanceChange(EntityUid uid, ToggleableLightVisualsComponent component, ref AppearanceChangeEvent args) - { - if (!AppearanceSystem.TryGetData(uid, ToggleableLightVisuals.Enabled, out var enabled, args.Component)) - return; - - var modulate = AppearanceSystem.TryGetData(uid, ToggleableLightVisuals.Color, out var color, args.Component); - - // Update the item's sprite - if (args.Sprite != null && component.SpriteLayer != null && SpriteSystem.LayerMapTryGet((uid, args.Sprite), component.SpriteLayer, out var layer, false)) - { - SpriteSystem.LayerSetVisible((uid, args.Sprite), layer, enabled); - if (modulate) - SpriteSystem.LayerSetColor((uid, args.Sprite), layer, color); - } - - // Update any point-lights - if (TryComp(uid, out PointLightComponent? light)) - { - DebugTools.Assert(!light.NetSyncEnabled, "light visualizers require point lights without net-sync"); - _lights.SetEnabled(uid, enabled, light); - if (enabled && modulate) - { - _lights.SetColor(uid, color, light); - } - } - - // update clothing & in-hand visuals. - _itemSys.VisualsChanged(uid); - } - - /// - /// Add the unshaded light overlays to any clothing sprites. - /// - private void OnGetEquipmentVisuals(EntityUid uid, ToggleableLightVisualsComponent component, GetEquipmentVisualsEvent args) - { - if (!TryComp(uid, out AppearanceComponent? appearance) - || !AppearanceSystem.TryGetData(uid, ToggleableLightVisuals.Enabled, out var enabled, appearance) - || !enabled) - return; - - if (!TryComp(args.Equipee, out InventoryComponent? inventory)) - return; - List? layers = null; - - // attempt to get species specific data - if (inventory.SpeciesId != null) - component.ClothingVisuals.TryGetValue($"{args.Slot}-{inventory.SpeciesId}", out layers); - - // No species specific data. Try to default to generic data. - if (layers == null && !component.ClothingVisuals.TryGetValue(args.Slot, out layers)) - return; - - var modulate = AppearanceSystem.TryGetData(uid, ToggleableLightVisuals.Color, out var color, appearance); - - var i = 0; - foreach (var layer in layers) - { - var key = layer.MapKeys?.FirstOrDefault(); - if (key == null) - { - key = i == 0 ? $"{args.Slot}-toggle" : $"{args.Slot}-toggle-{i}"; - i++; - } - - if (modulate) - layer.Color = color; - - args.Layers.Add((key, layer)); - } - } - - private void OnGetHeldVisuals(EntityUid uid, ToggleableLightVisualsComponent component, GetInhandVisualsEvent args) - { - if (!TryComp(uid, out AppearanceComponent? appearance) - || !AppearanceSystem.TryGetData(uid, ToggleableLightVisuals.Enabled, out var enabled, appearance) - || !enabled) - return; - - if (!component.InhandVisuals.TryGetValue(args.Location, out var layers)) - return; - - var modulate = AppearanceSystem.TryGetData(uid, ToggleableLightVisuals.Color, out var color, appearance); - - var i = 0; - var defaultKey = $"inhand-{args.Location.ToString().ToLowerInvariant()}-toggle"; - foreach (var layer in layers) - { - var key = layer.MapKeys?.FirstOrDefault(); - if (key == null) - { - key = i == 0 ? defaultKey : $"{defaultKey}-{i}"; - i++; - } - - if (modulate) - layer.Color = color; - - args.Layers.Add((key, layer)); - } - } -} diff --git a/Content.Client/Toggleable/ToggleableVisualsComponent.cs b/Content.Client/Toggleable/ToggleableVisualsComponent.cs new file mode 100644 index 0000000000..cab8650466 --- /dev/null +++ b/Content.Client/Toggleable/ToggleableVisualsComponent.cs @@ -0,0 +1,30 @@ +using Content.Shared.Hands.Components; + +namespace Content.Client.Toggleable; + +/// +/// Component that handles toggling the visuals of an entity, including layers on an entity's sprite, +/// the in-hand visuals, and the clothing/equipment visuals. +/// +/// +[RegisterComponent] +public sealed partial class ToggleableVisualsComponent : Component +{ + /// + /// Sprite layer that will have its visibility toggled when this item is toggled. + /// + [DataField(required: true)] + public string? SpriteLayer; + + /// + /// Layers to add to the sprite of the player that is holding this entity (while the component is toggled on). + /// + [DataField] + public Dictionary> InhandVisuals = new(); + + /// + /// Layers to add to the sprite of the player that is wearing this entity (while the component is toggled on). + /// + [DataField] + public Dictionary> ClothingVisuals = new(); +} diff --git a/Content.Client/Toggleable/ToggleableVisualsSystem.cs b/Content.Client/Toggleable/ToggleableVisualsSystem.cs new file mode 100644 index 0000000000..3aacd9a4fa --- /dev/null +++ b/Content.Client/Toggleable/ToggleableVisualsSystem.cs @@ -0,0 +1,140 @@ +using System.Linq; +using Content.Client.Clothing; +using Content.Client.Items.Systems; +using Content.Shared.Clothing; +using Content.Shared.Hands; +using Content.Shared.Inventory; +using Content.Shared.Item; +using Content.Shared.Light.Components; +using Content.Shared.Toggleable; +using Robust.Client.GameObjects; +using Robust.Shared.Utility; + +namespace Content.Client.Toggleable; + +/// +/// Implements the behavior of by reacting to +/// , for the sprite directly; for the +/// in-hand visuals; and for the clothing visuals. +/// +/// +public sealed class ToggleableVisualsSystem : VisualizerSystem +{ + [Dependency] private readonly SharedItemSystem _item = default!; + [Dependency] private readonly SharedPointLightSystem _pointLight = default!; + + public override void Initialize() + { + base.Initialize(); + SubscribeLocalEvent(OnGetHeldVisuals, + after: [typeof(ItemSystem)]); + SubscribeLocalEvent(OnGetEquipmentVisuals, + after: [typeof(ClientClothingSystem)]); + } + + protected override void OnAppearanceChange(EntityUid uid, + ToggleableVisualsComponent component, + ref AppearanceChangeEvent args) + { + if (!AppearanceSystem.TryGetData(uid, ToggleableVisuals.Enabled, out var enabled, args.Component)) + return; + + var modulateColor = + AppearanceSystem.TryGetData(uid, ToggleableVisuals.Color, out var color, args.Component); + + // Update the item's sprite + if (args.Sprite != null && component.SpriteLayer != null && + SpriteSystem.LayerMapTryGet((uid, args.Sprite), component.SpriteLayer, out var layer, false)) + { + SpriteSystem.LayerSetVisible((uid, args.Sprite), layer, enabled); + if (modulateColor) + SpriteSystem.LayerSetColor((uid, args.Sprite), component.SpriteLayer, color); + } + + // If there's a `ItemTogglePointLightComponent` that says to apply the color to attached lights, do so. + if (TryComp(uid, out var toggleLights) && + TryComp(uid, out PointLightComponent? light)) + { + DebugTools.Assert(!light.NetSyncEnabled, + $"{typeof(ItemTogglePointLightComponent)} requires point lights without net-sync"); + _pointLight.SetEnabled(uid, enabled, light); + if (modulateColor && toggleLights.ToggleableVisualsColorModulatesLights) + { + _pointLight.SetColor(uid, color, light); + } + } + + // update clothing & in-hand visuals. + _item.VisualsChanged(uid); + } + + private void OnGetEquipmentVisuals(EntityUid uid, + ToggleableVisualsComponent component, + GetEquipmentVisualsEvent args) + { + if (!TryComp(uid, out AppearanceComponent? appearance) + || !AppearanceSystem.TryGetData(uid, ToggleableVisuals.Enabled, out var enabled, appearance) + || !enabled) + return; + + if (!TryComp(args.Equipee, out InventoryComponent? inventory)) + return; + List? layers = null; + + // attempt to get species specific data + if (inventory.SpeciesId != null) + component.ClothingVisuals.TryGetValue($"{args.Slot}-{inventory.SpeciesId}", out layers); + + // No species specific data. Try to default to generic data. + if (layers == null && !component.ClothingVisuals.TryGetValue(args.Slot, out layers)) + return; + + var modulateColor = AppearanceSystem.TryGetData(uid, ToggleableVisuals.Color, out var color, appearance); + + var i = 0; + foreach (var layer in layers) + { + var key = layer.MapKeys?.FirstOrDefault(); + if (key == null) + { + key = i == 0 ? $"{args.Slot}-toggle" : $"{args.Slot}-toggle-{i}"; + i++; + } + + if (modulateColor) + layer.Color = color; + + args.Layers.Add((key, layer)); + } + } + + private void OnGetHeldVisuals(EntityUid uid, ToggleableVisualsComponent component, GetInhandVisualsEvent args) + { + if (!TryComp(uid, out AppearanceComponent? appearance) + || !AppearanceSystem.TryGetData(uid, ToggleableVisuals.Enabled, out var enabled, appearance) + || !enabled) + return; + + if (!component.InhandVisuals.TryGetValue(args.Location, out var layers)) + return; + + var modulateColor = AppearanceSystem.TryGetData(uid, ToggleableVisuals.Color, out var color, appearance); + + var i = 0; + var defaultKey = $"inhand-{args.Location.ToString().ToLowerInvariant()}-toggle"; + foreach (var layer in layers) + { + var key = layer.MapKeys?.FirstOrDefault(); + if (key == null) + { + key = i == 0 ? defaultKey : $"{defaultKey}-{i}"; + i++; + } + + if (modulateColor) + layer.Color = color; + + args.Layers.Add((key, layer)); + } + } +} diff --git a/Content.Server/Atmos/EntitySystems/FlammableSystem.cs b/Content.Server/Atmos/EntitySystems/FlammableSystem.cs index 8681fc635c..0cb40627ab 100644 --- a/Content.Server/Atmos/EntitySystems/FlammableSystem.cs +++ b/Content.Server/Atmos/EntitySystems/FlammableSystem.cs @@ -282,7 +282,7 @@ namespace Content.Server.Atmos.EntitySystems // This is intended so that matches & candles can re-use code for un-shaded layers on in-hand sprites. // However, this could cause conflicts if something is ACTUALLY both a toggleable light and flammable. // if that ever happens, then fire visuals will need to implement their own in-hand sprite management. - _appearance.SetData(uid, ToggleableLightVisuals.Enabled, flammable.OnFire, appearance); + _appearance.SetData(uid, ToggleableVisuals.Enabled, flammable.OnFire, appearance); } public void AdjustFireStacks(EntityUid uid, float relativeFireStacks, FlammableComponent? flammable = null, bool ignite = false) diff --git a/Content.Shared/ContainerHeld/ContainerHeldComponent.cs b/Content.Shared/ContainerHeld/ContainerHeldComponent.cs index 3d7643b42c..e9b19d8262 100644 --- a/Content.Shared/ContainerHeld/ContainerHeldComponent.cs +++ b/Content.Shared/ContainerHeld/ContainerHeldComponent.cs @@ -8,7 +8,7 @@ public sealed partial class ContainerHeldComponent: Component /// /// The amount of weight needed to be in the container /// in order for it to toggle it's appearance - /// to ToggleVisuals.Toggled = true, and + /// to ToggleableVisuals.Enabled = true, and /// SetHeldPrefix() to "full" instead of "empty". /// [DataField("threshold")] diff --git a/Content.Shared/ContainerHeld/ContainerHeldSystem.cs b/Content.Shared/ContainerHeld/ContainerHeldSystem.cs index f2ce5b44a5..f09cd4443d 100644 --- a/Content.Shared/ContainerHeld/ContainerHeldSystem.cs +++ b/Content.Shared/ContainerHeld/ContainerHeldSystem.cs @@ -32,12 +32,12 @@ public sealed class ContainerHeldSystem : EntitySystem if (_storage.GetCumulativeItemAreas(uid) >= comp.Threshold) { _item.SetHeldPrefix(uid, "full", component: item); - _appearance.SetData(uid, ToggleVisuals.Toggled, true, appearance); + _appearance.SetData(uid, ToggleableVisuals.Enabled, true, appearance); } else { _item.SetHeldPrefix(uid, "empty", component: item); - _appearance.SetData(uid, ToggleVisuals.Toggled, false, appearance); + _appearance.SetData(uid, ToggleableVisuals.Enabled, false, appearance); } } } diff --git a/Content.Shared/Item/ItemToggle/ItemToggleSystem.cs b/Content.Shared/Item/ItemToggle/ItemToggleSystem.cs index 2c3e596a27..8008ecf9e5 100644 --- a/Content.Shared/Item/ItemToggle/ItemToggleSystem.cs +++ b/Content.Shared/Item/ItemToggle/ItemToggleSystem.cs @@ -282,7 +282,7 @@ public sealed class ItemToggleSystem : EntitySystem { if (TryComp(ent, out AppearanceComponent? appearance)) { - _appearance.SetData(ent, ToggleVisuals.Toggled, ent.Comp.Activated, appearance); + _appearance.SetData(ent, ToggleableVisuals.Enabled, ent.Comp.Activated, appearance); } } diff --git a/Content.Shared/Light/Components/ItemTogglePointLightComponent.cs b/Content.Shared/Light/Components/ItemTogglePointLightComponent.cs index 6ac1bf236d..5024a07f28 100644 --- a/Content.Shared/Light/Components/ItemTogglePointLightComponent.cs +++ b/Content.Shared/Light/Components/ItemTogglePointLightComponent.cs @@ -1,12 +1,18 @@ +using Content.Shared.Item.ItemToggle.Components; using Robust.Shared.GameStates; +using Content.Shared.Toggleable; namespace Content.Shared.Light.Components; /// -/// Toggles point light on an entity whenever ItemToggle hits. +/// Makes enable and disable point lights on this entity. /// [RegisterComponent, NetworkedComponent] public sealed partial class ItemTogglePointLightComponent : Component { - + /// + /// When true, causes the color specified in + /// be used to modulate the color of lights on this entity. + /// + [DataField] public bool ToggleableVisualsColorModulatesLights = false; } diff --git a/Content.Shared/Light/EntitySystems/ItemTogglePointLightSystem.cs b/Content.Shared/Light/EntitySystems/ItemTogglePointLightSystem.cs index e2ed6cfcc2..8a9995d74e 100644 --- a/Content.Shared/Light/EntitySystems/ItemTogglePointLightSystem.cs +++ b/Content.Shared/Light/EntitySystems/ItemTogglePointLightSystem.cs @@ -1,16 +1,15 @@ using Content.Shared.Item.ItemToggle.Components; using Content.Shared.Light.Components; -using Content.Shared.Toggleable; using ItemTogglePointLightComponent = Content.Shared.Light.Components.ItemTogglePointLightComponent; namespace Content.Shared.Light.EntitySystems; /// -/// Handles ItemToggle for PointLight +/// Implements the behavior of , causing s to +/// enable and disable lights on the entity. /// public sealed class ItemTogglePointLightSystem : EntitySystem { - [Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly SharedPointLightSystem _light = default!; [Dependency] private readonly SharedHandheldLightSystem _handheldLight = default!; @@ -25,7 +24,6 @@ public sealed class ItemTogglePointLightSystem : EntitySystem if (!_light.TryGetLight(ent.Owner, out var light)) return; - _appearance.SetData(ent, ToggleableLightVisuals.Enabled, args.Activated); _light.SetEnabled(ent.Owner, args.Activated, comp: light); if (TryComp(ent.Owner, out var handheldLight)) { diff --git a/Content.Shared/Light/SharedHandheldLightSystem.cs b/Content.Shared/Light/SharedHandheldLightSystem.cs index 74c809797b..e93ca0a041 100644 --- a/Content.Shared/Light/SharedHandheldLightSystem.cs +++ b/Content.Shared/Light/SharedHandheldLightSystem.cs @@ -80,7 +80,7 @@ public abstract class SharedHandheldLightSystem : EntitySystem if (component.ToggleActionEntity != null) _actionSystem.SetToggled(component.ToggleActionEntity, component.Activated); - _appearance.SetData(uid, ToggleableLightVisuals.Enabled, component.Activated, appearance); + _appearance.SetData(uid, ToggleableVisuals.Enabled, component.Activated, appearance); } private void AddToggleLightVerb(Entity ent, ref GetVerbsEvent args) diff --git a/Content.Shared/Toggleable/ToggleActionEvent.cs b/Content.Shared/Toggleable/ToggleActionEvent.cs index f28e62e7dd..74b900562b 100644 --- a/Content.Shared/Toggleable/ToggleActionEvent.cs +++ b/Content.Shared/Toggleable/ToggleActionEvent.cs @@ -15,8 +15,24 @@ public sealed partial class ToggleActionEvent : InstantActionEvent; /// Generic enum keys for toggle-visualizer appearance data & sprite layers. /// [Serializable, NetSerializable] -public enum ToggleVisuals : byte +public enum ToggleableVisuals : byte { - Toggled, - Layer + Enabled, + Layer, + Color, +} + +/// +/// Generic sprite layer keys. +/// +[Serializable, NetSerializable] +public enum LightLayers : byte +{ + Light, + + /// + /// Used as a key for generic unshaded layers. Not necessarily related to an entity with an actual light source. + /// Use this instead of creating a unique single-purpose "unshaded" enum for every visualizer. + /// + Unshaded, } diff --git a/Content.Shared/Toggleable/ToggleableLightVisuals.cs b/Content.Shared/Toggleable/ToggleableLightVisuals.cs deleted file mode 100644 index 72e8ed4926..0000000000 --- a/Content.Shared/Toggleable/ToggleableLightVisuals.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Robust.Shared.Serialization; - -namespace Content.Shared.Toggleable; - -// Appearance Data key -[Serializable, NetSerializable] -public enum ToggleableLightVisuals : byte -{ - Enabled, - Color -} - -/// -/// Generic sprite layer keys. -/// -[Serializable, NetSerializable] -public enum LightLayers : byte -{ - Light, - - /// - /// Used as a key for generic unshaded layers. Not necessarily related to an entity with an actual light source. - /// Use this instead of creating a unique single-purpose "unshaded" enum for every visualizer. - /// - Unshaded, -} diff --git a/Content.Shared/Weapons/Melee/EnergySword/EnergySwordSystem.cs b/Content.Shared/Weapons/Melee/EnergySword/EnergySwordSystem.cs index 7ca3de9cc5..f89ca2a28b 100644 --- a/Content.Shared/Weapons/Melee/EnergySword/EnergySwordSystem.cs +++ b/Content.Shared/Weapons/Melee/EnergySword/EnergySwordSystem.cs @@ -33,7 +33,7 @@ public sealed class EnergySwordSystem : EntitySystem if (!TryComp(entity, out AppearanceComponent? appearanceComponent)) return; - _appearance.SetData(entity, ToggleableLightVisuals.Color, entity.Comp.ActivatedColor, appearanceComponent); + _appearance.SetData(entity, ToggleableVisuals.Color, entity.Comp.ActivatedColor, appearanceComponent); } // Used to make the blade multicolored when using a multitool on it. diff --git a/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs b/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs index 3d7f9df458..f6702569bf 100644 --- a/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs +++ b/Content.Shared/Weapons/Misc/SharedTetherGunSystem.cs @@ -204,7 +204,7 @@ public abstract partial class SharedTetherGunSystem : EntitySystem TryComp(gunUid, out var appearance); _appearance.SetData(gunUid, TetherVisualsStatus.Key, true, appearance); - _appearance.SetData(gunUid, ToggleableLightVisuals.Enabled, true, appearance); + _appearance.SetData(gunUid, ToggleableVisuals.Enabled, true, appearance); // Target updates TransformSystem.Unanchor(target, targetXform); @@ -280,7 +280,7 @@ public abstract partial class SharedTetherGunSystem : EntitySystem TryComp(gunUid, out var appearance); _appearance.SetData(gunUid, TetherVisualsStatus.Key, false, appearance); - _appearance.SetData(gunUid, ToggleableLightVisuals.Enabled, false, appearance); + _appearance.SetData(gunUid, ToggleableVisuals.Enabled, false, appearance); RemComp(component.Tethered.Value); _blocker.UpdateCanMove(component.Tethered.Value); diff --git a/Resources/Prototypes/Entities/Clothing/Hands/gloves.yml b/Resources/Prototypes/Entities/Clothing/Hands/gloves.yml index dee1745e2e..9fd20a9791 100644 --- a/Resources/Prototypes/Entities/Clothing/Hands/gloves.yml +++ b/Resources/Prototypes/Entities/Clothing/Hands/gloves.yml @@ -216,14 +216,14 @@ sprite: Clothing/Hands/Gloves/spaceninja.rsi layers: - state: icon - map: [ "enum.ToggleVisuals.Layer" ] + map: [ "enum.ToggleableVisuals.Layer" ] - type: Clothing sprite: Clothing/Hands/Gloves/spaceninja.rsi - type: Appearance - type: GenericVisualizer visuals: - enum.ToggleVisuals.Toggled: - enum.ToggleVisuals.Layer: + enum.ToggleableVisuals.Enabled: + enum.ToggleableVisuals.Layer: True: {state: icon-green} False: {state: icon} - type: Insulated @@ -566,15 +566,15 @@ sprite: Clothing/Hands/Gloves/KnuckleDusters/electricknuckleduster.rsi layers: - state: knuckleduster_off - map: [ "enum.ToggleVisuals.Layer" ] + map: [ "enum.ToggleableVisuals.Layer" ] - type: Clothing sprite: Clothing/Hands/Gloves/KnuckleDusters/electricknuckleduster.rsi equippedPrefix: on - type: Appearance - type: GenericVisualizer visuals: - enum.ToggleVisuals.Toggled: - enum.ToggleVisuals.Layer: + enum.ToggleableVisuals.Enabled: + enum.ToggleableVisuals.Layer: True: {state: knuckleduster_on} False: {state: knuckleduster_off} - type: ToggleClothing diff --git a/Resources/Prototypes/Entities/Clothing/Head/base_clothinghead.yml b/Resources/Prototypes/Entities/Clothing/Head/base_clothinghead.yml index 1898bb0038..dac5a8946e 100644 --- a/Resources/Prototypes/Entities/Clothing/Head/base_clothinghead.yml +++ b/Resources/Prototypes/Entities/Clothing/Head/base_clothinghead.yml @@ -62,7 +62,9 @@ - type: Item heldPrefix: off size: Normal - - type: ToggleableLightVisuals + - type: ToggleableVisuals + spriteLayer: light + - type: ItemTogglePointLight - type: PointLight enabled: false radius: 3 @@ -207,7 +209,9 @@ map: [ "light" ] - type: Clothing equippedPrefix: off - - type: ToggleableLightVisuals + - type: ToggleableVisuals + spriteLayer: light + - type: ItemTogglePointLight - type: PointLight enabled: false radius: 3 diff --git a/Resources/Prototypes/Entities/Clothing/Head/eva-helmets.yml b/Resources/Prototypes/Entities/Clothing/Head/eva-helmets.yml index 3aec1f83c4..3920a8a7af 100644 --- a/Resources/Prototypes/Entities/Clothing/Head/eva-helmets.yml +++ b/Resources/Prototypes/Entities/Clothing/Head/eva-helmets.yml @@ -74,7 +74,7 @@ sprite: Clothing/Head/Hardsuits/paramedhelm.rsi - type: HandheldLight addPrefix: false - - type: ToggleableLightVisuals + - type: ToggleableVisuals spriteLayer: light clothingVisuals: head: diff --git a/Resources/Prototypes/Entities/Clothing/Head/hardhats.yml b/Resources/Prototypes/Entities/Clothing/Head/hardhats.yml index ea987ddda1..8809ad4c46 100644 --- a/Resources/Prototypes/Entities/Clothing/Head/hardhats.yml +++ b/Resources/Prototypes/Entities/Clothing/Head/hardhats.yml @@ -25,22 +25,22 @@ radiatingBehaviourId: radiating - type: LightBehaviour behaviours: - - !type:FadeBehaviour - id: radiating - interpolate: Linear - maxDuration: 2.0 - startValue: 3.0 - endValue: 2.0 - isLooped: true - reverseWhenFinished: true - - !type:PulseBehaviour - id: blinking - interpolate: Nearest - maxDuration: 1.0 - minValue: 0.1 - maxValue: 2.0 - isLooped: true - - type: ToggleableLightVisuals + - !type:FadeBehaviour + id: radiating + interpolate: Linear + maxDuration: 2.0 + startValue: 3.0 + endValue: 2.0 + isLooped: true + reverseWhenFinished: true + - !type:PulseBehaviour + id: blinking + interpolate: Nearest + maxDuration: 1.0 + minValue: 0.1 + maxValue: 2.0 + isLooped: true + - type: ToggleableVisuals spriteLayer: light inhandVisuals: left: @@ -50,6 +50,7 @@ clothingVisuals: head: - state: on-equipped-HELMET + - type: ItemTogglePointLight - type: PowerCellSlot cellSlotId: cell_slot - type: ItemSlots @@ -68,8 +69,8 @@ - type: HideLayerClothing layers: Hair: HEAD - HeadTop : HEAD - HeadSide : HEAD + HeadTop: HEAD + HeadSide: HEAD - type: entity parent: ClothingHeadHatHardhatBase diff --git a/Resources/Prototypes/Entities/Clothing/Head/hardsuit-helmets.yml b/Resources/Prototypes/Entities/Clothing/Head/hardsuit-helmets.yml index 7cd873643a..86a7286d89 100644 --- a/Resources/Prototypes/Entities/Clothing/Head/hardsuit-helmets.yml +++ b/Resources/Prototypes/Entities/Clothing/Head/hardsuit-helmets.yml @@ -24,7 +24,7 @@ map: [ "light" ] - type: HandheldLight addPrefix: false - - type: ToggleableLightVisuals + - type: ToggleableVisuals spriteLayer: light clothingVisuals: head: @@ -90,7 +90,7 @@ map: [ "light" ] - type: HandheldLight addPrefix: false - - type: ToggleableLightVisuals + - type: ToggleableVisuals clothingVisuals: head: - state: equipped-head-light @@ -150,7 +150,7 @@ map: [ "light" ] - type: HandheldLight addPrefix: false - - type: ToggleableLightVisuals + - type: ToggleableVisuals clothingVisuals: head: - state: equipped-head-light diff --git a/Resources/Prototypes/Entities/Clothing/Head/helmets.yml b/Resources/Prototypes/Entities/Clothing/Head/helmets.yml index 4c38dde0d7..520733220e 100644 --- a/Resources/Prototypes/Entities/Clothing/Head/helmets.yml +++ b/Resources/Prototypes/Entities/Clothing/Head/helmets.yml @@ -508,7 +508,8 @@ action: ActionToggleJusticeHelm mustEquip: false - type: ItemTogglePointLight - - type: ToggleableLightVisuals + - type: ToggleableVisuals + spriteLayer: light clothingVisuals: head: - state: on-equipped-HELMET diff --git a/Resources/Prototypes/Entities/Clothing/Neck/misc.yml b/Resources/Prototypes/Entities/Clothing/Neck/misc.yml index b25f78e6a4..c8892bc0b5 100644 --- a/Resources/Prototypes/Entities/Clothing/Neck/misc.yml +++ b/Resources/Prototypes/Entities/Clothing/Neck/misc.yml @@ -8,20 +8,20 @@ sprite: Clothing/Neck/Misc/headphones.rsi layers: - state: icon - map: [ "enum.ToggleVisuals.Layer" ] + map: [ "enum.ToggleableVisuals.Layer" ] - type: Clothing equippedPrefix: off sprite: Clothing/Neck/Misc/headphones.rsi - - type: ToggleableLightVisuals - spriteLayer: enum.ToggleVisuals.Layer + - type: ToggleableVisuals + spriteLayer: enum.ToggleableVisuals.Layer clothingVisuals: neck: - state: on-equipped-NECK - type: Appearance - type: GenericVisualizer visuals: - enum.ToggleVisuals.Toggled: - enum.ToggleVisuals.Layer: + enum.ToggleableVisuals.Enabled: + enum.ToggleableVisuals.Layer: True: {state: icon-on} False: {state: icon} - type: ItemToggle diff --git a/Resources/Prototypes/Entities/Clothing/OuterClothing/armor.yml b/Resources/Prototypes/Entities/Clothing/OuterClothing/armor.yml index 07bf9ad351..c029c62afc 100644 --- a/Resources/Prototypes/Entities/Clothing/OuterClothing/armor.yml +++ b/Resources/Prototypes/Entities/Clothing/OuterClothing/armor.yml @@ -243,7 +243,7 @@ walkModifier: 0.9 sprintModifier: 0.9 #Shoulder mounted flashlight - - type: ToggleableLightVisuals + - type: ToggleableVisuals spriteLayer: light clothingVisuals: outerClothing: @@ -252,6 +252,7 @@ outerClothing-vox: - state: equipped-OUTERCLOTHING-light-vox shader: unshaded + - type: ItemTogglePointLight - type: Appearance - type: HandheldLight addPrefix: false diff --git a/Resources/Prototypes/Entities/Clothing/Shoes/magboots.yml b/Resources/Prototypes/Entities/Clothing/Shoes/magboots.yml index ad88dd1ae2..1a8d7fcf40 100644 --- a/Resources/Prototypes/Entities/Clothing/Shoes/magboots.yml +++ b/Resources/Prototypes/Entities/Clothing/Shoes/magboots.yml @@ -9,7 +9,7 @@ sprite: Clothing/Shoes/Boots/magboots.rsi layers: - state: icon - map: [ "enum.ToggleVisuals.Layer" ] + map: [ "enum.ToggleableVisuals.Layer" ] - type: Clothing sprite: Clothing/Shoes/Boots/magboots.rsi - type: ToggleClothing @@ -29,8 +29,8 @@ - type: Appearance - type: GenericVisualizer visuals: - enum.ToggleVisuals.Toggled: - enum.ToggleVisuals.Layer: + enum.ToggleableVisuals.Enabled: + enum.ToggleableVisuals.Layer: True: {state: icon-on} False: {state: icon} - type: StaticPrice diff --git a/Resources/Prototypes/Entities/Clothing/Shoes/misc.yml b/Resources/Prototypes/Entities/Clothing/Shoes/misc.yml index fafb9a0846..5ba1a63ea5 100644 --- a/Resources/Prototypes/Entities/Clothing/Shoes/misc.yml +++ b/Resources/Prototypes/Entities/Clothing/Shoes/misc.yml @@ -127,7 +127,7 @@ sprite: Clothing/Shoes/Boots/speedboots.rsi layers: - state: icon - map: [ "enum.ToggleVisuals.Layer" ] + map: [ "enum.ToggleableVisuals.Layer" ] - type: Clothing sprite: Clothing/Shoes/Boots/speedboots.rsi - type: ToggleClothing @@ -138,8 +138,8 @@ - type: Appearance - type: GenericVisualizer visuals: - enum.ToggleVisuals.Toggled: - enum.ToggleVisuals.Layer: + enum.ToggleableVisuals.Enabled: + enum.ToggleableVisuals.Layer: True: {state: icon-on} False: {state: icon} - type: StaticPrice diff --git a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml index 68e5a802e2..d4182cd12f 100644 --- a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml +++ b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml @@ -220,7 +220,8 @@ minValue: 0.1 maxValue: 2.0 isLooped: true - - type: ToggleableLightVisuals + - type: ToggleableVisuals + spriteLayer: light - type: PointLight enabled: false mask: /Textures/Effects/LightMasks/cone.png diff --git a/Resources/Prototypes/Entities/Objects/Fun/candy_bucket.yml b/Resources/Prototypes/Entities/Objects/Fun/candy_bucket.yml index 63175dc89a..3efba15f93 100644 --- a/Resources/Prototypes/Entities/Objects/Fun/candy_bucket.yml +++ b/Resources/Prototypes/Entities/Objects/Fun/candy_bucket.yml @@ -8,7 +8,7 @@ sprite: Objects/Fun/candy_bucket.rsi layers: - state: empty_icon - map: [ "enum.ToggleVisuals.Layer" ] + map: [ "enum.ToggleableVisuals.Layer" ] - type: ContainerHeld threshold: 1 - type: Item @@ -17,8 +17,8 @@ - type: Appearance - type: GenericVisualizer visuals: - enum.ToggleVisuals.Toggled: - enum.ToggleVisuals.Layer: + enum.ToggleableVisuals.Enabled: + enum.ToggleableVisuals.Layer: True: {state: full_icon} False: {state: empty_icon} - type: Storage diff --git a/Resources/Prototypes/Entities/Objects/Fun/spectral_locator.yml b/Resources/Prototypes/Entities/Objects/Fun/spectral_locator.yml index 5bae35c4ac..194fd4d233 100644 --- a/Resources/Prototypes/Entities/Objects/Fun/spectral_locator.yml +++ b/Resources/Prototypes/Entities/Objects/Fun/spectral_locator.yml @@ -12,12 +12,12 @@ - state: screen shader: unshaded visible: false - map: ["enum.ToggleVisuals.Layer"] + map: ["enum.ToggleableVisuals.Layer"] - type: Appearance - type: GenericVisualizer visuals: - enum.ToggleVisuals.Toggled: - enum.ToggleVisuals.Layer: + enum.ToggleableVisuals.Enabled: + enum.ToggleableVisuals.Layer: True: { visible: true } False: { visible: false } - type: ItemToggle diff --git a/Resources/Prototypes/Entities/Objects/Fun/toys.yml b/Resources/Prototypes/Entities/Objects/Fun/toys.yml index ce57a8d933..1d92b2de94 100644 --- a/Resources/Prototypes/Entities/Objects/Fun/toys.yml +++ b/Resources/Prototypes/Entities/Objects/Fun/toys.yml @@ -1739,7 +1739,7 @@ color: white netsync: false - type: Appearance - - type: ToggleableLightVisuals + - type: ToggleableVisuals spriteLayer: blade inhandVisuals: left: @@ -2039,8 +2039,8 @@ - type: Appearance - type: GenericVisualizer visuals: - enum.ToggleVisuals.Toggled: - enum.ToggleVisuals.Layer: + enum.ToggleableVisuals.Enabled: + enum.ToggleableVisuals.Layer: True: { state: icon } False: { state: icon-off } - type: ItemToggle diff --git a/Resources/Prototypes/Entities/Objects/Misc/arabianlamp.yml b/Resources/Prototypes/Entities/Objects/Misc/arabianlamp.yml index 844db3f765..2b1c2940fe 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/arabianlamp.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/arabianlamp.yml @@ -70,18 +70,18 @@ - state: flame visible: false shader: unshaded - map: ["enum.ToggleVisuals.Layer"] + map: ["enum.ToggleableVisuals.Layer"] - type: GenericVisualizer visuals: - enum.ToggleVisuals.Toggled: - enum.ToggleVisuals.Layer: + enum.ToggleableVisuals.Enabled: + enum.ToggleableVisuals.Layer: True: { visible: true } False: { visible: false } - type: EntityStorageVisuals stateBaseClosed: lamp stateDoorOpen: lamp stateDoorClosed: lamptop - - type: ToggleableLightVisuals + - type: ToggleableVisuals spriteLayer: flame inhandVisuals: left: diff --git a/Resources/Prototypes/Entities/Objects/Misc/candles.yml b/Resources/Prototypes/Entities/Objects/Misc/candles.yml index 1220ea4051..f3167b1d99 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/candles.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/candles.yml @@ -41,7 +41,7 @@ - type: FireVisuals sprite: Objects/Misc/candles.rsi normalState: fire-big - - type: ToggleableLightVisuals + - type: ToggleableVisuals spriteLayer: null inhandVisuals: left: diff --git a/Resources/Prototypes/Entities/Objects/Misc/fire_extinguisher.yml b/Resources/Prototypes/Entities/Objects/Misc/fire_extinguisher.yml index 495443911f..5d4ca1a7ee 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/fire_extinguisher.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/fire_extinguisher.yml @@ -8,7 +8,7 @@ sprite: Objects/Misc/fire_extinguisher.rsi layers: - state: fire_extinguisher_closed - map: [ "enum.ToggleVisuals.Layer" ] + map: [ "enum.ToggleableVisuals.Layer" ] - type: Item sprite: Objects/Misc/fire_extinguisher.rsi size: Normal @@ -67,8 +67,8 @@ - FireExtinguisher - type: GenericVisualizer visuals: - enum.ToggleVisuals.Toggled: - enum.ToggleVisuals.Layer: + enum.ToggleableVisuals.Enabled: + enum.ToggleableVisuals.Layer: True: { state: fire_extinguisher_open } False: { state: fire_extinguisher_closed } - type: PhysicalComposition diff --git a/Resources/Prototypes/Entities/Objects/Misc/fluff_lights.yml b/Resources/Prototypes/Entities/Objects/Misc/fluff_lights.yml index 676b875039..e2a2000844 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/fluff_lights.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/fluff_lights.yml @@ -45,7 +45,9 @@ radius: 3 energy: 2 netsync: false - - type: ToggleableLightVisuals + - type: ToggleableVisuals + spriteLayer: light + - type: ItemTogglePointLight - type: Appearance - type: Physics canCollide: false diff --git a/Resources/Prototypes/Entities/Objects/Misc/land_mine.yml b/Resources/Prototypes/Entities/Objects/Misc/land_mine.yml index 08991ec11f..1252453019 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/land_mine.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/land_mine.yml @@ -28,12 +28,12 @@ sprite: Objects/Misc/landmine.rsi layers: - state: landmine-inactive - map: [ "enum.ToggleVisuals.Layer" ] + map: [ "enum.ToggleableVisuals.Layer" ] - type: Appearance - type: GenericVisualizer visuals: - enum.ToggleVisuals.Toggled: - enum.ToggleVisuals.Layer: + enum.ToggleableVisuals.Enabled: + enum.ToggleableVisuals.Layer: True: {state: landmine} False: {state: landmine-inactive} - type: Damageable diff --git a/Resources/Prototypes/Entities/Objects/Shields/shields.yml b/Resources/Prototypes/Entities/Objects/Shields/shields.yml index d1b0d9ca11..69da81853d 100644 --- a/Resources/Prototypes/Entities/Objects/Shields/shields.yml +++ b/Resources/Prototypes/Entities/Objects/Shields/shields.yml @@ -401,7 +401,7 @@ heldPrefix: eshield - type: UseDelay delay: 0.5 - - type: ToggleableLightVisuals + - type: ToggleableVisuals spriteLayer: shield inhandVisuals: left: @@ -513,7 +513,7 @@ heldPrefix: teleriot - type: UseDelay delay: 0.5 - - type: ToggleableLightVisuals + - type: ToggleableVisuals spriteLayer: shield inhandVisuals: left: diff --git a/Resources/Prototypes/Entities/Objects/Specific/Medical/defib.yml b/Resources/Prototypes/Entities/Objects/Specific/Medical/defib.yml index 83cbd86bdf..eb07b695aa 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Medical/defib.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Medical/defib.yml @@ -10,14 +10,14 @@ layers: - state: icon - state: screen - map: [ "enum.ToggleVisuals.Layer" ] + map: [ "enum.ToggleableVisuals.Layer" ] visible: false shader: unshaded - type: Appearance - type: GenericVisualizer visuals: - enum.ToggleVisuals.Toggled: - enum.ToggleVisuals.Layer: + enum.ToggleableVisuals.Enabled: + enum.ToggleableVisuals.Layer: True: { visible: true } False: { visible: false } - type: Item @@ -76,7 +76,7 @@ layers: - state: icon - state: screen - map: [ "enum.ToggleVisuals.Layer" ] + map: [ "enum.ToggleableVisuals.Layer" ] visible: false shader: unshaded - state: ready @@ -106,7 +106,7 @@ layers: - state: icon - state: screen - map: [ "enum.ToggleVisuals.Layer" ] + map: [ "enum.ToggleableVisuals.Layer" ] visible: false shader: unshaded - state: ready diff --git a/Resources/Prototypes/Entities/Objects/Specific/Research/anomaly.yml b/Resources/Prototypes/Entities/Objects/Specific/Research/anomaly.yml index 21971dda32..f3a82abd72 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Research/anomaly.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Research/anomaly.yml @@ -36,12 +36,12 @@ - state: screen shader: unshaded visible: false - map: ["enum.ToggleVisuals.Layer"] + map: ["enum.ToggleableVisuals.Layer"] - type: Appearance - type: GenericVisualizer visuals: - enum.ToggleVisuals.Toggled: - enum.ToggleVisuals.Layer: + enum.ToggleableVisuals.Enabled: + enum.ToggleableVisuals.Layer: True: { visible: true } False: { visible: false } - type: ItemToggle diff --git a/Resources/Prototypes/Entities/Objects/Specific/Salvage/scanner.yml b/Resources/Prototypes/Entities/Objects/Specific/Salvage/scanner.yml index c9248553bc..ac2c44ff2e 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Salvage/scanner.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Salvage/scanner.yml @@ -12,7 +12,7 @@ - state: icon-o shader: unshaded visible: false - map: ["enum.ToggleVisuals.Layer"] + map: ["enum.ToggleableVisuals.Layer"] - type: ItemToggleActiveSound activeSound: path: /Audio/Ambience/Objects/light_hum.ogg @@ -22,8 +22,8 @@ - type: Appearance - type: GenericVisualizer visuals: - enum.ToggleVisuals.Toggled: - enum.ToggleVisuals.Layer: + enum.ToggleableVisuals.Enabled: + enum.ToggleableVisuals.Layer: True: { visible: true } False: { visible: false } - type: ItemToggle @@ -66,7 +66,7 @@ - state: adv-o shader: unshaded visible: false - map: ["enum.ToggleVisuals.Layer"] + map: ["enum.ToggleableVisuals.Layer"] - type: Item storedRotation: -90 - type: MiningScanner diff --git a/Resources/Prototypes/Entities/Objects/Tools/decoys.yml b/Resources/Prototypes/Entities/Objects/Tools/decoys.yml index bea8c61cb9..1ea52c3f70 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/decoys.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/decoys.yml @@ -36,7 +36,9 @@ nameFormat: name-format-nukie-generic - type: Damageable damageContainer: Inorganic - - type: ToggleableLightVisuals + - type: ToggleableVisuals + spriteLayer: light + - type: ItemTogglePointLight - type: Foldable folded: true - type: PowerCellSlot diff --git a/Resources/Prototypes/Entities/Objects/Tools/flashlights.yml b/Resources/Prototypes/Entities/Objects/Tools/flashlights.yml index 1a08f613bb..c63265ef7d 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/flashlights.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/flashlights.yml @@ -27,7 +27,7 @@ minValue: 0.1 maxValue: 2.0 isLooped: true - - type: ToggleableLightVisuals + - type: ToggleableVisuals spriteLayer: light inhandVisuals: left: @@ -36,6 +36,7 @@ right: - state: inhand-right-light shader: unshaded + - type: ItemTogglePointLight - type: PowerCellSlot cellSlotId: cell_slot - type: ContainerContainer @@ -91,7 +92,7 @@ - type: HandheldLight addPrefix: false wattage: 0.5 - - type: ToggleableLightVisuals + - type: ToggleableVisuals inhandVisuals: left: - state: inhand-left-light diff --git a/Resources/Prototypes/Entities/Objects/Tools/lantern.yml b/Resources/Prototypes/Entities/Objects/Tools/lantern.yml index f5ea2e6f27..3d25957851 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/lantern.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/lantern.yml @@ -42,7 +42,9 @@ color: "#FFC458" netsync: false - type: Appearance - - type: ToggleableLightVisuals + - type: ToggleableVisuals + spriteLayer: light + - type: ItemTogglePointLight - type: PowerCellSlot cellSlotId: cell_slot - type: ItemSlots diff --git a/Resources/Prototypes/Entities/Objects/Tools/lighters.yml b/Resources/Prototypes/Entities/Objects/Tools/lighters.yml index 66da03cbba..a5e0afbc7f 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/lighters.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/lighters.yml @@ -47,11 +47,11 @@ basic_icon_base-11: "" - type: GenericVisualizer visuals: - enum.ToggleVisuals.Toggled: + enum.ToggleableVisuals.Enabled: flame: True: { visible: true } False: { visible: false } - - type: ToggleableLightVisuals + - type: ToggleableVisuals spriteLayer: lighter_flame inhandVisuals: left: @@ -164,7 +164,7 @@ - type: Appearance - type: GenericVisualizer visuals: - enum.ToggleVisuals.Toggled: + enum.ToggleableVisuals.Enabled: flame: True: { visible: true } False: { visible: false } @@ -188,7 +188,7 @@ fuelConsumption: 0.01 fuelLitCost: 0.1 tankSafe: true - - type: ToggleableLightVisuals + - type: ToggleableVisuals spriteLayer: lighter_flame inhandVisuals: left: diff --git a/Resources/Prototypes/Entities/Objects/Tools/welders.yml b/Resources/Prototypes/Entities/Objects/Tools/welders.yml index 686bc6cd2d..a1f8613109 100644 --- a/Resources/Prototypes/Entities/Objects/Tools/welders.yml +++ b/Resources/Prototypes/Entities/Objects/Tools/welders.yml @@ -14,11 +14,11 @@ - state: welder_flame visible: false shader: unshaded - map: ["enum.ToggleVisuals.Layer"] + map: ["enum.ToggleableVisuals.Layer"] - type: GenericVisualizer visuals: - enum.ToggleVisuals.Toggled: - enum.ToggleVisuals.Layer: + enum.ToggleableVisuals.Enabled: + enum.ToggleableVisuals.Layer: True: { visible: true } False: { visible: false } - type: Item @@ -59,7 +59,7 @@ components: - type: DisarmMalus malus: 0.6 - - type: ToggleableLightVisuals + - type: ToggleableVisuals spriteLayer: flame inhandVisuals: left: diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Launchers/launchers.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Launchers/launchers.yml index 2fcf294a73..96afa6f219 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Launchers/launchers.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Launchers/launchers.yml @@ -218,7 +218,7 @@ map: [ "unshaded" ] shader: unshaded visible: false - - type: ToggleableLightVisuals + - type: ToggleableVisuals spriteLayer: unshaded inhandVisuals: left: @@ -266,7 +266,7 @@ map: [ "unshaded" ] shader: unshaded visible: false - - type: ToggleableLightVisuals + - type: ToggleableVisuals spriteLayer: unshaded inhandVisuals: left: @@ -338,7 +338,7 @@ map: [ "unshaded" ] shader: unshaded visible: false - - type: ToggleableLightVisuals + - type: ToggleableVisuals spriteLayer: unshaded inhandVisuals: left: @@ -380,7 +380,7 @@ map: [ "unshaded" ] shader: unshaded visible: false - - type: ToggleableLightVisuals + - type: ToggleableVisuals spriteLayer: unshaded inhandVisuals: left: diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Melee/e_sword.yml b/Resources/Prototypes/Entities/Objects/Weapons/Melee/e_sword.yml index dab155f02e..0a51497696 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Melee/e_sword.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Melee/e_sword.yml @@ -23,6 +23,7 @@ - type: ItemToggleSize activatedSize: Huge - type: ItemTogglePointLight + toggleableVisualsColorModulatesLights: true - type: ItemToggleMeleeWeapon activatedSoundOnHit: path: /Audio/Weapons/eblade1.ogg @@ -59,7 +60,7 @@ color: white netsync: false - type: Appearance - - type: ToggleableLightVisuals # Add support for multiple layers + - type: ToggleableVisuals # Add support for multiple layers spriteLayer: blade inhandVisuals: left: diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Melee/stunprod.yml b/Resources/Prototypes/Entities/Objects/Weapons/Melee/stunprod.yml index 7a3b298129..295a782190 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Melee/stunprod.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Melee/stunprod.yml @@ -8,7 +8,7 @@ sprite: Objects/Weapons/Melee/stunprod.rsi layers: - state: stunprod_off - map: [ "enum.ToggleVisuals.Layer" ] + map: [ "enum.ToggleableVisuals.Layer" ] - type: ItemToggle soundActivate: collection: sparks @@ -59,8 +59,8 @@ - type: Appearance - type: GenericVisualizer visuals: - enum.ToggleVisuals.Toggled: - enum.ToggleVisuals.Layer: + enum.ToggleableVisuals.Enabled: + enum.ToggleableVisuals.Layer: True: {state: stunprod_on} False: {state: stunprod_off} - type: StaticPrice diff --git a/Resources/Prototypes/Entities/Objects/Weapons/security.yml b/Resources/Prototypes/Entities/Objects/Weapons/security.yml index ff54af9518..ade0107670 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/security.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/security.yml @@ -8,7 +8,7 @@ sprite: Objects/Weapons/Melee/stunbaton.rsi layers: - state: stunbaton_off - map: [ "enum.ToggleVisuals.Layer" ] + map: [ "enum.ToggleableVisuals.Layer" ] - type: Stunbaton energyPerUse: 50 - type: ItemToggle @@ -64,8 +64,8 @@ - type: Appearance - type: GenericVisualizer visuals: - enum.ToggleVisuals.Toggled: - enum.ToggleVisuals.Layer: + enum.ToggleableVisuals.Enabled: + enum.ToggleableVisuals.Layer: True: {state: stunbaton_on} False: {state: stunbaton_off} - type: StaticPrice