Power Cell Refactor (#5943)
Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
This commit is contained in:
@@ -10,6 +10,7 @@ namespace Content.Client.Entry
|
||||
"Pickaxe",
|
||||
"IngestionBlocker",
|
||||
"Interactable",
|
||||
"Charger",
|
||||
"CloningPod",
|
||||
"Destructible",
|
||||
"Temperature",
|
||||
@@ -35,11 +36,6 @@ namespace Content.Client.Entry
|
||||
"Material",
|
||||
"RangedMagazine",
|
||||
"Ammo",
|
||||
"HitscanWeaponCapacitor",
|
||||
"PowerCell",
|
||||
"PowerCellCharger",
|
||||
"PowerCellSlot",
|
||||
"WeaponCapacitorCharger",
|
||||
"AiController",
|
||||
"Computer",
|
||||
"AsteroidRock",
|
||||
|
||||
@@ -16,8 +16,6 @@ namespace Content.Client.Light.Components
|
||||
[Friend(typeof(HandheldLightSystem))]
|
||||
public sealed class HandheldLightComponent : SharedHandheldLightComponent, IItemStatus
|
||||
{
|
||||
[ViewVariables] protected override bool HasCell => Level != null;
|
||||
|
||||
public byte? Level;
|
||||
|
||||
public Control MakeControl()
|
||||
@@ -69,9 +67,6 @@ namespace Content.Client.Light.Components
|
||||
{
|
||||
base.FrameUpdate(args);
|
||||
|
||||
if (!_parent.HasCell)
|
||||
return;
|
||||
|
||||
_timer += args.DeltaSeconds;
|
||||
_timer %= TimerCycle;
|
||||
|
||||
@@ -81,7 +76,7 @@ namespace Content.Client.Light.Components
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
if (level == 0)
|
||||
if (level == 0 || level == null)
|
||||
{
|
||||
_sections[0].PanelOverride = StyleBoxUnlit;
|
||||
}
|
||||
|
||||
7
Content.Client/PowerCell/PowerCellSystem.cs
Normal file
7
Content.Client/PowerCell/PowerCellSystem.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
using Content.Shared.PowerCell;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace Content.Client.PowerCell;
|
||||
|
||||
[UsedImplicitly]
|
||||
public sealed class PowerCellSystem : SharedPowerCellSystem { }
|
||||
@@ -23,9 +23,6 @@ namespace Content.Client.Weapons.Ranged.Barrels.Components
|
||||
|
||||
private StatusControl? _statusControl;
|
||||
|
||||
[DataField("cellSlot", required: true)]
|
||||
public ItemSlot CellSlot = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Count of bullets in the magazine.
|
||||
/// </summary>
|
||||
@@ -35,18 +32,6 @@ namespace Content.Client.Weapons.Ranged.Barrels.Components
|
||||
[ViewVariables]
|
||||
public (int count, int max)? MagazineCount { get; private set; }
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
EntitySystem.Get<ItemSlotsSystem>().AddItemSlot(Owner, $"{Name}-powercell-container", CellSlot);
|
||||
}
|
||||
|
||||
protected override void OnRemove()
|
||||
{
|
||||
base.OnRemove();
|
||||
EntitySystem.Get<ItemSlotsSystem>().RemoveItemSlot(Owner, CellSlot);
|
||||
}
|
||||
|
||||
public override void HandleComponentState(ComponentState? curState, ComponentState? nextState)
|
||||
{
|
||||
base.HandleComponentState(curState, nextState);
|
||||
|
||||
Reference in New Issue
Block a user