* - Combine enum keys `ToggleableLightVisuals` and `ToggleVisuals` into `ToggleableVisuals`
- Rename `ToggleableLightVisualsComponent` to `ToggleableVisualsComponent` and `ToggleableLightVisualsSystem` to `ToggleableVisualsSystem`
- (The `SpriteLayer` field on the component is now required because the old default of `light` doesn't make sense anymore)
- Make it so that `ToggleableVisualsComponent` works even when there's not a light attached to the entity
- (Amazingly this seems to have only applied to Headphones, but I can only imagine there are many other things people would like to do with simple toggleable visuals)
- Explicitly make `ItemTogglePointLightComponent`'s purpose to make `ToggleVisualsComponent` apply to `PointLightComponent`s on the same entity.
- Add field `ToggleableVisualsColorModulatesLights`, which makes the `Color` appearance value of `ToggleableVisuals` modulate the color of lights on the same entity
- Lots of prototype updates to uptake the above
* fix bad merge
* unbork robust
* blindly letting rider reformat stuff
* I guess I never cleaned up these imports at all
return;
}
- if (!_appearance.TryGetData<bool>(uid, ToggleableLightVisuals.Enabled, out var enabled, args.Component))
+ if (!_appearance.TryGetData<bool>(uid, ToggleableVisuals.Enabled, out var enabled, args.Component))
{
return;
}
+++ /dev/null
-using Content.Shared.Hands.Components;
-
-namespace Content.Client.Toggleable;
-
-/// <summary>
-/// Component that handles the toggling the visuals of some light emitting entity.
-/// </summary>
-/// <remarks>
-/// 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.
-/// </remarks>
-[RegisterComponent]
-public sealed partial class ToggleableLightVisualsComponent : Component
-{
- /// <summary>
- /// Sprite layer that will have its visibility toggled when this item is toggled.
- /// </summary>
- [DataField("spriteLayer")]
- public string? SpriteLayer = "light";
-
- /// <summary>
- /// Layers to add to the sprite of the player that is holding this entity (while the component is toggled on).
- /// </summary>
- [DataField("inhandVisuals")]
- public Dictionary<HandLocation, List<PrototypeLayerData>> InhandVisuals = new();
-
- /// <summary>
- /// Layers to add to the sprite of the player that is wearing this entity (while the component is toggled on).
- /// </summary>
- [DataField("clothingVisuals")]
- public Dictionary<string, List<PrototypeLayerData>> ClothingVisuals = new();
-}
+++ /dev/null
-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<ToggleableLightVisualsComponent>
-{
- [Dependency] private readonly SharedItemSystem _itemSys = default!;
- [Dependency] private readonly SharedPointLightSystem _lights = default!;
-
- public override void Initialize()
- {
- base.Initialize();
- SubscribeLocalEvent<ToggleableLightVisualsComponent, GetInhandVisualsEvent>(OnGetHeldVisuals, after: new[] { typeof(ItemSystem) });
- SubscribeLocalEvent<ToggleableLightVisualsComponent, GetEquipmentVisualsEvent>(OnGetEquipmentVisuals, after: new[] { typeof(ClientClothingSystem) });
- }
-
- protected override void OnAppearanceChange(EntityUid uid, ToggleableLightVisualsComponent component, ref AppearanceChangeEvent args)
- {
- if (!AppearanceSystem.TryGetData<bool>(uid, ToggleableLightVisuals.Enabled, out var enabled, args.Component))
- return;
-
- var modulate = AppearanceSystem.TryGetData<Color>(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);
- }
-
- /// <summary>
- /// Add the unshaded light overlays to any clothing sprites.
- /// </summary>
- private void OnGetEquipmentVisuals(EntityUid uid, ToggleableLightVisualsComponent component, GetEquipmentVisualsEvent args)
- {
- if (!TryComp(uid, out AppearanceComponent? appearance)
- || !AppearanceSystem.TryGetData<bool>(uid, ToggleableLightVisuals.Enabled, out var enabled, appearance)
- || !enabled)
- return;
-
- if (!TryComp(args.Equipee, out InventoryComponent? inventory))
- return;
- List<PrototypeLayerData>? 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<Color>(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<bool>(uid, ToggleableLightVisuals.Enabled, out var enabled, appearance)
- || !enabled)
- return;
-
- if (!component.InhandVisuals.TryGetValue(args.Location, out var layers))
- return;
-
- var modulate = AppearanceSystem.TryGetData<Color>(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));
- }
- }
-}
--- /dev/null
+using Content.Shared.Hands.Components;
+
+namespace Content.Client.Toggleable;
+
+/// <summary>
+/// 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.
+/// </summary>
+/// <see cref="ToggleableVisualsSystem"/>
+[RegisterComponent]
+public sealed partial class ToggleableVisualsComponent : Component
+{
+ /// <summary>
+ /// Sprite layer that will have its visibility toggled when this item is toggled.
+ /// </summary>
+ [DataField(required: true)]
+ public string? SpriteLayer;
+
+ /// <summary>
+ /// Layers to add to the sprite of the player that is holding this entity (while the component is toggled on).
+ /// </summary>
+ [DataField]
+ public Dictionary<HandLocation, List<PrototypeLayerData>> InhandVisuals = new();
+
+ /// <summary>
+ /// Layers to add to the sprite of the player that is wearing this entity (while the component is toggled on).
+ /// </summary>
+ [DataField]
+ public Dictionary<string, List<PrototypeLayerData>> ClothingVisuals = new();
+}
--- /dev/null
+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;
+
+/// <summary>
+/// Implements the behavior of <see cref="ToggleableVisualsComponent"/> by reacting to
+/// <see cref="AppearanceChangeEvent"/>, for the sprite directly; <see cref="OnGetHeldVisuals"/> for the
+/// in-hand visuals; and <see cref="OnGetEquipmentVisuals"/> for the clothing visuals.
+/// </summary>
+/// <see cref="ToggleableVisualsComponent"/>
+public sealed class ToggleableVisualsSystem : VisualizerSystem<ToggleableVisualsComponent>
+{
+ [Dependency] private readonly SharedItemSystem _item = default!;
+ [Dependency] private readonly SharedPointLightSystem _pointLight = default!;
+
+ public override void Initialize()
+ {
+ base.Initialize();
+ SubscribeLocalEvent<ToggleableVisualsComponent, GetInhandVisualsEvent>(OnGetHeldVisuals,
+ after: [typeof(ItemSystem)]);
+ SubscribeLocalEvent<ToggleableVisualsComponent, GetEquipmentVisualsEvent>(OnGetEquipmentVisuals,
+ after: [typeof(ClientClothingSystem)]);
+ }
+
+ protected override void OnAppearanceChange(EntityUid uid,
+ ToggleableVisualsComponent component,
+ ref AppearanceChangeEvent args)
+ {
+ if (!AppearanceSystem.TryGetData<bool>(uid, ToggleableVisuals.Enabled, out var enabled, args.Component))
+ return;
+
+ var modulateColor =
+ AppearanceSystem.TryGetData<Color>(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<ItemTogglePointLightComponent>(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<bool>(uid, ToggleableVisuals.Enabled, out var enabled, appearance)
+ || !enabled)
+ return;
+
+ if (!TryComp(args.Equipee, out InventoryComponent? inventory))
+ return;
+ List<PrototypeLayerData>? 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<Color>(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<bool>(uid, ToggleableVisuals.Enabled, out var enabled, appearance)
+ || !enabled)
+ return;
+
+ if (!component.InhandVisuals.TryGetValue(args.Location, out var layers))
+ return;
+
+ var modulateColor = AppearanceSystem.TryGetData<Color>(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));
+ }
+ }
+}
// 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)
/// <summary>
/// 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".
/// </summary>
[DataField("threshold")]
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);
}
}
}
{
if (TryComp(ent, out AppearanceComponent? appearance))
{
- _appearance.SetData(ent, ToggleVisuals.Toggled, ent.Comp.Activated, appearance);
+ _appearance.SetData(ent, ToggleableVisuals.Enabled, ent.Comp.Activated, appearance);
}
}
+using Content.Shared.Item.ItemToggle.Components;
using Robust.Shared.GameStates;
+using Content.Shared.Toggleable;
namespace Content.Shared.Light.Components;
/// <summary>
-/// Toggles point light on an entity whenever ItemToggle hits.
+/// Makes <see cref="ItemToggledEvent"/> enable and disable point lights on this entity.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class ItemTogglePointLightComponent : Component
{
-
+ /// <summary>
+ /// When true, causes the color specified in <see cref="ToggleableVisuals.Color"/>
+ /// be used to modulate the color of lights on this entity.
+ /// </summary>
+ [DataField] public bool ToggleableVisualsColorModulatesLights = false;
}
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;
/// <summary>
-/// Handles ItemToggle for PointLight
+/// Implements the behavior of <see cref="ItemTogglePointLightComponent"/>, causing <see cref="ItemToggledEvent"/>s to
+/// enable and disable lights on the entity.
/// </summary>
public sealed class ItemTogglePointLightSystem : EntitySystem
{
- [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedPointLightSystem _light = default!;
[Dependency] private readonly SharedHandheldLightSystem _handheldLight = default!;
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<HandheldLightComponent>(ent.Owner, out var handheldLight))
{
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<HandheldLightComponent> ent, ref GetVerbsEvent<ActivationVerb> args)
/// Generic enum keys for toggle-visualizer appearance data & sprite layers.
/// </summary>
[Serializable, NetSerializable]
-public enum ToggleVisuals : byte
+public enum ToggleableVisuals : byte
{
- Toggled,
- Layer
+ Enabled,
+ Layer,
+ Color,
+}
+
+/// <summary>
+/// Generic sprite layer keys.
+/// </summary>
+[Serializable, NetSerializable]
+public enum LightLayers : byte
+{
+ Light,
+
+ /// <summary>
+ /// 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.
+ /// </summary>
+ Unshaded,
}
+++ /dev/null
-using Robust.Shared.Serialization;
-
-namespace Content.Shared.Toggleable;
-
-// Appearance Data key
-[Serializable, NetSerializable]
-public enum ToggleableLightVisuals : byte
-{
- Enabled,
- Color
-}
-
-/// <summary>
-/// Generic sprite layer keys.
-/// </summary>
-[Serializable, NetSerializable]
-public enum LightLayers : byte
-{
- Light,
-
- /// <summary>
- /// 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.
- /// </summary>
- Unshaded,
-}
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.
TryComp<AppearanceComponent>(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);
TryComp<AppearanceComponent>(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<TetheredComponent>(component.Tethered.Value);
_blocker.UpdateCanMove(component.Tethered.Value);
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
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
- type: Item
heldPrefix: off
size: Normal
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
+ spriteLayer: light
+ - type: ItemTogglePointLight
- type: PointLight
enabled: false
radius: 3
map: [ "light" ]
- type: Clothing
equippedPrefix: off
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
+ spriteLayer: light
+ - type: ItemTogglePointLight
- type: PointLight
enabled: false
radius: 3
sprite: Clothing/Head/Hardsuits/paramedhelm.rsi
- type: HandheldLight
addPrefix: false
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
spriteLayer: light
clothingVisuals:
head:
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:
clothingVisuals:
head:
- state: on-equipped-HELMET
+ - type: ItemTogglePointLight
- type: PowerCellSlot
cellSlotId: cell_slot
- type: ItemSlots
- type: HideLayerClothing
layers:
Hair: HEAD
- HeadTop : HEAD
- HeadSide : HEAD
+ HeadTop: HEAD
+ HeadSide: HEAD
- type: entity
parent: ClothingHeadHatHardhatBase
map: [ "light" ]
- type: HandheldLight
addPrefix: false
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
spriteLayer: light
clothingVisuals:
head:
map: [ "light" ]
- type: HandheldLight
addPrefix: false
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
clothingVisuals:
head:
- state: equipped-head-light
map: [ "light" ]
- type: HandheldLight
addPrefix: false
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
clothingVisuals:
head:
- state: equipped-head-light
action: ActionToggleJusticeHelm
mustEquip: false
- type: ItemTogglePointLight
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
+ spriteLayer: light
clothingVisuals:
head:
- state: on-equipped-HELMET
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
walkModifier: 0.9
sprintModifier: 0.9
#Shoulder mounted flashlight
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
spriteLayer: light
clothingVisuals:
outerClothing:
outerClothing-vox:
- state: equipped-OUTERCLOTHING-light-vox
shader: unshaded
+ - type: ItemTogglePointLight
- type: Appearance
- type: HandheldLight
addPrefix: false
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
- 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
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
- 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
minValue: 0.1
maxValue: 2.0
isLooped: true
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
+ spriteLayer: light
- type: PointLight
enabled: false
mask: /Textures/Effects/LightMasks/cone.png
sprite: Objects/Fun/candy_bucket.rsi
layers:
- state: empty_icon
- map: [ "enum.ToggleVisuals.Layer" ]
+ map: [ "enum.ToggleableVisuals.Layer" ]
- type: ContainerHeld
threshold: 1
- type: Item
- 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
- 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
color: white
netsync: false
- type: Appearance
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
spriteLayer: blade
inhandVisuals:
left:
- 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
- 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:
- type: FireVisuals
sprite: Objects/Misc/candles.rsi
normalState: fire-big
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
spriteLayer: null
inhandVisuals:
left:
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
- 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
radius: 3
energy: 2
netsync: false
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
+ spriteLayer: light
+ - type: ItemTogglePointLight
- type: Appearance
- type: Physics
canCollide: false
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
heldPrefix: eshield
- type: UseDelay
delay: 0.5
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
spriteLayer: shield
inhandVisuals:
left:
heldPrefix: teleriot
- type: UseDelay
delay: 0.5
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
spriteLayer: shield
inhandVisuals:
left:
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
layers:
- state: icon
- state: screen
- map: [ "enum.ToggleVisuals.Layer" ]
+ map: [ "enum.ToggleableVisuals.Layer" ]
visible: false
shader: unshaded
- state: ready
layers:
- state: icon
- state: screen
- map: [ "enum.ToggleVisuals.Layer" ]
+ map: [ "enum.ToggleableVisuals.Layer" ]
visible: false
shader: unshaded
- state: ready
- 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
- 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
- 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
- state: adv-o
shader: unshaded
visible: false
- map: ["enum.ToggleVisuals.Layer"]
+ map: ["enum.ToggleableVisuals.Layer"]
- type: Item
storedRotation: -90
- type: MiningScanner
nameFormat: name-format-nukie-generic
- type: Damageable
damageContainer: Inorganic
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
+ spriteLayer: light
+ - type: ItemTogglePointLight
- type: Foldable
folded: true
- type: PowerCellSlot
minValue: 0.1
maxValue: 2.0
isLooped: true
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
spriteLayer: light
inhandVisuals:
left:
right:
- state: inhand-right-light
shader: unshaded
+ - type: ItemTogglePointLight
- type: PowerCellSlot
cellSlotId: cell_slot
- type: ContainerContainer
- type: HandheldLight
addPrefix: false
wattage: 0.5
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
inhandVisuals:
left:
- state: inhand-left-light
color: "#FFC458"
netsync: false
- type: Appearance
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
+ spriteLayer: light
+ - type: ItemTogglePointLight
- type: PowerCellSlot
cellSlotId: cell_slot
- type: ItemSlots
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:
- type: Appearance
- type: GenericVisualizer
visuals:
- enum.ToggleVisuals.Toggled:
+ enum.ToggleableVisuals.Enabled:
flame:
True: { visible: true }
False: { visible: false }
fuelConsumption: 0.01
fuelLitCost: 0.1
tankSafe: true
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
spriteLayer: lighter_flame
inhandVisuals:
left:
- 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
components:
- type: DisarmMalus
malus: 0.6
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
spriteLayer: flame
inhandVisuals:
left:
map: [ "unshaded" ]
shader: unshaded
visible: false
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
spriteLayer: unshaded
inhandVisuals:
left:
map: [ "unshaded" ]
shader: unshaded
visible: false
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
spriteLayer: unshaded
inhandVisuals:
left:
map: [ "unshaded" ]
shader: unshaded
visible: false
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
spriteLayer: unshaded
inhandVisuals:
left:
map: [ "unshaded" ]
shader: unshaded
visible: false
- - type: ToggleableLightVisuals
+ - type: ToggleableVisuals
spriteLayer: unshaded
inhandVisuals:
left:
- type: ItemToggleSize
activatedSize: Huge
- type: ItemTogglePointLight
+ toggleableVisualsColorModulatesLights: true
- type: ItemToggleMeleeWeapon
activatedSoundOnHit:
path: /Audio/Weapons/eblade1.ogg
color: white
netsync: false
- type: Appearance
- - type: ToggleableLightVisuals # Add support for multiple layers
+ - type: ToggleableVisuals # Add support for multiple layers
spriteLayer: blade
inhandVisuals:
left:
sprite: Objects/Weapons/Melee/stunprod.rsi
layers:
- state: stunprod_off
- map: [ "enum.ToggleVisuals.Layer" ]
+ map: [ "enum.ToggleableVisuals.Layer" ]
- type: ItemToggle
soundActivate:
collection: sparks
- 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
sprite: Objects/Weapons/Melee/stunbaton.rsi
layers:
- state: stunbaton_off
- map: [ "enum.ToggleVisuals.Layer" ]
+ map: [ "enum.ToggleableVisuals.Layer" ]
- type: Stunbaton
energyPerUse: 50
- type: ItemToggle
- 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