* Fix huds

* No unshaded
This commit is contained in:
Aviu00
2023-08-07 13:30:21 +03:00
committed by Aviu00
parent 1f42f3bd3a
commit 64f8083539
13 changed files with 88 additions and 81 deletions

View File

@@ -1,6 +1,6 @@
using Robust.Client.Player;
using Robust.Shared.Console;
using Content.Shared.EntityHealthBar;
using Content.Shared.White.EntityHealthBar;
namespace Content.Client.Commands
{

View File

@@ -19,24 +19,19 @@ public sealed class EntityCrimeRecordsOverlay : Overlay
{
private readonly IEntityManager _entManager;
private readonly SharedTransformSystem _transform;
private readonly IPrototypeManager _prototypeManager;
private readonly InventorySystem _inventorySystem;
private readonly ShaderInstance _shader;
private readonly ShowCrimeRecordsSystem _parentSystem;
public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowFOV;
public EntityCrimeRecordsOverlay(
IEntityManager entManager,
IPrototypeManager protoManager,
InventorySystem inventorySystem,
ShowCrimeRecordsSystem showCrimSystem)
{
_entManager = entManager;
_prototypeManager = protoManager;
_inventorySystem = inventorySystem;
_parentSystem = showCrimSystem;
_transform = _entManager.EntitySysManager.GetEntitySystem<SharedTransformSystem>();
_shader = protoManager.Index<ShaderPrototype>("unshaded").Instance();
}
protected override void Draw(in OverlayDrawArgs args)
@@ -49,7 +44,6 @@ public sealed class EntityCrimeRecordsOverlay : Overlay
const float scale = 1f;
var scaleMatrix = Matrix3.CreateScale(new Vector2(scale, scale));
var rotationMatrix = Matrix3.CreateRotation(-rotation);
handle.UseShader(_shader);
// da pizda
this.ZIndex = this.ZIndex -= 1;

View File

@@ -30,7 +30,7 @@ namespace Content.Client.White.EntityCrimeRecords
SubscribeLocalEvent<ShowCrimeRecordsComponent, PlayerDetachedEvent>(OnPlayerDetached);
SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestart);
_overlay = new(EntityManager, _protoMan, _inventorySystem, this);
_overlay = new(EntityManager, _inventorySystem, this);
}
private void OnInit(EntityUid uid, ShowCrimeRecordsComponent component, ComponentInit args)

View File

@@ -11,7 +11,7 @@ using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using Robust.Shared.Timing;
namespace Content.Client.EntityHealthBar;
namespace Content.Client.White.EntityHealthBar;
/// <summary>
/// Yeah a lot of this is duplicated from doafters.

View File

@@ -1,11 +1,11 @@
using Content.Shared.EntityHealthBar;
using Content.Shared.White.EntityHealthBar;
using Content.Shared.GameTicking;
using Robust.Client.Player;
using Robust.Client.Graphics;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
namespace Content.Client.EntityHealthBar
namespace Content.Client.White.EntityHealthBar
{
public sealed class ShowHealthBarsSystem : EntitySystem
{

View File

@@ -11,7 +11,7 @@ using Content.Shared.Roles;
using System.Diagnostics.CodeAnalysis;
using System.Numerics;
namespace Content.Client.EntityJobInfo;
namespace Content.Client.White.EntityJobInfo;
public sealed class EntityJobInfoOverlay : Overlay
{
@@ -19,7 +19,6 @@ public sealed class EntityJobInfoOverlay : Overlay
private readonly SharedTransformSystem _transform;
private readonly IPrototypeManager _prototypeManager;
private readonly InventorySystem _inventorySystem;
private readonly ShaderInstance _shader;
public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowFOV;
public EntityJobInfoOverlay(IEntityManager entManager, IPrototypeManager protoManager, InventorySystem inventorySystem)
@@ -28,7 +27,6 @@ public sealed class EntityJobInfoOverlay : Overlay
_prototypeManager = protoManager;
_inventorySystem = inventorySystem;
_transform = _entManager.EntitySysManager.GetEntitySystem<SharedTransformSystem>();
_shader = protoManager.Index<ShaderPrototype>("unshaded").Instance();
}
protected override void Draw(in OverlayDrawArgs args)
@@ -41,7 +39,6 @@ public sealed class EntityJobInfoOverlay : Overlay
const float scale = 1f;
var scaleMatrix = Matrix3.CreateScale(new Vector2(scale, scale));
var rotationMatrix = Matrix3.CreateRotation(-rotation);
handle.UseShader(_shader);
foreach (var hum in _entManager.EntityQuery<HumanoidAppearanceComponent>(true))
{

View File

@@ -1,4 +1,4 @@
using Content.Shared.EntityJobInfo;
using Content.Shared.White.EntityJobInfo;
using Content.Shared.GameTicking;
using Robust.Client.Player;
using Robust.Client.Graphics;
@@ -7,14 +7,15 @@ using Robust.Shared.Prototypes;
using Content.Shared.Inventory;
using Robust.Shared.Player;
namespace Content.Client.EntityJobInfo
{
namespace Content.Client.White.EntityJobInfo;
public sealed class ShowJobInfoSystem : EntitySystem
{
[Dependency] private readonly IPlayerManager _player = default!;
[Dependency] private readonly IPrototypeManager _protoMan = default!;
[Dependency] private readonly IOverlayManager _overlayMan = default!;
[Dependency] private readonly InventorySystem _inventorySystem = default!;
[Dependency] private readonly ILogManager _log = default!;
private EntityJobInfoOverlay _overlay = default!;
public override void Initialize()
@@ -36,9 +37,8 @@ namespace Content.Client.EntityJobInfo
{
_overlayMan.AddOverlay(_overlay);
}
}
private void OnRemove(EntityUid uid, ShowJobInfoComponent component, ComponentRemove args)
{
if (_player.LocalPlayer?.ControlledEntity == uid)
@@ -62,4 +62,3 @@ namespace Content.Client.EntityJobInfo
_overlayMan.RemoveOverlay(_overlay);
}
}
}

View File

@@ -1,15 +1,17 @@
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
namespace Content.Shared.Clothing
{
[RegisterComponent]
namespace Content.Shared.White.ClothingGrant.Components;
[RegisterComponent, NetworkedComponent]
[AutoGenerateComponentState]
public sealed partial class ClothingGrantComponentComponent : Component
{
[DataField("component", required: true)]
[AlwaysPushInheritance]
public ComponentRegistry Components { get; set; } = new();
public ComponentRegistry Components { get; private set; } = new();
[ViewVariables(VVAccess.ReadWrite)]
[AutoNetworkedField]
public bool IsActive = false;
}
}

View File

@@ -1,11 +1,16 @@
namespace Content.Shared.Clothing
using Robust.Shared.GameStates;
namespace Content.Shared.White.ClothingGrant.Components
{
[RegisterComponent]
[RegisterComponent, NetworkedComponent]
[AutoGenerateComponentState]
public sealed partial class ClothingGrantTagComponent : Component
{
[DataField("tag", required: true), ViewVariables(VVAccess.ReadWrite)]
public string Tag = "";
[ViewVariables(VVAccess.ReadWrite)] public bool IsActive = false;
[ViewVariables(VVAccess.ReadWrite)]
[AutoNetworkedField]
public bool IsActive = false;
}
}

View File

@@ -2,8 +2,9 @@ using Content.Shared.Clothing.Components;
using Content.Shared.Inventory.Events;
using Robust.Shared.Serialization.Manager;
using Content.Shared.Tag;
using Content.Shared.White.ClothingGrant.Components;
namespace Content.Shared.Clothing;
namespace Content.Shared.White.ClothingGrant.Systems;
public sealed class ClothingGrantingSystem : EntitySystem
{
@@ -44,9 +45,10 @@ public sealed class ClothingGrantingSystem : EntitySystem
var temp = (object) newComp;
_serializationManager.CopyTo(data.Component, ref temp);
EntityManager.AddComponent(args.Equipee, (Component)temp!);
}
component.IsActive = true;
}
Dirty(component);
}
private void OnCompUnequip(EntityUid uid, ClothingGrantComponentComponent component, GotUnequippedEvent args)
@@ -61,6 +63,7 @@ public sealed class ClothingGrantingSystem : EntitySystem
}
component.IsActive = false;
Dirty(component);
}
private void OnTagEquip(EntityUid uid, ClothingGrantTagComponent component, GotEquippedEvent args)
@@ -73,6 +76,7 @@ public sealed class ClothingGrantingSystem : EntitySystem
_tagSystem.AddTag(args.Equipee, component.Tag);
component.IsActive = true;
Dirty(component);
}
private void OnTagUnequip(EntityUid uid, ClothingGrantTagComponent component, GotUnequippedEvent args)
@@ -82,5 +86,6 @@ public sealed class ClothingGrantingSystem : EntitySystem
_tagSystem.RemoveTag(args.Equipee, component.Tag);
component.IsActive = false;
Dirty(component);
}
}

View File

@@ -1,9 +1,11 @@
using Robust.Shared.GameStates;
namespace Content.Shared.White.EntityCrimeRecords
{
/// <summary>
/// Allow to see crime records info for character
/// </summary>
[RegisterComponent]
[RegisterComponent, NetworkedComponent]
public sealed partial class ShowCrimeRecordsComponent : Component
{
}

View File

@@ -1,14 +1,15 @@
using Content.Shared.Damage.Prototypes;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.EntityHealthBar
namespace Content.Shared.White.EntityHealthBar
{
/// <summary>
/// This component allows you to see health bars above damageable mobs.
/// </summary>
[RegisterComponent]
public sealed partial class ShowWhiteHealthBarsComponent : Component
[RegisterComponent, NetworkedComponent]
public sealed partial class ShowHealthBarsComponent : Component
{
/// <summary>
/// Displays health bars of the damage containers.

View File

@@ -1,9 +1,11 @@
namespace Content.Shared.EntityJobInfo;
using Robust.Shared.GameStates;
namespace Content.Shared.White.EntityJobInfo;
/// <summary>
/// This component allows you to see job icon from entity(char)
/// </summary>
[RegisterComponent]
[RegisterComponent, NetworkedComponent]
public sealed partial class ShowJobInfoComponent : Component
{
}