Remove lights compref (#19531)

This commit is contained in:
metalgearsloth
2023-09-11 19:18:06 +10:00
committed by GitHub
parent d315ce3c8c
commit 99b77bc2d3
64 changed files with 222 additions and 132 deletions

View File

@@ -12,6 +12,7 @@ using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.Graphics;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Maths;

View File

@@ -10,6 +10,8 @@ namespace Content.Client.Atmos.EntitySystems;
/// </summary>
public sealed class FireVisualizerSystem : VisualizerSystem<FireVisualsComponent>
{
[Dependency] private readonly PointLightSystem _lights = default!;
public override void Initialize()
{
base.Initialize();
@@ -83,11 +85,11 @@ public sealed class FireVisualizerSystem : VisualizerSystem<FireVisualsComponent
component.LightEntity ??= Spawn(null, new EntityCoordinates(uid, default));
var light = EnsureComp<PointLightComponent>(component.LightEntity.Value);
light.Color = component.LightColor;
_lights.SetColor(component.LightEntity.Value, component.LightColor, light);
// light needs a minimum radius to be visible at all, hence the + 1.5f
light.Radius = Math.Clamp(1.5f + component.LightRadiusPerStack * fireStacks, 0f, component.MaxLightRadius);
light.Energy = Math.Clamp(1 + component.LightEnergyPerStack * fireStacks, 0f, component.MaxLightEnergy);
_lights.SetRadius(component.LightEntity.Value, Math.Clamp(1.5f + component.LightRadiusPerStack * fireStacks, 0f, component.MaxLightRadius), light);
_lights.SetEnergy(component.LightEntity.Value, Math.Clamp(1 + component.LightEnergyPerStack * fireStacks, 0f, component.MaxLightEnergy), light);
// TODO flickering animation? Or just add a noise mask to the light? But that requires an engine PR.
}

View File

@@ -8,6 +8,8 @@ using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.ResourceManagement;
using Robust.Shared.Enums;
using Robust.Shared.Graphics;
using Robust.Shared.Graphics.RSI;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Prototypes;
@@ -79,7 +81,7 @@ namespace Content.Client.Atmos.Overlays
if (!rsi.TryGetState(stateId, out var state)) continue;
_frames[i] = state.GetFrames(RSI.State.Direction.South);
_frames[i] = state.GetFrames(RsiDirection.South);
_frameDelays[i] = state.GetDelays();
_frameCounter[i] = 0;
break;
@@ -97,7 +99,7 @@ namespace Content.Client.Atmos.Overlays
if (!fire.TryGetState((i + 1).ToString(), out var state))
throw new ArgumentOutOfRangeException($"Fire RSI doesn't have state \"{i}\"!");
_fireFrames[i] = state.GetFrames(RSI.State.Direction.South);
_fireFrames[i] = state.GetFrames(RsiDirection.South);
_fireFrameDelays[i] = state.GetDelays();
_fireFrameCounter[i] = 0;
}

View File

@@ -9,6 +9,7 @@ using Robust.Client.UserInterface.CustomControls;
using Robust.Client.AutoGenerated;
using Robust.Client.UserInterface.XAML;
using static Content.Shared.Atmos.Components.GasAnalyzerComponent;
using Direction = Robust.Shared.Maths.Direction;
namespace Content.Client.Atmos.UI
{

View File

@@ -2,6 +2,8 @@ using System.Text;
using Robust.Client.Graphics;
using Robust.Client.ResourceManagement;
using Robust.Client.Utility;
using Robust.Shared.Graphics;
using Robust.Shared.Graphics.RSI;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
@@ -71,7 +73,7 @@ namespace Content.Client.Clickable
return SampleClickMap(clickMap, pos, clickMap.Size, Vector2i.Zero);
}
public bool IsOccluding(RSI rsi, RSI.StateId state, RSI.State.Direction dir, int frame, Vector2i pos)
public bool IsOccluding(RSI rsi, RSI.StateId state, RsiDirection dir, int frame, Vector2i pos)
{
if (!_rsiMaps.TryGetValue(rsi, out var rsiData))
{
@@ -210,6 +212,6 @@ namespace Content.Client.Clickable
{
public bool IsOccluding(Texture texture, Vector2i pos);
public bool IsOccluding(RSI rsi, RSI.StateId state, RSI.State.Direction dir, int frame, Vector2i pos);
public bool IsOccluding(RSI rsi, RSI.StateId state, RsiDirection dir, int frame, Vector2i pos);
}
}

View File

@@ -4,6 +4,7 @@ using Robust.Client.Graphics;
using Robust.Client.Utility;
using Robust.Shared.Graphics;
using static Robust.Client.GameObjects.SpriteComponent;
using Direction = Robust.Shared.Maths.Direction;
namespace Content.Client.Clickable
{
@@ -74,7 +75,7 @@ namespace Content.Client.Clickable
if (layer.ActualRsi is not { } rsi || !rsi.TryGetState(layer.State, out var rsiState))
continue;
var dir = Layer.GetDirection(rsiState.Directions, relativeRotation);
var dir = Layer.GetDirection(rsiState.RsiDirections, relativeRotation);
// convert to layer-local coordinates
layer.GetLayerDrawMatrix(dir, out var matrix);
@@ -87,7 +88,7 @@ namespace Content.Client.Clickable
// Next, to get the right click map we need the "direction" of this layer that is actually being used to draw the sprite on the screen.
// This **can** differ from the dir defined before, but can also just be the same.
if (sprite.EnableDirectionOverride)
dir = sprite.DirectionOverride.Convert(rsiState.Directions);
dir = sprite.DirectionOverride.Convert(rsiState.RsiDirections);
dir = dir.OffsetRsiDir(layer.DirOffset);
if (_clickMapManager.IsOccluding(layer.ActualRsi!, layer.State, dir, layer.AnimationFrame, layerImagePos))

View File

@@ -6,6 +6,7 @@ using Robust.Client.Graphics;
using Robust.Client.Input;
using Robust.Client.UserInterface;
using Robust.Shared.Enums;
using Robust.Shared.Graphics;
using Robust.Shared.Utility;
namespace Content.Client.CombatMode;

View File

@@ -5,6 +5,7 @@ using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Graphics;
using Robust.Shared.IoC;
using Robust.Shared.Localization;

View File

@@ -8,6 +8,7 @@ using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.Utility;
using Robust.Shared.Enums;
using Robust.Shared.Graphics;
using Robust.Shared.Prototypes;
using static Robust.Client.UserInterface.Controls.BaseButton;

View File

@@ -8,6 +8,7 @@ using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Client.Utility;
using Robust.Shared.Graphics;
using Robust.Shared.Maths;
using Robust.Shared.Utility;
using static Robust.Client.UserInterface.Controls.BaseButton;

View File

@@ -7,6 +7,7 @@ using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Client.Utility;
using Robust.Shared.Graphics;
using static Robust.Client.UserInterface.Controls.BaseButton;
namespace Content.Client.Decals.UI;

View File

@@ -3,6 +3,7 @@ using Content.Shared.DoAfter;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Shared.Enums;
using Robust.Shared.Graphics;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using Robust.Shared.Utility;

View File

@@ -6,6 +6,8 @@ namespace Content.Client.Dragon;
public sealed class DragonSystem : EntitySystem
{
[Dependency] private readonly SharedPointLightSystem _lights = default!;
public override void Initialize()
{
base.Initialize();
@@ -32,19 +34,25 @@ public sealed class DragonSystem : EntitySystem
sprite?.LayerSetColor(0, Color.FromHex("#569fff"));
if (light != null)
light.Color = Color.FromHex("#366db5");
{
_lights.SetColor(uid, Color.FromHex("#366db5"), light);
}
break;
case DragonRiftState.AlmostFinished:
sprite?.LayerSetColor(0, Color.FromHex("#cf4cff"));
if (light != null)
light.Color = Color.FromHex("#9e2fc1");
{
_lights.SetColor(uid, Color.FromHex("#9e2fc1"), light);
}
break;
case DragonRiftState.Finished:
sprite?.LayerSetColor(0, Color.FromHex("#edbc36"));
if (light != null)
light.Color = Color.FromHex("#cbaf20");
{
_lights.SetColor(uid, Color.FromHex("#cbaf20"), light);
}
break;
}
}

View File

@@ -22,6 +22,7 @@ using static Content.Shared.Interaction.SharedInteractionSystem;
using static Robust.Client.UserInterface.Controls.BoxContainer;
using Content.Shared.Interaction.Events;
using Content.Shared.Item;
using Direction = Robust.Shared.Maths.Direction;
namespace Content.Client.Examine
{

View File

@@ -1,8 +1,8 @@
using Content.Shared.Explosion;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.ResourceManagement;
using Robust.Shared.GameStates;
using Robust.Shared.Graphics.RSI;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
@@ -17,6 +17,7 @@ public sealed class ExplosionOverlaySystem : EntitySystem
[Dependency] private readonly IPrototypeManager _protoMan = default!;
[Dependency] private readonly IResourceCache _resCache = default!;
[Dependency] private readonly IOverlayManager _overlayMan = default!;
[Dependency] private readonly SharedPointLightSystem _lights = default!;
/// <summary>
/// For how many seconds should an explosion stay on-screen once it has finished expanding?
@@ -71,9 +72,11 @@ public sealed class ExplosionOverlaySystem : EntitySystem
// spawn in a client-side light source at the epicenter
var lightEntity = Spawn("ExplosionLight", component.Epicenter);
var light = EnsureComp<PointLightComponent>(lightEntity);
light.Energy = light.Radius = component.Intensity.Count;
light.Color = type.LightColor;
var light = _lights.EnsureLight(lightEntity);
_lights.SetRadius(lightEntity, component.Intensity.Count, light);
_lights.SetEnergy(lightEntity, component.Intensity.Count, light);
_lights.SetColor(lightEntity, type.LightColor, light);
textures.LightEntity = lightEntity;
textures.FireColor = type.FireColor;
@@ -82,7 +85,7 @@ public sealed class ExplosionOverlaySystem : EntitySystem
var fireRsi = _resCache.GetResource<RSIResource>(type.TexturePath).RSI;
foreach (var state in fireRsi)
{
textures.FireFrames.Add(state.GetFrames(RSI.State.Direction.South));
textures.FireFrames.Add(state.GetFrames(RsiDirection.South));
if (textures.FireFrames.Count == type.FireStates)
break;
}

View File

@@ -1,4 +1,5 @@
using Robust.Client.Graphics;
using Robust.Shared.Graphics;
namespace Content.Client.Explosion;

View File

@@ -4,6 +4,7 @@ using Robust.Client.Graphics;
using Robust.Client.State;
using Robust.Client.Player;
using Robust.Shared.Enums;
using Robust.Shared.Graphics;
using Robust.Shared.IoC;
using Robust.Shared.Maths;
using Robust.Shared.Prototypes;

View File

@@ -7,7 +7,9 @@ using Robust.Client.Input;
using Robust.Client.UserInterface;
using Robust.Shared.Configuration;
using Robust.Shared.Enums;
using Robust.Shared.Graphics;
using Robust.Shared.Map;
using Direction = Robust.Shared.Maths.Direction;
namespace Content.Client.Hands
{

View File

@@ -5,6 +5,7 @@ using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Graphics;
namespace Content.Client.Kitchen.UI
{

View File

@@ -3,6 +3,7 @@ using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Graphics;
namespace Content.Client.Lathe.UI;

View File

@@ -53,7 +53,7 @@ namespace Content.Client.Light.Components
if (Enabled && _entMan.TryGetComponent(_parent, out PointLightComponent? light))
{
light.Enabled = true;
_entMan.System<PointLightSystem>().SetEnabled(_parent, true, light);
}
OnInitialize();
@@ -63,7 +63,7 @@ namespace Content.Client.Light.Components
{
if (_entMan.TryGetComponent(_parent, out PointLightComponent? light))
{
light.Enabled = true;
_entMan.System<PointLightSystem>().SetEnabled(_parent, true, light);
}
if (MinDuration > 0)

View File

@@ -17,6 +17,7 @@ namespace Content.Client.Light
{
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly ItemSystem _itemSystem = default!;
[Dependency] private readonly SharedPointLightSystem _lights = default!;
public override void Initialize()
{
@@ -156,7 +157,7 @@ namespace Content.Client.Light
if (!Resolve(uid, ref rgb, ref sprite, ref light, false))
return;
light.Color = rgb.OriginalLightColor;
_lights.SetColor(uid, rgb.OriginalLightColor, light);
if (rgb.Layers == null || rgb.OriginalLayerColors == null)
return;
@@ -173,7 +174,7 @@ namespace Content.Client.Light
{
var color = GetCurrentRgbColor(_gameTiming.RealTime, rgb.CreationTick.Value * _gameTiming.TickPeriod, rgb);
light.Color = color;
_lights.SetColor(light.Owner, color, light);
if (rgb.Layers != null)
{

View File

@@ -9,6 +9,7 @@ using Robust.Client.Graphics;
using Robust.Shared.Utility;
using Robust.Shared.Configuration;
using Robust.Shared.ContentPack;
using Robust.Shared.Graphics;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;

View File

@@ -1,6 +1,7 @@
using System.Threading;
using System.Threading.Tasks;
using Robust.Client.Graphics;
using Robust.Shared.Graphics;
namespace Content.Client.Parallax.Data
{

View File

@@ -4,6 +4,7 @@ using JetBrains.Annotations;
using Content.Client.Resources;
using Content.Client.IoC;
using Robust.Client.Graphics;
using Robust.Shared.Graphics;
using Robust.Shared.Utility;
namespace Content.Client.Parallax.Data;

View File

@@ -1,6 +1,7 @@
using System;
using Robust.Client.Graphics;
using Content.Client.Parallax.Data;
using Robust.Shared.Graphics;
namespace Content.Client.Parallax;

View File

@@ -6,6 +6,8 @@ namespace Content.Client.Power.APC;
public sealed class ApcVisualizerSystem : VisualizerSystem<ApcVisualsComponent>
{
[Dependency] private readonly SharedPointLightSystem _lights = default!;
protected override void OnAppearanceChange(EntityUid uid, ApcVisualsComponent comp, ref AppearanceChangeEvent args)
{
if (args.Sprite == null)
@@ -43,8 +45,10 @@ public sealed class ApcVisualizerSystem : VisualizerSystem<ApcVisualsComponent>
}
}
if (TryComp<SharedPointLightComponent>(uid, out var light))
light.Color = comp.ScreenColors[(sbyte)chargeState];
if (TryComp<PointLightComponent>(uid, out var light))
{
_lights.SetColor(uid, comp.ScreenColors[(sbyte)chargeState], light);
}
}
else
{
@@ -61,8 +65,10 @@ public sealed class ApcVisualizerSystem : VisualizerSystem<ApcVisualsComponent>
args.Sprite.LayerSetVisible(layer, false);
}
if (TryComp<SharedPointLightComponent>(uid, out var light))
light.Color = comp.EmaggedScreenColor;
if (TryComp<PointLightComponent>(uid, out var light))
{
_lights.SetColor(uid, comp.EmaggedScreenColor, light);
}
}
}
}

View File

@@ -9,6 +9,8 @@ using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Graphics;
using Robust.Shared.Graphics.RSI;
using Robust.Shared.Prototypes;
namespace Content.Client.Power;
@@ -64,7 +66,7 @@ public sealed partial class PowerMonitoringWindow : DefaultWindow, IComputerWind
IRsiStateLike? iconState = null;
if (entityPrototype != null)
iconState = _spriteSystem.GetPrototypeIcon(entityPrototype);
var icon = iconState?.GetFrame(RSI.State.Direction.South, 0);
var icon = iconState?.GetFrame(RsiDirection.South, 0);
var item = list[i];
item.Text = $"{ent.NameLocalized} {Loc.GetString("power-monitoring-window-value", ("value", ent.Size))}";
item.Icon = icon;

View File

@@ -25,6 +25,7 @@ using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Prototypes;
using static Robust.Client.UserInterface.Controls.BoxContainer;
using Direction = Robust.Shared.Maths.Direction;
namespace Content.Client.Preferences.UI
{

View File

@@ -32,6 +32,7 @@ using Robust.Shared.Random;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using static Robust.Client.UserInterface.Controls.BoxContainer;
using Direction = Robust.Shared.Maths.Direction;
namespace Content.Client.Preferences.UI
{

View File

@@ -1,6 +1,7 @@
using JetBrains.Annotations;
using Robust.Client.Graphics;
using Robust.Client.ResourceManagement;
using Robust.Shared.Graphics;
using Robust.Shared.Utility;
namespace Content.Client.Resources

View File

@@ -6,6 +6,8 @@ namespace Content.Client.Revenant;
public sealed class RevenantOverloadedLightsSystem : SharedRevenantOverloadedLightsSystem
{
[Dependency] private readonly SharedPointLightSystem _lights = default!;
public override void Initialize()
{
base.Initialize();
@@ -20,37 +22,37 @@ public sealed class RevenantOverloadedLightsSystem : SharedRevenantOverloadedLig
var enumerator = EntityQueryEnumerator<RevenantOverloadedLightsComponent, PointLightComponent>();
while (enumerator.MoveNext(out var comp, out var light))
while (enumerator.MoveNext(out var uid, out var comp, out var light))
{
//this looks cool :HECK:
light.Energy = 2f * Math.Abs((float) Math.Sin(0.25 * Math.PI * comp.Accumulator));
_lights.SetEnergy(uid, 2f * Math.Abs((float) Math.Sin(0.25 * Math.PI * comp.Accumulator)), light);
}
}
private void OnStartup(EntityUid uid, RevenantOverloadedLightsComponent component, ComponentStartup args)
{
var light = EnsureComp<PointLightComponent>(uid);
var light = _lights.EnsureLight(uid);
component.OriginalEnergy = light.Energy;
component.OriginalEnabled = light.Enabled;
light.Enabled = component.OriginalEnabled;
Dirty(light);
_lights.SetEnabled(uid, component.OriginalEnabled, light);
Dirty(uid, light);
}
private void OnShutdown(EntityUid uid, RevenantOverloadedLightsComponent component, ComponentShutdown args)
{
if (!TryComp<PointLightComponent>(component.Owner, out var light))
if (!_lights.TryGetLight(uid, out var light))
return;
if (component.OriginalEnergy == null)
{
RemComp<PointLightComponent>(component.Owner);
RemComp(uid, light);
return;
}
light.Energy = component.OriginalEnergy.Value;
light.Enabled = component.OriginalEnabled;
Dirty(light);
_lights.SetEnergy(uid, component.OriginalEnergy.Value, light);
_lights.SetEnabled(uid, component.OriginalEnabled, light);
Dirty(uid, light);
}
protected override void OnZap(RevenantOverloadedLightsComponent component)

View File

@@ -4,6 +4,7 @@ using Robust.Client.ResourceManagement;
using Robust.Shared.Serialization.TypeSerializers.Implementations;
using Robust.Shared.Utility;
using System.Linq;
using Robust.Shared.Graphics;
namespace Content.Client.SprayPainter;

View File

@@ -11,6 +11,7 @@ using Content.Shared.Stacks;
using Robust.Client.UserInterface;
using static Robust.Client.UserInterface.Controls.BoxContainer;
using static Content.Shared.Storage.SharedStorageComponent;
using Direction = Robust.Shared.Maths.Direction;
namespace Content.Client.Storage.UI
{

View File

@@ -2,6 +2,7 @@ using Robust.Client.AutoGenerated;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Graphics;
namespace Content.Client.Store.Ui;

View File

@@ -14,6 +14,7 @@ using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.Graphics;
using static Robust.Client.UserInterface.StylesheetHelpers;
namespace Content.Client.Stylesheets

View File

@@ -13,6 +13,7 @@ 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()
{
@@ -40,9 +41,11 @@ public sealed class ToggleableLightVisualsSystem : VisualizerSystem<ToggleableLi
if (TryComp(uid, out PointLightComponent? light))
{
DebugTools.Assert(!light.NetSyncEnabled, "light visualizers require point lights without net-sync");
light.Enabled = enabled;
_lights.SetEnabled(uid, enabled, light);
if (enabled && modulate)
light.Color = color;
{
_lights.SetColor(uid, color, light);
}
}
// update clothing & in-hand visuals.

View File

@@ -1,6 +1,7 @@
using System.Numerics;
using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Direction = Robust.Shared.Maths.Direction;
namespace Content.Client.UserInterface.Controls;

View File

@@ -7,6 +7,7 @@ using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Graphics;
using Robust.Shared.Timing;
using Robust.Shared.Utility;

View File

@@ -3,6 +3,7 @@ using System.Numerics;
using Robust.Client.Graphics;
using Robust.Client.Input;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Graphics;
using Robust.Shared.Input;
using Robust.Shared.Utility;

View File

@@ -20,6 +20,7 @@ using Robust.Client.Player;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controllers;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Graphics.RSI;
using Robust.Shared.Input;
using Robust.Shared.Input.Binding;
using Robust.Shared.Timing;
@@ -748,7 +749,7 @@ public sealed class ActionUIController : UIController, IOnStateChanged<GameplayS
if (entIcon != null)
{
_dragShadow.Texture = EntityManager.GetComponent<SpriteComponent>(entIcon.Value).Icon?
.GetFrame(RSI.State.Direction.South, 0);
.GetFrame(RsiDirection.South, 0);
}
else if (action.Icon != null)
{

View File

@@ -9,11 +9,13 @@ using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.Utility;
using Robust.Shared.Graphics;
using Robust.Shared.Input;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using static Robust.Client.UserInterface.Controls.BoxContainer;
using static Robust.Client.UserInterface.Controls.TextureRect;
using Direction = Robust.Shared.Maths.Direction;
namespace Content.Client.UserInterface.Systems.Actions.Controls;

View File

@@ -6,6 +6,7 @@ using Robust.Client.Graphics;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Client.UserInterface.XAML;
using Robust.Shared.Graphics;
using Robust.Shared.Prototypes;
namespace Content.Client.VendingMachines.UI

View File

@@ -8,6 +8,7 @@ using Robust.Client.Animations;
using Robust.Client.Graphics;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Graphics;
namespace Content.Client.Weapons.Ranged.Systems;

View File

@@ -312,8 +312,8 @@ public sealed partial class GunSystem : SharedGunSystem
light.NetSyncEnabled = false;
Lights.SetEnabled(uid, true, light);
Lights.SetRadius(uid, 2f, light);
light.Color = Color.FromHex("#cc8e2b");
light.Energy = 5f;
Lights.SetColor(uid, Color.FromHex("#cc8e2b"), light);
Lights.SetEnergy(uid, 5f, light);
var animTwo = new Animation()
{

View File

@@ -7,6 +7,8 @@ using Robust.Client.Graphics;
using Robust.Client.ResourceManagement;
using Robust.Client.Utility;
using Robust.Shared.Enums;
using Robust.Shared.Graphics;
using Robust.Shared.Graphics.RSI;
using Robust.Shared.Map;
using Robust.Shared.Physics.Components;
using Robust.Shared.Prototypes;
@@ -131,7 +133,7 @@ public sealed class WeatherOverlay : Overlay
case SpriteSpecifier.Rsi rsi:
var rsiActual = _cache.GetResource<RSIResource>(rsi.RsiPath).RSI;
rsiActual.TryGetState(rsi.RsiState, out var state);
var frames = state!.GetFrames(RSI.State.Direction.South);
var frames = state!.GetFrames(RsiDirection.South);
var delays = state.GetDelays();
var totalDelay = delays.Sum();
var time = curTime.TotalSeconds % totalDelay;