change components, remake system
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
using Content.Shared.Weapons.Ranged.Events;
|
||||
|
||||
namespace Content.Shared._White.WeaponModules;
|
||||
|
||||
public abstract class SharedWeaponModulesSystem : EntitySystem
|
||||
{
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<WeaponModulesComponent, GunMuzzleFlashAttemptEvent>(OnMuzzleFlashEvent);
|
||||
}
|
||||
|
||||
private void OnMuzzleFlashEvent(EntityUid weapon, WeaponModulesComponent component, ref GunMuzzleFlashAttemptEvent args)
|
||||
{
|
||||
args.Cancelled = component.UseEffect;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared._White.WeaponModules;
|
||||
|
||||
/// <summary>
|
||||
/// Base Module Component
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
public partial class WeaponModulesComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField]
|
||||
public List<EntityUid> Modules = new();
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
|
||||
public bool UseEffect;
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum ModuleVisualState : byte
|
||||
{
|
||||
Module
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum Modules : byte
|
||||
{
|
||||
Light
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Client._White.WeaponsModules;
|
||||
|
||||
/// <inheritdoc/>
|
||||
[RegisterComponent]
|
||||
public sealed partial class WeaponModulesVisualsComponent : Component
|
||||
{
|
||||
[DataField] public string? state;
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum ModuleVisualState : byte
|
||||
{
|
||||
Module
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum Modules : byte
|
||||
{
|
||||
Light
|
||||
}
|
||||
Reference in New Issue
Block a user