Skip to content

Commit

Permalink
Merge pull request AdventureTimeSS14#252 from FrisKisDr/origmaster
Browse files Browse the repository at this point in the history
Фикс мед худов
  • Loading branch information
FrisKisDr authored Dec 28, 2023
2 parents c210a1c + 9e822c3 commit 3f82c01
Show file tree
Hide file tree
Showing 9 changed files with 325 additions and 303 deletions.
461 changes: 230 additions & 231 deletions Content.Client/Sirena/EntityHealthBar/EntityHealthBarOverlay.cs

Large diffs are not rendered by default.

128 changes: 64 additions & 64 deletions Content.Client/Sirena/EntityHealthBar/ShowHealthBarsSystem.cs
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
// using Content.Shared.Sirena.EntityHealthBar;
// using Content.Shared.GameTicking;
// using Robust.Client.Player;
// using Robust.Client.Graphics;
// using Robust.Client.GameObjects;
// 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!;
//
// private EntityHealthBarOverlay _overlay = default!;
// public override void Initialize()
// {
// base.Initialize();
//
// SubscribeLocalEvent<ShowHealthBarsComponent, ComponentInit>(OnInit);
// SubscribeLocalEvent<ShowHealthBarsComponent, ComponentRemove>(OnRemove);
// SubscribeLocalEvent<ShowHealthBarsComponent, PlayerAttachedEvent>(OnPlayerAttached);
// SubscribeLocalEvent<ShowHealthBarsComponent, PlayerDetachedEvent>(OnPlayerDetached);
// SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestart);
//
// _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 OnRemove(EntityUid uid, ShowHealthBarsComponent component, ComponentRemove args)
// {
// if (_player.LocalPlayer?.ControlledEntity == uid)
// {
// _overlayMan.RemoveOverlay(_overlay);
// }
// }
//
// private void OnPlayerAttached(EntityUid uid, ShowHealthBarsComponent component, PlayerAttachedEvent args)
// {
// _overlayMan.AddOverlay(_overlay);
// _overlay.DamageContainer = component.DamageContainer;
// }
//
// private void OnPlayerDetached(EntityUid uid, ShowHealthBarsComponent component, PlayerDetachedEvent args)
// {
// _overlayMan.RemoveOverlay(_overlay);
// }
//
// private void OnRoundRestart(RoundRestartCleanupEvent args)
// {
// _overlayMan.RemoveOverlay(_overlay);
// }
// }
// }
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!;

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);

_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 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 OnPlayerDetached(EntityUid uid, ShowHealthBarsComponent component, LocalPlayerDetachedEvent args)
{
_overlayMan.RemoveOverlay(_overlay);
}

private void OnRoundRestart(RoundRestartCleanupEvent args)
{
_overlayMan.RemoveOverlay(_overlay);
}
}
}
10 changes: 9 additions & 1 deletion Resources/Changelog/ChangelogADT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -929,8 +929,16 @@ Entries:
id: 55648 #костыль отображения в Обновлениях
time: '2023-12-25T20:20:00.0000000+00:00'


- author: Friskis
changes:
- {message: "Медицинские худы теперь работают", type: Fix}
id: 55649 #костыль отображения в Обновлениях
time: '2023-12-27T20:04:00.0000000+00:00'

- author: Altius
changes:
- {message: Добавил хачапури. Пользуясь случаем; внёс в книгу рецептов некоторые дополнения, type: Add}
id: 55649 #костыль отображения в Обновлениях
id: 55650 #костыль отображения в Обновлениях
time: '2023-12-27T20:20:00.0000000+00:00'

Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
- id: ADTWiretapping
- type: Storage
grid:
- 0,0,10,7
- 0,0,1,0
maxItemSize: Small
- type: ContainerContainer
containers:
Expand Down
17 changes: 16 additions & 1 deletion Resources/Prototypes/Entities/Clothing/Eyes/hud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
- type: ClothingGrantComponent # Sirena-Edit's-Start
component:
- type: ShowHealthBars
damageContainer: Biological # Sirena-Edit's-End
damageContainer: Biological

- type: entity
parent: ClothingEyesBase
Expand Down Expand Up @@ -133,6 +133,10 @@
- type: Clothing
sprite: Clothing/Eyes/Hud/medonion.rsi
- type: ShowHungerIcons
- type: ClothingGrantComponent # Sirena-Edit's-Start
component:
- type: ShowHealthBars
damageContainer: Biological

- type: entity
parent: ClothingEyesBase
Expand All @@ -158,6 +162,13 @@
- type: Clothing
sprite: Clothing/Eyes/Hud/medsec.rsi
- type: ShowSecurityIcons
- type: ClothingGrantComponent # Sirena-Edit's-Start
component:
- type: ShowHealthBars
damageContainer: Biological
- type: FlashImmunity
- type: EyeProtection
protectionTime: 5

- type: entity
parent: ClothingEyesBase
Expand Down Expand Up @@ -199,4 +210,8 @@
sprite: Clothing/Eyes/Hud/synd.rsi
- type: ShowSyndicateIcons
- type: ShowSecurityIcons
- type: ClothingGrantComponent # Sirena-Edit's-Start
component:
- type: ShowHealthBars
damageContainer: Biological

2 changes: 1 addition & 1 deletion Resources/Prototypes/Entities/Structures/Power/apc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
graph: APC
node: apc
- type: PowerNetworkBattery
maxSupply: 15000
maxSupply: 50000
maxChargeRate: 5000
supplyRampTolerance: 1000
supplyRampRate: 500
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Entities/Structures/Power/smes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
voltage: High
node: input
- type: PowerNetworkBattery
maxSupply: 200000
maxSupply: 400000
maxChargeRate: 5000
supplyRampTolerance: 5000
supplyRampRate: 1000
Expand Down
4 changes: 2 additions & 2 deletions Resources/Prototypes/Entities/Structures/Power/substation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
- type: BatteryDischarger
voltage: Medium
- type: PowerNetworkBattery
maxSupply: 200000
maxSupply: 400000
maxChargeRate: 5000
supplyRampTolerance: 5000
supplyRampRate: 1000
Expand Down Expand Up @@ -184,7 +184,7 @@
- type: BatteryDischarger
voltage: Medium
- type: PowerNetworkBattery
maxSupply: 150000
maxSupply: 300000
maxChargeRate: 5000
supplyRampTolerance: 5000
supplyRampRate: 1000
Expand Down
2 changes: 1 addition & 1 deletion Resources/Prototypes/Roles/Jobs/Security/brigmedic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
back: ClothingBackpackBrigmedicFilled
shoes: ClothingShoesColorRed
gloves: ClothingHandsGlovesNitrile
eyes: ClothingEyesHudMedical
eyes: ClothingEyesHudMedSec
head: ClothingHeadHatBeretBrigmedic
id: BrigmedicPDA
ears: ClothingHeadsetBrigmedic
Expand Down

0 comments on commit 3f82c01

Please sign in to comment.