Skip to content

Commit

Permalink
oh duh
Browse files Browse the repository at this point in the history
  • Loading branch information
amylizzle committed Feb 4, 2025
1 parent 2263646 commit 9eea9ee
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Robust.Shared.GameObjects;

[RegisterComponent, NetworkedComponent]
[RegisterComponent]
public sealed partial class ParticlesComponent : SharedParticlesComponent {
public ParticleSystem? particlesSystem;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,18 @@
namespace Robust.Client.GameObjects
{
[UsedImplicitly]
public sealed class ParticlesSystem : SharedParticlesSystem
public sealed class ClientParticlesSystem : SharedParticlesSystem
{
[Dependency] private readonly ParticlesManager _particlesManager = default!;
protected override void OnParticlesComponentGetState(EntityUid uid, SharedParticlesComponent component, ref ComponentGetState args)


public override void Initialize() {
base.Initialize();
SubscribeLocalEvent<ParticlesComponent, ComponentGetState>(OnParticlesComponentGetState);
}


private void OnParticlesComponentGetState(EntityUid uid, ParticlesComponent component, ref ComponentGetState args)
{
//do a lookup for some yaml thing or some such based on particle type
ParticleSystemArgs particleSystemArgs = new(
Expand All @@ -28,7 +36,7 @@ protected override void OnParticlesComponentGetState(EntityUid uid, SharedPartic
particleSystemArgs.SpawnPosition = () => new Vector3(new Random().NextFloat()*200, 0, 0);
particleSystemArgs.Color = (float lifetime) => Color.Red;

((ParticlesComponent) component).particlesSystem = _particlesManager.CreateParticleSystem(particleSystemArgs);
component.particlesSystem = _particlesManager.CreateParticleSystem(particleSystemArgs);

}
}
Expand Down
12 changes: 0 additions & 12 deletions Robust.Server/GameObjects/EntitySystems/ParticlesSystem.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;

namespace Robust.Server.GameObjects;

public sealed class ServerParticlesSystem : SharedParticlesSystem
{

}
7 changes: 7 additions & 0 deletions Robust.Server/Graphics/ParticlesComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using Robust.Shared.GameObjects;

namespace Robust.Server.Graphics;

[RegisterComponent]
public sealed partial class ParticlesComponent : SharedParticlesComponent {
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Robust.Shared.GameObjects;

[RegisterComponent, NetworkedComponent]
[NetworkedComponent]
public abstract partial class SharedParticlesComponent : Component {
[ViewVariables] public string ParticleType;
}
7 changes: 0 additions & 7 deletions Robust.Shared/GameObjects/Systems/ParticlesComponentSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,4 @@
namespace Robust.Shared.GameObjects;

public abstract class SharedParticlesSystem : EntitySystem {

public override void Initialize() {
base.Initialize();
SubscribeLocalEvent<SharedParticlesComponent, ComponentGetState>(OnParticlesComponentGetState);
}

protected abstract void OnParticlesComponentGetState(EntityUid uid, SharedParticlesComponent component, ref ComponentGetState args);
}

0 comments on commit 9eea9ee

Please sign in to comment.