Makes more fields VV (#2026)

* Some more VV

* Fixed build & some more gun vvs

* Added VendingMachine Inventory & Items
This commit is contained in:
Exp
2020-09-08 13:30:22 +02:00
committed by GitHub
parent cdf42cf880
commit 5120627ca2
28 changed files with 82 additions and 18 deletions

View File

@@ -15,6 +15,7 @@ using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Timing; using Robust.Shared.Interfaces.Timing;
using Robust.Shared.IoC; using Robust.Shared.IoC;
using Robust.Shared.Maths; using Robust.Shared.Maths;
using Robust.Shared.ViewVariables;
namespace Content.Client.GameObjects.Components.Mobs namespace Content.Client.GameObjects.Components.Mobs
{ {
@@ -29,7 +30,9 @@ namespace Content.Client.GameObjects.Components.Mobs
[Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly IGameTiming _gameTiming = default!;
private StatusEffectsUI _ui; private StatusEffectsUI _ui;
[ViewVariables]
private Dictionary<StatusEffect, StatusEffectStatus> _status = new Dictionary<StatusEffect, StatusEffectStatus>(); private Dictionary<StatusEffect, StatusEffectStatus> _status = new Dictionary<StatusEffect, StatusEffectStatus>();
[ViewVariables]
private Dictionary<StatusEffect, CooldownGraphic> _cooldown = new Dictionary<StatusEffect, CooldownGraphic>(); private Dictionary<StatusEffect, CooldownGraphic> _cooldown = new Dictionary<StatusEffect, CooldownGraphic>();
/// <summary> /// <summary>

View File

@@ -7,6 +7,7 @@ using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Components; using Robust.Shared.GameObjects.Components;
using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components namespace Content.Server.GameObjects.Components
{ {
@@ -15,6 +16,7 @@ namespace Content.Server.GameObjects.Components
{ {
public override string Name => "Anchorable"; public override string Name => "Anchorable";
[ViewVariables]
int IInteractUsing.Priority => 1; int IInteractUsing.Priority => 1;
/// <summary> /// <summary>

View File

@@ -1,5 +1,6 @@
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Atmos namespace Content.Server.GameObjects.Components.Atmos
{ {
@@ -8,8 +9,11 @@ namespace Content.Server.GameObjects.Components.Atmos
{ {
public override string Name => "MovedByPressure"; public override string Name => "MovedByPressure";
[ViewVariables(VVAccess.ReadWrite)]
public float PressureResistance { get; set; } = 1f; public float PressureResistance { get; set; } = 1f;
[ViewVariables(VVAccess.ReadWrite)]
public float MoveResist { get; set; } = 100f; public float MoveResist { get; set; } = 100f;
[ViewVariables]
public int LastHighPressureMovementAirCycle { get; set; } = 0; public int LastHighPressureMovementAirCycle { get; set; } = 0;
public override void ExposeData(ObjectSerializer serializer) public override void ExposeData(ObjectSerializer serializer)

View File

@@ -50,6 +50,7 @@ namespace Content.Server.GameObjects.Components.Body.Digestive
/// <summary> /// <summary>
/// Used to track how long each reagent has been in the stomach /// Used to track how long each reagent has been in the stomach
/// </summary> /// </summary>
[ViewVariables]
private readonly List<ReagentDelta> _reagentDeltas = new List<ReagentDelta>(); private readonly List<ReagentDelta> _reagentDeltas = new List<ReagentDelta>();
public override void ExposeData(ObjectSerializer serializer) public override void ExposeData(ObjectSerializer serializer)

View File

@@ -49,7 +49,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
private bool Powered => !Owner.TryGetComponent(out PowerReceiverComponent? receiver) || receiver.Powered; private bool Powered => !Owner.TryGetComponent(out PowerReceiverComponent? receiver) || receiver.Powered;
private readonly SolutionComponent BufferSolution = new SolutionComponent(); [ViewVariables] private readonly SolutionComponent BufferSolution = new SolutionComponent();
[ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(ChemMasterUiKey.Key); [ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(ChemMasterUiKey.Key);

View File

@@ -25,7 +25,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
/// <summary> /// <summary>
/// The amount of solution to be transferred from this solution when clicking on other solutions with it. /// The amount of solution to be transferred from this solution when clicking on other solutions with it.
/// </summary> /// </summary>
[ViewVariables] [ViewVariables(VVAccess.ReadWrite)]
public ReagentUnit TransferAmount public ReagentUnit TransferAmount
{ {
get => _transferAmount; get => _transferAmount;

View File

@@ -49,7 +49,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
[ViewVariables] private ReagentUnit _dispenseAmount = ReagentUnit.New(10); [ViewVariables] private ReagentUnit _dispenseAmount = ReagentUnit.New(10);
[ViewVariables] [ViewVariables]
private SolutionComponent Solution => _beakerContainer.ContainedEntity.GetComponent<SolutionComponent>(); private SolutionComponent? Solution => _beakerContainer.ContainedEntity?.GetComponent<SolutionComponent>();
private bool Powered => !Owner.TryGetComponent(out PowerReceiverComponent? receiver) || receiver.Powered; private bool Powered => !Owner.TryGetComponent(out PowerReceiverComponent? receiver) || receiver.Powered;

View File

@@ -61,14 +61,15 @@ namespace Content.Server.GameObjects.Components.Disposal
/// The current pressure of this disposal unit. /// The current pressure of this disposal unit.
/// Prevents it from flushing if it is not equal to or bigger than 1. /// Prevents it from flushing if it is not equal to or bigger than 1.
/// </summary> /// </summary>
[ViewVariables]
private float _pressure; private float _pressure;
private bool _engaged; private bool _engaged;
[ViewVariables] [ViewVariables(VVAccess.ReadWrite)]
private TimeSpan _automaticEngageTime; private TimeSpan _automaticEngageTime;
[ViewVariables] [ViewVariables(VVAccess.ReadWrite)]
private TimeSpan _flushDelay; private TimeSpan _flushDelay;
[ViewVariables] [ViewVariables]
@@ -101,7 +102,7 @@ namespace Content.Server.GameObjects.Components.Disposal
[ViewVariables] [ViewVariables]
private PressureState State => _pressure >= 1 ? PressureState.Ready : PressureState.Pressurizing; private PressureState State => _pressure >= 1 ? PressureState.Ready : PressureState.Pressurizing;
[ViewVariables] [ViewVariables(VVAccess.ReadWrite)]
private bool Engaged private bool Engaged
{ {
get => _engaged; get => _engaged;

View File

@@ -18,6 +18,7 @@ using Robust.Shared.GameObjects.Systems;
using Robust.Shared.IoC; using Robust.Shared.IoC;
using Robust.Shared.Localization; using Robust.Shared.Localization;
using Robust.Shared.Maths; using Robust.Shared.Maths;
using Robust.Shared.ViewVariables;
using static Content.Shared.GameObjects.Components.SharedWiresComponent; using static Content.Shared.GameObjects.Components.SharedWiresComponent;
using static Content.Shared.GameObjects.Components.SharedWiresComponent.WiresAction; using static Content.Shared.GameObjects.Components.SharedWiresComponent.WiresAction;
using Timer = Robust.Shared.Timers.Timer; using Timer = Robust.Shared.Timers.Timer;
@@ -43,6 +44,7 @@ namespace Content.Server.GameObjects.Components.Doors
/// <summary> /// <summary>
/// True if either power wire was pulsed in the last <see cref="PowerWiresTimeout"/>. /// True if either power wire was pulsed in the last <see cref="PowerWiresTimeout"/>.
/// </summary> /// </summary>
[ViewVariables(VVAccess.ReadWrite)]
private bool PowerWiresPulsed private bool PowerWiresPulsed
{ {
get => _powerWiresPulsed; get => _powerWiresPulsed;
@@ -56,6 +58,7 @@ namespace Content.Server.GameObjects.Components.Doors
private bool _boltsDown; private bool _boltsDown;
[ViewVariables(VVAccess.ReadWrite)]
private bool BoltsDown private bool BoltsDown
{ {
get => _boltsDown; get => _boltsDown;
@@ -68,6 +71,7 @@ namespace Content.Server.GameObjects.Components.Doors
private bool _boltLightsWirePulsed = true; private bool _boltLightsWirePulsed = true;
[ViewVariables(VVAccess.ReadWrite)]
private bool BoltLightsVisible private bool BoltLightsVisible
{ {
get => _boltLightsWirePulsed && BoltsDown && IsPowered() && State == DoorState.Closed; get => _boltLightsWirePulsed && BoltsDown && IsPowered() && State == DoorState.Closed;
@@ -80,6 +84,7 @@ namespace Content.Server.GameObjects.Components.Doors
private const float AutoCloseDelayFast = 1; private const float AutoCloseDelayFast = 1;
// True => AutoCloseDelay; False => AutoCloseDelayFast // True => AutoCloseDelay; False => AutoCloseDelayFast
[ViewVariables(VVAccess.ReadWrite)]
private bool NormalCloseSpeed private bool NormalCloseSpeed
{ {
get => CloseSpeed == AutoCloseDelay; get => CloseSpeed == AutoCloseDelay;

View File

@@ -36,6 +36,7 @@ namespace Content.Server.GameObjects.Components.Doors
{ {
public override string Name => "Door"; public override string Name => "Door";
[ViewVariables]
private DoorState _state = DoorState.Closed; private DoorState _state = DoorState.Closed;
public virtual DoorState State public virtual DoorState State
@@ -45,8 +46,10 @@ namespace Content.Server.GameObjects.Components.Doors
} }
protected float OpenTimeCounter; protected float OpenTimeCounter;
[ViewVariables(VVAccess.ReadWrite)]
protected bool AutoClose = true; protected bool AutoClose = true;
protected const float AutoCloseDelay = 5; protected const float AutoCloseDelay = 5;
[ViewVariables(VVAccess.ReadWrite)]
protected float CloseSpeed = AutoCloseDelay; protected float CloseSpeed = AutoCloseDelay;
private CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource(); private CancellationTokenSource _cancellationTokenSource = new CancellationTokenSource();
@@ -59,11 +62,12 @@ namespace Content.Server.GameObjects.Components.Doors
private const int DoorCrushDamage = 15; private const int DoorCrushDamage = 15;
private const float DoorStunTime = 5f; private const float DoorStunTime = 5f;
[ViewVariables(VVAccess.ReadWrite)]
protected bool Safety = true; protected bool Safety = true;
[ViewVariables] private bool _occludes; [ViewVariables(VVAccess.ReadWrite)] private bool _occludes;
[ViewVariables] [ViewVariables(VVAccess.ReadWrite)]
public bool IsWeldedShut public bool IsWeldedShut
{ {
get => _isWeldedShut; get => _isWeldedShut;

View File

@@ -9,6 +9,7 @@ using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
using static Content.Shared.GameObjects.Components.Inventory.EquipmentSlotDefines; using static Content.Shared.GameObjects.Components.Inventory.EquipmentSlotDefines;
namespace Content.Server.GameObjects.Components.Items.Clothing namespace Content.Server.GameObjects.Components.Items.Clothing
@@ -22,13 +23,16 @@ namespace Content.Server.GameObjects.Components.Items.Clothing
public override string Name => "Clothing"; public override string Name => "Clothing";
public override uint? NetID => ContentNetIDs.CLOTHING; public override uint? NetID => ContentNetIDs.CLOTHING;
[ViewVariables]
public SlotFlags SlotFlags = SlotFlags.PREVENTEQUIP; //Different from None, NONE allows equips if no slot flags are required public SlotFlags SlotFlags = SlotFlags.PREVENTEQUIP; //Different from None, NONE allows equips if no slot flags are required
private bool _quickEquipEnabled = true; private bool _quickEquipEnabled = true;
private int _heatResistance; private int _heatResistance;
[ViewVariables(VVAccess.ReadWrite)]
public int HeatResistance => _heatResistance; public int HeatResistance => _heatResistance;
private string _clothingEquippedPrefix; private string _clothingEquippedPrefix;
[ViewVariables(VVAccess.ReadWrite)]
public string ClothingEquippedPrefix public string ClothingEquippedPrefix
{ {
get get

View File

@@ -4,6 +4,7 @@ using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.IoC; using Robust.Shared.IoC;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Items.Storage.Fill namespace Content.Server.GameObjects.Components.Items.Storage.Fill
{ {
@@ -14,6 +15,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage.Fill
public override string Name => "StorageFill"; public override string Name => "StorageFill";
[ViewVariables]
private List<string> _contents = new List<string>(); private List<string> _contents = new List<string>();
public override void ExposeData(ObjectSerializer serializer) public override void ExposeData(ObjectSerializer serializer)

View File

@@ -26,6 +26,7 @@ using Robust.Shared.IoC;
using Robust.Shared.Log; using Robust.Shared.Log;
using Robust.Shared.Players; using Robust.Shared.Players;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Items.Storage namespace Content.Server.GameObjects.Components.Items.Storage
{ {
@@ -51,6 +52,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
private int _storageCapacityMax; private int _storageCapacityMax;
public readonly HashSet<IPlayerSession> SubscribedSessions = new HashSet<IPlayerSession>(); public readonly HashSet<IPlayerSession> SubscribedSessions = new HashSet<IPlayerSession>();
[ViewVariables]
public IReadOnlyCollection<IEntity>? StoredEntities => _storage?.ContainedEntities; public IReadOnlyCollection<IEntity>? StoredEntities => _storage?.ContainedEntities;
public bool OccludesLight public bool OccludesLight

View File

@@ -8,6 +8,7 @@ using Content.Shared.Interfaces;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.Network; using Robust.Shared.Interfaces.Network;
using Robust.Shared.Players; using Robust.Shared.Players;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Mobs namespace Content.Server.GameObjects.Components.Mobs
{ {
@@ -15,6 +16,7 @@ namespace Content.Server.GameObjects.Components.Mobs
[ComponentReference(typeof(SharedStatusEffectsComponent))] [ComponentReference(typeof(SharedStatusEffectsComponent))]
public sealed class ServerStatusEffectsComponent : SharedStatusEffectsComponent public sealed class ServerStatusEffectsComponent : SharedStatusEffectsComponent
{ {
[ViewVariables]
private readonly Dictionary<StatusEffect, StatusEffectStatus> _statusEffects = new Dictionary<StatusEffect, StatusEffectStatus>(); private readonly Dictionary<StatusEffect, StatusEffectStatus> _statusEffects = new Dictionary<StatusEffect, StatusEffectStatus>();
public override ComponentState GetComponentState() public override ComponentState GetComponentState()

View File

@@ -40,9 +40,9 @@ namespace Content.Server.GameObjects.Components.Nutrition
private string _useSound; private string _useSound;
[ViewVariables] [ViewVariables]
private bool _defaultToOpened; private bool _defaultToOpened;
[ViewVariables] [ViewVariables(VVAccess.ReadWrite)]
public ReagentUnit TransferAmount { get; private set; } = ReagentUnit.New(2); public ReagentUnit TransferAmount { get; private set; } = ReagentUnit.New(2);
[ViewVariables] [ViewVariables(VVAccess.ReadWrite)]
public bool Opened { get; protected set; } public bool Opened { get; protected set; }
[ViewVariables] [ViewVariables]
public bool Empty => _contents.CurrentVolume.Float() <= 0; public bool Empty => _contents.CurrentVolume.Float() <= 0;

View File

@@ -1,9 +1,10 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Content.Server.GameObjects.Components.GUI; using Content.Server.GameObjects.Components.GUI;
using Content.Shared.GameObjects.Components; using Content.Shared.GameObjects.Components;
using Content.Shared.Interfaces.GameObjects.Components; using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components namespace Content.Server.GameObjects.Components
{ {
@@ -11,8 +12,10 @@ namespace Content.Server.GameObjects.Components
public class PlaceableSurfaceComponent : SharedPlaceableSurfaceComponent, IInteractUsing public class PlaceableSurfaceComponent : SharedPlaceableSurfaceComponent, IInteractUsing
{ {
private bool _isPlaceable; private bool _isPlaceable;
[ViewVariables(VVAccess.ReadWrite)]
public bool IsPlaceable { get => _isPlaceable; set => _isPlaceable = value; } public bool IsPlaceable { get => _isPlaceable; set => _isPlaceable = value; }
[ViewVariables]
int IInteractUsing.Priority => 1; int IInteractUsing.Priority => 1;
public override void ExposeData(ObjectSerializer serializer) public override void ExposeData(ObjectSerializer serializer)

View File

@@ -41,6 +41,7 @@ namespace Content.Server.GameObjects.Components.Research
set => _state = value; set => _state = value;
} }
[ViewVariables]
private LatheRecipePrototype? _producingRecipe; private LatheRecipePrototype? _producingRecipe;
private bool Powered => !Owner.TryGetComponent(out PowerReceiverComponent? receiver) || receiver.Powered; private bool Powered => !Owner.TryGetComponent(out PowerReceiverComponent? receiver) || receiver.Powered;

View File

@@ -1,7 +1,8 @@
using Content.Shared.GameObjects.Components.Research; using Content.Shared.GameObjects.Components.Research;
using Content.Shared.Research; using Content.Shared.Research;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Research namespace Content.Server.GameObjects.Components.Research
{ {
@@ -12,6 +13,7 @@ namespace Content.Server.GameObjects.Components.Research
/// <summary> /// <summary>
/// Whether new recipes can be added to this database or not. /// Whether new recipes can be added to this database or not.
/// </summary> /// </summary>
[ViewVariables]
public bool Static => _static; public bool Static => _static;
private bool _static = false; private bool _static = false;

View File

@@ -1,7 +1,8 @@
using System.Collections.Generic; using System.Collections.Generic;
using Content.Shared.GameObjects.Components.Research; using Content.Shared.GameObjects.Components.Research;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Research namespace Content.Server.GameObjects.Components.Research
{ {
@@ -9,11 +10,13 @@ namespace Content.Server.GameObjects.Components.Research
[ComponentReference(typeof(SharedMaterialStorageComponent))] [ComponentReference(typeof(SharedMaterialStorageComponent))]
public class MaterialStorageComponent : SharedMaterialStorageComponent public class MaterialStorageComponent : SharedMaterialStorageComponent
{ {
[ViewVariables]
protected override Dictionary<string, int> Storage { get; set; } = new Dictionary<string, int>(); protected override Dictionary<string, int> Storage { get; set; } = new Dictionary<string, int>();
/// <summary> /// <summary>
/// How much material the storage can store in total. /// How much material the storage can store in total.
/// </summary> /// </summary>
[ViewVariables]
public int StorageLimit => _storageLimit; public int StorageLimit => _storageLimit;
private int _storageLimit; private int _storageLimit;

View File

@@ -29,7 +29,7 @@ namespace Content.Server.GameObjects.Components.Research
private const string SoundCollectionName = "keyboard"; private const string SoundCollectionName = "keyboard";
private bool Powered => !Owner.TryGetComponent(out PowerReceiverComponent? receiver) || receiver.Powered; [ViewVariables] private bool Powered => !Owner.TryGetComponent(out PowerReceiverComponent? receiver) || receiver.Powered;
[ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(ResearchConsoleUiKey.Key); [ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(ResearchConsoleUiKey.Key);

View File

@@ -16,14 +16,14 @@ namespace Content.Server.GameObjects.Components.Research
private bool _active; private bool _active;
private PowerReceiverComponent _powerReceiver; private PowerReceiverComponent _powerReceiver;
[ViewVariables] [ViewVariables(VVAccess.ReadWrite)]
public int PointsPerSecond public int PointsPerSecond
{ {
get => _pointsPerSecond; get => _pointsPerSecond;
set => _pointsPerSecond = value; set => _pointsPerSecond = value;
} }
[ViewVariables] [ViewVariables(VVAccess.ReadWrite)]
public bool Active public bool Active
{ {
get => _active; get => _active;
@@ -34,6 +34,7 @@ namespace Content.Server.GameObjects.Components.Research
/// Whether this can be used to produce research points. /// Whether this can be used to produce research points.
/// </summary> /// </summary>
/// <remarks>If no <see cref="PowerReceiverComponent"/> is found, it's assumed power is not required.</remarks> /// <remarks>If no <see cref="PowerReceiverComponent"/> is found, it's assumed power is not required.</remarks>
[ViewVariables]
public bool CanProduce => Active && (_powerReceiver is null || _powerReceiver.Powered); public bool CanProduce => Active && (_powerReceiver is null || _powerReceiver.Powered);
public override void Initialize() public override void Initialize()

View File

@@ -20,6 +20,7 @@ using Robust.Shared.Localization;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.Utility; using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
{ {
@@ -50,8 +51,10 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
private Stack<IEntity> _spawnedAmmo; private Stack<IEntity> _spawnedAmmo;
private Container _ammoContainer; private Container _ammoContainer;
[ViewVariables]
private BallisticCaliber _caliber; private BallisticCaliber _caliber;
[ViewVariables]
private string _fillPrototype; private string _fillPrototype;
private int _unspawnedCount; private int _unspawnedCount;

View File

@@ -18,6 +18,7 @@ using Robust.Shared.Localization;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.Utility; using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
{ {
@@ -47,8 +48,10 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
private Stack<IEntity> _spawnedAmmo; private Stack<IEntity> _spawnedAmmo;
private Container _ammoContainer; private Container _ammoContainer;
[ViewVariables]
private BallisticCaliber _caliber; private BallisticCaliber _caliber;
[ViewVariables]
private string _fillPrototype; private string _fillPrototype;
private int _unspawnedCount; private int _unspawnedCount;

View File

@@ -19,6 +19,7 @@ using Robust.Shared.IoC;
using Robust.Shared.Localization; using Robust.Shared.Localization;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
{ {
@@ -30,8 +31,10 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
public override string Name => "RevolverBarrel"; public override string Name => "RevolverBarrel";
public override uint? NetID => ContentNetIDs.REVOLVER_BARREL; public override uint? NetID => ContentNetIDs.REVOLVER_BARREL;
[ViewVariables]
private BallisticCaliber _caliber; private BallisticCaliber _caliber;
private Container _ammoContainer; private Container _ammoContainer;
[ViewVariables]
private int _currentSlot = 0; private int _currentSlot = 0;
public override int Capacity => _ammoSlots.Length; public override int Capacity => _ammoSlots.Length;
private IEntity[] _ammoSlots; private IEntity[] _ammoSlots;
@@ -39,6 +42,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
public override int ShotsLeft => _ammoContainer.ContainedEntities.Count; public override int ShotsLeft => _ammoContainer.ContainedEntities.Count;
private AppearanceComponent _appearanceComponent; private AppearanceComponent _appearanceComponent;
[ViewVariables]
private string _fillPrototype; private string _fillPrototype;
private int _unspawnedCount; private int _unspawnedCount;

View File

@@ -114,11 +114,13 @@ namespace Content.Server.GameObjects.Components
/// <summary> /// <summary>
/// Contains all registered wires. /// Contains all registered wires.
/// </summary> /// </summary>
[ViewVariables]
public readonly List<Wire> WiresList = new List<Wire>(); public readonly List<Wire> WiresList = new List<Wire>();
/// <summary> /// <summary>
/// Status messages are displayed at the bottom of the UI. /// Status messages are displayed at the bottom of the UI.
/// </summary> /// </summary>
[ViewVariables]
private readonly Dictionary<object, object> _statuses = new Dictionary<object, object>(); private readonly Dictionary<object, object> _statuses = new Dictionary<object, object>();
/// <summary> /// <summary>

View File

@@ -78,7 +78,9 @@ namespace Content.Shared.GameObjects.Components.Movement
} }
} }
[ViewVariables(VVAccess.ReadWrite)]
public float CurrentPushSpeed => 5; public float CurrentPushSpeed => 5;
[ViewVariables(VVAccess.ReadWrite)]
public float GrabRange => 0.2f; public float GrabRange => 0.2f;
public bool Sprinting => !HasFlag(_heldMoveButtons, MoveButtons.Walk); public bool Sprinting => !HasFlag(_heldMoveButtons, MoveButtons.Walk);

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Components.UserInterface; using Robust.Shared.GameObjects.Components.UserInterface;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
namespace Content.Shared.GameObjects.Components.VendingMachines namespace Content.Shared.GameObjects.Components.VendingMachines
{ {
@@ -11,6 +12,7 @@ namespace Content.Shared.GameObjects.Components.VendingMachines
public override string Name => "VendingMachine"; public override string Name => "VendingMachine";
public override uint? NetID => ContentNetIDs.VENDING_MACHINE; public override uint? NetID => ContentNetIDs.VENDING_MACHINE;
[ViewVariables]
public List<VendingMachineInventoryEntry> Inventory = new List<VendingMachineInventoryEntry>(); public List<VendingMachineInventoryEntry> Inventory = new List<VendingMachineInventoryEntry>();
[Serializable, NetSerializable] [Serializable, NetSerializable]
@@ -63,7 +65,9 @@ namespace Content.Shared.GameObjects.Components.VendingMachines
[Serializable, NetSerializable] [Serializable, NetSerializable]
public class VendingMachineInventoryEntry public class VendingMachineInventoryEntry
{ {
[ViewVariables(VVAccess.ReadWrite)]
public string ID; public string ID;
[ViewVariables(VVAccess.ReadWrite)]
public uint Amount; public uint Amount;
public VendingMachineInventoryEntry(string id, uint amount) public VendingMachineInventoryEntry(string id, uint amount)
{ {

View File

@@ -1,14 +1,20 @@
using System; using System;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.ViewVariables;
namespace Content.Shared.GameObjects.Components.Weapons.Ranged namespace Content.Shared.GameObjects.Components.Weapons.Ranged
{ {
public abstract class SharedRangedBarrelComponent : Component public abstract class SharedRangedBarrelComponent : Component
{ {
[ViewVariables]
public abstract FireRateSelector FireRateSelector { get; } public abstract FireRateSelector FireRateSelector { get; }
[ViewVariables]
public abstract FireRateSelector AllRateSelectors { get; } public abstract FireRateSelector AllRateSelectors { get; }
[ViewVariables]
public abstract float FireRate { get; } public abstract float FireRate { get; }
[ViewVariables]
public abstract int ShotsLeft { get; } public abstract int ShotsLeft { get; }
[ViewVariables]
public abstract int Capacity { get; } public abstract int Capacity { get; }
} }
@@ -19,4 +25,4 @@ namespace Content.Shared.GameObjects.Components.Weapons.Ranged
Single = 1 << 0, Single = 1 << 0,
Automatic = 1 << 1, Automatic = 1 << 1,
} }
} }