-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #277 from PyotrIgn/try_of_fix_vyleti_yobannie
Попытка пофиксить вылеты + завершение праздников
- Loading branch information
Showing
22 changed files
with
21,265 additions
and
17,010 deletions.
There are no files selected for viewing
460 changes: 230 additions & 230 deletions
460
Content.Client/Sirena/EntityHealthBar/EntityHealthBarOverlay.cs
Large diffs are not rendered by default.
Oops, something went wrong.
108 changes: 54 additions & 54 deletions
108
Content.Client/Sirena/EntityHealthBar/ShowHealthBarsSystem.cs
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 |
---|---|---|
@@ -1,64 +1,64 @@ | ||
using Content.Shared.GameTicking; | ||
using Content.Shared.Sirena.EntityHealthBar; | ||
using Robust.Client.Graphics; | ||
using Robust.Client.Player; | ||
using Robust.Shared.Player; | ||
using Robust.Shared.Prototypes; | ||
//using Content.Shared.GameTicking; | ||
//using Content.Shared.Sirena.EntityHealthBar; | ||
//using Robust.Client.Graphics; | ||
//using Robust.Client.Player; | ||
//using Robust.Shared.Player; | ||
//using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Client.Sirena.EntityHealthBar | ||
{ | ||
public sealed class ShowHealthBarsSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IPlayerManager _player = default!; | ||
[Dependency] private readonly IPrototypeManager _protoMan = default!; | ||
[Dependency] private readonly IOverlayManager _overlayMan = default!; | ||
//namespace Content.Client.Sirena.EntityHealthBar | ||
//{ | ||
// public sealed class ShowHealthBarsSystem : EntitySystem | ||
// { | ||
// [Dependency] private readonly IPlayerManager _player = default!; | ||
// [Dependency] private readonly IPrototypeManager _protoMan = default!; | ||
// [Dependency] private readonly IOverlayManager _overlayMan = default!; | ||
|
||
private EntityHealthBarOverlay _overlay = default!; | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
// private EntityHealthBarOverlay _overlay = default!; | ||
// public override void Initialize() | ||
// { | ||
// base.Initialize(); | ||
|
||
SubscribeLocalEvent<ShowHealthBarsComponent, ComponentInit>(OnInit); | ||
SubscribeLocalEvent<ShowHealthBarsComponent, ComponentRemove>(OnRemove); | ||
SubscribeLocalEvent<ShowHealthBarsComponent, LocalPlayerAttachedEvent>(OnPlayerAttached); | ||
SubscribeLocalEvent<ShowHealthBarsComponent, LocalPlayerDetachedEvent>(OnPlayerDetached); | ||
SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestart); | ||
// SubscribeLocalEvent<ShowHealthBarsComponent, ComponentInit>(OnInit); | ||
// SubscribeLocalEvent<ShowHealthBarsComponent, ComponentRemove>(OnRemove); | ||
// SubscribeLocalEvent<ShowHealthBarsComponent, LocalPlayerAttachedEvent>(OnPlayerAttached); | ||
// SubscribeLocalEvent<ShowHealthBarsComponent, LocalPlayerDetachedEvent>(OnPlayerDetached); | ||
// SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestart); | ||
|
||
_overlay = new(EntityManager, _protoMan); | ||
} | ||
// _overlay = new(EntityManager, _protoMan); | ||
// } | ||
|
||
private void OnInit(EntityUid uid, ShowHealthBarsComponent component, ComponentInit args) | ||
{ | ||
if (_player.LocalPlayer?.ControlledEntity == uid) | ||
{ | ||
_overlayMan.AddOverlay(_overlay); | ||
_overlay.DamageContainer = component.DamageContainer; | ||
} | ||
// private void OnInit(EntityUid uid, ShowHealthBarsComponent component, ComponentInit args) | ||
// { | ||
// if (_player.LocalPlayer?.ControlledEntity == uid) | ||
// { | ||
// _overlayMan.AddOverlay(_overlay); | ||
// _overlay.DamageContainer = component.DamageContainer; | ||
// } | ||
|
||
|
||
} | ||
private void OnRemove(EntityUid uid, ShowHealthBarsComponent component, ComponentRemove args) | ||
{ | ||
if (_player.LocalPlayer?.ControlledEntity == uid) | ||
{ | ||
_overlayMan.RemoveOverlay(_overlay); | ||
} | ||
} | ||
// } | ||
// private void OnRemove(EntityUid uid, ShowHealthBarsComponent component, ComponentRemove args) | ||
// { | ||
// if (_player.LocalPlayer?.ControlledEntity == uid) | ||
// { | ||
// _overlayMan.RemoveOverlay(_overlay); | ||
// } | ||
// } | ||
|
||
private void OnPlayerAttached(EntityUid uid, ShowHealthBarsComponent component, LocalPlayerAttachedEvent args) | ||
{ | ||
_overlayMan.AddOverlay(_overlay); | ||
_overlay.DamageContainer = component.DamageContainer; | ||
} | ||
// private void OnPlayerAttached(EntityUid uid, ShowHealthBarsComponent component, LocalPlayerAttachedEvent args) | ||
// { | ||
// _overlayMan.AddOverlay(_overlay); | ||
// _overlay.DamageContainer = component.DamageContainer; | ||
// } | ||
|
||
private void OnPlayerDetached(EntityUid uid, ShowHealthBarsComponent component, LocalPlayerDetachedEvent args) | ||
{ | ||
_overlayMan.RemoveOverlay(_overlay); | ||
} | ||
// private void OnPlayerDetached(EntityUid uid, ShowHealthBarsComponent component, LocalPlayerDetachedEvent args) | ||
// { | ||
// _overlayMan.RemoveOverlay(_overlay); | ||
// } | ||
|
||
private void OnRoundRestart(RoundRestartCleanupEvent args) | ||
{ | ||
_overlayMan.RemoveOverlay(_overlay); | ||
} | ||
} | ||
} | ||
// private void OnRoundRestart(RoundRestartCleanupEvent args) | ||
// { | ||
// _overlayMan.RemoveOverlay(_overlay); | ||
// } | ||
// } | ||
//} |
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
Oops, something went wrong.