Make more fields VV-writeable (#21754)

This commit is contained in:
LordEclipse
2023-11-19 15:17:53 -05:00
committed by GitHub
parent 808555ade6
commit f3df6b85af
13 changed files with 28 additions and 28 deletions

View File

@@ -43,7 +43,7 @@ namespace Content.Server.Atmos.Components
/// <summary> /// <summary>
/// Whether the entity is immuned to pressure (i.e possess the PressureImmunity component) /// Whether the entity is immuned to pressure (i.e possess the PressureImmunity component)
/// </summary> /// </summary>
[ViewVariables] [ViewVariables(VVAccess.ReadWrite)]
public bool HasImmunity = false; public bool HasImmunity = false;
} }

View File

@@ -6,7 +6,7 @@ namespace Content.Server.Forensics
[RegisterComponent] [RegisterComponent]
public sealed partial class FingerprintComponent : Component public sealed partial class FingerprintComponent : Component
{ {
[DataField("fingerprint")] [DataField("fingerprint"), ViewVariables(VVAccess.ReadWrite)]
public string? Fingerprint; public string? Fingerprint;
} }
} }

View File

@@ -21,7 +21,7 @@ public sealed partial class GatewayComponent : Component
/// <summary> /// <summary>
/// Can the gateway be interacted with? If false then only settable via admins / mappers. /// Can the gateway be interacted with? If false then only settable via admins / mappers.
/// </summary> /// </summary>
[DataField] [DataField, ViewVariables(VVAccess.ReadWrite)]
public bool Interactable = true; public bool Interactable = true;
/// <summary> /// <summary>

View File

@@ -11,14 +11,14 @@ namespace Content.Shared.Access.Components
[Access(typeof(SharedIdCardSystem), typeof(SharedPdaSystem), typeof(SharedAgentIdCardSystem), Other = AccessPermissions.ReadWrite)] [Access(typeof(SharedIdCardSystem), typeof(SharedPdaSystem), typeof(SharedAgentIdCardSystem), Other = AccessPermissions.ReadWrite)]
public sealed partial class IdCardComponent : Component public sealed partial class IdCardComponent : Component
{ {
[DataField("fullName")] [DataField("fullName"), ViewVariables(VVAccess.ReadWrite)]
[AutoNetworkedField] [AutoNetworkedField]
// FIXME Friends // FIXME Friends
public string? FullName; public string? FullName;
[DataField("jobTitle")] [DataField("jobTitle")]
[AutoNetworkedField] [AutoNetworkedField]
[Access(typeof(SharedIdCardSystem), typeof(SharedPdaSystem), typeof(SharedAgentIdCardSystem), Other = AccessPermissions.ReadWrite)] [Access(typeof(SharedIdCardSystem), typeof(SharedPdaSystem), typeof(SharedAgentIdCardSystem), Other = AccessPermissions.ReadWrite), ViewVariables(VVAccess.ReadWrite)]
public string? JobTitle; public string? JobTitle;
/// <summary> /// <summary>

View File

@@ -44,10 +44,10 @@ public sealed partial class GhostComponent : Component
[ViewVariables(VVAccess.ReadWrite), DataField] [ViewVariables(VVAccess.ReadWrite), DataField]
public TimeSpan TimeOfDeath = TimeSpan.Zero; public TimeSpan TimeOfDeath = TimeSpan.Zero;
[DataField("booRadius")] [DataField("booRadius"), ViewVariables(VVAccess.ReadWrite)]
public float BooRadius = 3; public float BooRadius = 3;
[DataField("booMaxTargets")] [DataField("booMaxTargets"), ViewVariables(VVAccess.ReadWrite)]
public int BooMaxTargets = 3; public int BooMaxTargets = 3;
// TODO: instead of this funny stuff just give it access and update in system dirtying when needed // TODO: instead of this funny stuff just give it access and update in system dirtying when needed

View File

@@ -22,7 +22,7 @@ public sealed partial class MechComponent : Component
/// <summary> /// <summary>
/// The maximum amount of damage the mech can take. /// The maximum amount of damage the mech can take.
/// </summary> /// </summary>
[DataField, AutoNetworkedField] [DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
public FixedPoint2 MaxIntegrity = 250; public FixedPoint2 MaxIntegrity = 250;
/// <summary> /// <summary>
@@ -36,7 +36,7 @@ public sealed partial class MechComponent : Component
/// The maximum amount of energy the mech can have. /// The maximum amount of energy the mech can have.
/// Derived from the currently inserted battery. /// Derived from the currently inserted battery.
/// </summary> /// </summary>
[DataField, AutoNetworkedField] [DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
public FixedPoint2 MaxEnergy = 0; public FixedPoint2 MaxEnergy = 0;
/// <summary> /// <summary>
@@ -52,7 +52,7 @@ public sealed partial class MechComponent : Component
/// A multiplier used to calculate how much of the damage done to a mech /// A multiplier used to calculate how much of the damage done to a mech
/// is transfered to the pilot /// is transfered to the pilot
/// </summary> /// </summary>
[DataField] [DataField, ViewVariables(VVAccess.ReadWrite)]
public float MechToPilotDamageMultiplier; public float MechToPilotDamageMultiplier;
/// <summary> /// <summary>
@@ -80,7 +80,7 @@ public sealed partial class MechComponent : Component
/// <summary> /// <summary>
/// The maximum amount of equipment items that can be installed in the mech /// The maximum amount of equipment items that can be installed in the mech
/// </summary> /// </summary>
[DataField("maxEquipmentAmount")] [DataField("maxEquipmentAmount"), ViewVariables(VVAccess.ReadWrite)]
public int MaxEquipmentAmount = 3; public int MaxEquipmentAmount = 3;
/// <summary> /// <summary>
@@ -104,20 +104,20 @@ public sealed partial class MechComponent : Component
/// <summary> /// <summary>
/// How long it takes to enter the mech. /// How long it takes to enter the mech.
/// </summary> /// </summary>
[DataField] [DataField, ViewVariables(VVAccess.ReadWrite)]
public float EntryDelay = 3; public float EntryDelay = 3;
/// <summary> /// <summary>
/// How long it takes to pull *another person* /// How long it takes to pull *another person*
/// outside of the mech. You can exit instantly yourself. /// outside of the mech. You can exit instantly yourself.
/// </summary> /// </summary>
[DataField] [DataField, ViewVariables(VVAccess.ReadWrite)]
public float ExitDelay = 3; public float ExitDelay = 3;
/// <summary> /// <summary>
/// How long it takes to pull out the battery. /// How long it takes to pull out the battery.
/// </summary> /// </summary>
[DataField] [DataField, ViewVariables(VVAccess.ReadWrite)]
public float BatteryRemovalDelay = 2; public float BatteryRemovalDelay = 2;
/// <summary> /// <summary>

View File

@@ -13,16 +13,16 @@ namespace Content.Shared.Nutrition.Components
/// <summary> /// <summary>
/// Solution inhale amount per second. /// Solution inhale amount per second.
/// </summary> /// </summary>
[DataField("inhaleAmount")] [DataField("inhaleAmount"), ViewVariables(VVAccess.ReadWrite)]
public FixedPoint2 InhaleAmount { get; private set; } = FixedPoint2.New(0.05f); public FixedPoint2 InhaleAmount { get; private set; } = FixedPoint2.New(0.05f);
[DataField("state")] [DataField("state")]
public SmokableState State { get; set; } = SmokableState.Unlit; public SmokableState State { get; set; } = SmokableState.Unlit;
[DataField("exposeTemperature")] [DataField("exposeTemperature"), ViewVariables(VVAccess.ReadWrite)]
public float ExposeTemperature { get; set; } = 0; public float ExposeTemperature { get; set; } = 0;
[DataField("exposeVolume")] [DataField("exposeVolume"), ViewVariables(VVAccess.ReadWrite)]
public float ExposeVolume { get; set; } = 1f; public float ExposeVolume { get; set; } = 1f;
// clothing prefixes // clothing prefixes

View File

@@ -19,10 +19,10 @@ public sealed partial class ThirstComponent : Component
[AutoNetworkedField] [AutoNetworkedField]
public float ActualDecayRate; public float ActualDecayRate;
[DataField, AutoNetworkedField] [DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
public ThirstThreshold CurrentThirstThreshold; public ThirstThreshold CurrentThirstThreshold;
[DataField, AutoNetworkedField] [DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
public ThirstThreshold LastThirstThreshold; public ThirstThreshold LastThirstThreshold;
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]

View File

@@ -33,7 +33,7 @@ namespace Content.Shared.PDA
[ViewVariables] public EntityUid? ContainedId; [ViewVariables] public EntityUid? ContainedId;
[ViewVariables] public bool FlashlightOn; [ViewVariables] public bool FlashlightOn;
[ViewVariables] public string? OwnerName; [ViewVariables(VVAccess.ReadWrite)] public string? OwnerName;
[ViewVariables] public string? StationName; [ViewVariables] public string? StationName;
[ViewVariables] public string? StationAlertLevel; [ViewVariables] public string? StationAlertLevel;
[ViewVariables] public Color StationAlertColor = Color.White; [ViewVariables] public Color StationAlertColor = Color.White;

View File

@@ -21,7 +21,7 @@ public sealed partial class LinkedEntityComponent : Component
/// <summary> /// <summary>
/// Should this entity be deleted if all of its links are removed? /// Should this entity be deleted if all of its links are removed?
/// </summary> /// </summary>
[DataField] [DataField, ViewVariables(VVAccess.ReadWrite)]
public bool DeleteOnEmptyLinks; public bool DeleteOnEmptyLinks;
} }

View File

@@ -26,7 +26,7 @@ public sealed partial class PortalComponent : Component
/// <summary> /// <summary>
/// If no portals are linked, the subject will be teleported a random distance at maximum this far away. /// If no portals are linked, the subject will be teleported a random distance at maximum this far away.
/// </summary> /// </summary>
[DataField("maxRandomRadius")] [DataField("maxRandomRadius"), ViewVariables(VVAccess.ReadWrite)]
public float MaxRandomRadius = 7.0f; public float MaxRandomRadius = 7.0f;
/// <summary> /// <summary>
@@ -45,12 +45,12 @@ public sealed partial class PortalComponent : Component
/// <remarks> /// <remarks>
/// Obviously this should strictly be larger than <see cref="MaxRandomRadius"/> (or null) /// Obviously this should strictly be larger than <see cref="MaxRandomRadius"/> (or null)
/// </remarks> /// </remarks>
[DataField("maxTeleportRadius")] [DataField("maxTeleportRadius"), ViewVariables(VVAccess.ReadWrite)]
public float? MaxTeleportRadius; public float? MaxTeleportRadius;
/// <summary> /// <summary>
/// Should we teleport randomly if nothing is linked. /// Should we teleport randomly if nothing is linked.
/// </summary> /// </summary>
[DataField, AutoNetworkedField] [DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
public bool RandomTeleport = true; public bool RandomTeleport = true;
} }

View File

@@ -5,14 +5,14 @@ public abstract partial class BatteryAmmoProviderComponent : AmmoProviderCompone
/// <summary> /// <summary>
/// How much battery it costs to fire once. /// How much battery it costs to fire once.
/// </summary> /// </summary>
[DataField("fireCost")] [DataField("fireCost"), ViewVariables(VVAccess.ReadWrite)]
public float FireCost = 100; public float FireCost = 100;
// Batteries aren't predicted which means we need to track the battery and manually count it ourselves woo! // Batteries aren't predicted which means we need to track the battery and manually count it ourselves woo!
[ViewVariables] [ViewVariables(VVAccess.ReadWrite)]
public int Shots; public int Shots;
[ViewVariables] [ViewVariables(VVAccess.ReadWrite)]
public int Capacity; public int Capacity;
} }

View File

@@ -149,7 +149,7 @@ public partial class GunComponent : Component
/// Whether or not someone with the /// Whether or not someone with the
/// clumsy trait can shoot this /// clumsy trait can shoot this
/// </summary> /// </summary>
[DataField("clumsyProof")] [DataField("clumsyProof"), ViewVariables(VVAccess.ReadWrite)]
public bool ClumsyProof = false; public bool ClumsyProof = false;
} }