Fix the flashlight's power bar and status with no battery (#1862)

Co-authored-by: Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
This commit is contained in:
DrSmugleaf
2020-08-23 13:19:40 +02:00
committed by GitHub
parent a4a25a9975
commit 814daaba4c
3 changed files with 17 additions and 4 deletions

View File

@@ -13,7 +13,10 @@ namespace Content.Client.GameObjects.Components
[RegisterComponent]
public sealed class HandheldLightComponent : SharedHandheldLightComponent, IItemStatus
{
private bool _hasCell;
[ViewVariables] public float? Charge { get; private set; }
[ViewVariables] protected override bool HasCell => _hasCell;
public Control MakeControl()
{
@@ -26,6 +29,7 @@ namespace Content.Client.GameObjects.Components
return;
Charge = cast.Charge;
_hasCell = cast.HasCell;
}
private sealed class StatusControl : Control