Per-map parallax support (#9786)
* Per-map parallax support * Comments for future sloth * c * bet * Fix exception * VV support * Fix parallax * mem * weightless sounds * Gravity stuff * placeholder coz im too lazy to stash don't @ me son * decent clouds * sky * Fast parallax * Imagine spelling * Loicense * perish * Fix weightless status Co-authored-by: metalgearsloth <metalgearsloth@gmail.com>
This commit is contained in:
28
Content.Shared/Parallax/ParallaxComponent.cs
Normal file
28
Content.Shared/Parallax/ParallaxComponent.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared.Parallax;
|
||||
|
||||
/// <summary>
|
||||
/// Handles per-map parallax
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed class ParallaxComponent : Component
|
||||
{
|
||||
// I wish I could use a typeserializer here but parallax is extremely client-dependent.
|
||||
[DataField("parallax")]
|
||||
public string Parallax = "Default";
|
||||
|
||||
[UsedImplicitly, ViewVariables(VVAccess.ReadWrite)]
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public string ParallaxVV
|
||||
{
|
||||
get => Parallax;
|
||||
set
|
||||
{
|
||||
if (value.Equals(Parallax)) return;
|
||||
Parallax = value;
|
||||
IoCManager.Resolve<IEntityManager>().Dirty(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user