forked from new-frontiers-14/frontier-station-14
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Robust.Shared.Audio; | ||
|
||
namespace Content.Server.Corvax.Elzuosa | ||
{ | ||
[RegisterComponent] | ||
public sealed partial class ElzuosaColorComponent : Component | ||
{ | ||
public Color SkinColor { get; set; } | ||
|
||
public bool Hacked { get; set; } = false; | ||
|
||
[DataField("cycleRate")] | ||
public float CycleRate = 1f; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Content.Shared.Humanoid; | ||
using Content.Shared.Preferences; | ||
using Robust.Server.GameObjects; | ||
using Content.Server.GameTicking; | ||
namespace Content.Server.Corvax.Elzuosa | ||
{ | ||
public sealed class ElzuosaColorSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly PointLightSystem _pointLightSystem = default!; | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<ElzuosaColorComponent, PlayerSpawnCompleteEvent>(OnPlayerSpawn); | ||
} | ||
|
||
private void OnPlayerSpawn(EntityUid uid, ElzuosaColorComponent comp, PlayerSpawnCompleteEvent args) | ||
{ | ||
if (!HasComp<HumanoidAppearanceComponent>(uid)) | ||
return; | ||
if (args == null) | ||
return; | ||
var profile = args.Profile; | ||
SetEntityPointLightColor(uid, profile); | ||
} | ||
|
||
public void SetEntityPointLightColor(EntityUid uid, HumanoidCharacterProfile? profile) | ||
{ | ||
if (profile == null) | ||
return; | ||
|
||
var color = profile.Appearance.SkinColor; | ||
_pointLightSystem.SetColor(uid,color); | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters