Skip to content

Commit

Permalink
fix?
Browse files Browse the repository at this point in the history
  • Loading branch information
Rxup committed Dec 27, 2023
1 parent 893a102 commit 795bbd7
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Numerics;
using Content.Server.Mind;
using Content.Server.Backmen.Species.Shadowkin.Events;
using Content.Server.Preferences.Managers;
using Content.Shared.Bed.Sleep;
using Content.Shared.Cuffs.Components;
using Content.Shared.Examine;
Expand All @@ -13,6 +14,7 @@
using Content.Shared.Humanoid;
using Robust.Server.Player;
using Robust.Shared.Map;
using Robust.Shared.Player;
using Robust.Shared.Random;

namespace Content.Server.Backmen.Species.Shadowkin.Systems;
Expand All @@ -25,6 +27,7 @@ public sealed class ShadowkinSystem : EntitySystem
[Dependency] private readonly MobStateSystem _mobState = default!;
[Dependency] private readonly MindSystem _mindSystem = default!;
[Dependency] private readonly ShadowkinBlackeyeSystem _shadowkinBlackeyeSystem = default!;
[Dependency] private readonly IServerPreferencesManager _prefs = default!;


public override void Initialize()
Expand All @@ -34,19 +37,18 @@ public override void Initialize()
SubscribeLocalEvent<ShadowkinComponent, ExaminedEvent>(OnExamine);
SubscribeLocalEvent<ShadowkinComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<ShadowkinComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<ShadowkinComponent, ComponentStartup>(OnMapInit, after: new[]{ typeof(SharedHumanoidAppearanceSystem) });
SubscribeLocalEvent<ShadowkinComponent, PlayerAttachedEvent>(OnMapInit, after: new[]{ typeof(SharedHumanoidAppearanceSystem) });
}

private void OnMapInit(Entity<ShadowkinComponent> ent, ref ComponentStartup args)
private void OnMapInit(Entity<ShadowkinComponent> ent, ref PlayerAttachedEvent args)
{
if (!TryComp<HumanoidAppearanceComponent>(ent, out var sprite))
return;

// Blackeye if none of the RGB values are greater than 75
if (sprite.EyeColor.R * 255 < 75 && sprite.EyeColor.G * 255 < 75 && sprite.EyeColor.B * 255 < 75)
{
// TODO: в данный момент почему-то всегда не приходит нужный цвент
//_shadowkinBlackeyeSystem.SetBlackEye(ent);
_shadowkinBlackeyeSystem.SetBlackEye(ent);
}
}

Expand Down

0 comments on commit 795bbd7

Please sign in to comment.