using Robust.Client.ResourceManagement;
using Robust.Shared.Utility;
using System.Linq;
-using static Robust.Shared.GameObjects.SharedSpriteComponent;
+using Robust.Shared.Serialization.TypeSerializers.Implementations;
namespace Content.Client.AirlockPainter
{
continue;
}
- RSIResource doorRsi = _resourceCache.GetResource<RSIResource>(TextureRoot / new ResPath(iconPath));
+ RSIResource doorRsi = _resourceCache.GetResource<RSIResource>(SpriteSpecifierSerializer.TextureRoot / new ResPath(iconPath));
if (!doorRsi.RSI.TryGetState("closed", out var icon))
{
Entries.Add(new AirlockPainterEntry(style, null));
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.ResourceManagement;
+using Robust.Shared.Serialization.TypeSerializers.Implementations;
namespace Content.Client.Atmos.EntitySystems;
if (!TryComp(uid, out SpriteComponent? sprite))
return;
- if (!_resCache.TryGetResource(SharedSpriteComponent.TextureRoot / component.RsiPath, out RSIResource? rsi))
+ if (!_resCache.TryGetResource(SpriteSpecifierSerializer.TextureRoot / component.RsiPath, out RSIResource? rsi))
{
Logger.Error($"{nameof(AtmosPipeAppearanceSystem)} could not load to load RSI {component.RsiPath}.");
return;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.ResourceManagement;
+using Robust.Shared.Serialization.TypeSerializers.Implementations;
using static Robust.Client.GameObjects.SpriteComponent;
-using static Robust.Shared.GameObjects.SharedSpriteComponent;
namespace Content.Client.Clothing;
RSI? rsi = null;
if (clothing.RsiPath != null)
- rsi = _cache.GetResource<RSIResource>(TextureRoot / clothing.RsiPath).RSI;
+ rsi = _cache.GetResource<RSIResource>(SpriteSpecifierSerializer.TextureRoot / clothing.RsiPath).RSI;
else if (TryComp(uid, out SpriteComponent? sprite))
rsi = sprite.BaseRSI;
using Robust.Client.GameObjects;
using Robust.Client.ResourceManagement;
using Robust.Shared.Audio;
-using Robust.Shared.GameObjects;
using Robust.Shared.Player;
+using Robust.Shared.Serialization.TypeSerializers.Implementations;
using Robust.Shared.Timing;
namespace Content.Client.Doors;
if (AppearanceSystem.TryGetData<string>(uid, DoorVisuals.BaseRSI, out var baseRsi, args.Component))
{
- if (!_resourceCache.TryGetResource<RSIResource>(SharedSpriteComponent.TextureRoot / baseRsi, out var res))
+ if (!_resourceCache.TryGetResource<RSIResource>(SpriteSpecifierSerializer.TextureRoot / baseRsi, out var res))
{
Logger.Error("Unable to load RSI '{0}'. Trace:\n{1}", baseRsi, Environment.StackTrace);
}
layer.Rsi = res?.RSI;
}
}
-
+
TryComp<AnimationPlayerComponent>(uid, out var animPlayer);
if (_animationSystem.HasRunningAnimation(uid, animPlayer, DoorComponent.AnimationKey))
_animationSystem.Stop(uid, animPlayer, DoorComponent.AnimationKey); // Halt all running anomations.
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Shared.Hands;
+using Content.Shared.Inventory.Events;
using Content.Shared.Item;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.ResourceManagement;
-using Robust.Shared.Containers;
-using static Robust.Shared.GameObjects.SharedSpriteComponent;
+using Robust.Shared.Serialization.TypeSerializers.Implementations;
namespace Content.Client.Items.Systems;
base.Initialize();
SubscribeLocalEvent<ItemComponent, GetInhandVisualsEvent>(OnGetVisuals);
+
+ // TODO is this still needed? Shouldn't containers occlude them?
+ SubscribeLocalEvent<SpriteComponent, GotEquippedEvent>(OnEquipped);
+ SubscribeLocalEvent<SpriteComponent, GotUnequippedEvent>(OnUnequipped);
+ }
+
+ private void OnUnequipped(EntityUid uid, SpriteComponent component, GotUnequippedEvent args)
+ {
+ component.Visible = true;
+ }
+
+ private void OnEquipped(EntityUid uid, SpriteComponent component, GotEquippedEvent args)
+ {
+ component.Visible = false;
}
#region InhandVisuals
RSI? rsi = null;
if (item.RsiPath != null)
- rsi = _resCache.GetResource<RSIResource>(TextureRoot / item.RsiPath).RSI;
+ rsi = _resCache.GetResource<RSIResource>(SpriteSpecifierSerializer.TextureRoot / item.RsiPath).RSI;
else if (TryComp(uid, out SpriteComponent? sprite))
rsi = sprite.BaseRSI;
using Content.Shared.Hands.Components;
-using static Robust.Shared.GameObjects.SharedSpriteComponent;
namespace Content.Client.Toggleable;
foreach (var entity in _sEntityManager.GetEntities())
{
- if (!_sEntityManager.HasComponent<SharedSpriteComponent>(entity))
+ if (!_sEntityManager.HasComponent<SpriteComponent>(entity))
{
continue;
}
-using static Robust.Shared.GameObjects.SharedSpriteComponent;
namespace Content.Shared.Clothing;
{
[DataField("clothingVisuals")]
[Access(typeof(ClothingSystem), typeof(InventorySystem), Other = AccessPermissions.ReadExecute)] // TODO remove execute permissions.
- public Dictionary<string, List<SharedSpriteComponent.PrototypeLayerData>> ClothingVisuals = new();
+ public Dictionary<string, List<PrototypeLayerData>> ClothingVisuals = new();
[ViewVariables(VVAccess.ReadWrite)]
[DataField("quickEquip")]
using JetBrains.Annotations;
using Robust.Shared.Map;
using Robust.Shared.Serialization;
-using static Robust.Shared.GameObjects.SharedSpriteComponent;
-
namespace Content.Shared.Hands
{
[Access(typeof(SharedItemSystem))]
[DataField("inhandVisuals")]
- public Dictionary<HandLocation, List<SharedSpriteComponent.PrototypeLayerData>> InhandVisuals = new();
+ public Dictionary<HandLocation, List<PrototypeLayerData>> InhandVisuals = new();
[Access(typeof(SharedItemSystem))]
[ViewVariables(VVAccess.ReadWrite)]
{
base.Initialize();
SubscribeLocalEvent<ItemComponent, GetVerbsEvent<InteractionVerb>>(AddPickupVerb);
-
- SubscribeLocalEvent<SharedSpriteComponent, GotEquippedEvent>(OnEquipped);
- SubscribeLocalEvent<SharedSpriteComponent, GotUnequippedEvent>(OnUnequipped);
SubscribeLocalEvent<ItemComponent, InteractHandEvent>(OnHandInteract);
SubscribeLocalEvent<ItemComponent, ComponentGetState>(OnGetState);
args.State = new ItemComponentState(component.Size, component.HeldPrefix);
}
- // Although netsync is being set to false for items client can still update these
- // Realistically:
- // Container should already hide these
- // Client is the only thing that matters.
-
- private void OnUnequipped(EntityUid uid, SharedSpriteComponent component, GotUnequippedEvent args)
- {
- component.Visible = true;
- }
-
- private void OnEquipped(EntityUid uid, SharedSpriteComponent component, GotEquippedEvent args)
- {
- component.Visible = false;
- }
-
private void AddPickupVerb(EntityUid uid, ItemComponent component, GetVerbsEvent<InteractionVerb> args)
{
if (args.Hands == null ||