Skip to content

Commit

Permalink
headachee
Browse files Browse the repository at this point in the history
  • Loading branch information
amylizzle committed Feb 3, 2025
1 parent 8977b23 commit 2263646
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;

namespace Robust.Shared.GameObjects;

[RegisterComponent, NetworkedComponent]
public sealed partial class ParticlesComponent : SharedParticlesComponent {
public ParticleSystem? particlesSystem;
}
5 changes: 4 additions & 1 deletion Robust.Client/GameObjects/EntitySystems/ParticlesSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Robust.Client.GameObjects
public sealed class ParticlesSystem : SharedParticlesSystem
{
[Dependency] private readonly ParticlesManager _particlesManager = default!;
protected override void OnParticlesComponentGetState(EntityUid uid, ParticlesComponent component, ref ComponentGetState args)
protected override void OnParticlesComponentGetState(EntityUid uid, SharedParticlesComponent component, ref ComponentGetState args)
{
//do a lookup for some yaml thing or some such based on particle type
ParticleSystemArgs particleSystemArgs = new(
Expand All @@ -27,6 +27,9 @@ protected override void OnParticlesComponentGetState(EntityUid uid, ParticlesCom
particleSystemArgs.Acceleration = (float lifetime) => new Vector3(lifetime);
particleSystemArgs.SpawnPosition = () => new Vector3(new Random().NextFloat()*200, 0, 0);
particleSystemArgs.Color = (float lifetime) => Color.Red;

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

}
}
}
2 changes: 1 addition & 1 deletion Robust.Server/GameObjects/EntitySystems/ParticlesSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Robust.Server.GameObjects;

public sealed class ParticlesSystem : SharedParticlesSystem
{
protected override void OnParticlesComponentGetState(EntityUid uid, ParticlesComponent component, ref ComponentGetState args)
protected override void OnParticlesComponentGetState(EntityUid uid, SharedParticlesComponent component, ref ComponentGetState args)
{

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
namespace Robust.Shared.GameObjects;

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

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

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

0 comments on commit 2263646

Please sign in to comment.