Skip to content

Commit 10444f5

Browse files
committed
chore: Move defaults to module constructors
1 parent 94707cf commit 10444f5

File tree

8 files changed

+43
-16
lines changed

8 files changed

+43
-16
lines changed

Source/RocketSoundEnhancement/PartModules/RSE_Coupler.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@ public class RSE_Coupler : RSE_Module
1111
private bool isDecoupler;
1212
private bool hasDecoupled;
1313

14+
public RSE_Coupler()
15+
{
16+
EnableLowpassFilter = true;
17+
EnableDistortionFilter = true;
18+
}
19+
1420
public override void OnStart(StartState state)
1521
{
1622
if (state == StartState.Editor || state == StartState.None)
1723
return;
1824

19-
EnableLowpassFilter = true;
20-
EnableDistortionFilter = true;
2125
base.OnStart(state);
2226

2327
if(part.GetComponent<ModuleDecouplerBase>()) {

Source/RocketSoundEnhancement/PartModules/RSE_Engines.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,18 @@ public class RSE_Engines : RSE_Module
1212
public Dictionary<string, int> sharedSoundLayers = new Dictionary<string, int>();
1313
private List<ModuleEngines> engineModules = new List<ModuleEngines>();
1414

15-
public override void OnStart(StartState state)
15+
public RSE_Engines()
1616
{
17-
if(state == StartState.Editor || state == StartState.None)
18-
return;
19-
2017
EnableLowpassFilter = true;
2118
EnableCombFilter = true;
2219
EnableDistortionFilter = true;
20+
}
21+
22+
public override void OnStart(StartState state)
23+
{
24+
if (state == StartState.Editor || state == StartState.None)
25+
return;
26+
2327
base.OnStart(state);
2428

2529
var soundLayersCache = new HashSet<string>();

Source/RocketSoundEnhancement/PartModules/RSE_KerbalEVA.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@ namespace RocketSoundEnhancement.PartModules
55
{
66
public class RSE_KerbalEVA : RSE_Module
77
{
8+
public RSE_KerbalEVA()
9+
{
10+
EnableLowpassFilter = true;
11+
}
12+
813
public override void OnStart(StartState state)
914
{
1015
if (state == StartState.Editor || state == StartState.None)
1116
return;
1217

13-
EnableLowpassFilter = true;
1418
base.OnStart(state);
1519

1620
Initialized = true;

Source/RocketSoundEnhancement/PartModules/RSE_Module.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,5 @@ public override void OnLoad(ConfigNode node)
353353
.PartConfigNode;
354354
}
355355
}
356-
357356
}
358357
}

Source/RocketSoundEnhancement/PartModules/RSE_RCS.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,17 @@ public class RSE_RCS : RSE_Module
77
{
88
private ModuleRCSFX moduleRCSFX;
99

10+
public RSE_RCS()
11+
{
12+
EnableLowpassFilter = true;
13+
}
14+
15+
1016
public override void OnStart(StartState state)
1117
{
1218
if (state == StartState.Editor || state == StartState.None)
1319
return;
1420

15-
EnableLowpassFilter = true;
1621
base.OnStart(state);
1722

1823
moduleRCSFX = part.Modules.GetModule<ModuleRCSFX>();

Source/RocketSoundEnhancement/PartModules/RSE_RotorEngines.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,18 @@ public class RSE_RotorEngines : RSE_Module
2424
private ModuleResourceIntake resourceIntake;
2525
private int childPartsCount = 0;
2626

27+
public RSE_RotorEngines()
28+
{
29+
EnableLowpassFilter = true;
30+
EnableCombFilter = true;
31+
EnableDistortionFilter = true;
32+
}
33+
2734
public override void OnStart(StartState state)
2835
{
2936
if(state == StartState.Editor || state == StartState.None)
3037
return;
3138

32-
EnableLowpassFilter = true;
33-
EnableCombFilter = true;
34-
EnableDistortionFilter = true;
3539
base.OnStart(state);
3640

3741
rotorModule = part.GetComponent<ModuleRoboticServoRotor>();

Source/RocketSoundEnhancement/PartModules/RSE_Wheels.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ public class RSE_Wheels : RSE_Module
2323
private float wheelSpeed = 0;
2424
private float slipDisplacement = 0;
2525

26+
public RSE_Wheels()
27+
{
28+
EnableLowpassFilter = true;
29+
}
30+
2631
public override void OnStart(StartState state)
2732
{
2833
if (state == StartState.Editor || state == StartState.None)
2934
return;
3035

31-
EnableLowpassFilter = true;
3236
base.OnStart(state);
3337

3438
if (PartConfigNode.HasNode("Motor"))

Source/RocketSoundEnhancement/PartModules/ShipEffectsCollisions.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,16 @@ public class ShipEffectsCollisions : RSE_Module
2121
private CollidingObject collidingObject;
2222
private CollisionType collisionType;
2323

24+
public ShipEffectsCollisions()
25+
{
26+
PrepareSoundLayers = false;
27+
EnableLowpassFilter = true;
28+
}
29+
2430
public override void OnStart(StartState state)
2531
{
2632
if (state == StartState.Editor || state == StartState.None)
2733
return;
28-
29-
PrepareSoundLayers = false;
30-
EnableLowpassFilter = true;
3134
base.OnStart(state);
3235

3336
foreach (var node in PartConfigNode.GetNodes())

0 commit comments

Comments
 (0)