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>
/// Whether the entity is immuned to pressure (i.e possess the PressureImmunity component)
/// </summary>
[ViewVariables]
[ViewVariables(VVAccess.ReadWrite)]
public bool HasImmunity = false;
}

View File

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

View File

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

View File

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

View File

@@ -44,10 +44,10 @@ public sealed partial class GhostComponent : Component
[ViewVariables(VVAccess.ReadWrite), DataField]
public TimeSpan TimeOfDeath = TimeSpan.Zero;
[DataField("booRadius")]
[DataField("booRadius"), ViewVariables(VVAccess.ReadWrite)]
public float BooRadius = 3;
[DataField("booMaxTargets")]
[DataField("booMaxTargets"), ViewVariables(VVAccess.ReadWrite)]
public int BooMaxTargets = 3;
// 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>
/// The maximum amount of damage the mech can take.
/// </summary>
[DataField, AutoNetworkedField]
[DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
public FixedPoint2 MaxIntegrity = 250;
/// <summary>
@@ -36,7 +36,7 @@ public sealed partial class MechComponent : Component
/// The maximum amount of energy the mech can have.
/// Derived from the currently inserted battery.
/// </summary>
[DataField, AutoNetworkedField]
[DataField, AutoNetworkedField, ViewVariables(VVAccess.ReadWrite)]
public FixedPoint2 MaxEnergy = 0;
/// <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
/// is transfered to the pilot
/// </summary>
[DataField]
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float MechToPilotDamageMultiplier;
/// <summary>
@@ -80,7 +80,7 @@ public sealed partial class MechComponent : Component
/// <summary>
/// The maximum amount of equipment items that can be installed in the mech
/// </summary>
[DataField("maxEquipmentAmount")]
[DataField("maxEquipmentAmount"), ViewVariables(VVAccess.ReadWrite)]
public int MaxEquipmentAmount = 3;
/// <summary>
@@ -104,20 +104,20 @@ public sealed partial class MechComponent : Component
/// <summary>
/// How long it takes to enter the mech.
/// </summary>
[DataField]
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float EntryDelay = 3;
/// <summary>
/// How long it takes to pull *another person*
/// outside of the mech. You can exit instantly yourself.
/// </summary>
[DataField]
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float ExitDelay = 3;
/// <summary>
/// How long it takes to pull out the battery.
/// </summary>
[DataField]
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float BatteryRemovalDelay = 2;
/// <summary>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -5,14 +5,14 @@ public abstract partial class BatteryAmmoProviderComponent : AmmoProviderCompone
/// <summary>
/// How much battery it costs to fire once.
/// </summary>
[DataField("fireCost")]
[DataField("fireCost"), ViewVariables(VVAccess.ReadWrite)]
public float FireCost = 100;
// 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;
[ViewVariables]
[ViewVariables(VVAccess.ReadWrite)]
public int Capacity;
}

View File

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