mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* Predict Light Replacers * Public once more * Light changes * Introduce an OrderList. * Added Radial Menu * Fix missing Dirty() * Introduce EntityProvider * Migratiooon! * Adress Reviews * Forgot Comments * Test-Fail Fix * Fixes * Update buttons * Revert "Update buttons" This reverts commit f84d8f2502600905a2ab4bce5463af6f2b4b1c3e. * Introduce Dedicated Short String * review * Another review has hit the PR Co-Authored-By: Whatstone <166147148+whatston3@users.noreply.github.com> * Adressing reviews Co-Authored-By: Whatstone <166147148+whatston3@users.noreply.github.com> * Update LightReplacerMenuBoundUserInterface.cs * refactor: do not pass ref type by ref, try not to create impure methods where it is not required * refactor: random xml-doc changes * refactor: more xml-doc, and 1 call per line convention * Small fixes * Iterate through the container * updated xml docs * IReadOnlyfix * refactor: renaming, whitespaces, use deconstructor in foreach, use Enumerable instead of creating additional list when its possible that it will be empty and wont be modified * refactor: fix collction cloning to not throw during modificaiton * Replace popups with sounds. * Added singular sounds * refactor: fix error on moving items from one EntityProvider to another and back when they have some spawned entities in container * Replaced Popup with Sound --------- Co-authored-by: Pok245 <113675512+Pok27@users.noreply.github.com> Co-authored-by: Whatstone <166147148+whatston3@users.noreply.github.com> Co-authored-by: Fildrance <fildrance@gmail.com>
124 lines
3.2 KiB
C#
124 lines
3.2 KiB
C#
using Robust.Shared.Audio;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Serialization;
|
|
|
|
namespace Content.Shared.Light.Components;
|
|
|
|
/// <summary>
|
|
/// Component that represents a light bulb. Can be broken, or burned, which turns them mostly useless.
|
|
/// TODO: Breaking and burning should probably be moved to another component eventually.
|
|
/// </summary>
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
|
public sealed partial class LightBulbComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// The color of the lightbulb and the light it produces.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public Color Color = Color.White;
|
|
|
|
/// <summary>
|
|
/// The type of lightbulb. Tube/bulb/etc...
|
|
/// </summary>
|
|
[DataField("bulb")]
|
|
public LightBulbType Type = LightBulbType.Tube;
|
|
|
|
/// <summary>
|
|
/// The initial state of the lightbulb.
|
|
/// </summary>
|
|
[DataField("startingState"), AutoNetworkedField]
|
|
public LightBulbState State = LightBulbState.Normal;
|
|
|
|
/// <summary>
|
|
/// The localized short name of the light. Used for the status control of the light replacer.
|
|
/// </summary>
|
|
/// <example>An orange light tube uses "orange" as its short name.</example>
|
|
[DataField]
|
|
public LocId? ShortName;
|
|
|
|
/// <summary>
|
|
/// The temperature the air around the lightbulb is exposed to when the lightbulb burns out.
|
|
/// </summary>
|
|
[DataField("BurningTemperature")]
|
|
public int BurningTemperature = 1400;
|
|
|
|
/// <summary>
|
|
/// Relates to how bright the light produced by the lightbulb is.
|
|
/// </summary>
|
|
[DataField]
|
|
public float LightEnergy = 0.8f;
|
|
|
|
/// <summary>
|
|
/// The maximum radius of the point light source this light produces.
|
|
/// </summary>
|
|
[DataField]
|
|
public float LightRadius = 10;
|
|
|
|
/// <summary>
|
|
/// Relates to the falloff constant of the light produced by the lightbulb.
|
|
/// </summary>
|
|
[DataField]
|
|
public float LightSoftness = 1;
|
|
|
|
/// <summary>
|
|
/// The amount of power used by the lightbulb when it's active.
|
|
/// </summary>
|
|
[DataField("PowerUse")]
|
|
public int PowerUse = 60;
|
|
|
|
/// <summary>
|
|
/// The sound produced when the lightbulb breaks.
|
|
/// </summary>
|
|
[DataField]
|
|
public SoundSpecifier BreakSound = new SoundCollectionSpecifier("GlassBreak", AudioParams.Default.AddVolume(-6f));
|
|
|
|
#region Appearance
|
|
|
|
/// <summary>
|
|
/// The sprite state used when the lightbulb is intact.
|
|
/// </summary>
|
|
[DataField]
|
|
public string NormalSpriteState = "normal";
|
|
|
|
/// <summary>
|
|
/// The sprite state used when the lightbulb is broken.
|
|
/// </summary>
|
|
[DataField]
|
|
public string BrokenSpriteState = "broken";
|
|
|
|
/// <summary>
|
|
/// The sprite state used when the lightbulb is burned.
|
|
/// </summary>
|
|
[DataField]
|
|
public string BurnedSpriteState = "burned";
|
|
|
|
#endregion Appearance
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public enum LightBulbState : byte
|
|
{
|
|
Normal,
|
|
Broken,
|
|
Burned,
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public enum LightBulbVisuals : byte
|
|
{
|
|
State,
|
|
Color
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public enum LightBulbType : byte
|
|
{
|
|
Bulb,
|
|
Tube,
|
|
}
|
|
|
|
[Serializable, NetSerializable]
|
|
public enum LightBulbVisualLayers : byte
|
|
{
|
|
Base,
|
|
}
|