From ae92e313beda3205ec0499ad76c41536e70106ed Mon Sep 17 00:00:00 2001 From: IbanPlay <56191483+IbanPlay@users.noreply.github.com> Date: Thu, 6 Jan 2022 23:08:55 +0100 Subject: [PATCH] Particle cap config --- CalamityConfig.cs | 8 ++++++++ Particles/GeneralParticleHandler.cs | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CalamityConfig.cs b/CalamityConfig.cs index 4a38eca484..e8b9591f41 100644 --- a/CalamityConfig.cs +++ b/CalamityConfig.cs @@ -30,6 +30,14 @@ namespace CalamityMod [Tooltip("Enables rendering afterimages for Calamity NPCs, projectiles, etc.\nDisable to improve performance.")] public bool Afterimages { get; set; } + [Label("Maximum particles")] + [BackgroundColor(192, 54, 64, 192)] + [SliderColor(224, 165, 56, 128)] + [Range(0, 1000)] + [DefaultValue(500)] + [Tooltip("Sets the maximum of particle effects that can exist at once.\nParticles are separate from dust and gores.\nTurn down to improve performance.")] + public int ParticleLimit { get; set; } + [Label("Disable Screenshakes")] [BackgroundColor(192, 54, 64, 192)] [DefaultValue(false)] diff --git a/Particles/GeneralParticleHandler.cs b/Particles/GeneralParticleHandler.cs index 52788d3e79..a0beecd252 100644 --- a/Particles/GeneralParticleHandler.cs +++ b/Particles/GeneralParticleHandler.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Particles /// This is the maximum of particles allowed. Particles marked as important may replace nonimportant particles when the cap is reached /// // May be a good idea to make this into a config option - private static readonly int particleCap = 500; + private static readonly int particleCap = CalamityConfig.Instance.ParticleLimit; private static Particle[] particles; private static int nextVacantIndex;