Skip to content

Commit

Permalink
TODO: stop taking on enormous projects when tired
Browse files Browse the repository at this point in the history
  • Loading branch information
amylizzle committed Feb 17, 2025
1 parent 9138e9c commit 3d37193
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 9 deletions.
25 changes: 25 additions & 0 deletions OpenDreamRuntime/Objects/Types/DreamObjectParticles.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using OpenDreamRuntime.Procs;
using OpenDreamRuntime.Rendering;
using OpenDreamShared.Dream;
using OpenDreamShared.Rendering;
using Robust.Shared.Map;

namespace OpenDreamRuntime.Objects.Types;

public sealed class DreamObjectParticles : DreamObject {
public EntityUid Entity = EntityUid.Invalid;
public DreamParticlesComponent ParticlesComponent;

public DreamObjectParticles(DreamObjectDefinition objectDefinition) : base(objectDefinition) {
Entity = EntityManager.SpawnEntity(null, new MapCoordinates(0, 0, MapId.Nullspace)); //spawning an entity in nullspace means it never actually gets sent to any clients until it's placed on the map, or it gets a PVS override
ParticlesComponent = EntityManager.AddComponent<DreamParticlesComponent>(Entity);
//populate component with settings from type
//do set/get var to grab those also
//check if I need to manually send update events to the component?
//add entity array to appearance objects
//collect entities client-side for the rendermetadata
//idk I guess bodge generators right now?
//set up a special list type on /atom for /particles

}
}
20 changes: 11 additions & 9 deletions OpenDreamShared/Rendering/DreamParticlesComponent.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

using System.Numerics;
using OpenDreamShared.Dream;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Maths;
Expand All @@ -11,16 +12,16 @@ namespace OpenDreamShared.Rendering;

[NetworkedComponent]
public abstract partial class SharedDreamParticlesComponent : Component {
//The width and height of the drawing surface for the particles - this is the size of the texture that the particles are drawn on.
[ViewVariables(VVAccess.ReadWrite)] public int Width = 640;
[ViewVariables(VVAccess.ReadWrite)] public int Height = 480;
//Maximum number of particles in this system
[ViewVariables(VVAccess.ReadWrite)] public int Count = 1000;
//Maximum number of particles spawned per second
[ViewVariables(VVAccess.ReadWrite)] public float Spawning = 100;
//Texture that the particles have. This is a list of paths to textures, and the particle system will randomly choose one of them for each particle. If blank, the particle will be a 1px white dot.
[ViewVariables(VVAccess.ReadWrite)] public ResPath[] TextureList = [];
//Maximum lifespan of the partcles in seconds
[ViewVariables(VVAccess.ReadWrite)] public Vector3 Bound1;
[ViewVariables(VVAccess.ReadWrite)] public Vector3 Bound2;
[ViewVariables(VVAccess.ReadWrite)] public Vector3 Gravity;
[ViewVariables(VVAccess.ReadWrite)] public Color[] Gradient = [];
[ViewVariables(VVAccess.ReadWrite)] public Matrix3x2 Transform;
[ViewVariables(VVAccess.ReadWrite)] public ImmutableAppearance[] TextureList = [];
[ViewVariables(VVAccess.ReadWrite)] public float LifespanHigh;
[ViewVariables(VVAccess.ReadWrite)] public float LifespanLow;
[ViewVariables(VVAccess.ReadWrite)] public ParticlePropertyType LifespanType;

Check failure on line 27 in OpenDreamShared/Rendering/DreamParticlesComponent.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The type or namespace name 'ParticlePropertyType' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 27 in OpenDreamShared/Rendering/DreamParticlesComponent.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'ParticlePropertyType' could not be found (are you missing a using directive or an assembly reference?)
Expand All @@ -30,9 +31,7 @@ public abstract partial class SharedDreamParticlesComponent : Component {
[ViewVariables(VVAccess.ReadWrite)] public int FadeOutHigh = 0;
[ViewVariables(VVAccess.ReadWrite)] public int FadeOutLow = 0;
[ViewVariables(VVAccess.ReadWrite)] public ParticlePropertyType FadeOutType;

Check failure on line 33 in OpenDreamShared/Rendering/DreamParticlesComponent.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The type or namespace name 'ParticlePropertyType' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 33 in OpenDreamShared/Rendering/DreamParticlesComponent.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'ParticlePropertyType' could not be found (are you missing a using directive or an assembly reference?)
//Color of the particles. This can either be a list of a colours, or a gradient that the particles will interpolate between over their lifespan.
[ViewVariables(VVAccess.ReadWrite)] public Color[] ColorList = [];
//Starting position of the particles. X,Y,Z. The Z co-ordinate determines layering order.

[ViewVariables(VVAccess.ReadWrite)] public Vector3 SpawnPositionHigh;
[ViewVariables(VVAccess.ReadWrite)] public Vector3 SpawnPositionLow;
[ViewVariables(VVAccess.ReadWrite)] public ParticlePropertyType SpawnPositionType;

Check failure on line 37 in OpenDreamShared/Rendering/DreamParticlesComponent.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The type or namespace name 'ParticlePropertyType' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 37 in OpenDreamShared/Rendering/DreamParticlesComponent.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'ParticlePropertyType' could not be found (are you missing a using directive or an assembly reference?)
Expand All @@ -44,6 +43,9 @@ public abstract partial class SharedDreamParticlesComponent : Component {
[ViewVariables(VVAccess.ReadWrite)] public Vector3 AccelerationHigh;
[ViewVariables(VVAccess.ReadWrite)] public Vector3 AccelerationLow;
[ViewVariables(VVAccess.ReadWrite)] public ParticlePropertyType AccelerationType;

Check failure on line 45 in OpenDreamShared/Rendering/DreamParticlesComponent.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The type or namespace name 'ParticlePropertyType' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 45 in OpenDreamShared/Rendering/DreamParticlesComponent.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'ParticlePropertyType' could not be found (are you missing a using directive or an assembly reference?)
[ViewVariables(VVAccess.ReadWrite)] public Vector3 FrictionHigh;
[ViewVariables(VVAccess.ReadWrite)] public Vector3 FrictionLow;
[ViewVariables(VVAccess.ReadWrite)] public ParticlePropertyType FrictionType;

Check failure on line 48 in OpenDreamShared/Rendering/DreamParticlesComponent.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The type or namespace name 'ParticlePropertyType' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 48 in OpenDreamShared/Rendering/DreamParticlesComponent.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'ParticlePropertyType' could not be found (are you missing a using directive or an assembly reference?)
//Scaling applied to the particles in (x,y)
[ViewVariables(VVAccess.ReadWrite)] public Vector2 ScaleHigh;
[ViewVariables(VVAccess.ReadWrite)] public Vector2 ScaleLow;
Expand Down

0 comments on commit 3d37193

Please sign in to comment.