@@ -37,6 +37,7 @@ public class SEMaster : MonoBehaviour
3737 FXGroup dockedGroup = new FXGroup ( "DockFXGroup" ) ;
3838 FXGroup undockedGroup = new FXGroup ( "DockFXGroup" ) ;
3939
40+ #if false
4041 //Settings
4142 public float masterVolume = 1f ;
4243 public float rVolCtrl = 1f ;
@@ -48,7 +49,7 @@ public class SEMaster : MonoBehaviour
4849
4950 public float resistMultiplier = 1.0f ;
5051 public float reEntryMultiplier = 8.0f ;
51-
52+ #endif
5253 //sets
5354 bool rumbleSet ;
5455 bool smallRattlesSet ;
@@ -83,8 +84,10 @@ public class SEMaster : MonoBehaviour
8384 float counter = 0 ;
8485
8586 bool doEngineThrust ;
87+ #if false
8688 bool onlyIVA = true ;
8789 bool onlyIfCrewed = true ;
90+ #endif
8891
8992 void Start ( )
9093 {
@@ -93,8 +96,9 @@ void Start()
9396 return ;
9497
9598 LoadGroups ( ) ;
96-
99+ #if false
97100 LoadSettings ( ) ;
101+ #endif
98102
99103 GameEvents . onPartCouple . Add ( this . onVesselDock ) ;
100104 GameEvents . onPartUndock . Add ( this . onVesselUndock ) ;
@@ -118,7 +122,7 @@ void LoadGroups()
118122 dockedSet = createGroup ( dockedGroup , vessel , dockedClip , false , true ) ;
119123 undockedSet = createGroup ( undockedGroup , vessel , undockedClip , false , true ) ;
120124 }
121-
125+ #if false
122126 void LoadSettings ( )
123127 {
124128 bool settingsRead = false ;
@@ -158,6 +162,7 @@ void LoadSettings()
158162 //break;
159163 }
160164 }
165+ #endif
161166
162167 public bool createGroup ( FXGroup group , Vessel vessel , string clip , bool loop , bool fxBypass )
163168 {
@@ -185,7 +190,7 @@ void SoundFX(FXGroup fx, float volume, float volCtrl, float spread, bool play)
185190 if ( ! gamePaused && ! fx . audio . isPlaying && play == true )
186191 {
187192 fx . audio . Play ( ) ;
188- fx . audio . volume = ( Mathf . Clamp ( volume , 0 , 1f ) * volCtrl ) * masterVolume ;
193+ fx . audio . volume = ( Mathf . Clamp ( volume , 0 , 1f ) * volCtrl ) * HighLogic . CurrentGame . Parameters . CustomParams < SE > ( ) . masterVolume ;
189194 }
190195 else
191196 {
@@ -271,7 +276,7 @@ void Update()
271276
272277 if ( burnDownTime > 0 )
273278 {
274- vResist += ( aeroFx . FxScalar * burnDownTime * reEntryMultiplier ) ;
279+ vResist += ( aeroFx . FxScalar * burnDownTime * HighLogic . CurrentGame . Parameters . CustomParams < SE > ( ) . reEntryMultiplier ) ;
275280
276281 burnDownTime -= Time . deltaTime ;
277282 }
@@ -331,12 +336,12 @@ void Update()
331336
332337 vResist += engineAccel ;
333338
334- vResist *= resistMultiplier ;
339+ vResist *= HighLogic . CurrentGame . Parameters . CustomParams < SE > ( ) . resistMultiplier ;
335340
336341 bool isCrewed = false ;
337342
338343 //don't search if not necessary
339- if ( onlyIfCrewed )
344+ if ( HighLogic . CurrentGame . Parameters . CustomParams < SE > ( ) . OnlyIfCrewed )
340345 {
341346 foreach ( Part part in vessel . parts )
342347 {
@@ -350,12 +355,12 @@ void Update()
350355 if ( ! gamePaused )
351356 {
352357
353- if ( ( ! onlyIfCrewed || isCrewed ) && ! MapView . MapIsEnabled && ( onlyIVA == false || InternalCamera . Instance . isActive ) )
358+ if ( ( ! HighLogic . CurrentGame . Parameters . CustomParams < SE > ( ) . OnlyIfCrewed || isCrewed ) && ! MapView . MapIsEnabled && ( HighLogic . CurrentGame . Parameters . CustomParams < SE > ( ) . OnlyInIVA == false || InternalCamera . Instance . isActive ) )
354359 {
355360 //wind and pressure?
356361 if ( surfSpeed > 10 || vesselRot > 1.5f )
357362 {
358- SoundFX ( atmosphereGroup , ( ( atmDensity * surfSpeed - 10f ) / 80f ) + ( ( vesselRot - 1.5f ) / 7.0f * atmDensity ) , aVolCtrl , 90f , true ) ;
363+ SoundFX ( atmosphereGroup , ( ( atmDensity * surfSpeed - 10f ) / 80f ) + ( ( vesselRot - 1.5f ) / 7.0f * atmDensity ) , HighLogic . CurrentGame . Parameters . CustomParams < SE > ( ) . atmosphereVolume / 100f , 90f , true ) ;
359364 }
360365 else
361366 {
@@ -365,7 +370,7 @@ void Update()
365370 //dynamics
366371 if ( vResist > 0.5 )
367372 {
368- SoundFX ( smallRattlesGroup , ( vResist - 0.5f ) / 4f , rVolCtrl , 90f , true ) ;
373+ SoundFX ( smallRattlesGroup , ( vResist - 0.5f ) / 4f , HighLogic . CurrentGame . Parameters . CustomParams < SE > ( ) . rattleVolume / 100f , 90f , true ) ;
369374 }
370375 else
371376 {
@@ -374,7 +379,7 @@ void Update()
374379
375380 if ( vResist > 0.8 || vesselRot > 1.5f )
376381 {
377- SoundFX ( vibrationsGroup , ( ( vResist - 0.8f ) / 2f ) + ( ( vesselRot - 1.5f ) / 6f ) , vVolCtrl , 35f , true ) ;
382+ SoundFX ( vibrationsGroup , ( ( vResist - 0.8f ) / 2f ) + ( ( vesselRot - 1.5f ) / 6f ) , HighLogic . CurrentGame . Parameters . CustomParams < SE > ( ) . vibrationVolume / 100f , 35f , true ) ;
378383 }
379384 else
380385 {
@@ -383,7 +388,7 @@ void Update()
383388
384389 if ( vResist > 1 || vesselRot > 2.0f )
385390 {
386- SoundFX ( rumbleGroup , ( ( vResist - 1f ) / 2f ) + ( ( vesselRot - 2.0f ) / 6f ) , rmVolCtrl , 180f , true ) ;
391+ SoundFX ( rumbleGroup , ( ( vResist - 1f ) / 2f ) + ( ( vesselRot - 2.0f ) / 6f ) , HighLogic . CurrentGame . Parameters . CustomParams < SE > ( ) . rumbleVolume / 100f , 180f , true ) ;
387392 }
388393 else
389394 {
@@ -392,7 +397,7 @@ void Update()
392397
393398 if ( vResist > 4.0 )
394399 {
395- SoundFX ( bigRattlesGroup , ( vResist - 5f ) / 4f , rVolCtrl , 90f , true ) ;
400+ SoundFX ( bigRattlesGroup , ( vResist - 5f ) / 4f , HighLogic . CurrentGame . Parameters . CustomParams < SE > ( ) . rattleVolume / 100f , 90f , true ) ;
396401 }
397402 else
398403 {
@@ -401,7 +406,7 @@ void Update()
401406
402407 if ( vResist > 8.0 )
403408 {
404- SoundFX ( stressBigGroup , ( vResist - 6f ) / 6f , sVolCtrl , 90f , true ) ;
409+ SoundFX ( stressBigGroup , ( vResist - 6f ) / 6f , HighLogic . CurrentGame . Parameters . CustomParams < SE > ( ) . stressVolume / 100f , 90f , true ) ;
405410 }
406411 else
407412 {
@@ -427,11 +432,11 @@ void Update()
427432 {
428433 if ( vResist > 2.0f && vResist < 5.0 )
429434 {
430- SoundFX ( thumpLowGroup , ( vResist - 2.0f ) / 3f , tVolCtrl , 180f , true ) ;
435+ SoundFX ( thumpLowGroup , ( vResist - 2.0f ) / 3f , HighLogic . CurrentGame . Parameters . CustomParams < SE > ( ) . thumpVolume / 100f , 180f , true ) ;
431436 }
432437 if ( vResist > 4.0f && vResist < 8.0 )
433438 {
434- SoundFX ( thumpHeavyGroup , ( vResist - 4.0f ) / 4f , tVolCtrl , 180f , true ) ;
439+ SoundFX ( thumpHeavyGroup , ( vResist - 4.0f ) / 4f , HighLogic . CurrentGame . Parameters . CustomParams < SE > ( ) . thumpVolume / 100f , 180f , true ) ;
435440 }
436441 }
437442 }
0 commit comments