Files
tbd-station-14/Content.Shared/Gravity/GravityGeneratorComponent.cs
Justin Pfeifler 4f0b1f377e Gravity Generators cannot be unanchored while active (#41256)
* Add unanchor attempt check

* Combine shared component and server component

- Combines SharedGravityGeneratorComponent and GravityGeneratorComponent
- AutoNetworked the GravityActiveBool

* Remove SharedGravityGeneratorComponent

* Update to SharedGravityGeneratorComponent

* Fix to be a complete sentence

* Dirty GravityActive whenever changed

* Rename component and remove view variables

* Update referenced component name

* Move unanchor attempt to shared system

* Add client system

* Revert popup to PopupEntity

* Fix popup to be PopupClient

* Set access restriction on GravityActive
2025-11-07 00:53:27 +00:00

48 lines
1.6 KiB
C#

using Content.Shared.Power;
using Robust.Shared.GameStates;
namespace Content.Shared.Gravity;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class GravityGeneratorComponent : Component
{
[DataField] public float LightRadiusMin { get; set; }
[DataField] public float LightRadiusMax { get; set; }
/// <summary>
/// A map of the sprites used by the gravity generator given its status.
/// </summary>
[DataField, Access(typeof(SharedGravitySystem))]
public Dictionary<PowerChargeStatus, string> SpriteMap = [];
/// <summary>
/// The sprite used by the core of the gravity generator when the gravity generator is starting up.
/// </summary>
[DataField]
public string CoreStartupState = "startup";
/// <summary>
/// The sprite used by the core of the gravity generator when the gravity generator is idle.
/// </summary>
[DataField]
public string CoreIdleState = "idle";
/// <summary>
/// The sprite used by the core of the gravity generator when the gravity generator is activating.
/// </summary>
[DataField]
public string CoreActivatingState = "activating";
/// <summary>
/// The sprite used by the core of the gravity generator when the gravity generator is active.
/// </summary>
[DataField]
public string CoreActivatedState = "activated";
/// <summary>
/// Is the gravity generator currently "producing" gravity?
/// </summary>
[DataField, AutoNetworkedField, Access(typeof(SharedGravityGeneratorSystem))]
public bool GravityActive = false;
}