Skip to content

Commit

Permalink
Added option to toggle saber clash glow
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadnix-was-taken committed Sep 28, 2020
1 parent df6e6ae commit f92e61e
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 5 deletions.
13 changes: 13 additions & 0 deletions ParticleOverdrive/Misc/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,19 @@ internal static float ClashParticleLifetimeMultiplier
}
}

static readonly string clashGlow = "ClashGlow";
internal static bool ClashGlow
{
get
{
return config.GetBool(sectionParticles, clashGlow, true, true);
}
set
{
config.SetBool(sectionParticles, clashGlow, value);
}
}

static readonly string dustParticles = "DustParticles";
internal static bool DustParticles
{
Expand Down
5 changes: 4 additions & 1 deletion ParticleOverdrive/Patches/SaberClashEffectStart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ internal static void SaberClashEffectStartPostfix(ref SaberClashEffect __instanc
ParticleSystem.MainModule glowMain = glowPS.main;
ParticleSystem.MainModule sparkleMain = sparklePS.main;

glowMain.maxParticles = int.MaxValue;
if (!Plugin.ClashGlow)
{
glowMain.startLifetimeMultiplier = 0;
}

sparkleEM.rateOverDistanceMultiplier = sparkleEM.rateOverDistanceMultiplier * Plugin.ClashParticleMultiplier;
sparkleEM.rateOverTimeMultiplier = sparkleEM.rateOverTimeMultiplier * Plugin.ClashParticleMultiplier;
Expand Down
4 changes: 3 additions & 1 deletion ParticleOverdrive/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public class Plugin
public static float SlashParticleLifetimeMultiplier;
public static float ExplosionParticleLifetimeMultiplier;
public static float ClashParticleLifetimeMultiplier;
public static float SlashParticleSpeedMultiplier;
//public static float SlashParticleSpeedMultiplier;
public static bool ClashGlow;
public static bool RainbowParticles;

[Init]
Expand All @@ -66,6 +67,7 @@ public void LoadConfig()
ExplosionParticleLifetimeMultiplier = Config.ExplosionParticleLifetimeMultiplier;
ClashParticleLifetimeMultiplier = Config.ClashParticleLifetimeMultiplier;
//SlashParticleSpeedMultiplier = Config.SlashParticleSpeedMultiplier;
ClashGlow = Config.ClashGlow;
RainbowParticles = Config.RainbowParticles;
}

Expand Down
7 changes: 4 additions & 3 deletions ParticleOverdrive/UI/POUI.bsml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</horizontal>

<!--World Particles-->
<settings-submenu text='&#62; World Particles...' hover-hint='Enable/Disable world particles and camera noise.'>
<settings-submenu text='&#62; World Particles...'>
<settings-container>
<bool-setting text='Camera Noise' value='cameraNoiseEnable'></bool-setting>
<bool-setting text='Global Dust Particles' value='dustParticleEnable'></bool-setting>
Expand All @@ -14,7 +14,7 @@
</settings-submenu>

<!--Note Cut Particles-->
<settings-submenu text='&#62; Note Cut Particles...' hover-hint='Modify or disable note cut particles.'>
<settings-submenu text='&#62; Note Cut Particles...'>
<settings-container>
<list-setting text='Slash Particles' value='slashParticleChoice' choices='slashParticleChoices' formatter='multiplierFormatter'></list-setting>
<list-setting text='Slash Particle Lifetime' value='slashParticleLifetimeChoice' choices='lifetimeChoices' formatter='multiplierFormatter'></list-setting>
Expand All @@ -28,10 +28,11 @@
</settings-submenu>

<!--Saber Clash Particles-->
<settings-submenu text='&#62; Saber Clash Particles...' hover-hint='Modify or disable saber clash particles.'>
<settings-submenu text='&#62; Saber Clash Particles...'>
<settings-container>
<list-setting text='Clash Particles' value='clashParticleChoice' choices='clashParticleChoices' formatter='multiplierFormatter'></list-setting>
<list-setting text='Clash Particles Lifetime' value='clashParticleLifetimeChoice' choices='lifetimeChoices' formatter='multiplierFormatter'></list-setting>
<bool-setting text='Clash Glow' value='clashGlowEnable'></bool-setting>

<clickable-text text='&#60; Back' align='Left' click-event='back' />
</settings-container>
Expand Down
11 changes: 11 additions & 0 deletions ParticleOverdrive/UI/POUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,17 @@ public float _clashParticleLifetimeMultiplier
}
}

[UIValue("clashGlowEnable")]
public bool _clashGlowEnable
{
get => Config.ClashGlow;
set
{
Plugin.ClashGlow = value;
Config.ClashGlow = value;
}
}

[UIAction("multiplierFormatter")]
public string multiplierDisplay(float multiplier)
{
Expand Down

0 comments on commit f92e61e

Please sign in to comment.