TryGetData() Generics support content changes (#13053)
This commit is contained in:
@@ -219,8 +219,7 @@ public sealed class ClientClothingSystem : ClothingSystem
|
|||||||
|
|
||||||
if (slot == "jumpsuit" && sprite.LayerMapTryGet(HumanoidVisualLayers.StencilMask, out var suitLayer))
|
if (slot == "jumpsuit" && sprite.LayerMapTryGet(HumanoidVisualLayers.StencilMask, out var suitLayer))
|
||||||
{
|
{
|
||||||
if (_appearance.TryGetData(equipee, HumanoidVisualizerKey.Key, out object? obj)
|
if (_appearance.TryGetData<HumanoidVisualizerData>(equipee, HumanoidVisualizerKey.Key, out var data)
|
||||||
&& obj is HumanoidVisualizerData data
|
|
||||||
&& data.Sex == Sex.Female)
|
&& data.Sex == Sex.Female)
|
||||||
{
|
{
|
||||||
sprite.LayerSetState(suitLayer, clothingComponent.FemaleMask switch
|
sprite.LayerSetState(suitLayer, clothingComponent.FemaleMask switch
|
||||||
|
|||||||
@@ -23,8 +23,7 @@ public sealed class VendingMachineSystem : SharedVendingMachineSystem
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (!TryComp<AppearanceComponent>(uid, out var appearance) ||
|
if (!TryComp<AppearanceComponent>(uid, out var appearance) ||
|
||||||
!_appearanceSystem.TryGetData(uid, VendingMachineVisuals.VisualState, out var visualStateObject, appearance) ||
|
!_appearanceSystem.TryGetData<VendingMachineVisualState>(uid, VendingMachineVisuals.VisualState, out var visualState, appearance))
|
||||||
visualStateObject is not VendingMachineVisualState visualState)
|
|
||||||
{
|
{
|
||||||
visualState = VendingMachineVisualState.Normal;
|
visualState = VendingMachineVisualState.Normal;
|
||||||
}
|
}
|
||||||
@@ -147,7 +146,7 @@ public enum VendingMachineVisualLayers : byte
|
|||||||
Base,
|
Base,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Normal / Deny / Eject
|
/// Normal / Deny / Eject
|
||||||
/// </summary>
|
/// </summary>
|
||||||
BaseUnshaded,
|
BaseUnshaded,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Screens that are persistent (where the machine is not off or broken)
|
/// Screens that are persistent (where the machine is not off or broken)
|
||||||
|
|||||||
@@ -10,12 +10,10 @@ public sealed class RandomArtifactSpriteSystem : VisualizerSystem<RandomArtifact
|
|||||||
if (args.Sprite == null)
|
if (args.Sprite == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!AppearanceSystem.TryGetData(uid, SharedArtifactsVisuals.SpriteIndex, out var ind, args.Component)
|
if (!AppearanceSystem.TryGetData<int>(uid, SharedArtifactsVisuals.SpriteIndex, out var spriteIndex, args.Component))
|
||||||
|| ind is not int spriteIndex)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!AppearanceSystem.TryGetData(uid, SharedArtifactsVisuals.IsActivated, out var act, args.Component)
|
if (!AppearanceSystem.TryGetData<bool>(uid, SharedArtifactsVisuals.IsActivated, out var isActivated, args.Component))
|
||||||
|| act is not bool isActivated)
|
|
||||||
isActivated = false;
|
isActivated = false;
|
||||||
|
|
||||||
var spriteIndexStr = spriteIndex.ToString("D2");
|
var spriteIndexStr = spriteIndex.ToString("D2");
|
||||||
|
|||||||
Reference in New Issue
Block a user